/* Self-hosted Geist (SEC-14): @fontsource/geist-sans and geist-mono 5.3.0, OFL (fonts/OFL.txt). */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/geist-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/geist-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/geist-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/geist-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/geist-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/geist-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/geist-mono-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/geist-mono-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Tokens mirror direction C ("Refined dark") in the Figma file "NZDROLL v3 · Terminal directions". */
:root {
    --bg-canvas: #0B0D10;
    --bg-sidebar: #0D0F13;
    --bg-surface: #111418;
    --bg-surface-2: #161A1F;
    --bg-input: #0E1115;
    --bg-hover: #1B2026;
    --bg-console: #090B0E;
    --border-subtle: #1F242B;
    --border-default: #2B313A;
    --border-strong: #3B434E;
    --text-primary: #E6E9ED;
    --text-secondary: #A1A9B3;
    --text-tertiary: #7A838E;
    --text-faint: #4B525C;
    --text-on-accent: #FFFFFF;
    --accent: #5B8CFF;
    --accent-text: #8AABFF;
    --accent-subtle: #17213A;
    --positive: #3DD68C;
    --positive-subtle: #0E2419;
    --caution: #F5B83D;
    --caution-subtle: #2A2110;
    --critical: #F2555A;
    --critical-solid: #D63A3E;
    --critical-subtle: #2A1416;
    --violet: #B48CFF;
    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    --radius: 6px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg-canvas); color: var(--text-primary); font-family: var(--font); font-size: 13px; line-height: 18px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1:focus { outline: none; }

/* ---------- type ---------- */
.t-title { font-size: 18px; line-height: 24px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.t-heading { font-size: 13px; line-height: 18px; font-weight: 600; margin: 0; }
.t-body { font-size: 13px; line-height: 18px; }
.t-small { font-size: 12.5px; line-height: 17px; }
.t-caption { font-size: 11.5px; line-height: 15px; }
.t-label { font-size: 11.5px; line-height: 15px; font-weight: 400; color: var(--text-tertiary); }
.t-strong { font-weight: 500; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num-l { font-family: var(--mono); font-size: 18px; line-height: 24px; font-weight: 500; letter-spacing: -0.01em; }
.num-xl { font-family: var(--mono); font-size: 26px; line-height: 32px; font-weight: 500; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
kbd { font: 10.5px/1 var(--mono); padding: 2px 4px; border-radius: 3px; border: 1px solid currentColor; opacity: .7; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-tertiary); }
.pos { color: var(--positive); }
.neg { color: var(--critical); }
.warn { color: var(--caution); }
.accent { color: var(--accent-text); }
.nowrap { white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 184px; flex: 0 0 184px; background: var(--bg-sidebar); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 2px 6px 18px; font: 600 14px/18px var(--font); letter-spacing: 0.08em; color: var(--text-primary); text-decoration: none !important; }
.nav-group { font-size: 11px; color: var(--text-tertiary); padding: 12px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); color: var(--text-secondary); font-size: 13px; line-height: 18px; }
.nav-item:hover { background: var(--bg-hover); text-decoration: none; color: var(--text-primary); }
.nav-item.active { background: var(--accent-subtle); color: var(--text-primary); font-weight: 500; }
.nav-item .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-card { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--bg-surface); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-subtle); color: var(--accent-text); display: grid; place-items: center; font-size: 11px; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border-subtle); background: rgba(11, 13, 16, 0.94); backdrop-filter: blur(8px); }
.topbar .right { display: flex; align-items: center; gap: 8px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-tertiary); white-space: nowrap; }
.crumb b { color: var(--text-primary); font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 1px solid var(--border-subtle); border-radius: 4px; background: var(--bg-surface); font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.chip .v { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }
.chip .sep { width: 1px; height: 12px; background: var(--border-default); }
a.chip:hover { text-decoration: none; border-color: var(--border-default); }
.content { padding: 18px 20px 32px; display: flex; flex-direction: column; gap: 12px; width: 100%; }

/* ---------- layout helpers ---------- */
.row { display: flex; gap: 12px; }
.row.g16 { gap: 16px; } .row.g12 { gap: 12px; } .row.g8 { gap: 8px; } .row.g4 { gap: 4px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.col.g16 { gap: 16px; } .col.g12 { gap: 12px; } .col.g8 { gap: 8px; } .col.g4 { gap: 4px; } .col.g2 { gap: 2px; }
.fill { flex: 1; min-width: 0; }
.side-360 { width: 360px; flex: 0 0 360px; }
.side-380 { width: 392px; flex: 0 0 392px; }
.center { align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 30px; }
.page-header .sub { font-size: 12.5px; color: var(--text-tertiary); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.facts.f5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat .t-caption { color: var(--text-tertiary); }
/* Fact: small label, mono value, mono caption (Overview next night, night strip). */
.fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact .k { font-size: 11.5px; line-height: 15px; color: var(--text-tertiary); }
.fact .v { font: 500 14px/19px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact .v.l { font-size: 17px; line-height: 23px; }
.fact .s { font: 11px/15px var(--mono); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A row of facts split by hairlines, as in the night strip. */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.strip > * { padding: 12px 14px; border-left: 1px solid var(--border-subtle); }
.strip > *:first-child { border-left: 0; }

/* ---------- cards ---------- */
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); overflow: hidden; }
.card.danger { border-color: var(--critical-solid); }
.card-pad { padding: 12px 14px; }
.card-pad-l { padding: 14px 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 37px; padding: 8px 14px; border-bottom: 1px solid var(--border-subtle); }
.card-head .t-heading { font-size: 13px; }
.card-head .meta { font: 11.5px var(--mono); color: var(--text-tertiary); white-space: nowrap; }
.card-head:last-child { border-bottom: 0; }
.rows > .r { border-top: 1px solid var(--border-subtle); }
.card-head + .tbl-wrap .tbl th, .card-head + .tbl th, .card-head + .list-row, .card-head + .empty { border-top: 0; }
.divider { height: 1px; background: var(--border-subtle); border: 0; margin: 0; }
.callout { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius); font-size: 12.5px; line-height: 17px; }
.callout.info { background: var(--accent-subtle); }
.callout.ok { background: var(--positive-subtle); }
.callout.warn { background: var(--caution-subtle); }
.callout.bad { background: var(--critical-subtle); color: var(--critical); }
.box { background: var(--bg-surface-2); border-radius: var(--radius); padding: 10px 12px; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 17px; }
.tbl th { text-align: left; font-weight: 400; font-size: 11.5px; color: var(--text-tertiary); padding: 7px 14px; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.tbl td:first-child, .tbl th:first-child { white-space: nowrap; }
.tbl td { padding: 6px 14px; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl td.num, .tbl td .num { font-size: 12.5px; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl tr.total td { background: var(--bg-surface-2); font-weight: 500; }
.tbl tr.bad td { background: var(--critical-subtle); }
.tbl tr.hl td { background: var(--caution-subtle); }
.tbl tr.dim td { opacity: .55; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--bg-hover); }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status.positive { color: var(--positive); }
.status.caution { color: var(--caution); }
.status.critical { color: var(--critical); }
.status.info { color: var(--accent-text); }
.status.neutral { color: var(--text-secondary); }
.status.neutral::before { background: var(--text-tertiary); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; line-height: 17px; font-weight: 500; white-space: nowrap; }
.pill::before { width: 5px !important; height: 5px !important; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.positive { color: var(--positive); background: var(--positive-subtle); }
.pill.caution { color: var(--caution); background: var(--caution-subtle); }
.pill.critical { color: var(--critical); background: var(--critical-subtle); }
.pill.info { color: var(--accent-text); background: var(--accent-subtle); }
.pill.neutral { color: var(--text-secondary); background: var(--bg-hover); }

/* ---------- buttons ---------- */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius); border: 1px solid transparent; font: 500 12.5px/1 var(--font); cursor: pointer; white-space: nowrap; color: var(--text-primary); background: transparent; text-decoration: none !important; user-select: none; }
.b.s { height: 24px; padding: 0 8px; font-size: 12px; gap: 5px; }
.b.l { height: 36px; font-size: 13.5px; }
.b svg { width: 14px; height: 14px; }
.b.primary { background: var(--accent); color: var(--text-on-accent); }
.b.primary:hover { filter: brightness(1.1); }
.b.secondary { background: var(--bg-surface-2); border-color: var(--border-default); }
.b.secondary:hover { background: var(--bg-hover); }
.b.ghost { color: var(--text-secondary); }
.b.ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.b.danger { color: var(--critical); border-color: var(--critical-solid); background: transparent; }
.b.danger:hover { background: #3a1a1c; }
.b.armed { background: var(--critical-solid); color: #fff; border-color: var(--critical-solid); animation: pulse 1s ease-in-out infinite; }
.b:disabled, .b.disabled { color: var(--text-tertiary); background: var(--bg-surface); border-color: var(--border-subtle); cursor: not-allowed; filter: none; animation: none; }
.b.full { width: 100%; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(214, 58, 62, .25); } }
.link { color: var(--accent-text); background: none; border: 0; padding: 0; font: 600 13px var(--font); cursor: pointer; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); }
.help { font-size: 11.5px; color: var(--text-tertiary); }
/* InfoTip: opens leftwards from the icon, so it stays inside the card in a right-hand column and on narrow screens. */
.tip { position: relative; display: inline-flex; color: var(--text-tertiary); cursor: help; border-radius: 50%; }
.tip:hover, .tip:focus-visible { color: var(--text-primary); }
.tip-body { display: none; position: absolute; z-index: 30; top: calc(100% + 6px); right: -8px; width: max-content; max-width: min(320px, calc(100vw - 48px)); padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary); font-size: 12px; font-weight: 400; line-height: 18px; white-space: normal; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.tip-body b { color: var(--text-primary); font-weight: 500; }
.tip:hover .tip-body, .tip:focus .tip-body { display: block; }
.help.err { color: var(--critical); }
.inp { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-input); }
.inp:focus-within { border-color: var(--accent); }
.inp.err { border-color: var(--critical); }
.inp.s { height: 28px; padding: 0 8px; }
.inp input, .inp select { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--text-primary); font: 13px var(--font); }
.inp input.num { font-family: var(--mono); }
.inp select option { background: var(--bg-surface); }
.inp .sfx { color: var(--text-tertiary); font-size: 11.5px; white-space: nowrap; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--bg-input); border: 1px solid var(--border-default); }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; border: 0; background: transparent; color: var(--text-secondary); font: 500 12.5px var(--font); cursor: pointer; }
.seg button.on { background: var(--bg-hover); color: var(--text-primary); }
/* Filter chips (Activity). */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 26px; padding: 0 11px; border-radius: 13px; border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); font: 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.chips button:hover { color: var(--text-primary); border-color: var(--border-strong); }
.chips button.on { background: var(--accent-subtle); border-color: var(--accent); color: var(--text-primary); }
.chips button .n { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); margin-left: 4px; }
.radio-card { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-input); cursor: pointer; text-align: left; color: var(--text-primary); font: inherit; }
.radio-card.on { border: 1.5px solid var(--accent); background: var(--accent-subtle); }
.radio-card .rc-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.radio-card .rc-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--bg-input); flex: none; }
.radio-card.on .rc-dot { border: 5px solid var(--accent); background: #fff; }
.radio-card .rc-desc { padding-left: 24px; font-size: 12px; color: var(--text-secondary); }
.toggle { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--border-strong); border: 0; cursor: pointer; padding: 0; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 18px; }
input[type=checkbox].cb { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ---------- section cards (run setup) ---------- */
.section-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.section-num { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-hover); display: grid; place-items: center; font: 500 11px var(--mono); color: var(--text-secondary); flex: none; }
.section-body { padding: 14px 14px 16px 44px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- misc ---------- */
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.checks.inline .check { align-items: center; gap: 6px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.check svg { flex: none; margin-top: 1px; }
.check.blocker { color: var(--text-primary); }
.bar { height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.bar > div { height: 100%; border-radius: 3px; background: var(--positive); transition: width .3s; }
.datebox { width: 36px; height: 36px; border-radius: var(--radius); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.iconbox { width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; flex: none; }
.iconbox.critical { background: var(--critical-subtle); color: var(--critical); }
.iconbox.caution { background: var(--caution-subtle); color: var(--caution); }
.iconbox.accent { background: var(--accent-subtle); color: var(--accent-text); }
.iconbox.positive { background: var(--positive-subtle); color: var(--positive); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border-subtle); }
.empty { padding: 18px 14px; text-align: center; color: var(--text-tertiary); font-size: 12.5px; border-top: 1px solid var(--border-subtle); }
.mono-log { font-family: var(--mono); font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px; padding: 12px 16px; border-radius: var(--radius); background: var(--bg-surface-2); border: 1px solid var(--border-default); box-shadow: 0 12px 32px rgba(0,0,0,.45); font-size: 13px; }
.toast.bad { border-color: var(--critical-solid); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; border-radius: var(--radius); background: var(--bg-surface-2); border: 1px solid var(--border-default); box-shadow: 0 12px 32px rgba(0,0,0,.45); display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; color: var(--text-primary); border-radius: 6px; font: 13px var(--font); cursor: pointer; text-align: left; }
.menu button:hover { background: var(--bg-hover); }
.menu button.bad { color: var(--critical); }
.menu hr { border: 0; height: 1px; background: var(--border-subtle); margin: 6px 0; }
.rel { position: relative; }
.chart { width: 100%; height: 160px; display: block; }

/* ---------- console (Activity, night log) ---------- */
.console { display: flex; flex-direction: column; background: var(--bg-console); border: 1px solid var(--border-subtle); border-radius: var(--radius); overflow: hidden; min-height: 0; }
.console-bar { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); font-size: 12px; color: var(--text-tertiary); }
.console-bar .dots { display: flex; gap: 6px; }
.console-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: #3A2224; }
.console-bar .dots i:nth-child(1) { background: #6B2A2D; } .console-bar .dots i:nth-child(2) { background: #6B5420; } .console-bar .dots i:nth-child(3) { background: #1F5A3D; }
.console-body { flex: 1; overflow: auto; padding: 8px 0; font: 12.5px/22px var(--mono); font-variant-numeric: tabular-nums; }
.console-body .ln { display: grid; grid-template-columns: 96px 60px 76px minmax(0, 1fr) auto; gap: 0 12px; padding: 0 14px; white-space: nowrap; }
.console-body.wide .ln { grid-template-columns: 150px 60px 76px minmax(0, 1fr) auto; }
.console-body .ln:hover { background: rgba(255, 255, 255, .025); }
.console-body .ln > span { overflow: hidden; text-overflow: ellipsis; }
.console-body .ln .t { color: var(--text-tertiary); }
.console-body .ln .a { color: var(--text-primary); }
.console-body .ln .m { color: var(--text-primary); }
.console-body .ln .r { color: var(--text-faint); text-align: right; }
.console-body .ln .r a { color: inherit; opacity: 0; }
.console-body .ln:hover .r a, .console-body .ln .r a:focus-visible { opacity: 1; }
.console-body .ln .r a:hover { color: var(--text-secondary); }
.console-body .ln.bad { background: rgba(242, 85, 90, .09); }
.console-body .ln.quiet .m { color: var(--text-secondary); }
.console-body .none { padding: 6px 14px; color: var(--text-tertiary); }
.k-info { color: var(--text-tertiary); } .k-sent { color: var(--accent-text); } .k-filled, .k-closed, .k-done { color: var(--positive); }
.k-partial, .k-noreply { color: var(--caution); } .k-problem, .k-rejected, .k-stopped { color: var(--critical); } .k-resolved { color: var(--accent-text); }
.console-prompt { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface); font: 12.5px var(--mono); }
.console-prompt .p { color: var(--accent-text); }
.console-prompt input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; caret-color: var(--accent); }
.console-prompt input::placeholder { color: var(--text-faint); }
.console-prompt .hint { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.live-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--positive); font-size: 11.5px; }
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--positive); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
/* The Activity page console fills the window under the header. */
/* Inside a card (night page) the console drops its own frame and scrolls past ~20 lines. */
.card > .console { border: 0; border-radius: 0; }
.card > .console .console-body { max-height: 470px; }
.activity-page { height: calc(100vh - 44px); }
.activity-page .console { flex: 1; }
.sel { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 9px; border: 1px solid var(--border-default); border-radius: var(--radius); background: transparent; font-size: 12px; color: var(--text-tertiary); }
.sel select { max-width: 240px; text-overflow: ellipsis; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: 12.5px var(--font); cursor: pointer; }
.sel select option { background: var(--bg-surface); }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }

/* Blazor */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 10px 20px; background: var(--critical-solid); color: #fff; }
#blazor-error-ui .reload { color: #fff; text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
.valid.modified:not([type=checkbox]) { outline: none; }
.validation-message { color: var(--critical); font-size: 12px; }

@media (max-width: 1100px) {
    .row.stack-md { flex-direction: column; }
    /* Stacked columns take the screen's width even where the row aligns its items to the start. */
    .row.stack-md > * { align-self: stretch; min-width: 0; }
    .side-360, .side-380 { width: auto; flex: none; }
    .facts, .facts.f5, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Narrow screens (UI-07): the sidebar becomes a scrolling strip on top, and the top bar wraps so Close all and the kill switch stay on screen. */
@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
    .sidebar .brand { padding: 6px 10px 6px 0; }
    .sidebar .nav-group { display: none; }
    .sidebar .nav-item { white-space: nowrap; padding: 6px 10px; }
    .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
    .sidebar-foot .user-card { padding: 4px 6px; border: 0; background: none; }
    .sidebar-foot .user-card .col { display: none; }
    .content { padding: 20px 16px 40px; }
    .topbar { height: auto; min-height: 60px; padding: 8px 16px; flex-wrap: wrap; }
    .topbar .right { flex-wrap: wrap; justify-content: flex-end; }
    .tbl-wrap { -webkit-overflow-scrolling: touch; }
    .seg { max-width: 100%; overflow-x: auto; }
    /* Run editor: one field per row, so three inputs side by side don't push the page wider than the screen. */
    .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .section-body { padding: 4px 16px 16px; }
    /* The info tip spans the card instead of hanging off the icon, which can sit near either edge. */
    .card { position: relative; }
    .tip { position: static; }
    .tip-body { top: auto; left: 12px; right: 12px; width: auto; max-width: none; margin-top: 22px; }
    /* The console scrolls inside itself; time, account and kind shrink so the message keeps some room. */
    .activity-page { height: auto; }
    .activity-page .console-body { max-height: 70vh; }
    /* Lines keep their full width and the log scrolls sideways, like a terminal. */
    .console-body .ln { grid-template-columns: 92px 64px 64px max-content; width: max-content; min-width: 100%; font-size: 11.5px; }
    .console-body.wide .ln { grid-template-columns: 142px 64px 64px max-content; }
    .console-body .ln > span { overflow: visible; }
    .console-body .ln .r { display: none; }
    .page-header { flex-wrap: wrap; }
    .filters { flex-direction: column; align-items: stretch !important; }
    .filters .selects > .sel { flex: 1; min-width: 0; }
    .filters .sel select { max-width: none; width: 100%; min-width: 0; }
    .console-prompt .hint { display: none; }
}

/* ---------- minimal styles for the built-in Identity pages (no Bootstrap) ---------- */
.form-floating { display: flex; flex-direction: column-reverse; gap: 6px; margin-bottom: 14px; }
.form-floating > label, .form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-control { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-primary); font: 14px var(--font); outline: 0; }
.form-control:focus { border-color: var(--accent); }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--text-secondary); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-primary); font: 500 14px var(--font); cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: var(--critical-solid); border-color: var(--critical-solid); color: #fff; }
.btn-link { background: none; border: 0; color: var(--accent-text); }
.btn-lg { height: 44px; }
.w-100 { width: 100%; }
.mb-3 { margin-bottom: 14px; } .mt-3 { margin-top: 14px; }
.text-danger { color: var(--critical); font-size: 12px; }
.alert { padding: 10px 14px; border-radius: var(--radius); background: var(--bg-surface-2); border: 1px solid var(--border-default); margin-bottom: 14px; font-size: 13px; }
.alert-danger { background: var(--critical-subtle); border-color: var(--critical-solid); color: var(--critical); }
.alert-success { background: var(--positive-subtle); border-color: var(--positive); color: var(--positive); }
.alert-warning { background: var(--caution-subtle); border-color: var(--caution); color: var(--caution); }
.nav.nav-pills { display: flex; flex-direction: column; gap: 4px; list-style: none; padding: 0; margin: 0; }
.nav-pills .nav-link { display: block; padding: 8px 10px; border-radius: var(--radius); color: var(--text-secondary); }
.nav-pills .nav-link.active { background: var(--bg-hover); color: var(--text-primary); }
.col-lg-4, .col-lg-6, .col-md-4, .col-md-6, .col-xl-6 { flex: 1; min-width: 0; max-width: 520px; }
.col-lg-3, .col-md-3 { width: 220px; flex: none; }
.col-lg-9, .col-md-9 { flex: 1; min-width: 0; }
.identity hr { border: 0; height: 1px; background: var(--border-subtle); margin: 16px 0; }
.identity h1 { font-size: 22px; line-height: 28px; font-weight: 600; margin: 0 0 8px; }
.identity h2, .identity h3 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.identity section { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 24px; }
.identity p { color: var(--text-secondary); font-size: 13px; }
.identity kbd { font-family: var(--mono); background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; }
.menu button.hl { background: var(--bg-hover); }
.menu { max-height: 280px; overflow-y: auto; }
/* Picker: the input covers the whole box so the arrow area is clickable too. */
.inp.picker { position: relative; padding: 0; }
.inp.picker input { padding: 0 34px 0 12px; cursor: pointer; }
.inp.picker .picker-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }

/* Dashboard alerts (C6): impossible to miss, never automatic. */
.alert-stack { display: flex; flex-direction: column; gap: 8px; padding: 12px 24px 0; }
.alert-banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--critical-solid);
    background: var(--critical-subtle); color: var(--critical); animation: pulse 1.6s ease-in-out infinite; }
.alert-banner .t-caption { color: var(--text-secondary, inherit); }

/* Wide tables scroll inside their card instead of being clipped below 1920 px (UI-01, UI-02, R45). */
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.tbl-wrap > .tbl { min-width: max-content; }

/* Disconnected from the server: everything behind the reconnect bar is frozen (UI-08). */
body.stale .main, body.stale main, body.stale .content { opacity: .45; filter: grayscale(.7); pointer-events: none; transition: opacity .2s; }

/* Keyboard focus is always visible (UI-10). */
.b:focus-visible, .toggle:focus-visible, .nav-item:focus-visible, tr.click:focus-visible, .seg button:focus-visible, a:focus-visible,
.menu button:focus-visible, .radio-card:focus-visible, .link:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; }

/* Overview NZ roll card: the trading week's nights, days rolled and roll time (server) */
.week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.week > div { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--bg-surface-2); }
.week .d { font-size: 11.5px; color: var(--text-tertiary); }
.week .x { font-family: var(--mono); font-weight: 500; }
.week .t { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.week > .on { border-color: var(--accent); }
.week > .multi .x { color: var(--accent); }
.week > .zero .x { color: var(--caution); }
select.mini { height: 24px; padding: 0 22px 0 8px; font: 500 12px var(--mono); color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius); }
.card-head .t-heading { white-space: nowrap; }

/* Run editor, picked nights: Monday–Friday grid, each night with its roll days */
.pick { display: grid; grid-template-columns: repeat(5, minmax(64px, 1fr)); gap: 4px; max-width: 560px; }
.pick > button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font: inherit; color: var(--text-primary);
    border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--bg-surface-2); cursor: pointer; }
.pick > button:hover:not(:disabled) { border-color: var(--border-strong); }
.pick > button:disabled { opacity: .35; cursor: default; }
.pick .d { font-size: 11.5px; color: var(--text-tertiary); }
.pick .x { font-family: var(--mono); font-weight: 500; font-size: 12px; }
.pick > .multi .x { color: var(--accent); }
.pick > .zero .x { color: var(--caution); }
.pick > .sel { background: var(--accent-subtle); border-color: var(--accent); }
.pick > .sel .d { color: var(--text-primary); }
.pick > .m { grid-column: 1 / -1; padding: 8px 2px 2px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.pick > .m:first-child { padding-top: 0; }

/* A segmented control that fills its field, at input height (run editor: direction) */
.seg.full { display: flex; width: 100%; height: 32px; box-sizing: border-box; }
.seg.full button { flex: 1; justify-content: center; }
.seg.side button.on.sell { background: var(--critical-subtle); color: var(--critical); }
.seg.side button.on.buy { background: var(--positive-subtle); color: var(--positive); }
