/* The spine of the page is a two-column trade: what you give, what you get.
   Type is the OS UI face; palette is neutral. Nothing decorative. */

/* Light is the default. Dark is expressed as token overrides only, so every
   rule below is written once and works in both. Two tokens exist purely
   because a surface must stay dark in both themes: --band for the closing CTA
   and the captured-record block, and --on-band for type sitting on it. */
:root {
  color-scheme: light;
  /* Palette (2026-09-26): white page, no grid, near-black ink, forest green
     as the working accent, burnt orange as the secondary, light grey
     surfaces with hard edges and one soft shadow. */
  --paper: #FFFFFF;
  --paper-2: #F7F7F6;
  --ink: #171A18;
  --ink-70: #5C625D;
  --ink-45: #8E948E;
  --rule: #C9CBC2;
  --rule-dark: #8E948E;
  --green: #0E684B;
  --green-hover: #0B5640;
  --green-soft: #DCEBE4;
  --orange: #D45C27;
  --gold: #B48519;
  --gold-soft: #F3E9CC;
  --red: #9C332C;
  --red-soft: #F3DCDA;
  --blue: #315D75;
  --error: var(--red);
  --ok: var(--green);
  --warn: var(--gold);
  /* Working accent (links, focus, product state) and the money accent share
     the green. The orange is for section numbers and one word in a headline. */
  --cobalt: var(--green);
  --cobalt-hover: var(--green-hover);
  --lift: var(--green-soft);
  --earn: var(--green);
  --earn-deep: var(--green);
  --accent-2: var(--orange);
  --band: #17201C;
  --on-band: #B9C2BC;
  --code: #D7E5DC;
  --shadow: 0 14px 34px rgba(22, 26, 23, 0.08);
  --shadow-soft: 0 8px 22px rgba(22, 26, 23, 0.05);
  --grid-line: transparent;

  /* Layout standard (2026-09-19). Three container widths, two text measures,
     one gutter, one breakpoint (800px). Every page container is one of these.
       --w-page   marketing sections, dashboard, trace, header, footer
       --w-prose  legal, confirmations, anything read top to bottom
       --w-form   one-task forms (device code)
     Headline caps in ch stay per component; body and lead text use the two
     measures. Inside a page every panel, card, table and list spans the
     container; only the text inside a panel takes a measure. Two tabs of one
     page must never differ in width. The 09-brand.md Layout section describes this. */
  --w-page: 1180px;
  --w-prose: 46rem;
  --w-form: 32rem;
  --measure: none;
  /* Body copy inside a marketing section runs the full container, the same
     edge as the rules and panels it sits between (Karthik, 2026-09-26). */
  --w-text: none;
  --measure-lead: none;
  --gutter: 1.75rem;
  --wrap: var(--w-page);

  /* Type. Public Sans for everything read, IBM Plex Mono for labels, numbers
     and anything that is data. Both self-hosted (fonts/, OFL). */
  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: var(--font-sans);
  --text: var(--font-sans);
  --mono: var(--font-mono);

  /* Type scale and leading (shadcn / Tailwind steps). Fluid headline clamps
     keep their own bounds; every fixed size below maps to one of these. */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Radius. Hard edges everywhere: panels, buttons, chips, inputs. The steps
     stay as tokens so a component never hard-codes a corner. */
  --radius: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-2xl: 0;
  --radius-pill: 0;

  /* Spacing scale for new rules (0.25rem steps). Existing spacing is untouched. */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;

  /* Semantic colour aliases in shadcn's vocabulary over the brand tokens. */
  --background: var(--paper);
  --foreground: var(--ink);
  --muted: var(--paper-2);
  --muted-foreground: var(--ink-45);
  --border: var(--rule);
  --primary: var(--green);
  --primary-foreground: #FFFFFF;
  --destructive: var(--error);
  --card: var(--paper);
  --ring: var(--cobalt);
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/turnset/fonts/PublicSans-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/turnset/fonts/PublicSans-Variable-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/turnset/fonts/IBMPlexMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/turnset/fonts/IBMPlexMono-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/turnset/fonts/IBMPlexMono-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/turnset/fonts/IBMPlexMono-400-Italic.woff2") format("woff2");
}

@media (max-width: 599px) {
  :root {
    --gutter: 1rem;
  }
}

/* Light is the default for everyone. Dark is explicit opt-in through the
   theme toggle, which sets data-theme="dark". There is no automatic
   dark-by-system step. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17201C;
  --paper-2: #202B26;
  --ink: #E9EDE9;
  --ink-70: #B9C2BC;
  --ink-45: #8A958D;
  --rule: #3A453F;
  --rule-dark: #53615A;
  --green: #8DC3A9;
  --green-hover: #9DD2B8;
  --green-soft: #254E3E;
  --orange: #F5B18E;
  --gold: #E0C27A;
  --gold-soft: #3D3620;
  --red: #F0A49C;
  --red-soft: #4A2622;
  --blue: #8FB4C9;
  --band: #0D110F;
  --on-band: #B9C2BC;
  --code: #D7E5DC;
  --shadow: none;
  --shadow-soft: none;
  --grid-line: transparent;
}

/* Theme control: one button cycling light -> dark -> system, showing the
   current state. "Follow the system" stays reachable as the third stop. */
.theme {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.theme button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  cursor: pointer;
  line-height: 0;
}

.theme button:hover {
  background: var(--paper-2);
}

.theme svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme svg[hidden] {
  display: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Class-based display rules outrank the UA sheet, so hidden needs to win. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

[id] {
  scroll-margin-top: 5rem;
}

body {
  margin: 0;
  color: var(--ink-70);
  /* Paper with a 28px grid drawn in two hairline gradients. */
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px, 28px 28px, auto;
  font-family: var(--text);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

h1 {
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

h1 em {
  color: var(--orange);
  font-style: normal;
}

.lede {
  max-width: var(--w-text);
  margin: 0.9rem 0 0;
  font-size: var(--text-lg);
  color: var(--ink-70);
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-color: var(--ink-45);
  text-underline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap--prose {
  max-width: var(--w-prose);
}

.wrap--form {
  max-width: var(--w-form);
}

/* Text measures, for paragraphs that sit inside a wider container. */
.measure {
  max-width: var(--measure);
}

.measure-lead {
  max-width: var(--measure-lead);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
}

/* Header. One header on every page: mark, theme button, one action. */

.top {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}

.top__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* Same height whether or not the page has an action button. */
  min-height: 2.75rem;
}

/* Theme button plus the action slot, pinned to the right edge. */
.top__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-left: auto;
}

/* Signed-in pages: the login as a muted label, sign-out as a small outline
   button, on one line. The label truncates so theme toggle + account stay
   inside the 17rem the right cluster reserves and the nav never moves. */
.top .account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  white-space: nowrap;
}
.top .account [data-login] {
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--ink-70);
}
.top .account .btn {
  margin: 0;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.top .btn {
  flex: none;
}

/* Narrow: mark and action on the first row, nav on its own row underneath,
   rather than letting two links wrap into a ragged block. */
@media (max-width: 560px) {
  .top__row {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .top__right {
    min-width: 0;
    margin-left: auto;
  }

  .top nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 1.5rem;
    font-size: var(--text-sm);
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.7rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease,
    transform 0.12s ease, box-shadow 0.14s ease;
}

.btn:hover {
  background: var(--ink-70);
  border-color: var(--ink-70);
  color: var(--paper);
}

.btn:active {
  transform: scale(0.98);
}

:root[data-theme="dark"] .btn {
  box-shadow: none;
}

.btn--open {
  background: var(--paper-2);
  border-color: var(--ink);
  color: var(--ink);
}

.btn--open:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--sm {
  padding: 0.6rem 1.1rem;
  font-size: var(--text-sm);
}

/* Earn variant: the money CTA, forest green with white text. */
.btn--earn {
  background: var(--green);
  border-color: var(--green);
  color: #FFFFFF;
}

.btn--earn:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
  color: #FFFFFF;
}

/* Live pulse dot for the product mock header. */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--earn);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--earn) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 9px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Paid pill: emerald money accent, distinct from cobalt product accents. */
.paid-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: var(--paper-2);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* Telemetry primitives: mono metrics and status chips shared by the
   marketing waterfall mock and the product trace pages. */
.metric {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--ink-70);
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-70);
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-45);
}

.chip--ok {
  color: var(--earn-deep);
  border-color: color-mix(in srgb, var(--earn) 45%, transparent);
  background: color-mix(in srgb, var(--earn) 10%, transparent);
}

.chip--ok::before {
  background: var(--earn);
}

.chip--err {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 45%, transparent);
  background: color-mix(in srgb, var(--error) 8%, transparent);
}

.chip--err::before {
  background: var(--error);
}

.chip--run {
  color: var(--cobalt);
  border-color: color-mix(in srgb, var(--cobalt) 45%, transparent);
  background: color-mix(in srgb, var(--cobalt) 8%, transparent);
}

.chip--run::before {
  background: var(--cobalt);
  animation: pulse 2.2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .chip--run::before {
    animation: none;
  }
}

/* Hero */

.hero {
  padding: 5.5rem 0 6.5rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
}

.hero h1 em {
  font-style: normal;
}

.hero__foot {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}

@media (min-width: 800px) {
  .hero__foot {
    grid-template-columns: 1.1fr 1fr;
    align-items: end;
    gap: 4rem;
  }
}

.hero__sub {
  max-width: var(--measure-lead);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--ink-70);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero__fine {
  margin-top: 0.9rem;
  font-size: var(--text-sm);
  color: var(--ink-45);
}

/* The deal */

/* How it works: the four steps, scannable in about five seconds. */

.how {
  padding: 6rem 0 6.5rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}

.steps {
  display: grid;
  gap: 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.75rem;
  }
}

.steps li {
  counter-increment: step;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-dark);
  position: relative;
}

.steps li::before {
  content: "0" counter(step);
  position: absolute;
  top: 0.55rem;
  left: 0;
  font: 600 11px/1 var(--mono);
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.011em;
}

.steps p {
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  color: var(--ink-70);
}

.steps code {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.05rem 0.3rem;
  white-space: nowrap;
}

.how__note {
  margin-top: 2.25rem;
  font-size: var(--text-sm);
  color: var(--ink-45);
}

/* A real capture, shown because the scrubbing claim is the one people most
   need evidence for before installing a proxy. */

.proof {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.proof__lead,
.proof__note {
  max-width: var(--measure);
  font-size: var(--text-sm);
  color: var(--ink-70);
}

.proof pre {
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  background: var(--band);
  border-radius: var(--radius-md);
}

.proof code {
  font-family: var(--mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--code);
  white-space: pre;
}

.proof pre b {
  color: #fff;
  font-weight: 600;
}

.proof__note code {
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.05rem 0.3rem;
}

/* Coverage. A visitor's first question after "how does it work" is "does it
   work with what I use", and the honest answer has two columns. */

.covers {
  padding: 6rem 0 6.5rem;
  border-top: 1px solid var(--rule);
}

.covers__grid {
  display: grid;
  gap: 2rem;
  margin-top: 1.75rem;
}

@media (min-width: 800px) {
  .covers__grid {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }
}

.covers__when {
  font-family: var(--display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-45);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ink);
}

.covers ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.covers li {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-base);
}

.covers li b {
  color: var(--ink);
  font-weight: 600;
}

.covers__note {
  max-width: var(--w-text);
  margin-top: 2rem;
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.deal {
  padding: 6rem 0 7rem;
  border-top: 1px solid var(--rule);
}

.deal__intro {
  margin-bottom: 3rem;
}

.deal h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule-dark);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 800px) {
  .cols {
    gap: 3.5rem;
  }
}

.cols span {
  font: 600 10px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.cols span:last-child {
  color: var(--ink);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule-dark);
  align-items: baseline;
}

@media (min-width: 800px) {
  .pair {
    gap: 3.5rem;
  }
}

.give,
.get {
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: var(--leading-snug);
}

.give {
  color: var(--ink-70);
}

.get {
  color: var(--ink);
  padding-left: 1.35rem;
  border-left: 3px solid var(--cobalt);
}

/* No leading rule on the "get" column. It was a 1px line rather than a
   character, but it read as an em dash, which is the only thing that matters. */

/* Inline commands in the deal table read as literal commands, same chip as
   the how-it-works steps use. */
.pair small code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.05rem 0.3rem;
  white-space: nowrap;
}

.pair small {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--text);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--leading-normal);
  color: var(--ink-45);
}

.deal__note {
  margin-top: 2.5rem;
  font-size: var(--text-base);
  color: var(--ink-70);
}

.deal__note b {
  color: var(--ink);
}

/* Negative panel */

/* A white section. Pages alternate paper and band from section to section. */
.band {
  background: var(--paper-2);
}

.nope {
  padding: 6rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-70);
}

.how h2,
.nope h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}

.nope__lead {
  max-width: var(--w-text);
  margin-top: 1rem;
  font-size: var(--text-base);
  color: var(--ink-70);
}

.nope ul {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.nope li {
  max-width: var(--w-text);
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule-dark);
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--leading-snug);
  color: var(--ink);
}

.nope li span {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--text);
  font-size: var(--text-base);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--leading-normal);
  color: var(--ink-70);
}

/* Rate */

.rate {
  padding: 4.5rem 0;
}

.rate h2 {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.rate__lead {
  max-width: var(--measure-lead);
  margin-top: 1.25rem;
}

.three {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 800px) {
  .three {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.three > div {
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.three h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.three p {
  margin-top: 0.75rem;
  font-size: var(--text-base);
}

.bonus {
  display: grid;
  gap: 1rem;
  margin-top: 3.5rem;
  padding: 2rem;
  background: var(--paper-2);
}

@media (min-width: 800px) {
  .bonus {
    grid-template-columns: 1fr 1.4fr;
    gap: 3rem;
    align-items: center;
  }
}

.bonus h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.011em;
}

/* Start */

.start {
  padding: 4.5rem 0;
  border-top: 1px solid var(--rule);
}

.start h2 {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.line {
  display: grid;
  gap: 0.4rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 800px) {
  .line {
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 2rem;
  }
}

.line h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.011em;
}

.line h3 code {
  font-family: inherit;
  font-weight: 600;
}

.line p {
  margin-top: 0.45rem;
  font-size: var(--text-base);
  color: var(--ink-45);
}

.copy {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-70);
  font-family: var(--text);
  font-size: var(--text-sm);
  cursor: pointer;
}

.copy:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.facts {
  display: grid;
  gap: 1.5rem 2rem;
  margin: 3rem 0 0;
}

@media (min-width: 720px) {
  .facts {
    grid-template-columns: repeat(3, 1fr);
  }
}

.facts > div {
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
}

.facts dt {
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.facts dd {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}

/* Straight answers */

.answers {
  padding: 4.5rem 0;
  background: var(--paper-2);
}

.answers h2 {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.qa {
  margin: 2.5rem 0 0;
}

.qa > div {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

@media (min-width: 860px) {
  .qa > div {
    display: grid;
    grid-template-columns: 22rem 1fr;
    gap: 3rem;
    align-items: baseline;
  }
}

.qa dt {
  font-family: var(--display);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.qa dd {
  margin: 0.5rem 0 0;
  font-size: var(--text-base);
}

@media (min-width: 860px) {
  .qa dd {
    margin-top: 0;
  }
}

/* Close */

.close {
  padding: 7rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-70);
}

.close h2 {
  color: var(--ink);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.035em;
}

.close p {
  max-width: var(--measure-lead);
  margin-top: 1.25rem;
  font-size: var(--text-lg);
}

.perks {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

/* Wide: the pitch reads down the left, the perks sit alongside it. The band
   is full width, so confining everything to one narrow column left half the
   section empty and wrapped the heading early. */
@media (min-width: 900px) {
  .close .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 4.5rem;
    align-items: start;
  }

  .close h2,
  .close > .wrap > p,
  .close .btn {
    grid-column: 1;
  }

  .close .perks {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0.4rem;
  }

  .close .btn {
    justify-self: start;
  }
}

.perks li {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--text-base);
}

.perks b {
  color: var(--ink);
  font-weight: 600;
}

.close .btn {
  margin-top: 2rem;
}

.foot {
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.foot__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.foot a {
  color: var(--ink-45);
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
}

/* Modal (shares behaviour with main.js) */

.modal {
  position: relative;
  width: min(93vw, 440px);
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink-70);
  font-family: var(--text);
}

.modal::backdrop {
  background: rgba(22, 19, 15, 0.5);
}

.modal-step {
  padding: 1.9rem;
}

.modal-form {
  padding: 0;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: none;
  background: none;
  color: var(--ink-45);
  font-size: var(--text-2xl);
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-step h2 {
  font-size: var(--text-3xl);
}

.modal-lead {
  margin: 0.6rem 0 1rem;
  font-size: var(--text-base);
}

.modal-note {
  margin: 0 0 1.2rem;
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.modal-fine {
  margin: 1rem 0 0;
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.modal-step label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--text-sm);
  color: var(--ink);
}

.modal-step input[type="email"],
.modal-step input[type="text"],
.modal-step select {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.modal-step input:focus-visible,
.modal-step select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.opt {
  color: var(--ink-45);
}

/* Sign-in block: rendered only for providers that are configured */

.sso__note {
  margin: 0.55rem 0 0;
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.sso .btn--block + .btn--block {
  margin-top: 0.5rem;
}

.or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.2rem 0 1rem;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.turnstile:not(:empty) {
  margin-bottom: 1rem;
}

.choice {
  margin: 0 0 1.1rem;
  padding: 0;
  border: none;
}

.choice legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  color: var(--ink);
}

.choice label {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 0.4rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  cursor: pointer;
}

.choice label:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper);
}

.choice input {
  margin: 0.3rem 0 0;
  accent-color: var(--ink);
}

.choice strong {
  font-weight: 600;
  color: var(--ink);
}

.check {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  font-size: var(--text-sm);
  cursor: pointer;
}

.check input {
  margin: 0.25rem 0 0;
  accent-color: var(--ink);
}

/* The submit sits under a stack of full-width sign-in buttons and a full-width
   input, so a small right-aligned button breaks the column. Match them. */
.modal-actions {
  display: flex;
  margin-top: 0.25rem;
}

.modal-actions .btn {
  width: 100%;
}

.btn--block {
  width: 100%;
}

.modal-back {
  margin-top: 1.1rem;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--text);
  font-size: var(--text-sm);
  color: var(--ink-45);
  cursor: pointer;
}

.modal-back:hover {
  color: var(--ink);
}

.form-status {
  margin: 0.8rem 0 0;
  font-size: var(--text-sm);
}

.form-status.success {
  color: var(--earn-deep);
}

.form-status.error {
  color: var(--error);
}



/* Long-form pages: legal, confirmations, errors */

.legal-page {
  padding: 3rem 0 4rem;
}

.legal-page h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.legal-page h2 {
  margin: 2.25rem 0 0.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.legal-page h3 {
  margin: 1.5rem 0 0.4rem;
  font-family: var(--display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.legal-page p,
.legal-page li {
  font-size: var(--text-base);
}

.legal-page p {
  margin: 0.75rem 0;
}

.legal-page ul,
.legal-page ol {
  margin: 0.75rem 0;
  padding-left: 1.2rem;
}

.legal-page li {
  margin: 0.35rem 0;
}

.legal-meta {
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.legal-summary,
.legal-toc {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper-2);
}

.legal-summary__label,
.legal-toc__label {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.legal-toc ol {
  columns: 2;
  column-gap: 2rem;
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .legal-toc ol {
    columns: 1;
  }
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--ink-45);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.04em;
}

.cmd {
  margin: 1.25rem 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cmd__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.cmd pre {
  margin: 0;
  padding: 1rem 0.9rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink);
}

.code-copy,
.copy {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-70);
  font-family: var(--text);
  font-size: var(--text-xs);
  cursor: pointer;
}

.code-copy:hover,
.copy:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.note {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--rule);
  background: var(--paper-2);
  font-size: var(--text-base);
}

.note--flag {
  border-left-color: var(--ink);
}

.account {
  font-size: var(--text-sm);
  color: var(--ink-45);
}

.logo__mark {
  width: 1.15em;
  height: 1.15em;
  border-radius: var(--radius-sm);
}

/* Contributor dashboard */

.dash-page {
  padding: 2.4rem 0 4rem;
}

.dash-state h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.dash-metric {
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-soft);
}

.dash-metric b {
  display: block;
  font: 600 var(--text-2xl)/1.1 var(--mono);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.dash-metric span {
  display: block;
  margin-top: 0.4rem;
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.dash-metric--hold b {
  color: var(--ink-45);
}

.dash-split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .dash-split {
    grid-template-columns: minmax(0, 1.6fr) minmax(14rem, 0.9fr);
    gap: 2.5rem;
    align-items: start;
  }
}

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.dash-toolbar h2,
.dash-side h2 {
  margin: 0;
  font-size: var(--text-base);
}

.dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dash-chip {
  border: 1px solid var(--rule-dark);
  background: var(--paper-2);
  color: var(--ink-70);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.6rem;
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.dash-chip:hover {
  color: var(--ink);
}

.dash-chip.is-on {
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: color-mix(in srgb, var(--cobalt) 10%, var(--paper));
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-item {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.dash-item--clickable {
  cursor: pointer;
  border-radius: var(--radius-lg);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  transition: background 0.12s ease;
}

.dash-item--clickable:hover {
  background: color-mix(in srgb, var(--cobalt) 6%, var(--paper));
}

.dash-item--clickable:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

.dash-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.dash-item__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
}

.dash-host {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink);
}

.dash-host--name {
  font-family: inherit;
}

.dash-meta {
  margin: 0.35rem 0 0;
  font-size: var(--text-sm);
  color: var(--ink-70);
}

.dash-meta.muted,
.muted {
  color: var(--ink-45);
}

.dash-paths {
  margin: 0.45rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dash-paths code {
  font-size: var(--text-xs);
  color: var(--ink-70);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.35rem;
}

.dash-badge {
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-70);
}

.dash-badge--pending {
  color: var(--cobalt);
  border-color: color-mix(in srgb, var(--cobalt) 45%, var(--rule));
  background: color-mix(in srgb, var(--cobalt) 10%, transparent);
}

.dash-badge--finalized {
  color: var(--ink-70);
}

.dash-badge--excluded {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 40%, var(--rule));
}

/* Local dashboard (served by the turnset binary): where a session lives. */
.dash-badge--local {
  color: var(--ink-70);
}

.dash-badge--queued {
  color: var(--cobalt);
  border-color: color-mix(in srgb, var(--cobalt) 45%, var(--rule));
  background: color-mix(in srgb, var(--cobalt) 10%, transparent);
}

.dash-badge--partial,
.dash-badge--uploaded {
  color: var(--earn, var(--cobalt));
  border-color: color-mix(in srgb, var(--earn, var(--cobalt)) 45%, var(--rule));
  background: color-mix(in srgb, var(--earn, var(--cobalt)) 10%, transparent);
}

.dash-hosts {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
}

.dash-hosts li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
}

.dash-hosts em {
  font-style: normal;
  color: var(--ink-45);
  font-variant-numeric: tabular-nums;
}

.dash-side .mini {
  margin-top: 0.6rem;
}

.dash-side .mini li {
  font-size: var(--text-sm);
}

.error {
  color: var(--error);
  font-size: var(--text-sm);
}

.dash-host--link {
  text-decoration: none;
  color: var(--ink);
}

.dash-host--link:hover {
  color: var(--cobalt);
}

.dash-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* Trace detail — highlights / full toggle (traces.com-style) */

.trace-page {
  padding: 1.6rem 0 4rem;
}


.trace-back {
  margin: 0 0 1rem;
  font-size: var(--text-sm);
}

.trace-back a {
  color: var(--ink-70);
  text-decoration: none;
}

.trace-back a:hover {
  color: var(--ink);
}

.trace-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.trace-hero h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: var(--leading-tight);
}

.trace-sub {
  margin: 0.5rem 0 0;
  color: var(--ink-70);
  font-size: var(--text-sm);
}

.trace-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.trace-summary {
  margin: 0 0 1.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}

.trace-summary p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-70);
}

.trace-summary p.trace-summary__score {
  margin-top: 0.4rem;
  color: var(--ink);
}

.trace-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem 1rem;
  margin: 0 0 1.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}

.trace-meta div {
  margin: 0;
}

.trace-meta dt {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.trace-meta dd {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  word-break: break-word;
}

.trace-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  margin-bottom: 1.4rem;
}

.trace-toggle__btn {
  border: 0;
  background: transparent;
  color: var(--ink-70);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.trace-toggle__btn:hover {
  color: var(--ink);
}

.trace-toggle__btn.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 35, 63, 0.08);
}

.trace-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The step spans the list; its text keeps a reading measure. */
.trace-step__body {
  max-width: var(--measure);
}

.trace-step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0 0.85rem 0.9rem;
  border-top: 1px solid var(--rule);
  position: relative;
}

.trace-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9rem;
  bottom: 0.9rem;
  width: 3px;
  border-radius: var(--radius-sm);
  background: var(--rule);
}

.trace-step.is-user::before {
  background: var(--cobalt);
}

.trace-step.is-error::before {
  background: var(--error);
}

.trace-step:last-child {
  border-bottom: 1px solid var(--rule);
}

.trace-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-70);
}

.trace-step.is-user .trace-step__num {
  border-color: color-mix(in srgb, var(--cobalt) 50%, var(--rule));
  color: var(--cobalt);
}

.trace-step.is-error .trace-step__num {
  border-color: color-mix(in srgb, var(--error) 45%, var(--rule));
  color: var(--error);
}

.trace-step__kind {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.trace-step__title {
  margin: 0.25rem 0 0;
  font-size: var(--text-base);
  color: var(--ink);
  line-height: var(--leading-snug);
}

.trace-step__at {
  margin: 0.3rem 0 0;
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.trace-stream {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trace-msg {
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  padding: 0.85rem 1rem;
  background: var(--paper);
}

.trace-msg.is-user {
  border-color: color-mix(in srgb, var(--cobalt) 35%, var(--rule));
  background: color-mix(in srgb, var(--cobalt) 6%, var(--paper));
}

.trace-msg.is-assistant {
  background: var(--paper);
}

.trace-msg.is-tool {
  background: var(--paper-2);
}

.trace-msg.is-error {
  border-color: color-mix(in srgb, var(--error) 40%, var(--rule));
}

.trace-msg__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.trace-msg__role {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.trace-msg.is-user .trace-msg__role {
  color: var(--cobalt);
}

.trace-msg__at {
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.trace-msg__title {
  margin: 0 0 0.35rem;
  font-size: var(--text-sm);
}

.trace-msg__title code {
  font-size: var(--text-sm);
  word-break: break-all;
}

.trace-msg__body {
  max-width: var(--measure);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.trace-msg__path {
  margin: 0.45rem 0 0;
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.trace-msg__path code {
  font-size: var(--text-xs);
}

/* Analytics cards */

.an-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 800px) {
  .an-grid--2 {
    grid-template-columns: 1.2fr 1fr;
  }
  .an-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.an-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  background: var(--paper);
  padding: 1.1rem 1.15rem 1.2rem;
  min-width: 0;
}

.an-card h2 {
  margin: 0;
  font-size: var(--text-base);
}

.an-card__sub {
  margin: 0.25rem 0 0.9rem;
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.an-note {
  margin: 0.25rem 0 1.25rem;
  font-size: var(--text-sm);
}

.an-empty {
  margin: 0.4rem 0 0;
  font-size: var(--text-sm);
}

/* Heatmap — column-major 7 rows (Sun–Sat) × weeks */
.heat {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
}

.heat i {
  display: block;
  aspect-ratio: 1;
  min-width: 10px;
  border-radius: var(--radius-sm);
  background: var(--rule);
}

.heat .l1 {
  background: color-mix(in srgb, var(--cobalt) 22%, transparent);
}
.heat .l2 {
  background: color-mix(in srgb, var(--cobalt) 45%, transparent);
}
.heat .l3 {
  background: color-mix(in srgb, var(--cobalt) 70%, transparent);
}
.heat .l4 {
  background: var(--cobalt);
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.65rem;
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.heat-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-sm);
  background: var(--rule);
}
.heat-legend .l1 {
  background: color-mix(in srgb, var(--cobalt) 22%, transparent);
}
.heat-legend .l2 {
  background: color-mix(in srgb, var(--cobalt) 45%, transparent);
}
.heat-legend .l3 {
  background: color-mix(in srgb, var(--cobalt) 70%, transparent);
}
.heat-legend .l4 {
  background: var(--cobalt);
}

/* Hour-of-day vertical bars */
.bars-h {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  padding-top: 0.4rem;
}

.bars-h__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.bars-h__col i {
  display: block;
  width: 100%;
  max-width: 14px;
  border-radius: 2px 2px 0 0;
  background: var(--cobalt);
  min-height: 2px;
}

.bars-h__col span {
  margin-top: 0.25rem;
  font-size: var(--text-xs);
  color: var(--ink-45);
  line-height: 1;
  height: 0.75rem;
}

/* Horizontal rank bars */
.an-bars {
  list-style: none;
  margin: 0;
  padding: 0;
}

.an-bars li {
  display: grid;
  grid-template-columns: minmax(4rem, 38%) 1fr 2.2rem;
  gap: 0.45rem;
  align-items: center;
  padding: 0.28rem 0;
  font-size: var(--text-sm);
}

.an-bars__lab {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-70);
  font-family: var(--mono);
  font-size: var(--text-xs);
}

.an-bars--names .an-bars__lab {
  font-family: inherit;
}

.an-bars i {
  display: block;
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--cobalt);
  min-width: 2px;
}

.an-bars em {
  font-style: normal;
  text-align: right;
  color: var(--ink-45);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xs);
}

.an-stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.an-stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
  color: var(--ink-70);
}

.an-stat-list em {
  font-style: normal;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.an-stat-list--solo li:first-child {
  border-top: 0;
  padding-top: 0;
}

.an-ring-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.an-ring {
  text-align: center;
  flex-shrink: 0;
}

.an-ring svg {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto;
}

.an-ring .ring__bg {
  fill: none;
  stroke: var(--rule);
  stroke-width: 8;
}

.an-ring .ring__fg {
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 8;
  stroke-linecap: round;
}

.an-ring p {
  margin: 0.35rem 0 0;
}

.an-ring b {
  display: block;
  font-size: var(--text-base);
  color: var(--ink);
}

.an-ring span {
  font-size: var(--text-xs);
  color: var(--ink-45);
}

.an-expire {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}

.an-expire li {
  border-top: 1px solid var(--rule);
  padding: 0.45rem 0;
  font-size: var(--text-sm);
}

.an-expire a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
}

.an-expire a:hover .dash-host {
  color: var(--cobalt);
}

.an-expire span {
  color: var(--ink-45);
  font-size: var(--text-xs);
}

.dash-split--analytics {
  margin-top: 1.25rem;
}

@media (max-width: 799px) {
  .an-ring-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---- Structured LLM calls (trace page, Calls tab) ---- */
.calls-wrap { overflow-x: auto; }
.calls { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.calls th, .calls td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.calls th { font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-45); font-weight: 600; }
.calls .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.calls .call-row { cursor: pointer; }
.calls .call-row:hover, .calls .call-row.is-open { background: var(--paper-2); }
.calls .call-row.is-error td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.calls .call-model { font-family: var(--mono); font-size: var(--text-sm); }
.call-detail-row > td { padding: 0 0 1.2rem 0; background: var(--paper-2); }
.call-detail { padding: 1rem 1rem 0.4rem; display: grid; gap: 0.9rem; }
.call-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.call-meta dt { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-45); }
.call-meta dd { margin: 0; font-family: var(--mono); font-size: var(--text-sm); word-break: break-all; }
.call-usage .chip { display: inline-block; margin: 0 0.4rem 0.4rem 0; padding: 0.15rem 0.55rem; border: 1px solid var(--rule); border-radius: var(--radius-pill); font-size: var(--text-xs); }
.call-usage .chip b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.call-sec h4 { margin: 0 0 0.5rem; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-70); }
.call-sec--out { padding-top: 0.6rem; border-top: 1px dashed var(--rule); }
.call-text { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: var(--text-sm); line-height: var(--leading-normal); max-height: 32rem; overflow: auto; padding: 0.6rem 0.75rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.call-json { tab-size: 2; }
.call-error { border-color: color-mix(in srgb, var(--error) 50%, var(--rule)); color: var(--error); }
.call-long > summary, .call-thinking > summary, .call-params > summary, .call-sec details > summary { cursor: pointer; font-size: var(--text-sm); color: var(--ink-70); }
.call-long > summary { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: var(--text-sm); }
.call-msg { margin: 0.5rem 0; }
.call-tool { margin: 0.4rem 0; }
.call-tool__head { font-size: var(--text-xs); color: var(--ink-70); margin-bottom: 0.25rem; }
.call-tool__head code { font-size: var(--text-sm); }
.call-tools { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: var(--text-sm); }
.calls-others { margin-top: 1.2rem; font-size: var(--text-sm); }
.calls-others summary { cursor: pointer; color: var(--ink-70); }
.calls-others ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.calls-others code { font-size: var(--text-xs); word-break: break-all; }

/* ---- Score tab ---- */
.score-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-bottom: 1.2rem; }
.score-composite { display: flex; align-items: center; gap: 0.7rem; }
.score-composite b { font-size: var(--text-4xl); line-height: 1; font-variant-numeric: tabular-nums; }
.score-composite span { font-size: var(--text-sm); color: var(--ink-70); line-height: var(--leading-tight); }
.score-composite small { color: var(--ink-45); }
.score-floor { font-size: var(--text-sm); }
.score-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; font-size: var(--text-sm); }
.score-dims { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.score-dim { padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.score-dim.is-na { opacity: 0.6; }
.score-dim__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.score-dim__head b { font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.score-bar { height: 6px; background: var(--paper-2); border-radius: var(--radius-sm); margin: 0.5rem 0; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--cobalt); border-radius: var(--radius-sm); }
.score-evidence { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: var(--text-sm); color: var(--ink-70); display: grid; gap: 0.15rem; }
.score-features, .score-runs { margin-top: 1rem; font-size: var(--text-sm); }
.score-features summary, .score-runs summary { cursor: pointer; color: var(--ink-70); }
.score-runs-table { margin-top: 0.6rem; }
.score-runs-table tr.is-error td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.score-notes { margin: 1rem 0 0; padding-left: 1.1rem; font-size: var(--text-sm); display: grid; gap: 0.2rem; }

/* ---- Device link form (device.html) ---- */
.device-form {
  margin-top: 1.6rem;
}
.device-form label {
  display: block;
  font-size: var(--text-sm);
  color: var(--ink-45);
  margin-bottom: 0.4rem;
}
.code-input {
  width: 100%;
  font: inherit;
  font-family: var(--mono);
  font-size: var(--text-xl);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
}
.device-form .error {
  margin-top: 0.8rem;
  color: var(--error);
}
.device-form .hero__cta {
  margin-top: 1.4rem;
  gap: 0.6rem;
}

/* ---- /traces: toolbar and pager ---- */
.traces-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin: 1.2rem 0 1rem; }
.traces-select, .traces-search { font: inherit; font-size: var(--text-sm); padding: 0.45rem 0.7rem; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); }
.traces-search { flex: 1 1 14rem; min-width: 12rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.4rem 0 0; font-size: var(--text-sm); }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--ink); }

/* Phone header: two rows, not three. The mark and the action share the first
   row, the nav takes the second, the theme toggle steps aside. */
@media (max-width: 700px) {
  .top__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 0.6rem;
  }

  .top__row nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
  }

  .top__right {
    min-width: 0;
    justify-content: flex-end;
  }

}

.call-note {
  margin: 0 0 1rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--rule));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--warn) 8%, var(--paper));
  font-size: var(--text-sm);
  color: var(--ink-70);
}

/* Dark: the money button is mint, so its text goes to ink. */
:root[data-theme="dark"] .btn--earn,
:root[data-theme="dark"] .btn--earn:hover {
  color: #0D110F;
}

/* A provider's mark inside a sign-in button (GitHub, Google). */
.btn__icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  margin-right: 0.55rem;
}
