/* Design tokens shared with the other CloudSalus sites (salus.cloudsalus.com). */
:root {
  color-scheme: light dark;
  --cs-bg: #faf9fb;
  --cs-surface: #fff;
  --cs-surface-alt: #f4f2f6;
  --cs-text: #211e27;
  --cs-text-muted: #686470;
  --cs-border: #e5e2e9;
  --cs-border-strong: #cdc9d3;
  --cs-color-primary: #602888;
  --cs-color-primary-hover: #4e2170;
  /* Colour of links in body text: the dark theme needs it lighter than the primary,
     which on a dark surface stays below the 4.5:1 WCAG requires. */
  --cs-link: #602888;
  --cs-color-primary-soft: #f7f0fb;
  --cs-color-accent: #e03080;
  --cs-color-accent-soft: #fdeef5;
  --cs-success: #2e9e5b;
  --cs-success-soft: #e6f6ec;
  --cs-warning: #b06a12;
  --cs-warning-soft: #fdf3e3;
  --cs-danger: #d43549;
  --cs-danger-soft: #fdecee;
  --cs-gradient-brand: linear-gradient(135deg, #e03080, #882880, #602888);
  --cs-shadow-sm: 0 1px 2px #2a123c14;
  --cs-shadow-md: 0 4px 12px #2a123c1f;
  --cs-transition: .16s ease;
  --cs-focus-ring: 0 0 0 3px color-mix(in srgb, var(--cs-color-accent) 35%, transparent);
  --cs-radius-sm: 6px;
  --cs-radius-md: 10px;
  --cs-radius-lg: 16px;
  --cs-font-display: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cs-font-ui: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cs-font-body: "Courier Prime", "Courier New", monospace;
  --button-bg: #602888;
  --button-hover: #4e2170;
  --hero-bg: #17141c;
  --hero-text: #cdc9d3;
  --header-height: 64px;
  --gutter: 16px;
  --max-width: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cs-bg: #17141c;
    --cs-surface: #211e27;
    --cs-surface-alt: #2a262f;
    --cs-text: #f3f1f5;
    --cs-text-muted: #a49fad;
    --cs-border: #35323c;
    --cs-border-strong: #4e4a56;
    --cs-color-primary: #9d5cc0;
    --cs-color-primary-hover: #bd8dda;
    --cs-link: #c9a0e4;
    --cs-color-primary-soft: #2f2040;
    --cs-color-accent: #e64f95;
    --cs-color-accent-soft: #3c1f30;
    --cs-success: #4cc07a;
    --cs-success-soft: #16301f;
    --cs-warning: #e0a44a;
    --cs-warning-soft: #33260f;
    --cs-danger: #ef6072;
    --cs-danger-soft: #391418;
    --cs-shadow-sm: 0 1px 2px #0006;
    --cs-shadow-md: 0 4px 12px #00000073;
    --button-bg: #7c3aa4;
    --button-hover: #9d5cc0;
  }
}

* { box-sizing: border-box; }

body {
  background: var(--cs-bg);
  color: var(--cs-text);
  font-family: var(--cs-font-body);
  letter-spacing: -.02em;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--cs-font-display);
  letter-spacing: -.015em;
  color: var(--cs-text);
  overflow-wrap: break-word;
  margin: 0 0 16px;
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: clamp(30px, 7vw, 46px); }
h2 { font-size: clamp(26px, 6vw, 36px); }
h3 { font-size: clamp(19px, 4vw, 22px); }
p { margin: 0 0 16px; }
a { color: var(--cs-link); }

.container { width: 100%; max-width: var(--max-width); padding: 0 var(--gutter); margin: 0 auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.header {
  z-index: 50; background: var(--cs-surface); border-bottom: 1px solid var(--cs-border);
  font-family: var(--cs-font-ui); position: sticky; top: 0;
}
.header__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--header-height); max-width: var(--max-width);
  margin: 0 auto; padding: 0 var(--gutter);
}
.brand { display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--cs-text); }
.brand__name { font-weight: 700; font-size: 18px; letter-spacing: .02em; color: var(--cs-text); text-decoration: none; }
.brand__by { color: var(--cs-text-muted); font-size: 13px; text-decoration: none; }
.brand__by:hover { color: var(--cs-color-primary); text-decoration: underline; }
.menu { display: flex; gap: 20px; font-size: 15px; }
.menu a { color: var(--cs-text-muted); text-decoration: none; }
.menu a:hover { color: var(--cs-link); }
.menu__short { display: none; }
@media (max-width: 720px) { .menu { display: none; } }

/* Hero */
.hero {
  background: radial-gradient(circle at 85% 10%, #e0308052, transparent 45%),
              radial-gradient(circle at 10% 95%, #60288873, transparent 50%), var(--hero-bg);
  color: var(--hero-text); padding: 48px 0 56px;
}
.hero h1 { color: #fff; max-width: 20ch; }
.hero__overline {
  font-family: var(--cs-font-ui); text-transform: uppercase; letter-spacing: .08em;
  font-size: 13px; color: #e6a8c8; margin: 0 0 12px;
}
.hero__text { max-width: 62ch; font-size: 17px; }

/* Sections and surfaces */
.section { background: var(--cs-bg); padding: 48px 0; }
.section--alt { background: var(--cs-surface-alt); }
.card {
  background: var(--cs-surface); border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-lg); box-shadow: var(--cs-shadow-sm); padding: 24px;
}

/* Buttons */
.button {
  border-radius: var(--cs-radius-md); background: var(--button-bg); color: #fff;
  min-height: 48px; font-family: var(--cs-font-ui); text-align: center;
  transition: background var(--cs-transition), box-shadow var(--cs-transition), filter var(--cs-transition);
  border: 1px solid #0000; justify-content: center; align-items: center;
  padding: 10px 24px; font-size: 16px; font-weight: 600; text-decoration: none;
  display: inline-flex; cursor: pointer; gap: 8px;
}
.button:hover { background: var(--button-hover); }
.button--gradient { background: var(--cs-gradient-brand); }
.button--gradient:hover { filter: brightness(1.08); background: var(--cs-gradient-brand); }
.button--outline { background: none; border-color: var(--cs-border-strong); color: var(--cs-text); }
.button--outline:hover { background: var(--cs-color-primary-soft); }
.button--small { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.button:focus-visible, summary:focus-visible {
  /* The solid outline is the ring that is always visible; the coloured halo
     accompanies it where color-mix() is supported. Never the halo alone. */
  outline: 2px solid var(--cs-color-accent);
  outline-offset: 2px;
  box-shadow: var(--cs-focus-ring);
}
a:focus-visible { outline: 2px solid var(--cs-color-accent); outline-offset: 2px; border-radius: 2px; }

/* Copy confirmation: the text changes, and the colour confirms it at a glance. */
.button--copied, .button--copied:hover {
  background: var(--cs-success); border-color: var(--cs-success); color: #fff;
}

/* Recommendation cards */
.results { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.pick { border-top: 4px solid var(--cs-border-strong); }
.pick--everyday { border-top-color: var(--cs-success); }
.pick--hard { border-top-color: var(--cs-warning); }
.pick__role {
  font-family: var(--cs-font-ui); font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.pick--everyday .pick__role { color: var(--cs-success); }
.pick--hard .pick__role { color: var(--cs-warning); }
.pick__model { font-size: clamp(21px, 4vw, 26px); margin-bottom: 4px; }
.pick__provider { font-family: var(--cs-font-ui); font-size: 15px; color: var(--cs-text-muted); margin-bottom: 16px; }
.pick__provider strong { color: var(--cs-text); }
.pick__alternative { font-family: var(--cs-font-ui); font-size: 14px; color: var(--cs-text-muted); margin: -6px 0 14px; }
.pick__why { margin-bottom: 16px; }

.prices { display: grid; gap: 8px; margin: 0 0 16px; padding: 14px; background: var(--cs-surface-alt); border-radius: var(--cs-radius-md); }
.prices__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.prices__row--total { border-top: 1px solid var(--cs-border); padding-top: 8px; font-weight: 700; font-size: 16px; }
.prices__label { color: var(--cs-text-muted); }

.label {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--cs-font-ui);
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; line-height: 1.5;
}
.label--ok { background: var(--cs-success-soft); color: var(--cs-success); }
.label--warning { background: var(--cs-warning-soft); color: var(--cs-warning); }
.label--info { background: var(--cs-color-primary-soft); color: var(--cs-color-primary); }
.label--fee { background: var(--cs-accent-soft, var(--cs-color-accent-soft)); color: var(--cs-color-accent); }

.notice {
  border-left: 3px solid var(--cs-warning); background: var(--cs-warning-soft);
  padding: 12px 14px; border-radius: var(--cs-radius-sm); font-size: 14px; margin-bottom: 16px;
}
.notice--error { border-left-color: var(--cs-danger); background: var(--cs-danger-soft); }
.notice--neutral { border-left-color: var(--cs-border-strong); background: var(--cs-surface-alt); }

details.details { border-top: 1px solid var(--cs-border); padding-top: 12px; margin-top: 4px; }
details.details summary {
  cursor: pointer; font-family: var(--cs-font-ui); font-weight: 600; font-size: 15px;
  color: var(--cs-text); list-style: none; display: flex; align-items: center; gap: 8px;
}
details.details summary:hover { color: var(--cs-link); }
details.details summary::-webkit-details-marker { display: none; }
details.details summary::before { content: "▸"; transition: transform var(--cs-transition); }
details.details[open] summary::before { transform: rotate(90deg); }
.details__body { padding-top: 12px; font-size: 14px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--cs-font-ui); }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--cs-border); vertical-align: top; }
.table th { color: var(--cs-text-muted); font-weight: 600; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.meta { font-family: var(--cs-font-ui); font-size: 13px; color: var(--cs-text-muted); }
.list { padding-left: 20px; margin: 0 0 16px; }
.list li { margin-bottom: 6px; }

pre.code {
  background: var(--cs-surface-alt); border: 1px solid var(--cs-border); border-radius: var(--cs-radius-md);
  padding: 14px; overflow-x: auto; font-size: 13px; margin: 0 0 12px;
}

.footer { background: var(--cs-surface); border-top: 1px solid var(--cs-border); padding: 18px 0; font-family: var(--cs-font-ui); font-size: 14px; }
.footer__rows { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer a { color: var(--cs-text-muted); }

.loading { font-family: var(--cs-font-ui); color: var(--cs-text-muted); padding: 24px 0; }

/* --- Card --- */
.hero--compact { padding: 28px 0 32px; }
.hero--compact h1 { font-size: clamp(28px, 6vw, 40px); margin: 0; }
.hero--compact .hero__text { font-size: 16px; margin: 0; }

.pick__summary { font-family: var(--cs-font-ui); font-size: 17px; margin-bottom: 8px; line-height: 1.5; }
.pick__change { font-family: var(--cs-font-ui); font-size: 13px; color: var(--cs-text-muted); margin-bottom: 16px; }
.pick__change--moved {
  color: var(--cs-text-muted); font-weight: 600;
  background: var(--cs-surface-alt); border-left: 3px solid var(--cs-border-strong);
  display: block; padding: 8px 12px; border-radius: var(--cs-radius-sm);
}
.pick__when { font-size: 14px; color: var(--cs-text-muted); margin-bottom: 16px; }

/* --- Configuration row to copy --- */
.config { background: var(--cs-surface-alt); border-radius: var(--cs-radius-md); padding: 12px 14px; margin-bottom: 20px; }
.config__label { display: block; font-family: var(--cs-font-ui); font-size: 12px; color: var(--cs-text-muted); margin-bottom: 6px; }
.config__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.config__row code {
  flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-size: 13px; padding: 8px 10px; border-radius: var(--cs-radius-sm);
  background: var(--cs-surface); border: 1px solid var(--cs-border);
}

/* --- Provider comparison, in plain view --- */
.purchase__title { font-size: 15px; margin-bottom: 8px; font-family: var(--cs-font-ui); }
.comparison td, .comparison th { padding: 7px 8px; }
.comparison .meta { display: block; font-size: 11px; }
.comparison tr.chosen td { background: var(--cs-success-soft); }
.comparison tr.chosen td:first-child { border-left: 3px solid var(--cs-success); }
.purchase__note { margin: 8px 0 0; }
.purchase { margin-bottom: 8px; overflow-x: auto; }
.comparison { min-width: 420px; }

.savings {
  font-family: var(--cs-font-ui); background: var(--cs-success-soft); color: var(--cs-text);
  border-radius: var(--cs-radius-md); padding: 14px 16px; margin-top: 20px;
}

/* Command to run: the card's main action */
.config__purpose { font-family: var(--cs-font-ui); font-size: 13px; color: var(--cs-text-muted); margin: 10px 0 0; line-height: 1.6; }
.config__purpose code.key {
  font-size: 12px; padding: 2px 6px; border-radius: var(--cs-radius-sm);
  background: var(--cs-surface); border: 1px solid var(--cs-border); white-space: nowrap;
}
.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.comparison td.action { text-align: right; white-space: nowrap; }
.comparison td .meta { display: block; font-size: 11px; font-weight: 400; }
.comparison td { vertical-align: middle; }
.comparison td.nowrap { white-space: nowrap; }
.purchase__title .meta { font-weight: 400; }

/* Three steps to get started */
.steps { list-style: none; counter-reset: step; margin: 0 0 20px; padding: 14px; background: var(--cs-surface-alt); border-radius: var(--cs-radius-md); display: grid; gap: 8px; }
.step { counter-increment: step; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-family: var(--cs-font-ui); font-size: 14px; }
.step::before {
  content: counter(step); flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--cs-border-strong); color: var(--cs-text); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.step__text { flex: 1 1 260px; }
.step__code {
  flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 13px;
  padding: 7px 10px; border-radius: var(--cs-radius-sm); background: var(--cs-surface); border: 1px solid var(--cs-border);
}
.row-link { font-family: var(--cs-font-ui); font-size: 12px; margin-right: 8px; }
.alert { font-family: var(--cs-font-ui); font-size: 13px; color: var(--cs-warning); background: var(--cs-warning-soft); padding: 8px 12px; border-radius: var(--cs-radius-sm); margin: 0 0 16px; }
.steps__privacy { font-family: var(--cs-font-ui); font-size: 13px; line-height: 1.5; color: var(--cs-text-muted); margin: 0 0 16px; }
.steps__intro { font-family: var(--cs-font-ui); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.steps__note { font-family: var(--cs-font-ui); font-size: 12px; color: var(--cs-text-muted); margin: -12px 0 20px; }
.pick__summary .meta { font-size: 13px; }
.pick__summary .nowrap { white-space: nowrap; }
.pick__summary { margin-bottom: 2px; }
.pick__price { font-size: 1.3em; font-weight: 700; color: var(--cs-text); }
.pick__evidence { font-family: var(--cs-font-ui); font-size: 13px; color: var(--cs-text-muted); margin-bottom: 14px; }
.pick__evidence a { color: var(--cs-text-muted); }
.step .button { white-space: nowrap; }

/* --- Phone --- */
/* Grid columns never ask for more space than there is. */
.results { grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.results > *, .pick, .steps, .step, .purchase { min-width: 0; }
.step__text { min-width: 0; }

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  /* Monospace at this width leaves 35 characters per line: text in Inter. */
  body { font-family: var(--cs-font-ui); font-size: 15px; letter-spacing: 0; }
  .section { padding: 28px 0; }
  .results { gap: 24px; }
  .hero { padding: 28px 0 32px; }
  .card { padding: 20px 18px; border-radius: var(--cs-radius-md); }
  .list { padding-left: 18px; }

  /* Menu: below the logo, always reachable, scrolls if it does not fit. */
  .header__bar { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 6px; padding-bottom: 4px; }
  .menu {
    display: flex; width: 100%; gap: 18px; font-size: 14px; overflow-x: auto;
    padding: 2px 0 8px; scrollbar-width: none;
  }
  .menu::-webkit-scrollbar { display: none; }
  .menu a { display: inline-flex; align-items: center; min-height: 32px; white-space: nowrap; }
  .menu .lang-switch { margin-left: auto; font-weight: 600; color: var(--cs-color-primary); }
  /* Six links and the language must fit a phone without scrolling out of sight. */
  .menu__long { display: none; }
  .menu__short { display: inline; }
  @media (max-width: 400px) { .menu { gap: 12px; } }

  /* Compact notices: they inform, but must not push the action off screen. */
  .alert { font-size: 12.5px; padding: 7px 10px; line-height: 1.45; margin-bottom: 10px; }
  .pick__change--moved { display: block; border-radius: var(--cs-radius-sm); font-size: 12.5px; padding: 6px 10px; line-height: 1.45; margin-bottom: 14px; }

  /* Steps: text or command on the left, button on the same line on the right. */
  .steps { padding: 14px; gap: 12px; }
  .step { gap: 8px; }
  .step__text { flex: 1 1 0; line-height: 1.35; }
  .step__code { flex: 1 1 0; font-size: 12px; padding: 7px 8px; }
  .step .button { flex: 0 0 auto; min-height: 36px; padding: 6px 12px; }

  /* Provider comparison: every offer is a two-level row,
     provider and price on top, actions below aligned right. */
  .purchase { overflow-x: visible; }
  .comparison, .comparison tbody { display: block; min-width: 0; }
  .comparison tr {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
    padding: 10px 10px; border-bottom: 1px solid var(--cs-border);
  }
  .comparison td { display: block; padding: 0; border: 0; }
  .comparison tr.chosen td { background: none; }
  .comparison tr.chosen { background: var(--cs-success-soft); border-left: 3px solid var(--cs-success); border-radius: var(--cs-radius-sm); }
  .comparison tr.chosen td:first-child { border-left: 0; }
  .comparison td:first-child { min-width: 0; overflow-wrap: break-word; }
  .comparison td.num { font-size: 15px; text-align: right; }
  .comparison td.action {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end;
    align-items: center; gap: 8px 12px; margin-top: 6px;
  }
  .comparison td.action .button { min-height: 34px; padding: 4px 12px; font-size: 13px; }
  .comparison td.action .preview { margin: 0; }
  .comparison tr { row-gap: 0; }
  .row-link { margin-right: 0; font-size: 13px; }

  .hero__overline { font-size: 11.5px; }

  /* Long tables: every row becomes a card with its labels spelled out. */
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 10px 0; border-bottom: 1px solid var(--cs-border); }
  .table--stack td { border: 0; padding: 2px 0; text-align: left; }
  .table--stack td.num { text-align: left; }
  .table--stack td.stack__title { font-size: 15px; font-weight: 600; padding-bottom: 4px; }
  .table--stack td[data-label]::before {
    content: attr(data-label) ": "; color: var(--cs-text-muted); font-weight: 600;
  }

  .footer__rows { gap: 8px; }
}

/* --- What you are about to copy, in plain view --- */
.details--copy { border-top: 0; padding-top: 0; margin: 4px 0 0; }
.details--copy summary { font-size: 13px; font-weight: 400; }
.details--copy pre.code { margin: 8px 0 0; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.step--config { counter-increment: none; display: block; }
.step--config::before { content: none; }
.comparison tr.config-row td { padding-top: 0; }
.savings__title { font-family: var(--cs-font-ui); font-weight: 700; margin: 0 0 4px; }
.savings { margin: 0 0 20px; }
.savings--no-seller, .savings--no-evidence, .savings--no-price, .savings--unknown-model {
  background: var(--cs-surface-alt);
}

@media (max-width: 720px) {
  /* The configuration row takes the full width below the offer. */
  .comparison tr.config-row { display: block; padding: 0 10px 10px; border-bottom: 1px solid var(--cs-border); }
  .comparison tr.config-row td { display: block; }
  .details--copy pre.code { font-size: 12px; }
}

/* --- The answer, at the top --- */
.answer {
  background: var(--cs-surface); border-bottom: 1px solid var(--cs-border);
  padding: 28px 0 22px; font-family: var(--cs-font-ui);
}
.answer__title { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 10px; }
.answer__line { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.35; margin: 0 0 4px; font-weight: 600; }
.answer__date { font-size: 13px; color: var(--cs-text-muted); margin: 10px 0 14px; }

/* Method page: short blocks, two per row where there is room. */
.method { font-family: var(--cs-font-ui); }
.method h1 { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 6px; }
.method h2 { font-size: 18px; margin: 0 0 12px; }
.method .list { font-size: 15px; line-height: 1.55; }
.method__rule { font-size: 16px; line-height: 1.55; margin: 0 0 14px; }
.method .card { margin-bottom: 20px; }
.method__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 0 20px; }
.method .table { margin-bottom: 10px; }

/* Status page: the answer in one line, three numbers, the sources. */
.status { font-family: var(--cs-font-ui); }
.status h1 { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 16px; }
.status h2 { font-size: 18px; margin: 0 0 12px; }
.status .card { margin-bottom: 20px; }
.status__line { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 16px; }
.stat { display: flex; flex-direction: column; }
.stat__value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 13px; color: var(--cs-text-muted); }
.status__technical { background: var(--cs-surface); border: 1px solid var(--cs-border); border-radius: var(--cs-radius-md); padding: 14px 16px; }

/* Controls above the results: links that work without JavaScript. */
.choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.choices__label { font-size: 13px; color: var(--cs-text-muted); margin-right: 4px; }
.choice {
  display: inline-flex; align-items: center; min-height: 36px; padding: 5px 14px;
  border: 1px solid var(--cs-border-strong); border-radius: 999px; text-decoration: none;
  color: var(--cs-text); font-size: 14px; background: var(--cs-surface);
}
.choice:hover { border-color: var(--cs-color-primary); color: var(--cs-color-primary); }
.choice--active, .choice--active:hover {
  background: var(--button-bg); border-color: var(--button-bg); color: #fff; font-weight: 600;
}

/* Card: the answer first, then everything else inside a collapsible section. */
.pick__why { font-family: var(--cs-font-ui); font-size: 14px; color: var(--cs-text); margin: 0 0 14px; }
.details--actions { border-top: 1px solid var(--cs-border); }
.details--actions > summary { font-size: 14px; }

/* Preview of the text to copy: one line, inside the cell. */
.preview { display: block; margin-top: 4px; }
.preview summary {
  cursor: pointer; list-style: none; font-size: 12px; color: var(--cs-text-muted);
  font-family: var(--cs-font-ui); text-decoration: underline;
}
.preview summary::-webkit-details-marker { display: none; }
.preview summary::marker { content: ''; }
.preview summary { display: inline-block; }
.preview pre.code { margin: 6px 0 0; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; text-align: left; }

/* OpenCode Go page: one model per row, the plan against the cheapest provider. */
.plan .card { margin-bottom: 20px; overflow-x: auto; }
.plan__table td .meta { display: block; font-size: 11px; font-weight: 400; margin-top: 2px; }
.plan__table td .label { display: inline-block; }
.plan__table .plan__warn { display: table; margin-top: 4px; font-size: 11px; font-weight: 400; }
.plan .details { margin-bottom: 12px; }
.plan__title { font-size: 17px; margin: 0 0 8px; }
.plan__cards { margin-bottom: 24px; }
.plan__cards .pick__model { font-size: 26px; margin: 4px 0 6px; }
.plan__terms { font-family: var(--cs-font-ui); font-size: 13px; background: var(--cs-surface-alt); border-radius: var(--cs-radius-sm); padding: 10px 12px; }
.plan__terms p { margin: 0 0 6px; }
.plan__terms p:last-child { margin-bottom: 0; }
.plan__table code { font-size: 11px; }
.plan__table td.nowrap, .plan__table .nowrap { white-space: nowrap; }
.plan__table tr.chosen td { background: var(--cs-success-soft); }
.plan__table tr.chosen td:first-child { border-left: 3px solid var(--cs-success); }
.pick__plan { font-family: var(--cs-font-ui); font-size: 13px; margin: -8px 0 16px; }
.plan-link { font-family: var(--cs-font-ui); font-size: 14px; margin-top: 20px; text-align: center; }

/* One column below 960px: two cards side by side are cramped here. */
@media (max-width: 960px) {
  .results { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .answer { padding: 20px 0 16px; }
  .answer__title { font-size: 20px; margin-bottom: 8px; }
  /* Label on its own line, buttons wrap: every choice stays visible,
     none is cut off at the edge of a row that scrolls without saying so. */
  .choices { gap: 6px; margin-top: 12px; }
  .choices__label { flex: 0 0 100%; margin: 0 0 2px; }
  .choice { white-space: nowrap; font-size: 13px; padding: 4px 12px; min-height: 36px; }

  /* Less nesting: the content gains the width the boxes were taking. */
  .card { padding: 16px 14px; }
  .steps { padding: 12px 10px; }
  .details__body { padding-left: 0; padding-right: 0; }

  /* Full commands, over several lines, instead of truncated. */
  .step { flex-wrap: wrap; align-items: stretch; }
  .step__text { flex: 1 1 100%; }
  .step__code {
    flex: 1 1 100%; white-space: pre-wrap; word-break: break-all; overflow-x: visible;
  }
  .step .button { flex: 1 1 100%; width: 100%; justify-content: center; }
}

/* While a new choice loads, the old answer fades so it is not read as the new one. */
main[aria-busy="true"] .results, main[aria-busy="true"] .board, main[aria-busy="true"] .answer__line { opacity: 0.45; }
main .results, main .board, main .answer__line { transition: opacity 0.15s ease; }
@media (prefers-reduced-motion: reduce) { main .results, main .board, main .answer__line { transition: none; } }

/* --- Home dashboard: the finder on the left, the answer on the right --- */
.dashboard {
  --max-width: 1240px;
  padding: 28px 0 48px;
  background:
    radial-gradient(900px 520px at 0% 0%, color-mix(in srgb, var(--cs-color-primary) 11%, transparent), transparent 70%),
    radial-gradient(760px 520px at 100% 0%, color-mix(in srgb, var(--cs-color-accent) 7%, transparent), transparent 70%),
    var(--cs-bg);
}
/* Glass: translucent surfaces over the soft background, never at the cost of contrast. */
.dashboard .card {
  background: color-mix(in srgb, var(--cs-surface) 84%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: color-mix(in srgb, var(--cs-border-strong) 70%, transparent);
}
.dashboard__grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }

.finder { position: sticky; top: 16px; font-family: var(--cs-font-ui); }
.finder__title { font-size: clamp(22px, 2.4vw, 26px); margin: 0 0 8px; }
.finder .answer__line { font-size: 17px; }
.finder .answer__date { margin: 6px 0 0; }
.finder__question { font-size: 15px; margin: 22px 0 10px; }

.tasks { display: grid; gap: 8px; }
.finder .task {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px;
  border-radius: var(--cs-radius-md); white-space: normal; font-size: 15px; font-weight: 400;
  background: color-mix(in srgb, var(--cs-surface) 70%, transparent);
}
.task .icon { flex: none; color: var(--cs-color-primary); }
.task__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.task__name { font-weight: 600; }
.task__note { font-size: 13px; color: var(--cs-text-muted); line-height: 1.35; }
.task__mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--cs-border-strong); }
.finder .task.choice--active, .finder .task.choice--active:hover {
  background: var(--cs-color-primary-soft); border-color: var(--cs-color-primary); color: var(--cs-text); font-weight: 400;
}
.task.choice--active .task__mark { border-color: var(--cs-color-primary); background: var(--cs-color-primary); box-shadow: inset 0 0 0 3px var(--cs-surface); }

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px;
  border: 1px solid var(--cs-border); border-radius: var(--cs-radius-md); background: var(--cs-surface-alt);
}
.finder .segment {
  justify-content: center; text-align: center; border: 0; border-radius: var(--cs-radius-sm);
  background: none; padding: 6px 8px; font-size: 14px; white-space: normal; line-height: 1.2;
}
.finder .segment.choice--active, .finder .segment.choice--active:hover { background: var(--button-bg); color: #fff; }

.usage { margin-top: 18px; }
.usage__rows { display: grid; gap: 6px; margin: 10px 0; }
.usage__rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.usage__rows dt { color: var(--cs-text-muted); }
.usage__rows dd { margin: 0; font-variant-numeric: tabular-nums; }

.board { display: grid; gap: 20px; min-width: 0; }
.board__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; align-items: start; }
.board__row > * { min-width: 0; }
.board__title { font-family: var(--cs-font-ui); font-size: 17px; margin: 0 0 12px; }
.board__card .purchase__title { display: none; }
.pick--featured .pick__price { font-size: clamp(28px, 3.6vw, 38px); color: var(--cs-color-primary); }

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--cs-font-ui); }
.option, .option__link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.option { border: 1px solid var(--cs-border); border-radius: var(--cs-radius-md); }
.option:not(:has(.option__link)), .option__link { padding: 10px 12px; }
.option__link { flex: 1; color: inherit; text-decoration: none; border-radius: var(--cs-radius-md); }
.option__link:hover { background: var(--cs-color-primary-soft); }
.option__text { display: flex; flex-direction: column; min-width: 0; }
.option__name { font-weight: 600; }
.option__price { display: flex; flex-direction: column; align-items: flex-end; flex: none; }

@media (max-width: 960px) {
  .dashboard__grid { grid-template-columns: minmax(0, 1fr); }
  .finder { position: static; }
}
@media (max-width: 720px) {
  .dashboard { padding: 16px 0 32px; }
  .dashboard__grid { gap: 16px; }
  /* On a phone the finder stays short, so the answer is one scroll away. */
  .task__note { display: none; }
  .tasks { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
  .finder .task { min-height: 44px; padding: 8px 10px; gap: 8px; font-size: 14px; }
  .task .icon { width: 18px; height: 18px; }
  .task__mark { display: none; }
  .finder__question { margin: 16px 0 8px; }
  .finder .segment { font-size: 13px; min-height: 40px; }
}
/* In its half-width card the table fits by letting the provider column shrink. */
.board__card .purchase { overflow-x: visible; }
.board__card .comparison { min-width: 0; width: 100%; }
.board__card .comparison td:first-child { overflow-wrap: anywhere; }
.dashboard .pick--everyday { border-top-color: var(--cs-success); }
.dashboard .pick--hard { border-top-color: var(--cs-warning); }

/* Price history under the provider prices: the range switch is radios and :has(). */
.history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--cs-border); font-family: var(--cs-font-ui); }
.history__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.history__title { font-size: 14px; margin: 0; }
.history__ranges { display: flex; gap: 2px; padding: 2px; margin: 0; border: 1px solid var(--cs-border); border-radius: 999px; background: var(--cs-surface-alt); }
.history__ranges label { font-size: 12px; padding: 2px 10px; border-radius: 999px; cursor: pointer; color: var(--cs-text-muted); }
.history__ranges input:checked + label { background: var(--button-bg); color: #fff; font-weight: 600; }
.history__ranges input:focus-visible + label { outline: 2px solid var(--cs-color-accent); outline-offset: 2px; }
.history__panel { margin: 0; display: none; }
.history__panel:first-child { display: block; }
.history:has(.history__radio--3m:checked) .history__panel { display: none; }
.history:has(.history__radio--3m:checked) .history__panel--3m { display: block; }
.history:has(.history__radio--1y:checked) .history__panel { display: none; }
.history:has(.history__radio--1y:checked) .history__panel--1y { display: block; }
.history__plot svg { display: block; width: 100%; height: 110px; }
.history__area { fill: color-mix(in srgb, var(--cs-color-primary) 14%, transparent); }
.history__line { fill: none; stroke: var(--cs-color-primary); stroke-width: 2; stroke-linejoin: round; }
.history__x { display: flex; justify-content: space-between; font-size: 11px; margin-top: 4px; }
