/* Kerata design system.
   Tokens -> base -> layout -> components -> page sections -> utilities -> print.
   One accent (ink blue, --accent), warm off-white page, near-black text, hairline borders, no decorative gradients.
   Type scale (px): 12 13 15 16 18 20 24 30 40 52 (Inter).  Spacing: 4px grid (--s1 .. --s10).
   Radius: 6 / 8 / 12 / 16.  Every component reads colors from tokens only, so light / dark are the same CSS.
   Verdict colors (--ai / --mixed / --human) meet WCAG AA (>= 4.5:1) on every surface in both themes, and are always
   paired with a text label. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/aurora/fonts/inter-latin-wght.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/aurora/fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); }

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-xs: 12px; --t-sm: 13px; --t-base: 15px; --t-md: 16px; --t-lg: 18px; --t-xl: 20px;
  --t-2xl: 24px; --t-3xl: 30px; --t-4xl: 40px; --t-5xl: 52px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 48px; --s10: 72px;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
  --wrap: 1160px; --wrap-narrow: 760px; --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* light (primary) */
  --bg: #faf9f6; --bg-elev: #ffffff; --surface: #ffffff; --surface-2: #f3f2ee; --surface-3: #e9e7e1;
  --border: #e6e3dc; --border-strong: #8e897f;
  --text: #1a1915; --text-2: #4a4740; --text-3: #68645b;
  --accent: #24418f; --accent-hover: #1b3274; --accent-fg: #ffffff; --accent-soft: #e8ecf6;
  --focus: #24418f;
  --ai: #b23a12; --ai-soft: #fbeae3; --ai-rgb: 214, 84, 40;
  --mixed: #875a00; --mixed-soft: #f7eeda; --mixed-rgb: 205, 150, 30;
  --human: #1d6b45; --human-soft: #e3f0e7;
  --neutral: #625e55; --neutral-soft: #eeede8;
  --danger: #b42318; --danger-soft: #fbeceb; --success: #1d6b45; --success-soft: #e3f0e7;
  --warn: #875a00; --warn-soft: #f7eeda; --info: #24418f; --info-soft: #e8ecf6;
  --code-bg: #fcfbf9; --code-gutter: #6f6b62;
  --shadow-sm: 0 1px 2px rgba(26, 25, 21, .04);
  --shadow-md: 0 1px 2px rgba(26, 25, 21, .04);
  --shadow-lg: 0 10px 30px rgba(26, 25, 21, .10);
  /* legacy aliases (older markup / JS may still name these) */
  --brand: var(--accent); --brand-hover: var(--accent-hover); --brand-fg: var(--accent-fg); --brand-soft: var(--accent-soft);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #161718; --bg-elev: #1d1e20; --surface: #1d1e20; --surface-2: #242528; --surface-3: #2e2f33;
  --border: #303135; --border-strong: #6e6b65;
  --text: #eceae5; --text-2: #bebbb3; --text-3: #9c988f;
  --accent: #93a9e6; --accent-hover: #aebfee; --accent-fg: #111522; --accent-soft: #20283d;
  --focus: #aebfee;
  --ai: #f08c62; --ai-soft: #3a2219; --ai-rgb: 240, 140, 98;
  --mixed: #ddb052; --mixed-soft: #33291a; --mixed-rgb: 221, 176, 82;
  --human: #6cc593; --human-soft: #1b2e23;
  --neutral: #a29e95; --neutral-soft: #2a2a2b;
  --danger: #f2877a; --danger-soft: #3a1f1c; --success: #6cc593; --success-soft: #1b2e23;
  --warn: #ddb052; --warn-soft: #33291a; --info: #93a9e6; --info-soft: #20283d;
  --code-bg: #1a1b1d; --code-gutter: #8d8a83;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #161718; --bg-elev: #1d1e20; --surface: #1d1e20; --surface-2: #242528; --surface-3: #2e2f33;
  --border: #303135; --border-strong: #6e6b65;
  --text: #eceae5; --text-2: #bebbb3; --text-3: #9c988f;
  --accent: #93a9e6; --accent-hover: #aebfee; --accent-fg: #111522; --accent-soft: #20283d;
  --focus: #aebfee;
  --ai: #f08c62; --ai-soft: #3a2219; --ai-rgb: 240, 140, 98;
  --mixed: #ddb052; --mixed-soft: #33291a; --mixed-rgb: 221, 176, 82;
  --human: #6cc593; --human-soft: #1b2e23;
  --neutral: #a29e95; --neutral-soft: #2a2a2b;
  --danger: #f2877a; --danger-soft: #3a1f1c; --success: #6cc593; --success-soft: #1b2e23;
  --warn: #ddb052; --warn-soft: #33291a; --info: #93a9e6; --info-soft: #20283d;
  --code-bg: #1a1b1d; --code-gutter: #8d8a83;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ------------------------------------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--t-base)/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
p { margin: 0 0 var(--s3); }
h1, h2, h3, h4 { margin: 0 0 var(--s3); line-height: 1.2; letter-spacing: -.012em; font-weight: 650; color: var(--text); }
h1 { font-size: var(--t-4xl); line-height: 1.12; letter-spacing: -.024em; font-weight: 700; }
h2 { font-size: var(--t-3xl); letter-spacing: -.02em; }
h3 { font-size: var(--t-lg); font-weight: 600; }
h4 { font-size: var(--t-md); font-weight: 600; }
small { font-size: var(--t-xs); }
code, kbd, pre { font-family: var(--mono); font-size: .92em; font-variant-ligatures: none; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s3); top: -200px; z-index: 100; background: var(--surface); color: var(--text);
  padding: var(--s2) var(--s3); border-radius: var(--r-md); }
.skip-link:focus { top: var(--s3); box-shadow: var(--shadow-lg); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important;
  animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ------------------------------------------------------------------------------------------------ layout */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s6); }
.wrap.narrow { max-width: var(--wrap-narrow); }
@media (max-width: 640px) { .wrap { padding: 0 var(--s4); } }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s6); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.section { padding: var(--s10) 0; }
.section.tight { padding: var(--s8) 0; }
.section + .section { border-top: 1px solid var(--border); }
@media (max-width: 640px) { .section { padding: var(--s8) 0; } }
.page-head { padding: var(--s9) 0 var(--s6); }
.page-head h1 { margin-bottom: var(--s2); }
.page-head .lede { max-width: 640px; }
.app-main { padding-top: var(--s7); padding-bottom: var(--s10); }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  margin-bottom: var(--s6); }
.app-head h1 { font-size: var(--t-3xl); margin: 0; }
.app-head p { margin: var(--s1) 0 0; color: var(--text-2); }

/* ------------------------------------------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: var(--s6); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650;
  font-size: 19px; letter-spacing: -.02em; text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark .bm-bg { fill: var(--accent); }
.brand-mark .bm-k { stroke: var(--accent-fg); }
.brand-name { line-height: 1; }
.nav { display: flex; align-items: center; gap: var(--s1); }
.nav a { color: var(--text-2); font-weight: 500; font-size: 14.5px; padding: 7px 12px; border-radius: var(--r-md);
  line-height: 20px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.auth-slot { display: flex; align-items: center; gap: var(--s2); min-width: 176px; justify-content: flex-end; }
html:not([data-auth]) .auth-slot > * { visibility: hidden; }
html[data-auth="in"] .when-out, html[data-auth="out"] .when-in, html:not([data-auth]) .when-in { display: none !important; }
.header-actions .menu-toggle { display: none; }
@media (max-width: 860px) {
  .site-header .nav { display: none; }
  .header-actions .menu-toggle { display: inline-grid; }
  .auth-slot { min-width: 0; }
  .auth-slot .hide-sm { display: none; }
}
.mobile-nav { position: fixed; inset: var(--header-h) 0 auto 0; z-index: 39; background: var(--bg-elev);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: var(--s3) var(--s4) var(--s5); }
.mobile-nav a { display: block; padding: 12px var(--s2); color: var(--text); font-weight: 500; border-radius: var(--r-md); }
.mobile-nav a:hover { background: var(--surface-2); text-decoration: none; }
.mobile-nav hr { margin: var(--s2) 0; }

/* account menu */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s2); }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: var(--s2); width: 100%; padding: 9px 10px;
  border-radius: var(--r-md); color: var(--text); font: 500 var(--t-base)/1.3 var(--font); background: none; border: 0;
  cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: var(--s1); min-width: 0; }
.menu-who b { display: block; font-size: var(--t-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who span { display: block; color: var(--text-3); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: var(--t-sm); line-height: 1; border: 0; }

/* ------------------------------------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); padding: var(--s9) 0 var(--s7);
  color: var(--text-2); font-size: var(--t-sm); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s7); }
.footer-grid h4 { font-size: var(--t-sm); color: var(--text); margin-bottom: var(--s3); text-transform: none; }
.footer-grid a { display: block; color: var(--text-2); padding: 3px 0; }
.footer-grid a:hover { color: var(--text); }
.footer-grid a.brand { display: inline-flex; color: var(--text); padding: 0; }
.footer-note { max-width: 320px; margin-top: var(--s3); }
.footer-bottom { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; color: var(--text-3); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------------------------------------ text */
.eyebrow { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-xs); font-weight: 600;
  color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: var(--s3); }
.eyebrow svg { width: 16px; height: 16px; flex: none; }
.lede { font-size: var(--t-lg); color: var(--text-2); line-height: 1.6; }
.lede.lg { font-size: var(--t-lg); }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.hint { color: var(--text-3); font-size: var(--t-sm); }
.num { font-variant-numeric: tabular-nums; }
.gradient-text { color: inherit; }  /* legacy class name; no gradient text */
.accent-text { color: var(--accent); }
.prose { max-width: 720px; font-size: var(--t-md); line-height: 1.72; color: var(--text-2); }
.prose h2 { margin-top: var(--s8); font-size: var(--t-2xl); color: var(--text); }
.prose h3 { margin-top: var(--s6); color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--s4); }
.prose li { margin: var(--s1) 0; }
.prose strong, .prose b { color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: var(--t-sm); }

/* ------------------------------------------------------------------------------------------------ buttons */
.btn { --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--h);
  padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid transparent; font: 600 var(--t-base)/1 var(--font);
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s var(--ease), border-color .15s,
  color .15s, box-shadow .15s; user-select: none; -webkit-user-select: none; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.95); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { --h: 34px; padding: 0 var(--s3); font-size: var(--t-sm); border-radius: var(--r-md); }
.btn-lg { --h: 48px; padding: 0 var(--s6); font-size: var(--t-md); border-radius: var(--r-md); }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--r-md);
  background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.btn .spinner { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: var(--t-sm); font-weight: 600; color: var(--text); }
.field .opt { color: var(--text-3); font-weight: 400; }
.field-help { font-size: var(--t-xs); color: var(--text-3); }
.field-error { font-size: var(--t-xs); color: var(--danger); font-weight: 500; }
.input, .select, .textarea { width: 100%; min-width: 0; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); font: 400 var(--t-base)/1.4 var(--font);
  padding: 0 12px; height: 40px; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; padding: 12px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--border-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23778' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-sm, .select-sm { height: 34px; font-size: var(--t-sm); }
.checkbox { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: var(--t-base); color: var(--text-2); }
.checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.input-group { display: flex; gap: var(--s2); align-items: stretch; }
.input-group .input { flex: 1; }
@media (max-width: 560px) { .input-group { flex-direction: column; } .input-group .btn { width: 100%; } }

/* ------------------------------------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); min-width: 0; }
.card-quiet { background: transparent; box-shadow: none; }
.card-pad { padding: var(--s6); }
.card-pad-sm { padding: var(--s4); }
@media (max-width: 640px) { .card-pad { padding: var(--s5) var(--s4); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: var(--t-md); }
.card-body { padding: var(--s5); }
.card-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg); }
.feature { padding: var(--s6); }
.feature-icon { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: var(--s4);
  background: var(--surface); border: 1px solid var(--border); color: var(--accent); }
.feature-icon svg { width: 18px; height: 18px; stroke-width: 1.75; }
.feature h3 { margin-bottom: var(--s2); }
.feature p { color: var(--text-2); margin: 0; }

/* ------------------------------------------------------------------------------------------------ badges / chips */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: 600; line-height: 1; white-space: nowrap; border: 1px solid transparent; }
.badge svg { width: 12px; height: 12px; flex: none; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ai { color: var(--ai); background: var(--ai-soft); }
.badge-mixed { color: var(--mixed); background: var(--mixed-soft); }
.badge-human { color: var(--human); background: var(--human-soft); }
.badge-neutral { color: var(--neutral); background: var(--neutral-soft); }
.badge-brand { color: var(--accent); background: var(--accent-soft); }
.badge-outline { color: var(--text-2); border-color: var(--border-strong); background: transparent; }
.badge-lg { height: 30px; padding: 0 12px; font-size: var(--t-sm); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border); font-size: var(--t-sm); color: var(--text-2); white-space: nowrap; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 5px; color: var(--text-2); background: var(--surface); }

/* ------------------------------------------------------------------------------------------------ alerts / toast */
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md);
  border: 1px solid; font-size: var(--t-sm); line-height: 1.5; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert > div { min-width: 0; flex: 1; }
.alert b { display: block; margin-bottom: 2px; }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text); }
.alert-info svg { color: var(--info); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); }
.alert-warn svg { color: var(--warn); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); }
.alert-error svg { color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--text); }
.alert-success svg { color: var(--success); }
.toasts { position: fixed; z-index: 90; bottom: var(--s5); left: 50%; transform: translateX(-50%); display: flex;
  flex-direction: column; gap: var(--s2); align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: var(--t-sm); font-weight: 500; animation: toast-in .25s var(--ease); max-width: 100%; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------------------------------------ dialog */
dialog.modal { border: 1px solid var(--border); border-radius: var(--r-xl); padding: 0; background: var(--bg-elev);
  color: var(--text); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.modal::backdrop { background: rgba(20, 19, 16, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s5) var(--s5) 0; }
.modal-head h2 { font-size: var(--t-lg); margin: 0; }
.modal-body { padding: var(--s4) var(--s5); color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: 0 var(--s5) var(--s5); flex-wrap: wrap; }

/* ------------------------------------------------------------------------------------------------ tabs (segmented) */
.tabs { display: inline-flex; gap: var(--s1); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 14px; border-radius: 0; border: 0;
  border-bottom: 2px solid transparent; background: transparent; color: var(--text-2);
  font: 500 14.5px/1 var(--font); cursor: pointer; white-space: nowrap; }
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tab[aria-selected="true"] svg { color: var(--accent); }

/* ------------------------------------------------------------------------------------------------ loaders */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); border-radius: inherit;
  transition: width .4s var(--ease); }
.progress.indeterminate > i { width: 35%; animation: indet 1.2s var(--ease) infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }

/* ------------------------------------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: var(--t-xs); text-transform: uppercase;
  letter-spacing: .05em; padding: 10px var(--s4); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.table td { padding: 12px var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
@media (max-width: 640px) {   /* long set names + number columns must fit a phone without sideways scrolling */
  .table-wrap-sm th { white-space: normal; letter-spacing: 0; }
  .table-wrap-sm th, .table-wrap-sm td { padding: 10px 10px; }
  .table-wrap-sm td:first-child { font-size: var(--t-xs); line-height: 1.4; }
  .menu-panel { right: 0; max-width: calc(100vw - 32px); }
}
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

/* ------------------------------------------------------------------------------------------------ empty states */
.empty { text-align: center; padding: var(--s9) var(--s5); color: var(--text-2); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto var(--s4); border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3); }
.empty-icon svg { width: 22px; height: 22px; }
.empty h3 { margin-bottom: var(--s2); }
.empty p { max-width: 420px; margin: 0 auto var(--s4); }

/* ------------------------------------------------------------------------------------------------ hero / landing */
.hero { position: relative; padding: var(--s10) 0 var(--s9); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
.hero-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: var(--t-5xl); line-height: 1.06; letter-spacing: -.03em; margin-bottom: var(--s5); }
.hero .lede { font-size: var(--t-lg); max-width: 620px; margin: 0 auto var(--s2); }
.hero-inner > [data-check-area] { width: 100%; max-width: 960px; margin: 0 auto; }
.hero-trust { display: flex; justify-content: center; gap: var(--s5); flex-wrap: wrap; color: var(--text-3);
  font-size: var(--t-sm); margin-top: var(--s4); }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { width: 15px; height: 15px; color: var(--text-3); }
@media (max-width: 640px) { .hero { padding: var(--s8) 0 var(--s7); } .hero h1 { font-size: 34px; }
  .hero .lede { font-size: var(--t-md); } h1 { font-size: var(--t-3xl); } h2 { font-size: var(--t-2xl); } }

/* stat row: one bordered strip split by hairlines (not a grid of floating cards) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.stat-grid > .stat { border: 0; border-radius: 0; box-shadow: none; background: none; border-left: 1px solid var(--border); margin-left: -1px;
  border-top: 1px solid var(--border); margin-top: -1px; }
.stat { padding: var(--s6); }
.stat b { display: block; font-size: var(--t-3xl); font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.stat span { display: block; color: var(--text-2); font-size: var(--t-sm); margin-top: var(--s2); line-height: 1.5; }
@media (max-width: 640px) { .stat { padding: var(--s5); } .stat b { font-size: var(--t-2xl); } }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 44px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px;
  border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: var(--t-sm); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.faq { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: var(--s5) 0; font-weight: 600; font-size: var(--t-md);
  display: flex; justify-content: space-between; gap: var(--s4); align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--text-3); font-weight: 400; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--text-2); padding-bottom: var(--s4); margin: 0; max-width: 760px; }
.cta-band { text-align: center; padding: var(--s9) var(--s5); border-radius: var(--r-xl); background: var(--surface);
  border: 1px solid var(--border); }

/* ------------------------------------------------------------------------------------------------ checker */
.checker { overflow: hidden; }
.checker { box-shadow: 0 1px 2px rgba(26, 25, 21, .04), 0 8px 24px rgba(26, 25, 21, .05); text-align: left; }
.checker-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 0 var(--s4) 0 var(--s3);
  flex-wrap: wrap; box-shadow: inset 0 -1px 0 var(--border); }
.checker-pane { padding: var(--s4); }
.code-input { display: block; width: 100%; min-height: 280px; max-height: 60vh; resize: vertical; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--code-bg); color: var(--text); font: 400 13px/1.6 var(--mono); font-variant-ligatures: none; padding: 14px 16px;
  tab-size: 4; white-space: pre; overflow: auto; }
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.checker-bar { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4) var(--s4); flex-wrap: wrap; }
.checker-bar .meta { color: var(--text-3); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.checker-bar .spacer { flex: 1; }
.checker-bar .input { max-width: 220px; height: 36px; font-size: var(--t-sm); }
@media (max-width: 560px) { .checker-bar .input { max-width: none; flex: 1 1 100%; order: -1; }
  .checker-bar .btn-primary { flex: 1; } }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s2);
  min-height: 280px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--code-bg);
  padding: var(--s6); cursor: pointer; color: var(--text-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.dropzone svg { width: 28px; height: 28px; color: var(--text-3); }
.dropzone b { color: var(--text); font-size: var(--t-md); }
.file-pill { display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; padding: 6px 10px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); font-family: var(--mono); font-size: var(--t-sm); color: var(--text); }
.file-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-pane { min-height: 280px; display: flex; flex-direction: column; gap: var(--s4); justify-content: center; padding: var(--s6);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--code-bg); }
.gh-pane .examples { display: flex; flex-wrap: wrap; gap: var(--s2); }
.progress-panel { padding: var(--s5); border-top: 1px solid var(--border); }
.progress-panel .row-between { margin-bottom: var(--s3); }
.stage-list { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s2); }
.stage-list li { display: flex; align-items: center; gap: var(--s2); color: var(--text-3); font-size: var(--t-sm); }
.stage-list li .ic { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
.stage-list li.done { color: var(--text-2); }
.stage-list li.done .ic { color: var(--human); }
.stage-list li.on { color: var(--text); font-weight: 500; }

/* ------------------------------------------------------------------------------------------------ result */
.result { display: flex; flex-direction: column; gap: var(--s5); }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.result-head h1, .result-head h2 { margin: 0; font-size: var(--t-2xl); overflow-wrap: anywhere; }
.result-head .sub { color: var(--text-3); font-size: var(--t-sm); margin-top: var(--s1); overflow-wrap: anywhere; }
.result-head .sub svg { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.result-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
@media (max-width: 560px) { .result-actions { gap: 6px; } .result-actions .btn-sm { padding: 0 10px; } .result-actions .btn-sm svg { width: 15px; height: 15px; } }
.summary-card { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: var(--s7); align-items: center; padding: var(--s6) var(--s7); }
@media (max-width: 720px) { .summary-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center;
  gap: var(--s5); padding: var(--s6) var(--s4); } .summary-card .verdict-row, .summary-card .facts { justify-content: center; }
  .summary-card .scale { margin-left: auto; margin-right: auto; } }
/* score gauge: the SVG ring and the number share one square box; the number is centered with grid, never by
   padding / magic offsets, and uses tabular figures so 7% and 87% sit on the same optical center. */
.gauge { position: relative; width: 168px; height: 168px; display: grid; place-items: center; flex: none; }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { stroke: var(--surface-3); }
.gauge .value { stroke: var(--gauge-color, var(--accent)); transition: stroke-dashoffset .9s var(--ease); }
.gauge-center { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1; }
.gauge-num { display: inline-flex; align-items: baseline; justify-content: center; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--text); }
.gauge-num .n { font-size: 44px; line-height: 1; }
.gauge-num .u { font-size: 20px; line-height: 1; margin-left: 1px; color: var(--text-2); font-weight: 600; }
.gauge-cap { margin-top: 6px; font-size: var(--t-xs); color: var(--text-3); font-weight: 500; letter-spacing: .01em; }
.gauge.na .gauge-num .n { font-size: 34px; color: var(--text-3); }
.gauge.sm { width: 64px; height: 64px; }
.gauge.sm .gauge-num .n { font-size: 18px; }
.gauge.sm .gauge-num .u { font-size: 11px; }
.verdict-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
.verdict-title { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 0; }
.verdict-text { color: var(--text-2); font-size: var(--t-md); max-width: 620px; margin-bottom: var(--s4); }
.facts { display: flex; gap: var(--s2) var(--s5); flex-wrap: wrap; color: var(--text-3); font-size: var(--t-sm); margin-top: var(--s4); }
.facts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.scale { position: relative; max-width: 460px; }
.scale-bar { position: relative; height: 8px; border-radius: var(--r-full); display: flex; overflow: hidden; background: var(--surface-3); }
.scale-bar i { height: 100%; }
.scale-bar .h { background: color-mix(in srgb, var(--human) 70%, transparent); }
.scale-bar .m { background: color-mix(in srgb, var(--mixed) 70%, transparent); }
.scale-bar .a { background: color-mix(in srgb, var(--ai) 75%, transparent); }
.scale-marker { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--text);
  box-shadow: 0 0 0 2px var(--surface); transition: left .9s var(--ease); }
.scale-labels { position: relative; height: 18px; margin-top: 6px; font-size: var(--t-xs); color: var(--text-3); }
.scale-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.scale-labels span:first-child { left: 0 !important; transform: none; }
.scale-labels span:last-child { left: auto !important; right: 0; transform: none; }

.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 900px) { .info-grid { grid-template-columns: minmax(0, 1fr); } }
.info-card { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.info-card h3 { font-size: var(--t-sm); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.info-card .big { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.01em; color: var(--text); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.info-card p { margin: 0; color: var(--text-2); font-size: var(--t-sm); }
.meter { display: flex; gap: 4px; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.meter i.on { background: var(--accent); }
.vendor-row { display: flex; align-items: center; gap: var(--s3); font-size: var(--t-sm); }
.vendor-row .name { width: 150px; flex: none; color: var(--text); font-weight: 500; }
.vendor-row .bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.vendor-row .bar i { display: block; height: 100%; background: var(--text-3); border-radius: inherit; }
.vendor-row .v { width: 72px; text-align: right; color: var(--text-3); flex: none; font-size: var(--t-xs); }

/* sections list */
.section-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
.section-list li { min-width: 0; }
.section-item { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; width: 100%; font: inherit; color: var(--text); }
.section-item:hover { border-color: var(--accent); }
.section-item .loc { font-family: var(--mono); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.section-item .pct { font-variant-numeric: tabular-nums; color: var(--ai); font-weight: 600; font-size: var(--t-sm); flex: none; }

/* files + viewer */
.files-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (max-width: 960px) { .files-layout { grid-template-columns: minmax(0, 1fr); } }
.file-list { max-height: 72vh; overflow: auto; padding: var(--s2); position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 960px) { .file-list { position: static; max-height: 320px; } }
.file-list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s2) var(--s3); }
.file-list-head .input { height: 32px; font-size: var(--t-sm); }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s2); width: 100%;
  padding: 8px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.file-row:hover { background: var(--surface-2); }
.file-row[aria-current="true"] { background: var(--accent-soft); }
.file-row .fn { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.file-row .fsub { display: block; direction: ltr; font-family: var(--font); color: var(--text-3); font-size: 11px; margin-top: 2px; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 22px; padding: 0 8px;
  border-radius: var(--r-full); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.score-pill.ai { color: var(--ai); background: var(--ai-soft); }
.score-pill.mixed { color: var(--mixed); background: var(--mixed-soft); }
.score-pill.human { color: var(--human); background: var(--human-soft); }
.score-pill.neutral { color: var(--neutral); background: var(--neutral-soft); }
.viewer { overflow: hidden; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border); }
.viewer-head .fname { font-family: var(--mono); font-size: var(--t-sm); font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.viewer-head .fmeta { color: var(--text-3); font-size: var(--t-xs); margin-top: 2px; }
.legend { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; font-size: var(--t-xs); color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; flex: none; border: 1px solid var(--border); }
.legend .l-ai { background: rgba(var(--ai-rgb), .25); border-color: rgba(var(--ai-rgb), .5); }
.legend .l-mixed { background: rgba(var(--mixed-rgb), .16); border-color: rgba(var(--mixed-rgb), .45); }
.legend .l-none { background: var(--code-bg); }
.legend .l-sec { background: transparent; border: 0; border-left: 3px solid var(--ai); border-radius: 0; width: 6px; }
.code { font: 400 12.5px/1.65 var(--mono); font-variant-ligatures: none; background: var(--code-bg); overflow: auto; max-height: 75vh; counter-reset: ln; }
.code-line { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-width: max-content; border-left: 3px solid transparent; }
.code-line .ln { color: var(--code-gutter); text-align: right; padding: 0 12px 0 0; user-select: none; -webkit-user-select: none;
  font-variant-numeric: tabular-nums; position: sticky; left: 0; background: var(--code-bg); }
.code-line .tx { white-space: pre; padding: 0 16px 0 8px; tab-size: 4; }
.code-line.sec { border-left-color: var(--ai); }
.code-line.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--accent) 18%, transparent); } }
.code-empty { padding: var(--s6); color: var(--text-3); font-size: var(--t-sm); }
.code-note { padding: var(--s2) var(--s4); font-size: var(--t-xs); color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--surface-2); }

.explain { padding: var(--s6); }
.explain h2 { font-size: var(--t-lg); }
.explain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s7); }
@media (max-width: 760px) { .explain-grid { grid-template-columns: minmax(0, 1fr); } }
.explain-grid h3 { font-size: var(--t-base); margin-bottom: var(--s1); }
.explain-grid p { color: var(--text-2); font-size: var(--t-sm); margin: 0; }
.disclaimer { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: var(--t-sm); }
.disclaimer svg { width: 18px; height: 18px; flex: none; color: var(--text-3); margin-top: 1px; }

/* ------------------------------------------------------------------------------------------------ history */
.toolbar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 240px; min-width: 0; position: relative; }
.toolbar .search .input { padding-left: 36px; height: 36px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.toolbar .select { width: auto; height: 36px; font-size: var(--t-sm); min-width: 140px; }
@media (max-width: 560px) { .toolbar .select { flex: 1 1 45%; min-width: 0; } }
.scan-list { list-style: none; margin: 0; padding: 0; }
.scan-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border); }
.scan-item:last-child { border-bottom: 0; }
.scan-item:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.scan-item .title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.scan-item .title:hover { text-decoration: underline; }
.scan-item .meta { display: flex; gap: var(--s2) var(--s3); flex-wrap: wrap; align-items: center; color: var(--text-3); font-size: var(--t-xs); margin-top: 4px; }
.scan-item .meta .badge { height: 20px; font-size: 11px; padding: 0 8px; }
.scan-item .acts { display: flex; gap: 2px; }
@media (max-width: 560px) { .scan-item { grid-template-columns: 48px minmax(0, 1fr); } .scan-item .acts { grid-column: 1 / -1; justify-content: flex-end; margin-top: -4px; }
  .scan-item .gauge.sm { width: 48px; height: 48px; } .scan-item .gauge.sm .gauge-num .n { font-size: 14px; } .scan-item .gauge.sm .gauge-num .u { font-size: 9px; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--border);
  color: var(--text-3); font-size: var(--t-sm); flex-wrap: wrap; }

/* ------------------------------------------------------------------------------------------------ auth pages */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 120px); display: grid; place-items: center; padding: var(--s9) var(--s4); }
.auth-col { width: 100%; max-width: 420px; }
.auth-card { width: 100%; padding: var(--s7); }
@media (max-width: 480px) { .auth-card { padding: var(--s6) var(--s4); } }
.auth-card h1 { font-size: var(--t-2xl); margin-bottom: var(--s1); text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-2); margin-bottom: var(--s6); }
.auth-card form { display: flex; flex-direction: column; gap: var(--s4); }
.auth-foot { text-align: center; margin-top: var(--s5); color: var(--text-2); font-size: var(--t-sm); }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--text-3); font-size: var(--t-xs); margin: var(--s1) 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.btn-google { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-google:hover:not(:disabled) { background: var(--surface-2); }
.btn-google svg { width: 18px; height: 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.seg button { height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 600 var(--t-sm)/1 var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 2px; }

/* ------------------------------------------------------------------------------------------------ settings / app nav */
.app-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s7); align-items: start; }
@media (max-width: 860px) { .app-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s4); } }
.side-nav { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; }
.side-nav a svg { width: 17px; height: 17px; flex: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.side-nav a[aria-current="page"] svg { color: var(--accent); }
.side-nav .group { font-size: var(--t-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: var(--s4) 12px var(--s1); }
@media (max-width: 860px) { .side-nav { position: static; flex-direction: row; overflow-x: auto; gap: var(--s1); padding-bottom: var(--s1); scrollbar-width: none; }
  .side-nav a { white-space: nowrap; } .side-nav .group { display: none; } }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s6); padding: var(--s5) var(--s6); border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting h3 { font-size: var(--t-base); margin-bottom: var(--s1); }
.setting p { color: var(--text-3); font-size: var(--t-sm); margin: 0; }
@media (max-width: 760px) { .setting { grid-template-columns: minmax(0, 1fr); gap: var(--s3); padding: var(--s4); } }
.usage { display: grid; gap: var(--s2); }
.usage .row-between { font-size: var(--t-sm); }
.secret-box { display: flex; gap: var(--s2); align-items: center; padding: var(--s2) var(--s2) var(--s2) var(--s3); background: var(--code-bg);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); font-family: var(--mono); font-size: var(--t-sm); }
.secret-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: none; border: 0; padding: 0; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); align-items: stretch; }
@media (max-width: 1040px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan { display: flex; flex-direction: column; padding: var(--s6); position: relative; }
.plan.featured { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan .tag { position: absolute; top: -11px; left: var(--s6); }
.plan h3 { margin-bottom: var(--s1); }
.plan .aud { color: var(--text-3); font-size: var(--t-sm); min-height: 42px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; margin: var(--s4) 0; }
.plan .price b { font-size: var(--t-4xl); font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.plan .price span { color: var(--text-3); }
.plan ul { list-style: none; padding: 0; margin: 0 0 var(--s6); display: grid; gap: var(--s2); flex: 1; }
.plan li { display: flex; gap: var(--s2); color: var(--text-2); font-size: var(--t-sm); align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; flex: none; color: var(--accent); margin-top: 2px; }

.legal-note { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--text); font-size: var(--t-sm); margin-bottom: var(--s6); }
.error-page { text-align: center; padding: var(--s10) var(--s4); }
.error-page .code-big { font-size: 88px; font-weight: 650; letter-spacing: -.04em; line-height: 1; margin-bottom: var(--s4); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------------------------------------ utilities */
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); } .mt-8 { margin-top: var(--s8); }
.mb-2 { margin-bottom: var(--s2); } .mb-4 { margin-bottom: var(--s4); } .mb-6 { margin-bottom: var(--s6); }
.center { text-align: center; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ai-text { color: var(--ai); } .human-text { color: var(--human); } .mixed-text { color: var(--mixed); }

/* ------------------------------------------------------------------------------------------------ print */
.print-only { display: none; }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --bg-elev: #fff; --surface: #fff; --surface-2: #f4f5f7; --surface-3: #e6e8ec;
    --text: #000; --text-2: #222; --text-3: #555; --border: #d6d9de; --code-bg: #fff; --shadow-md: none; --shadow-sm: none; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .no-print, .result-actions, .toasts, .skip-link, .file-list-head .input, .side-nav { display: none !important; }
  .print-only { display: block; }
  .app-main, .section { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .files-layout { grid-template-columns: minmax(0, 1fr); }
  .file-list { position: static; max-height: none; overflow: visible; }
  .code { max-height: none; overflow: visible; font-size: 8.5pt; }
  .code-line { min-width: 0; }
  .code-line .tx { white-space: pre-wrap; word-break: break-all; }
  .code-line .ln { position: static; }
  a { color: #000; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* icon sizing inside composite components */
.menu-panel svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.menu-panel .ai-text svg { color: currentColor; }
.file-pill svg, .stage-list .ic svg, .chip svg { width: 14px; height: 14px; flex: none; }
.result-head .sub a { color: var(--text-2); }

.lbl-sm { display: none; }
.code-input:placeholder-shown { white-space: normal; overflow: hidden; }
@media (max-width: 560px) {
  .checker-top { box-shadow: none; padding: 0; }
  .checker-top .tabs { width: 100%; box-shadow: inset 0 -1px 0 var(--border); gap: 0; }
  .checker-top .tab { flex: 1; justify-content: center; padding: 0 8px; }
  .checker-top [data-sample] { margin: var(--s1) var(--s1) 0 auto; }
  .checker-pane { padding: var(--s1) var(--s3) var(--s3); } .checker-bar { padding: 0 var(--s3) var(--s3); }
  .lbl-lg { display: none; } .lbl-sm { display: inline; }
  .code-input { min-height: 220px; }
  .dropzone, .gh-pane { min-height: 220px; }
}

/* ------------------------------------------------------------------------------------------------ QA fixes (2026-11-14) */
/* contact page: form + side column side by side only when there is room */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); align-items: start; }
@media (min-width: 761px) { .contact-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
/* menus never leave the viewport (core.js clamps; this is the default for left-edge triggers on phones) */
.menu-panel { max-width: calc(100vw - 24px); }
@media (max-width: 560px) { .result-actions .menu:first-of-type .menu-panel { right: auto; left: 0; } }
/* the code viewer is the offset parent for its rows (section jumps compute row.offsetTop against it) */
.code { position: relative; overscroll-behavior: auto; }
/* programmatic focus on headings (tabindex=-1) never draws a ring */
[tabindex="-1"]:focus { outline: none; }
/* line shading is never applied to blank / import-only lines; tooltips say "relative" */
.code-line[data-quiet] { background: none !important; }
/* too-short results: muted dash, no number */
.gauge.short .gauge-num .n { font-size: 34px; color: var(--text-3); }
.gauge.na .value, .gauge.short .value { display: none; }
.score-pill.short { min-width: 0; font-weight: 500; color: var(--text-3); background: var(--neutral-soft); }
/* tap targets on phones */
@media (max-width: 640px) {
  .icon-btn { width: 44px; height: 44px; }
  .btn-sm { min-height: 40px; }
  .site-footer a { padding: 6px 0; }
  .verdict-text { text-align: left; }
  .summary-card { text-align: left; justify-items: stretch; }
  .summary-card .gauge { justify-self: center; }
  .summary-card .verdict-row, .summary-card .facts { justify-content: flex-start; }
}
/* API keys page on phones: the table scrolls inside its card, inputs keep their height */
.keys-table-wrap { overflow-x: auto; max-width: 100%; }
.input-group .input { min-height: 40px; }
.app-layout > div { min-width: 0; }
@media (max-width: 640px) { .side-nav { overflow-x: auto; max-width: 100%; } }
.kbd-hint { white-space: nowrap; }
.show-more { margin-top: var(--s2); }
.progress.indeterminate > i { animation: indet 1.5s ease-in-out infinite; }
.field-error:empty { display: none; }
.stage-list.plain li { color: var(--text-2); }
.verdict-title .badge-dot-only { padding: 0; background: none; border: 0; vertical-align: middle; margin-right: 2px; }
.verdict-title .badge-dot-only .dot { width: 12px; height: 12px; }
.plan ul { align-content: start; }
.plan .price b.txt { font-size: var(--t-2xl); }
.plan .price { min-height: 44px; }
/* absolutely positioned sr-only text inside a scrolling table must not widen the page */
.table-wrap, .code-line .tx { position: relative; }
@media (max-width: 960px) { .file-list { position: relative; } }
.keys-table-wrap td:first-child { min-width: 150px; }

/* ------------------------------------------------------------------------------------------------ Kerata refinements */
/* section rhythm: alternating plain / hairline-separated bands, generous whitespace */
.section-head { max-width: 640px; margin: 0 auto var(--s8); text-align: center; }
.section-head h2 { margin-bottom: var(--s3); }
.section-head .lede { margin: 0; }
.section-alt { background: var(--surface); }
.feature h3 { font-size: var(--t-md); font-weight: 600; }
.grid-3 > .feature.card, .grid-4 > .feature { box-shadow: none; }
.who .feature { padding: 0; }
/* landing accuracy band */
.accuracy-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s7); }
.accuracy-head h2 { margin-bottom: var(--s2); }
.accuracy-head .lede { max-width: 640px; margin: 0; }
/* plain text link with an arrow */
.link-arrow { font-weight: 600; color: var(--accent); white-space: nowrap; }
.hero-trust { gap: var(--s2) var(--s5); }
@media (max-width: 640px) { .lede { font-size: var(--t-md); } .section-head { margin-bottom: var(--s6); } .hero-trust { justify-content: flex-start; } }
/* menus and dialogs: flat surfaces with a hairline */
.menu-panel { box-shadow: var(--shadow-lg); }
/* form focus: one accent ring, no glow */
.input:focus, .select:focus, .textarea:focus, .code-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
/* the theme-color for mobile browsers follows the page background */
/* pricing: a worded price ("Coming soon", "Contact us") stacks its note underneath instead of beside it */
.plan .price:has(b.txt) { flex-direction: column; align-items: flex-start; gap: 2px; }
