/* Base reset (was supplied by the hosting page) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout: ink brand bar with the Kings lockup + gold-pill tabs, then a working canvas; shift review = guard queue (main) + site rail (aside).
   Palette and type from the Kings Security brand guidelines v1.0: ink #0A131C, gold #FFBD49, light gold #FEE59D, off-white #FAFBFF, grayscale Cloud→Phantom; Manrope. */
:root {
  --ink: #0A131C;        /* brand primary 03: bar, strong buttons */
  --ink-2: #121D29;
  --gold: #FFBD49;       /* brand primary 02: active tab, primary action */
  --gold-soft: #FEE59D;  /* brand primary 04 */
  --gold-ink: #9A6406;   /* gold as text on light grounds */
  --on-gold: #0A131C;
  --bg: #EDEFF7;         /* Cloud */
  --surface: #FAFBFF;    /* brand primary 01 */
  --surface-2: #F3F4FA;
  --line: #D3D6E0;       /* Smoke */
  --line-2: #BCBFCC;     /* Steel */
  --fg: #0A131C;
  --muted: #6E7180;      /* Graphite */
  --faint: #9DA2B3;      /* Space */
  --strong: #0A131C; --on-strong: #FAFBFF;
  --crit: #B4322A; --crit-bg: #FBE9E7;
  --warn: #9A5D00; --warn-bg: #FFF1D6;
  --ok: #24724A;   --ok-bg: #E3F3EA;
  --info: #3C5F93; --info-bg: #E7EDF7;
  --focus: #2F6FDB;
  --f-ui: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #0A131C; --ink-2: #121D29; --gold: #FFBD49; --gold-soft: #FEE59D; --gold-ink: #FFCB6E; --on-gold: #0A131C;
  --bg: #0A131C; --surface: #111B26; --surface-2: #16212E; --line: #253140; --line-2: #40424D;
  --fg: #FAFBFF; --muted: #BCBFCC; --faint: #9DA2B3; --strong: #FFBD49; --on-strong: #0A131C;
  --crit: #F2786E; --crit-bg: #3A1A1A; --warn: #FFCB6E; --warn-bg: #33270F; --ok: #6FCB95; --ok-bg: #12301F; --info: #93B4E6; --info-bg: #172539;
  --focus: #7AA7FF; color-scheme: dark; } }
:root[data-theme="dark"] {
  --ink: #0A131C; --ink-2: #121D29; --gold: #FFBD49; --gold-soft: #FEE59D; --gold-ink: #FFCB6E; --on-gold: #0A131C;
  --bg: #0A131C; --surface: #111B26; --surface-2: #16212E; --line: #253140; --line-2: #40424D;
  --fg: #FAFBFF; --muted: #BCBFCC; --faint: #9DA2B3; --strong: #FFBD49; --on-strong: #0A131C;
  --crit: #F2786E; --crit-bg: #3A1A1A; --warn: #FFCB6E; --warn-bg: #33270F; --ok: #6FCB95; --ok-bg: #12301F; --info: #93B4E6; --info-bg: #172539;
  --focus: #7AA7FF; color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font: 500 14px/1.5 var(--f-ui); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-variant-numeric: tabular-nums; font-size: .95em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* brand bar */
.top { background: var(--ink); color: #FAFBFF; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; border-bottom: 1px solid #1E2A38; }
@media (max-width: 700px) { .top { position: static; } }
.top .wrap { display: flex; align-items: center; gap: 12px 22px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { display: block; height: 48px; width: auto; }
.brand .mark { display: none; height: 40px; }
.brand .sep { width: 1px; height: 30px; background: rgba(250,251,255,.18); }
.brand .app { font-weight: 700; font-size: 15px; color: #FAFBFF; letter-spacing: .01em; }
.brand .app small { display: block; font-size: 11px; font-weight: 600; color: #9DA2B3; letter-spacing: .02em; }
@media (max-width: 520px) { .brand .full { display: none; } .brand .mark { display: block; } }
.tabs { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding: 2px; }
.tab { background: none; border: 0; color: #BCBFCC; padding: 8px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; border-radius: 10px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tab:hover { color: #FAFBFF; background: rgba(250,251,255,.06); }
.tab[aria-selected="true"] { color: #0A131C; background: #FFBD49; }
.tab .ct { background: #B4322A; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 17px; font-weight: 800; }
.tab[aria-selected="true"] .ct { background: #0A131C; color: #FFBD49; }
.upbtn { flex: none; }
@media (max-width: 1100px) { .tabs { order: 3; margin-left: 0; width: 100%; } .upbtn { margin-left: auto; } }
.status { background: var(--ink-2); color: #BCBFCC; font-size: 12px; }
.status .wrap { padding-block: 6px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #6FCB95; margin-right: 6px; vertical-align: 1px; }
.dot.off { background: #FFBD49; }

/* buttons */
.btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.navy { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--crit); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

main { padding-block: 20px 60px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 23px; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }

/* shift picker */
.shiftbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; margin-bottom: 18px; }
.shiftbar .title { min-width: 0; flex: 1 1 320px; }
.shiftbar .title p { margin: 4px 0 0; color: var(--muted); }
.picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 9px; font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--muted); display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.seg button small { font-weight: 500; font-size: 10.5px; color: var(--faint); }
.seg button[aria-pressed="true"] { background: var(--strong); color: var(--on-strong); }
.seg button[aria-pressed="true"] small { color: inherit; opacity: .75; }
.seg button .has { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-left: 4px; vertical-align: 2px; }
input[type="date"], input[type="search"], input[type="number"], select, textarea, input[type="text"] { background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; font-size: 13px; min-width: 0; }
textarea { width: 100%; resize: vertical; min-height: 70px; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 18px; overflow: hidden; }
.kpi { padding: 12px 14px; border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpi .s { font-size: 11.5px; color: var(--faint); }
.kpi.alert .v { color: var(--crit); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); } .kpi:nth-child(3) { border-right: 0; } .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 480px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } .kpi { border-right: 0 !important; border-bottom: 1px solid var(--line); } .kpi:nth-child(odd) { border-right: 1px solid var(--line) !important; } }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1040px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* review progress + filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.toolbar .grow { flex: 1 1 200px; min-width: 0; }
.toolbar input[type="search"] { width: 100%; }
.progress { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bar { flex: 1 1 160px; height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; min-width: 120px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.done-banner { background: var(--ok-bg); border-color: transparent; color: var(--ok); }

/* guard queue */
.queue { display: flex; flex-direction: column; gap: 8px; }
.g { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; }
.g::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.g.crit::before { background: var(--crit); } .g.warn::before { background: var(--warn); } .g.ok::before { background: var(--ok); }
.g.reviewed { opacity: .72; }
.g.reviewed:hover, .g.reviewed.open { opacity: 1; }
.ghead { display: grid; grid-template-columns: 26px minmax(0, 1.5fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; padding: 11px 14px 11px 16px; cursor: pointer; }
.ghead:hover { background: var(--surface-2); }
.gname { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.gsub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; border-radius: 7px; padding: 2px 7px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.crit { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.chip.gold { background: transparent; color: var(--gold-ink); border-color: var(--gold); }
.scores { display: flex; gap: 10px; align-items: center; }
.score { text-align: right; min-width: 52px; }
.score b { font-size: 19px; font-variant-numeric: tabular-nums; display: block; line-height: 1; }
.score span { font-size: 10.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.grade { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 15px; border: 1.5px solid currentColor; }
.grade.A { color: var(--ok); } .grade.B { color: var(--ok); opacity: .85; } .grade.C { color: var(--warn); } .grade.D, .grade.F { color: var(--crit); } .grade.x { color: var(--faint); }
.chk { width: 22px; height: 22px; border: 1.5px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; background: var(--surface); cursor: pointer; padding: 0; }
.chk[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk svg { width: 14px; height: 14px; }
@media (max-width: 720px) { .ghead { grid-template-columns: 26px minmax(0,1fr) auto; } .ghead .chips { grid-column: 2 / -1; } }

.gbody { border-top: 1px solid var(--line); padding: 12px 14px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.gactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 7px 9px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
td { padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td.mono { white-space: nowrap; }
tr.excused td { color: var(--faint); }
tr.excused td .chip:not(.ok) { opacity: .55; }
tr.crit td:first-child { box-shadow: inset 3px 0 var(--crit); } tr.warn td:first-child { box-shadow: inset 3px 0 var(--warn); }
.res { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res.bad { color: var(--crit); } .res.part { color: var(--warn); }
.reason { max-width: 280px; overflow-wrap: anywhere; }
.reason .cat { display: block; font-size: 10.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.excuse-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.excuse-form input { flex: 1 1 140px; }

/* aside */
aside { display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.panel h3 { margin-bottom: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { font-size: 12.5px; min-width: 0; }
.item b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.item q { display: block; color: var(--muted); font-style: italic; quotes: "“" "”"; overflow-wrap: anywhere; }
.empty { color: var(--faint); font-size: 12.5px; }

/* guards / sites tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.card > .tablewrap { border: 0; border-radius: 16px; }
.big td { padding: 9px 10px; font-size: 13px; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: var(--surface-2); }
.trend.up { color: var(--ok); } .trend.down { color: var(--crit); }
.spark { display: block; }
.rate { display: flex; gap: 8px; align-items: center; }
.rate b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* drawer / modal */
.scrim { position: fixed; inset: 0; background: rgba(8,14,28,.48); z-index: 20; display: flex; justify-content: flex-end; }
.drawer { background: var(--bg); width: min(760px, 100%); height: 100%; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.25); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer header { background: var(--ink); color: #FAFBFF; padding: 16px max(18px, env(safe-area-inset-right, 0px)) 16px 18px; display: flex; gap: 14px; align-items: center; position: sticky; top: 0; z-index: 1; }
.drawer header h2 { font-size: 19px; }
.drawer header .muted { color: #BCBFCC; }
.drawer .content { padding: 16px max(18px, env(safe-area-inset-right, 0px)) 40px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-scrim { position: fixed; inset: 0; background: rgba(8,14,28,.5); z-index: 30; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(620px, 100%); max-height: calc(100% - 20px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.modal .content { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field .lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.togglechips { display: flex; flex-wrap: wrap; gap: 6px; }
.togglechips button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 16px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--muted); }
.togglechips button[aria-pressed="true"] { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }

/* escalations */
.esc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.esc .eh { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 14px 16px; border-left: 4px solid var(--line-2); }
.esc.urgent .eh { border-left-color: var(--crit); } .esc.high .eh { border-left-color: var(--warn); } .esc.normal .eh { border-left-color: var(--info); }
.esc .note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.esc .eb { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.thread { display: flex; flex-direction: column; gap: 8px; }
.upd { font-size: 12.5px; border-left: 2px solid var(--line-2); padding-left: 10px; }
.upd p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.who { font-weight: 600; }
.pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 10px; }
.pill.open { background: var(--crit-bg); color: var(--crit); } .pill.ack { background: var(--warn-bg); color: var(--warn); } .pill.resolved { background: var(--ok-bg); color: var(--ok); }

/* empty / hero state */
.welcome { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.welcome .l { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.welcome .r { background: var(--ink); color: #D3D6E0; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.welcome .r ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.welcome h1 { font-size: 28px; letter-spacing: -.02em; }
.drop { border: 2px dashed var(--line-2); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--gold); color: var(--fg); background: var(--surface-2); }
@media (max-width: 760px) { .welcome { grid-template-columns: 1fr; } }
.dropveil { position: fixed; inset: 0; z-index: 40; background: rgba(10,19,28,.86); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; pointer-events: none; }

.toast { position: fixed; bottom: max(18px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: #0A131C; color: #FAFBFF; border: 1px solid #253140; padding: 10px 16px; border-radius: 8px; z-index: 50; box-shadow: var(--shadow); font-weight: 600; max-width: calc(100% - 32px); }
.toast.err { background: var(--crit); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.prose p { margin: 0 0 8px; max-width: 68ch; } .prose ul { margin: 0 0 8px; padding-left: 18px; max-width: 68ch; } .prose li { margin-bottom: 4px; }
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.al { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); align-items: start; cursor: pointer; }
.al:last-child { border-bottom: 0; }
.al:hover { background: var(--surface-2); }
.al .pip { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--line-2); }
.al.unread .pip { background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.al.crit .pip { background: var(--crit); } .al.warn .pip { background: var(--warn); }
.al b { display: block; font-size: 13.5px; } .al .sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.al time { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.al.unread b::after { content: "New"; margin-left: 8px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--on-gold); background: var(--gold); border-radius: 5px; padding: 1px 5px; vertical-align: 2px; }
.rolechip { background: rgba(255,189,73,.16); color: #FFCB6E; border-radius: 6px; padding: 1px 7px; font-weight: 700; }
.member { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member img { width: 26px; height: 26px; border-radius: 50%; }
.member .nm { flex: 1 1 140px; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.hits { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--f-ui); }
@media (prefers-reduced-motion: no-preference) { .g, .esc { transition: opacity .15s; } }

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); background: var(--bg); }
.auth-brand { background: #0A131C; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; padding: 48px max(32px, env(safe-area-inset-left, 0px)); }
.auth-brand img { width: 320px; height: auto; }
.auth-tag { color: #FFBD49; font-weight: 700; letter-spacing: .04em; margin: 0; }
.auth-card { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 48px max(28px, env(safe-area-inset-right, 0px)) 48px 28px; background: var(--surface); }
.auth-card h1 { font-size: 26px; letter-spacing: -.02em; }
.auth-card .muted { margin: 0 0 8px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.auth-form input { padding: 11px 12px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; margin-top: 8px; text-decoration: none; }
.auth-err { color: var(--crit); background: var(--crit-bg); border-radius: 8px; padding: 9px 11px; margin: 4px 0 0; font-weight: 600; font-size: 13px; }
.auth-ok { color: var(--ok); background: var(--ok-bg); border-radius: 8px; padding: 9px 11px; margin: 4px 0 0; font-weight: 600; font-size: 13px; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; } .auth-brand { padding-block: 28px; align-items: center; } .auth-brand img { width: 200px; } }
.userchip { display: inline-flex; align-items: center; gap: 8px; }
.linkbtn { background: none; border: 0; color: #BCBFCC; font-weight: 700; cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { color: #FAFBFF; }
.invite { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1.4fr) auto auto; gap: 8px; align-items: end; margin-top: 12px; }
@media (max-width: 760px) { .invite { grid-template-columns: 1fr; } }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- in-app alerts: bell, panel, pop-ups ---------- */
.bellbtn { position: relative; flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(250,251,255,.16); background: rgba(250,251,255,.04); color: #FAFBFF; display: grid; place-items: center; cursor: pointer; margin-left: auto; }
.bellbtn:hover, .bellbtn[aria-expanded="true"] { background: rgba(250,251,255,.1); }
.bellbtn .ct { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #FFBD49; color: #0A131C; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #0A131C; }
.tabs + .bellbtn { margin-left: 0; }
@media (max-width: 1100px) { .tabs + .bellbtn, .bellbtn { margin-left: auto; } .upbtn { margin-left: 0; } }
@media (max-width: 600px) { .popn:nth-child(n+2) { display: none; } }
.bellpanel { position: fixed; z-index: 35; top: calc(72px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: min(420px, calc(100vw - 32px)); max-height: min(70vh, 620px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(10,19,28,.28); overflow: hidden; }
.bp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bp-list { overflow-y: auto; }
.bp-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; background: var(--surface-2); }
.popups { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.popn { pointer-events: auto; display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 4px 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 34px rgba(10,19,28,.25); }
.popn.crit { border-left-color: var(--crit); } .popn.warn { border-left-color: var(--warn); }
.popn .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; }
.popn.crit .pip { background: var(--crit); } .popn.warn .pip { background: var(--warn); }
.popn b { display: block; font-size: 13.5px; } .popn .sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.popn-act { grid-column: 2; display: flex; gap: 6px; margin-top: 6px; }
@media (prefers-reduced-motion: no-preference) { .popn { animation: popin .22s ease-out; } @keyframes popin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } } }
