/* Public site base: the header and footer partials, sign-in and sign-up
   pages, billing, legal and error pages. Colours, type, spacing, radii and
   shadows come from the design tokens in /assets/tokens.css; this file only
   combines them. The landing page adds /assets/marketing.css and the legal
   pages add /legal.css. No gradients, glow or emoji; one accent colour.

   Every page links /assets/tokens.css before this file. The admin console
   (admin.html, browser-pool.html) does not use this file; it has admin.css. */

:root {
  --site-max: 1232px;
  --site-gutter: 16px;
  --site-header-h: 64px;
}
@media (min-width: 768px) { :root { --site-gutter: 24px; } }
@media (min-width: 1024px) { :root { --site-gutter: 32px; } }

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--c-canvas);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
a { color: var(--c-brand-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-brand-hover); }
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--c-focus);
}

/* ── Utilities ────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--sh-md);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Line icons from an inline sprite: 16 px, 1.5 px stroke (20 px keeps 1.5 px). */
.ic {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.ic-20 { width: 20px; height: 20px; stroke-width: 1.2; }
.wrap {
  width: 100%;
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: var(--site-gutter);
}

/* ── Brand: mark plus HTML wordmark ───────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--c-text);
  text-decoration: none;
}
.brand:hover { color: var(--c-text); }
.brand-mark { display: block; flex: none; width: 40px; height: 40px; }
.brand-name {
  overflow: hidden;
  font-family: "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-overflow: ellipsis;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
/* .btn on its own is the secondary button; .btn-secondary only names it. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--c-surface-3); color: var(--c-text); }
.btn-primary {
  border-color: var(--c-brand);
  background: var(--c-brand);
  color: var(--c-on-brand);
}
.btn-primary:hover {
  border-color: var(--c-brand-hover);
  background: var(--c-brand-hover);
  color: var(--c-on-brand);
}
.btn-primary:active { border-color: var(--c-brand-press); background: var(--c-brand-press); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-3); color: var(--c-text); }
.btn-danger { color: var(--c-danger); }
.btn-danger:hover { border-color: var(--c-danger); background: var(--c-danger-soft); color: var(--c-danger); }
.btn-sm { min-height: 32px; padding: 0 var(--sp-3); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.btn-lg { min-height: 48px; padding: 0 var(--sp-6); font-size: var(--fs-lg); }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ── Badges (subtle tints) ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  white-space: nowrap;
}
.badge-dot::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-brand { background: var(--c-brand-soft); color: var(--c-brand-text); }
.badge-success { background: var(--c-success-soft); color: var(--c-success); }
.badge-info { background: var(--c-info-soft); color: var(--c-info); }
.badge-warning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }

/* ── Check list (icon drawn with a mask, coloured by the brand token) ── */
.check-list { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 26px; }
.check-list li::before {
  content: "";
  position: absolute;
  top: calc(0.775em - 8px);
  left: 0;
  width: 16px;
  height: 16px;
  background-color: var(--c-brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

/* ── Callouts and form messages ───────────────────────────────────────── */
.callout {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  color: var(--c-text);
  font-size: var(--fs-md);
}
.callout-info { border-color: transparent; background: var(--c-info-soft); box-shadow: inset 3px 0 0 var(--c-info); }
.callout-success { border-color: transparent; background: var(--c-success-soft); box-shadow: inset 3px 0 0 var(--c-success); }
.callout-warning { border-color: transparent; background: var(--c-warning-soft); box-shadow: inset 3px 0 0 var(--c-warning); }
.callout-danger { border-color: transparent; background: var(--c-danger-soft); box-shadow: inset 3px 0 0 var(--c-danger); }
.form-error { min-height: 20px; margin: var(--sp-3) 0 0; color: var(--c-danger); font-size: var(--fs-md); }
.form-error:empty { min-height: 0; margin: 0; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-brand-text);
  font: inherit;
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-button:disabled { color: var(--c-text-3); text-decoration: none; cursor: default; }

/* ── Form controls ────────────────────────────────────────────────────── */
/* Text inputs, selects and text areas look the same on every page; labels
   are styled by .field below. */
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="hidden"])),
select,
textarea {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--c-text-3); opacity: 1; }
:is(input, select, textarea):focus-visible {
  outline: 2px solid transparent;
  border-color: var(--c-brand);
  box-shadow: var(--c-focus);
}
:is(input, select, textarea):disabled { opacity: .6; cursor: not-allowed; }
.field { display: grid; gap: 6px; }
.field label, .field-row label { margin: 0; color: var(--c-text); font-size: var(--fs-md); font-weight: var(--fw-medium); }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.field-row a { font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none; }
.field-row a:hover { text-decoration: underline; }
.field-hint { margin: 0; color: var(--c-text-3); font-size: var(--fs-sm); }

/* ── Site header (partials/site-header.html) ──────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}
.site-header-inner { display: flex; align-items: center; gap: var(--sp-8); height: var(--site-header-h); }
.site-nav { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.site-nav a {
  padding: 6px var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--c-text-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--c-surface-3); color: var(--c-text); }
.head-actions { display: flex; flex: none; align-items: center; gap: var(--sp-2); margin-left: auto; }

/* Mobile menu: a <details> element, so it works without JavaScript. */
.site-menu { display: none; }
.site-menu > summary { list-style: none; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
}
.site-menu-toggle:hover { background: var(--c-surface-3); }
.site-menu-icon { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.site-menu-icon-close, .site-menu[open] .site-menu-icon-open { display: none; }
.site-menu[open] .site-menu-icon-close { display: block; }
.site-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  max-height: calc(100vh - var(--site-header-h));
  overflow-y: auto;
  padding: var(--sp-2) var(--site-gutter) var(--sp-6);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  box-shadow: var(--sh-lg);
}
.site-menu-nav { display: grid; }
.site-menu-nav a {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.site-menu-actions { display: grid; gap: var(--sp-2); margin-top: var(--sp-5); }
@media (max-width: 960px) {
  .site-header-inner { gap: var(--sp-4); }
  .site-nav { display: none; }
  .site-menu { display: block; }
}
@media (max-width: 560px) {
  .head-actions .site-signin { display: none; }
}
@media (max-width: 400px) {
  .site-header-inner { gap: var(--sp-2); }
  .head-actions { gap: 6px; }
}
@media (max-width: 359px) {
  .head-actions .site-cta { display: none; }
}

/* ── Site footer (partials/site-footer.html) ──────────────────────────── */
.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: var(--fs-md);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-10) var(--sp-8);
  padding: var(--sp-16) 0 var(--sp-12);
}
.footer-brand .brand-mark { width: 24px; height: 24px; }
.footer-brand .brand-name { font-size: var(--fs-lg); }
.footer-brand p { max-width: 34ch; margin: var(--sp-3) 0 0; }
.footer-brand p a { color: var(--c-text-2); }
.footer-col h2 { margin: 0 0 var(--sp-3); color: var(--c-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.footer-col ul { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.footer-col a { color: var(--c-text-2); text-decoration: none; }
.footer-col a:hover, .footer-brand p a:hover { color: var(--c-text); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-8);
  padding: var(--sp-6) 0 var(--sp-10);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.footer-bottom p { margin: 0; }
.footer-disclaimer { max-width: 76ch; }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: var(--sp-12); }
}

/* ── Theme toggle (theme.js adds it to .head-actions) ─────────────────── */
.theme-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--c-surface-3); color: var(--c-text); }
.theme-toggle .theme-icon {
  display: block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 9.75A5.75 5.75 0 1 1 6.25 2.5a5.5 5.5 0 0 0 7.25 7.25Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 9.75A5.75 5.75 0 1 1 6.25 2.5a5.5 5.5 0 0 0 7.25 7.25Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
:root[data-theme="dark"] .theme-toggle .theme-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='2.75'/%3E%3Cpath d='M8 1.25v1.5M8 13.25v1.5M1.25 8h1.5M13.25 8h1.5M3.23 3.23l1.06 1.06M11.71 11.71l1.06 1.06M3.23 12.77l1.06-1.06M11.71 4.29l1.06-1.06'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='2.75'/%3E%3Cpath d='M8 1.25v1.5M8 13.25v1.5M1.25 8h1.5M13.25 8h1.5M3.23 3.23l1.06 1.06M11.71 11.71l1.06 1.06M3.23 12.77l1.06-1.06M11.71 4.29l1.06-1.06'/%3E%3C/svg%3E");
}
.theme-toggle.theme-fixed {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--z-sticky);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  box-shadow: var(--sh-xs);
}

/* ── Simple pages (billing, 404) ──────────────────────────────────────── */
.page-main { padding: var(--sp-16) 0 var(--sp-24); }
.page-eyebrow { margin: 0 0 var(--sp-2); color: var(--c-brand-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.page-title {
  margin: 0;
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-lead { max-width: 62ch; margin: var(--sp-4) 0 0; color: var(--c-text-2); font-size: var(--fs-xl); }
@media (min-width: 1024px) { .page-title { font-size: var(--fs-5xl); } }
@media (max-width: 560px) {
  .page-main { padding: var(--sp-10) 0 var(--sp-16); }
  .page-lead { font-size: var(--fs-lg); }
}

/* ── Sign-in, sign-up and password pages ──────────────────────────────── */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.auth-header { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--site-gutter); }
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--c-text-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
}
.auth-back:hover { background: var(--c-surface-3); color: var(--c-text); }
.auth-main {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--site-gutter) var(--sp-12);
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  max-width: 960px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--sh-lg);
}
.auth-card { min-width: 0; padding: var(--sp-12) var(--sp-10); }
.auth-title { margin: 0; font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: -0.015em; }
.auth-sub { margin: var(--sp-2) 0 0; color: var(--c-text-2); font-size: var(--fs-md); }
.auth-form { display: grid; gap: var(--sp-4); margin-top: var(--sp-6); }
.auth-submit { width: 100%; min-height: 44px; margin-top: var(--sp-2); font-size: var(--fs-lg); }
.auth-card .callout { margin-top: var(--sp-4); }
.auth-note { margin: var(--sp-4) 0 0; color: var(--c-text-3); font-size: var(--fs-sm); }
.auth-alt {
  margin: var(--sp-6) 0 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: var(--fs-md);
}
.auth-alt a { font-weight: var(--fw-semibold); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.auth-aside {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  min-width: 0;
  padding: var(--sp-12) var(--sp-10);
  border-left: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.auth-aside-eyebrow { margin: 0; color: var(--c-brand-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.auth-aside-title { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.auth-aside .check-list { color: var(--c-text-2); font-size: var(--fs-md); }
.auth-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-6);
  padding: var(--sp-5) var(--site-gutter) var(--sp-8);
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.auth-footer p { margin: 0; }
.auth-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.auth-footer a { color: var(--c-text-2); text-decoration: none; }
.auth-footer a:hover { color: var(--c-text); text-decoration: underline; }
@media (max-width: 860px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 480px; }
  .auth-aside { border-top: 1px solid var(--c-border); border-left: 0; }
}
@media (max-width: 480px) {
  .auth-main { padding-top: var(--sp-2); }
  .auth-card, .auth-aside { padding: var(--sp-8) var(--sp-5); }
  .auth-title { font-size: var(--fs-2xl); }
}

/* Small product sample in the sign-in side panel. */
.sample-card { margin: auto 0 0; }
.sample-card-body {
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-sm);
}
.sample-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.sample-card-title { overflow: hidden; font-size: var(--fs-md); font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; }
.sample-card-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0 0; }
.sample-card-figures div { min-width: 0; }
.sample-card-figures dt { color: var(--c-text-3); font-size: var(--fs-xs); }
.sample-card-figures dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.sample-card-note {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
}
.sample-caption { margin-top: var(--sp-2); color: var(--c-text-2); font-size: var(--fs-xs); }

/* ── Plan cards (landing pricing and the billing page) ────────────────── */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.plan-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
  padding: var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-xs);
}
.plan-card.is-highlighted { border-color: var(--c-brand); box-shadow: var(--sh-md); }
.plan-card.is-selected { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand), var(--sh-md); }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.plan-name { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.plan-tagline { margin: 0; color: var(--c-text-2); font-size: var(--fs-md); }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); margin: 0; }
.plan-amount {
  color: var(--c-text);
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.plan-interval { color: var(--c-text-2); font-size: var(--fs-md); }
.plan-card .check-list { padding-top: var(--sp-4); border-top: 1px solid var(--c-border); color: var(--c-text-2); font-size: var(--fs-md); }
.plan-card .btn { margin-top: auto; }
@media (max-width: 900px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
}

/* ── Billing page ─────────────────────────────────────────────────────── */
.billing-head { max-width: 720px; margin-bottom: var(--sp-10); }
.billing-notice { margin: 0; font-size: var(--fs-md); }
.billing-notice:not(:empty) {
  margin-top: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-info-soft);
  box-shadow: inset 3px 0 0 var(--c-info);
}
.billing-status { margin: var(--sp-4) 0 0; font-weight: var(--fw-semibold); }
.billing-status:empty { display: none; }
.billing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-8); }
.billing-actions p { margin: 0; color: var(--c-text-2); font-size: var(--fs-md); }
.billing-fineprint { max-width: 76ch; margin: var(--sp-6) 0 0; color: var(--c-text-2); font-size: var(--fs-sm); }

/* Credits (billing page): balance, top-up, prices and recent activity. */
.credits { margin-top: var(--sp-16); padding-top: var(--sp-10); border-top: 1px solid var(--c-border); }
.credits-head { max-width: 720px; margin-bottom: var(--sp-6); }
.credits-title { margin: 0; font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -0.01em; }
.credits-lead { margin: var(--sp-3) 0 0; color: var(--c-text-2); font-size: var(--fs-lg); }
.credits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.credits-grid[hidden] { display: none; }
.credits-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
  padding: var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-xs);
}
.credits-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.credits-card-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.credits-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); margin: 0; }
.credits-value {
  color: var(--c-text);
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.credits-unit { color: var(--c-text-2); font-size: var(--fs-md); }
.credits-sub { margin: 0; color: var(--c-text-2); font-size: var(--fs-sm); }
.credits-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); }
.credits-presets:empty { display: none; }
.credits-preset { flex-direction: column; gap: 2px; min-height: 56px; padding: var(--sp-2) var(--sp-3); }
.credits-preset-amount { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.credits-preset-sub { color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.credits-form { margin: 0; }
.credits-input-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.credits-input-row input { flex: 1 1 140px; min-width: 0; }
.credits-table-wrap { overflow-x: auto; }
.credits-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.credits-table th {
  padding: 0 var(--sp-3) var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: left;
}
.credits-table td { padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.credits-table tr:last-child td { border-bottom: 0; }
.credits-table .num { padding-right: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.credits-table .nowrap { white-space: nowrap; }
.credits-table .is-plus { color: var(--c-success); }
.credits-cell-sub { display: block; color: var(--c-text-3); font-size: var(--fs-xs); }
.credits-empty { color: var(--c-text-2); }
@media (max-width: 900px) {
  .credits-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .credits { margin-top: var(--sp-10); padding-top: var(--sp-8); }
  .credits-card { padding: var(--sp-5) var(--sp-4); }
  .credits-value { font-size: var(--fs-4xl); }
}

/* ── Error page (404) ─────────────────────────────────────────────────── */
.error-page { max-width: 680px; }
.error-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }
.error-help { margin: var(--sp-8) 0 0; color: var(--c-text-2); font-size: var(--fs-md); }

/* ── High contrast ────────────────────────────────────────────────────── */
@media (forced-colors: active) {
  .check-list li::before { forced-color-adjust: none; background-color: CanvasText; }
  .theme-toggle { border: 1px solid ButtonText; }
  .theme-toggle .theme-icon { forced-color-adjust: none; background-color: ButtonText; }
  .badge, .callout, .billing-notice:not(:empty) { border: 1px solid CanvasText; }
}

.brand-accent { color: var(--c-brand); }
