/* ════════════════════════════════════════════════════════════════
   Lawgorithm — design tokens
   Tier 1: raw palette (mode independent)
   Tier 2: semantic roles, LIGHT in :root, DARK in [data-theme="dark"]
   Components only ever reference Tier 2.
   ════════════════════════════════════════════════════════════════ */
:root {
  /* tier 1 */
  --c-cream: #fff9f1;
  --c-paper: #fffdf8;
  --c-sand: #f1ead6;
  --c-sand-2: #e8dfc4;
  --c-ink: #0b0b0c;
  --c-ink-2: #3a3833;
  --c-gold: #ffd43f;
  --c-coral: #fc9073;
  --c-night: #0c0c10;
  --c-night-2: #15151b;
  --c-night-3: #1e1e26;

  /* risk palette */
  --c-red: #e2462e;
  --c-red-soft: #fde3da;
  --c-amber: #e2a200;
  --c-amber-soft: #fff1c4;
  --c-green: #2f8f5b;
  --c-green-soft: #dcf0e2;

  /* tier 2 — light */
  --bg: var(--c-cream);
  --surface: var(--c-paper);
  --surface-raised: var(--c-sand);
  --surface-sunk: #f6f0e2;
  --text: var(--c-ink);
  --text-soft: #57534a;
  --text-faint: #8a8578;
  --line: rgba(11, 11, 12, 0.12);
  --line-strong: var(--c-ink);
  --accent: var(--c-coral);
  --accent-2: var(--c-gold);
  --btn-bg: var(--c-ink);
  --btn-text: var(--c-cream);
  --nav-glass: rgba(255, 249, 241, 0.72);
  --shadow-card: 0 1px 0 rgba(11, 11, 12, 0.04), 0 24px 48px -28px rgba(60, 45, 20, 0.35);
  --shadow-pop: 0 18px 40px -18px rgba(11, 11, 12, 0.45);
  --red: var(--c-red);       --red-soft: var(--c-red-soft);
  --amber: var(--c-amber);   --amber-soft: var(--c-amber-soft);
  --green: var(--c-green);   --green-soft: var(--c-green-soft);
  --grain-opacity: 0.35;

  /* type */
  --font-display: "Fraunces", "Noto Serif Devanagari", "Noto Serif Tamil", "Noto Serif Bengali", "Noto Serif Telugu", "Noto Serif Kannada", Georgia, serif;
  --font-body: "Space Grotesk", "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Bengali", "Noto Sans Telugu", "Noto Sans Kannada", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="dark"] {
  --bg: var(--c-night);
  --surface: var(--c-night-2);
  --surface-raised: var(--c-night-3);
  --surface-sunk: #101015;
  --text: #f6f1e7;
  --text-soft: #b9b3a6;
  --text-faint: #7d786d;
  --line: rgba(255, 249, 241, 0.12);
  --line-strong: rgba(255, 249, 241, 0.75);
  --btn-bg: var(--c-cream);
  --btn-text: var(--c-ink);
  --nav-glass: rgba(12, 12, 16, 0.7);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03), 0 24px 48px -28px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  --red: #ff7a5f;      --red-soft: rgba(255, 122, 95, 0.14);
  --amber: #ffcf4a;    --amber-soft: rgba(255, 207, 74, 0.13);
  --green: #6fd39b;    --green-soft: rgba(111, 211, 155, 0.13);
  --grain-opacity: 0.18;
}

/* ════════════ base ════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Only animate colours while the user is flipping the theme -- on page
   load the saved theme must apply instantly, not fade in from light. */
html.theme-anim body, html.theme-anim body * {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease) !important;
}
/* paper grain over everything, never intercepting clicks */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent-2); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--btn-bg); color: var(--btn-text);
  padding: 8px 14px; border-radius: var(--radius-pill); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.mono, .mono-label, .eyebrow { font-family: var(--font-mono); }
.mono-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-soft);
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); flex: none; }
.eyebrow-dot.coral { background: var(--accent); }
.eyebrow-dot.pulse { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: 0.45; } }

.display {
  font-family: var(--font-display);
  font-weight: 650;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(44px, 7.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.display-sm { font-size: clamp(34px, 5vw, 64px); line-height: 1.02; }
.display-em { font-style: italic; font-weight: 500; position: relative; display: inline-block; white-space: nowrap; }
/* Indian scripts have no italic cut and run longer: let them wrap */
html:not([lang="en"]) .display-em { font-style: normal; white-space: normal; }
html:not([lang="en"]) .display { font-size: clamp(36px, 5.6vw, 80px); line-height: 1.15; letter-spacing: -0.01em; }
.scribble {
  position: absolute; left: -2%; bottom: -0.2em; width: 104%; height: 0.3em;
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 420; stroke-dashoffset: 420;
  animation: draw 1.1s 0.5s var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.section-title.small { font-size: 28px; }
.section-sub { color: var(--text-soft); font-size: 17px; max-width: 58ch; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--text-soft); max-width: 46ch; }

/* ════════════ buttons ════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, opacity 0.2s;
}
.btn-ink { background: var(--btn-bg); color: var(--btn-text); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.6); }
.btn-ink:hover:not(:disabled) { transform: translateY(-2px); }
.btn-ink:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.btn-outline { border: 1.5px solid var(--line-strong); cursor: pointer; }
.btn-outline:hover { background: var(--surface-sunk); }
.btn-arrow {
  display: grid; place-items: center; width: 30px; height: 30px; margin-right: -12px;
  border-radius: 50%; background: var(--accent); color: var(--c-ink); font-size: 16px;
  transition: transform 0.25s var(--ease);
}
.btn-ink:hover:not(:disabled) .btn-arrow { transform: translateX(3px) rotate(-8deg); }
.btn-small { height: 38px; padding: 0 16px; font-size: 14px; }
.link-button {
  color: var(--text); font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.icon-button {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-soft); flex: none;
}
.icon-button:hover { background: var(--surface-sunk); color: var(--text); }

/* ════════════ nav ════════════ */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px var(--gutter);
}
.nav::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(var(--bg) 40%, transparent);
  pointer-events: none;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; }
.wordmark-mark svg { width: 34px; height: 34px; }
.wordmark-text {
  font-family: var(--font-display); font-weight: 650; font-size: 22px; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 48;
}
.wordmark-text.small { font-size: 18px; }
.wordmark-dot { color: var(--accent); }

.nav-pill {
  display: flex; gap: 2px; padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--nav-glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--shadow-card);
}
.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 500; color: var(--text-soft);
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { background: var(--btn-bg); color: var(--btn-text); }
.nav-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--accent); color: var(--c-ink); font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; font-family: var(--font-mono);
}
.nav-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }
.lang-button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--nav-glass);
  font-weight: 500; font-size: 14px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lang-button:hover { border-color: var(--line-strong); }
.lang-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.theme-toggle {
  position: relative; width: 58px; height: 32px; border-radius: 99px;
  background: #fff; border: 1px solid #e7dfcd;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.35s;
}
.theme-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-gold);
  box-shadow: 0 0 0 4px rgba(255, 212, 63, 0.25);
  transition: transform 0.35s var(--ease), background 0.35s, box-shadow 0.35s;
}
[data-theme="dark"] .theme-toggle { background: #10183a; border-color: #343434; }
[data-theme="dark"] .theme-knob {
  transform: translateX(26px); background: #f2efe6;
  box-shadow: inset -6px -2px 0 0 #c9c3b3, 0 0 12px rgba(242, 239, 230, 0.35);
}

/* ════════════ layout ════════════ */
/* grid children default to min-width:auto and would grow to fit
   unbreakable content (the no-wrap headline), pushing the page wider
   than a phone screen */
.hero > *, .results-grid > *, .upload-actions > * { min-width: 0; }
main { padding: 0 var(--gutter); max-width: 1320px; margin: 0 auto; }
.view { animation: rise 0.55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ════════════ hero ════════════ */
.hero {
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(32px, 5vw, 80px);
  align-items: center; min-height: min(calc(100vh - 90px), 820px); padding: 32px 0 64px;
}
.hero-copy { display: flex; flex-direction: column; gap: 26px; }
.trust-pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.trust-pills li {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; background: var(--surface);
}
.pill-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.pill-dot.red { background: var(--red); }
.pill-dot.amber { background: var(--amber); }
.pill-dot.green { background: var(--green); }
.hero-meta { display: flex; gap: 32px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--line); }
.hero-meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.hero-meta dd { font-weight: 500; margin-top: 2px; }

/* upload card */
.upload-card {
  background: var(--surface-raised);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-card);
  transform: rotate(0.6deg);
  transition: transform 0.4s var(--ease);
}
.upload-card:hover, .upload-card:focus-within { transform: rotate(0deg); }
.upload-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.segmented {
  display: inline-flex; padding: 4px; gap: 2px;
  border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line);
}
.seg { height: 34px; padding: 0 16px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--text-soft); }
.seg.is-active { background: var(--btn-bg); color: var(--btn-text); }
.segmented.small .seg { height: 30px; padding: 0 12px; font-size: 13px; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 20px 26px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px dashed var(--line-strong);
  cursor: pointer; text-align: center;
  transition: background 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.dropzone:hover { background: var(--surface-sunk); }
.dropzone.is-dragging { background: var(--amber-soft); border-style: solid; transform: scale(1.01); }
.drop-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 14px; }
.drop-sub { font-size: 14px; color: var(--text-soft); }

/* the little contract sheet illustration */
.paper {
  position: relative; width: 150px; height: 128px; padding: 16px 16px;
  background: var(--c-paper); border: 1.5px solid var(--c-ink); border-radius: 12px;
  display: flex; flex-direction: column; gap: 9px;
  transform: rotate(-3deg); box-shadow: 6px 6px 0 var(--c-ink);
}
.paper-line { display: block; height: 6px; width: 100%; border-radius: 99px; background: #d9d2bf; position: relative; overflow: hidden; }
.paper-line.short { width: 62%; }
.paper-line[class*="hl-"]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  transform-origin: left; transform: scaleX(0); animation: sweep 2.8s var(--ease) infinite;
}
.paper-line.hl-red::after { background: var(--c-red); animation-delay: 0.5s; }
.paper-line.hl-amber::after { background: var(--c-amber); animation-delay: 0.9s; }
.paper-line.hl-green::after { background: var(--c-green); animation-delay: 0.1s; }
@keyframes sweep { 0%, 8% { transform: scaleX(0); } 32%, 82% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
.paper-tag {
  position: absolute; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-paper); border: 1.5px solid var(--c-ink); font-size: 14px;
  animation: bob 3s ease-in-out infinite;
}
.tag-red { right: -14px; top: 40px; }
.tag-amber { left: -14px; bottom: 14px; animation-delay: 1.2s; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(6deg); } }

.file-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px;
  border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line);
}
.file-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }

.error-banner {
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--red-soft); color: var(--text); border: 1px solid var(--red);
  font-size: 14px;
}

/* ════════════ how it works ════════════ */
.how { padding: 72px 0 40px; display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 14px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step {
  padding: 24px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.step:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.step-num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.step h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; }
.step p { color: var(--text-soft); font-size: 15px; }

.legend-band {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 0 96px;
}
.legend-item {
  display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
}
.legend-item.red { background: var(--red-soft); }
.legend-item.amber { background: var(--amber-soft); }
.legend-item.green { background: var(--green-soft); }
.legend-emoji { font-size: 22px; line-height: 1.2; }
.legend-item strong { font-size: 17px; }
.legend-item p { color: var(--text-soft); font-size: 14px; margin-top: 2px; }

/* ════════════ progress ════════════ */
.progress-card {
  margin: 32px auto 28px; max-width: 880px; padding: clamp(24px, 4vw, 44px);
  background: var(--surface-raised); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 22px;
}
.stepper { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.stepper li { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-weight: 500; transition: color 0.3s; }
.stepper-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none;
  display: grid; place-items: center; font-size: 12px; transition: all 0.3s var(--ease);
}
.stepper li.is-active { color: var(--text); }
.stepper li.is-active .stepper-dot { border-color: var(--text); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.stepper li.is-done { color: var(--text); }
.stepper li.is-done .stepper-dot { background: var(--text); border-color: var(--text); }
.stepper li.is-done .stepper-dot::after { content: "✓"; color: var(--bg); font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.stepper-count { color: var(--text-soft); font-size: 13px; }
.progress-track { height: 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.progress-fill {
  display: block; height: 100%; width: 4%; border-radius: inherit;
  background: repeating-linear-gradient(-45deg, var(--accent-2) 0 10px, #ffe27e 10px 20px);
  background-size: 28px 28px; animation: stripes 1s linear infinite;
  transition: width 0.6s var(--ease);
}
@keyframes stripes { to { background-position: 28px 0; } }
.progress-current { font-size: 13px; color: var(--text-soft); min-height: 1.4em; }
.progress-note { font-size: 14px; color: var(--text-faint); }
#progressClauses { max-width: 880px; margin: 0 auto 80px; }

/* ════════════ results ════════════ */
.results-head { display: flex; flex-direction: column; gap: 14px; padding: 28px 0 32px; }
.back-link {
  align-self: flex-start; display: inline-flex; gap: 8px; align-items: center;
  font-weight: 500; color: var(--text-soft); padding: 4px 0;
}
.back-link:hover { color: var(--text); }
.verdict {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; flex-wrap: wrap;
  padding: 10px 18px 10px 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--line-strong); font-weight: 600; background: var(--surface);
}
.verdict .verdict-badge {
  display: inline-grid; place-items: center; height: 30px; padding: 0 12px; border-radius: 99px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1.5px solid var(--c-ink); color: var(--c-ink);
}
.verdict-badge.red { background: var(--c-red); color: #fff; }
.verdict-badge.amber { background: var(--c-gold); }
.verdict-badge.green { background: #9ee0b7; }

.results-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; padding-bottom: 96px; }
.summary-card {
  position: sticky; top: 92px;
  background: var(--surface-raised); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-xl); padding: 24px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-card);
}
.summary-text { font-family: var(--font-display); font-size: 19px; line-height: 1.4; font-weight: 450; }
.key-terms { display: flex; flex-direction: column; gap: 8px; }
.key-term {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line);
}
.key-term dt { font-size: 13px; color: var(--text-soft); }
.key-term dd { font-weight: 600; text-align: right; }
.jurisdiction { font-size: 13px; color: var(--text-soft); }
.disclaimer { font-size: 12.5px; color: var(--text-faint); padding-top: 12px; border-top: 1px solid var(--line); }
.translation-note { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); }
.translation-note.warn { color: var(--amber); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 600; transition: all 0.2s;
}
.filter:hover { border-color: var(--line-strong); }
.filter.is-active { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.filter-count { font-family: var(--font-mono); font-size: 12px; opacity: 0.7; }
.translate-status {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-soft);
  padding: 10px 14px; border-radius: var(--radius-md); background: var(--surface-sunk); margin-bottom: 14px;
}

/* clause cards */
.clause-list { display: flex; flex-direction: column; gap: 14px; }
.clause-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 22px 18px 28px; overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: rise 0.5s var(--ease) both;
  transition: border-color 0.25s;
}
.clause-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; }
.clause-card.red::before { background: var(--red); }
.clause-card.amber::before { background: var(--amber); }
.clause-card.green::before { background: var(--green); }
.clause-card:hover { border-color: var(--line-strong); }
.clause-card.is-flash { animation: rise 0.5s var(--ease) both, flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--accent-2); } }
.clause-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.clause-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.clause-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); flex: none; }
.clause-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.2; }
.risk-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; flex: none;
}
.risk-pill.red { background: var(--red-soft); color: var(--red); }
.risk-pill.amber { background: var(--amber-soft); color: var(--text); }
.risk-pill.green { background: var(--green-soft); color: var(--green); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
  border: 1px solid var(--line); color: var(--text-soft);
}
.chip.flag { border-color: var(--amber); color: var(--text); background: var(--amber-soft); }
.clause-explain { font-size: 18px; line-height: 1.5; margin-top: 12px; max-width: 70ch; }
.clause-action {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px;
  border-radius: var(--radius-md); background: var(--surface-sunk); border: 1px dashed var(--line);
}
.action-arrow {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--c-ink); border: 1.5px solid var(--c-ink); font-weight: 700; font-size: 14px;
}
.clause-action .mono-label { display: block; margin-bottom: 2px; }
.clause-action p { font-weight: 500; }
.clause-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.confidence { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-soft); }
.meter { width: 90px; height: 6px; border-radius: 99px; background: var(--surface-sunk); overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--text); border-radius: inherit; }
.status-note { font-size: 13px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; }
.expand-button {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.expand-button:hover { border-color: var(--line-strong); }
.expand-button .chev { transition: transform 0.25s var(--ease); display: inline-block; }
.expand-button[aria-expanded="true"] .chev { transform: rotate(180deg); }

.clause-details { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.detail-block h4 { margin-bottom: 6px; }
.detail-block p { color: var(--text-soft); }
.original-text {
  font-family: var(--font-display); font-size: 15px; line-height: 1.6; color: var(--text-soft);
  padding: 14px 16px; border-left: 3px solid var(--line-strong); background: var(--surface-sunk);
  border-radius: 0 var(--radius-md) var(--radius-md) 0; white-space: pre-wrap;
}
.source {
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
  overflow: hidden;
}
.source summary {
  cursor: pointer; padding: 12px 14px; display: flex; gap: 10px; align-items: baseline; list-style: none;
}
.source summary::-webkit-details-marker { display: none; }
.source summary::before { content: "§"; font-family: var(--font-display); color: var(--accent); font-weight: 700; }
.source-law { font-weight: 600; }
.source-title { color: var(--text-soft); font-size: 14px; }
.source-body { padding: 0 14px 14px; font-size: 14.5px; color: var(--text-soft); display: grid; gap: 8px; }
.source-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.source-meta a { color: var(--text); }
.claims { list-style: none; display: grid; gap: 8px; }
.claims li { display: flex; gap: 10px; font-size: 15px; color: var(--text-soft); }
.claims li::before { content: "↳"; color: var(--accent); font-weight: 700; }

.empty-note { color: var(--text-faint); font-style: italic; font-size: 14px; }
.failed-list:not(:empty) {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px dashed var(--red); color: var(--text-soft); font-size: 14px;
}

/* document view — the contract itself, highlighted */
.doc-view {
  background: var(--c-paper); color: var(--c-ink);
  border: 1.5px solid var(--c-ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--c-ink);
  padding: clamp(22px, 4vw, 52px); font-family: var(--font-display); font-size: 16.5px; line-height: 1.85;
}
.doc-clause { margin-bottom: 18px; }
.doc-clause h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 2px; color: #57534a; }
.doc-mark {
  cursor: pointer; padding: 2px 3px; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: filter 0.2s;
}
.doc-mark:hover, .doc-mark:focus-visible { filter: saturate(1.6) brightness(0.97); }
.doc-mark.red { background: #ffd5c9; box-shadow: inset 0 -2px 0 var(--c-red); }
.doc-mark.amber { background: #ffeaa1; box-shadow: inset 0 -2px 0 var(--c-amber); }
.doc-mark.green { background: #d3efdc; box-shadow: inset 0 -2px 0 var(--c-green); }
.doc-callout {
  margin: 10px 0 4px; padding: 14px 16px; border-radius: 12px; background: #f6efdc;
  border: 1px solid rgba(0, 0, 0, 0.15); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5;
  display: grid; gap: 8px;
}
.doc-callout strong { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #57534a; display: block; }

/* ════════════ reviewer desk ════════════ */
#view-review > .section-head { padding: 28px 0 28px; }
.review-list { display: grid; gap: 16px; padding-bottom: 96px; }
.review-card { display: grid; gap: 12px; }
.review-reason {
  font-size: 14px; padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--amber-soft); border: 1px solid var(--amber);
}
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state {
  text-align: center; padding: 64px 24px; border-radius: var(--radius-xl);
  border: 1.5px dashed var(--line); display: grid; gap: 8px; justify-items: center;
}
.empty-state .big { font-size: 40px; }

/* ════════════ dialogs ════════════ */
dialog {
  margin: auto; border: 0; padding: 0; background: transparent; color: var(--text);
  max-width: min(760px, calc(100vw - 24px)); width: 100%;
}
dialog::backdrop { background: rgba(11, 11, 12, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog[open] { animation: pop 0.35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.lang-sheet, .edit-form {
  background: var(--bg); border: 1.5px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-pop);
}
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.lang-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px;
  border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface);
  text-align: left; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.lang-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.lang-tile.is-active { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.lang-native { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; }
.lang-english { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.6; }

.edit-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.edit-form textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: var(--surface); font-weight: 400; font-size: 15px; resize: vertical;
}
.edit-form textarea:focus { outline: 2px solid var(--text); outline-offset: 1px; }
.risk-radios { border: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.risk-radios legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; width: 100%; }
.risk-radios label {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); cursor: pointer; font-weight: 500;
}
.risk-radios label:has(input:checked) { border-color: var(--line-strong); background: var(--surface-sunk); }
.risk-radios input { accent-color: var(--c-ink); }
.edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ════════════ footer + toast ════════════ */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--gutter); border-top: 1px solid var(--line); color: var(--text-soft);
}
.footer-note { font-size: 13px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300;
  background: var(--btn-bg); color: var(--btn-text); padding: 12px 20px; border-radius: var(--radius-pill);
  font-weight: 500; box-shadow: var(--shadow-pop); animation: rise 0.3s var(--ease);
  max-width: calc(100vw - 32px);
}

/* loading placeholders */
.clause-card.skeleton {
  height: 190px; border-color: var(--line);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-sunk) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.clause-card.skeleton::before { background: var(--line); }

/* skeleton shimmer while translating */
.is-translating { position: relative; color: transparent !important; }
.is-translating::after {
  content: ""; position: absolute; inset: 2px 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-sunk) 0%, var(--line) 50%, var(--surface-sunk) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ════════════ responsive ════════════ */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 24px; }
  .upload-card { transform: none; max-width: 620px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}
@media (max-width: 760px) {
  .display { font-size: clamp(40px, 11.5vw, 60px); }
  .display-em { white-space: normal; }
  .nav { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .nav-link { white-space: nowrap; }
  .nav-link[data-scroll-to] { display: none; }   /* "How it works" is right below the hero anyway */
  .nav-pill {
    position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 120;
  }
  .nav-link { padding: 0 13px; font-size: 14px; }
  .wordmark-text { font-size: 19px; }
  .lang-button span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 0 16px; }
  .steps, .legend-band { grid-template-columns: 1fr; }
  .legend-band { padding-bottom: 120px; }
  .hero-meta { gap: 18px; }
  .upload-actions { grid-template-columns: 1fr; }
  .clause-card { padding: 18px 16px 16px 22px; }
  .clause-explain { font-size: 16.5px; }
  .footer { padding-bottom: 96px; }
  .toast { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .scribble { stroke-dashoffset: 0; }
}

/* Indian scripts: no letter-spacing (it splits conjuncts apart), no
   uppercase, and the body face instead of a Latin-only mono. */
html:not([lang="en"]) .eyebrow,
html:not([lang="en"]) .mono-label,
html:not([lang="en"]) .hero-meta dt,
html:not([lang="en"]) .verdict .verdict-badge,
html:not([lang="en"]) .doc-clause h4,
html:not([lang="en"]) .doc-callout strong,
html:not([lang="en"]) .lang-english,
html:not([lang="en"]) .translation-note,
html:not([lang="en"]) .translate-status,
html:not([lang="en"]) .progress-current {
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}

/* ════════════ privacy (DPDP) ════════════ */
.consent {
  display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-soft);
  padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line);
  cursor: pointer;
}
.consent input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--c-ink); flex: none; cursor: pointer; }
.consent a { color: var(--text); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.retention-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.retention-note { font-size: 13px; color: var(--text-soft); }
.privacy-page { max-width: 760px; padding: 28px 0 96px; display: flex; flex-direction: column; gap: 16px; }
.privacy-list { display: grid; gap: 12px; padding-left: 0; list-style: none; counter-reset: p; }
.privacy-list li {
  counter-increment: p; position: relative; padding: 16px 18px 16px 52px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.privacy-list li::before {
  content: counter(p, decimal-leading-zero); position: absolute; left: 18px; top: 17px;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
}
.privacy-list strong { display: block; margin-bottom: 2px; }
.privacy-list p { color: var(--text-soft); font-size: 15px; }
.footer-note a { color: inherit; }

/* ════════════════════════════════════════════════════════════════
   Landing page — "the case that never gets filed"
   ════════════════════════════════════════════════════════════════ */
:root { --c-manila: #ead9ae; --c-manila-2: #dcc794; --c-stamp: #d9381e; --c-resolved: #1f8a52; }

/* full-bleed bands break out of main's max-width */
.impact, .finale, .game {
  margin-inline: calc(50% - 50vw);
  padding-inline: max(var(--gutter), calc(50vw - 660px));
}

/* reveal on scroll (JS adds .is-visible) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ── opening statement ── */
.impact {
  position: relative; min-height: min(calc(100vh - 70px), 940px); display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(60% 50% at 85% 30%, rgba(252, 144, 115, 0.18), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(255, 212, 63, 0.10), transparent 70%),
    #0b0b0c;
  color: #f6f1e7; padding-block: 64px 80px; margin-top: -76px; padding-top: 140px; overflow: hidden;
}
.impact-inner { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.impact-copy { display: flex; flex-direction: column; gap: 22px; position: relative; z-index: 1; }
.eyebrow.on-dark { color: rgba(246, 241, 231, 0.7); }
.impact-number { display: flex; flex-direction: column; gap: 10px; }
.impact-number .count-up {
  font-family: var(--font-display); font-weight: 700; font-variation-settings: "opsz" 144;
  font-size: clamp(64px, 11.5vw, 176px); line-height: 0.9; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff9f1 30%, #c9bfae); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.impact-number-label { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 36px); font-weight: 450; line-height: 1.15; }
.impact-line { font-size: clamp(17px, 1.5vw, 20px); color: rgba(246, 241, 231, 0.78); max-width: 52ch; }
.impact-punch {
  display: inline; font-family: var(--font-display); font-style: italic; font-weight: 600; color: #fff9f1;
  background: linear-gradient(transparent 62%, rgba(252, 144, 115, 0.55) 62%); background-size: 0% 100%; background-repeat: no-repeat;
  transition: background-size 1.2s 0.4s var(--ease);
}
.is-visible .impact-punch, .impact.is-visible .impact-punch { background-size: 100% 100%; }
.impact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn-cream { background: var(--c-cream); color: var(--c-ink); text-decoration: none; box-shadow: 0 12px 30px -14px rgba(252, 144, 115, 0.7); }
.btn-cream:hover { transform: translateY(-2px); }
.btn-cream.big { height: 62px; padding: 0 30px; font-size: 18px; }
.btn-ghost-dark { color: #f6f1e7; border: 1.5px solid rgba(246, 241, 231, 0.35); text-decoration: none; }
.btn-ghost-dark:hover { border-color: #f6f1e7; background: rgba(246, 241, 231, 0.06); }
.impact-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 22px; border-top: 1px solid rgba(246, 241, 231, 0.14); }
.impact-stats dt { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 650; color: var(--c-coral); }
.impact-stats dt span { font-size: 0.6em; }
.impact-stats dd { font-size: 13.5px; color: rgba(246, 241, 231, 0.65); margin-top: 2px; }
.impact-source { font-family: var(--font-mono); font-size: 11px; color: rgba(246, 241, 231, 0.45); }
.impact-source a { color: rgba(246, 241, 231, 0.65); }

/* the pile of case files + stamp */
.case-pile { position: relative; height: 440px; }
.case-file {
  position: absolute; width: 300px; height: 210px; border-radius: 6px 14px 14px 14px; padding: 34px 22px 18px;
  background: linear-gradient(170deg, var(--c-manila), var(--c-manila-2)); color: #3a3228;
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: flex; flex-direction: column; gap: 10px;
  animation: drift 7s ease-in-out infinite;
}
.case-file::before { content: ""; position: absolute; left: 0; top: -16px; width: 120px; height: 18px; border-radius: 8px 8px 0 0; background: var(--c-manila); }
.case-tab { position: absolute; top: -12px; left: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: #6b5d45; }
.case-line { height: 6px; border-radius: 9px; background: rgba(58, 50, 40, 0.18); }
.case-line.short { width: 60%; }
.case-clause { font-family: var(--font-display); font-style: italic; font-size: 14px; line-height: 1.35; margin-top: 4px;
  background: rgba(217, 56, 30, 0.14); box-shadow: inset 0 -2px 0 var(--c-stamp); padding: 2px 4px; }
.f1 { top: 10px; left: 40px; transform: rotate(-8deg); opacity: 0.55; animation-delay: -2s; }
.f2 { top: 70px; left: 0; transform: rotate(5deg); opacity: 0.75; animation-delay: -4s; }
.f3 { top: 150px; left: 50px; transform: rotate(-2deg); }
@keyframes drift { 50% { translate: 0 -8px; } }
.stamp {
  display: inline-block; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  font-size: 30px; padding: 8px 18px; border: 4px solid currentColor; border-radius: 8px; color: var(--c-stamp);
  mix-blend-mode: normal; background: rgba(255, 255, 255, 0.02);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='f'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='f'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}
.case-pile .stamp-pending { position: absolute; right: 10px; top: 210px; transform: rotate(-14deg) scale(2.4); opacity: 0; z-index: 3; }
.impact.is-visible .case-pile .stamp-pending { animation: slam 0.5s 1.4s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes slam { 0% { opacity: 0; transform: rotate(-14deg) scale(2.4); } 100% { opacity: 1; transform: rotate(-14deg) scale(1); } }
.scroll-cue { position: absolute; left: 50%; bottom: 24px; translate: -50% 0; width: 24px; height: 38px; border: 2px solid rgba(246,241,231,.45); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: #f6f1e7; animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 60% { transform: translateY(12px); opacity: 0; } }

.nav { z-index: 100; }

/* ── before / after ── */
.transform { padding: 96px 0 40px; display: flex; flex-direction: column; gap: 32px; }
.transform-grid { display: grid; grid-template-columns: 1fr auto 1.15fr; gap: 20px; align-items: center; }
.legalese-card {
  background: var(--c-paper); color: var(--c-ink); border: 1px solid rgba(0,0,0,.12); border-radius: 18px; padding: 26px;
  transform: rotate(-1.2deg); box-shadow: 10px 10px 0 rgba(11,11,12,.08); display: flex; flex-direction: column; gap: 14px;
}
.legalese { font-family: var(--font-display); font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; color: #2a2722; }
.legalese-meta { font-family: var(--font-mono); font-size: 11px; color: #8a8578; }
.transform-arrow span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: var(--c-ink); border: 2px solid var(--c-ink); font-size: 22px; font-weight: 700;
  animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.plain-card { background: var(--surface-raised); border: 1.5px solid var(--line-strong); border-radius: 22px; padding: 26px;
  display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-card); }
.plain-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.plain-text { font-size: clamp(18px, 1.6vw, 21px); font-weight: 500; line-height: 1.45; }
.plain-row { display: grid; gap: 4px; font-size: 15px; color: var(--text-soft); }
.plain-row.action { grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 14px; background: var(--surface); }
.plain-row.action strong { color: var(--text); }
.law-chip { display: inline-block; font-family: var(--font-mono); font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); margin-right: 6px; }
.demo-note { font-size: 13px; color: var(--text-faint); text-align: center; }

/* ── game ── */
.game { background: var(--surface-raised); padding-block: 88px; border-block: 1px solid var(--line); }
.game-shell { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.game-head { display: flex; flex-direction: column; gap: 14px; }
.game-card {
  min-height: 360px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 24px;
  padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-card);
}
.game-progress { display: flex; gap: 6px; }
.game-progress span { flex: 1; height: 5px; border-radius: 9px; background: var(--line); }
.game-progress span.done { background: var(--text); }
.game-progress span.now { background: var(--accent); }
.game-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.game-clause { font-family: var(--font-display); font-size: clamp(19px, 1.9vw, 25px); line-height: 1.4; }
.game-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.game-choice { height: 56px; border-radius: 16px; border: 1.5px solid var(--line); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s var(--ease), border-color .2s, background .2s; }
.game-choice:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--line-strong); }
.game-choice.red { background: var(--red-soft); } .game-choice.amber { background: var(--amber-soft); } .game-choice.green { background: var(--green-soft); }
.game-choice.picked { outline: 3px solid var(--text); outline-offset: 2px; }
.game-choice:disabled { cursor: default; opacity: .55; }
.game-choice.answer { opacity: 1; box-shadow: 0 0 0 3px var(--text); }
.game-result { border-radius: 16px; padding: 16px 18px; display: grid; gap: 6px; animation: rise .4s var(--ease); }
.game-result.right { background: var(--green-soft); } .game-result.wrong { background: var(--red-soft); }
.game-result strong { font-size: 17px; }
.game-result p { color: var(--text-soft); }
.game-score { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 10px 0; }
.game-score .big { font-family: var(--font-display); font-size: clamp(56px, 7vw, 92px); font-weight: 700; line-height: 1; }
.game-score .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── how it works: connected timeline ── */
.steps { position: relative; }
.steps::before { content: ""; position: absolute; left: 4%; right: 4%; top: 36px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 16px); opacity: .35; z-index: 0; }
.step { position: relative; z-index: 1; }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-text); }

/* ── law library ── */
.library { padding: 96px 0 40px; display: flex; flex-direction: column; gap: 36px; }
.section-head.center { align-items: center; text-align: center; }
.section-head.center .section-sub { margin-inline: auto; }
.library-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.library-stats > div { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; text-align: center; }
.library-stats strong { font-family: var(--font-display); font-size: clamp(38px, 4.6vw, 62px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.library-stats span { color: var(--text-soft); font-size: 14px; }
.marquee { overflow: hidden; margin-inline: calc(50% - 50vw); border-block: 1px solid var(--line); background: var(--surface);
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee-track span { padding: 18px 26px; font-family: var(--font-display); font-size: 20px; white-space: nowrap; position: relative; }
.marquee-track span::after { content: "§"; position: absolute; right: -6px; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── privacy promise ── */
.promise { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin: 72px 0 0; padding: 30px;
  border-radius: 26px; background: var(--green-soft); border: 1px solid var(--green); }
.promise p { color: var(--text-soft); margin: 8px 0 12px; max-width: 64ch; }
.promise-seal { width: 104px; height: 104px; border-radius: 50%; border: 3px dashed var(--green); display: grid; place-content: center; text-align: center;
  font-family: var(--font-mono); font-weight: 700; color: var(--green); line-height: 1.1; animation: spin-slow 24s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ── FAQ ── */
.faq { padding: 88px 0 24px; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 32px; align-items: start; }
.faq-list { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 0 18px; transition: border-color .2s; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 20px; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; color: var(--text-soft); max-width: 70ch; }

/* ── finale ── */
.finale {
  margin-top: 96px; padding-block: 120px 110px; text-align: center; display: grid; justify-items: center; gap: 26px;
  background: radial-gradient(50% 60% at 50% 0%, rgba(255, 212, 63, 0.12), transparent 70%), #0b0b0c; color: #f6f1e7; position: relative; overflow: hidden;
}
.finale-stamp { position: relative; height: 70px; width: 300px; }
.finale-stamp .stamp { position: absolute; left: 50%; top: 50%; translate: -50% -50%; transform: rotate(-8deg); }
.finale-stamp .stamp-resolved { color: #4fd18c; opacity: 0; transform: rotate(-8deg) scale(2.2); }
.finale.is-visible .stamp-pending { animation: strike-out .6s .5s forwards; }
.finale.is-visible .stamp-resolved { animation: slam-resolved .5s 1.1s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes strike-out { to { opacity: 0; transform: rotate(-8deg) scale(.8); filter: blur(2px); } }
@keyframes slam-resolved { to { opacity: 1; transform: rotate(-8deg) scale(1); } }
.finale-title { font-family: var(--font-display); font-weight: 650; font-size: clamp(40px, 6.4vw, 92px); line-height: 1.02; letter-spacing: -0.03em; max-width: 16ch; display: grid; }
.finale-title em { font-weight: 500; color: var(--c-coral); }
.finale-sub { font-size: clamp(17px, 1.6vw, 21px); color: rgba(246, 241, 231, 0.75); max-width: 46ch; }

/* ── footer ── */
.footer { display: grid; gap: 22px; padding: 56px var(--gutter) 28px; border-top: 1px solid var(--line);
  justify-content: stretch; align-items: start; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.footer-made { font-family: var(--font-display); font-size: 22px; margin-top: 6px; color: var(--text); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--text-soft); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--text); }
.footer-wordmark { font-family: var(--font-display); font-weight: 700; font-size: clamp(64px, 17vw, 260px); line-height: .8; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); opacity: .25; user-select: none; white-space: nowrap; overflow: hidden; }
.footer-wordmark .wordmark-dot { -webkit-text-stroke: 0; color: var(--accent); opacity: 1; }
.footer-note { font-size: 13px; color: var(--text-faint); }

/* ── results: ring + action plan ── */
.risk-ring-row { display: flex; align-items: center; gap: 14px; }
.risk-ring { --r: 0; --a: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--red) 0 calc(var(--r) * 1%), var(--amber) 0 calc((var(--r) + var(--a)) * 1%), var(--green) 0 100%); }
.risk-ring span { width: 54px; height: 54px; border-radius: 50%; background: var(--surface-raised); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.action-plan { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px dashed var(--line-strong); }
.action-plan h3 { font-family: var(--font-display); font-size: 20px; }
.plan-sub { font-size: 13px; color: var(--text-soft); }
.plan-list { display: grid; gap: 8px; padding-left: 0; list-style: none; counter-reset: plan; }
.plan-list li { counter-increment: plan; display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: 14px; }
.plan-list li::before { content: counter(plan); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--c-ink); background: var(--accent); }
.plan-list li.red::before { background: var(--c-red); color: #fff; }
.plan-list .plan-clause { display: block; font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── responsive ── */
@media (max-width: 1080px) {
  .impact-inner, .game-shell, .faq { grid-template-columns: 1fr; }
  .case-pile { height: 300px; max-width: 420px; }
  .transform-grid { grid-template-columns: 1fr; }
  .transform-arrow { justify-self: center; transform: rotate(90deg); }
  .library-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .impact { min-height: auto; padding-top: 110px; }
  .impact-stats { grid-template-columns: 1fr; }
  .case-file { width: 240px; height: 170px; }
  .case-pile { height: 260px; }
  .case-pile .stamp-pending { top: 150px; font-size: 22px; }
  .game-choices { grid-template-columns: 1fr; }
  .promise { grid-template-columns: 1fr; justify-items: start; }
  .steps::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee-track span:nth-child(n+18) { display: none; }   /* the copy only exists for the seamless loop */
  .case-pile .stamp-pending, .finale-stamp .stamp-resolved { opacity: 1; transform: rotate(-12deg); animation: none !important; }
  .finale-stamp .stamp-pending { display: none; }
  .impact-punch { background-size: 100% 100%; }
}

/* ── print: the action plan + results only ── */
@media print {
  .nav, .footer, .toolbar, .retention-row, .back-link, .plan-actions, .translate-status, .expand-button, #view-home { display: none !important; }
  body::before { display: none; }
  .results-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; box-shadow: none; }
  .clause-card { break-inside: avoid; box-shadow: none; }
}

/* the wordmark sits in the same glass pill as the other nav controls, so
   it reads over the cream page and the dark opening alike */
.wordmark {
  padding: 5px 14px 5px 5px; border-radius: var(--radius-pill);
  background: var(--nav-glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.wordmark-mark svg { width: 30px; height: 30px; }
.wordmark-text { color: var(--text) !important; }
@media (max-width: 760px) { .scroll-cue { display: none; } }

/* the tagline */
.lang-tagline { font-family: var(--font-display); font-style: italic; font-size: clamp(20px, 2.4vw, 26px);
  color: var(--accent); margin: 4px 0 -4px; }
.finale-tagline { margin-top: 44px; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 14px;
  font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 2vw, 24px); color: rgba(246, 241, 231, 0.9); }
.finale-tagline-mark { font-style: normal; font-weight: 600; color: #f6f1e7; padding-right: 14px;
  border-right: 1px solid rgba(246, 241, 231, 0.25); }
.finale-tagline-mark span { color: var(--accent); }
.footer-made { font-style: italic; font-size: clamp(24px, 3vw, 34px); }
.hero-tagline { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-family: var(--font-display); font-style: italic; font-size: clamp(19px, 2vw, 24px); color: var(--accent); }
#start, #game, #how { scroll-margin-top: 96px; }

/* ── opening + ending follow the theme ──
   The rules above are the dark look (dark theme). In light mode both
   bands become warm "court paper": ink text, manila files, a dark CTA. */
:root:not([data-theme="dark"]) .impact {
  background:
    radial-gradient(60% 50% at 85% 30%, rgba(252, 144, 115, 0.22), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(255, 212, 63, 0.20), transparent 70%),
    #f6eedf;
  color: var(--c-ink);
}
:root:not([data-theme="dark"]) .finale {
  background: radial-gradient(50% 60% at 50% 0%, rgba(255, 212, 63, 0.28), transparent 70%), #f6eedf;
  color: var(--c-ink);
}
:root:not([data-theme="dark"]) .eyebrow.on-dark { color: rgba(11, 11, 12, 0.6); }
:root:not([data-theme="dark"]) .impact-number .count-up { background-image: linear-gradient(180deg, #0b0b0c 35%, #5a4a36); }
:root:not([data-theme="dark"]) .impact-line,
:root:not([data-theme="dark"]) .finale-sub { color: rgba(11, 11, 12, 0.72); }
:root:not([data-theme="dark"]) .impact-punch { color: var(--c-ink); }
:root:not([data-theme="dark"]) .impact-stats { border-top-color: rgba(11, 11, 12, 0.14); }
:root:not([data-theme="dark"]) .impact-stats dt,
:root:not([data-theme="dark"]) .finale-title em { color: #c9472a; }
:root:not([data-theme="dark"]) .impact-stats dd { color: rgba(11, 11, 12, 0.62); }
:root:not([data-theme="dark"]) .impact-source { color: rgba(11, 11, 12, 0.5); }
:root:not([data-theme="dark"]) .impact-source a { color: rgba(11, 11, 12, 0.7); }
:root:not([data-theme="dark"]) .btn-cream { background: var(--c-ink); color: var(--c-cream); }
:root:not([data-theme="dark"]) .btn-ghost-dark { color: var(--c-ink); border-color: rgba(11, 11, 12, 0.3); }
:root:not([data-theme="dark"]) .btn-ghost-dark:hover { border-color: var(--c-ink); background: rgba(11, 11, 12, 0.04); }
:root:not([data-theme="dark"]) .case-file { box-shadow: 0 24px 40px -22px rgba(90, 60, 20, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
:root:not([data-theme="dark"]) .scroll-cue { border-color: rgba(11, 11, 12, 0.35); }
:root:not([data-theme="dark"]) .scroll-cue span { background: var(--c-ink); }
:root:not([data-theme="dark"]) .finale-stamp .stamp-resolved { color: var(--c-resolved); }
:root:not([data-theme="dark"]) .finale-tagline { color: rgba(11, 11, 12, 0.8); }
:root:not([data-theme="dark"]) .finale-tagline-mark { color: var(--c-ink); border-right-color: rgba(11, 11, 12, 0.2); }

/* ── primary logo (Primary logo — light-html): scales mark + Space Grotesk
   wordmark, "law" bold. Navy on light, the logo's cream on dark. */
:root { --logo-ink: #1B1F3B; --logo-accent: #E8962E; }
[data-theme="dark"] { --logo-ink: #F7F4EE; }
.wordmark { gap: 8px; padding: 5px 16px 5px 8px; }
.wordmark-mark svg { width: 32px; height: 32px; display: block; }
.wordmark-mark .logo-ink-stroke { stroke: var(--logo-ink); }
.wordmark-mark .logo-ink { fill: var(--logo-ink); }
.wordmark-mark .logo-accent { fill: var(--logo-accent); }
.wordmark-text, .wordmark-text.small {
  font-family: "Space Grotesk", var(--font-body); font-weight: 400; font-variation-settings: normal;
  font-size: 23px; letter-spacing: -0.035em; line-height: 1; color: var(--logo-ink) !important;
}
.wordmark-text b { font-weight: 700; }
@media (max-width: 760px) { .wordmark-text { font-size: 20px; } .wordmark-mark svg { width: 28px; height: 28px; } }

/* ── decisions: what to DO (backend/risk/decision.py) ── */
.decision-no_lawyer { --d: var(--c-green, #1f8a52); --d-bg: rgba(31, 138, 82, .12); }
.decision-negotiate { --d: #b7791f; --d-bg: rgba(255, 196, 61, .16); }
.decision-lawyer    { --d: #c9472a; --d-bg: rgba(224, 96, 63, .14); }
.decision-expert    { --d: #5b5bd6; --d-bg: rgba(91, 91, 214, .13); }
.decision-sign      { --d: #1f8a52; --d-bg: rgba(31, 138, 82, .12); }
[data-theme="dark"] .decision-no_lawyer, [data-theme="dark"] .decision-sign { --d: #5fd39a; }
[data-theme="dark"] .decision-negotiate { --d: #f2c14e; }
[data-theme="dark"] .decision-lawyer { --d: #ff8a6b; }
[data-theme="dark"] .decision-expert { --d: #a5a6ff; }

.verdict { display: grid; gap: 10px; }
.verdict-main { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.verdict-badge[class*="decision-"] { background: var(--d); color: #fff; }
[data-theme="dark"] .verdict-badge[class*="decision-"] { color: #0b0b0c; }
.decision-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.decision-count { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 99px;
  font-size: 13px; font-weight: 600; color: var(--d); background: var(--d-bg); }

.decision-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px 14px;
  border-radius: 14px; background: var(--d-bg); border: 1px solid color-mix(in srgb, var(--d) 35%, transparent); }
.decision-row .decision-icon { font-size: 20px; line-height: 1.2; }
.decision-row strong { color: var(--d); font-size: 15px; }
.decision-row p { margin-top: 2px; font-size: 13.5px; color: var(--text-soft); }
.decision-reviewed { font-weight: 500; color: var(--text-soft); }
@media print { .decision-row { break-inside: avoid; } }

/* ── expert review: the human in the loop ── */
.expert-panel { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding: 18px 20px; max-width: 760px;
  border-radius: 18px; background: rgba(91, 91, 214, .10); border: 1px solid rgba(91, 91, 214, .35); }
[data-theme="dark"] .expert-panel { background: rgba(165, 166, 255, .10); border-color: rgba(165, 166, 255, .35); }
.expert-panel .expert-icon { font-size: 26px; line-height: 1; }
.expert-panel h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 4px; }
.expert-panel p { color: var(--text-soft); font-size: 14px; margin-bottom: 10px; max-width: 62ch; }
.expert-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; }
.expert-consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--text); flex: none; }
.legal-aid { margin-top: 6px; font-weight: 600; color: var(--text) !important; }
.reviewer-by { font-size: 12.5px; opacity: .8; }
.decision-row .mono-label { display: block; margin-bottom: 2px; }
.expert-list { display: grid; gap: 16px; margin-top: 28px; max-width: 860px; }
.my-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-top: 12px; }

.expert-desk { display: grid; gap: 18px; margin-top: 24px; max-width: 900px; }
.desk-login { display: grid; gap: 12px; max-width: 440px; padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.desk-input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.desk-head { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; color: var(--text-soft); }
.desk-head strong { color: var(--text); }
.desk-head button { margin-left: auto; }
.desk-form { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.desk-form label { display: grid; gap: 6px; font-size: 14px; }
.desk-form textarea { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.desk-form .risk-radios { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 0; padding: 0; }
.desk-form .risk-radios legend { font-weight: 600; margin-bottom: 6px; font-size: 14px; }
@media (max-width: 760px) { .expert-panel { flex-direction: column; } }

.important-sentence { font-weight: 600; color: var(--text) !important; font-size: 14.5px !important; margin-top: 4px !important; }
.desk-help { color: var(--text-soft); font-size: 12.5px; }

/* owner: manage reviewers */
.team-panel { display: grid; gap: 12px; padding: 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.team-panel h3 { font-family: var(--font-display); font-size: 22px; }
.team-add { display: flex; gap: 10px; flex-wrap: wrap; }
.team-add .desk-input { flex: 1 1 240px; }
.team-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.invite-box { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(31, 138, 82, .10); border: 1px solid rgba(31, 138, 82, .35); }
.invite-link { font-family: var(--font-mono, monospace); font-size: 13px; }
.invite-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* payments & info pages */
.price-note { margin-top: 10px; font-size: 13px; color: var(--text-soft); }
.price-note a { color: var(--text); font-weight: 600; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.price-card { display: grid; gap: 6px; padding: 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.price-amount { font-family: var(--font-display); font-size: 34px; line-height: 1.1; }
.price-card p { color: var(--text-soft); font-size: 14px; }
.info-body { margin-top: 18px; display: grid; gap: 14px; max-width: 760px; }
.contact-form { border-top: 0; padding-top: 0; max-width: 560px; }
.contact-form select { height: 46px; }
.contact-sent { font-weight: 600; color: var(--c-green, #1f8a52); }
.message-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.message-text { white-space: pre-wrap; margin: 4px 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ════════════ organised expert check + reviewer desk ════════════ */
/* results page: "get a human expert" panel -- head, then (clauses | consent + send) */
.expert-panel { display: grid; gap: 16px; max-width: 900px; padding: 22px 24px; }
.expert-panel-head { display: flex; gap: 14px; align-items: flex-start; }
.expert-panel-head h3 { margin: 0 0 4px; }
.expert-panel-head .expert-sub { margin: 0; max-width: 70ch; }
.expert-panel-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start;
  padding-top: 16px; border-top: 1px solid var(--line); }
.expert-clauses { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.expert-clauses li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.expert-clause-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); font-weight: 500; }
.expert-panel-action { display: grid; gap: 12px; justify-items: start; }
.expert-panel-action .expert-consent { margin: 0; }
@media (max-width: 760px) { .expert-panel { padding: 18px; } .expert-panel-body { grid-template-columns: 1fr; } }

/* the person's ticket page */
.ticket-progress { display: grid; gap: 8px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ticket-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s var(--ease); }
.ticket-ai { display: grid; gap: 4px; margin-top: 10px; }
.ticket-ai p { color: var(--text-soft); }

/* reviewer desk: who's signed in, then one card per clause */
.expert-desk { max-width: 1180px; }
.desk-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.desk-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--c-ink); font-weight: 700; font-size: 17px; }
.desk-who { display: grid; gap: 1px; min-width: 0; }
.desk-who span { font-size: 13px; color: var(--text-soft); }
.desk-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.desk-head button { margin-left: 0; }

.desk-card { padding: 22px 24px 24px 30px; }
.desk-card-head { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.desk-card-head .chip-row { margin-top: 0; }
.ai-verdict { font-size: 14px; color: var(--text-soft); }
.ai-verdict strong { color: var(--text); }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 18px; }

.review-evidence { display: grid; gap: 18px; }
.evidence-block { display: grid; gap: 8px; }
.evidence-block .original-text { margin: 0; }
.ai-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14.5px; }
.ai-facts dt { font-weight: 600; color: var(--text); }
.ai-facts dd { margin: 0; color: var(--text-soft); line-height: 1.5; }
.law-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.law-chips .law-chip { text-decoration: none; font-size: 12px; padding: 5px 10px; margin: 0; }
.law-chips a.law-chip:hover { border-color: var(--line-strong); }

.review-panel { position: sticky; top: 92px; display: grid; gap: 18px; padding: 18px; border-radius: 18px;
  background: var(--surface-sunk); border: 1px solid var(--line); }
.review-title { font-family: var(--font-display); font-size: 19px; margin: 0; }
.review-step { display: grid; gap: 8px; }
.review-step[hidden] { display: none !important; }
.review-step-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.step-badge { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--btn-bg); color: var(--btn-text); font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.review-panel textarea, .review-panel .desk-input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14.5px; }
.review-panel textarea { resize: vertical; }
.review-panel textarea:focus, .review-panel .desk-input:focus { outline: 2px solid var(--text); outline-offset: 1px; }

/* choices: real radios, visually hidden; the whole card/pill is the target */
.choice-grid { display: grid; gap: 8px; }
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); }
.choice:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.choice-icon { font-size: 20px; line-height: 1; flex: none; }
.choice-text { display: grid; gap: 1px; min-width: 0; }
.choice-text strong { font-size: 14px; }
.choice-text small { font-size: 12.5px; color: var(--text-soft); line-height: 1.35; }
.choice[class*="decision-"]:has(input:checked) { border-color: var(--d); background: var(--d-bg); }
.choice[class*="decision-"]:has(input:checked) strong { color: var(--d); }
.risk-choice { justify-content: center; text-align: center; padding: 9px 8px; }
.risk-choice::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.risk-choice.green::before { background: var(--green); }
.risk-choice.amber::before { background: var(--amber); }
.risk-choice.red::before { background: var(--red); }
.risk-choice.green:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.risk-choice.amber:has(input:checked) { border-color: var(--amber); background: var(--amber-soft); }
.risk-choice.red:has(input:checked) { border-color: var(--red); background: var(--red-soft); }

.review-preview { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface); }
.review-preview-text { font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.review-panel .btn { width: 100%; }

@media (max-width: 980px) {
  .desk-grid { grid-template-columns: 1fr; }
  .review-panel { position: static; }
}
@media (max-width: 760px) {
  .desk-card { padding: 18px 16px 18px 22px; }
  .ai-facts { grid-template-columns: 1fr; gap: 2px; }
  .ai-facts dd { margin-bottom: 8px; }
  .desk-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) { .choice-row { grid-template-columns: 1fr; } .risk-choice { justify-content: flex-start; } }

/* ════════════ accounts ════════════ */
/* top right: "Sign in" pill, or the person's initials with a small menu */
.auth-button { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-text); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.auth-button:hover { opacity: .9; }
.account-menu { position: relative; }
.avatar-button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--c-ink); font-weight: 700; font-size: 14px; letter-spacing: .02em;
  border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line-strong); }
.avatar-button:hover { transform: scale(1.04); }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 8px); z-index: 150; min-width: 220px; display: grid; padding: 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.account-dropdown-who { display: grid; gap: 1px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.account-dropdown-who span { color: var(--text-soft); word-break: break-all; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text); }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface-sunk); }

.signin-note { margin-top: 10px; font-size: 13.5px; color: var(--text-soft); }
.signin-note a { color: var(--text); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* sign in / create account */
.auth-wrap { display: grid; place-items: start center; padding: 40px 0 96px; }
.auth-card { width: 100%; max-width: 460px; display: grid; gap: 14px; padding: clamp(22px, 4vw, 34px); border-radius: var(--radius-xl);
  background: var(--surface-raised); border: 1.5px solid var(--line-strong); box-shadow: var(--shadow-card); }
.auth-card .display-sm { font-size: clamp(32px, 5vw, 44px); }
.auth-tabs { width: 100%; }
.auth-tabs .seg { flex: 1; display: grid; place-items: center; text-decoration: none; }
.auth-form { display: grid; gap: 12px; }
.auth-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.auth-field .desk-input { width: 100%; font-weight: 400; }
.auth-form .btn { width: 100%; }
.auth-switch { text-align: center; font-size: 14px; }
.auth-switch a { color: var(--text); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-slot { display: flex; justify-content: center; min-height: 44px; }

/* dashboard */
.dash { display: grid; gap: 28px; padding: 28px 0 96px; max-width: 980px; }
.dash-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.dash-head > div { flex: 1; min-width: 240px; display: grid; gap: 6px; }
.dash-avatar { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--c-ink); font-family: var(--font-display); font-weight: 700; font-size: 30px; }
.dash-meta { color: var(--text-soft); font-size: 14px; word-break: break-word; }
.dash-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dash-stat { display: grid; gap: 2px; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.dash-stat strong { font-family: var(--font-display); font-size: 34px; line-height: 1.1; }
.dash-stat span { color: var(--text-soft); font-size: 14px; }
.dash-section { display: grid; gap: 12px; }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.history-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.history-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--surface-sunk); }
.history-main { display: grid; gap: 2px; min-width: 0; }
.history-file { font-family: var(--font-mono); font-size: 12px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-when { font-size: 12.5px; color: var(--text-faint); }
.history-side { display: grid; gap: 4px; justify-items: end; text-align: right; }
.history-status { display: inline-flex; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface-sunk); }
.history-status.failed, .history-status.deleted { color: var(--red); }
.money { font-size: 13px; font-weight: 600; }
.money.paid { color: var(--text); }
.money.refunded { color: var(--green); }
.money.free { color: var(--text-soft); }
.history-pay { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.history-side .link-button { font-size: 13.5px; }
.dash-setting { display: grid; gap: 8px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.dash-setting h4 { font-size: 15px; }
.dash-password { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-password .desk-input { flex: 1 1 200px; }
.btn.danger { border-color: var(--red); color: var(--red); }

@media (max-width: 760px) {
  .auth-button { height: 36px; padding: 0 12px; font-size: 13px; }
  .avatar-button { width: 36px; height: 36px; font-size: 13px; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-avatar { width: 60px; height: 60px; font-size: 24px; }
  .history-row { grid-template-columns: auto minmax(0, 1fr); }
  .history-side { grid-column: 1 / -1; justify-items: start; text-align: left; }
}
