/* ─────────────────────────────────────────────────────────────
   VvE Financieringsdossier — app styles
   Built on The Gorilla Effect tokens (assets/tge-tokens.css).
   Light, document-feel app · dark (ink) rail as the brand accent.
   ───────────────────────────────────────────────────────────── */

:root {
  --canvas: #F4F5F6;
  --rail-bg: var(--tge-ink);
  --rail-fg: rgba(255,255,255,0.62);
  --rail-fg-active: #FFFFFF;
  --topbar-h: 60px;
  --rail-w: 252px;

  /* status palette (maps to PRD review/route states) */
  --st-ok-bg:#E5F9F2;   --st-ok-fg:#00845F;
  --st-warn-bg:#FFF1D6; --st-warn-fg:#8A5A00;
  --st-err-bg:#FBE3E2;  --st-err-fg:#C8312B;
  --st-info-bg:#E7EEF6; --st-info-fg:#274B72;
  --st-neutral-bg:#ECEDEF; --st-neutral-fg:#3A3F48;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--canvas); }
body { color: var(--fg1); font-family: var(--font-body); font-size: 14px; }
#root { height: 100%; }

::selection { background: var(--tge-emerald); color: var(--tge-ink); }

button { font-family: inherit; }
.mono { font-family: var(--font-mono); }

/* ── App frame ─────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; height: 100vh; overflow: hidden; }
.app.dense { font-size: 13px; }

/* ── Left rail ─────────────────────────────────────────────── */
.rail { background: var(--rail-bg); color: var(--rail-fg); display: flex; flex-direction: column;
        border-right: 1px solid rgba(0,0,0,0.2); }
.rail-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.rail-brand img { width: 30px; height: 30px; }
.rail-brand .wm { display: flex; flex-direction: column; line-height: 1; }
.rail-brand .wm b { font-family: var(--font-display); font-weight: 700; font-size: 15px;
        letter-spacing: -0.01em; color: #fff; text-transform: uppercase; }
.rail-brand .wm span { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
        color: var(--tge-emerald); font-weight: 600; margin-top: 3px; }

.rail-section { padding: 14px 12px 6px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
        color: rgba(255,255,255,0.34); font-weight: 700; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.rail-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--rail-fg);
        background: none; border: 0; text-align: left; cursor: pointer; font-size: 13.5px; font-weight: 500;
        border-radius: 3px; position: relative; transition: color var(--dur-fast) var(--ease-out),
        background var(--dur-fast) var(--ease-out); width: 100%; }
.rail-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.rail-item.active { color: var(--rail-fg-active); background: rgba(255,255,255,0.08); font-weight: 600; }
.rail-item.active::before { content:""; position:absolute; left:0; top:7px; bottom:7px; width:3px;
        background: var(--tge-emerald); border-radius: 0 2px 2px 0; }
.rail-item .ico { flex: 0 0 auto; opacity: 0.9; }
.rail-item .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px;
        background: rgba(255,255,255,0.1); color: #fff; padding: 1px 7px; border-radius: 999px; }
.rail-item .count.alert { background: var(--tge-emerald); color: var(--tge-ink); font-weight: 700; }

.rail-spacer { flex: 1; }
.rail-user { display: flex; align-items: center; gap: 11px; padding: 14px 16px; margin: 8px 10px 12px;
        border-top: 1px solid rgba(255,255,255,0.08); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--tge-emerald); color: var(--tge-ink);
        display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; font-family: var(--font-display); }
.avatar.photo { background: var(--tge-slate-100); overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-user .who { line-height: 1.25; }
.rail-user .who b { color: #fff; font-size: 13px; font-weight: 600; display: block; }
.rail-user .who span { font-size: 11.5px; color: rgba(255,255,255,0.45); }

/* ── Main column ───────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: var(--topbar-h); flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--border);
        display: flex; align-items: center; gap: 16px; padding: 0 28px; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); min-width: 0; }
.crumb .sep { color: var(--fg3); }
.crumb a, .crumb button.link { color: var(--fg2); background: none; border: 0; cursor: pointer; padding: 0;
        font-size: 13px; font-family: inherit; }
.crumb a:hover, .crumb button.link:hover { color: var(--tge-emerald); }
.crumb .here { color: var(--fg1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }

.search { display: flex; align-items: center; gap: 8px; background: var(--canvas); border: 1px solid var(--border);
        padding: 7px 12px; border-radius: 4px; color: var(--fg2); min-width: 240px; }
.search input { border: 0; background: none; outline: none; font-family: inherit; font-size: 13px; color: var(--fg1);
        width: 100%; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; background: #fff;
        border: 1px solid var(--border); border-radius: 4px; color: var(--fg2); cursor: pointer; }
.icon-btn:hover { color: var(--fg1); border-color: var(--border-strong); }

.scroll { flex: 1; overflow-y: auto; }
.page { max-width: 1240px; margin: 0 auto; padding: 30px 28px 80px; }
.page.wide { max-width: 1400px; }

/* ── Page header ───────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
        text-transform: uppercase; color: var(--fg2); }
.page-title { font-family: var(--font-display); font-weight: 600; font-size: 27px; letter-spacing: -0.01em;
        color: var(--fg1); margin: 6px 0 0; text-transform: none; line-height: 1.1; }
.page-sub { color: var(--fg2); font-size: 13.5px; margin: 7px 0 0; max-width: 64ch; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-weight: 600; font-size: 13px;
        letter-spacing: 0.01em; border: 1.5px solid transparent; cursor: pointer; border-radius: 3px;
        transition: all var(--dur-fast) var(--ease-out); white-space: nowrap; }
.btn.primary { background: var(--tge-emerald); color: var(--tge-ink); }
.btn.primary:hover { background: var(--tge-emerald-700); }
.btn.outline { background: #fff; border-color: var(--border-strong); color: var(--fg1); }
.btn.outline:hover { border-color: var(--tge-ink); background: var(--tge-ink); color: #fff; }
.btn.ghost { background: none; color: var(--fg1); border-color: transparent; }
.btn.ghost:hover { color: var(--tge-emerald); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.danger { background: #fff; border-color: var(--st-err-fg); color: var(--st-err-fg); }
.btn.danger:hover { background: var(--st-err-fg); color: #fff; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-family: var(--font-body); font-weight: 700; font-size: 14px; margin: 0; text-transform: none;
        letter-spacing: 0; color: var(--fg1); display:flex; align-items:center; gap:9px; }
.card-head .meta { font-size: 12px; color: var(--fg2); }
.card-body { padding: 18px; }

/* ── Document preview modal ───────────────────────────────── */
.doc-preview { margin-top: 16px; border: 1px solid var(--border); border-radius: 4px; background: #fff; overflow: hidden; }
.preview-frame { width: 100%; height: min(62vh, 680px); border: 0; display: block; background: var(--canvas); }
.preview-label { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg2);
        padding: 11px 12px; border-bottom: 1px solid var(--border); background: #FAFBFB; }
.sheet-wrap { max-height: 420px; overflow: auto; }
.sheet-preview { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--font-mono); font-size: 11.5px; }
.sheet-preview td { border: 1px solid var(--border); padding: 7px 8px; min-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-preview tr:first-child td { background: var(--tge-slate-100); font-weight: 700; color: var(--fg1); }
.text-preview { margin: 0; max-height: 430px; overflow: auto; padding: 14px; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; color: var(--fg1); }
.field-preview { margin-top: 14px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }

/* ── KPI tiles ─────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 16px 18px; cursor: pointer;
        transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.kpi:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.kpi .lbl { font-size: 12px; color: var(--fg2); display: flex; align-items: center; gap: 7px; }
.kpi .num { font-family: var(--font-display); font-weight: 900; font-size: 38px; line-height: 1; letter-spacing: -0.02em;
        margin-top: 12px; color: var(--fg1); }
.kpi .foot { font-size: 11.5px; color: var(--fg2); margin-top: 8px; display:flex; align-items:center; gap:6px; }
.kpi.accent { background: var(--tge-ink); border-color: var(--tge-ink); }
.kpi.accent .lbl, .kpi.accent .foot { color: rgba(255,255,255,0.6); }
.kpi.accent .num { color: #fff; }
.kpi .num em { color: var(--tge-emerald); font-style: normal; }

/* ── Badges ────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-weight: 700; font-size: 11px;
        letter-spacing: 0.04em; text-transform: uppercase; border-radius: 3px; white-space: nowrap; line-height: 1.4; }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.badge.ok { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.badge.warn { background: var(--st-warn-bg); color: var(--st-warn-fg); }
.badge.err { background: var(--st-err-bg); color: var(--st-err-fg); }
.badge.info { background: var(--st-info-bg); color: var(--st-info-fg); }
.badge.neutral { background: var(--st-neutral-bg); color: var(--st-neutral-fg); }
.badge.ink { background: var(--tge-ink); color: #fff; }
.badge.outline { background: none; border: 1px solid var(--border-strong); color: var(--fg1); text-transform: none;
        letter-spacing: 0; font-weight: 600; }
.badge.sm { font-size: 10px; padding: 2px 7px; }

/* route chip (compact, in tables) */
.chip { display:inline-flex; align-items:center; gap:5px; padding:2px 8px; font-size:11.5px; font-weight:600;
        border:1px solid var(--border); border-radius:3px; color:var(--fg1); background:#fff; white-space:nowrap; }
.chip .sq { width:7px; height:7px; border-radius:2px; flex:0 0 auto; }
.chips-col { display:flex; flex-direction:column; gap:5px; align-items:flex-start; }
.tbl td .chip { padding:3px 9px; }

/* ── Table ─────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl thead th { background: #FAFBFB; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg2);
        font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border-strong); border-top: 1px solid var(--border); }
.tbl th:first-child { border-left: 0; } 
.tbl td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 13.5px; }
.tbl tr.row { cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.tbl tr.row:hover td { background: #FAFBFB; }
.tbl tr.row:last-child td { border-bottom: 0; }
.vve-name { font-weight: 600; color: var(--fg1); line-height: 1.25; }
.vve-meta { font-size: 12px; color: var(--fg2); margin-top: 4px; display:flex; gap:7px; align-items:center; white-space: nowrap; }
.vve-meta .mp { display:inline-flex; align-items:center; gap:4px; }

/* ── Filters bar ───────────────────────────────────────────── */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.seg button { padding: 7px 13px; font-size: 12.5px; font-weight: 600; background: #fff; border: 0; cursor: pointer;
        color: var(--fg2); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--tge-ink); color: #fff; }
.seg button:not(.on):hover { color: var(--fg1); background: var(--canvas); }
.select { display:inline-flex; align-items:center; gap:7px; padding:7px 12px; border:1px solid var(--border);
        border-radius:4px; background:#fff; font-size:12.5px; color:var(--fg1); font-weight:600; cursor:pointer; }
.select:hover { border-color: var(--border-strong); }

/* ── Stage progress (compact, in table) ────────────────────── */
.stage-mini { display: flex; align-items: center; gap: 3px; }
.stage-mini i { width: 16px; height: 4px; border-radius: 1px; background: var(--tge-slate-300); display:block; }
.stage-mini i.done { background: var(--tge-emerald); }
.stage-mini i.now { background: var(--tge-ink); }
.stage-label { font-size: 11.5px; color: var(--fg2); margin-top: 5px; }

/* ── Stage stepper (full, workspace) ───────────────────────── */
.stepper { display: flex; align-items: stretch; background:#fff; border:1px solid var(--border); border-radius:4px;
        overflow: hidden; }
.step { flex: 1; padding: 13px 14px; border-right: 1px solid var(--border); display:flex; flex-direction:column; gap:5px;
        cursor: pointer; transition: background var(--dur-fast) var(--ease-out); position: relative; min-width: 0; }
.step:last-child { border-right: 0; }
.step:hover { background: #FAFBFB; }
.step.active { background: #FAFBFB; }
.step.active::after { content:""; position:absolute; left:0; right:0; bottom:0; height:3px; background:var(--tge-emerald); }
.step .si { display:flex; align-items:center; gap:8px; }
.step .sdot { width: 18px; height:18px; border-radius:999px; flex:0 0 auto; display:grid; place-items:center;
        font-size:10px; font-weight:700; font-family:var(--font-mono); background:var(--tge-slate-100); color:var(--fg2); }
.step.done .sdot { background: var(--tge-emerald); color: var(--tge-ink); }
.step.current .sdot { background: var(--tge-ink); color:#fff; }

.step .sname { font-size:12.5px; font-weight:600; color:var(--fg1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.step.active .sname { font-weight:700; }
.step .sstat { font-size:11px; color:var(--fg2); }
.step.active .sstat { color:var(--tge-emerald); font-weight:600; }

/* Overzicht nav button (sits left of the stepper) */
.step-ov { display:flex; align-items:center; gap:8px; padding:0 16px; background:#fff; border:1px solid var(--border);
        border-radius:4px; cursor:pointer; font-size:12.5px; font-weight:600; color:var(--fg1); white-space:nowrap; }
.step-ov:hover { border-color: var(--border-strong); }
.step-ov.on { background:var(--tge-ink); color:#fff; border-color:var(--tge-ink); }

/* ── Demo pill (topbar) ────────────────────────────────────── */
.demo-pill { display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:999px;
        border:1px solid var(--border); background:#fff; font-size:12px; font-weight:600; color:var(--fg2);
        cursor:pointer; font-family:inherit; transition:all var(--dur-fast) var(--ease-out); }
.demo-pill:hover { border-color:var(--border-strong); color:var(--fg1); }
.dp-dot { width:7px; height:7px; border-radius:999px; background:var(--tge-emerald); flex:0 0 auto;
        box-shadow:0 0 0 3px rgba(1,195,141,0.18); }
.storage-pill { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:4px;
        border:1px solid var(--border); background:var(--canvas); font-size:11.5px; font-weight:700; color:var(--fg2);
        white-space:nowrap; }

.mobile-nav { display:none; background:var(--tge-ink); border-bottom:1px solid rgba(0,0,0,0.2);
        padding:8px 12px; gap:6px; overflow-x:auto; scrollbar-width:none; }
.mobile-nav::-webkit-scrollbar { display:none; }
.mobile-nav-item { min-height:34px; display:inline-flex; align-items:center; gap:7px; padding:7px 11px;
        border:1px solid rgba(255,255,255,0.08); border-radius:4px; background:rgba(255,255,255,0.04);
        color:rgba(255,255,255,0.68); white-space:nowrap; font-size:12px; font-weight:700; cursor:pointer; }
.mobile-nav-item.active { color:#fff; border-color:rgba(1,195,141,0.42); background:rgba(1,195,141,0.13); }
.mobile-nav-item .ico { flex:0 0 auto; }
.mobile-nav-item .count { font-family:var(--font-mono); font-size:10.5px; padding:1px 6px; border-radius:999px;
        background:rgba(255,255,255,0.1); color:#fff; }
.mobile-nav-item .count.alert { background:var(--tge-emerald); color:var(--tge-ink); }

/* ── Intro / welcome overlay ───────────────────────────────── */
.modal.intro { max-width:600px; overflow:hidden; }
.intro-hero { background:var(--tge-ink); color:#fff; padding:30px 30px 28px; position:relative;
        background-image: linear-gradient(160deg, var(--tge-ink) 55%, var(--tge-navy)); }
.intro-x { position:absolute; top:18px; right:18px; background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.16);
        color:rgba(255,255,255,0.75); }
.intro-x:hover { background:rgba(255,255,255,0.16); color:#fff; border-color:rgba(255,255,255,0.3); }
.intro-brand { display:flex; align-items:center; gap:12px; }
.intro-brand img { width:38px; height:38px; }
.ib-wm { display:flex; flex-direction:column; line-height:1; }
.ib-wm b { font-family:var(--font-display); font-weight:700; font-size:18px; letter-spacing:-0.01em; text-transform:uppercase; }
.ib-wm span { font-size:11px; letter-spacing:0.14em; text-transform:uppercase; color:var(--tge-emerald); font-weight:600; margin-top:4px; }
.intro-badge { display:inline-flex; align-items:center; gap:8px; margin:22px 0 16px; padding:5px 12px; border-radius:999px;
        background:rgba(1,195,141,0.14); border:1px solid rgba(1,195,141,0.3); color:var(--tge-emerald);
        font-size:11.5px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; white-space:nowrap; }
.intro-title { font-family:var(--font-display); font-weight:600; font-size:22px; line-height:1.22; letter-spacing:-0.01em; margin:0; color:#fff; text-wrap:balance; }
.intro-lead { font-size:13.5px; line-height:1.55; color:rgba(255,255,255,0.72); margin:16px 0 0; max-width:52ch; }
.intro-body { padding:22px 30px 6px; display:flex; flex-direction:column; gap:4px; }
.intro-pt { display:flex; gap:14px; padding:13px 0; border-bottom:1px solid var(--border); }
.intro-pt:last-child { border-bottom:0; }
.ip-ic { width:38px; height:38px; border-radius:5px; background:var(--st-ok-bg); color:var(--st-ok-fg);
        display:grid; place-items:center; flex:0 0 auto; }
.ip-t { font-size:14px; font-weight:700; }
.ip-d { font-size:12.5px; color:var(--fg2); margin-top:3px; line-height:1.5; }
.intro-foot { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 30px 22px; }

/* ── Dossierstatus (readiness ring + gate tracker) ─────────── */
.statusrow { display:flex; align-items:center; gap:26px; }
.sr-ring { display:flex; align-items:center; gap:16px; flex:0 0 auto; }
.sr-rl-t { font-family:var(--font-display); font-weight:600; font-size:16px; letter-spacing:-0.01em; }
.sr-rl-s { font-size:12.5px; color:var(--fg2); margin-top:3px; }
.sr-divider { width:1px; align-self:stretch; background:var(--border); }
.sr-gates { flex:1; min-width:0; }
.sr-gates-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:13px;
        font-size:11px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--fg2); }
.gpdot { width:7px; height:7px; border-radius:999px; background:var(--st-err-fg); display:inline-block; }
@media (prefers-reduced-motion: no-preference) { .gpdot { animation: attn 2.4s ease-in-out infinite; } }
.gatetrack { display:flex; align-items:flex-start; gap:0; }
.gate { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; cursor:pointer; position:relative;
        padding-top:2px; }
.gate::before { content:""; position:absolute; top:14px; left:-50%; width:100%; height:2px; background:var(--border); z-index:0; }
.gate:first-child::before { display:none; }
.gate.done::before, .gate.open.done::before { background:var(--tge-emerald); }
.gate .gdisc { width:30px; height:30px; border-radius:999px; display:grid; place-items:center; flex:0 0 auto;
        position:relative; z-index:1; border:2px solid #fff; }
.gdisc.ok { background:var(--st-ok-bg); color:var(--st-ok-fg); }
.gdisc.warn { background:var(--st-warn-bg); color:var(--st-warn-fg); }
.gdisc.err { background:var(--st-err-bg); color:var(--st-err-fg); }
.gdisc.neutral { background:var(--tge-slate-100); color:var(--fg3); }
.gate .glabel { font-size:11px; font-weight:600; color:var(--fg2); text-align:center; line-height:1.2; }
.gate.done .glabel { color:var(--fg1); }
.gate:hover .glabel { color:var(--tge-emerald); }

/* ── Modal / overlay ───────────────────────────────────────── */
.scrim { position:fixed; inset:0; background:rgba(25,30,41,0.55); display:flex; align-items:flex-start;
        justify-content:center; padding:48px 24px; z-index:100; overflow-y:auto;
        animation: scrimIn var(--dur-base) var(--ease-out); }
@keyframes scrimIn { from { opacity:0; } to { opacity:1; } }
.modal { background:#fff; border:1px solid var(--border); border-radius:5px; width:100%; max-width:640px;
        box-shadow:var(--shadow-3); margin:auto; animation: modalIn var(--dur-base) var(--ease-out); }
.modal.wide { max-width:760px; }
@keyframes modalIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.mhead { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 22px 16px;
        border-bottom:1px solid var(--border); }
.mhead .mh-eyebrow { font-size:11px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--fg2); }
.mhead h2 { font-family:var(--font-display); font-weight:600; font-size:20px; margin:6px 0 0; letter-spacing:-0.01em; }
.mclose { width:34px; height:34px; border-radius:4px; border:1px solid var(--border); background:#fff; cursor:pointer;
        display:grid; place-items:center; color:var(--fg2); flex:0 0 auto; }
.mclose:hover { border-color:var(--border-strong); color:var(--fg1); }
.mbody { padding:22px; }
.mfoot { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 22px;
        border-top:1px solid var(--border); background:#FAFBFB; border-radius:0 0 5px 5px; }

/* modal step dots */
.mdots { display:flex; align-items:center; gap:7px; }
.mdots i { width:7px; height:7px; border-radius:999px; background:var(--tge-slate-300); transition:all var(--dur-base) var(--ease-out); }
.mdots i.on { background:var(--tge-ink); width:22px; border-radius:4px; }
.mdots i.done { background:var(--tge-emerald); }

/* address lookup */
.lookup { display:flex; gap:9px; }
.lookup .ti { flex:1; }
.match-card { border:1px solid var(--tge-emerald); background:var(--st-ok-bg); border-radius:4px; padding:15px 17px; margin-top:14px;
        animation: modalIn var(--dur-base) var(--ease-out); }
.match-card .mc-top { display:flex; align-items:center; gap:9px; font-weight:700; font-size:13px; color:var(--st-ok-fg); margin-bottom:12px; }
.match-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px 18px; }
.match-grid .mg-k { font-size:11.5px; color:var(--fg2); }
.match-grid .mg-v { font-size:13.5px; font-weight:600; color:var(--fg1); margin-top:1px; }

/* "what happens" init list */
.initlist { display:flex; flex-direction:column; gap:2px; }
.initrow { display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); }
.initrow:last-child { border-bottom:0; }
.initrow .ir-ic { width:32px; height:32px; border-radius:4px; background:var(--st-ok-bg); color:var(--st-ok-fg);
        display:grid; place-items:center; flex:0 0 auto; }
.initrow .ir-t { font-size:13.5px; font-weight:600; }
.initrow .ir-s { font-size:12px; color:var(--fg2); margin-top:1px; }

/* dropzone */
.dropzone { border:1.5px dashed var(--border-strong); border-radius:5px; padding:34px 20px; text-align:center;
        background:#FAFBFB; transition:all var(--dur-fast) var(--ease-out); }
.dropzone.hot { border-color:var(--tge-emerald); background:var(--st-ok-bg); }
.dropzone .dz-ic { width:52px; height:52px; border-radius:6px; background:#fff; border:1px solid var(--border);
        display:grid; place-items:center; margin:0 auto 14px; color:var(--fg2); }
.dropzone h4 { font-size:15px; font-weight:700; margin:0 0 5px; }
.dropzone p { font-size:13px; color:var(--fg2); margin:0; }
.hidden-file { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }

/* processing file rows */
.pfile { display:flex; align-items:center; gap:13px; padding:13px 15px; border:1px solid var(--border); border-radius:4px; margin-bottom:9px; }
.pfile .pf-ic { width:36px; height:36px; border-radius:4px; display:grid; place-items:center; flex:0 0 auto; }
.pfile .pf-main { flex:1; min-width:0; }
.pfile .pf-name { font-size:13.5px; font-weight:600; display:flex; align-items:baseline; gap:8px; min-width:0; }
.pfile .pf-name .fn { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:var(--font-mono); font-size:12px; max-width:60%; }
.pfile .pf-meta { font-size:12px; color:var(--fg2); margin-top:4px; display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.pfile .pf-arrow { color:var(--fg3); flex:0 0 auto; }
.pfile .pf-type { font-size:12.5px; font-weight:600; color:var(--fg1); }

/* extraction mini-rows */
.exrow { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid var(--border); }
.exrow:last-child { border-bottom:0; }
.exrow .ex-k { font-size:12.5px; color:var(--fg2); }
.exrow .ex-v { font-size:13px; font-weight:600; font-family:var(--font-mono); display:flex; align-items:center; gap:9px; }

/* spinner */
.spin { width:16px; height:16px; border:2px solid var(--tge-slate-300); border-top-color:var(--tge-emerald);
        border-radius:999px; animation: spin 0.7s linear infinite; flex:0 0 auto; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Intake wizard ─────────────────────────────────────────── */
.wiz { display:grid; grid-template-columns: 252px 1fr; gap:22px; align-items:start; }
.wnav { background:#fff; border:1px solid var(--border); border-radius:4px; padding:8px; position:sticky; top:0; }
.wnav .wtitle { font-size:11px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--fg2);
        padding:10px 12px 8px; }
.wstep { display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius:3px; cursor:pointer; width:100%;
        border:0; background:none; text-align:left; font-family:inherit; transition:background var(--dur-fast) var(--ease-out); }
.wstep:hover { background:var(--canvas); }
.wstep.on { background:var(--tge-ink); }
.wstep .wn { width:24px; height:24px; border-radius:999px; flex:0 0 auto; display:grid; place-items:center;
        font-family:var(--font-mono); font-size:11px; font-weight:700; background:var(--tge-slate-100); color:var(--fg2);
        border:1px solid var(--border); }
.wstep.done .wn { background:var(--tge-emerald); color:var(--tge-ink); border-color:var(--tge-emerald); }
.wstep.on .wn { background:#fff; color:var(--tge-ink); border-color:#fff; }
.wstep .wl { font-size:13px; font-weight:600; color:var(--fg1); }
.wstep .wl small { display:block; font-size:11px; font-weight:500; color:var(--fg2); margin-top:1px; }
.wstep.on .wl, .wstep.on .wl small { color:#fff; }
.wstep.on .wl small { color:rgba(255,255,255,0.6); }

.wbar { height:4px; background:var(--tge-slate-100); border-radius:2px; overflow:hidden; margin:0 12px 6px; }
.wbar i { display:block; height:100%; background:var(--tge-emerald); transition:width var(--dur-base) var(--ease-out); }

/* ── Form rows ─────────────────────────────────────────────── */
.form { display:flex; flex-direction:column; }
.frow { display:grid; grid-template-columns: 230px 1fr; gap:20px; padding:17px 0; border-bottom:1px solid var(--border); align-items:start; }
.frow:first-child { padding-top:2px; }
.frow:last-child { border-bottom:0; padding-bottom:2px; }
.flabel { font-size:13.5px; font-weight:600; color:var(--fg1); }
.flabel .rq { color:var(--st-err-fg); margin-left:2px; }
.fhint { font-size:12px; color:var(--fg2); margin-top:4px; line-height:1.45; }
.fctl { min-width:0; }

.ti { width:100%; padding:9px 12px; border:1px solid var(--border-strong); border-radius:3px; font-family:inherit;
        font-size:14px; color:var(--fg1); background:#fff; outline:none; transition:border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out); }
.ti:focus { border-color:var(--tge-emerald); box-shadow:0 0 0 3px rgba(1,195,141,0.14); }
.ti.short { max-width:220px; }
.ti.mono { font-family:var(--font-mono); }
.ti-eur { position:relative; max-width:240px; }
.ti-eur span { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--fg2); font-size:14px; }
.ti-eur .ti { padding-left:28px; font-family:var(--font-mono); }

.fselect { display:inline-flex; align-items:center; gap:8px; padding:9px 12px; border:1px solid var(--border-strong);
        border-radius:3px; background:#fff; min-width:220px; }
.fselect select { border:0; background:none; font:inherit; font-size:14px; color:var(--fg1); width:100%; outline:none; cursor:pointer; }

/* source tag */
.srctag { display:inline-flex; align-items:center; gap:6px; margin-top:8px; font-size:11px; font-weight:600;
        color:var(--fg2); background:var(--canvas); border:1px solid var(--border); padding:3px 8px; border-radius:3px; }
.srctag .mono { font-size:10.5px; }
.srctag.pdok { color:var(--st-info-fg); background:var(--st-info-bg); border-color:transparent; }
.srctag.verified { color:var(--st-ok-fg); background:var(--st-ok-bg); border-color:transparent; }

/* multi-select chips */
.mchips { display:flex; flex-wrap:wrap; gap:8px; }
.mchip { display:inline-flex; align-items:center; gap:7px; padding:8px 13px; border:1px solid var(--border-strong);
        border-radius:3px; background:#fff; font-size:13px; font-weight:600; color:var(--fg1); cursor:pointer;
        transition:all var(--dur-fast) var(--ease-out); }
.mchip:hover { border-color:var(--tge-ink); }
.mchip.on { background:var(--st-ok-bg); border-color:var(--tge-emerald); color:var(--st-ok-fg); }
.mchip .mc-box { width:15px; height:15px; border-radius:3px; border:1.5px solid var(--border-strong); display:grid; place-items:center; flex:0 0 auto; }
.mchip.on .mc-box { background:var(--tge-emerald); border-color:var(--tge-emerald); color:var(--tge-ink); }

/* toggle / radio group */
.rgroup { display:flex; flex-direction:column; gap:8px; }
.ropt { display:flex; align-items:flex-start; gap:11px; padding:11px 13px; border:1px solid var(--border-strong); border-radius:3px;
        cursor:pointer; transition:all var(--dur-fast) var(--ease-out); }
.ropt:hover { border-color:var(--tge-ink); }
.ropt.on { border-color:var(--tge-emerald); background:var(--st-ok-bg); }
.ropt .rdot { width:17px; height:17px; border-radius:999px; border:1.5px solid var(--border-strong); flex:0 0 auto; margin-top:1px;
        display:grid; place-items:center; }
.ropt.on .rdot { border-color:var(--tge-emerald); }
.ropt.on .rdot::after { content:""; width:9px; height:9px; border-radius:999px; background:var(--tge-emerald); }
.ropt .rt { font-size:13.5px; font-weight:600; color:var(--fg1); }
.ropt .rd { font-size:12px; color:var(--fg2); margin-top:2px; }

/* wizard footer */
.wfoot { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:20px; }
.wstepno { font-size:12px; color:var(--fg2); font-weight:600; }

/* summary review list */
.sumrow { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--border); }
.sumrow:last-child { border-bottom:0; }
.sumrow .sk { font-size:13px; color:var(--fg2); }
.sumrow .sv { font-size:13.5px; font-weight:600; color:var(--fg1); display:flex; align-items:center; gap:9px; }

.check-line { display:flex; align-items:center; gap:11px; padding:10px 0; }
.check-line .cb { width:20px; height:20px; border-radius:3px; border:1.5px solid var(--border-strong); display:grid; place-items:center; cursor:pointer; flex:0 0 auto; }
.check-line .cb.on { background:var(--tge-emerald); border-color:var(--tge-emerald); color:var(--tge-ink); }

/* ── Layout grids ──────────────────────────────────────────── */
.grid-2 { display:grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.stack { display:flex; flex-direction:column; gap:18px; }

/* ── Key facts (evidence-on-hover) ─────────────────────────── */
.facts { display:grid; grid-template-columns: 1fr 1fr; gap:0; }
.fact { padding:13px 16px; border-bottom:1px solid var(--border); border-right:1px solid var(--border); position:relative; }
.fact:nth-child(2n){ border-right:0; }
.fact .fk { font-size:11.5px; color:var(--fg2); display:flex; align-items:center; gap:6px; }
.fact .fv { font-size:14px; font-weight:600; color:var(--fg1); margin-top:4px; }
.fact .ev { display:flex; align-items:center; gap:7px; margin-top:7px; opacity:0; max-height:0; overflow:hidden;
        transition: opacity var(--dur-base) var(--ease-out), max-height var(--dur-base) var(--ease-out); }
.fact:hover .ev { opacity:1; max-height:40px; }
.ev .src { font-size:10.5px; font-family:var(--font-mono); color:var(--fg2); }
.conf { display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700; font-family:var(--font-mono); }
.conf .bar { width:34px; height:4px; background:var(--tge-slate-100); border-radius:2px; overflow:hidden; }
.conf .bar i { display:block; height:100%; background:var(--tge-emerald); }
.conf.low .bar i { background: var(--st-warn-fg); }

/* ── List rows (routes, docs, review, audit) ──────────────── */
.lrow { display:flex; align-items:flex-start; gap:14px; padding:15px 18px; border-bottom:1px solid var(--border); }
.lrow:last-child { border-bottom:0; }
.lrow.click { cursor:pointer; }
.lrow.click:hover { background:#FAFBFB; }
.lrow .lr-main { flex:1; min-width:0; }
.lrow .lr-title { font-weight:600; font-size:14px; color:var(--fg1); display:flex; align-items:center; gap:9px; }
.lrow .lr-sub { font-size:12.5px; color:var(--fg2); margin-top:4px; }
.lrow .lr-side { flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:7px; }

/* status icon disc */
.sdisc { width:30px; height:30px; border-radius:4px; display:grid; place-items:center; flex:0 0 auto; }
.sdisc.ok { background:var(--st-ok-bg); color:var(--st-ok-fg); }
.sdisc.warn { background:var(--st-warn-bg); color:var(--st-warn-fg); }
.sdisc.err { background:var(--st-err-bg); color:var(--st-err-fg); }
.sdisc.info { background:var(--st-info-bg); color:var(--st-info-fg); }
.sdisc.neutral { background:var(--st-neutral-bg); color:var(--st-neutral-fg); }

/* meta line with source/date/freshness */
.metaline { display:flex; flex-wrap:wrap; gap:14px; margin-top:9px; font-size:11.5px; color:var(--fg2); }
.metaline span { display:inline-flex; align-items:center; gap:5px; }
.metaline .mono { font-family:var(--font-mono); font-size:11px; }
.fresh { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; }
.fresh .fd { width:7px; height:7px; border-radius:999px; }
.fresh.ok .fd { background:var(--tge-emerald); } .fresh.ok { color:var(--st-ok-fg); }
.fresh.stale .fd { background:var(--st-warn-fg); } .fresh.stale { color:var(--st-warn-fg); }

/* ── Banner / callout ──────────────────────────────────────── */
.banner { display:flex; gap:13px; padding:14px 16px; border-radius:4px; border:1px solid; align-items:flex-start; }
.banner.warn { background:var(--st-warn-bg); border-color: rgba(138,90,0,0.25); color:#6b4700; }
.banner.err { background:var(--st-err-bg); border-color: rgba(200,49,43,0.25); color:#8f231e; }
.banner.info { background:var(--st-info-bg); border-color: rgba(39,75,114,0.2); color:#274B72; }
.banner.ink { background:var(--tge-ink); border-color:var(--tge-ink); color:#fff; }
.banner .bt { font-weight:700; font-size:13px; }
.banner .bd { font-size:12.5px; margin-top:3px; opacity:0.92; }

/* ── Waterfall (scenario) ──────────────────────────────────── */
.wf { display:flex; flex-direction:column; gap:1px; }
.wf-row { display:grid; grid-template-columns: 200px 1fr 130px; align-items:center; gap:14px; padding:11px 4px; }
.wf-row .wl { font-size:13px; color:var(--fg1); font-weight:500; }
.wf-bar { height:26px; background:var(--tge-slate-100); border-radius:2px; position:relative; overflow:hidden; }
.wf-bar i { position:absolute; top:0; bottom:0; display:block; }
.wf-amt { text-align:right; font-family:var(--font-mono); font-size:13px; font-weight:600; }
.wf-row.total { border-top:2px solid var(--tge-ink); margin-top:5px; padding-top:14px; }
.wf-row.total .wl, .wf-row.total .wf-amt { font-weight:800; }

/* ── Misc ──────────────────────────────────────────────────── */
.divider { height:1px; background:var(--border); margin: 0; border:0; }
.kv { display:flex; justify-content:space-between; gap:14px; padding:9px 0; border-bottom:1px solid var(--border); font-size:13px; }
.kv:last-child { border-bottom:0; }
.kv .k { color:var(--fg2); } .kv .v { font-weight:600; color:var(--fg1); font-family:var(--font-mono); }
.empty { text-align:center; padding:50px 20px; color:var(--fg2); }
.empty .ico { color: var(--tge-slate-300); margin-bottom:12px; }
.muted { color:var(--fg2); }
.tiny { font-size:11.5px; }
.row { display:flex; align-items:center; gap:10px; }
.gap6{gap:6px;} .gap8{gap:8px;} .gap12{gap:12px;}
.between { justify-content:space-between; }
.wrap { flex-wrap:wrap; }
.pull { margin-left:auto; }

/* approval / audit timeline */
.audit { position:relative; padding-left:6px; }
.audit .ai { display:flex; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); }
.audit .ai:last-child { border-bottom:0; }
.audit .adot { width:9px; height:9px; border-radius:999px; background:var(--tge-slate-300); margin-top:5px; flex:0 0 auto; }
.audit .adot.em { background:var(--tge-emerald); }
.audit .atxt { font-size:12.5px; color:var(--fg1); }
.audit .atime { font-size:11px; color:var(--fg2); font-family:var(--font-mono); margin-top:2px; }

/* checklist doc rows */
.doc { display:flex; align-items:center; gap:13px; padding:12px 16px; border-bottom:1px solid var(--border); }
.doc:last-child{ border-bottom:0; }
.doc .dn { flex:1; min-width:0; }
.doc .dn b { font-weight:600; font-size:13.5px; }
.doc .dn .df { font-size:11.5px; color:var(--fg2); margin-top:3px; font-family:var(--font-mono); }
.req { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--fg2); }

/* source registry and generated package rows */
.source-url { display:inline-flex; margin-top:8px; max-width:100%; color:var(--st-info-fg); font-family:var(--font-mono);
        font-size:11px; text-decoration:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.source-url:hover { text-decoration:underline; }
.doc-output-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.doc-output { display:flex; align-items:center; gap:8px; min-width:0; padding:8px 10px; border:1px solid var(--border);
        background:#FAFBFB; border-radius:3px; font-size:12.5px; font-weight:600; color:var(--fg1); }
.doc-output .ico { flex:0 0 auto; color:var(--fg2); }
.package-row { display:grid; grid-template-columns:16px 1fr; align-items:start; gap:8px; padding:7px 0; font-size:13px; }
.package-row span { min-width:0; }

/* group header inside cards */
.ghead { padding:11px 16px; background:#FAFBFB; border-bottom:1px solid var(--border); display:flex;
        align-items:center; gap:10px; font-size:11.5px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase;
        color:var(--fg2); }
.ghead .sq { width:8px; height:8px; border-radius:2px; }

/* responsive: collapse rail on narrow */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .rail { display:none; }
  .mobile-nav { display:flex; flex:0 0 auto; }
  .kpis { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-2.even { grid-template-columns: 1fr; }
  .doc-output-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { padding:0 14px; gap:8px; }
  .crumb { max-width:28vw; }
  .demo-pill, .storage-pill { padding:6px 8px; font-size:11px; }
  .search { min-width:0; flex:1 1 180px; }
}
