/* ThrillhouseBot — generated from design/tokens.json by scripts/build-design-css.py; do not edit */

/* Self-hosted so no visitor's IP reaches Google just for fonts (GDPR). Latin and Latin Extended
   subsets of Familjen Grotesk, IBM Plex Sans and IBM Plex Mono, all SIL Open Font License 1.1. */
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/familjen-grotesk-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/familjen-grotesk-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/familjen-grotesk-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/familjen-grotesk-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root, [data-theme="light"] {
  --paper: #f7f5fb;
  --surface: #ffffff;
  --surface-sunken: #eeebf5;
  --ink: #1c1626;
  --ink-muted: #5b5468;
  --control-border: #7a7388;
  --hairline: #dcd6e8;
  --brand: #542a96;
  --on-brand: #ffffff;
  --lavender: #d2bafc;
  --on-lavender: #1c1626;
  --comment-bg: #f1eafe;
  --add-bg: #dff3e4;
  --add-ink: #17703a;
  --del-bg: #fbe4e1;
  --del-ink: #a8261b;
  --risk-critical-bg: #fbe4e1;
  --risk-critical-ink: #a8261b;
  --risk-high-bg: #ffe7d1;
  --risk-high-ink: #94450a;
  --risk-medium-bg: #fdf0c4;
  --risk-medium-ink: #735400;
  --risk-low-bg: #e2ecfb;
  --risk-low-ink: #1f559e;
  --shadow-raised: 0 1px 0 rgba(28,22,38,0.06), 0 8px 24px rgba(84,42,150,0.10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #110e18;
    --surface: #1a1624;
    --surface-sunken: #0c0a12;
    --ink: #ece8f4;
    --ink-muted: #a59eb3;
    --control-border: #8a8398;
    --hairline: #2e2840;
    --brand: #c4a8ff;
    --on-brand: #110e18;
    --comment-bg: #2a2140;
    --add-bg: #10301d;
    --add-ink: #5fd68a;
    --del-bg: #3a1714;
    --del-ink: #ff8a7d;
    --risk-critical-bg: #3a1714;
    --risk-critical-ink: #ff8a7d;
    --risk-high-bg: #3a2310;
    --risk-high-ink: #ffb070;
    --risk-medium-bg: #33290c;
    --risk-medium-ink: #f0c94e;
    --risk-low-bg: #13243d;
    --risk-low-ink: #8db8ff;
    --shadow-raised: 0 1px 0 rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.45);
    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --paper: #110e18;
  --surface: #1a1624;
  --surface-sunken: #0c0a12;
  --ink: #ece8f4;
  --ink-muted: #a59eb3;
  --control-border: #8a8398;
  --hairline: #2e2840;
  --brand: #c4a8ff;
  --on-brand: #110e18;
  --comment-bg: #2a2140;
  --add-bg: #10301d;
  --add-ink: #5fd68a;
  --del-bg: #3a1714;
  --del-ink: #ff8a7d;
  --risk-critical-bg: #3a1714;
  --risk-critical-ink: #ff8a7d;
  --risk-high-bg: #3a2310;
  --risk-high-ink: #ffb070;
  --risk-medium-bg: #33290c;
  --risk-medium-ink: #f0c94e;
  --risk-low-bg: #13243d;
  --risk-low-ink: #8db8ff;
  --shadow-raised: 0 1px 0 rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.45);
  color-scheme: dark;
}

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;
  --content-max: 1120px;
  --measure: 65ch;
  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

.display-xl { font-family: var(--font-display); font-size: 72px; line-height: 72px; font-weight: 700; letter-spacing: -0.02em; }
.display-l { font-family: var(--font-display); font-size: 48px; line-height: 52px; font-weight: 700; letter-spacing: -0.015em; }
.heading { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.lede { font-family: var(--font-sans); font-size: 20px; line-height: 30px; font-weight: 400; }
.body { font-family: var(--font-sans); font-size: 16px; line-height: 26px; font-weight: 400; }
.body-strong { font-family: var(--font-sans); font-size: 16px; line-height: 26px; font-weight: 600; }
.small { font-family: var(--font-sans); font-size: 14px; line-height: 20px; font-weight: 400; }
.label { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; }
.code { font-family: var(--font-mono); font-size: 14px; line-height: 22px; font-weight: 400; }
.code-small { font-family: var(--font-mono); font-size: 12px; line-height: 18px; font-weight: 400; }


/* ThrillhouseBot components. Every value comes from tokens.css; class prefix th-. */

.th-root {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
}

/* ---- Focus: one ring for everything interactive ---- */
.th-root :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---- Highlight: the marker swipe behind one phrase ---- */
.th-highlight {
  background: linear-gradient(transparent 12%, var(--lavender) 12%, var(--lavender) 88%, transparent 88%);
  color: var(--on-lavender);
  border-radius: var(--radius-s);
  padding-inline: 0.12em;
  margin-inline: -0.06em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---- Button ---- */
.th-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.th-button--primary {
  background: var(--brand);
  color: var(--on-brand);
}
.th-button--primary:hover {
  box-shadow: inset 0 -4px 0 var(--lavender);
}
.th-button--secondary {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.th-button--secondary:hover {
  background: var(--surface);
}
.th-button--quiet {
  background: transparent;
  color: var(--ink);
  padding-inline: var(--space-3);
}
.th-button--quiet:hover {
  background: var(--surface-sunken);
}
.th-button:active {
  transform: translateY(1px);
}
.th-button[disabled],
.th-button[aria-disabled="true"] {
  background: var(--surface-sunken);
  color: var(--ink-muted);
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
}
.th-button--small {
  min-height: 32px;
  padding: 0 var(--space-3);
  font-size: 14px;
}

/* ---- Review thread: a diff hunk with the bot's comment on a line ---- */
.th-thread {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 22px;
}
.th-thread__file {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 18px;
}
.th-thread__hunk {
  overflow-x: auto;
}
.th-line {
  display: grid;
  grid-template-columns: 3.5em 1.5em 1fr;
  white-space: pre;
  color: var(--ink);
}
.th-line__no {
  padding-inline: var(--space-2);
  text-align: right;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  user-select: none;
}
.th-line__sign {
  text-align: center;
  user-select: none;
}
.th-line--add { background: var(--add-bg); }
.th-line--add .th-line__sign { color: var(--add-ink); }
.th-line--del { background: var(--del-bg); }
.th-line--del .th-line__sign { color: var(--del-ink); }
.th-line--marked { box-shadow: inset 4px 0 0 var(--lavender); }

.th-thread__range {
  padding: var(--space-1) var(--space-4);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-muted);
}
.th-comment {
  margin: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink);
  white-space: normal;
}
.th-comment__who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.th-comment__who img {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-s);
}
.th-comment__bot {
  padding: 0 var(--space-2);
  border: 1px solid var(--control-border);
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--ink-muted);
}
.th-comment__meta {
  font-weight: 400;
  color: var(--ink-muted);
}
.th-comment code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-sunken);
  border-radius: var(--radius-s);
  padding: 1px var(--space-1);
}

/* ---- Pricing plan ---- */
.th-plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  min-width: 0;
}
.th-plan--selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-raised);
}
.th-plan__eyebrow {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.th-plan__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.th-plan__rates {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: var(--space-4) 0;
  border-block: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}
.th-plan__rates dt { color: var(--ink-muted); }
.th-plan__rates dd { margin: 0; font-family: var(--font-mono); font-size: 14px; text-align: right; }
.th-plan__zero { color: var(--add-ink); font-weight: 600; }
.th-plan__rates dd.th-plan__soon { font-family: var(--font-sans); font-size: 14px; color: var(--ink-muted); }
.th-plan > .th-button { margin-top: auto; justify-content: center; }
.th-plan__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}
.th-plan__list li { display: grid; grid-template-columns: 1.25em 1fr; }
.th-plan__list li::before { content: "+"; font-family: var(--font-mono); color: var(--add-ink); }

@media (prefers-reduced-motion: reduce) {
  .th-button { transition: none; }
}

/* ---- Logo: the character on its lavender tile, with the wordmark ---- */
.th-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.th-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-m);
}
.th-logo--large img { width: 64px; height: 64px; border-radius: var(--radius-l); }
.th-logo--large { font-size: 28px; gap: var(--space-4); }

/* ---- Promise: the data commitments, each a claim and its proof ---- */
.th-promise {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.th-promise li {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 2px solid var(--brand);
  min-width: 0;
}
.th-promise strong {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
}
.th-promise span { color: var(--ink-muted); }

/* ---- Risk badge: the review's four levels, always written out ---- */
.th-risk {
  display: inline-block;
  margin-right: var(--space-2);
  vertical-align: 1px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.th-risk--critical { background: var(--risk-critical-bg); color: var(--risk-critical-ink); }
.th-risk--high { background: var(--risk-high-bg); color: var(--risk-high-ink); }
.th-risk--medium { background: var(--risk-medium-bg); color: var(--risk-medium-ink); }
.th-risk--low { background: var(--risk-low-bg); color: var(--risk-low-ink); }

/* ---- Finding title inside a comment ---- */
.th-comment__title {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}
.th-comment p { margin: 0 0 var(--space-2); }
.th-comment p:last-child { margin-bottom: 0; }

/* ---- Suggested change: the replaced block, old lines then new, numbered ---- */
.th-suggestion {
  margin-top: var(--space-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.th-suggestion__head {
  padding: var(--space-1) var(--space-3);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-sunken);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-muted);
}
.th-suggestion .th-thread__hunk {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
}

/* ---- Plans side by side: every card's rows line up (subgrid) ---- */
.th-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  column-gap: var(--space-6);
  row-gap: var(--space-4);
}
.th-plans > .th-plan {
  display: grid;
  grid-row: span 6;
  grid-template-rows: subgrid;
  gap: var(--space-4);
}

/* ======================================================================
   Backoffice: the signed-in app (organizations, settings, costs).
   Same tokens as the site, denser: body text 15px, tables over cards.
   ====================================================================== */

/* ---- App header: logo, section tabs, account, sign out ---- */
.th-app-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}
.th-app-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 max(var(--space-4), env(safe-area-inset-right, 0px)) 0 max(var(--space-4), env(safe-area-inset-left, 0px));
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.th-tabs {
  display: flex;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.th-tabs a {
  position: relative;
  padding: var(--space-4) var(--space-3);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}
.th-tabs a:hover { color: var(--ink); }
.th-tabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
.th-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.th-app-header__account {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--ink-muted);
}

/* ---- Page frame ---- */
.th-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-8) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-16) max(var(--space-4), env(safe-area-inset-left, 0px));
  display: grid;
  gap: var(--space-8);
}
.th-page__head { display: grid; gap: var(--space-2); }
.th-page__head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.th-page__head p { margin: 0; max-width: var(--measure); color: var(--ink-muted); }
.th-page__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* ---- Panel: one bordered block per subject ---- */
.th-panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  min-width: 0;
}
.th-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--hairline);
}
.th-panel__head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
}
.th-panel__head p { margin: 0; font-size: 14px; color: var(--ink-muted); }
.th-panel__body { padding: var(--space-4) var(--space-6); }
.th-panel__body > p { margin: 0 0 var(--space-3); }
.th-panel__body > p:last-child { margin-bottom: 0; }

/* ---- Table: rows separated by hairlines; scrolls inside its own box ---- */
.th-table-wrap { overflow-x: auto; }
.th-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.th-table th {
  padding: var(--space-2) var(--space-6);
  text-align: left;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  white-space: nowrap;
}
.th-table td {
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--hairline);
  vertical-align: middle;
}
.th-table .num { text-align: right; white-space: nowrap; }
.th-table .end { text-align: right; }
.th-table .wide { min-width: 220px; }
.th-table code, .th-mono { font-family: var(--font-mono); font-size: 13px; }
.th-table td.th-mono, .th-table .th-mono, .th-table code { white-space: nowrap; }
.th-table tr.th-table__child td:first-child { padding-left: calc(var(--space-6) + var(--space-6)); }

/* ---- Fields ---- */
.th-field { display: grid; gap: var(--space-1); max-width: 420px; }
.th-field label { font-size: 14px; font-weight: 600; }
.th-field small { font-size: 13px; color: var(--ink-muted); }

/* ---- Check: a checkbox with its sentence, e.g. accepting the terms ---- */
.th-check { display: flex; gap: var(--space-2); align-items: flex-start; max-width: 560px; font-size: 14px; line-height: 20px; }
.th-check input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.th-check a { color: var(--brand); }
.th-input, .th-select {
  font: inherit;
  font-size: 15px;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}
.th-select { padding-right: var(--space-8); }
.th-form { display: grid; gap: var(--space-4); }
.th-form--inline { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.th-table .th-form--inline { flex-wrap: nowrap; justify-content: flex-end; }
.th-table .th-select, .th-table .th-input { min-height: 32px; font-size: 14px; }
.th-table .th-input { width: 180px; }

/* ---- Switch: a checkbox drawn as an on/off toggle ---- */
.th-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--ink-muted);
  cursor: pointer;
}
.th-switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--control-border);
  cursor: pointer;
  transition: background-color 120ms ease;
}
.th-switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: transform 120ms ease;
}
.th-switch input:checked { background: var(--brand); border-color: var(--brand); }
.th-switch input:checked::after { transform: translateX(16px); background: var(--on-brand); }
.th-switch input:disabled { opacity: 0.5; cursor: not-allowed; }
.th-switch input:checked + span { color: var(--ink); }

/* ---- Banner: a status line that says what happened, in words ---- */
.th-banner {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  font-size: 15px;
}
.th-banner strong { font-weight: 600; }
.th-banner--ok { background: var(--add-bg); color: var(--ink); }
.th-banner--ok::before { content: "✓"; color: var(--add-ink); font-weight: 700; }
.th-banner--warn { background: var(--risk-medium-bg); color: var(--ink); }
.th-banner--warn::before { content: "!"; color: var(--risk-medium-ink); font-weight: 700; }
.th-banner--error { background: var(--del-bg); color: var(--ink); }
.th-banner--error::before { content: "×"; color: var(--del-ink); font-weight: 700; }

/* ---- Pill: a neutral state label (disconnected, your key, revoked) ---- */
.th-pill {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid var(--control-border);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}
.th-pill--brand { border-color: var(--brand); color: var(--brand); }

/* ---- Empty state ---- */
.th-empty {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding: var(--space-8) var(--space-6);
  color: var(--ink-muted);
}
.th-empty strong { color: var(--ink); font-family: var(--font-display); font-size: 20px; line-height: 26px; }

/* ---- Stat: one figure with its label (cost totals) ---- */
.th-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.th-stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
}
.th-stat span { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.th-stat strong { font-family: var(--font-mono); font-size: 22px; line-height: 30px; font-weight: 500; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .th-panel__head, .th-panel__body { padding-left: var(--space-4); padding-right: var(--space-4); }
  .th-table th, .th-table td { padding-left: var(--space-4); padding-right: var(--space-4); }
  /* Header: logo and sign-out on top, the section tabs full width beneath. */
  .th-app-header__inner { gap: 0 var(--space-4); justify-content: space-between; }
  .th-app-header__inner > .th-logo { min-height: 56px; }
  .th-tabs { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--space-3)); }
  .th-tabs a { padding-top: var(--space-2); padding-bottom: var(--space-3); }
  .th-app-header__account > span { display: none; }
  /* Names may wrap on a phone rather than push the table sideways. */
  .th-table td.th-mono, .th-table .th-mono { white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .th-switch input, .th-switch input::after { transition: none; }
}

/* ---- Consent: the cookie choice, Accept and Reject equal in weight ---- */
.th-consent {
  position: fixed;
  right: max(var(--space-4), env(safe-area-inset-right, 0px));
  bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px));
  z-index: 20;
  width: min(440px, calc(100vw - 2 * var(--space-4)));
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-raised);
  font-size: 14px;
  line-height: 21px;
}
.th-consent h2 { margin: 0; font-family: var(--font-display); font-size: 18px; line-height: 24px; }
.th-consent p { margin: 0; color: var(--ink-muted); }
.th-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.th-consent__actions .th-button { min-height: 40px; padding: 0 var(--space-3); font-size: 14px; }

