/* Marketing site and customer documentation.
 * Tokens and components come from /assets/theme.css; this file adds only what
 * is specific to a public page: the top navigation, the hero, the docs layout
 * and the pricing grid. */

/* ---------- top navigation ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  flex: none;
}
.navlinks {
  display: flex;
  align-items: center;
  gap: var(--s1);
  margin-left: auto;
}
.navlinks a {
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 550;
  line-height: var(--tap);
}
.navlinks a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.navlinks a[aria-current="page"] { color: var(--ink); background: var(--bg-soft); }

.nav-toggle { display: none; }

/* The links collapse into a disclosure under 860px. They are not hidden behind
 * an overlay: a panel that pushes the page down keeps the reader's place and
 * needs no focus trap to be usable with a keyboard. */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .navlinks {
    display: none;
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: var(--s3);
  }
  .navlinks a { line-height: 1.5; padding: var(--s3); }
  .topnav-inner { flex-wrap: wrap; }
  .topnav-inner.open .navlinks { display: flex; }
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(var(--s6), 9vw, 96px); }
.hero h1 { max-width: 16ch; }
.hero .lede { max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero-grid {
  display: grid;
  gap: clamp(var(--s5), 5vw, var(--s7));
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s4);
  padding: var(--s1) var(--s3);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* A terminal-looking block. Decorative chrome only -- the code inside is real
 * and copy-pasteable, because a sample that does not run is worse than none. */
.codeblock {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.codeblock-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
}
.codeblock pre { margin: 0; border: 0; border-radius: 0; background: var(--panel); font-size: 13px; }
.codeblock .tok-key { color: var(--accent); }
.codeblock .tok-str { color: var(--ok); }
.codeblock .tok-com { color: var(--ink-3); }

/* ---------- feature and pricing grids ---------- */

.feature h3 { display: flex; align-items: center; gap: var(--s2); font-size: 17px; }
.feature p { margin: 0; color: var(--ink-2); font-size: 15px; }
.feature-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  flex: none;
}

/* The homepage puts the two APIs side by side so business research and page
 * collection are easy to tell apart at a glance. */
.product-overview {
  border-block: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 42%),
    var(--panel-2);
}
.product-grid { align-items: stretch; }
.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(var(--s4), 3vw, var(--s6));
  border-top: 3px solid var(--accent);
}
.product-card-jobs { border-top-color: var(--series-2); }
.product-card-top {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.product-label {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.product-card h3 { margin: 0 0 var(--s3); font-size: clamp(22px, 3vw, 28px); }
.product-card > p { color: var(--ink-2); }
.product-points {
  list-style: none;
  margin: 0 0 var(--s5);
  padding: 0;
  color: var(--ink-2);
  font-size: 14px;
}
.product-points li { position: relative; padding: var(--s2) 0 var(--s2) var(--s5); }
.product-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 750;
}
.product-link { margin-top: auto; font-weight: 650; }
.product-link span { display: inline-block; transition: transform .15s ease; }
.product-link:hover span { transform: translateX(3px); }
.product-note {
  max-width: 84ch;
  margin: var(--s5) 0 0;
  color: var(--ink-3);
  font-size: 13px;
}

.price-card { display: flex; flex-direction: column; height: 100%; }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.price-amount {
  font-size: 34px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.price-unit { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.price-list { list-style: none; margin: var(--s4) 0; padding: 0; font-size: 14px; }
.price-list li { padding: var(--s2) 0 var(--s2) var(--s5); position: relative; color: var(--ink-2); }
.price-list li::before {
  content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700;
}
.price-card .btn { margin-top: auto; }

/* ---------- documentation layout ---------- */

.docs-shell {
  display: grid;
  gap: clamp(var(--s5), 4vw, var(--s7));
  grid-template-columns: 1fr;
  padding-block: var(--s6);
  align-items: start;
}
@media (min-width: 900px) {
  .docs-shell { grid-template-columns: 260px minmax(0, 1fr); }
  /* The tree is taller than a screen now: it scrolls on its own, beside the page. */
  .docs-nav {
    position: sticky; top: 88px;
    max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain;
    padding-right: var(--s2);
  }
}

.docs-nav h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); margin: var(--s4) 0 var(--s2);
}
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a {
  display: block;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
}
.docs-nav a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.docs-nav a[aria-current="page"] {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}

/* A page and its sections. The triangle folds them; the title still links. */
.docs-page > summary {
  display: flex; align-items: center; gap: 2px;
  list-style: none; cursor: pointer;
}
.docs-page > summary::-webkit-details-marker { display: none; }
.docs-page > summary::before {
  content: "";
  flex: none;
  width: 16px; height: 16px;
  margin-left: -4px;
  background: currentColor;
  color: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 4l4 4-4 4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 4l4 4-4 4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease;
}
.docs-page[open] > summary::before { transform: rotate(90deg); }
.docs-page > summary > a { flex: 1; min-width: 0; }

.docs-toc {
  margin: 2px 0 var(--s2) 10px !important;
  padding-left: var(--s2) !important;
  border-left: 1px solid var(--line);
}
.docs-toc ul { margin: 0 0 0 var(--s3); padding: 0; list-style: none; }
.docs-nav .docs-toc a {
  padding: 5px var(--s3);
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-3);
}
.docs-nav .docs-toc ul a { font-size: 12.5px; }
.docs-nav .docs-toc a:hover { color: var(--ink); }
/* The section being read, kept in step by site.js as the page scrolls. */
.docs-nav .docs-toc a[aria-current="location"] {
  color: var(--accent); font-weight: 600; background: var(--accent-soft);
}

.toc-code {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--accent);
  font: 650 10.5px/1.6 var(--mono);
  vertical-align: 1px;
}

/* "On this page": the sections, at the top, so finding one never needs a scroll. */
.page-toc {
  margin: var(--s5) 0 var(--s6);
  padding: var(--s4) var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.page-toc-title {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  margin: 0 0 var(--s3);
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3);
}
.page-toc-legend { font-weight: 500; letter-spacing: 0; text-transform: none; }
.page-toc ul {
  margin: 0; padding: 0; list-style: none;
  columns: 2 240px; column-gap: var(--s6);
}
.page-toc li { break-inside: avoid; padding: 3px 0; }
.page-toc li.sub { padding-left: var(--s4); font-size: 13.5px; }
.page-toc a { color: var(--ink-2); }
.page-toc li:not(.sub) > a { color: var(--ink); font-weight: 600; }
.page-toc a:hover { color: var(--accent); }
.page-toc a[aria-current="location"] { color: var(--accent); }

/* On a phone the sidebar sits above the page: keep it to the page list and let
 * "On this page" carry the sections, instead of a screen of links to scroll past. */
@media (max-width: 899px) {
  .docs-nav .docs-toc { display: none; }
  .docs-page > summary::before { display: none; }
}

/* `min-width: 0` matters: a grid child defaults to min-content width, so one
 * long <pre> would push the column wider than the viewport and bring back the
 * sideways page scroll the body rule is there to prevent. */
.docs-body { min-width: 0; max-width: 78ch; }
.docs-body h2 { margin-top: var(--s7); scroll-margin-top: 88px; }
.docs-body h3 { margin-top: var(--s5); scroll-margin-top: 88px; }
.docs-body h2:first-of-type { margin-top: var(--s4); }
.docs-body table { margin-bottom: var(--s5); }
.docs-body th { position: static; }

.method {
  display: inline-block;
  padding: 2px var(--s2);
  border-radius: 5px;
  font: 650 12px/1.5 var(--mono);
  letter-spacing: .03em;
}
.method.get  { background: var(--info-soft); color: var(--info); }
.method.post { background: var(--ok-soft);   color: var(--ok); }
.method.del  { background: var(--bad-soft);  color: var(--bad); }

.endpoint {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  margin-bottom: var(--s4);
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
}

.docs-foot {
  display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between;
  margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line);
}

/* ---------- footer ---------- */

.sitefoot {
  margin-top: var(--s8);
  padding-block: var(--s6);
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  color: var(--ink-2);
}
.sitefoot-grid {
  display: grid; gap: var(--s5);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.sitefoot h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.sitefoot ul { list-style: none; margin: 0; padding: 0; }
.sitefoot li { margin-bottom: var(--s2); }
.sitefoot-bottom {
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}
.payment-methods { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding-block: var(--s3); }
.payment-methods-label { font-size: 12px; color: var(--ink-3); }
.payment-brand-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.payment-brand-list li { display: grid; place-items: center; min-width: 48px; height: 30px; margin: 0; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.payment-brand { display: block; width: 42px; height: 22px; }
.payment-brand.visa { width: 42px; fill: #1434cb; }
.payment-brand.visa text, .payment-brand.discover text { font: italic 900 19px Arial, sans-serif; }
.payment-brand.mastercard { width: 34px; }
.payment-brand.amex { width: 39px; }
.payment-brand.amex text { fill: white; font: 800 6.5px Arial, sans-serif; letter-spacing: -.1px; }
.payment-brand.discover { width: 59px; fill: #1a1f71; }

/* ---------- signup form ---------- */

.auth-wrap { max-width: 520px; margin-inline: auto; padding-block: var(--s7); }
.auth-card { padding: clamp(var(--s5), 5vw, var(--s6)); }

/* ---------- code blocks ---------- */

/* Colours come from /code.css, which is generated from VS Code's Light+ and
 * Dark+ themes: the editor's own background, the editor's own foreground. The
 * block therefore looks like the editor in both colour schemes, instead of a
 * grey box with coloured text in it. */
.code {
  margin: 0 0 var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-fg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 34px;
  padding: 0 var(--s3);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--code-bg) 94%, var(--code-fg));
  font: 600 12px/1 var(--sans);
  color: color-mix(in srgb, var(--code-fg) 70%, var(--code-bg));
}
.code-lang { letter-spacing: .02em; }
.code .code-body {
  margin: 0;
  padding: var(--s4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--code-fg);
  font-size: 13px;
  line-height: 1.65;
  tab-size: 4;
  /* The block scrolls, not the page. */
  overflow-x: auto;
}
.code .code-body code { color: inherit; font-size: inherit; }

/* One example, several languages. Without JavaScript the panels simply stack,
 * each with its own label; site.js turns them into tabs. */
.codetabs { margin-bottom: var(--s4); }
.codetabs.js-tabs .code { margin-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.codetabs.js-tabs .code-head { display: none; }

.code-tabbar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: var(--s1) var(--s1) 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-soft);
}
.code-tab {
  min-height: 38px;
  padding: 0 var(--s4);
  border: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--ink-2);
  font: 600 13px/1 var(--sans);
  cursor: pointer;
}
.code-tab:hover { color: var(--ink); }
.code-tab[aria-selected="true"] {
  background: var(--code-bg);
  color: var(--ink);
  box-shadow: 0 -1px 0 var(--accent) inset;
}

.code-copy {
  margin-left: auto;
  align-self: center;
  min-height: 30px;
  padding: 0 var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink-2);
  font: 600 12px/1 var(--sans);
  cursor: pointer;
}
.code-copy:hover { background: var(--bg-soft); color: var(--ink); }
.code-head .code-copy { height: 24px; min-height: 24px; }

.hero-code .code, .hero-code .code-tabbar { box-shadow: var(--shadow-sm); }
/* A grid child defaults to its content's width, so one long line would push
 * the hero wider than the screen and bring back sideways page scroll. */
.hero-grid > * { min-width: 0; }

@media (max-width: 640px) {
  .code .code-body { padding: var(--s3); font-size: 12.5px; }
  .code-tab { padding: 0 var(--s3); }
}

/* ---------- tables on the public pages ----------
 * theme.css gives the control panel its dense, flat tables. The public site is
 * read rather than worked in, so its tables sit in a rounded card with a soft
 * shadow, a tinted header and roomier rows. Only site.css loads here, so the
 * admin and the portal keep their own look. */
.section .table-wrap,
.docs-body .table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: var(--s5);
}
.section .table-wrap table th,
.docs-body .table-wrap table th {
  background: linear-gradient(180deg, var(--panel-2), var(--bg-soft));
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  padding-block: var(--s4);
}
.section .table-wrap table td,
.docs-body .table-wrap table td { padding-block: 14px; }
/* The card carries the spacing now; the table's own margin would sit inside it. */
.docs-body .table-wrap table { margin-bottom: 0; }
.section .table-wrap tbody tr:nth-child(even),
.docs-body .table-wrap tbody tr:nth-child(even) { background: var(--panel-2); }
.section .table-wrap tbody tr:hover,
.docs-body .table-wrap tbody tr:hover { background: var(--accent-soft); }

/* A focused reference panel makes the long AI response field list easier to
 * scan than a plain documentation table, while staying within the shared theme
 * so it follows both light and dark mode. */
.docs-body .field-guide {
  margin-top: var(--s6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}
.field-guide-head {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: clamp(var(--s4), 3vw, var(--s6));
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%),
    linear-gradient(120deg, var(--accent-soft), var(--panel));
}
.field-guide-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font: 750 17px/1 var(--mono);
}
.field-guide-copy { min-width: 0; }
.field-guide-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
}
.docs-body .field-guide-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(19px, 2.3vw, 24px);
  letter-spacing: -.025em;
}
.field-guide-copy p {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}
.field-guide-badge {
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.docs-body .field-guide-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-x: auto;
}
.field-mode-tabbar { margin: 0; }
.field-guide-table tr[hidden] { display: none; }
.docs-body .field-guide-table { table-layout: fixed; }
.field-guide-table th:first-child,
.field-guide-table td:first-child { width: 42%; }
.docs-body .field-guide-table th {
  position: static;
  padding: 13px var(--s5);
  background: var(--panel-2);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: .09em;
}
.docs-body .field-guide-table tr.field-guide-group th {
  padding: 14px var(--s5) 10px;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, var(--accent-soft), var(--panel));
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .075em;
  text-align: left;
}
.docs-body .field-guide-table td {
  padding: 12px var(--s5);
  vertical-align: top;
  line-height: 1.55;
}
.field-guide-table td:first-child code {
  display: inline-block;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.field-guide-table td:nth-child(2) { color: var(--ink-2); }
.field-guide-table tbody tr { transition: background-color .15s ease; }
.field-guide-table tbody tr:hover { background: var(--accent-soft); }

@media (max-width: 640px) {
  .field-guide-head { align-items: flex-start; gap: var(--s3); }
  .field-guide-icon { width: 42px; height: 42px; border-radius: 13px; }
  .field-guide-badge { display: none; }
  .docs-body .field-guide-table tr {
    margin: var(--s3);
    padding: var(--s2) 0;
    border-color: var(--line-soft);
    box-shadow: var(--shadow-sm);
  }
  .docs-body .field-guide-table tr.field-guide-group {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .docs-body .field-guide-table tr.field-guide-group th {
    display: block;
    padding: var(--s3) var(--s4);
    border-top: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .docs-body .field-guide-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s1);
    padding: var(--s2) var(--s4);
    text-align: left;
  }
  .field-guide-table td:first-child code { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .field-guide-table tbody tr { transition: none; }
}

/* ---------- pricing: what it costs ---------- */
.cost-board {
  position: relative;
  margin-top: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
/* A thin band in the two package colours across the top of the card. */
.cost-board::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--series-1), var(--accent));
}
.cost-table { font-size: 15px; }
.cost-table th {
  position: static;
  padding: var(--s5) var(--s5) var(--s4);
  background: transparent;
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
}
.cost-table td {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line-soft);
}
.cost-table tbody tr { transition: background-color .15s ease; }
.cost-table tbody tr:hover { background: var(--panel-2); }
.cost-head { text-align: right; }
.cost-head .tier-chip { margin-left: auto; }
.cost-rate {
  display: block;
  margin-top: var(--s2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.cost-head-advance, .cost-table td.cost-advance { background: var(--accent-soft); }
.cost-head-premium, .cost-table td.cost-premium { background: var(--panel-2); }

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tier-chip::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.tier-regular { color: var(--series-1); background: var(--info-soft); }
.tier-advance { color: var(--accent-ink); background: linear-gradient(90deg, var(--accent), var(--series-1)); }
.tier-premium { color: var(--ink); background: var(--bg-soft); }

.cost {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
}
.cost-advance { color: var(--accent); }
.cost-premium { color: var(--ink); font-weight: 600; }

/* The bar grows with the volume on a log scale (one step per power of ten), so
 * the eye reads "ten times more" as one step rather than a sliver and a wall. */
.volume { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.volume strong { font-variant-numeric: tabular-nums; font-size: 16px; }
.volume-bar {
  display: block;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--series-1), var(--accent));
  opacity: .85;
}
.volume-1 { width: 25%; }
.volume-2 { width: 50%; }
.volume-3 { width: 75%; }
.volume-4 { width: 100%; }

.cost-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  margin: 0;
  padding: var(--s4) var(--s5);
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  color: var(--ink-2);
}
.cost-foot-item { display: inline-flex; align-items: center; gap: 6px; }
.cost-foot-item::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11px;
  font-weight: 800;
}

.estimator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: var(--s5); }
.cost-estimator { padding: var(--s5) var(--s5) 0; margin-bottom: 0; min-width: 0; }
.estimator-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.estimator-heading h3 { margin: 0 0 var(--s1); }
.estimator-heading p { margin: 0; }
.estimator-volume { font-size: clamp(22px, 4vw, 30px); line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.volume-slider { display: block; width: 100%; height: 24px; margin: var(--s4) 0 var(--s2); appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
.volume-slider::-webkit-slider-runnable-track { height: 7px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--series-1), var(--accent)); }
.volume-slider::-moz-range-track { height: 7px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--series-1), var(--accent)); }
.volume-slider::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -7px; appearance: none; border: 4px solid var(--panel); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.volume-slider::-moz-range-thumb { width: 14px; height: 14px; border: 4px solid var(--panel); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.volume-slider:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; border-radius: var(--radius-pill); }
.slider-scale { display: flex; justify-content: space-between; gap: var(--s2); color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.estimate-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-block: var(--s5); }
.estimate-cards-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.estimate-cards-three .estimate-card { flex-direction: column; align-items: flex-start; }
.estimate-card { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-width: 0; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.estimate-card > div { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); min-width: 0; }
.estimate-card .cost-rate { margin-top: 0; }
.estimate-card-advance { background: var(--accent-soft); }
.estimate-card-premium { background: var(--panel-2); }
.estimate-price { font-size: clamp(17px, 2.5vw, 22px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .estimator-grid { grid-template-columns: 1fr; }
  .cost-estimator { margin-bottom: var(--s5); }
}

@media (max-width: 640px) {
  .cost-board { border-radius: var(--radius); }
  table.cost-table tr { width: auto; margin: var(--s3); box-shadow: var(--shadow-sm); }
  table.cost-table td { width: auto; padding: var(--s2) var(--s4); }
  .cost-head-advance, .cost-table td.cost-advance,
  .cost-head-premium, .cost-table td.cost-premium { background: transparent; }
  .volume { flex-direction: row; align-items: center; min-width: 0; }
  .volume-bar { display: none; }
  .cost-estimator { padding: var(--s4) var(--s3) 0; }
  .estimate-cards, .estimate-cards-three { grid-template-columns: 1fr; }
  .estimate-card { padding: var(--s3); }
}

/* ---------- pricing: measured capacity ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  margin: var(--s5) 0;
}
.metric-card {
  position: relative;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--series-1), var(--accent));
  opacity: .7;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.metric-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.metric-value {
  margin: var(--s2) 0 var(--s1);
  font-size: 40px;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: linear-gradient(90deg, var(--accent), var(--series-1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.metric-unit {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  -webkit-text-fill-color: var(--ink-3);
  color: var(--ink-3);
}
.metric-note { margin: 0; font-size: 13px; color: var(--ink-2); }

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-value { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .metric-card, .cost-table tbody tr { transition: none; }
  .metric-card:hover { transform: none; }
}
