:root {
  --navy: #0f1728;
  --navy-2: #1a2438;
  --ink: #0f1728;
  --muted: #5c6578;
  --quiet: #8a93a4;
  --line: #e6e9ef;
  --line-2: #eef1f5;
  --paper: #fff;
  --canvas: #f5f6f8;
  --soft: #f4f6f9;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --blue-soft: #eef3ff;
  --teal: #0f8a72;
  --teal-soft: #e7f6f1;
  --amber: #b45309;
  --amber-soft: #fff6e8;
  --red: #c2413b;
  --bad: #c2413b;
  --red-soft: #fff1f0;
  --shadow: 0 1px 2px rgba(15, 23, 40, .05), 0 10px 28px -16px rgba(15, 23, 40, .18);
  --sans: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--canvas);
  background-image:
    linear-gradient(to right, rgba(15, 23, 40, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 40, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
h1, h2, h3, h4 { letter-spacing: -.02em; text-wrap: balance; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.hidden { display: none !important; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 246, 248, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar .wrap {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: none;
}
.brand h1 { font-size: 15px; letter-spacing: -.3px; font-weight: 650; }
.sub { color: var(--quiet); font-size: 11px; margin-top: 1px; letter-spacing: .01em; }
.logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0;
}
.logo svg { width: 14px; height: 14px; display: block; }
.disclaimer {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}
.stepper {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.st {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--quiet);
  font-size: 12px;
  border: 0;
  background: transparent;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: default;
}
.st.clickable { cursor: pointer; }
.st.clickable:hover { background: var(--soft); color: var(--navy); }
.st:disabled { opacity: .55; cursor: default; }
.st i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}
.st.now { color: var(--navy); font-weight: 650; }
.st.now i { background: var(--navy); color: #fff; border-color: var(--navy); }
.st.done { color: var(--teal); }
.st.done i { background: var(--teal-soft); color: var(--teal); border-color: #cfe8df; }

/* ---------- home ---------- */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 28px;
  align-items: start;
  padding: 44px 0 8px;
}
.hero { padding: 8px 0 12px; }
.kicker,
.pill {
  display: inline-block;
  font: 11px/1 var(--mono);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--quiet);
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 16px;
}
.hero h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -1.6px;
  color: var(--navy);
  max-width: 16ch;
  font-weight: 700;
}
.lead {
  max-width: 54ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-note { margin-top: 14px; color: var(--quiet); font-size: 12.5px; max-width: 54ch; }
.trust-row {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 8px;
}
.trust-row li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.trust-row li:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy);
  flex: none;
}

.workspace-card { margin: 0; padding-bottom: 14px; }
.workspace-card .inbox-list { max-height: 360px; overflow: auto; }
.workspace-label {
  font: 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--quiet);
  margin-bottom: 10px;
}
.intake-card { margin: 0 0 22px; }
.intake-card textarea { min-height: 140px; font-size: 13.5px; font-family: var(--mono); }
.store-list, .inbox-list { display: grid; gap: 8px; margin-top: 10px; }
.store-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--soft);
  font-size: 13px;
}
.store-pill b { flex: 1; font-weight: 650; }
.store-pill span { color: var(--quiet); font-size: 12px; }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 138, 114, .12);
  flex: none;
}
.inbox-head { margin-top: 14px; margin-bottom: 4px; }
.inbox-head .subhead { margin: 0; }
.inbox-count {
  font: 11px/1 var(--mono);
  color: var(--quiet);
  letter-spacing: .04em;
}
.inbox-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 12px;
  align-items: start;
  transition: border-color .15s var(--ease), transform .15s var(--ease), background .15s var(--ease);
}
.inbox-item:hover {
  border-color: #c9d3e6;
  background: #fbfcff;
  transform: translateY(-1px);
}
.inbox-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  margin-top: 6px;
}
.inbox-item b { display: block; font-size: 13.5px; letter-spacing: -.2px; color: var(--ink); }
.inbox-item .pulled { margin-top: 6px; color: var(--teal); font-size: 11.5px; }
.inbox-item > span:nth-child(2) span {
  display: block;
  color: var(--quiet);
  font-size: 12px;
  margin-top: 3px;
}
.inbox-side {
  text-align: right;
  display: grid;
  gap: 4px;
  justify-items: end;
}
.inbox-side strong {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}
.inbox-side em {
  font-style: normal;
  font: 10.5px/1 var(--mono);
  color: var(--quiet);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.inbox-go {
  color: var(--quiet);
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
}

.flow-cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 8px 0 28px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.flow-cards li {
  background: var(--paper);
  border: 0;
  border-radius: 0;
  padding: 18px 16px;
  box-shadow: none;
}
.flow-cards .n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--navy);
  border: 1px solid var(--line);
  font: 11px/1 var(--mono);
  font-weight: 650;
  margin-bottom: 12px;
}
.flow-cards b { display: block; font-size: 13.5px; }
.flow-cards small { display: block; color: var(--quiet); font-size: 12px; margin-top: 4px; }

.home-block { margin: 0 0 28px; }
.block-head { margin-bottom: 12px; }
.block-head h3 { font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.hint.tight { margin-top: 2px; font-size: 12px; }
.tip { display: block; color: var(--quiet); font-size: 11.5px; margin-top: 4px; }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preset {
  min-height: 108px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 14px;
  cursor: pointer;
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.preset:hover {
  border-color: #c9d3e6;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.preset.active {
  border-color: var(--navy);
  background: #fff;
  box-shadow: 0 0 0 1px var(--navy);
}
.preset b { display: block; font-size: 14px; line-height: 1.35; letter-spacing: -.2px; }
.preset span { display: block; font-size: 12px; color: var(--quiet); margin-top: 6px; }
.preset .preset-tag {
  color: var(--quiet);
  font: 10px/1 var(--mono);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: transparent;
  padding: 0;
  margin: 0 0 8px;
}
.preset-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 1.5em;
}
.fine { color: var(--quiet); font-size: 12px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.mini-card {
  background: var(--paper);
  border: 0;
  border-radius: 0;
  padding: 18px 20px;
}
.mini-card.warn { background: #fffaf6; }
.mini-card h4 { font-size: 13px; margin-bottom: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--quiet); font-weight: 650; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: .14s var(--ease);
}
.btn:hover { border-color: #c5cedc; color: var(--navy); background: var(--soft); }
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 40, .16);
}
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-lg { padding: 10px 16px; font-size: 14px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-ghost:hover { background: transparent; color: var(--navy); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- wizard ---------- */
.wizard { padding: 28px 0 48px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-title { font-size: 17px; letter-spacing: -.3px; margin-bottom: 6px; font-weight: 650; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.card-head .card-title { margin-bottom: 0; }
.subhead { font-size: 12px; margin: 18px 0 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--quiet); }
.rule { border: 0; border-top: 1px solid var(--line-2); margin: 8px 0 4px; }

.grid2, .grid3 { display: grid; gap: 0 12px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 650; color: #45546a; }
.field > span b { color: var(--red); font-weight: 700; margin-left: 2px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  font-size: 13px;
  outline: none;
}
input, select { height: 39px; }
textarea { resize: vertical; line-height: 1.55; min-height: 66px; }
input:focus, select:focus, textarea:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(15, 23, 40, .08);
}
select {
  appearance: none;
  cursor: pointer;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, #7a8798 50%),
    linear-gradient(135deg, #7a8798 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.code-line {
  font: 11px/1.55 var(--mono);
  color: #334155;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  margin: -3px 0 12px;
}

.checklist { display: grid; gap: 7px; margin: 8px 0 12px; }
.chk {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  align-items: start;
}
.chk > label { min-width: 0; cursor: pointer; }
.chk:hover { border-color: #c5cedc; background: #fff; }
.chk.on { border-color: #cbd5e1; background: #f8fafc; }
.chk input {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 1px solid #afbbca;
  border-radius: 5px;
  padding: 0;
  margin: 2px 0 0;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.chk input:checked { background: var(--navy); border-color: var(--navy); }
.chk input:checked:after { content: "✓"; color: #fff; font-size: 11px; font-weight: 900; line-height: 1; }
.chk .t { font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.chk .r { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.chk .h {
  display: none;
  grid-column: 2 / -1;
  font-size: 11px;
  color: var(--quiet);
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.chk .h.open { display: block; }
.how-toggle { justify-self: end; font-size: 11px; padding: 2px 8px; }
.tag-crit, .tag-file {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  vertical-align: 2px;
}
.tag-crit { background: var(--red-soft); color: var(--red); }
.tag-file { background: var(--teal-soft); color: var(--teal); }

.dropzone {
  display: block;
  min-height: 110px;
  border: 1px dashed #c3cbd6;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--navy); background: var(--soft); }
.dropzone b { display: block; }
.dropzone small { display: block; color: var(--quiet); margin-top: 6px; font-size: 12px; }
.meter {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--muted);
}
.meter .over { color: var(--red); }
.meter .fine { color: var(--teal); }
.filelist { display: grid; gap: 6px; margin-top: 8px; }
.filerow {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
.filerow.bad { border-color: #efccc8; background: #fff9f8; }
.fname { font-size: 12.5px; font-weight: 650; }
.fmeta { font-size: 11px; color: var(--quiet); }
.filerow .del {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}
.filewarn { margin-top: 8px; }
.fw { font-size: 12.5px; border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.fw.bad { background: var(--red-soft); color: #743e38; }
.fw.warn { background: var(--amber-soft); color: #73501e; }
.fw.ok { background: var(--teal-soft); color: #336a5d; }

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.step-hint { color: var(--muted); font-size: 12.5px; text-align: center; flex: 1; }
.quick-run { display: block; margin: 8px auto 0; }

/* ---------- analyzing ---------- */
.analyzing { padding: 72px 0; max-width: 640px; }
.scan-card { padding-top: 0; overflow: hidden; }
.scan-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 -22px 16px;
  padding: 10px 16px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.scan-chrome i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4dae3;
}
.scan-chrome span {
  margin-left: 8px;
  font: 11px/1 var(--mono);
  color: var(--quiet);
  letter-spacing: .04em;
}
.scan-bar {
  height: 4px;
  background: #e8ecf2;
  border-radius: 99px;
  overflow: hidden;
  margin: 16px 0 18px;
}
.scan-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--navy);
  border-radius: 99px;
  transition: width .38s var(--ease);
}
.scanlog { list-style: none; padding: 0; }
.scanlog li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  color: var(--quiet);
  opacity: .45;
  font-family: var(--mono);
  font-size: 12px;
}
.scanlog li.on { opacity: 1; color: var(--ink); font-weight: 650; }
.scanlog li.done { opacity: .85; color: var(--teal); }
.scanlog .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c5ceda;
  flex: none;
}
.scanlog li.on .dot { background: var(--navy); }
.scanlog li.done .dot { background: var(--teal); }

/* ---------- results ---------- */
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 24px 0 14px;
}
.result-head h2 { font-size: 22px; }
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px;
  padding-bottom: 40px;
  align-items: start;
}
.col-left, .col-right { min-width: 0; display: grid; gap: 14px; }

.route-line {
  display: grid;
  grid-template-columns: 72px 1fr 72px 1fr;
  gap: 6px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.route-line .k { color: var(--quiet); font-size: 11px; }
.clock { font-weight: 800; }
.clock.ok { color: var(--teal); }
.clock.soon { color: var(--amber); }
.clock.urgent, .clock.over { color: var(--red); }

.verdict {
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.verdict.rep { background: var(--teal-soft); border: 1px solid #c5e8dc; }
.verdict.nego { background: var(--amber-soft); border: 1px solid #f0ddb5; }
.verdict.acc { background: var(--red-soft); border: 1px solid #f0ceca; }
.v-label { font-size: 16px; font-weight: 800; }
.v-note { font-size: 12px; color: var(--muted); }
.strength { padding: 0 1px 14px; }
.strength-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.strength-head b { color: var(--ink); }
.bar { height: 7px; background: #edf0f4; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar.s-high i { background: var(--teal); }
.bar.s-mid i { background: #d8912c; }
.bar.s-low i { background: var(--red); }
.block-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--quiet);
  margin: 12px 0 6px;
}
ul.plain { padding: 0; margin: 0; list-style: none; }
ul.plain li {
  position: relative;
  padding: 4px 0 4px 17px;
  color: #4c5b70;
  font-size: 12.5px;
}
ul.plain li:before { content: "→"; position: absolute; left: 0; color: var(--navy); font-weight: 800; }
ul.plain li.have:before { content: "✓"; color: var(--teal); }
ul.plain.wont li { color: #8a7d6c; text-decoration: line-through; text-decoration-color: #c9b79a; }
ul.plain.wont li:before { content: "✕"; color: var(--red); text-decoration: none; }
.money {
  font-size: 13px;
  line-height: 1.7;
  background: var(--soft);
  border-radius: 8px;
  padding: 10px 12px;
}
.panel-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--soft);
  border-left: 3px solid #aab6c6;
  border-radius: 0 7px 7px 0;
  padding: 8px 10px;
  margin-top: 11px;
}
.panel-note.warn { background: var(--amber-soft); border-color: var(--amber); color: #73501e; }
.panel-note.bad { background: var(--red-soft); border-color: var(--red); color: #743e38; }
.panel-note.ok { background: var(--teal-soft); border-color: var(--teal); color: #336a5d; }

.gap-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  margin-top: 7px;
  background: #fff;
}
.gap-item.crit { border-color: #efccc8; background: #fff9f8; }
.gap-item .gt { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; font-weight: 750; }
.gap-item .miss { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--red); white-space: nowrap; }
.gap-item .gr { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.gap-item .gh { font-size: 10.5px; color: var(--quiet); margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--line); }

.letter {
  font: 12px/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 27px, #f1f4f8 27px, #f1f4f8 28px);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px 20px;
  max-height: none;
  overflow: visible;
  color: #1e293b;
  margin: 0;
}
.letter-toolbar {
  position: sticky;
  top: 58px;
  z-index: 8;
  background: #fff;
  padding-bottom: 10px;
}
.field-error { display: none; color: var(--red); font-size: 11.5px; margin-top: 2px; }
.field.has-error .field-error { display: block; }
.field.has-error > span { color: var(--red); }
.blocked-files {
  margin-top: 10px;
  border: 1px solid #efccc8;
  background: #fff9f8;
  border-radius: 9px;
  padding: 10px 12px;
}
.blocked-files h4 { font-size: 13px; color: var(--red); margin-bottom: 6px; }
.blocked-files li { font-size: 12.5px; color: #743e38; padding: 3px 0; }
.pack-status {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.pack-status.complete { background: var(--teal-soft); border-color: #c5e8dc; }
.pack-status.missing { background: var(--amber-soft); border-color: #f0ddb5; }
.pack-status.dont_fight { background: var(--red-soft); border-color: #f0ceca; }
.pack-status b { display: block; font-size: 15px; }
.pack-status span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.money-split { display: grid; gap: 4px; }
.money-split div { display: flex; justify-content: space-between; gap: 12px; }
.money-split .total { font-weight: 800; color: var(--ink); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; }

.foot {
  border-top: 1px solid var(--line);
  padding: 22px 0 36px;
  color: var(--quiet);
  font-size: 12px;
  background: transparent;
}
.foot .fine { margin-top: 4px; }
.foot-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 700px) {
  .foot-row { flex-direction: column; }
}
.foot-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 10px;
  font: 11px/1 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.foot-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .22s var(--ease);
  z-index: 100;
  box-shadow: 0 10px 25px rgba(16, 33, 61, .22);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(192, 68, 56, .08) !important; }
.verdict-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  flex: none;
}
.rep .verdict-icon { background: var(--teal); }
.nego .verdict-icon { background: var(--amber); }
.acc .verdict-icon { background: var(--red); }
.case-summary {
  padding: 16px 18px 14px;
  background: var(--navy);
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-radius: 11px 11px 0 0;
  margin: -22px -22px 0;
}
.case-summary small { font: 9.5px/1 var(--mono); letter-spacing: .16em; color: #aebbd0; font-weight: 500; text-transform: uppercase; }
.case-summary h3 { font-size: 16px; margin-top: 4px; letter-spacing: -.3px; }
.case-summary .case-meta { text-align: right; color: #cad3df; font-size: 12px; font-variant-numeric: tabular-nums; }
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line-2); }
.route-stat { padding: 13px 0; }
.route-stat span { display: block; font-size: 10px; color: var(--quiet); text-transform: uppercase; letter-spacing: .1em; }
.route-stat strong { display: block; font-size: 13px; margin-top: 4px; }
.exposure { padding: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.gap-summary {
  display: flex;
  justify-content: space-between;
  background: var(--soft);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.all-good { padding: 18px; text-align: center; background: var(--teal-soft); border-radius: 9px; color: #286a59; font-size: 13px; }
.pdf-index {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  padding: 12px 14px;
}
.pdf-index h3 { font-size: 13px; margin-bottom: 6px; }
.pdf-index ol { margin: 0; padding-left: 20px; }
.pdf-index li { font-size: 12.5px; color: #4c5b70; padding: 3px 0; }
.pdf-index .fine { margin-top: 8px; display: block; }
.preset-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 6px;
}

/* ---------- reason-code map / file type select ---------- */
.cat-help { margin: -4px 0 14px; }
.cat-help details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 8px 11px;
}
.cat-help summary { cursor: pointer; font-size: 12px; font-weight: 700; color: #45546a; }
.cat-help .row {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  gap: 10px;
  padding: 7px 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.cat-help .row b { color: var(--ink); font-size: 12px; }
.cat-help .row.now { background: var(--paper); border-radius: 6px; border-top-color: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cat-help code { font: 10.5px/1.6 var(--mono); color: #40599e; }

.ftype { height: 34px; font-size: 12px; padding: 0 8px; }
.filewarn .fw:first-child { margin-top: 0; }
.meter b { color: var(--ink); }

.paste-split {
  display: grid;
  grid-template-columns: 1fr;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .inbox-item, .preset, .btn, .toast, .scan-bar i { transition: none; }
}

@media (max-width: 700px) {
  .cat-help .row { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .hero-split, .flow-cards, .presets, .two-col, .result-grid, .grid3 { grid-template-columns: 1fr 1fr; }
  .hero-split { grid-template-columns: 1fr; padding-top: 28px; }
  .hero h2 { max-width: 20ch; }
  .disclaimer {
    display: block;
    white-space: normal;
    font-size: 10.5px;
    line-height: 1.35;
    padding: 5px 9px;
    max-width: 100%;
  }
  .letter-toolbar { top: 0; }
  .route-line { grid-template-columns: 72px 1fr; }
  .route-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .wrap { width: min(100% - 24px, 1120px); }
  .flow-cards, .presets, .two-col, .result-grid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .filerow { grid-template-columns: 1fr; }
  .hero { padding-top: 8px; }
  .topbar .wrap { flex-wrap: wrap; }
  .stepper { order: 3; width: 100%; justify-content: flex-start; }
  .inbox-item { grid-template-columns: 8px 1fr; }
  .inbox-side { grid-column: 2; text-align: left; justify-items: start; }
}

@media print {
  body { background: #fff; }
  .topbar, .foot, .result-head, #routeCard, #adviceCard, #gapCard, .btn-row, .hint { display: none !important; }
  .result-grid { display: block; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .letter { border: 0; max-height: none; overflow: visible; font-size: 10.5pt; line-height: 1.45; background: #fff; }
  .pdf-index { border: 0; background: #fff; page-break-before: always; }
}
