/* The Lab's plans, drawn by src/lib/plan-cards.js on /lab and /account/plans: one look on both.
   A card is the name, the price as the one large figure, a line on who it is for, the action, then what
   the plan holds, each a title over one plain line under a hairline. Then the plans side by side, and
   the two ways to use AI. The home page's own terms: hairlines, mono figures, a small label over a
   heading, ranged left, and no pills, gradients, shadows or coloured borders. */
.pcards {
  display: grid;
  /* Four plans form balanced pairs on narrower account pages. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.pcard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px 26px 26px;
  border: 1px solid var(--quiet);
  border-radius: var(--radius-panel);
  background: var(--panel);
}
.pcard h2 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}
.pcard-price {
  margin: 14px 0 0;
  color: var(--sec);
  font-size: var(--text-md);
}
.pcard-price .mono {
  margin-right: 6px;
  color: var(--text);
  font-size: 40px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.pcard-tagline {
  margin: 10px 0 0;
  min-height: 4.5em; /* three lines, so the actions of cards side by side start level */
  color: var(--sec);
  font-size: var(--text-md);
  line-height: 1.5;
}
.pcard-action {
  margin: 18px 0 0;
  color: var(--sec);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.pcard-action .btn { width: 100%; justify-content: center; }
.pcard-welcome { margin: 12px 0 0; color: var(--sec); font-size: 14px; line-height: 1.5; }
.pcard-rows {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.pcard-rows li {
  padding: 14px 0;
  border-top: 1px solid var(--quiet);
}
.pcard-rows li:last-child { padding-bottom: 0; }
.pcard-rows b {
  display: block;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}
.pcard-rows span {
  display: block;
  margin-top: 3px;
  color: var(--sec);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* A small label over a section's heading, as the home page sets one. */
.pc-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Words for a screen reader alone: the table's empty corner, and what a check or a dash means. */
.pc-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- the plans side by side ------------------------------------------- */
.pcompare { min-width: 0; max-width: 100%; margin-top: 64px; }
.pcompare h2,
.pitch h2 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}
/* The table keeps its columns on a phone and scrolls inside its own box, never the page. Since 2026-10-19 the three
   plans fit a phone's width (the phone rules below), and the box scrolls only if a cell cannot wrap. */
/* Positioned so the words for a screen reader in its cells (.pc-hidden, absolute) are placed inside it: without it
   they escape the scrolling box, and a phone's page grew 130 pixels wider than the phone. */
.pcompare-scroll {
  position: relative;
  max-width: 100%;
  margin-top: 20px;
  overflow-x: auto;
}
.pcompare table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  table-layout: fixed; /* the plans' columns share what the first leaves equally, whatever their cells say */
  font-size: var(--text-sm);
}
.pcompare thead th {
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  text-align: left;
}
.pcompare thead th:first-child { width: 34%; padding-left: 0; }
.pcompare tbody th,
.pcompare tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--quiet);
  vertical-align: top;
  text-align: left;
  line-height: 1.5;
}
.pcompare tbody th { width: 34%; padding-left: 0; font-weight: var(--weight-regular); }
.pcompare tbody th b { display: block; color: var(--text); font-weight: var(--weight-medium); }
.pcompare tbody th span { display: block; margin-top: 2px; color: var(--sec); }
.pcompare td { color: var(--text); }
.pcompare td svg { margin-top: 2px; color: var(--accent); }
.pcompare-no { color: var(--faint); }
.pcompare-group th {
  padding-top: 30px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pcompare-group small {
  margin-left: 10px;
  color: var(--faint);
  font-size: var(--text-xs);
  letter-spacing: 0;
  text-transform: none;
}

/* --- why Etalon, above the plans on /lab (labPitch) ---------------------- */
/* Rows under a hairline, a short title over one plain line: nothing boxed, as the design asks. */
/* Under the plan cards since 2026-10-18, so the plans are in sight as the page opens (Ben). */
.pitch { min-width: 0; max-width: 100%; margin-top: 24px; }
.pitch-grid {
  display: grid;
  /* 340 and not 260 since 2026-10-19: six items in rows of four left two holes; this makes rows of three, two on a
     tablet, one on a phone. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 0 32px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.pitch-grid li { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.pitch-grid b { display: block; color: var(--text); font-size: var(--text-md); font-weight: var(--weight-medium); }
.pitch-grid span { display: block; margin-top: 6px; color: var(--sec); font-size: var(--text-sm); line-height: 1.55; }

@media (max-width: 640px) {
  .pcard { padding: 22px 18px 22px; }
  .pcard-tagline { min-height: 0; }
  .pcompare { margin-top: 48px; }
  .pitch { margin-top: 8px; }
}
/* Keep every plan visible on a phone. Four plans need more room than the former three-column offer. */
@media (max-width: 640px) {
  .pcompare table { min-width: 0; font-size: var(--text-xs); }
  .pcompare thead th { padding: 0 4px 10px; font-size: var(--text-sm); }
  .pcompare tbody th,
  .pcompare tbody td { padding: 11px 4px; overflow-wrap: anywhere; }
  .pcompare thead th:first-child,
  .pcompare tbody th { width: 28%; padding-left: 0; }
  .pcompare thead th:last-child,
  .pcompare tbody td:last-child { padding-right: 0; }
  .pcompare tbody.pc-types th { padding-left: 12px; }
}

/* --- /account/plans, since 2026-10-17, in Husky's drawing --------------------------------------------
   Your current plan, then a compact card per plan (planTile), then two folds a reader opens: Compare
   all features and How runs are counted. /lab draws none of these. */
.plans-now {
  margin-top: var(--space-6);
  padding: 20px 24px;
  border: 1px solid var(--quiet);
  border-radius: var(--radius-panel);
  background: var(--panel);
}
.plans-now-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.plans-now-head h2 { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-medium); }
/* The status is its word, on a quiet ground as the drawing has it: no dot, no colour, not uppercase. */
.plans-now-status {
  margin: 0;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--raised);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.plans-now-body { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.plans-now-name { margin: 0; color: var(--text); font-size: var(--text-xl); font-weight: var(--weight-medium); }
.plans-now-line { margin: 4px 0 0; color: var(--sec); font-size: var(--text-sm); }
.plans-now-price { margin: 0; color: var(--sec); font-size: var(--text-md); }
.plans-now-price .mono { color: var(--text); font-size: var(--text-xl); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.plans-now-note { margin: 14px 0 0; color: var(--muted); font-size: var(--text-sm); }

.account-shell > .pcards-compact { margin-top: 16px; }
/* Three side by side wherever the account column holds three of 180 pixels (from about 960 wide). */
.pcards-compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
/* Each card's parts on rows shared across the cards (a subgrid), so a line that wraps in one card
   keeps the rules, the lists and the buttons of all three level. */
.pcards-compact .pcard { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; padding: 20px; }
/* The plan a reader would move to next stands forward by its edge alone. */
.pcards-compact .pcard[data-featured] { border-color: var(--hover); }
.pcards-compact .pcard h2 { font-size: var(--text-lg); font-weight: var(--weight-medium); }
.pcards-compact .pcard-price { margin-top: 10px; }
.pcards-compact .pcard-price .mono { margin-right: 3px; font-size: 28px; }
.pcard-short { margin: 6px 0 0; color: var(--sec); font-size: var(--text-sm); }
.pcard-checks {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 12px;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--quiet);
  list-style: none;
}
.pcard-checks li { display: flex; align-items: flex-start; gap: 10px; }
.pcard-checks svg { flex: none; margin-top: 1px; color: var(--sec); }
.pcard-checks b { color: var(--text); font-size: var(--text-sm); font-weight: var(--weight-regular); }
.pcards-compact .pcard-action { margin-top: 20px; }
/* The cards answer the pointer as the folds below them do (Husky, 2026-10-17): a pixel up, the edge
   lighter, the ground a shade lighter. Half way to --raised, so a button resting on --raised inside a
   card still shows. translate, as the folds, so nothing that holds transform can pin it. */
.pcards-compact .pcard {
  transition:
    border-color var(--dur-160) var(--ease),
    background var(--dur-160) var(--ease),
    translate var(--dur-200) var(--ease-spring);
}
.pcards-compact .pcard:hover {
  border-color: var(--field);
  background: color-mix(in srgb, var(--raised) 50%, var(--panel));
  translate: 0 -1px;
}
.pcards-compact .pcard[data-featured]:hover { border-color: var(--hover); }
@media (prefers-reduced-motion: reduce) {
  .pcards-compact .pcard:hover { translate: none; }
}
/* Current plan and Included in your plan: a state in a button's place, not a link. */
.pcard-state { background: var(--raised); color: var(--muted); border-color: var(--line); cursor: default; }

.plans-fold {
  margin-top: 16px;
  border: 1px solid var(--quiet);
  border-radius: var(--radius-panel);
  background: var(--panel);
}
.plans-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  list-style: none;
  cursor: pointer;
}
.plans-fold summary::-webkit-details-marker { display: none; }
.plans-fold summary b { display: block; color: var(--text); font-size: var(--text-lg); font-weight: var(--weight-medium); }
.plans-fold summary small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--text-sm); }
.plans-fold-mark { flex: none; color: var(--sec); transition: transform var(--dur-200) var(--ease); }
.plans-fold[open] .plans-fold-mark { transform: rotate(180deg); }
.plans-fold[open] summary { border-bottom: 1px solid var(--quiet); }
/* Hover and opening, at Husky's word on 2026-10-17. A shut fold under the pointer rises a pixel, its
   edge and ground lighten, and its arrow nudges the way it will turn. Opening slides the box open
   and its rows come in one after another; shutting slides it closed. A browser without
   ::details-content opens it at once, as before. Under reduced motion nothing moves. */
.plans-fold {
  transition:
    border-color var(--dur-160) var(--ease),
    background var(--dur-160) var(--ease),
    translate var(--dur-200) var(--ease-spring);
}
.plans-fold:hover { border-color: var(--field); background: var(--raised); }
/* translate, not transform: the page's arrival (account-settle in account.css) holds transform. */
.plans-fold:not([open]):hover { translate: 0 -1px; }
.plans-fold summary b { transition: color var(--dur-120) var(--ease); }
.plans-fold-mark { transition: transform var(--dur-200) var(--ease), color var(--dur-120) var(--ease); }
.plans-fold summary:hover .plans-fold-mark { color: var(--text); transform: translateY(2px); }
.plans-fold[open] summary:hover .plans-fold-mark { transform: rotate(180deg) translateY(2px); }
@supports selector(::details-content) {
  .plans-fold { interpolate-size: allow-keywords; }
  .plans-fold::details-content {
    block-size: 0;
    overflow-y: clip;
    transition:
      block-size var(--dur-260) var(--ease),
      content-visibility var(--dur-260) allow-discrete;
  }
  .plans-fold[open]::details-content { block-size: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .plans-fold[open] .pcompare-bare,
  .plans-fold[open] .plans-rules > div { animation: plans-fold-in var(--dur-260) var(--ease) both; }
  .plans-fold[open] .plans-rules > div:nth-child(2) { animation-delay: 40ms; }
  .plans-fold[open] .plans-rules > div:nth-child(3) { animation-delay: 80ms; }
  .plans-fold[open] .plans-rules > div:nth-child(4) { animation-delay: 120ms; }
}
@media (prefers-reduced-motion: reduce) {
  .plans-fold:not([open]):hover { translate: none; }
  .plans-fold summary:hover .plans-fold-mark { transform: none; }
  .plans-fold[open] summary:hover .plans-fold-mark { transform: rotate(180deg); }
}
@keyframes plans-fold-in {
  from { opacity: 0; transform: translateY(-6px); }
}
.pcompare-bare { margin: 0; padding: 4px 24px 20px; }
.plans-rules { margin: 0; padding: 4px 24px 18px; }
.plans-rules div { padding: 14px 0; border-top: 1px solid var(--quiet); }
.plans-rules div:first-child { border-top: 0; }
.plans-rules dt { color: var(--text); font-weight: var(--weight-medium); }
.plans-rules dd { margin: 3px 0 0; color: var(--sec); font-size: var(--text-sm); }

@media (max-width: 640px) {
  .plans-now,
  .plans-fold summary { padding-inline: 18px; }
  .pcompare-bare,
  .plans-rules { padding-inline: 18px; }
}

/* --- a market class and its kinds of data (planCompare, /plan-compare.js) ---- */
/* A class's name is a button that opens the kinds of data under it; it reads as the row's title. */
.pc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.pcompare tbody th .pc-toggle b { display: inline; }
.pc-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.pc-chevron { flex: none; color: var(--sec); transition: transform 0.15s ease; }
.pc-toggle[aria-expanded="false"] .pc-chevron { transform: rotate(-90deg); }
.pcompare tbody.pc-types th { padding-left: 20px; }
.pcompare tbody.pc-types th b { font-weight: var(--weight-regular); }
@media (prefers-reduced-motion: reduce) { .pc-chevron { transition: none; } }

@media (min-width: 1200px) { .offer-page .pcards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pcards { grid-template-columns: 1fr; } }
