/* Robo-Insure AI — Gap Scanner MVP */
:root {
  --bg: #0A1218;
  --surface: #121D26;
  --surface-2: #16232E;
  --border: #24333E;
  --heading: #F2F5F7;
  --body: #C3CDD4;
  --muted: #8A97A1;
  --azure: #4DA6FF;
  --azure-dim: rgba(77, 166, 255, 0.12);
  --gold: #D9B45B;
  --gold-dim: rgba(217, 180, 91, 0.14);
  --covered: #4CAF7D;
  --silent: #E08A4C;
  --excluded: #E05C5C;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --maxw: 900px;
  --ease: cubic-bezier(0.22, 0.75, 0.25, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--body);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--heading);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  font-weight: 600;
}
h1 { font-size: clamp(1.5rem, 5vw, 2.05rem); }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--azure); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; border-radius: 4px; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.lede { color: var(--muted); max-width: 60ch; margin-top: 10px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 18, 24, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 58px; }
.lockup { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.lockup:hover { text-decoration: none; }
.lockup img { width: 24px; height: 27px; display: block; }
.wordmark {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.02rem;
  color: var(--heading); letter-spacing: -0.02em; white-space: nowrap;
}
.wordmark .hy { color: var(--azure); }
.badge-mvp {
  font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(217, 180, 91, 0.5);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.header-tag { margin-left: auto; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) { .header-tag { display: none; } }

/* ---------- stepper ---------- */
.stepper { border-bottom: 1px solid var(--border); background: rgba(18, 29, 38, 0.4); }
.stepper ol {
  list-style: none; display: flex; gap: 6px; margin: 0; padding: 12px 0;
}
.stepper li { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.stepper li > button {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0;
  color: inherit; min-width: 0; cursor: default;
}
.stepper li.reachable > button { cursor: pointer; }
.stepper li.reachable > button:hover .lbl { color: var(--heading); }
.stepper li.locked > button { opacity: 0.45; }
.stepper li::after {
  content: ""; flex: 1; height: 1px; background: var(--border); margin-left: 4px;
}
.stepper li:last-child::after { display: none; }
.stepper .dot {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  border: 1px solid var(--border); color: var(--muted);
  display: grid; place-items: center; font-size: 0.75rem;
  font-variant-numeric: tabular-nums; transition: all .3s var(--ease);
}
.stepper .lbl { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.stepper li.active .dot { border-color: var(--azure); color: var(--bg); background: var(--azure); }
.stepper li.active .lbl { color: var(--heading); }
.stepper li.done .dot { border-color: var(--covered); color: var(--covered); }
@media (max-width: 720px) { .stepper .lbl { display: none; } }
@media (max-width: 720px) { .stepper ol { gap: 2px; } }

/* ---------- steps ---------- */
.step { padding: 34px 0 56px; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } }

/* ---------- upload ---------- */
.drop {
  margin-top: 22px; border: 1.5px dashed var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 40px 22px; text-align: center;
  transition: border-color .25s var(--ease), background .25s var(--ease);
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--azure); background: var(--surface-2); }
.drop-icon { width: 30px; height: 30px; color: var(--azure); margin-bottom: 10px; }
.drop-title { font-family: 'Space Grotesk', sans-serif; color: var(--heading); font-size: 1.02rem; margin: 0 0 6px; }
.drop-sub { color: var(--muted); font-size: 0.83rem; margin: 0; }

.or-row { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.or-line { flex: 1; height: 1px; background: var(--border); }
.or-word { color: var(--muted); font-size: 0.8rem; }

.sample-card {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  padding: 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between;
}
.sample-card p { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }
@media (max-width: 620px) { .sample-card { flex-direction: column; align-items: flex-start; } }

/* ---------- buttons ---------- */
.btn {
  border-radius: var(--r-sm); padding: 10px 16px; border: 1px solid transparent;
  transition: all .2s var(--ease); font-weight: 500; white-space: nowrap;
}
.btn-primary { background: var(--azure); color: #06121C; }
.btn-primary:hover { background: #6FB8FF; }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--azure); color: var(--azure); }
.btn-small { padding: 7px 12px; font-size: 0.83rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
#btn-prefill { white-space: normal; text-align: left; line-height: 1.35; max-width: 100%; }
textarea { min-height: 72px; overflow: hidden; }

/* ---------- status + alerts ---------- */
.status {
  margin-top: 18px; border: 1px solid var(--border); border-left: 2px solid var(--azure);
  border-radius: var(--r-sm); background: var(--surface); padding: 12px 14px; font-size: 0.88rem;
}
.alert {
  margin-top: 18px; border: 1px solid rgba(224, 92, 92, 0.45);
  border-radius: var(--r-sm); background: rgba(224, 92, 92, 0.08);
  padding: 12px 14px; font-size: 0.88rem; color: #F3CACA;
}
.spinner {
  display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--border); border-top-color: var(--azure); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- form ---------- */
.doc-chip {
  margin: 18px 0 14px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px;
  font-size: 0.82rem; color: var(--body); background: var(--surface);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.doc-chip .tick { color: var(--covered); }
.form { margin-top: 20px; display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 7px; border: 0; padding: 0; margin: 0; }
.field > span, .field legend {
  font-size: 0.82rem; color: var(--muted); padding: 0;
}
input, select, textarea {
  font-family: inherit; font-size: 0.93rem; color: var(--heading);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
  transition: border-color .2s var(--ease);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--azure); outline: none; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
@media (max-width: 620px) { .checks { grid-template-columns: 1fr; } }
.check {
  display: flex; gap: 9px; align-items: flex-start; font-size: 0.88rem;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); padding: 10px 12px; cursor: pointer;
  transition: border-color .2s var(--ease);
}
.check:hover { border-color: var(--azure); }
.check input { width: auto; margin: 2px 0 0; accent-color: var(--azure); }
.check.on { border-color: var(--azure); background: var(--azure-dim); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- scan stages ---------- */
.stages { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; }
.stages li {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: 14px 16px; color: var(--muted);
  transition: all .3s var(--ease);
}
.stages li .num {
  width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 0.7rem;
}
.stages li.active { border-color: var(--azure); color: var(--heading); background: var(--surface-2); }
.stages li.active .num { border-color: var(--azure); color: var(--azure); }
.stages li.done { color: var(--body); }
.stages li.done .num { border-color: var(--covered); color: var(--covered); }
.scan-note { margin-top: 18px; display: grid; gap: 4px; }

/* ---------- report ---------- */
.report-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.report-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 12px; }
@media (max-width: 560px) { .summary { grid-template-columns: 1fr; } }
.sum-card {
  border: 1px solid var(--border); border-top: 2px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); padding: 14px 16px;
}
.sum-card .n { font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; color: var(--heading); line-height: 1; font-variant-numeric: tabular-nums; }
.sum-card .k { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.sum-card.covered { border-top-color: var(--covered); }
.sum-card.silent { border-top-color: var(--silent); }
.sum-card.excluded { border-top-color: var(--excluded); }

.findings { display: grid; gap: 14px; margin: 22px 0 26px; }
.card {
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); padding: 18px;
}
.card.covered { border-left-color: var(--covered); }
.card.silent { border-left-color: var(--silent); }
.card.excluded { border-left-color: var(--excluded); }
.card-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.pill {
  font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px; border: 1px solid;
}
.pill.covered { color: var(--covered); border-color: rgba(76, 175, 125, 0.5); background: rgba(76, 175, 125, 0.1); }
.pill.silent { color: var(--silent); border-color: rgba(224, 138, 76, 0.5); background: rgba(224, 138, 76, 0.1); }
.pill.excluded { color: var(--excluded); border-color: rgba(224, 92, 92, 0.5); background: rgba(224, 92, 92, 0.1); }
.card .topic { font-size: 0.78rem; color: var(--muted); margin: 6px 0 0; }
.card .why { margin: 10px 0 0; }
.ev { margin-top: 14px; display: grid; gap: 8px; }
.ev-item {
  border-left: 2px solid var(--border); background: var(--surface-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 12px;
}
.ev-ref { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--azure); }
.ev-quote { font-size: 0.86rem; color: var(--body); margin: 5px 0 0; font-style: italic; }
.opts { margin: 14px 0 0; }
.opts h4 { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.opts ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; font-size: 0.89rem; }
.opts li::marker { color: var(--azure); }
.conf { font-size: 0.75rem; color: var(--muted); }

.disclaimer {
  border: 1px solid var(--gold); border-radius: var(--r-md);
  background: var(--gold-dim); padding: 14px 16px; font-size: 0.86rem; color: #EBDCB4;
}

.app-footer { border-top: 1px solid var(--border); padding: 20px 0 30px; margin-top: 20px; }

/* ---------- print ---------- */


/* ---------- severity strip + heat map ---------- */
.strip {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--border); margin: 22px 0 14px; background: var(--surface);
}
.strip span { display: block; height: 100%; }
.strip span.excluded { background: var(--excluded); }
.strip span.silent { background: var(--silent); }
.strip span.covered { background: var(--covered); }

.heat { margin: 26px 0 10px; }
.heat-head h2 { font-size: 1.15rem; }
.heat-head p { margin-top: 6px; }
.heat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px;
}
@media (max-width: 720px) { .heat-grid { grid-template-columns: repeat(2, 1fr); } }
.tile {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 13px;
  text-align: left; background: var(--surface); color: var(--heading);
  display: grid; gap: 8px; align-content: start; min-height: 96px;
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.tile:hover { transform: translateY(-2px); }
.tile .tile-area { font-family: 'Space Grotesk', sans-serif; font-size: 0.92rem; line-height: 1.2; }
.tile .tile-status {
  font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
}
.tile .tile-bar { height: 3px; border-radius: 2px; }
.legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; font-size: 0.8rem; color: var(--body); }
.legend .key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend .key.excluded { background: var(--excluded); }
.legend .key.silent { background: var(--silent); }
.legend .key.covered { background: var(--covered); }
.legend .muted { margin-left: auto; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 22px; }
.card.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: none; } 25% { box-shadow: 0 0 0 2px var(--azure); } }

/* ---------- options page ---------- */
.options-body { display: grid; gap: 22px; margin: 24px 0 26px; }
.gap-block {
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: 18px;
}
.gap-block .gap-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.gap-block .gap-area { font-size: 0.78rem; color: var(--muted); margin: 6px 0 0; }
.gap-block .gap-why { margin: 10px 0 0; color: var(--body); }
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 800px) { .paths { grid-template-columns: 1fr; } }
.path {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  padding: 14px; display: grid; gap: 8px; align-content: start;
}
.path .path-kind {
  font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--azure);
}
.path.standalone .path-kind { color: var(--gold); }
.path.operational .path-kind { color: var(--covered); }
.path h4 { font-family: 'Space Grotesk', sans-serif; font-size: 0.95rem; color: var(--heading); margin: 0; line-height: 1.25; }
.path p { font-size: 0.87rem; margin: 0; }
.gap-foot { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- compare page ---------- */
.filters { display: grid; gap: 10px; margin: 22px 0 6px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--body); font-size: 0.8rem; padding: 6px 12px; transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--azure); color: var(--heading); }
.chip.on { border-color: var(--azure); background: var(--azure-dim); color: var(--heading); }
.compare-body { margin: 18px 0 20px; display: grid; gap: 26px; }
.cat-block h2 { font-size: 1.05rem; margin-bottom: 10px; }
table.market { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
table.market th {
  text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 0 12px 8px 0; border-bottom: 1px solid var(--border);
}
table.market td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
table.market td:first-child, table.market td:last-child { white-space: nowrap; }
table.market td .pname { font-family: 'Space Grotesk', sans-serif; color: var(--heading); }
.gapchips { display: flex; gap: 5px; flex-wrap: wrap; }
.gapchip {
  font-size: 0.68rem; border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 8px; color: var(--muted); white-space: nowrap;
}
.gapchip.hit { border-color: var(--azure); color: var(--azure); }
.market-cards { display: none; }
@media (max-width: 760px) {
  table.market { display: none; }
  .market-cards { display: grid; gap: 10px; }
}
.mcard {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 14px;
  display: grid; gap: 8px;
}
.mcard .pname { font-family: 'Space Grotesk', sans-serif; color: var(--heading); font-size: 0.98rem; }
.empty {
  border: 1px dashed var(--border); border-radius: var(--r-md); padding: 20px;
  color: var(--muted); font-size: 0.88rem; text-align: center;
}

/* ---------- v3: access gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: grid; place-items: center; padding: 24px;
}
.gate-card {
  width: 100%; max-width: 360px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 28px 24px; display: grid; gap: 14px; text-align: center;
}
.gate-lockup { justify-content: center; }
.gate-line { color: var(--body); font-size: 0.92rem; }
.gate-form { display: grid; gap: 10px; }
.gate-form input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--heading); padding: 11px 13px; font: inherit; text-align: center; letter-spacing: 0.08em;
}
.gate-form input:focus { outline: none; border-color: var(--azure); }
.gate-error { color: var(--excluded); font-size: 0.85rem; }

/* ---------- v3: source cards ---------- */
.source-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
@media (max-width: 860px) { .source-cards { grid-template-columns: 1fr; } }
.src-card {
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px; display: grid; gap: 10px; align-content: start;
}
.src-card h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; color: var(--heading); margin: 0; }
.src-card .btn { justify-self: start; }
.src-soon { opacity: 0.6; }
.mini-drop {
  border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: 16px 12px;
  text-align: center; cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.mini-drop:hover, .mini-drop.over { border-color: var(--azure); background: var(--azure-dim); }
.mini-drop .drop-title { margin: 0; }
.mini-drop .drop-sub { margin: 4px 0 0; font-size: 0.76rem; color: var(--muted); }
.consent { font-size: 0.76rem; color: var(--muted); margin: 0; }

/* ---------- v3: email review ---------- */
.mail-review {
  margin-top: 24px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 18px;
}
.review-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.review-head h2 { font-size: 1.1rem; }
.candidates { display: grid; gap: 12px; margin-top: 16px; }
.cand {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  padding: 14px; display: grid; gap: 10px;
}
.cand-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.cand-name { font-family: 'Space Grotesk', sans-serif; color: var(--heading); font-size: 0.95rem; word-break: break-word; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.echip {
  font-size: 0.72rem; border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px;
  color: var(--body); background: var(--bg);
}
.echip.sender { border-color: rgba(77, 166, 255, .5); color: var(--azure); }
.echip.filename { border-color: rgba(217, 180, 91, .5); color: var(--gold); }
.echip.content { border-color: rgba(76, 175, 125, .5); color: var(--covered); }
.cand-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.aside { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.aside summary { cursor: pointer; font-size: 0.86rem; color: var(--body); }
.aside .aside-item { font-size: 0.82rem; color: var(--muted); padding: 8px 0 0; }
.ocr-tag {
  font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; margin-left: 8px;
  white-space: nowrap;
}

/* ---- sample wording viewer ---- */
.pdf-modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 9, 13, 0.92);
  display: flex; flex-direction: column;
}
.pdf-modal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); color: var(--heading);
  font-family: 'Space Grotesk', sans-serif; font-size: 15px;
}
.pdf-modal-close {
  background: none; border: 1px solid var(--border); color: var(--body);
  border-radius: 8px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer;
}
.pdf-modal-close:hover { border-color: var(--azure); color: var(--heading); }
.pdf-modal-pages { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdf-modal-pages img {
  width: min(720px, 100%); height: auto; display: block;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}

/* ---------------- v4: detected line, self-check ---------------- */
.line-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 18px;
}
.line-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--azure-dim);
  border: 1px solid rgba(77, 166, 255, 0.4);
  color: var(--azure);
  font-size: 0.8rem;
  font-weight: 600;
}
.line-fix { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; }
.line-fix > span { white-space: nowrap; }
.line-fix select {
  padding: 5px 8px;
  background: var(--surface);
  color: var(--body);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 0.8rem;
  max-width: 220px;
}
.line-fix select:disabled { opacity: 0.5; }

.report-marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}
.badge-check {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(76, 175, 125, 0.14);
  border: 1px solid rgba(76, 175, 125, 0.45);
  color: var(--covered);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.badge-check:hover { background: rgba(76, 175, 125, 0.22); }
#selfcheck-note, #kb-line { margin: 8px 0 0; max-width: 62ch; }

@media (max-width: 560px) {
  .line-fix { width: 100%; }
  .line-fix select { flex: 1 1 auto; max-width: none; }
}

/* ---------- v5: market selector ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 3px; }
.seg-btn {
  border: none; background: transparent; color: var(--body); font: inherit; font-size: 0.85rem;
  padding: 7px 15px; border-radius: 999px; transition: all .2s var(--ease); cursor: pointer;
}
.seg-btn:hover { color: var(--heading); }
.seg-btn.on { background: var(--azure-dim); color: var(--heading); box-shadow: inset 0 0 0 1px var(--azure); }
@media (max-width: 420px) { .seg { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-sm); } .seg-btn { border-radius: var(--r-sm); } }

/* ---------- v5: toast for blocked links ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 14px);
  z-index: 80; max-width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--gold); border-radius: var(--r-md); background: var(--surface-2);
  color: #EBDCB4; font-size: 0.86rem; padding: 11px 15px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease), transform .22s var(--ease);
  word-break: break-word;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media print { .toast { display: none; } }

/* ---------- v5: voice dictation ---------- */
.dictate-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn-mic { display: inline-flex; align-items: center; gap: 8px; }
.mic-ico { width: 8px; height: 12px; border-radius: 999px; background: var(--muted); flex: none; }
.btn-mic:hover .mic-ico { background: var(--azure); }
.btn-mic.listening { border-color: var(--gold); color: var(--gold); }
.btn-mic.listening .mic-ico { background: var(--gold); }
.btn-mic.off { opacity: 0.5; }
.dictate-note { line-height: 1.4; }

/* ---------- v5: two paths per gap ---------- */
.two-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; align-items: start; }
@media (max-width: 800px) { .two-paths { grid-template-columns: 1fr; } }
.path-col {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  padding: 15px; display: grid; gap: 10px; align-content: start;
}
.path-col .path-title {
  font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; margin: 0;
  font-family: 'Inter', sans-serif; font-weight: 500;
}
.path-col.upgrade .path-title { color: var(--azure); }
.path-col.buy .path-title { color: var(--gold); }
.path-col .ask {
  margin: 0; color: var(--heading); font-family: 'Space Grotesk', sans-serif;
  font-size: 0.96rem; line-height: 1.4;
}
.ask-block { display: grid; gap: 5px; }
.ask-label { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ask-block ul { margin: 0; padding-left: 17px; display: grid; gap: 4px; }
.ask-block li, .ask-block p { font-size: 0.86rem; margin: 0; color: var(--body); }
.prod-list { display: grid; gap: 9px; }
.prod {
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  padding: 12px; display: grid; gap: 6px;
}
.prod-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.prod-provider { font-family: 'Space Grotesk', sans-serif; color: var(--heading); font-size: 0.95rem; }
.prod-tag {
  font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px;
  padding: 2px 8px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.prod-tag.online { border-color: rgba(76, 175, 125, 0.5); color: var(--covered); }
.prod-tag.quote { border-color: rgba(217, 180, 91, 0.45); color: var(--gold); }
.prod-name { margin: 0; font-size: 0.87rem; color: var(--body); }
.prod-note { margin: 0; font-size: 0.8rem; color: var(--muted); }
.prod a { font-size: 0.84rem; }
.market-cards.wide { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 760px) { .market-cards.wide { grid-template-columns: 1fr; } }

/* ---------- v5.3 connect your systems ---------- */
.connect-pointer { margin: 14px 0 0; }

.connect {
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px; display: grid; gap: 12px;
}
.connect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.connect-head h2 { margin: 0; font-size: 1.05rem; }
.connect > p { margin: 0; color: var(--muted); }

.conn-search {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 13px;
}
.conn-search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.conn-search input {
  flex: 1; background: none; border: 0; outline: none; color: var(--heading);
  font: inherit; font-size: 0.9rem; padding: 0;
}
.conn-search input::placeholder { color: var(--muted); }
.conn-search:focus-within { border-color: var(--azure); }

.gallery { display: grid; gap: 4px; }
.conn-cat {
  font-family: 'Space Grotesk', sans-serif; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 12px 0 8px;
}
.conn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ctile {
  display: flex; align-items: center; gap: 11px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  padding: 11px 12px; transition: border-color .2s var(--ease);
}
.ctile:hover { border-color: rgba(77, 166, 255, 0.45); }
.ctile .glyph {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-sm);
  background: var(--azure-dim); color: var(--azure); display: grid; place-items: center;
}
.ctile .glyph svg { width: 18px; height: 18px; }
.ctile-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ctile-name {
  font-family: 'Space Grotesk', sans-serif; color: var(--heading); font-size: 0.91rem;
  font-weight: 500; overflow-wrap: anywhere;
}
.ctile-why { color: var(--muted); font-size: 0.76rem; }
.ctile .btn { flex: none; }
.ctile.own {
  grid-column: 1 / -1; border-style: dashed; border-color: rgba(217, 180, 91, 0.45);
  background: var(--gold-dim);
}
.ctile.own .glyph { background: transparent; border: 1px dashed rgba(217, 180, 91, 0.5); color: var(--gold); }
.ctile.own:hover { border-color: var(--gold); }
.btn.gold-btn { border-color: rgba(217, 180, 91, 0.55); color: var(--gold); }
.btn.gold-btn:hover { border-color: var(--gold); background: var(--gold-dim); }

.system-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sys-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  border: 1px solid rgba(77, 166, 255, 0.4); background: var(--azure-dim);
  border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 0.8rem; color: var(--body);
}
.sys-chip-text { overflow-wrap: anywhere; }
.sys-chip-x {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 0.95rem; line-height: 1;
  font-family: inherit;
}
.sys-chip-x:hover { color: var(--heading); background: rgba(255, 255, 255, 0.12); }

/* modal */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(6, 12, 17, 0.74);
  display: flex; align-items: center; justify-content: center; padding: 18px; overflow: auto;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; display: grid; gap: 13px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55); animation: rise .3s var(--ease) both;
}
.modal-card h2 { margin: 0; font-size: 1.12rem; }
.modal-card > p { margin: 0; }
.modal-actions { margin: 0; display: flex; gap: 10px; }
.sys-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sys-path {
  display: grid; gap: 2px; text-align: left; cursor: pointer; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2);
  padding: 10px 11px; color: var(--body); transition: border-color .2s var(--ease), background .2s var(--ease);
}
.sys-path .pt { font-family: 'Space Grotesk', sans-serif; color: var(--heading); font-size: 0.86rem; }
.sys-path .ps { color: var(--muted); font-size: 0.72rem; }
.sys-path.on { border-color: var(--azure); background: var(--azure-dim); }
.sys-panel { display: grid; gap: 10px; }
.roadmap-note {
  margin: 0; border: 1px solid rgba(217, 180, 91, 0.35); background: var(--gold-dim);
  border-radius: var(--r-sm); padding: 11px 12px; color: var(--body);
}
#sys-drop { cursor: pointer; }
#sys-drop.over { border-color: var(--azure); }

@media (max-width: 700px) {
  .conn-grid { grid-template-columns: 1fr; }
  .connect { padding: 15px 13px; }
  .modal { padding: 0; align-items: stretch; }
  .modal-card { width: 100%; border-radius: 0; min-height: 100%; align-content: start; }
  .sys-paths { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

/* ---------- v5.6: friendlier email pop-up + scans-left chip ---------- */
.eg {
  position: fixed; inset: 0; z-index: 62; background: rgba(10, 18, 24, 0.58);
  display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto;
}
.eg[hidden] { display: none; }
.eg-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--gold-dim);
  border-radius: 22px; padding: 24px 22px; display: grid; gap: 12px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42); animation: rise .3s var(--ease) both;
}
.eg-title { margin: 0; font-size: 1.06rem; color: var(--heading); letter-spacing: -0.01em; }
.eg-line { margin: 0; color: var(--body); font-size: 0.9rem; line-height: 1.55; }
.eg-line a { color: var(--gold); }
.eg-form { display: grid; gap: 9px; margin-top: 2px; }
.eg-form input, .eg-form select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  color: var(--heading); padding: 11px 13px; font: inherit; text-align: center;
}
.eg-form select { text-align-last: center; cursor: pointer; }
.eg-form input::placeholder { color: var(--muted); }
.eg-form input:focus, .eg-form select:focus { outline: none; border-color: rgba(217, 180, 91, 0.55); }
.eg-error { margin: 0; color: var(--silent); font-size: 0.83rem; }
.eg-form .btn.gold-btn {
  background: var(--gold-dim); border-color: rgba(217, 180, 91, 0.45); color: var(--gold);
  padding: 11px 14px; border-radius: 12px;
}
.eg-form .btn.gold-btn:hover { background: rgba(217, 180, 91, 0.2); border-color: var(--gold); }
.eg-limit { display: grid; gap: 10px; }
.eg-switch, .eg-close {
  justify-self: center; background: none; border: 0; padding: 2px 0; font: inherit;
  font-size: 0.8rem; color: var(--muted); cursor: pointer;
}
.eg-switch { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.eg-switch:hover, .eg-close:hover { color: var(--heading); }
.badge-scans {
  font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 9px; white-space: nowrap;
}
.badge-scans.spent { color: var(--silent); border-color: rgba(224, 138, 76, 0.45); }
@media (max-width: 460px) {
  .badge-mvp { display: none; }
  .eg-card { padding: 20px 17px; border-radius: 18px; }
}


/* ---------- v5.7: public scan counter, prepared-for block, print document ---------- */
.count-row { margin: -6px 0 18px; }
.badge-count {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-dim); border: 1px solid rgba(217, 180, 91, 0.35);
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.badge-count.first { color: var(--muted); background: none; border-color: var(--border); }
.gold-note { color: var(--gold); margin: 0; }

.prepared {
  margin: 12px 0 14px; padding: 12px 14px; display: grid; gap: 6px;
  border: 1px solid var(--border); border-left: 2px solid var(--gold);
  border-radius: var(--r-sm); background: var(--surface-2);
}
.prep-row { display: grid; grid-template-columns: 118px 1fr; gap: 10px; align-items: baseline; }
.prep-row dt {
  font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.prep-row dd { margin: 0; font-size: 0.86rem; color: var(--body); line-height: 1.45; }
@media (max-width: 560px) {
  .prep-row { grid-template-columns: 1fr; gap: 2px; }
}

/* The printable report lives in the DOM but is only ever shown to the printer. */
.print-only { display: none; }

@media print {
  @page { size: A4; margin: 16mm 15mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body > *:not(#print-report) { display: none !important; }
  .print-only, #print-report { display: block !important; }
  #print-report {
    font-family: Inter, system-ui, sans-serif; color: #000; font-size: 10.5pt; line-height: 1.45;
  }
  #print-report * { background: none !important; box-shadow: none !important; color: #000 !important; }
  .p-head { border-bottom: 1pt solid #000; padding-bottom: 6pt; margin-bottom: 12pt; }
  .p-brand {
    margin: 0; font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase; font-size: 9pt;
  }
  .p-title { margin: 2pt 0 0; font-size: 19pt; font-family: 'Space Grotesk', Inter, sans-serif; }
  .p-date { margin: 2pt 0 0; font-size: 9pt; }
  .p-prepared { margin: 0 0 12pt; display: block; }
  .p-prepared > div { display: flex; gap: 8pt; margin-bottom: 2pt; page-break-inside: avoid; }
  .p-prepared dt {
    width: 30mm; flex: none; font-size: 8.5pt; letter-spacing: 0.05em; text-transform: uppercase;
  }
  .p-prepared dd { margin: 0; font-size: 9.5pt; }
  .p-headline { margin: 0 0 4pt; font-size: 12pt; font-weight: 600; }
  .p-counts { margin: 0 0 14pt; font-size: 9.5pt; border-bottom: 0.5pt solid #666; padding-bottom: 8pt; }
  .p-finding { page-break-inside: avoid; margin-bottom: 13pt; }
  .p-finding h2 { margin: 0 0 2pt; font-size: 11.5pt; font-family: 'Space Grotesk', Inter, sans-serif; }
  .p-status { font-size: 9pt; font-weight: 500; }
  .p-topic { margin: 0 0 4pt; font-size: 8.5pt; letter-spacing: 0.04em; text-transform: uppercase; }
  .p-why { margin: 0 0 5pt; }
  .p-ev {
    margin: 0 0 3pt 0; padding-left: 7pt; border-left: 1.5pt solid #999; font-size: 9.5pt;
  }
  .p-opt-head {
    margin: 7pt 0 3pt; font-size: 8.5pt; letter-spacing: 0.05em; text-transform: uppercase;
    border-top: 0.5pt solid #999; padding-top: 5pt;
  }
  .p-opt { margin: 0 0 3pt; font-size: 9.5pt; }
  .p-label { font-weight: 600; }
  .p-prods { margin: 2pt 0 3pt 14pt; padding: 0; font-size: 9.5pt; }
  .p-prods li { margin-bottom: 1.5pt; }
  .p-note { margin: 0 0 3pt; font-size: 8.5pt; }
  .p-disclaimer {
    margin-top: 16pt; padding-top: 7pt; border-top: 1pt solid #000; font-size: 9.5pt;
    page-break-inside: avoid;
  }
}

/* Prototype strip */
.proto-strip {
  background: var(--gold-dim);
  border-bottom: 1px solid var(--border);
  color: var(--body);
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 7px 16px;
}
.proto-strip .proto-label { color: var(--gold); font-weight: 600; }
@media (max-width: 480px) {
  .proto-strip { font-size: 0.78rem; padding: 6px 12px; }
}
