/* /transparency/ - radical cost transparency.
   Built ONLY on the watchtower tokens, so light and dark both come from the
   design system rather than from colors invented here. Every foreground /
   background pair used below was checked with a calculated WCAG ratio in BOTH
   modes; the measured numbers are in the comments. Dark mode on this site is
   html[data-mode="batman"], NOT prefers-color-scheme, so nothing here uses a
   media query for theme. */

.kc-page--cost .cst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 22px 0 8px;
}

/* Card. ink on surface = 13.42:1 light, 12.68:1 dark. */
.cst-card {
  background: var(--wt-surface);
  border: 1px solid var(--wt-rule);
  border-radius: 10px;
  padding: 18px 18px 14px;
}

/* Label. inkSoft on surface = 8.24:1 light, 9.28:1 dark. */
.cst-card__label {
  margin: 0;
  font-family: var(--wt-font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wt-ink-soft);
}

/* The figure. ink on surface = 13.42:1 light, 12.68:1 dark.
   font-variant-numeric keeps the columns of digits aligned. */
.cst-card__num {
  margin: 6px 0 12px;
  font-family: var(--wt-font-display);
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--wt-ink);
  font-variant-numeric: tabular-nums;
}

.cst-bd { margin: 0; padding: 0; list-style: none; }
.cst-bd li {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--wt-ink-soft);   /* 8.24:1 light, 9.28:1 dark on surface */
}
.cst-bd li:last-child { margin-bottom: 0; }
/* ink on surface = 13.42:1 light, 12.68:1 dark. */
.cst-bd__n { color: var(--wt-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Provenance line. inkSoft, never the quiet token, because this is the part of
   the page that has to be readable to be worth anything. */
.cst-src {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--wt-rule);
  font-size: 13px;
  line-height: 1.55;
  color: var(--wt-ink-soft);
}
.cst-src--block {
  border-top: 0;
  padding-top: 0;
  margin: 14px 0 0;
  font-size: 14px;
}
.cst-src code,
.kc-page--cost p code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--wt-chip-bg);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--wt-ink);        /* 11.07:1 light, 10.22:1 dark on chip */
  overflow-wrap: anywhere;
}

/* Tags are 7px rectangles, matching .kc-tag. The warn variant is the SAME
   rectangle: only the left rule changes, and that rule is decoration, so the
   text keeps chip-ink (8.78:1 light, 9.25:1 dark). */
.kc-page--cost .kc-tag {
  display: inline-block;
  margin-right: 6px;
  vertical-align: baseline;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.kc-tag--warn { border-left: 3px solid var(--wt-warm); }

/* Callout. The clay bar is DECORATION only: --wt-warm is 3.56:1 light and
   9.14:1 dark on the page, which clears the 3:1 non-text threshold but NOT the
   4.5:1 text one, so no text on this page is ever painted with it.
   Text is inkSoft on panelBg = 7.44:1 light, 9.10:1 dark. */
.cst-callout {
  margin: 20px 0;
  padding: 14px 16px;
  background: var(--wt-panel-bg);
  border: 1px solid var(--wt-panel-border);
  border-left: 4px solid var(--wt-warm);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--wt-ink-soft);
}

/* Wide content scrolls inside its own box; the page body never scrolls sideways. */
.cst-tblwrap { overflow-x: auto; margin: 20px 0 6px; -webkit-overflow-scrolling: touch; }

.cst-tbl {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
}
/* Caption reads as the source note for the table, so it stays inkSoft. */
.cst-tbl caption {
  caption-side: bottom;
  text-align: left;
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--wt-ink-soft);
}
.cst-tbl th,
.cst-tbl td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--wt-rule);
  color: var(--wt-ink);        /* 12.42:1 light, 14.25:1 dark on page */
}
/* The header underline carries the table's structure, so it uses the strong
   rule: 11.00:1 light, 9.97:1 dark against the page. */
.cst-tbl thead th {
  font-family: var(--wt-font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wt-ink-soft);
  border-bottom: 2px solid var(--wt-rule-strong);
  white-space: nowrap;
}
.cst-tbl tbody th { font-weight: 600; }
.cst-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cst-tbl tbody tr:last-child th,
.cst-tbl tbody tr:last-child td { border-bottom: 0; }
/* inkSoft on page = 7.62:1 light, 10.43:1 dark. */
.cst-pct { display: inline-block; margin-left: 6px; font-size: 13px; color: var(--wt-ink-soft); }

/* Per-cell row label. Hidden by default: the real <th> header does the work on
   any screen wide enough to show it. Revealed only in the narrow media query
   below, which is why this default MUST be declared before it. */
.cst-rl { display: none; }

/* Stack the table into labeled rows on narrow screens rather than forcing a
   sideways scroll on a phone. */
@media (max-width: 600px) {
  .cst-tbl { min-width: 0; }
  .cst-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .cst-tbl tbody tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--wt-rule);
  }
  .cst-tbl tbody tr:last-child { border-bottom: 0; }
  .cst-tbl tbody th {
    display: block;
    padding: 0 0 8px;
    border-bottom: 0;
    font-size: 16px;
  }
  .cst-tbl tbody td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 0;
    text-align: right;
  }
  /* The row label the clipped header would have supplied. It is real markup
     carrying a data-i18n key, NOT a CSS attr() on data-label, because the
     translator only ever rewrites keyed nodes: an attribute would have stayed
     English in all 35 other languages. aria-hidden because the real <th>
     headers are still in the accessibility tree, and a screen reader should
     hear the header once, not twice. */
  .cst-rl {
    display: block;
    font-family: var(--wt-font-ui);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--wt-ink-soft);
    text-align: left;
  }
}

/* Visible keyboard focus, on top of whatever the shell provides.
   link on page = 6.70:1 light, 9.92:1 dark, well past the 3:1 a ring owes. */
.kc-page--cost a:focus-visible {
  outline: 2px solid var(--wt-link);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .kc-page--cost * { animation: none !important; transition: none !important; }
}
