/* Fonts (SIL Open Font License), served from HQ itself so they work offline in the phone app */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }
/* AXIS HQ — dashboard styles (same colours as AXIS) */
:root {
  --bg: #080a0c; --bg2: #0b0e12; --card: #0e1115; --card2: #131820; --border: #1c2330; --border2: #283142;
  --text: #e8edf5; --muted: #8a96a8; --dim: #5b6779; --accent: #22c55e; --accent-dim: rgba(34,197,94,.12);
  --red: #ef4444; --amber: #f59e0b; --blue: #38bdf8; --purple: #a78bfa;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .mono { font-family: var(--mono); }
.pos { color: var(--accent); } .neg { color: var(--red); } .warn { color: var(--amber); }

/* icons (inline SVG drawn by app.js) */
i[data-i] { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; }
i[data-i] svg { width: 100%; height: 100%; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(800px 400px at 50% 0%, rgba(34,197,94,.08), transparent); }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login-card input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border2); background: var(--bg); }
.login-card input:focus { outline: none; border-color: var(--accent); }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 1.5px; font-size: 15px; padding: 0 8px 14px; flex-wrap: wrap; }
.brand b { color: var(--accent); }
.brand .sub { width: 100%; font-size: 10px; letter-spacing: 1.5px; color: var(--dim); font-weight: 700; text-transform: uppercase; margin-left: 26px; margin-top: -4px; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), #15803d); box-shadow: 0 0 12px rgba(34,197,94,.4); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: var(--card2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.badge.red { background: var(--red); color: #fff; }
.badge { margin-left: auto; background: var(--amber); color: #000; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; }
.side-h { margin: 22px 10px 8px; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.side-agents { display: flex; flex-direction: column; gap: 4px; }
.side-agent { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.side-agent:hover { background: var(--card); }
.side-agent .av { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--card2); border: 1px solid var(--border2); }
.side-agent .nm { font-weight: 600; } .side-agent .st { font-size: 10.5px; color: var(--dim); }
.side-agent .stat { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border2); color: var(--dim); white-space: nowrap; }
.side-agent .stat.ok { color: var(--accent); border-color: rgba(34,197,94,.35); }
.side-agent .stat.bad { color: var(--red); border-color: rgba(239,68,68,.35); }
.side-agent .stat.busy { color: var(--amber); border-color: rgba(245,158,11,.35); }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 11.5px; color: var(--dim); }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(8,10,12,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border2); color: var(--muted); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.pill.live.busy .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.25); animation: pulse 1.2s infinite; }
.pill.live.ok .dot { background: var(--accent); }
@keyframes pulse { 50% { opacity: .4; } }
.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.icon-btn { background: none; border: 1px solid var(--border2); border-radius: 8px; width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.menu-btn { display: none; }
.page { padding: 24px; max-width: 1240px; }

/* headings */
.h1 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 0; line-height: 1.15; }
.h1 em { font-style: normal; color: var(--accent); }
.lede { color: var(--muted); margin: 6px 0 0; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sec-h { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); font-weight: 700; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.sec-h .live-tag { color: var(--accent); }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.card-p { padding: 16px 18px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.kpi .k { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-family: var(--mono); font-size: 24px; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.kpi .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .bar { height: 3px; border-radius: 3px; background: var(--border); margin-top: 8px; overflow: hidden; }
.kpi .bar > span { display: block; height: 100%; background: var(--accent); }
.hero { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(90deg, rgba(34,197,94,.1), rgba(34,197,94,.02)); border: 1px solid rgba(34,197,94,.25); margin-bottom: 12px; }
.hero .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(34,197,94,.15); color: var(--accent); font-weight: 800; }
.hero .t { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero .v { font-size: 15px; font-weight: 600; }

.banner { padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; border: 1px solid var(--border2); background: var(--card); line-height: 1.55; }
.banner.warn { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.07); }
.banner.err { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.07); }
.banner.info { border-color: rgba(56,189,248,.3); background: rgba(56,189,248,.06); }

/* agent network */
.net { position: relative; padding: 18px; }
.net-ceo { max-width: 460px; margin: 0 auto 26px; position: relative; }
.net-lines { position: absolute; inset: 0; pointer-events: none; }
.agents { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.agent { background: var(--card2); border: 1px solid var(--border2); border-radius: 11px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.agent.ceo { border-color: rgba(167,139,250,.4); background: linear-gradient(180deg, rgba(167,139,250,.08), var(--card2)); }
.agent .a-h { display: flex; align-items: center; gap: 8px; }
.agent .av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--bg); border: 1px solid var(--border2); flex-shrink: 0; }
.agent .nm { font-weight: 700; font-size: 13px; } .agent .rl { font-size: 10.5px; color: var(--dim); line-height: 1.3; }
.agent .sum { font-size: 12px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 52px; }
.agent .a-f { display: flex; align-items: center; gap: 6px; margin-top: auto; font-size: 11px; color: var(--dim); }
.agent .a-f .btn { margin-left: auto; }
.agent.off { opacity: .5; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex-shrink: 0; }
.st-dot.ok { background: var(--accent); } .st-dot.bad { background: var(--red); } .st-dot.busy { background: var(--amber); animation: pulse 1s infinite; }

/* three things */
.three { display: flex; flex-direction: column; gap: 8px; }
.thing { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.thing.done { opacity: .55; border-left-color: var(--dim); }
.thing.done .tt { text-decoration: line-through; }
.thing .num { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.thing .tt { font-weight: 700; } .thing .td { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; margin-top: 2px; }
.chk { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border2); background: var(--bg); cursor: pointer; flex-shrink: 0; display: grid; place-items: center; color: #000; margin-top: 1px; }
.chk.on { background: var(--accent); border-color: var(--accent); }

/* log */
.log { font-family: var(--mono); font-size: 11.5px; max-height: 300px; overflow-y: auto; padding: 8px 14px; }
.log-l { display: grid; grid-template-columns: 62px 70px minmax(0, 1fr); gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,.03); }
.log-l .t { color: var(--dim); } .log-l .a { color: var(--blue); } .log-l.warn .x { color: var(--amber); } .log-l.error .x { color: var(--red); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border2); background: var(--card2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #000; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
input.i, select.i, textarea.i { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border2); background: var(--bg); color: var(--text); font-size: 13.5px; }
textarea.i { resize: vertical; line-height: 1.55; }
input.i:focus, select.i:focus, textarea.i:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border2); cursor: pointer; transition: .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 19px; }

/* tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.tabs button.on { background: var(--card2); color: var(--text); }
.tabs button b { font-size: 11px; margin-left: 4px; color: var(--amber); }

/* approvals */
.draft { padding: 16px 18px; }
.draft + .draft { border-top: 1px solid var(--border); }
.d-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.d-to { font-weight: 700; } .d-email { color: var(--muted); font-size: 12.5px; }
.chip { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border2); color: var(--muted); white-space: nowrap; }
.chip.green { color: var(--accent); border-color: rgba(34,197,94,.35); } .chip.amber { color: var(--amber); border-color: rgba(245,158,11,.4); }
.chip.red { color: var(--red); border-color: rgba(239,68,68,.4); } .chip.blue { color: var(--blue); border-color: rgba(56,189,248,.4); } .chip.purple { color: var(--purple); border-color: rgba(167,139,250,.4); }
.d-why { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.d-quote { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--border2); padding: 6px 12px; margin-bottom: 10px; white-space: pre-wrap; max-height: 160px; overflow-y: auto; background: var(--bg2); border-radius: 0 8px 8px 0; }
.d-subj { margin-bottom: 8px; font-weight: 600; }
.d-f { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.d-f .when { margin-left: auto; font-size: 11.5px; color: var(--dim); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* reports (simple markdown) */
.md { font-size: 13.5px; line-height: 1.65; color: #cdd5e1; }
.md h2 { font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--accent); margin: 18px 0 6px; }
.md h3 { font-size: 14px; margin: 16px 0 4px; color: var(--text); }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 10px; white-space: pre-wrap; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin-bottom: 3px; }
.md strong { color: var(--text); }
.rep { margin-bottom: 12px; }
.rep .card-h .av { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--bg); border: 1px solid var(--border2); }
.rep-sum { font-size: 13px; color: var(--text); font-weight: 600; padding: 12px 16px 0; }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.days button { background: var(--card); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: var(--mono); }
.days button.on { border-color: var(--accent); color: var(--text); }

/* content */
.hook { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.hook:last-child { border-bottom: 0; }
.hook .q { font-weight: 600; flex: 1; } .hook .why { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.script { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.script:last-child { border-bottom: 0; }
.script pre { white-space: pre-wrap; font: 13.5px/1.6 var(--font); margin: 8px 0; color: #d4dbe6; background: var(--bg2); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { text-align: left; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t td.n { font-family: var(--mono); text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* numbers */
.chart { padding: 12px 14px; }
.chart .ct { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); font-weight: 700; display: flex; justify-content: space-between; }
.chart .cv { font-family: var(--mono); font-size: 20px; font-weight: 700; margin: 2px 0 6px; }
.chart svg { width: 100%; height: 90px; display: block; }
.funnel { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.fstep { display: grid; grid-template-columns: 140px minmax(0, 1fr) 80px; gap: 10px; align-items: center; font-size: 13px; }
.fbar { height: 22px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.fbar > span { display: block; height: 100%; background: linear-gradient(90deg, #15803d, var(--accent)); border-radius: 6px; }
.fstep .fn { font-family: var(--mono); text-align: right; } .fstep .fn small { color: var(--dim); }

/* goals */
.goal { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.goal:last-child { border-bottom: 0; }
.goal .gh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.goal .gt { font-weight: 700; } .goal .gn { margin-left: auto; font-family: var(--mono); }
.gbar { height: 8px; border-radius: 6px; background: var(--bg2); margin-top: 8px; overflow: hidden; }
.gbar > span { display: block; height: 100%; background: var(--accent); }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .tt { font-weight: 600; } .task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .td { font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.task .tr { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* vault & settings */
.vs { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.vs:last-child { border-bottom: 0; }
.vs .vh { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.vs .vt { font-weight: 700; } .vs .vd { font-size: 12px; color: var(--dim); }
.conn { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.conn:last-child { border-bottom: 0; }
.conn .cn { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.set { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.set:last-child { border-bottom: 0; }
.set .sl { flex: 1; min-width: 0; } .set .sl b { display: block; font-size: 13.5px; } .set .sl span { font-size: 12px; color: var(--muted); }
.set .sv { width: 160px; flex-shrink: 0; }

/* toast & modal */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--border2); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
.toast.ok { border-color: rgba(34,197,94,.5); } .toast.bad { border-color: rgba(239,68,68,.5); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--card); border: 1px solid var(--border2); border-radius: 14px; width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; padding: 20px; }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .agents { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 20px 0 40px rgba(0,0,0,.5); }
  .menu-btn { display: inline-grid; }
  .page { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .clock { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .h1 { font-size: 24px; }
  .fstep { grid-template-columns: 110px minmax(0, 1fr) 64px; }
  .set { flex-wrap: wrap; } .set .sv { width: 100%; }
  .log-l { grid-template-columns: 54px minmax(0, 1fr); } .log-l .a { display: none; }
}
@media (max-width: 480px) { .agents { grid-template-columns: 1fr; } .kpi .v { font-size: 20px; } }

/* ── phone app ─────────────────────────────────────────────── */
html { -webkit-tap-highlight-color: transparent; }
body { padding-top: env(safe-area-inset-top); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: none; background: rgba(11,14,18,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--dim); font-size: 10.5px; font-weight: 600; position: relative; padding: 4px 0; }
.tabbar a i[data-i] { width: 21px; height: 21px; }
.tabbar a.on { color: var(--accent); }
.tb-badge { position: absolute; top: 0; left: 50%; margin-left: 6px; background: var(--amber); color: #000; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px; }
.tb-badge.red { background: var(--red); color: #fff; }
.install { display: flex; gap: 12px; align-items: center; }
.install img { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; }
@media (max-width: 860px) {
  .tabbar:not([hidden]) { display: flex; }
  .page { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .topbar { top: 0; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .head .right { width: 100%; }
  .head .right .btn { flex: 1; }
}
@media (display-mode: standalone) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } body { padding-top: 0; } }
@media (max-width: 860px) {
  .set > .row { width: 100%; }
  .set > .row .btn { flex: 1; }
  #mode-pill { display: none !important; }
}

/* ════════════════════════════════════════════════════════════
   HQ look, v3: a trader's desk. Graphite chart-pane background,
   AXIS lime from the logo, silver condensed headings like the
   logo's "A", and a quote board for the business numbers.
   ════════════════════════════════════════════════════════════ */
:root {
  --bg: #0f1318; --bg2: #12171d; --card: #161c23; --card2: #1c232c; --border: #242c37; --border2: #313b48;
  --text: #e9edf2; --muted: #95a1b1; --dim: #66727f;
  --accent: #8ccf2a; --accent-dim: rgba(140,207,42,.12); --red: #f05d5e; --amber: #f2b33d; --blue: #5ab8f0; --purple: #b39cf5;
  --font: 'Barlow', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', Arial Narrow, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --silver: linear-gradient(180deg, #ffffff 0%, #d9dee4 45%, #9aa5b1 100%);
  --r: 14px;
}
html, body { font: 15px/1.5 var(--font); }
body { background-color: var(--bg);
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px), radial-gradient(1200px 500px at 70% -10%, rgba(140,207,42,.07), transparent 60%);
  background-size: 36px 36px, 36px 36px, 100% 100%; background-attachment: fixed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* brand + navigation */
.brand { font-family: var(--cond); font-size: 22px; letter-spacing: .5px; gap: 10px; }
.brand b { color: var(--text); font-weight: 700; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: url(/icons/icon-192.png) center/cover; box-shadow: none; }
.brand .sub { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; margin-left: 40px; color: var(--dim); }
.side { background: rgba(16,20,25,.92); }
.nav a { font-size: 14.5px; padding: 9px 10px; }
.nav a.on { background: var(--card2); box-shadow: inset 3px 0 0 var(--accent); }
.side-h { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--dim); }
.crumb { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.topbar { background: rgba(15,19,24,.82); }
.clock { font-family: var(--cond); font-size: 15px; letter-spacing: .5px; }

/* type: silver condensed headings, sentence case labels */
.h1 { font-family: var(--cond); font-weight: 700; font-size: 40px; letter-spacing: .2px; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h1 em { color: inherit; -webkit-text-fill-color: transparent; }
.lede { font-size: 15px; max-width: 70ch; }
.sec-h { text-transform: none; letter-spacing: 0; font-family: var(--cond); font-size: 21px; font-weight: 600; color: var(--text); margin: 30px 0 12px; }
.sec-h .live-tag { font-family: var(--font); font-size: 12.5px; }
.card-h { font-family: var(--cond); font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.kpi .k, .chart .ct, .stat-label, table.t th, .wk-stats span { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi .v, .chart .cv { font-family: var(--cond); font-size: 30px; font-weight: 600; letter-spacing: .3px; }
.chip { text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 600; }
.hero .t { text-transform: none; letter-spacing: 0; font-size: 13px; }
.md h2 { text-transform: none; letter-spacing: 0; font-family: var(--cond); font-size: 18px; font-weight: 600; color: var(--accent); }
td.n, .fstep .fn, .gn, .q-v { font-family: var(--cond); font-size: 15px; letter-spacing: .3px; }
.log { font-family: var(--mono); }

/* surfaces */
.card, .kpi { background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 40%), var(--card); border-color: var(--border); }
.btn { border-radius: 10px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0f04; }
.banner { border-radius: 12px; }
.badge { background: var(--amber); }
.st-dot.ok { background: var(--accent); box-shadow: 0 0 0 3px rgba(140,207,42,.15); }
.st-dot.bad { box-shadow: 0 0 0 3px rgba(240,93,94,.18); }
.switch input:checked + span { background: var(--accent); }

/* ── Command center ── */
.cc-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin: 4px 0 18px; }
.cc-hi { margin: 0; font-family: var(--cond); font-weight: 700; font-size: clamp(40px, 5vw, 60px); line-height: 1; letter-spacing: .2px; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cc-sub { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; max-width: 70ch; }
.cc-act { margin-left: auto; display: flex; gap: 10px; }

/* the quote board: the one bold thing on the page */
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border2); border-radius: var(--r); overflow: hidden; background: #11161c; margin-bottom: 14px; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.q { padding: 14px 16px 12px; border-left: 1px solid var(--border); min-width: 0; position: relative; }
.q:first-child { border-left: 0; }
.q-k { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-v { font-size: 34px !important; font-weight: 600; line-height: 1.1; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--text); }
.mv { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.mv.up { color: var(--accent); } .mv.dn { color: var(--red); } .mv.flat { color: var(--dim); font-size: 12.5px; }
.q-s { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spk { width: 100%; height: 28px; display: block; margin: 6px 0 4px; }
.spk .l { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.spk .a { fill: rgba(140,207,42,.10); stroke: none; }
.spk circle { fill: var(--accent); }
.spk.dn .l { stroke: var(--red); } .spk.dn .a { fill: rgba(240,93,94,.10); } .spk.dn circle { fill: var(--red); }

.cc-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-top: 4px; }
.cc-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 14px; }
.today { padding: 18px 20px 20px; }
.today-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.today-h h2 { margin: 0; font-family: var(--cond); font-size: 24px; font-weight: 600; margin-right: auto; }
.prog { width: 90px; height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.prog > span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.thing { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 16px; }
.thing .tt { font-size: 16px; }
.thing .td { font-size: 13.5px; line-height: 1.5; margin-top: 4px; }
.chk { width: 24px; height: 24px; border-radius: 7px; }
.chk.on { background: var(--accent); border-color: var(--accent); color: #0b0f04; }
.chk:hover { border-color: var(--accent); }
.side-stack { display: flex; flex-direction: column; gap: 10px; }
.mini { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); text-decoration: none; transition: border-color .15s; }
.mini:hover { border-color: var(--border2); }
.mini b { display: block; font-size: 14.5px; } .mini span { display: block; font-size: 12.5px; color: var(--muted); }
.mini-n { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-family: var(--cond); font-size: 24px; font-weight: 700; background: var(--accent-dim); color: var(--accent); }
.mini-n.sm { font-size: 16px; }
.mini.warn .mini-n { background: rgba(242,179,61,.14); color: var(--amber); }
.mini.bad { border-color: rgba(240,93,94,.45); } .mini.bad .mini-n { background: rgba(240,93,94,.14); color: var(--red); }

/* the team: CEO on top, wired to the five specialists */
.desk { margin-top: 18px; }
.desk-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.desk-h h2 { margin: 0; font-family: var(--cond); font-size: 24px; font-weight: 600; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 4px; animation: pulse 1.1s infinite; }
.net { position: relative; padding: 18px; border: 1px solid var(--border); border-radius: var(--r); background: radial-gradient(600px 220px at 50% 0%, rgba(179,156,245,.07), transparent 70%), rgba(17,22,28,.7); }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wires path { fill: none; stroke: var(--border2); stroke-width: 1.5; stroke-dasharray: 4 5; }
.net.busy .wires path { stroke: var(--amber); animation: flow 1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -18; } }
.net-ceo { max-width: 480px; margin: 0 auto 34px; position: relative; z-index: 1; }
.agents { position: relative; z-index: 1; }
.agent { border-radius: 12px; background: var(--card2); }
.agent .av { width: 34px; height: 34px; border-radius: 10px; font-family: var(--cond); font-size: 15px; }
.agent.ceo { border-color: rgba(179,156,245,.45); background: linear-gradient(180deg, rgba(179,156,245,.10), var(--card2) 60%); }
.agent .sum { font-size: 13px; min-height: 58px; }
.agent .a-f .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent .a-f .btn { margin-left: 0; }

/* other pages */
.draft { border-radius: 0; }
.d-to { font-size: 15.5px; }
.tabs button { font-size: 13.5px; }
.goal .gt { font-size: 15px; }
.gbar > span, .fbar > span { background: linear-gradient(90deg, #5c9a14, var(--accent)); }
.chart svg path[stroke] { stroke: var(--accent); }
.wk-bar-range { font-family: var(--cond); }
.login-card { background: var(--card); }
.login-card .brand { justify-content: center; font-size: 26px; }
.login-card .brand-mark { width: 40px; height: 40px; }

@media (max-width: 1180px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } .q:nth-child(4) { border-left: 0; } .q:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 860px) {
  .cc-grid, .cc-grid.two { grid-template-columns: 1fr; }
  .cc-act { width: 100%; } .cc-act .btn { flex: 1; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q:nth-child(odd) { border-left: 0; } .q:nth-child(4) { border-left: 1px solid var(--border); } .q:nth-child(n+3) { border-top: 1px solid var(--border); }
  .q-v { font-size: 28px !important; }
  .h1 { font-size: 32px; }
  .net-ceo { margin-bottom: 16px; } .wires { display: none; }
}

@media (max-width: 860px) { .today-h { flex-wrap: wrap; } .today-h h2 { width: 100%; font-size: 22px; } .today-h .prog { flex: 1; } }

/* data packets travelling between the CEO and the agents */
.wires .pkt { opacity: 0; }
.wires .pkt.up { fill: var(--accent); filter: drop-shadow(0 0 4px rgba(140,207,42,.9)); }
.wires .pkt.down { fill: var(--purple); filter: drop-shadow(0 0 4px rgba(179,156,245,.9)); }
.net.busy .wires .pkt.up, .net.busy .wires .pkt.down { fill: var(--amber); filter: drop-shadow(0 0 6px rgba(242,179,61,1)); }
/* speed chart */
.speed { display: flex; align-items: center; gap: 22px; padding: 18px 20px; flex-wrap: wrap; }
.speed-n { font-family: var(--cond); font-size: 64px; font-weight: 700; line-height: 1; }
.speed-n small { font-size: 20px; color: var(--dim); margin-left: 2px; }
.speed-c { flex: 1; min-width: 240px; }
.speed-c svg { width: 100%; height: 110px; display: block; }
.speed-c .l { fill: none; stroke: var(--accent); stroke-width: 2; } .speed-c .a { fill: rgba(140,207,42,.08); } .speed-c .g { stroke: var(--border); stroke-dasharray: 3 4; }
.speed-k { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; }
.speed-k b { color: var(--text); }
.modal-card { background: var(--card); border-color: var(--border2); }
