/* One semantic palette. Light is the default; legacy names are aliases only. */
:root {
  color-scheme: light;
  --surface-canvas: #f5f7fb;
  --surface: #ffffff;
  --surface-raised: #eef2f7;
  --text-primary: #172235;
  --text-secondary: #526176;
  --border: #dfe5ee;
  --border-strong: #bbc6d6;
  --accent: #f59e0b;
  --accent-hover: #ffb347;
  --accent-text: #994b08;
  --accent-subtle: #fff1dc;
  --accent-border: #e5bd89;
  --positive: #14623c;
  --positive-subtle: #e8f5ed;
  --warning: #85520a;
  --warning-subtle: #fff5df;
  --negative: #a82d38;
  --negative-subtle: #fff0f1;
  --focus: #a95609;
  --overlay: rgba(23,34,53,.42);
  --shadow-card: 0 2px 8px rgba(26,40,65,.035);
  --shadow-floating: 0 16px 40px rgba(26,40,65,.14);
  --radius: 16px;
  --radius-sm: 8px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --canvas: var(--surface-canvas); --paper: var(--surface); --paper-warm: var(--surface-raised);
  --ink: var(--text-primary); --muted: var(--text-secondary);
  --line: var(--border); --line-strong: var(--border-strong);
  --teal: var(--accent); --teal-dark: var(--accent-text); --teal-pale: var(--accent-subtle);
  --amber: var(--warning); --amber-pale: var(--warning-subtle);
  --red: var(--negative); --red-pale: var(--negative-subtle);
  --graphite: var(--surface-canvas); --graphite-2: var(--surface-raised); --graphite-3: var(--border-strong);
  --shadow: var(--shadow-floating);
}
:root[data-ui-theme="dark"] {
  color-scheme: dark;
  --surface-canvas: #0b1220;
  --surface: #121d2f;
  --surface-raised: #19273c;
  --text-primary: #f4f7fb;
  --text-secondary: #b0bccf;
  --border: #2a3b53;
  --border-strong: #4c607a;
  --accent-hover: #ffd08a;
  --accent-text: #ffb347;
  --accent-subtle: #2b241c;
  --accent-border: #805b31;
  --positive: #88d5a4;
  --positive-subtle: #183328;
  --warning: #ffd08a;
  --warning-subtle: #33291a;
  --negative: #f39c9b;
  --negative-subtle: #38242e;
  --focus: #ffb347;
  --overlay: rgba(3,8,16,.66);
  --shadow-card: 0 2px 8px rgba(0,0,0,.10);
  --shadow-floating: 0 16px 40px rgba(0,0,0,.32);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scrollbar-color: var(--border-strong) var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 12px; transform: translateY(-160%); padding: 12px 16px; border-radius: var(--radius-sm); color: var(--ink); background: var(--accent-subtle); border: 1px solid var(--accent-border); transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); }

/* Rail */
.console-shell { display: flex; }
.sidebar { position: fixed; z-index: 40; display: flex; flex-direction: column; width: 256px; height: 100vh; height: 100dvh; padding: 24px 16px 16px; overflow-y: auto; overscroll-behavior: contain; color: var(--ink); background: var(--paper); border-right: 1px solid var(--line); }
.sidebar-top { flex: 0 0 auto; padding: 0 8px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; letter-spacing: .06em; }
.wordmark-mark { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 8px; color: #120c04; background: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: -.06em; }
.wordmark-text { display: grid; color: var(--ink); line-height: 1.1; font-size: 12px; letter-spacing: .12em; }
.wordmark-text strong { font-size: 12px; font-weight: 800; }
.wordmark-text span { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.environment { display: flex; align-items: center; gap: 8px; margin: 24px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.environment-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }
.nav-list { display: grid; flex: 0 0 auto; gap: 24px; }
.nav-link { display: flex; min-width: 0; min-height: 44px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.4; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.nav-link:hover { color: var(--ink); background: var(--paper-warm); }
.nav-link.is-active { border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-subtle); }
.nav-icon { display: inline-flex; flex: 0 0 18px; width: 18px; height: 18px; color: currentColor; }
.nav-link.is-active .nav-icon { color: currentColor; }
.sidebar-bottom { flex: 0 0 auto; margin-top: auto; padding-top: 24px; }
.session-card { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 16px 8px; border-top: 1px solid var(--line); }
.avatar { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--accent-text); background: var(--accent-subtle); font-size: 13px; font-weight: 750; }
.session-copy { display: grid; min-width: 0; line-height: 1.25; }
.session-copy strong, .session-copy small { overflow-wrap: anywhere; }
.session-copy strong { color: var(--ink); font-size: 13px; }
.session-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.sidebar-actions { display: flex; gap: 8px; padding: 0 6px; }
.rail-button { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); background: var(--paper); font-size: 12px; font-weight: 650; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.rail-button:hover { border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-subtle); }
.rail-button-wide { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; }
.console-frame { width: calc(100% - 256px); min-width: 0; min-height: 100vh; margin-left: 256px; }
.mobile-bar { display: none; }
.content-canvas { width: min(100%, 1440px); min-width: 0; margin: 0 auto; padding: 40px 32px 64px; }

/* Shared content */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading { margin: 0; color: var(--ink); font-size: clamp(28px, 2.6vw, 34px); font-weight: 700; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.page-subtitle { max-width: 650px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.eyebrow { margin: 0 0 8px; color: var(--accent-text); font-size: 12px; font-weight: 750; letter-spacing: .09em; }
.page-action { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; font-weight: 650; line-height: 1.4; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.button:hover { text-decoration: none; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: #172235; background: var(--accent); box-shadow: none; }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: var(--paper); }
.button-secondary:hover { border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-subtle); }
.button-danger { border-color: rgba(243,156,155,.28); color: var(--red); background: var(--red-pale); }
.button-quiet { min-height: 32px; padding: 5px 8px; color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--teal-dark); background: var(--teal-pale); }
.button-full { width: 100%; min-height: 48px; }
.icon-button { display: inline-grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); background: var(--paper); }

.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-card); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px; }
.card-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.card-note { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-link { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent-text); font-size: 13px; font-weight: 650; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 21px; }
.metric { min-height: 125px; padding: 17px 17px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.metric-label { display: block; min-height: 31px; color: var(--muted); font-size: 12px; line-height: 1.25; }
.metric-value { display: block; margin-top: 15px; color: var(--ink); font-size: 30px; font-weight: 650; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-value.is-unavailable { color: var(--muted); font-size: 17px; letter-spacing: 0; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; margin-top: 32px; }
.status-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 16px 24px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--positive-subtle); color: var(--positive); font-size: 13px; }
.status-strip.is-warning { border-color: rgba(239,193,116,.28); background: var(--amber-pale); color: var(--amber); }
.status-strip strong { color: inherit; }
.status-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--positive); }
.status-strip.is-warning .status-dot { background: var(--amber); }

/* Data tables and listing */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; align-items: center; flex: 1; flex-wrap: wrap; gap: 8px; }
.input-wrap { position: relative; flex: 1 1 220px; max-width: 330px; }
.input-wrap span { position: absolute; top: 9px; left: 11px; color: var(--muted); pointer-events: none; }
.input-wrap input { padding-left: 32px; }
.input, .select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.4; transition: border-color .16s ease, box-shadow .16s ease; }
.select { width: auto; min-width: 125px; padding-right: 28px; }
.input:focus, .select:focus, textarea:focus { border-color: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--red); }
.table-card { overflow: hidden; }
.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--paper-warm); font-size: 12px; font-weight: 650; letter-spacing: .03em; text-align: left; white-space: nowrap; }
td { padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: var(--paper-warm); }
.cell-primary { display: block; color: var(--ink); font-weight: 700; }
.cell-secondary { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cell-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { position: relative; text-align: right; }
.menu-trigger { width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; font-size: 18px; }
.menu-trigger:hover, .menu-trigger[aria-expanded="true"] { color: var(--teal-dark); background: var(--teal-pale); }
.action-menu { position: absolute; z-index: 12; top: 39px; right: 14px; display: grid; min-width: 166px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); text-align: left; }
.action-menu button { padding: 8px 9px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font-size: 12px; text-align: left; }
.action-menu button:hover { background: var(--paper-warm); }
.action-menu button.danger { color: var(--red); }
.pill { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.pill-active, .pill-ready, .pill-installed { color: var(--positive); background: var(--positive-subtle); }
.pill-pending, .pill-warning { color: var(--amber); background: var(--amber-pale); }
.pill-disabled, .pill-removed, .pill-error { color: var(--red); background: var(--red-pale); }
.pill-neutral { color: var(--muted); background: var(--paper-warm); }

/* Empty, load, error, alerts */
.empty-state { display: grid; min-height: 185px; place-items: center; padding: 29px; text-align: center; }
.empty-state > div { max-width: 380px; }
.empty-symbol { display: grid; width: 36px; height: 36px; place-items: center; margin: 0 auto 11px; border-radius: 50%; color: var(--teal-dark); background: var(--teal-pale); font-size: 17px; }
.empty-state h2, .empty-state h3 { margin: 0; font-size: 15px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.empty-state .button { margin-top: 15px; }
.loading-state { display: flex; min-height: 150px; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid #344960; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
.initial-loader { display: flex; min-height: 60vh; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.error-panel { padding: 16px 18px; border: 1px solid rgba(243,156,155,.28); border-radius: 10px; color: var(--red); background: var(--red-pale); }
.error-panel p { margin: 3px 0 0; font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Activity and settings */
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: var(--radius-sm); color: var(--accent-text); background: var(--accent-subtle); }
.activity-title { margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.activity-meta { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.activity-summary { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.settings-list { margin: 0; }
.setting-row { display: grid; grid-template-columns: minmax(125px, .8fr) minmax(0, 1.2fr); gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row dt { color: var(--muted); font-size: 12px; }
.setting-row dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.setting-row dd a { color: var(--teal-dark); }
.deferred-note { padding: 17px 20px; border-top: 1px solid var(--line); color: var(--muted); background: var(--paper-warm); font-size: 12px; }
.deferred-note strong { color: var(--ink); }

/* Report library */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 0 20px 20px; }
.report-card { display: flex; min-width: 0; flex-direction: column; min-height: 195px; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.report-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.report-file-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; color: var(--teal-dark); background: var(--teal-pale); font-size: 12px; font-weight: 800; }
.report-card h3 { margin: 20px 0 9px; overflow-wrap: anywhere; font-size: 16px; letter-spacing: -.015em; line-height: 1.4; }
.report-card p { margin: 0; color: var(--muted); font-size: 12px; }
.report-card .button { align-self: flex-start; margin-top: 24px; min-height: 44px; }
.source-status { margin: 0 20px 18px; }

/* dialogs */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; justify-content: flex-end; background: var(--overlay); }
.modal-panel { display: flex; width: min(100%, 570px); max-height: 100vh; flex-direction: column; overflow: hidden; border-left: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow-floating); }
.modal-panel.modal-confirm { width: min(calc(100% - 32px), 420px); height: fit-content; max-height: calc(100vh - 40px); margin: auto; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 23px 24px 17px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.close-button { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; font-size: 21px; line-height: 1; }
.close-button:hover { color: var(--ink); background: var(--paper-warm); }
.modal-body { overflow-y: auto; padding: 20px 24px 26px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px; border-top: 1px solid var(--line); background: var(--paper-warm); }
.confirm-copy { padding: 23px 24px 15px; color: var(--muted); font-size: 13px; }
.confirm-copy strong { color: var(--ink); }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; gap: 6px; }
.form-row label { color: var(--ink); font-size: 12px; font-weight: 750; }
.form-row .hint { margin: 0; color: var(--muted); font-size: 12px; }
.field-error { min-height: 16px; margin: 0; color: var(--red); font-size: 12px; }
.form-error { padding: 9px 10px; border: 1px solid rgba(243,156,155,.28); border-radius: 7px; color: var(--red); background: var(--red-pale); font-size: 12px; }
.permission-group { padding: 14px 0; border-top: 1px solid var(--line); }
.permission-group:first-child { padding-top: 0; border-top: 0; }
.permission-group h3 { margin: 0 0 9px; color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.permission-option { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 12px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.permission-option:hover { background: var(--paper-warm); }
.permission-option input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--teal); }
.permission-option strong { display: block; color: var(--ink); font-size: 12px; }
.permission-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.form-notice { padding: 9px 11px; border: 1px solid rgba(239,193,116,.28); border-radius: 7px; color: var(--amber); background: var(--amber-pale); font-size: 12px; }
.copy-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-warm); }
.copy-link code { min-width: 0; flex: 1; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.toast-region { position: fixed; z-index: 130; right: 20px; bottom: 20px; display: grid; gap: 8px; max-width: min(390px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border: 1px solid rgba(245,158,11,.22); border-radius: 9px; color: var(--teal-dark); background: var(--teal-pale); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .16s ease; }
.toast.is-error { border-color: rgba(243,156,155,.28); color: var(--red); background: var(--red-pale); }
.toast button { margin-left: auto; padding: 0; border: 0; color: inherit; background: transparent; font-size: 16px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Login and forbidden */
.login-page { background: var(--canvas); }
.login-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(390px, .9fr) minmax(380px, 1.1fr); }
.login-panel { display: flex; max-width: 565px; flex-direction: column; justify-content: center; padding: 50px clamp(35px, 9vw, 134px); }
.login-wordmark { margin-bottom: clamp(60px, 13vh, 138px); }
.login-copy h1, .forbidden-card h1 { max-width: 490px; margin: 0; color: var(--ink); font-size: clamp(34px, 4vw, 52px); font-weight: 650; letter-spacing: -.055em; line-height: 1.02; }
.login-copy > p:last-child { max-width: 440px; margin: 17px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-panel .form-notice { margin-bottom: 14px; }
.login-help { max-width: 430px; margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-aside { position: relative; overflow: hidden; background: var(--graphite); }
.login-grid { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(rgba(255,179,71,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,179,71,.1) 1px, transparent 1px); background-size: 58px 58px; transform: perspective(600px) rotateX(57deg) scale(1.5) translateY(17%); transform-origin: center; }
.login-aside::after { position: absolute; width: 500px; height: 500px; top: -130px; right: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(245,158,11,.22), transparent 68%); content: ""; }
.login-aside-copy { position: absolute; z-index: 1; left: 13%; bottom: 11%; color: #f1f5f1; }
.accent-line { display: block; width: 43px; height: 3px; margin-bottom: 17px; background: #f59e0b; }
.login-aside-copy p { margin: 0; font-size: clamp(23px, 3vw, 37px); font-weight: 500; letter-spacing: -.04em; line-height: 1.13; }
.forbidden-card { width: min(calc(100% - 32px), 650px); margin: 0 auto; padding: min(15vh, 130px) 0 42px; }
.forbidden-card .login-wordmark { margin-bottom: 66px; }
.forbidden-card > p:not(.eyebrow) { max-width: 530px; margin: 18px 0 25px; color: var(--muted); font-size: 14px; }

[hidden], .is-hidden { display: none !important; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-canvas { padding: 42px 34px 58px; }
}
@media (max-width: 840px) {
  .sidebar { width: min(288px, calc(100vw - 32px)); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 30px rgba(18,25,24,.22); }
  .sidebar.is-open { transform: translateX(0); }
  .console-shell::after { position: fixed; z-index: 30; inset: 0; display: none; background: rgba(20,29,27,.32); content: ""; }
  .console-shell.is-nav-open::after { display: block; }
  .console-frame { width: 100%; margin-left: 0; }
  .mobile-bar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); background: var(--paper); }
  .mobile-wordmark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: #120c04; background: var(--teal); font-size: 8px; font-weight: 800; letter-spacing: -.05em; text-decoration: none; }
  .language-button { min-width: 44px; height: 44px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--teal-dark); background: var(--paper); font-size: 12px; font-weight: 800; }
  .overview-grid, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .content-canvas { padding: 29px 17px 45px; }
  .page-header { display: grid; gap: 16px; margin-bottom: 24px; }
  .page-action, .page-action .button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 105px; padding: 13px; }
  .metric-value { margin-top: 12px; font-size: 25px; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; }
  .input-wrap { max-width: none; }
  .select { flex: 1; min-width: 0; }
  th, td { padding-right: 13px; padding-left: 13px; }
  .report-grid { grid-template-columns: 1fr; padding: 0 13px 13px; }
  .source-status { margin-right: 13px; margin-left: 13px; }
  .modal-header, .modal-body { padding-right: 17px; padding-left: 17px; }
  .modal-footer { padding-right: 17px; padding-left: 17px; }
  .setting-row { grid-template-columns: 1fr; gap: 3px; padding-right: 16px; padding-left: 16px; }
  .login-layout { display: block; }
  .login-panel { min-height: 100vh; padding: 40px 26px; }
  .login-wordmark { margin-bottom: clamp(57px, 13vh, 100px); }
  .login-aside { display: none; }
  .forbidden-card { padding-top: 72px; }
  .forbidden-card .login-wordmark { margin-bottom: 55px; }
}

/* A single report reader, with language inside the same document. */
.report-reader { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; background: var(--canvas); }
.reader-header { display: flex; align-items: center; flex-wrap: wrap; flex: 0 0 auto; gap: 16px; padding: 15px 26px; border-bottom: 1px solid var(--line); background: var(--paper); }
.reader-period { flex: 1 1 280px; min-width: 160px; }
.reader-period .select { width: 100%; }
.reader-languages { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.reader-languages a { padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 650; text-decoration: none; transition: color .18s ease,background .18s ease; }
.reader-languages a:hover { color: var(--ink); }
.reader-languages a[aria-current="true"] { color: var(--teal-dark); background: var(--teal-pale); }
.reader-back { color: var(--muted); font-size: 12px; text-decoration: none; }
.reader-back:hover { color: var(--teal-dark); }
.reader-frame { display: block; flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--canvas); }
@media (max-width: 840px) { .login-layout { grid-template-columns: minmax(0,1fr) minmax(0,.9fr); } .login-panel { padding: 40px 32px; } .reader-header { padding: 12px 16px; gap: 10px; } }
@media (max-width: 620px) { .login-layout { display: block; } .reader-period { flex-basis: calc(100% - 130px); } .reader-header .wordmark { flex: 0 0 110px; } .reader-back { margin-left: auto; } .card-header { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Date-selected reporting: one day or an inclusive reporting-period range. */
.report-date-panel { padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.report-date-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.date-control { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.date-control > span { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.date-control .input { width: 170px; min-height: 44px; }
.date-control .select { min-width: 180px; min-height: 44px; }
.report-date-filters > .button { min-height: 44px; white-space: nowrap; }
.report-date-filters > .card-note { padding-bottom: 10px; }
.date-selection-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.date-filter-error { flex-basis: 100%; margin: 0; color: var(--red); font-size: 12px; }
.reader-date-panel { flex: 0 0 auto; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.reader-title { flex: 1 1 240px; color: var(--ink); font-size: 14px; }
.matched-report-control { flex: 1 1 250px; }
.reader-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; }
.reader-empty h1 { font-size: 22px; }
.reader-empty p { color: var(--muted); font-size: 14px; }
@media (max-width: 620px) {
  .reader-date-panel, .report-date-panel { padding: 14px 16px; }
  .report-date-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .date-control .input, .date-control .select { width: 100%; min-width: 0; }
  .matched-report-control, .date-filter-error { grid-column: 1 / -1; }
  .reader-title { order: 3; flex-basis: 100%; }
  .date-selection-note { font-size: 12px; }
}

/* Full-period searches: source granularity is explicit, never prorated. */
.period-coverage { display: block; margin-top: 16px; color: var(--ink); font-size: 13px; font-weight: 650; }
.report-date-filters .date-control .select { max-width: 360px; }
@media (max-width: 620px) { .report-date-filters .date-control .select { max-width: 100%; } }

/* Finished login artwork: preserve the complete brand/caption at every visible size. */
.login-aside--artwork { position: sticky; top: 0; align-self: start; height: 100vh; height: 100svh; isolation: isolate; background: #03060d; }
.login-aside--artwork::after { content: none; }
.login-artwork { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }

/* Shared workspace structure; no report or credential composition changes. */
.ui-icon { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-group { display: grid; min-width: 0; gap: 4px; }
.nav-group-label { margin: 0 12px 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar-close { display: none; }
.workspace-health { margin-top: 32px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.health-grid { display: grid; grid-template-columns: minmax(0,1.6fr) repeat(2,minmax(0,1fr)); gap: 24px; }
.health-group { min-width: 0; padding: 24px; }
.health-label { margin: 0; color: var(--muted); font-size: 13px; }
.health-value { margin: 8px 0 0; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.health-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.health-accounts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; }
.health-accounts div { display: flex; align-items: baseline; gap: 6px; }
.health-accounts dt { color: var(--muted); font-size: 12px; }
.health-accounts dd { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.workspace-health .status-strip { margin-top: 16px; }
.overview-grid .table-scroll table { min-width: 480px; }
.table-scroll > table { min-width: 600px; }
.activity-icon .ui-icon { width: 16px; height: 16px; }
.card-note, .health-note, .page-subtitle, .activity-summary, .activity-meta { overflow-wrap: anywhere; }
body.modal-open, body.drawer-open { overflow: hidden; }
::selection { color: #172235; background: #ffd08a; }
@media (max-width:1120px) {
  .content-canvas { padding: 32px 24px 56px; }
  .overview-grid { grid-template-columns: 1fr; }
  .health-grid { gap: 16px; }
  .health-group { padding: 20px; }
}
@media (max-width:840px) {
  .sidebar-close { display: inline-grid; }
  .sidebar:not(.is-open) { visibility: hidden; }
  .console-shell::after { background: var(--overlay); }
  .mobile-bar { gap: 8px; }
}
@media (max-width:620px) {
  .content-canvas { padding: 24px 16px 40px; }
  .page-heading { font-size: 28px; }
  .health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .health-group { padding: 16px; }
  .health-group--accounts { grid-column: 1 / -1; }
  .health-value { font-size: 28px; }
  .card-header { padding: 20px 16px; }
  .activity-item { padding: 16px; }
  .status-strip { padding: 16px; }
  .overview-grid { gap: 24px; }
}
@media (max-width:360px) { .mobile-wordmark { display: none; } .mobile-bar { padding: 8px 12px; } }

@media (max-width:360px) { .sidebar-brand-row .wordmark-text { display: none; } }
