/* WorldPulse AI — operations-console design system */
:root {
  --bg: #0a0e13;
  --bg-2: #0f141b;
  --panel: #121922;
  --panel-2: #17202b;
  --line: #222d3a;
  --line-2: #2c3949;
  --text: #e6edf3;
  --muted: #8b98a8;
  --faint: #5d6b7c;
  --accent: #46d9c4;
  --accent-ink: #062521;
  --accent-soft: rgba(70, 217, 196, 0.12);
  --sev-1: #6b7a8c;
  --sev-2: #5aa2ff;
  --sev-3: #f2c14e;
  --sev-4: #ff8a3d;
  --sev-5: #ff4d5e;
  --cat-cloud: #5aa2ff;
  --cat-security: #ff6b7d;
  --cat-software: #b18cff;
  --cat-hazard: #f2a64e;
  --cat-policy: #46d9c4;
  --good: #4ad38a;
  --bad: #ff5d6c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-2: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --line: #e1e6ec;
  --line-2: #d3dae2;
  --text: #121820;
  --muted: #5a6776;
  --faint: #8794a3;
  --accent: #0f9d8a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 157, 138, 0.1);
  --shadow: 0 10px 30px rgba(20, 30, 40, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hide { display: none !important; }

/* ---------- Boot & toast */
.boot { height: 100vh; display: grid; place-items: center; }
.pulse-mark { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 1.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 10px;
  opacity: 0; transition: 0.25s; pointer-events: none; z-index: 100; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { border-color: var(--bad); }

/* ---------- Auth */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 10% 110%, rgba(70, 217, 196, 0.18), transparent 60%), var(--bg-2);
  border-right: 1px solid var(--line);
}
.auth-hero h1 { font-size: 44px; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 520px; }
.auth-hero p { color: var(--muted); max-width: 460px; font-size: 16px; }
.auth-hero .grid-bg { position: absolute; inset: 0; opacity: 0.35; pointer-events: none; }
.auth-points { display: grid; gap: 10px; margin-top: 28px; }
.auth-points div { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.auth-points b { color: var(--text); font-weight: 600; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; margin: 0 0 4px; }
.auth-card .switch { margin-top: 16px; color: var(--muted); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-hero { padding: 32px 20px; } .auth-hero h1 { font-size: 30px; } }

/* ---------- Brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; font-size: 16px; }
.brand svg { flex: none; }
.brand small { font-weight: 500; color: var(--faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-top: -2px; }

/* ---------- Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--line);
  background: var(--bg-2); display: flex; flex-direction: column; gap: 18px;
}
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--text); }
.nav a.on svg { color: var(--accent); }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--sev-5); color: #fff; border-radius: 10px; padding: 0 6px; }
.nav-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 0 10px; margin-top: 6px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.me .who { min-width: 0; }
.me .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.topbar .spacer { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: livep 2s infinite; }
@keyframes livep { 0% { box-shadow: 0 0 0 0 rgba(74, 211, 138, 0.6); } 100% { box-shadow: 0 0 0 8px rgba(74, 211, 138, 0); } }
.content { padding: 24px 28px 80px; max-width: 1440px; }
.btn.mobile-menu { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .btn.mobile-menu { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 96px; }
}

/* ---------- Primitives */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 500; white-space: nowrap; transition: 0.15s;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.danger { color: var(--bad); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); outline: none; transition: 0.15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-h .spacer { flex: 1; }
.card-b { padding: 16px; }

.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g-2 { grid-template-columns: 1fr; } }

.kpi { padding: 16px; }
.kpi .label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--faint); font-size: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; text-transform: capitalize;
}
.sev { font-family: var(--mono); font-weight: 500; border: none; color: #0a0e13; }
.sev-1 { background: var(--sev-1); color: #fff; } .sev-2 { background: var(--sev-2); } .sev-3 { background: var(--sev-3); } .sev-4 { background: var(--sev-4); } .sev-5 { background: var(--sev-5); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.cat-cloud { background: var(--cat-cloud); } .cat-security { background: var(--cat-security); } .cat-software { background: var(--cat-software); } .cat-hazard { background: var(--cat-hazard); } .cat-policy { background: var(--cat-policy); }
.conf-high { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.conf-medium { color: var(--sev-3); border-color: color-mix(in srgb, var(--sev-3) 40%, transparent); }
.conf-low { color: var(--muted); }
.tag { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }

.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 340px; }
.toolbar select.input { width: auto; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { color: var(--faint); margin-bottom: 8px; }

/* ---------- Lists */
.list { display: grid; }
.row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; cursor: pointer; transition: background 0.1s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel-2); }
.row .t { font-weight: 500; line-height: 1.35; }
.row .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--faint); font-size: 12px; margin-top: 4px; }
.row .grow { flex: 1; min-width: 0; }
.row .clamp { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }

/* ---------- Alerts */
.alert-card { padding: 16px; display: grid; gap: 10px; border-left: 3px solid var(--sev-3); }
.alert-card.s5 { border-left-color: var(--sev-5); } .alert-card.s4 { border-left-color: var(--sev-4); } .alert-card.s2, .alert-card.s1 { border-left-color: var(--sev-2); }
.alert-card h4 { margin: 0; font-size: 15px; line-height: 1.35; }
.why { font-size: 13px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.why b { color: var(--text); font-weight: 600; }
.ai-note { font-size: 13px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }
.ai-note .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; display: block; margin-bottom: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Drawer */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 60; opacity: 0; pointer-events: none; transition: 0.2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line-2);
  z-index: 61; transform: translateX(100%); transition: transform 0.25s; overflow-y: auto; box-shadow: var(--shadow);
}
.drawer.on { transform: none; }
.drawer .dh { position: sticky; top: 0; background: var(--panel); padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; z-index: 1; }
.drawer .db { padding: 20px; display: grid; gap: 18px; }
.drawer h2 { font-size: 18px; margin: 0; line-height: 1.3; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; }
.section-t { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 600; margin: 0 0 8px; }
.rel { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.rel + .rel { margin-top: 8px; }

/* ---------- Charts / map */
.chart { width: 100%; height: 180px; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-wrap { position: relative; }
.map { width: 100%; height: auto; display: block; }
.map .land { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 0.5; }
.map .grat { fill: none; stroke: var(--line); stroke-width: 0.4; }
.map .pt { stroke: var(--bg); stroke-width: 1; cursor: pointer; }
.map .halo { fill: none; stroke-width: 1.5; animation: halo 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(3.2); opacity: 0; } }
.tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 8px; font-size: 12px; max-width: 260px; box-shadow: var(--shadow); z-index: 5; }
.bar { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar .track { flex: 1; height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 4px; }
.bar + .bar { margin-top: 10px; }

/* ---------- Graph */
.graph-wrap { position: relative; height: calc(100vh - 190px); min-height: 480px; }
.graph-wrap svg { width: 100%; height: 100%; display: block; cursor: grab; }
.graph-wrap .node text { font-size: 11px; fill: var(--muted); pointer-events: none; }
.graph-wrap .node.dep text { fill: var(--text); font-weight: 600; font-size: 12px; }
.graph-legend { position: absolute; left: 12px; bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- Table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.crit { display: inline-flex; gap: 3px; }
.crit i { width: 6px; height: 14px; border-radius: 2px; background: var(--line-2); }
.crit i.on { background: var(--accent); }
.status-ok { color: var(--good); } .status-bad { color: var(--bad); }

/* ---------- Assistant */
.chat { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 63px); }
.convs { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; display: grid; align-content: start; gap: 4px; }
.convs button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convs button:hover, .convs button.on { background: var(--panel); color: var(--text); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.msg { max-width: 820px; width: 100%; margin: 0 auto; display: flex; gap: 12px; }
.msg .av { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.msg.user .av { background: var(--panel-2); color: var(--muted); }
.msg.assistant .av { background: var(--accent-soft); color: var(--accent); }
.msg .bubble { min-width: 0; flex: 1; }
.msg.user .bubble { color: var(--text); font-weight: 500; padding-top: 3px; white-space: pre-wrap; }
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; } .md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { font-size: 15px; margin: 14px 0 6px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--bg-2); border: 1px solid var(--line); padding: 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 8px 0; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line-2); padding: 5px 9px; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--muted); }
.cite { font-family: var(--mono); font-size: 10px; background: var(--accent-soft); color: var(--accent); padding: 0 4px; border-radius: 4px; vertical-align: 1px; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.srcs a { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--muted); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srcs a b { color: var(--accent); font-family: var(--mono); font-weight: 500; margin-right: 4px; }
.caret::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer { padding: 14px 28px 20px; border-top: 1px solid var(--line); }
.composer-box { max-width: 820px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; max-height: 200px; min-height: 36px; padding: 8px; line-height: 1.45; }
.suggest { max-width: 820px; margin: 0 auto 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.suggest button:hover { color: var(--text); border-color: var(--line-2); }
.hello { max-width: 820px; margin: auto; text-align: center; padding: 40px 0 20px; }
.hello h2 { font-size: 26px; letter-spacing: -0.02em; margin: 14px 0 6px; }
@media (max-width: 960px) { .chat { grid-template-columns: 1fr; height: calc(100vh - 57px); } .convs { display: none; } .msgs { padding: 16px; } .composer { padding: 10px 12px 14px; } }

/* ---------- Voice overlay */
.voice {
  position: fixed; inset: 0; z-index: 80; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px;
  background: radial-gradient(800px 500px at 50% 45%, rgba(70, 217, 196, 0.10), transparent 70%), color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(8px);
}
.voice.on { display: flex; }
.orb { width: 180px; height: 180px; border-radius: 50%; position: relative; cursor: pointer; border: 0; background: transparent; }
.orb .core {
  position: absolute; inset: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a9fff1, var(--accent) 45%, #0b6d62 100%);
  box-shadow: 0 0 60px rgba(70, 217, 196, 0.45); transition: transform 0.08s linear;
}
.orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.voice[data-state="listening"] .ring { animation: ring 1.6s ease-out infinite; }
.voice[data-state="listening"] .ring.r2 { animation-delay: 0.8s; }
.voice[data-state="thinking"] .core { animation: think 1.2s ease-in-out infinite; }
.voice[data-state="speaking"] .core { animation: speak 0.6s ease-in-out infinite alternate; }
@keyframes ring { 0% { transform: scale(0.75); opacity: 0.8; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes think { 0%, 100% { transform: scale(0.9); filter: hue-rotate(0deg); } 50% { transform: scale(1); filter: hue-rotate(40deg); } }
@keyframes speak { from { transform: scale(0.94); } to { transform: scale(1.06); } }
.voice .state { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); font-weight: 600; }
.voice .said { max-width: 640px; text-align: center; color: var(--muted); min-height: 22px; }
.voice .reply { max-width: 680px; text-align: center; font-size: 19px; line-height: 1.5; min-height: 30px; }
.voice .vbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #a9fff1, var(--accent) 50%, #0b6d62); box-shadow: 0 8px 28px rgba(70, 217, 196, 0.35); display: grid; place-items: center; color: #042;
}
.fab:hover { transform: scale(1.05); }

/* ---------- Scenario */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 18px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.chips button:hover { color: var(--text); }
.hypo { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sev-3); border: 1px dashed var(--sev-3); border-radius: 6px; padding: 2px 8px; }
.risk { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 6px; }
.risk-low { background: rgba(74, 211, 138, 0.15); color: var(--good); } .risk-moderate { background: rgba(242, 193, 78, 0.15); color: var(--sev-3); }
.risk-high { background: rgba(255, 138, 61, 0.15); color: var(--sev-4); } .risk-severe { background: rgba(255, 77, 94, 0.15); color: var(--sev-5); }
.timeline-list { display: grid; gap: 10px; }
.timeline-list div { display: flex; gap: 10px; align-items: flex-start; }
.when { font-family: var(--mono); font-size: 11px; min-width: 44px; padding: 2px 6px; border-radius: 5px; background: var(--panel-2); color: var(--accent); text-align: center; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.5); }
.modal .card { width: 100%; max-width: 480px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
