/* ICM Client Discovery — design system. Deep navy/charcoal foundation, restrained blue + cyan accents.
   Light and dark themes; WCAG 2.2 AA contrast targets; no external fonts (works offline). */
:root {
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --navy-950: #070d19; --navy-900: #0b1220; --navy-850: #0f1829; --navy-800: #142036; --navy-700: #1d2b47;
  --blue-600: #2056d8; --blue-500: #2f6bf0; --blue-400: #5b8cf5; --cyan-500: #06b6d4; --cyan-400: #22d3ee;
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8fafc; --raise: #ffffff;
  --ink: #0f172a; --ink-2: #334155; --muted: #5b6880; --line: #e3e8f0; --line-2: #cfd7e3;
  --accent: var(--blue-600); --accent-ink: #ffffff; --accent-soft: #e8efff; --accent-2: #0e7490;
  --crit: #c81e1e; --crit-soft: #fdecec; --high: #c2410c; --high-soft: #fff1e8; --med: #946200; --med-soft: #fdf6dd;
  --low: #52607a; --low-soft: #eef2f7; --good: #047857; --good-soft: #e6f6ef;
  --side-bg: var(--navy-900); --side-ink: #c9d5ea; --side-muted: #8193b2; --side-active: #ffffff; --side-active-bg: #1b2a47;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-2: 0 8px 24px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .06);
  --radius: 14px; --radius-sm: 9px; --gap: 20px; --side-w: 248px; --top-h: 60px;
  --focus: 0 0 0 3px rgba(47, 107, 240, .45);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a101c; --surface: #111a2c; --surface-2: #0e1626; --raise: #16213a;
    --ink: #e7edf8; --ink-2: #c3cee2; --muted: #93a3bf; --line: #1f2b45; --line-2: #2a3a5c;
    --accent: #7aa5ff; --accent-ink: #0a101c; --accent-soft: #16264a; --accent-2: #22d3ee;
    --crit: #f87171; --crit-soft: #3a1518; --high: #fb923c; --high-soft: #3a2010; --med: #facc15; --med-soft: #33290b;
    --low: #a3b1c9; --low-soft: #1b2539; --good: #34d399; --good-soft: #0f2f25;
    --side-bg: #070d19; --side-active-bg: #17233d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a101c; --surface: #111a2c; --surface-2: #0e1626; --raise: #16213a;
  --ink: #e7edf8; --ink-2: #c3cee2; --muted: #93a3bf; --line: #1f2b45; --line-2: #2a3a5c;
  --accent: #7aa5ff; --accent-ink: #0a101c; --accent-soft: #16264a; --accent-2: #22d3ee;
  --crit: #f87171; --crit-soft: #3a1518; --high: #fb923c; --high-soft: #3a2010; --med: #facc15; --med-soft: #33290b;
  --low: #a3b1c9; --low-soft: #1b2539; --good: #34d399; --good-soft: #0f2f25;
  --side-bg: #070d19; --side-active-bg: #17233d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; } h2 { font-size: 1.2rem; font-weight: 650; } h3 { font-size: 1rem; font-weight: 650; }
p { margin: .4em 0; } ul, ol { margin: .4em 0; padding-left: 1.3em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

svg.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
svg.ico-lg { width: 46px; height: 46px; display: block; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; font-weight: 700; letter-spacing: .01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--blue-500), var(--cyan-500)); display: grid; place-items: center; }
.brand small { display: block; color: var(--side-muted); font-weight: 500; font-size: .72rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; color: var(--side-ink); padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: .93rem; }
.nav a:hover { background: rgba(255, 255, 255, .05); text-decoration: none; color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active-bg); color: var(--side-active); box-shadow: inset 3px 0 0 var(--cyan-400); }
.nav .ico { width: 18px; height: 18px; opacity: .9; flex: none; }
.nav .badge { margin-left: auto; background: var(--blue-600); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 999px; }
.side .sect { color: var(--side-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 16px 12px 6px; }
.side .foot { margin-top: auto; padding: 12px; color: var(--side-muted); font-size: .78rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .menu-btn { display: none; }
.orgsel { display: flex; align-items: center; gap: 8px; }
.orgsel select { font-weight: 600; max-width: 280px; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: 8px; }
.search input { width: 100%; padding-left: 36px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.search .results { position: absolute; top: 44px; left: 0; right: 0; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); max-height: 380px; overflow: auto; z-index: 30; }
.search .results a { display: flex; gap: 10px; padding: 9px 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search .results a:hover, .search .results a:focus { background: var(--surface-2); text-decoration: none; }
.top .spacer { flex: 1; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.iconbtn:hover { background: var(--surface-2); border-color: var(--line); }
.iconbtn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-500); border: 2px solid var(--surface); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--navy-700), var(--blue-600)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; border: none; cursor: pointer; }
.content { padding: 28px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.sample-banner { background: #fde68a; color: #422006; text-align: center; padding: 7px 16px; font-weight: 600; font-size: .85rem; }

/* ---------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 70ch; }
.eyebrow { color: var(--accent-2); font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); }
.card + .card { margin-top: var(--gap); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head p { color: var(--muted); margin: 2px 0 0; font-size: .9rem; }
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: var(--gap); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .76rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* ---------- KPI tiles */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: .85rem; font-weight: 550; }
.kpi .value { font-size: 2.1rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.kpi .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.kpi.accent::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--blue-500), var(--cyan-500)); }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .9rem; border-radius: 10px; padding: 9px 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--crit); border-color: var(--crit); background: transparent; }
.btn.small { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-height: 40px; }
textarea { min-height: 90px; resize: vertical; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
label { font-weight: 600; font-size: .88rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: .8rem; font-weight: 400; display: block; margin-top: 2px; }
.field input, .field select, .field textarea { width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { min-height: auto; width: 18px; height: 18px; margin-top: 2px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.sev-critical { color: var(--crit); background: var(--crit-soft); border-color: transparent; }
.sev-high { color: var(--high); background: var(--high-soft); border-color: transparent; }
.sev-medium { color: var(--med); background: var(--med-soft); border-color: transparent; }
.sev-low { color: var(--low); background: var(--low-soft); border-color: transparent; }
.ok { color: var(--good); background: var(--good-soft); border-color: transparent; }
.info { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--low); }
.status-dot.ok { background: var(--good); } .status-dot.warn { background: var(--high); } .status-dot.bad { background: var(--crit); } .status-dot.info { background: var(--accent); }

/* ---------- progress */
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--cyan-500)); border-radius: 999px; transition: width .4s ease; }
.ring { width: 64px; height: 64px; flex: none; }
.ring .t { fill: none; stroke: var(--line); stroke-width: 7; } .ring .v { fill: none; stroke: var(--accent-2); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .5s; }
.ring text { fill: var(--ink); font-size: 15px; font-weight: 700; }

/* ---------- stepper (7 steps) */
.stepper { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 118px; position: relative; }
.step:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.step .t { font-weight: 650; font-size: .88rem; line-height: 1.3; }
.step .s { color: var(--muted); font-size: .75rem; margin-top: auto; }
.step[data-state="done"] .n { background: var(--good); border-color: var(--good); color: #fff; }
.step[data-state="started"] .n { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.step[aria-current="step"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-1); }

/* ---------- lists & tables */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: none; }
.item .grow { flex: 1; min-width: 0; }
.item h3 { font-size: .97rem; }
.item p { color: var(--ink-2); margin: 3px 0 0; font-size: .9rem; }
.item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: .8rem; }
.clickable { cursor: pointer; border-radius: 10px; } .clickable:hover { background: var(--surface-2); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* ---------- states */
.empty, .error-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico-lg, .error-state .ico-lg { width: 46px; height: 46px; margin: 0 auto 12px; color: var(--line-2); }
.empty h3, .error-state h3 { color: var(--ink); margin-bottom: 6px; }
.error-state .ico-lg { color: var(--crit); }
.skel { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: sh 1.3s infinite; border-radius: 8px; height: 14px; margin: 8px 0; }
@keyframes sh { from { background-position: 200% 0 } to { background-position: -200% 0 } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); border: 1px solid transparent; font-size: .9rem; }
.notice.warn { background: var(--high-soft); } .notice.bad { background: var(--crit-soft); } .notice.good { background: var(--good-soft); }
.notice .ico { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- drawer, modal, toast */
.scrim { position: fixed; inset: 0; background: rgba(7, 13, 25, .45); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: var(--surface); z-index: 41; box-shadow: var(--shadow-2); display: flex; flex-direction: column; animation: slide .2s ease; }
.drawer header, .modal header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer .body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer footer, .modal footer { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; animation: fade .15s; }
.modal .body { padding: 20px 24px; overflow-y: auto; }
@keyframes fade { from { opacity: 0 } } @keyframes slide { from { transform: translateX(30px); opacity: 0 } }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-2); max-width: 380px; font-size: .9rem; animation: fade .2s; border-left: 4px solid var(--cyan-500); }
.toast.bad { border-left-color: #f87171; }
.menu { position: absolute; right: 0; top: 46px; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); min-width: 240px; padding: 6px; z-index: 30; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: none; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- finding cards & evidence */
.fcard { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--surface); display: flex; gap: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.fcard .sevbar { width: 4px; border-radius: 4px; flex: none; background: var(--low); }
.fcard .sevbar.critical { background: var(--crit); } .fcard .sevbar.high { background: var(--high); } .fcard .sevbar.medium { background: #d4a20b; }
.fcard + .fcard { margin-top: 10px; }
.quote { border-left: 3px solid var(--accent-2); padding: 6px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--ink-2); font-size: .88rem; margin: 6px 0; }
.src { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
details.adv { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
details.adv summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--accent); font-size: .88rem; }

/* ---------- charts & map */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
svg.chart .grid { stroke: var(--line); }
svg.chart .area { fill: var(--accent-soft); } svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
svg.chart .dot { fill: var(--accent); }
.mapwrap { position: relative; height: calc(100vh - 230px); min-height: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mapwrap svg { width: 100%; height: 100%; cursor: grab; touch-action: none; }
.mapwrap svg:active { cursor: grabbing; }
.mapwrap .edge { stroke: var(--line-2); stroke-width: 1.4; fill: none; }
.mapwrap .edge.manual { stroke: var(--high); stroke-dasharray: 5 4; stroke-width: 1.8; }
.mapwrap .edge.none { stroke: var(--crit); stroke-dasharray: 2 4; }
.mapwrap .edge.hl { stroke: var(--accent); stroke-width: 2.4; }
.mapwrap .node circle { stroke: var(--surface); stroke-width: 2; }
.mapwrap .node text { fill: var(--ink-2); font-size: 11px; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.mapwrap .node.dim { opacity: .18; } .mapwrap .edge.dim { opacity: .08; }
.mapwrap .node.sel circle { stroke: var(--accent); stroke-width: 3; }
.map-legend { position: absolute; left: 14px; bottom: 14px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .78rem; display: grid; gap: 4px; }
.map-tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; flex-direction: column; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ---------- chat (interview) */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; }
.bubble.app { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { background: var(--accent); color: var(--accent-ink); margin-left: auto; border-bottom-right-radius: 4px; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .art { background: radial-gradient(1200px 600px at 20% 10%, #1b3466 0%, var(--navy-900) 55%, var(--navy-950) 100%); color: #e6edf7; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .art h1 { font-size: 2.4rem; max-width: 18ch; color: #fff; }
.auth .art p { color: #a9bbd8; font-size: 1.05rem; max-width: 46ch; }
.auth .art ul { color: #c9d5ea; list-style: none; padding: 0; } .auth .art li { padding: 6px 0; display: flex; gap: 10px; align-items: center; }
.auth .form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth form { width: min(380px, 100%); }

/* ---------- presentation mode */
.present { position: fixed; inset: 0; background: var(--navy-950); color: #e7edf8; z-index: 70; display: flex; flex-direction: column; }
.present .slide { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 6vh 8vw; overflow: auto; }
.present h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); color: #fff; } .present h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); color: #fff; margin-bottom: 3vh; }
.present p, .present li { font-size: clamp(1.05rem, 1.7vw, 1.45rem); color: #c3cee2; line-height: 1.5; }
.present .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2vw; margin-top: 4vh; }
.present .kpis div { border: 1px solid #22314f; border-radius: 16px; padding: 2.5vh 1.5vw; }
.present .kpis b { display: block; font-size: clamp(2rem, 4vw, 3.4rem); color: var(--cyan-400); }
.present .bar-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-top: 1px solid #1a2741; color: #8ea1c2; font-size: .9rem; }
.present .bar-nav button { background: #142036; color: #e7edf8; border: 1px solid #22314f; border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer; }
.present .sev { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; }

/* ---------- responsive */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; }
  .top .menu-btn { display: inline-grid; }
  .top { padding: 0 14px; } .content { padding: 18px 16px; }
  .g2, .g3 { grid-template-columns: 1fr; } .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; } .auth .art { display: none; }
  .search { display: none; } .orgsel select { max-width: 160px; }
  .present .kpis { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr; } .stepper { grid-template-columns: 1fr; } .kpi .value { font-size: 1.7rem; } }
@media print { .side, .top, .no-print { display: none !important; } .shell { display: block; } .card { box-shadow: none; } }

/* links inside running text are underlined, not told apart by color alone (WCAG 1.4.1) */
p a, li a, .muted a, .small a, .notice a, .help a, td a { text-decoration: underline; text-underline-offset: 2px; }
.btn, a.btn, .nav a, .step, a.item, a.kpi, .search .results a, .menu a { text-decoration: none; }
