/* Pathub — friendly, guided UI for first-time inventors. Clean, crisp, modern. */

:root {
  --bg: #f4f6f9;
  --bg-soft: #eef1f6;
  --card: #ffffff;
  --line: #e7eaf0;
  --line-2: #d8dde6;
  --ink: #16202e;
  --ink-dim: #58627a;
  --ink-faint: #8b94a5;

  --brand: #2d68f0;
  --brand-2: #1b4fd1;
  --brand-soft: #e9f1fe;
  --brand-softer: #f3f8ff;
  --good: #16803c;
  --good-soft: #e7f5ec;
  --turn: #b26708;
  --turn-soft: #fdf2e0;
  --bad: #d92d2d;
  --bad-soft: #fcebeb;
  --on-brand: #ffffff;

  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.05);
  --shadow: 0 2px 5px rgba(20, 30, 50, 0.05), 0 12px 28px rgba(20, 30, 50, 0.07);
  --shadow-lg: 0 8px 40px rgba(20, 30, 50, 0.12);

  --r: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }

*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: rgba(139, 148, 165, 0.4); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }

#app {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 62px 1fr;
  grid-template-areas: "topbar topbar" "rail main";
  height: 100vh;
}

/* ============================================================= TOPBAR */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; background: var(--card); border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .nib { width: 26px; height: 26px; color: var(--brand); flex-shrink: 0; }
.brand .wordmark { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.brand .tag { font-size: 12px; color: var(--ink-faint); margin-left: 2px; font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .runname { font-size: 13.5px; color: var(--ink-dim); font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  border: none; cursor: pointer; font-family: var(--font); font-weight: 600;
  border-radius: var(--r-sm); transition: transform 0.06s, background 0.14s, box-shadow 0.14s, border-color 0.14s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); padding: 11px 20px; font-size: 15px; box-shadow: 0 2px 10px rgba(45, 104, 240, 0.28); }
.btn-primary:hover { background: var(--brand-2); box-shadow: 0 4px 16px rgba(45, 104, 240, 0.34); }
.btn-primary:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn-primary.small { padding: 8px 15px; font-size: 14px; }
.btn-ghost { background: var(--card); color: var(--ink-dim); border: 1.5px solid var(--line-2); padding: 10px 18px; font-size: 14.5px; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.small { padding: 7px 14px; font-size: 13.5px; }
.btn-soft { background: var(--bg-soft); color: var(--ink-dim); border: none; padding: 8px 15px; font-size: 14px; }
.btn-soft:hover { background: var(--line); color: var(--ink); }
.topbar .btn-primary { padding: 8px 16px; font-size: 14px; }

/* pro switch */
.proswitch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-faint); cursor: pointer; user-select: none; }
.proswitch .track { width: 34px; height: 19px; border-radius: 999px; background: var(--line-2); position: relative; transition: background 0.15s; }
.proswitch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left 0.15s; }
.proswitch.on .track { background: var(--brand); }
.proswitch.on .track::after { left: 17px; }

.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-dim); padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.pill b { font-family: var(--font-mono); font-size: 11.5px; }
.pill select { border: none; background: transparent; font-family: var(--font); font-size: 12px; color: var(--ink); cursor: pointer; }
.mode-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.mode-toggle button { background: transparent; border: none; padding: 5px 13px; font-size: 12px; cursor: pointer; color: var(--ink-faint); font-weight: 600; font-family: var(--font); }
.mode-toggle button.active { background: var(--brand); color: #fff; }

/* ============================================================= RAIL */
.rail {
  grid-area: rail; background: var(--card); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 18px 14px 30px; display: flex; flex-direction: column; gap: 8px;
}
.rail .rail-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-faint); font-weight: 700; margin: 4px 6px 6px; }
.run-select { width: 100%; background: var(--bg-soft); border: 1px solid var(--line-2); color: var(--ink); padding: 9px 11px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-family: var(--font); font-weight: 500; margin-bottom: 6px; }
.run-select:hover { border-color: var(--brand); }

.phase { margin-top: 10px; }
.phase-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.phase-head .pnum { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-soft); color: var(--ink-faint); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.phase-head.done .pnum { background: var(--good-soft); color: var(--good); }
.phase-head.active .pnum { background: var(--brand); color: #fff; }
.phase-head .plabel { font-size: 12.5px; font-weight: 700; color: var(--ink-dim); }
.phase-head.active .plabel { color: var(--ink); }
.phase-steps { margin: 2px 0 2px 18px; border-left: 2px solid var(--line); padding-left: 4px; }

.jstep { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; }
.jstep:hover { background: var(--bg-soft); }
.jstep.active { background: var(--brand-softer); }
.jicon { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
.jicon.passed { background: var(--good); border-color: var(--good); }
.jicon.running { background: var(--brand); border-color: var(--brand); animation: pulse 1.3s ease-in-out infinite; }
.jicon.turn { background: var(--turn); border-color: var(--turn); }
.jicon.next { border-color: var(--brand); }
.jicon.error { background: var(--bad); border-color: var(--bad); }
.jstep .jname { flex: 1; font-size: 13px; color: var(--ink-dim); line-height: 1.3; }
.jstep.active .jname, .jstep.done .jname { color: var(--ink); font-weight: 600; }
.jstep .jstatus { font-size: 10.5px; font-weight: 700; }
.jstatus.passed { color: var(--good); } .jstatus.running { color: var(--brand); }
.jstatus.turn { color: var(--turn); } .jstatus.next { color: var(--brand); } .jstatus.error { color: var(--bad); }

.rail-empty { color: var(--ink-faint); font-size: 13px; padding: 10px 8px; line-height: 1.5; }
.rail-feed { margin-top: 14px; }
.rail-feed .fi { font-size: 11px; color: var(--ink-faint); line-height: 1.4; margin-bottom: 6px; }
.rail-feed .fi b { color: var(--ink-dim); font-family: var(--font-mono); font-weight: 500; }

/* ============================================================= MAIN */
.main { grid-area: main; overflow-y: auto; padding: 26px 30px 70px; }
.wrap { max-width: 780px; margin: 0 auto; }

/* progress bar */
.progress { margin-bottom: 20px; }
.progress .ptop { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.progress .pstep { font-size: 13px; font-weight: 700; color: var(--ink); }
.progress .pstep .pphase { color: var(--brand); }
.progress .ppct { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.progress .ptrack { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress .pfill { height: 100%; background: linear-gradient(90deg, var(--brand), #4d81f5); border-radius: 999px; transition: width 0.4s ease; }

/* the guided step card */
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 30px 32px; box-shadow: var(--shadow); margin-bottom: 16px; }
.step-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.step-eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); }
.step-eyebrow .ph { color: var(--ink-faint); }
.step-title { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; font-optical-sizing: auto; }

.hook { display: flex; gap: 12px; background: var(--brand-softer); border: 1px solid var(--brand-soft); border-radius: var(--r-md); padding: 15px 17px; margin: 18px 0; }
.hook .ic { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.hook .htext { font-size: 14.5px; color: var(--ink-dim); line-height: 1.55; }

/* result / summary */
.result-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.result-badge.done { background: var(--good-soft); color: var(--good); }
.result-badge.turn { background: var(--turn-soft); color: var(--turn); }
.result-badge.error { background: var(--bad-soft); color: var(--bad); }

.summary { font-size: 16px; line-height: 1.68; color: var(--ink); }
.summary p { margin: 10px 0; }
.summary ul, .summary ol { margin: 10px 0 10px 22px; }
.summary li { margin: 5px 0; }
.summary strong { font-weight: 700; }
.summary-lead { font-size: 13px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }

.confidence { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); margin-top: 16px; }
.confidence .cbar { display: inline-flex; gap: 3px; }
.confidence .cbar i { width: 6px; height: 12px; border-radius: 2px; background: var(--line-2); }
.confidence .cbar i.on { background: var(--good); }
.confidence.medium .cbar i.on { background: var(--turn); }

/* what we're doing (pending / preview) */
.doing { font-size: 15.5px; color: var(--ink-dim); line-height: 1.6; margin: 6px 0 4px; }
.doing b { color: var(--ink); }

/* decision */
.decision { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.decision .dq { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.decision .dhelp { font-size: 14px; color: var(--ink-dim); line-height: 1.55; margin-bottom: 16px; }
.decision .dbtns { display: flex; gap: 12px; flex-wrap: wrap; }
.feedback { margin-top: 16px; }
.feedback textarea { width: 100%; background: var(--bg-soft); border: 1.5px solid var(--line-2); border-radius: var(--r-md); padding: 13px 15px; font-family: var(--font); font-size: 15px; line-height: 1.55; resize: vertical; min-height: 90px; color: var(--ink); }
.feedback textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.feedback .fbtns { display: flex; gap: 10px; margin-top: 12px; }

/* working state */
.working { text-align: center; padding: 20px 10px 10px; }
.working .spinner { display: inline-flex; gap: 6px; margin-bottom: 16px; }
.working .spinner i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: bounce 1.3s ease-in-out infinite; }
.working .spinner i:nth-child(2) { animation-delay: 0.16s; }
.working .spinner i:nth-child(3) { animation-delay: 0.32s; }
.working .wmsg { font-size: 16px; font-weight: 600; color: var(--ink); min-height: 24px; }
.working .wsub { font-size: 13.5px; color: var(--ink-faint); margin-top: 6px; }
.working .wshimmer { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin: 22px auto 0; max-width: 340px; position: relative; }
.working .wshimmer::after { content: ""; position: absolute; inset: 0; width: 45%; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: sweep 1.6s ease-in-out infinite; }

/* details disclosure */
.disclosure { margin-top: 22px; }
.disclosure-toggle { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; color: var(--ink-dim); font-family: var(--font); font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.disclosure-toggle:hover { color: var(--brand); }
.disclosure-toggle .chev { transition: transform 0.15s; font-size: 11px; }
.disclosure-toggle.open .chev { transform: rotate(90deg); }
.doc-panel { margin-top: 14px; }
.doc-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-tabs button { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; color: var(--ink-dim); font-family: var(--font); font-weight: 500; }
.doc-tabs button:hover { border-color: var(--brand); }
.doc-tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.doc-body { border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px; max-height: 560px; overflow-y: auto; font-size: 14.5px; line-height: 1.7; background: var(--card); }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 { font-family: var(--font-display); font-weight: 600; margin: 16px 0 8px; line-height: 1.25; }
.doc-body h1 { font-size: 21px; } .doc-body h2 { font-size: 18px; } .doc-body h3 { font-size: 15.5px; } .doc-body h4 { font-size: 14px; }
.doc-body p { margin: 9px 0; } .doc-body ul, .doc-body ol { margin: 9px 0 9px 22px; } .doc-body li { margin: 3px 0; }
.doc-body strong { font-weight: 700; }
.doc-body code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; }
.doc-body pre { background: #0f1626; color: #cdd6e6; border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; margin: 12px 0; }
.doc-body pre code { background: none; color: #9fd0a0; font-size: 11.5px; }
.doc-body hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.doc-body table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13.5px; }
.doc-body th, .doc-body td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.doc-body th { background: var(--bg-soft); font-weight: 700; }
.doc-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.doc-actions .path { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }

/* pro-only inline meta */
.pro-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }
.pro-meta .mchip b { color: var(--ink-dim); }
.pro-meta select { font-family: var(--font-mono); font-size: 11.5px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 3px 7px; background: var(--card); }
.pro-scores { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.pro-scores .sc { font-family: var(--font-mono); font-size: 11px; background: var(--bg-soft); border-radius: 999px; padding: 3px 10px; color: var(--ink-dim); }
.pro-stream { margin-top: 14px; background: #0f1626; border-radius: var(--r-sm); padding: 12px 14px; font-family: var(--font-mono); font-size: 11px; color: #9fd0a0; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; line-height: 1.6; }

.warn-list { margin-top: 12px; }
.warn-item { font-size: 13.5px; color: var(--turn); margin: 5px 0; }

/* ============================================================= INTAKE WIZARD */
.intake-top { text-align: center; margin-bottom: 24px; }
.intake-top .eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); }
.wprog { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; }
.wprog .wdot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); transition: all 0.22s; }
.wprog .wdot.done { background: var(--brand); }
.wprog .wdot.active { background: var(--brand); transform: scale(1.55); box-shadow: 0 0 0 4px var(--brand-soft); }
.wprog .wlabel { font-size: 12px; color: var(--ink-faint); font-weight: 600; margin-left: 8px; }

.wizard-wrap { display: flex; gap: 40px; justify-content: center; align-items: flex-start; }
.wizard { width: 100%; max-width: 580px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 40px 42px; box-shadow: var(--shadow); }
.wq-title { font-family: var(--font-display); font-size: 31px; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; text-align: center; font-optical-sizing: auto; }
.wq-why { color: var(--ink-dim); font-size: 15px; text-align: center; margin: 12px auto 26px; max-width: 450px; line-height: 1.55; }
.wq input, .wq textarea { width: 100%; background: var(--bg-soft); border: 1.5px solid var(--line-2); border-radius: var(--r-md); font-family: var(--font); color: var(--ink); line-height: 1.5; resize: vertical; }
.wq textarea { padding: 15px 17px; font-size: 16px; min-height: 150px; }
.wq input { padding: 16px 18px; font-size: 18px; }
.wq.name input { font-size: 25px; text-align: center; padding: 22px; font-weight: 600; font-family: var(--font-display); }
.wq input:focus, .wq textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.wq input::placeholder, .wq textarea::placeholder { color: var(--ink-faint); font-weight: 400; }
.wnav { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.wnav > span { flex: 1; }
.wprivacy { text-align: center; font-size: 12px; color: var(--ink-faint); margin-top: 20px; }

.margin-note { width: 224px; flex-shrink: 0; padding-top: 96px; }
.margin-note .mn-card { border-left: 2px solid var(--brand-soft); padding: 2px 0 2px 16px; }
.margin-note .mn-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--brand); margin-bottom: 7px; }
.margin-note .mn-text { font-size: 14px; color: var(--ink-dim); line-height: 1.55; font-style: italic; font-family: var(--font-display); }
@media (max-width: 1080px) { .margin-note { display: none; } }

/* technical detail shown only in Pro mode */
.tech-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
.tech-sub b { color: var(--ink-dim); }
.role-pro { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); line-height: 1.6; border-left: 2px solid var(--line-2); padding-left: 13px; margin: 16px 0; }

/* ================================================= PRO MODE (dense, technical) */
.proswitch.on { color: var(--turn); font-weight: 700; }
.proswitch.on .track { background: var(--turn); }
body.pro .main { background: #eceff4; }

body.pro .topbar { background: #0e1626; border-bottom-color: #243350; }
body.pro .brand .wordmark { color: #e6ecf7; }
body.pro .brand .tag { color: #7f8ca8; }
body.pro .topbar .runname { color: #aab6cf; font-family: var(--font-mono); font-size: 12px; }
body.pro .topbar .proswitch { color: var(--turn); }
body.pro .pill { background: rgba(255, 255, 255, 0.03); border-color: #26344f; color: #aab6cf; }
body.pro .pill select, body.pro .pill b { color: #dbe3f2; }
body.pro .pill select option { background: #0e1626; }
body.pro .mode-toggle { border-color: #26344f; }
body.pro .mode-toggle button { color: #7f8ca8; }
body.pro .mode-toggle button.active { background: #4d85f5; color: #fff; }

body.pro .rail { background: #0e1626; border-right-color: #243350; }
body.pro .rail .rail-lbl { color: #6f7d9a; }
body.pro .run-select { background: #17233a; border-color: #26344f; color: #dbe3f2; }
body.pro .phase-head .plabel { color: #9aa7c2; }
body.pro .phase-head.active .plabel { color: #e6ecf7; }
body.pro .phase-head .pnum { background: #17233a; color: #7f8ca8; }
body.pro .phase-head.done .pnum { background: rgba(22, 128, 60, 0.25); color: #6fd79a; }
body.pro .phase-head.active .pnum { background: #4d85f5; color: #fff; }
body.pro .phase-steps { border-left-color: #26344f; }
body.pro .jstep:hover { background: rgba(255, 255, 255, 0.04); }
body.pro .jstep.active { background: rgba(77, 133, 245, 0.16); }
body.pro .jstep .jname { color: #9aa7c2; font-family: var(--font-mono); font-size: 11.5px; }
body.pro .jstep.active .jname, body.pro .jstep.done .jname { color: #e6ecf7; }
body.pro .jicon { border-color: #33425f; }
body.pro .rail-feed .fi { color: #6f7d9a; }
body.pro .rail-feed .fi b { color: #9aa7c2; }

/* ============================================================= SCORED FINDINGS */
.findings-intro { font-size: 14px; color: var(--ink-dim); line-height: 1.55; margin: 4px 0 12px; }
.findings-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.findings { width: 100%; border-collapse: collapse; font-size: 14px; }
.findings th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 700; padding: 10px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.findings td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.findings tr:last-child td { border-bottom: none; }
.fc-concern { font-weight: 600; width: 34%; }
.fc-risk { width: 128px; white-space: nowrap; }
.risk-chip { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.risk-chip.high { background: var(--bad-soft); color: var(--bad); }
.risk-chip.med { background: var(--turn-soft); color: var(--turn); }
.risk-chip.low { background: var(--good-soft); color: var(--good); }
.fc-desc { color: var(--ink-dim); line-height: 1.5; }
.fuzzy { filter: blur(5px); user-select: none; transition: filter 0.3s ease; }
.fuzzy.revealed { filter: none; user-select: text; }
.verdict { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 5px; margin-left: 2px; white-space: nowrap; }
.verdict.defend { background: var(--good-soft); color: var(--good); }
.verdict.amend { background: var(--turn-soft); color: var(--turn); }
.verdict.weak { background: var(--bad-soft); color: var(--bad); }
.reveal-waiver { display: flex; gap: 12px; align-items: flex-start; background: var(--turn-soft); border: 1px solid #e8cf9a; border-radius: var(--r-md); padding: 13px 15px; margin-top: 12px; font-size: 13px; color: var(--ink-dim); line-height: 1.5; cursor: pointer; }
.reveal-waiver input { margin-top: 2px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--turn); cursor: pointer; }
.reveal-waiver b { color: var(--turn); }
.revealed-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 12px; line-height: 1.5; }

/* ============================================================= AUTH */
.auth-card { max-width: 400px; margin: 8vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 34px 34px 30px; box-shadow: var(--shadow); }
.auth-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; text-align: center; }
.auth-sub { color: var(--ink-dim); font-size: 14px; text-align: center; margin: 6px 0 22px; }
.auth-card .field { margin-top: 14px; }
.auth-card .field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.auth-card .field input { width: 100%; background: var(--bg-soft); border: 1.5px solid var(--line-2); border-radius: var(--r-md); padding: 11px 14px; font-family: var(--font); font-size: 15px; color: var(--ink); }
.auth-card .field input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-card .field input::placeholder { color: var(--ink-faint); }
.auth-err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 10px 0 4px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--ink-dim); margin-top: 16px; }
.auth-switch a { color: var(--brand); font-weight: 600; cursor: pointer; }
.acct { font-size: 12.5px; color: var(--ink-dim); font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credits-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--good); background: var(--good-soft); border-radius: 999px; padding: 5px 12px; font-family: var(--font-mono); }
.credits-pill.low { color: var(--turn); background: var(--turn-soft); }
.nocredit-banner { background: var(--turn-soft); border: 1px solid #e8cf9a; border-left: 4px solid var(--turn); border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px; font-size: 14px; color: var(--ink); }
.nocredit-banner b { color: var(--turn); }

/* ============================================================= WAIVER MODAL */
.disclosure-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.disclosure-row .disclosure-toggle { flex: 1; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15, 22, 40, 0.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; animation: fadeIn 0.18s ease both; }
.modal { background: var(--card); border-radius: var(--r); max-width: 580px; width: 100%; box-shadow: var(--shadow-lg); padding: 28px 32px; max-height: 92vh; overflow-y: auto; animation: fadeUp 0.24s ease both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.modal-x { background: none; border: none; font-size: 17px; color: var(--ink-faint); cursor: pointer; line-height: 1; padding: 4px; }
.modal-x:hover { color: var(--ink); }
.modal-intro { font-size: 14px; color: var(--ink-dim); line-height: 1.6; margin: 12px 0 20px; }
.acks { display: flex; flex-direction: column; gap: 11px; }
.ack { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--ink); cursor: pointer; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; transition: border-color 0.12s, background 0.12s; }
.ack:hover { border-color: var(--line-2); }
.ack input { margin-top: 2px; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: var(--brand); }
.ack:has(input:checked) { background: var(--brand-softer); border-color: var(--brand-soft); }
.sign { margin-top: 22px; }
.sign label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.sign input { width: 100%; background: var(--bg-soft); border: 1.5px solid var(--line-2); border-radius: var(--r-md); padding: 13px 16px; font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.sign input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.sign-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 9px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ============================================================= ANIM */

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes sweep { 0% { left: -45%; } 100% { left: 100%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.wrap > * { animation: fadeUp 0.28s ease both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ============================================================= RESPONSIVE */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 62px auto 1fr; grid-template-areas: "topbar" "rail" "main"; }
  .rail { max-height: 42vh; border-right: none; border-bottom: 1px solid var(--line); }
  .main { padding: 20px 16px 50px; }
  .step-card { padding: 22px 20px; }
  .hero h1 { font-size: 30px; }
  .step-title { font-size: 25px; }
  .brand .tag { display: none; }
}
