/* LinkedERP Sales Sidekick — Titan UI language (wireframes v1.0, 2026-06-29).
   Light chrome so Sidekick and Titan read as one product: navy 213840 rail and
   table headers, brand red EE2E24 as the single accent, slate text on a
   near-white canvas, E2E8F0 hairlines. Brand DNA unchanged: § NN · LABEL mono
   section labels, linkederp.com / AI-first ERP footer. */
:root {
  --red: #EE2E24;
  --red-glow: rgba(238, 46, 36, .18);
  --navy: #213840;
  --slate: #3F4C57;
  --grey: #64748B;
  --bg0: #F4F6F8;          /* canvas */
  --bg1: #F7F9FB;          /* raised canvas */
  --ink: #1F2933;          /* body text */
  --ink-dim: #55636E;      /* secondary text */
  --panel: #FFFFFF;
  --panel-strong: #FFFFFF;
  --line: #E2E8F0;
  --line-strong: #CBD2D9;
  --ok: #136B33;
  --warn: #B45309;
  --blue: #538DD5;
  --font: Aptos, Calibri, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  --radius: 10px;
  --red-ink: #B3170F;      /* brand red darkened until it is readable as text */
  --red-btn: #D42219;      /* primary button fill — 5.2:1 behind white */
  --red-bg: #FDECEA;   --red-line: #F6CBC7;
  --ok-bg: #E7F5EC;    --ok-line: #BFE3CC;
  --warn-bg: #FDF3E3;  --warn-line: #F3DCB4;
  --info-bg: #EEF3F7;  --info-line: #DCE6EE;
  --navy-hover: #16272D;
  --placeholder: #94A3B8;
  --on-navy: #FFFFFF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--ink); font-size: 15px;
  background-color: var(--bg0);
}
#login-view, #app-view { position: relative; z-index: 1; }

h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 700; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea {
  font-family: var(--font); font-size: 14px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px;
  background: #ffffff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(238,46,36,.18); }
input::placeholder, textarea::placeholder { color: rgba(184,198,204,.45); }
select option { background-color: var(--bg1); color: var(--ink); }
textarea { resize: vertical; min-height: 130px; }
label { font-size: 12px; font-weight: 600; color: var(--grey); display: block; margin-bottom: 5px; letter-spacing: .02em; }

.hidden { display: none !important; }

/* ---------- atoms ---------- */
.seclabel { font-family: var(--mono); font-weight: 700; font-size: 10.5px; letter-spacing: .12em; color: var(--red-ink); text-transform: uppercase; }
.btn {
  border: none; border-radius: 10px; padding: 10px 18px; font-weight: 650; font-size: 14px;
  transition: transform .18s, border-color .18s, box-shadow .18s, opacity .18s; position: relative;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-red { background: linear-gradient(135deg, #FF4438, var(--red)); color: #fff; box-shadow: 0 4px 18px var(--red-glow); }
.btn-navy { background: linear-gradient(135deg, #2E4B56, var(--navy)); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-slate { background: linear-gradient(135deg, #46697A, var(--slate)); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-dim); border: 1px solid var(--line-strong); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3.5px 12px;
  font-size: 12px; font-weight: 600; background: #EEF3F7; color: var(--ink-dim);
  border: 1px solid var(--line);
}
.chip.red { background: rgba(238, 46, 36, .16); color: #B3170F; border-color: rgba(238,46,36,.35); }
.chip.navy { background: rgba(33, 56, 64, .9); color: var(--ink); }
.chip.ok { background: rgba(61, 214, 140, .14); color: var(--ok); border-color: rgba(61,214,140,.3); }
.chip.warn { background: rgba(255, 197, 61, .12); color: var(--warn); border-color: rgba(255,197,61,.3); }
.chip.mono { font-family: var(--mono); font-size: 10.5px; }

.card {
  background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 20px 22px; margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}
.card h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .seclabel { display: block; margin-bottom: 8px; }

/* Fold a step away. The § heading is the toggle (wired once in workspace.js),
   so a rep can hide the steps they are done with and keep the stage readable.
   Only a card whose FIRST child is the heading folds — sub-headings inside a
   card are untouched. */
.card.foldable > .seclabel { cursor: pointer; user-select: none; display: flex; align-items: baseline; gap: 8px; }
.card.foldable > .seclabel::after { content: '▾'; font-size: 9px; opacity: .55; margin-left: auto; }
.card.folded > .seclabel::after { content: '▸'; }
.card.foldable > .seclabel:hover { color: var(--red); }
.card.foldable > .seclabel:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.card.folded { padding-bottom: 16px; }
.card.folded > :not(.seclabel) { display: none; }
.card.folded > .seclabel { margin-bottom: 0; }

.callout { border-radius: 10px; padding: 11px 15px; font-size: 13.5px; display: flex; gap: 11px; align-items: baseline; margin: 10px 0; border: 1px solid var(--line); }
.callout .tag { font-family: var(--mono); font-size: 9.5px; font-weight: 700; color: #fff; border-radius: 5px; padding: 2.5px 8px; flex: none; letter-spacing: .08em; }
.callout.note { background: rgba(84, 104, 112, .18); } .callout.note .tag { background: #546870; }
.callout.warn { background: rgba(238, 46, 36, .1); border-color: rgba(238,46,36,.25); } .callout.warn .tag { background-color: var(--red); }
.callout.info { background: #EEF3F7; } .callout.info .tag { background-color: var(--slate); }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(33, 56, 64, .95); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 12px 24px; border-radius: 12px; font-size: 14px; z-index: 99; max-width: 72vw;
  backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.toast.error { background: rgba(120, 25, 20, .95); border-color: rgba(238,46,36,.5); }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.pulsing { animation: pulse 1.6s ease-in-out infinite; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  background-color: var(--bg1); color: var(--ink-dim); font-family: var(--mono);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  text-align: left; padding: 8px 11px; border-bottom: 1px solid var(--red);
}
table.t td { padding: 8px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr.total td { font-weight: 700; border-top: 2px solid var(--red); color: var(--ink); font-size: 14px; }
table.t input, table.t select { padding: 5px 8px; font-size: 13px; border-radius: 6px; }

/* ---------- login ---------- */
#login-view { display: flex; min-height: 100vh; align-items: stretch; }
.login-brand { flex: 1.1; padding: 64px 68px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-brand .rose {
  position: absolute; right: -120px; top: 40px; width: 420px; height: 420px; opacity: .14; pointer-events: none;
  animation: rosespin 90s linear infinite;
}
@keyframes rosespin { to { transform: rotate(360deg); } }
.logo { font-size: 32px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); }
.logo .red { color: var(--red); text-shadow: 0 0 24px var(--red-glow); }
.login-brand .tagline { font-style: italic; color: var(--grey); margin-top: 2px; }
.login-brand .compass { margin-top: 56px; font-size: 30px; font-weight: 800; }
.login-brand .compass .seclabel { display: block; font-size: 11px; margin-bottom: 8px; }
.login-brand p.lead { color: var(--ink-dim); line-height: 1.6; max-width: 48ch; }
.flowlist { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.flowlist .step { display: flex; gap: 14px; align-items: baseline; font-size: 14px; color: var(--ink-dim); }
.flowlist .num { font-family: var(--mono); font-size: 10.5px; color: var(--red-ink); font-weight: 700; flex: none; width: 24px; }
.login-brand .foot { margin-top: auto; padding-top: 40px; font-size: 12.5px; color: var(--grey); display: flex; gap: 20px; }
.login-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 34px; }
.login-card {
  width: 100%; max-width: 460px; background-color: var(--panel-strong); border: 1px solid var(--line-strong);
  border-radius: 20px; backdrop-filter: blur(20px); padding: 38px 40px;
  box-shadow: 0 20px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
}
.login-card h2 { font-size: 22px; }
.login-card .sub { color: var(--grey); font-size: 13.5px; margin-bottom: 24px; }
.fgroup { margin-bottom: 16px; }
.check-row {
  display: flex; align-items: flex-start; gap: 11px; background: #EEF3F7;
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; margin: 14px 0; cursor: pointer;
}
.check-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--red); flex: none; }
.check-row .lbl { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.check-row .muted { margin-top: 2px; }
.conn-status { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.demo-link { text-align: center; margin-top: 14px; }
.demo-link a { color: var(--grey); font-size: 12.5px; text-decoration: underline; cursor: pointer; }

/* ---------- app shell ---------- */
#app-view { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 26px; height: 58px; flex: none;
  background-color: var(--bg1); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar .logo { font-size: 18px; }
.topbar .app-name { font-family: var(--mono); font-size: 10.5px; color: var(--grey); border-left: 1px solid var(--line-strong); padding-left: 14px; letter-spacing: .14em; }
.topbar .grow { flex: 1; }
.topbar .uchip { font-size: 13px; color: var(--ink-dim); }
.topbar .btn { padding: 6px 13px; font-size: 12.5px; }
.appfoot {
  color: var(--grey); font-size: 12px; display: flex; justify-content: space-between;
  padding: 12px 26px; flex: none; border-top: 1px solid var(--line); background-color: var(--bg1);
}
.appfoot .mid { font-style: italic; }
#main { flex: 1; padding: 26px 30px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ---------- pipeline ---------- */
.pipe-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pipe-head h2 { font-size: 20px; margin: 0; }

/* Dev ⇄ Live segmented toggle. The selected side is the database you are
   actually connected to; Production is red so nobody drafts against live
   thinking they are in the sandbox. */
.envtog { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background-color: var(--bg1); }
.envtog:empty { display: none; }
.envtog button {
  font: inherit; font-size: 12px; line-height: 1; cursor: pointer; border: 0; border-radius: 999px;
  padding: 6px 13px; color: var(--ink-dim); background-color: transparent; white-space: nowrap;
}
.envtog button:hover:not(.on) { color: var(--ink); background-color: var(--panel-strong); }
.envtog button.on { color: #fff; background-color: var(--navy); cursor: default; }
.envtog button.on.live { background-color: var(--red); }
.envtog button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kcol {
  flex: none; width: 248px; background-color: var(--bg1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; backdrop-filter: blur(8px);
}
.kcol h4 { font-size: 12px; display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: var(--ink-dim); }
.kcol h4 .n { font-family: var(--mono); font-size: 9.5px; color: var(--bg0); background-color: var(--red); border-radius: 5px; padding: 1.5px 7px; }
.kcol h4 .count { margin-left: auto; color: var(--grey); font-weight: 400; }
.kcard {
  background-color: var(--panel-strong); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s, opacity .18s; position: relative;
}
.kcard:hover { transform: translateY(-2px); border-color: rgba(238,46,36,.45); box-shadow: 0 8px 26px rgba(0,0,0,.35), 0 0 0 1px rgba(238,46,36,.2); }
.kcard.lost { opacity: .5; }
.kcard .co { font-weight: 700; font-size: 13.5px; }
.kcard .meta { color: var(--grey); font-size: 12px; margin: 3px 0 8px; }
.kcard .chips { display: flex; gap: 5px; flex-wrap: wrap; }
.kcard .chip { font-size: 10px; padding: 2px 8px; }
.scorebadge {
  position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 10px; font-weight: 700;
  border-radius: 6px; padding: 2px 7px; background-color: var(--bg1); border: 1px solid var(--line-strong);
}
.scorebadge.hot { color: var(--ok); border-color: rgba(61,214,140,.4); }
.scorebadge.warm { color: var(--warn); border-color: rgba(255,197,61,.4); }
.scorebadge.cold { color: #B3170F; border-color: rgba(238,46,36,.4); }

/* ---------- workspace ---------- */
.ws-grid { display: grid; grid-template-columns: 220px 1fr 320px; gap: 20px; align-items: start; }
.ws-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ws-head h2 { font-size: 20px; margin: 0; }
.ws-head .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.status-banner { border-radius: 11px; padding: 11px 18px; font-weight: 700; margin-bottom: 16px; border: 1px solid; }
.status-banner.lost { background: rgba(238,46,36,.12); color: #B3170F; border-color: rgba(238,46,36,.35); }
.status-banner.won, .status-banner.closed { background: rgba(61,214,140,.1); color: var(--ok); border-color: rgba(61,214,140,.3); }

.stepper {
  background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px); padding: 14px 10px; position: sticky; top: 76px;
}
.step-item { display: flex; gap: 11px; padding: 10px 9px; border-radius: 10px; cursor: pointer; align-items: flex-start; transition: background .15s; }
.step-item:hover { background-color: var(--line); }
.step-item.current { background: rgba(238, 46, 36, .1); border: 1px solid rgba(238,46,36,.3); }
.step-item .dot {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background-color: var(--bg1);
  color: var(--grey); font-family: var(--mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-strong);
}
.step-item.current .dot { background-color: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 16px var(--red-glow); }
.step-item.done .dot { background-color: var(--slate); border-color: var(--slate); color: var(--ink); }
.step-item .t { font-size: 13px; font-weight: 650; line-height: 1.25; color: var(--ink-dim); }
.step-item.current .t, .step-item.done .t { color: var(--ink); }
.step-item .c { font-family: var(--mono); font-size: 9px; color: var(--grey); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

.stage-panel h2.stage-title { font-size: 19px; margin-bottom: 2px; }
.stage-sub { color: var(--grey); font-size: 13px; margin-bottom: 18px; }

/* agent banner */
.agentbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.agentbar .aname { font-size: 16px; font-weight: 800; letter-spacing: .01em; }
.agentbar .aname .emoji { margin-right: 6px; }
.agentbar .atag { color: var(--grey); font-size: 12.5px; font-style: italic; }

/* approval gate */
.gate {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 19px;
  margin: 16px 0; background-color: var(--bg1);
}
.gate .glabel { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--ink-dim); text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gate textarea { min-height: 76px; margin: 8px 0; }
.gate .actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.gate.approved { border-color: rgba(61,214,140,.45); background: rgba(61,214,140,.06); }
.gate.changes { border-color: rgba(238,46,36,.5); background: rgba(238,46,36,.07); }

/* decision diamond */
.decision {
  background-color: var(--panel-strong); border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; backdrop-filter: blur(14px);
}
.decision .q { font-weight: 750; font-size: 15.5px; display: flex; gap: 10px; align-items: center; }
.decision .q .diamond { color: var(--red); font-size: 18px; text-shadow: 0 0 12px var(--red-glow); }
.decision .actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.decision textarea { margin-top: 10px; }

/* transcript picker */
.tr-tabs { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; width: fit-content; }
.tr-tabs button { background: transparent; border: none; color: var(--grey); font-size: 12.5px; font-weight: 650; padding: 8px 16px; }
.tr-tabs button.active { background-color: var(--slate); color: #fff; }
.tr-fathom { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.tr-fathom .fgroup { margin: 0; flex: 1; min-width: 180px; }

/* artifacts */
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 11px; margin-top: 8px; }
.slide { background-color: var(--bg1); border: 1px solid var(--line); border-top: 3px solid var(--slate); border-radius: 10px; padding: 12px 14px; }
.slide .sn { font-family: var(--mono); font-size: 9px; color: var(--grey); letter-spacing: .1em; }
.slide .st { font-weight: 700; font-size: 13px; margin: 4px 0 7px; }
.slide ul { margin: 0; padding-left: 17px; font-size: 12px; color: var(--ink-dim); }
.taglist { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.kv { display: grid; grid-template-columns: 158px 1fr; gap: 7px 16px; font-size: 13.5px; margin: 8px 0; }
.kv dt { color: var(--grey); font-weight: 600; } .kv dd { margin: 0; color: var(--ink-dim); }
.kv dd b { color: var(--ink); }
.script { background-color: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 14px 17px; font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); }
.script b { color: var(--ink); }

/* doc job */
.docjob { display: flex; align-items: center; gap: 12px; background-color: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 11px 15px; margin: 8px 0; font-size: 13px; flex-wrap: wrap; }
.docjob .jicon { font-size: 17px; }
.docjob .jname { font-weight: 650; font-family: var(--mono); font-size: 11.5px; }
.docjob a { color: var(--ok); font-weight: 700; }

/* BANT panel */
.bantgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.bantcell { background-color: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.bantcell .bh { display: flex; align-items: baseline; gap: 8px; }
.bantcell .bl { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--grey); }
.bantcell .bs { font-size: 22px; font-weight: 800; }
.bantcell .bs.good { color: var(--ok); } .bantcell .bs.bad { color: #B3170F; }
.bantcell .be { font-size: 12px; color: var(--ink-dim); margin-top: 5px; }
.bantcell .bg { font-size: 11.5px; color: var(--warn); margin-top: 4px; }

/* right rail */
.rail .card { padding: 16px 18px; }
.rail h3 { font-size: 13px; }
.synclog { max-height: 360px; overflow-y: auto; }
.sl-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.sl-item .ic { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; background-color: var(--grey); }
.sl-item.ok .ic { background-color: var(--ok); box-shadow: 0 0 8px rgba(61,214,140,.6); }
.sl-item.error .ic { background-color: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.sl-item.simulated .ic { background-color: var(--warn); }
.sl-item .a { font-weight: 650; color: var(--ink-dim); }
.sl-item .d { color: var(--grey); font-size: 11.5px; }
.sl-item .ts { color: rgba(143,163,171,.55); font-family: var(--mono); font-size: 9px; }

/* radar (pipeline strength) */
.radarwrap { display: flex; gap: 14px; align-items: center; }
.radarwrap svg { flex: none; }
.radar-axes { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; }
.radar-axes .ax { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-dim); }
.radar-axes .ax .v { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.radar-axes .ax.na { opacity: .42; }
.strengthbar { height: 7px; border-radius: 4px; background-color: var(--bg1); margin: 10px 0 4px; overflow: hidden; border: 1px solid var(--line); }
.strengthbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--red), var(--warn) 55%, var(--ok)); }

/* logo image */
.logoimg { height: 26px; width: auto; display: block; }
.logoimg.big { height: 44px; margin-bottom: 4px; }

/* settings panel */
.settings-panel { max-width: 1560px; margin: 14px auto 0; padding: 0 30px; }

/* doc job progress */
.docjob { display: block; }
.docjob .jrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progressbar { height: 8px; border-radius: 5px; background-color: var(--bg1); border: 1px solid var(--line); overflow: hidden; margin-top: 8px; position: relative; }
.progressbar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--slate), var(--red)); transition: width .8s ease; box-shadow: 0 0 12px var(--red-glow); }
/* indeterminate shimmer for a running job that sits in a long phase (e.g. composing) */
.progressbar.indet::after { content: ""; position: absolute; top: 0; left: -40%; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--red-glow), transparent); animation: indetslide 1.3s ease-in-out infinite; }
@keyframes indetslide { from { left: -40%; } to { left: 100%; } }
.docjob .jdetail { font-family: var(--mono); font-size: 10px; color: var(--grey); margin-top: 5px; letter-spacing: .03em; }

/* topbar nav */
.topbar .nav { display: flex; gap: 4px; margin-left: 10px; }
.navbtn { background: transparent; border: 1px solid transparent; color: var(--grey); font-size: 13px; font-weight: 650; padding: 7px 13px; border-radius: 9px; }
.navbtn:hover { color: var(--ink); border-color: var(--line-strong); }

/* home / mission select */
.home-wrap { max-width: 980px; margin: 7vh auto 0; }
.home-head h2 { font-size: 26px; margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 26px; }
@media (max-width: 1180px) { .home-grid { grid-template-columns: 1fr 1fr; } }
.home-card {
  background-color: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 34px 32px; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s, opacity .2s; backdrop-filter: blur(16px);
  box-shadow: 0 12px 44px rgba(0,0,0,.35);
}
.home-card:hover { transform: translateY(-4px); border-color: rgba(238,46,36,.5); box-shadow: 0 18px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(238,46,36,.25); }
.home-card .hc-emoji { font-size: 44px; margin-bottom: 12px; }
.home-card h3 { font-size: 20px; }
.home-card p { color: var(--ink-dim); font-size: 14px; line-height: 1.55; min-height: 64px; }
.home-card.hawk { background: linear-gradient(160deg, rgba(238,46,36,.10), var(--panel-strong) 55%); }
.home-card.beacon { background: linear-gradient(160deg, rgba(255,197,61,.10), var(--panel-strong) 55%); }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } }

/* nighthawk mission control */
.nh-hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
  background-color: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; backdrop-filter: blur(14px);
}
.nh-cell label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.nh-big { font-family: var(--mono); font-size: 30px; font-weight: 800; color: var(--ink); margin: 4px 0; }
.nh-dim { color: var(--grey); font-size: 16px; font-weight: 600; }
.nh-mix { flex: 1; min-width: 220px; }
.flowrail { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-top: 10px; }
.fr-item { display: flex; gap: 11px; align-items: flex-start; background-color: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.fr-num { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--red); margin-top: 3px; }
.fr-icon { font-size: 17px; }
.fr-item b { font-size: 13px; }
.fr-item .muted { font-size: 11.5px; line-height: 1.45; }

/* economics strip */
.eco-strip { display: flex; align-items: stretch; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.eco-cell { flex: 1; min-width: 180px; background-color: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; }
.eco-cell label { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.eco-big { font-family: var(--mono); font-size: 24px; font-weight: 800; margin: 4px 0; }
.eco-arrow { align-self: center; color: var(--red); font-size: 20px; font-weight: 800; text-shadow: 0 0 10px var(--red-glow); }

/* usage panel */
.usagebox { margin: 0 0 16px; }
.usagebox summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink-dim); padding: 11px 18px; background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.usagebox summary:hover { color: var(--ink); }

/* structured ICP editors */
.prow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pnum {
  flex: none; min-width: 34px; text-align: center; font-family: var(--mono); font-size: 10.5px;
  font-weight: 700; color: var(--ink); background: #EEF3F7; border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 6px;
}
.pnum.red { background: rgba(238,46,36,.14); color: #B3170F; border-color: rgba(238,46,36,.3); }
.prow input { padding: 7px 10px; font-size: 13px; }
.prow .prow-del { padding: 4px 9px; flex: none; }
.stars { flex: none; cursor: pointer; user-select: none; letter-spacing: 1px; font-size: 16px; }
.stars i { font-style: normal; color: var(--warn); text-shadow: 0 0 8px rgba(255,197,61,.4); }
.stars i.off { color: rgba(143,163,171,.3); text-shadow: none; }
.stars i:hover { transform: scale(1.15); display: inline-block; }

/* nighthawk run phases */
.nh-phases { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.nh-phase { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.nh-phase.done { color: var(--ok); border-color: rgba(61,214,140,.4); }
.nh-phase.now { color: #fff; background-color: var(--red); border-color: var(--red); box-shadow: 0 0 12px var(--red-glow); animation: pulse 1.6s ease-in-out infinite; }
.nh-arrow { color: rgba(143,163,171,.4); font-size: 11px; }
.rv-detail td { background-color: var(--bg1); }

/* step architecture */
.stepline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepnum {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #FF4438, var(--red)); box-shadow: 0 0 14px var(--red-glow);
}
.stepline .aname { font-size: 15.5px; font-weight: 800; }
.stepline .aname .emoji { margin-right: 6px; }
.stepline .atag { color: var(--grey); font-size: 12px; font-style: italic; }
.card.locked { opacity: .45; pointer-events: none; filter: saturate(.6); }

/* ⚡ token report (leadership view) */
.trow { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.trow .card { margin-bottom: 0; }
.tk-bars { display: flex; align-items: flex-end; gap: 6px; margin-top: 14px; }
.tk-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tk-col {
  display: flex; flex-direction: column; justify-content: flex-end; width: 100%; max-width: 36px; height: 122px;
  background-color: var(--bg1); border: 1px solid var(--line); border-radius: 6px 6px 3px 3px; overflow: hidden;
}
.tk-seg { width: 100%; flex: none; }
.tk-seg.nh { background: linear-gradient(180deg, #FF4438, var(--red)); }
.tk-seg.pipe { background: linear-gradient(180deg, #4A6B78, var(--slate)); }
.tk-seg.docs { background: linear-gradient(180deg, #A4B6BD, var(--grey)); }
.tk-val { font-family: var(--mono); font-size: 9px; color: var(--ink-dim); height: 12px; line-height: 12px; }
.tk-day label { font-family: var(--mono); font-size: 9.5px; color: var(--grey); }
.tk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tk-dot.nh { background-color: var(--red); }
.tk-dot.pipe { background-color: var(--slate); }
.tk-dot.docs { background-color: var(--grey); }
.tk-share { margin-top: 14px; }
.tk-share-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 650; margin-bottom: 5px; }
.tk-share-track { height: 10px; background-color: var(--bg1); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tk-share-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.tk-share-fill.nh { background: linear-gradient(90deg, #B3221A, var(--red)); }
.tk-share-fill.pipe { background: linear-gradient(90deg, #2C424B, var(--slate)); }
.tk-share-fill.docs { background: linear-gradient(90deg, #6E828A, var(--grey)); }
.tk-share-fill.bc { background: linear-gradient(90deg, #C79A2A, var(--warn)); }
.tk-seg.bc { background: linear-gradient(180deg, #FFD66B, var(--warn)); }
.tk-dot.bc { background-color: var(--warn); }
.tk-month { cursor: pointer; }
.tk-month:hover { border-color: var(--line-strong); color: var(--ink); }

/* 🗞️ beacon (client newsletters · AI_Kallol) — two-report layout */
.bx-life {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background-color: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 14px; backdrop-filter: blur(12px);
}
.bx-stage {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 650; color: var(--ink-dim);
  background-color: var(--bg1); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
}
.bx-stage b { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.bx-stage.ok { border-color: rgba(61, 214, 140, .55); color: var(--ok); background: rgba(61, 214, 140, .10); }
.bx-stage.ok b { color: var(--ok); }
.bx-stage.warn { border-color: rgba(255, 197, 61, .45); color: var(--warn); background: rgba(255, 197, 61, .08); }
.bx-arrow { color: var(--red); font-weight: 800; font-size: 15px; }

/* ─── ambient animation layer (home + login) ─────────────────────────── */
@keyframes orbFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(46px, -34px) scale(1.07); } }
@keyframes orbFloat2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-38px, 30px) scale(.94); } }
@keyframes ringPulse { 0%, 100% { opacity: .10; transform: scale(1); } 50% { opacity: .22; transform: scale(1.05); } }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.home-bg, .login-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.home-bg { position: fixed; }
.home-wrap > *:not(.home-bg), .login-brand, .login-form-wrap { position: relative; z-index: 1; }
.orb { position: absolute; border-radius: 50%; filter: blur(58px); }
.orb.o1 { width: 480px; height: 480px; top: -140px; right: -90px; background: radial-gradient(circle, rgba(238,46,36,.55), transparent 66%); animation: orbFloat 14s ease-in-out infinite; }
.orb.o2 { width: 600px; height: 600px; bottom: -230px; left: -170px; background: radial-gradient(circle, rgba(74,123,144,.65), transparent 66%); animation: orbFloat2 19s ease-in-out infinite; }
.orb.o3 { width: 360px; height: 360px; top: 36%; left: 55%; background: radial-gradient(circle, rgba(255,197,61,.28), transparent 66%); animation: orbFloat 24s ease-in-out infinite reverse; }
.hb-ring { position: absolute; border-radius: 50%; border: 1px solid var(--line); animation: ringPulse 8s ease-in-out infinite; }
.hb-ring.hr1 { width: 640px; height: 640px; top: 6%; right: -190px; }
.hb-ring.hr2 { width: 400px; height: 400px; top: 20%; right: -60px; animation-delay: 3s; border-color: rgba(238,46,36,.22); }
.hb-sweep {
  position: absolute; width: 980px; height: 980px; top: -280px; right: -450px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(238,46,36,.12) 14deg, transparent 55deg);
  animation: sweep 30s linear infinite;
}

.home-wrap { position: relative; }
.home-head { animation: fadeUp .45s ease both; }
.home-card { animation: fadeUp .5s ease both; }
.home-grid .home-card:nth-child(2) { animation-delay: .09s; }
.home-grid .home-card:nth-child(3) { animation-delay: .18s; }
#home-eco { animation: fadeUp .55s ease both; animation-delay: .26s; }

#login-view { position: relative; overflow: hidden; }
.login-brand, .login-form-wrap { position: relative; z-index: 1; }
.flowlist .num { width: 26px; font-size: 14px; }
.flowlist .step { animation: fadeUp .5s ease both; }
.flowlist .step:nth-child(1) { animation-delay: .10s; }
.flowlist .step:nth-child(2) { animation-delay: .20s; }
.flowlist .step:nth-child(3) { animation-delay: .30s; }
.flowlist .step:nth-child(4) { animation-delay: .40s; }
.login-card { animation: fadeUp .55s ease both; animation-delay: .15s; }
.login-brand .compass, .login-brand p.lead { animation: fadeUp .5s ease both; }
.login-brand .rose { opacity: .22; }
.login-card { box-shadow: 0 18px 60px rgba(0,0,0,.45); }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 18px 60px rgba(0,0,0,.45); } 50% { box-shadow: 0 18px 70px rgba(238,46,36,.18); } }
.login-card { animation: fadeUp .55s ease both, glowPulse 6s ease-in-out 1s infinite; }
@media (prefers-reduced-motion: reduce) {
  .orb, .hb-ring, .hb-sweep, .login-brand .rose, .login-card { animation: none; }
}
.bc-frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 10px; background: #eef1f4; }
.bx-pick { width: 15px; height: 15px; accent-color: var(--red); }
.bx-preset { cursor: pointer; }
.bx-preset:hover { border-color: var(--line-strong); color: var(--ink); }
.bx-detail > td { background-color: var(--bg1); padding: 14px !important; }
.bx-panel { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.bx-side { width: 330px; flex: none; display: flex; flex-direction: column; }
.bx-side textarea { width: 100%; }
.bx-edit { padding: 5px 8px; font-size: 12.5px; border-radius: 6px; }
input.bx-edit::placeholder { color: var(--warn); }
.bx-matrix th, .bx-matrix td { padding: 6px 5px; text-align: center; }
.bx-matrix th.bx-sticky, .bx-matrix td.bx-sticky {
  position: sticky; left: 0; z-index: 1; text-align: left; min-width: 170px;
  background: #101F27; box-shadow: 2px 0 6px rgba(0,0,0,.35);
}
.bx-cell { cursor: pointer; font-size: 13px; border-radius: 5px; }
.bx-cell:hover { background: #EEF3F7; }
.bx-cell.cur { outline: 1px solid var(--red); outline-offset: -2px; }
.bx-cell.sel { background: rgba(238, 46, 36, .18); }
.bx-ovr { font-size: 9px; color: var(--warn); margin-left: 1px; vertical-align: super; }
.st-sent { color: var(--ok); font-weight: 800; }
.st-app { color: #4FA3E3; font-weight: 800; }
.st-draft { color: var(--warn); font-weight: 800; }
.st-plan { color: var(--grey); }
.st-skip { color: var(--red); font-weight: 800; }
.optstep { margin-bottom: 16px; }
.optstep summary { cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--ink-dim); padding: 12px 18px; background-color: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.optstep summary:hover { color: var(--ink); }
.optstep.locked { opacity: .45; pointer-events: none; }
.agentprog { margin: 10px 0 4px; }
textarea.cmt { min-height: 64px; }

/* meeting library */
.mlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.mitem { display: flex; align-items: center; gap: 8px; }
.mitem .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem .m-del { padding: 2px 8px; }
.adhoc-wrap { margin: 0 0 16px; background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; backdrop-filter: blur(10px); }
.adhoc-wrap summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink-dim); }
.adhoc-wrap summary:hover { color: var(--ink); }
.adhoc-wrap .card { margin: 12px 0 4px; }

/* score explainer */
.scorehelp { margin-top: 10px; }
.scorehelp summary { cursor: pointer; font-size: 11.5px; color: var(--grey); font-family: var(--mono); letter-spacing: .04em; }
.scorehelp summary:hover { color: var(--ink-dim); }
.scorehelp .shbody { font-size: 11.5px; color: var(--ink-dim); line-height: 1.5; background-color: var(--bg1); border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; margin-top: 8px; }
.scorehelp .shbody p { margin: 6px 0; }
.scorehelp .shbody b { color: var(--ink); }

.muted { color: var(--grey); font-size: 12.5px; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; } .frow .fgroup { flex: 1; min-width: 150px; }

/* calculator */
.rates-header { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.rates-header .rcell { background-color: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rates-header .rcell label { font-size: 10px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.calc-table td { padding: 5px 6px; }
.calc-table .del-row:hover { background-color: var(--line); }
.calc-table .auto { color: var(--grey); font-family: var(--mono); font-size: 11px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) { .ws-grid { grid-template-columns: 1fr; } .stepper { position: static; display: flex; flex-wrap: wrap; } }

/* ============================================================================
   TITAN UI LANGUAGE — light chrome (wireframes v1.0, 2026-06-29)
   Everything below re-points the rules that hard-coded the old dark console at
   the light palette above, and adds the rail + landing dashboard the deck
   specifies. Kept as one block so the retheme is reviewable — and reversible —
   in one place.
   Deck principles honoured: state is never colour alone (icon + text), controls
   are >= 24px with padding, one primary action per view, nothing clipped.
   ========================================================================= */

/* --- forms ------------------------------------------------------------- */
input, select, textarea { background-color: var(--panel); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
select option { background-color: var(--panel); color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--bg1); color: var(--grey); }

/* --- atoms ------------------------------------------------------------- */
/* Brand red is 4.16:1 behind white text — below the AA floor the deck sets.
   The button uses a darkened brand red (5.2:1); the red itself still carries
   accents, rules and section labels where it is not a text background. */
.btn-red { background-color: var(--red-btn); box-shadow: none; }
.btn-red:hover { background-color: var(--red-ink); }
.btn-navy { background-color: var(--navy); color: #fff; border: 1px solid var(--navy); }
.btn-navy:hover { background-color: var(--navy-hover); }
.btn-slate { background-color: var(--slate); color: #fff; }
.btn-ghost { background-color: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background-color: var(--bg1); }
.btn:focus-visible { outline: 3px solid rgba(83,141,213,.55); outline-offset: 2px; }

.chip { background-color: var(--bg1); color: var(--ink-dim); border: 1px solid var(--line); }
.chip.red { background-color: var(--red-bg); color: var(--red-ink); border-color: var(--red-line); }
.chip.navy { background-color: var(--navy); color: #fff; border-color: var(--navy); }
.chip.ok { background-color: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip.warn { background-color: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

.card {
  background-color: var(--panel); border: 1px solid var(--line);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 1px 2px rgba(31,41,51,.05);
}
.callout.note { background-color: var(--bg1); border-color: var(--line); }
.callout.warn { background-color: var(--red-bg); border-color: var(--red-line); }
.callout.info { background-color: var(--info-bg); border-color: var(--info-line); }
.callout.ok { background-color: var(--ok-bg); border-color: var(--ok-line); } .callout.ok .tag { background-color: var(--ok); }

.toast { background-color: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 24px rgba(31,41,51,.18); }
.toast.error { background-color: var(--red-ink); border-color: var(--red-ink); }
.muted { color: var(--grey); }

table.t th { background-color: var(--navy); color: #fff; border-bottom: none; }
table.t tr.total td { border-top: 2px solid var(--navy); }

/* --- shell: topbar + rail --------------------------------------------- */
.topbar {
  background-color: var(--navy); border-bottom: none; backdrop-filter: none;
  height: 62px; color: #fff;
}
.topbar .logoimg { height: 22px; }
.topbar .app-name { color: #B8C6CC; border-left-color: rgba(255,255,255,.22); }
.topbar .uchip { color: #E2E8F0; }
.topbar .btn-ghost { background: transparent; color: #E2E8F0; border-color: rgba(255,255,255,.28); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); }
.topbar .chip { background: rgba(255,255,255,.1); color: #E2E8F0; border-color: rgba(255,255,255,.2); }
.topbar .chip.ok { background: rgba(255,255,255,.12); color: #7EE2A8; border-color: rgba(126,226,168,.4); }

#main { padding: 24px 28px; max-width: none; }
.appfoot { background-color: var(--panel); border-top: 1px solid var(--line); color: var(--grey); }

/* --- landing dashboard (deck screen 1) --------------------------------- */
.dash-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-head h2 { font-size: 21px; margin: 0; }
.dash-head .grow { flex: 1; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background-color: var(--panel); }
.seg button {
  border: none; background-color: var(--panel); color: var(--ink); font-size: 13px; font-weight: 600;
  padding: 8px 14px; min-height: 34px; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: none; }
.seg button:hover { background-color: var(--bg1); }
.seg button.on { background-color: var(--navy); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile .tl { font-size: 12px; color: var(--grey); font-weight: 600; }
.tile .tv { font-size: 27px; font-weight: 700; color: var(--navy); margin-top: 4px; line-height: 1.15; }
.tile .tn { font-size: 11.5px; color: var(--grey); margin-top: 3px; }

.opp-table-wrap { background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.opps { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.opps th {
  background-color: var(--navy); color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 10px 14px; white-space: nowrap;
}
table.opps th.num, table.opps td.num { text-align: right; }
table.opps td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.opps tbody tr { cursor: pointer; }
table.opps tbody tr:hover { background-color: var(--bg1); }
table.opps tbody tr:focus-visible { outline: 3px solid rgba(83,141,213,.55); outline-offset: -3px; }
table.opps tr.total td { font-weight: 700; background-color: var(--bg1); border-top: 2px solid var(--navy); border-bottom: none; }
table.opps .co { font-weight: 650; color: var(--ink); }
table.opps .sub { font-size: 12px; color: var(--grey); margin-top: 2px; }
table.opps .stg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
table.opps .stg .n {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: #fff; background-color: var(--navy);
  border-radius: 4px; padding: 2px 6px; flex: none;
}
table.opps .stg.beyond .n { background-color: var(--grey); }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.status .dot { font-size: 11px; }
.status.active { color: var(--blue); }
.status.won { color: var(--ok); }
.status.lost { color: var(--red-ink); }
.empty-state { padding: 40px 24px; text-align: center; color: var(--grey); }

/* --- workspace --------------------------------------------------------- */
.ws-head h2 { color: var(--navy); }
.stepper { background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.step-item .dot { border-color: var(--line-strong); }

/* --- login ------------------------------------------------------------- */
#login-view { background-color: var(--bg0); }
.login-brand { background-color: var(--navy); color: #fff; }
.login-brand .logo, .login-brand .compass { color: #fff; }
.login-brand p.lead, .flowlist .step { color: #CBD2D9; }
.login-brand .tagline, .login-brand .foot { color: var(--placeholder); }
.login-card { background-color: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 20px rgba(31,41,51,.08); backdrop-filter: none; }
.check-row { background-color: var(--bg1); border-color: var(--line); }
.settings-panel .card { box-shadow: 0 8px 30px rgba(31,41,51,.12); }

/* --- pipeline strength: card sparkline + scorebadge on the light theme --- */
.scorebadge.hot { color: var(--ok); border-color: var(--ok-line); background-color: var(--ok-bg); }
.scorebadge.warm { color: var(--warn); border-color: var(--warn-line); background-color: var(--warn-bg); }
.scorebadge.cold { color: var(--red-ink); border-color: var(--red-line); background-color: var(--red-bg); }
.strengthbar { height: 6px; border-radius: 3px; background-color: var(--line); overflow: hidden; margin-top: 12px; }
.strengthbar i { display: block; height: 100%; background-color: var(--red-btn); }
/* Five bars per card — the same axes as the radar, so a card shows WHY it
   scores what it does. Hollow = the axis cannot apply at this stage yet. */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 22px; margin: 8px 0 2px; }
.spark i { flex: 1; background-color: var(--navy); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .8; }
.spark i.na { background: transparent; border: 1px dashed var(--line-strong); }
.kcard:hover .spark i { opacity: 1; }

/* ============================================================================
   DARK THEME — same approach as the Nighthawk console.
   Every surface draws from --panel / --bg0 / --bg1 and every text tint from
   --ink / --grey, so a theme is just a different set of tokens. An explicit
   choice lives on html[data-theme] and beats the operating system; with nothing
   chosen, the @media block below follows the OS.
   Text tints are LIFTED for the dark ground — the light theme's inks are
   unreadable here (--grey #64748B would be about 1.9:1 on --panel).
   ========================================================================= */
html[data-theme='dark'] {
  --bg0: #0E1519;
  --bg1: #1C2A33;
  --ink: #E8EEF1;
  --ink-dim: #A9B8C0;
  --grey: #A9B8C0;
  --panel: #16232B;
  --panel-strong: #1C2A33;
  --line: #26343D;
  --line-strong: #5C7484;
  --navy: #1B2A3A;
  --navy-hover: #24384C;
  --slate: #5C7484;
  --ok: #4FC98B;
  --warn: #E7B65C;
  --blue: #7FB1E8;
  --red-ink: #FF7C72;
  --red-btn: #D42219;
  --red-bg: #3A1D1B;   --red-line: #5E2B27;
  --ok-bg: #123326;    --ok-line: #1E5138;
  --warn-bg: #33280F;  --warn-line: #55431B;
  --info-bg: #17283A;  --info-line: #24405C;
  --placeholder: #7C8B96;
  --on-navy: #E8EEF1;
  color-scheme: dark;
}

/* Follow the operating system until the user picks a side. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg0: #0E1519; --bg1: #1C2A33;
    --ink: #E8EEF1; --ink-dim: #A9B8C0; --grey: #A9B8C0;
    --panel: #16232B; --panel-strong: #1C2A33;
    --line: #26343D; --line-strong: #5C7484;
    --navy: #1B2A3A; --navy-hover: #24384C; --slate: #5C7484;
    --ok: #4FC98B; --warn: #E7B65C; --blue: #7FB1E8;
    --red-ink: #FF7C72; --red-btn: #D42219;
    --red-bg: #3A1D1B; --red-line: #5E2B27;
    --ok-bg: #123326; --ok-line: #1E5138;
    --warn-bg: #33280F; --warn-line: #55431B;
    --info-bg: #17283A; --info-line: #24405C;
    --placeholder: #7C8B96; --on-navy: #E8EEF1;
    color-scheme: dark;
  }
}

/* Surfaces that were stated as literal white/near-white before the theme
   existed, re-pointed at the tokens so they flip with it. */
input, select, textarea { background-color: var(--panel); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
select option { background-color: var(--panel); color: var(--ink); }
.btn-ghost { background-color: var(--panel); color: var(--ink); }
.rail, .kcol, .tile, .opp-table-wrap, .stepper, .appfoot { background-color: var(--panel); }
.kcard { background-color: var(--panel); }
table.opps th, table.t th { color: var(--on-navy); }
.topbar { color: var(--on-navy); }

/* The theme button itself — states which theme you would switch TO, in words as
   well as an icon, because state carried by a symbol alone cannot be read out. */
.theme-tog {
  background: transparent; border: 1px solid rgba(255,255,255,.28); color: #E2E8F0;
  border-radius: 8px; padding: 6px 11px; font-size: 13px; line-height: 1.4;
  cursor: pointer; min-height: 30px; min-width: 30px;
}
.theme-tog:hover { background: rgba(255,255,255,.1); }
.theme-tog:focus-visible { outline: 3px solid rgba(83,141,213,.55); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
