/* ────────────────────────────────────────────────────────────────────────────
   Cyber Sofia · Procurement Intelligence — design system
   Dirección creativa: «European intelligence desk» — lujo discreto, nitidez de
   datos. Tema CLARO por defecto; variante oscura vía [data-theme="dark"].
   Tokens conforme a HERMES_TIE_DIRECCION_DISENO_UXUI_PRODUCTO.md (D1).
   ──────────────────────────────────────────────────────────────────────────── */
:root {
  --canvas: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #EEF2F9;
  --ink: #15233B;
  --muted: #63738C;
  --faint: #93A2B8;
  --brand: #3059DB;
  --brand-hover: #2447B5;
  --accent: #17A59A;
  --accent2: #38BDF8;
  --line: #E5EBF4;
  --line-strong: #D4DCE8;
  --warning: #B66B14;
  --danger: #BD3C52;
  --ok: #17A59A;
  --radius-card: 14px;
  --radius-control: 9px;
  --shadow-card: 0 5px 24px rgba(24,43,78,.055);
  --shadow-pop: 0 12px 40px rgba(24,43,78,.12);
  --font: "Inter", "Geist", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  --sidebar-w: 250px;
  /* alias compat (mantener inline styles existentes) */
  --bg: var(--canvas);
  --bg2: var(--surface-2);
  --card: var(--surface);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text: var(--ink);
}
[data-theme="dark"] {
  --canvas: #0B0F16;
  --surface: #121922;
  --surface-2: #0E151E;
  --ink: #E7EEF5;
  --muted: #8AA0B4;
  --faint: #5F7184;
  --brand: #4B74E8;
  --brand-hover: #5C82F0;
  --accent: #2DD4BF;
  --accent2: #38BDF8;
  --line: #1E2A38;
  --line-strong: #2A3A4C;
  --warning: #F0A84B;
  --danger: #F07185;
  --ok: #2DD4BF;
  --shadow-card: 0 5px 24px rgba(0,0,0,.32);
  --shadow-pop: 0 12px 40px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--canvas); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.small { font-size: .82rem; }
hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.ic { vertical-align: -0.18em; flex: 0 0 auto; }

/* ── Icon-only / action buttons ── */
.iconbtn { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); border-radius: var(--radius-control); padding: 6px 9px; cursor: pointer; font-size: .9rem; line-height: 1; display: inline-flex; align-items: center; gap: 5px; transition: border-color .14s ease, color .14s ease; }
.iconbtn:hover { border-color: var(--brand); color: var(--ink); }
.iconbtn.on { border-color: var(--accent); color: var(--accent); }
.iconbtn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ── Buttons ── */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; height: 42px; font-size: .9rem; font-weight: 600; line-height: 1;
  background: var(--brand); color: #fff; border: 1px solid transparent;
  border-radius: var(--radius-control); cursor: pointer; font-family: var(--font);
  transition: background .14s ease, border-color .14s ease, transform .05s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--brand-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 7px 12px; height: 34px; font-size: .82rem; }
a.btn { text-decoration: none; }
a.btn:hover { color: #fff; }
a.btn.ghost:hover { color: var(--brand); }

/* ── App shell ── */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 18px 12px 12px; overflow-y: auto;
}
.brand { display: flex; align-items: baseline; gap: 7px; padding: 2px 12px 18px; color: var(--ink); font-weight: 780; font-size: 1.06rem; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand .mark { color: var(--brand); }
.brand .sub { color: var(--faint); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; margin-left: 1px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-control);
  color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-item .ic { color: var(--faint); }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: #EEF3FF; color: var(--brand); font-weight: 600; }
[data-theme="dark"] .nav-item.active { background: rgba(75,116,232,.14); }
.nav-item.active .ic { color: var(--brand); }
.nav-sep { border-top: 1px solid var(--line); margin: 12px 10px; }
.nav-caption { color: var(--faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; padding: 2px 11px 6px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar-foot .who { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--muted); font-size: .8rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .76rem; flex: 0 0 auto; }

.topbar {
  display: flex; align-items: center; gap: 14px; padding: 0 24px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.topbar-search { position: relative; flex: 1; max-width: 460px; }
.topbar-search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font: inherit; font-size: .86rem;
}
.topbar-search input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.topbar-search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.lang { display: flex; gap: 2px; }
.lang a { color: var(--muted); padding: 4px 7px; font-size: .72rem; border-radius: 6px; }
.lang a:hover { color: var(--ink); }
.lang a.on { color: var(--brand); font-weight: 700; background: var(--surface-2); }
.menu-btn { display: none; background: transparent; border: 1px solid var(--line-strong); color: var(--ink); border-radius: var(--radius-control); padding: 8px 10px; cursor: pointer; }
.icon-mode { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); width: 36px; height: 36px; border-radius: var(--radius-control); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-mode:hover { color: var(--ink); border-color: var(--brand); }

.content { padding: 28px 32px 56px; max-width: 1280px; }
.content.narrow { max-width: 900px; }

/* ── Page heading ── */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead h1 { margin: 0 0 6px; font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; }
.pagehead .sub { color: var(--muted); margin: 0; font-size: .94rem; line-height: 1.5; max-width: 640px; }
.pagehead .pg-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.breadcrumb { color: var(--faint); font-size: .78rem; margin-bottom: 10px; letter-spacing: .02em; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* ── Cards & grid ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px 22px; box-shadow: var(--shadow-card); }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card .card-sub { color: var(--muted); font-size: .82rem; }
.card.tight { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.04rem; font-weight: 650; letter-spacing: -.01em; }
.section-head .sub { color: var(--muted); font-size: .82rem; }
.section-head .right { display: flex; gap: 8px; align-items: center; }

/* ── KPI / metrics ── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px 18px; box-shadow: var(--shadow-card); transition: border-color .14s ease; }
a.kpi { display: block; color: var(--ink); }
a.kpi:hover { border-color: var(--brand); color: var(--ink); }
.kpi .num { font-size: 1.9rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .lbl { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 9px; }
.kpi .hint { color: var(--faint); font-size: .72rem; margin-top: 4px; }
.kpi.brand .num { color: var(--brand); }
.kpi.accent .num { color: var(--accent); }
.kpi.warn .num { color: var(--warning); }
.kpi.danger .num { color: var(--danger); }

/* ── Badges & chips ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge.new::before { background: var(--accent2); } .badge.new { color: var(--accent2); border-color: rgba(56,189,248,.4); }
.badge.evaluating::before { background: var(--warning); } .badge.evaluating { color: var(--warning); border-color: rgba(182,107,20,.35); }
.badge.bid::before, .badge.submitted::before { background: var(--brand); } .badge.bid, .badge.submitted { color: var(--brand); border-color: rgba(48,89,219,.35); }
.badge.won::before { background: var(--accent); } .badge.won { color: var(--accent); border-color: rgba(23,165,154,.4); }
.badge.lost::before { background: var(--danger); } .badge.lost { color: var(--danger); border-color: rgba(189,60,82,.35); }
.badge.no-bid::before { background: var(--faint); }
.badge.neutral { border-color: var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 11px; font-size: .78rem; }
.chip.cpv { font-family: var(--mono); }
.chip.toggle { cursor: pointer; user-select: none; transition: border-color .12s ease, color .12s ease, background .12s ease; position: relative; }
.chip.toggle.on, .chip.toggle:has(input:checked) { border-color: var(--brand); color: var(--brand); background: #EEF3FF; }
[data-theme="dark"] .chip.toggle.on, [data-theme="dark"] .chip.toggle:has(input:checked) { background: rgba(75,116,232,.16); }

/* ── Progress ── */
.prog { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.prog.warn .prog-fill { background: var(--warning); }
.prog.accent .prog-fill { background: var(--accent); }
.completeness { display: flex; align-items: center; gap: 12px; }
.completeness .prog { flex: 1; }
.completeness .val { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Money / values ── */
.money { font-variant-numeric: tabular-nums; }
.na { color: var(--faint); font-style: italic; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; color: var(--faint); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table tbody tr { cursor: pointer; }
.table a { color: var(--ink); font-weight: 500; }
.table a:hover { color: var(--brand); }

/* ── Horizontal bars (datos reales) ── */
.hbars { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.hbar { display: grid; grid-template-columns: 128px 1fr 38px; gap: 10px; align-items: center; font-size: .82rem; }
.hbar .lbl { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); border-radius: 999px; }
.hbar .val { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.hbar.alt .fill { background: var(--accent); }

/* ── Lists / results ── */
.results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); transition: border-color .14s ease; overflow: hidden; }
.result:hover { border-color: var(--line-strong); }
.result a { display: block; padding: 15px 18px; color: var(--ink); }
.result-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.result-head strong { font-weight: 600; }
.result-meta { display: flex; gap: 14px; margin-top: 6px; color: var(--muted); font-size: .84rem; flex-wrap: wrap; align-items: center; }
.deadline { color: var(--warning); font-weight: 500; }
.overdue { color: var(--danger); font-weight: 700; }
.match { color: var(--accent); white-space: nowrap; font-size: .82rem; font-weight: 600; }

/* ── Kanban ── */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px; min-height: 120px; }
.kanban-col h3 { margin: 0 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); display: flex; align-items: center; gap: 8px; font-weight: 650; }
.kanban-col h3 .count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: .7rem; color: var(--muted); }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 12px 13px; margin-bottom: 9px; box-shadow: var(--shadow-card); }
.kanban-card a.title { color: var(--ink); font-weight: 600; font-size: .88rem; line-height: 1.35; display: block; }
.kanban-card .meta { display: flex; gap: 10px; margin-top: 7px; color: var(--muted); font-size: .78rem; flex-wrap: wrap; align-items: center; }
.kanban-card .next { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-size: .9rem; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── Executive summary / detail ── */
.exec { background: linear-gradient(135deg, #F3F6FF, var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px 22px; margin-bottom: 18px; }
[data-theme="dark"] .exec { background: linear-gradient(135deg, rgba(75,116,232,.08), var(--surface)); }
.exec h2 { margin: 0 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 650; }
.exec .facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.exec .f { }
.exec .f dt { color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.exec .f dd { margin: 3px 0 0; font-weight: 600; font-size: .92rem; }

/* ── Detail layout (rail) ── */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px 18px; box-shadow: var(--shadow-card); }
.countdown { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.countdown.danger { color: var(--danger); }
.countdown.warn { color: var(--warning); }
.countdown .unit { font-size: .8rem; color: var(--muted); font-weight: 500; }

/* ── Workspace (tabs content) ── */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; margin: 14px 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 12px 14px; }
.facts dt { color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 4px 0 0; font-weight: 600; font-size: .9rem; }
.desc { color: var(--muted); line-height: 1.65; white-space: pre-wrap; }
.pubnum { font-family: var(--mono); color: var(--faint); }
.back { font-size: 1.3rem; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); }
.back:hover { color: var(--brand); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.match-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px 18px; }
.match-panel h3 { margin: 0 0 8px; font-size: .95rem; }
.match-score { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.match-score .num { font-size: 1.9rem; font-weight: 750; color: var(--accent); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.factors { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.factor { display: flex; align-items: center; gap: 9px; font-size: .86rem; }
.factor .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--faint); }
.factor.ok .dot { background: var(--accent); }
.factor.bad .dot { background: var(--danger); }
.factor .k { color: var(--muted); flex: 0 0 auto; min-width: 78px; }
.factor .d { color: var(--ink); font-family: var(--mono); font-size: .78rem; }
.hint { color: var(--muted); font-size: .78rem; }

/* ── Checklist / evidence ── */
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-control); background: var(--surface-2); }
.checklist li.done .lbl { text-decoration: line-through; color: var(--muted); }
.checklist .lbl { flex: 1; font-size: .88rem; }
.evidence { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.evidence li { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: var(--radius-control); background: var(--surface-2); }
.evidence .lbl { flex: 1; font-size: .86rem; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 120px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 9px 11px; color: var(--ink); font: inherit; }
.inline-form input:focus { outline: none; border-color: var(--brand); }
.tool-hint { color: var(--muted); font-size: .78rem; margin: 6px 0 0; line-height: 1.5; }
.agenda { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.agenda li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: var(--radius-control); background: var(--surface); border: 1px solid var(--line); }
.agenda a { color: var(--ink); font-weight: 500; }
.agenda a:hover { color: var(--brand); }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.form input, .form textarea, .form select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-control); padding: 11px 13px; color: var(--ink); font: inherit; }
.form textarea { min-height: 80px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--brand); }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { color: var(--muted); font-size: .78rem; margin-top: 4px; }

/* ── Notes / states ── */
.note { padding: 11px 14px; border-radius: var(--radius-control); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .86rem; line-height: 1.5; }
.note.warn { border-color: rgba(182,107,20,.4); color: var(--warning); background: #FBF5EC; }
[data-theme="dark"] .note.warn { background: rgba(240,168,75,.08); }
.note.ok { border-color: rgba(23,165,154,.4); color: var(--accent); background: #ECF8F6; }
[data-theme="dark"] .note.ok { background: rgba(45,212,191,.08); }
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .glyph { font-size: 1.8rem; margin-bottom: 10px; color: var(--faint); }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.05rem; }
.empty-state p { margin: 0 0 16px; font-size: .9rem; max-width: 460px; margin-left: auto; margin-right: auto; }

/* ── Onboarding wizard ── */
.onb-shell { max-width: 720px; }
.onb-progress { display: flex; gap: 8px; margin: 20px 0 24px; }
.onb-progress .seg { flex: 1; }
.onb-progress .bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.onb-progress .bar .fill { height: 100%; background: var(--brand); }
.onb-progress .lbl { color: var(--faint); font-size: .72rem; margin-top: 6px; }
.onb-progress .seg.on .lbl { color: var(--brand); font-weight: 600; }
.cpv-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.cpv-opt { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); cursor: pointer; background: var(--surface); transition: border-color .12s ease, background .12s ease; position: relative; }
.cpv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cpv-opt:hover { border-color: var(--brand); }
.cpv-opt.on, .cpv-opt:has(input:checked) { border-color: var(--brand); background: #EEF3FF; }
[data-theme="dark"] .cpv-opt.on, [data-theme="dark"] .cpv-opt:has(input:checked) { background: rgba(75,116,232,.14); }
.cpv-opt .code { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.cpv-opt .lbl { flex: 1; font-size: .86rem; color: var(--ink); }
.cpv-opt .check { color: var(--brand); font-weight: 700; }
.cpv-opt .check::after { content: "○"; }
.cpv-opt:has(input:checked) .check::after { content: "✓"; }

/* ── Landing / public ── */
.shell-public .topbar { padding: 0 32px; }
.shell-public main { min-height: 60vh; }
.hero { position: relative; padding: 96px 24px 72px; background: linear-gradient(180deg, #EFF3FC 0%, var(--canvas) 100%); border-bottom: 1px solid var(--line); }
[data-theme="dark"] .hero { background: linear-gradient(180deg, #0E1626 0%, var(--canvas) 100%); }
.hero-inner { position: relative; max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .13em; font-size: .76rem; margin: 0 0 16px; font-weight: 700; }
.hero h1 { font-size: 2.5rem; line-height: 1.13; margin: 0 0 18px; font-weight: 800; letter-spacing: -.03em; }
.lede { color: var(--muted); font-size: 1.06rem; line-height: 1.65; margin: 0 0 26px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); overflow: hidden; }
.hero-visual .vi { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.hero-visual .vi .row { flex: 1; }
.hero-visual .vi .bar { height: 8px; border-radius: 999px; background: var(--surface-2); margin-bottom: 6px; }
.hero-visual .vi .bar.f { width: 76%; background: var(--brand); }
.hero-visual .vi .bar.a { width: 52%; background: var(--accent); }
.hero-visual .vi .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--brand); }
.section { max-width: 1120px; margin: 0 auto; padding: 56px 24px; }
.section.centered { text-align: center; }
.section-head.center { justify-content: center; }
.section > h2 { font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -.02em; }
.section .lede2 { color: var(--muted); margin: 0 0 28px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: #EEF3FF; color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: .95rem; }
.step p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.capgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.cap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px; box-shadow: var(--shadow-card); }
.cap .glyph { width: 40px; height: 40px; border-radius: 10px; background: #EEF3FF; color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.cap h3 { margin: 0 0 8px; font-size: 1.02rem; }
.cap p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 14px; }
.coverage .item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px; }
.coverage .k { display: block; color: var(--brand); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-bottom: 8px; }
.coverage .v { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px; text-align: center; }
.plan.hl { border-color: var(--brand); }
.plan .price { font-size: 1.6rem; font-weight: 750; margin: 10px 0 4px; }
.plan .tag { color: var(--brand); font-weight: 600; text-transform: uppercase; font-size: .74rem; letter-spacing: .05em; }

/* ── Auth ── */
.auth-wrap { max-width: 430px; margin: 56px auto; padding: 0 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-card); }
.auth-card .brand { justify-content: center; margin-bottom: 8px; padding: 0; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head h1 { font-size: 1.25rem; margin: 8px 0 4px; }
.auth-head .sub { color: var(--muted); font-size: .86rem; margin: 0; }

/* ── AI chat ── */
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 12px 15px; border-radius: 14px; font-size: .9rem; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ai .attrib { margin-top: 8px; font-size: .74rem; color: var(--muted); }
.suggested { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.suggested button, .suggested .q { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 999px; padding: 7px 13px; font-size: .82rem; cursor: pointer; font-family: var(--font); }
.suggested .q:hover { border-color: var(--brand); color: var(--brand); }

/* ── Activity timeline ── */
.timeline { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; font-size: .86rem; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: 0 0 auto; }
.timeline .body { color: var(--muted); }
.timeline .body strong { color: var(--ink); font-weight: 600; }
.timeline .when { color: var(--faint); font-size: .74rem; }

/* ── Footer ── */
.foot { border-top: 1px solid var(--line); padding: 24px 24px 32px; background: var(--surface); color: var(--muted); font-size: .82rem; }
.foot-inner { display: flex; justify-content: space-between; max-width: 1120px; margin: 0 auto; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--brand); }

/* ── Legal ── */
.draft-banner { border: 1px solid rgba(182,107,20,.4); color: var(--warning); background: #FBF5EC; border-radius: var(--radius-control); padding: 10px 14px; font-size: .84rem; margin-bottom: 18px; }
[data-theme="dark"] .draft-banner { background: rgba(240,168,75,.08); }
.legal-body { color: var(--muted); line-height: 1.7; max-width: 720px; }
.legal-body p { margin: 0 0 14px; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .steps, .plans, .capgrid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: var(--sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .topbar-search { max-width: none; }
  .content { padding: 22px 18px 44px; }
  .shell-public .topbar nav { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .hero h1 { font-size: 1.8rem; }
  .lede { font-size: .98rem; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .f-row { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 36px; }
  .hbars .hbar { grid-template-columns: 96px 1fr 30px; }
  .pagehead { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
