@import url("strix-tokens-Ix9a-Rx.css");

/*
 * Operations shell, redesign per design_handoff_middleware_dashboard (17
 * sep): sticky black header with pill nav, status hero, triage-first
 * layout, bento cards. Light is the default theme (handoff fidelity); the
 * dark theme keeps the same structure on the existing token layer.
 */

:root {
    --bg-page: #F7F7F5;
    --bg-surface: #FFFFFF;
    --bg-inset: #EEEEEE;
    --bg-tile: #F7F7F5;
    --bg-topbar: #000000;
    --text-1: #000000;
    --text-2: #222222;
    --text-3: #595959;
    --text-muted: #8A8A8A;
    --text-on-dark-1: #FFFFFF;
    --text-on-dark-2: #D8D8DD;
    --text-on-dark-3: #8F93A3;
    --border-1: rgba(0, 0, 0, 0.08);
    --border-2: rgba(0, 0, 0, 0.06);
    --accent-text: #8A6D00;
    --alert-text: #C62828;
    --alert-bg: rgba(198, 40, 40, 0.08);
    --alert-border: rgba(198, 40, 40, 0.35);
    --menu-shadow: var(--shadow-card);
    --card-hover-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 18px 48px -12px rgba(0, 0, 0, 0.18);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme='dark'] {
    --bg-page: var(--strix-black-alt);
    --bg-surface: var(--strix-ink);
    --bg-inset: var(--strix-graphite);
    --bg-tile: var(--strix-black-alt);
    --bg-topbar: var(--strix-black);
    --text-1: var(--strix-white);
    --text-2: var(--strix-paper);
    --text-3: var(--strix-fog);
    --text-muted: var(--strix-mist);
    --border-1: var(--strix-graphite);
    --border-2: rgba(255, 255, 255, 0.06);
    --accent-text: var(--strix-yellow);
    --alert-text: #FF5A5A;
    --alert-bg: rgba(255, 90, 90, 0.12);
    --alert-border: rgba(255, 90, 90, 0.4);
    --menu-shadow: var(--shadow-lift);
    --card-hover-shadow: var(--shadow-lift);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-2);
    font-family: 'Poppins', system-ui, sans-serif;
    min-height: 100vh;
}

a { color: var(--text-1); text-decoration: none; }
.num, .value, .metric, .clock, .triage-count, .side-value, .tile-value { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 32px;
    background: var(--bg-topbar);
    color: var(--text-on-dark-1);
}

.topbar .brand { display: flex; align-items: baseline; gap: 10px; }
.topbar .brand .wordmark { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.topbar .brand .wordmark span { color: var(--strix-yellow); }
.topbar .brand .brand-sub { font-size: 15px; font-weight: 400; color: var(--text-on-dark-3); }

.topbar .topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar .topnav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-on-dark-2);
    padding: 7px 14px;
    border-radius: 999px;
    transition: background 200ms var(--ease);
}
.topbar .topnav a:hover { background: rgba(255, 255, 255, 0.1); }
.topbar .topnav a.active { font-weight: 600; background: var(--strix-yellow); color: #000; }
.topbar .topnav a .nav-badge { color: var(--strix-yellow); font-weight: 600; margin-left: 6px; }
.topbar .topnav a.active .nav-badge { color: #000; }

.topbar .meta { display: flex; align-items: center; gap: 14px; }
.topbar .clock { font-size: 12px; color: var(--text-on-dark-3); }

.profile { position: relative; }
.profile summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.profile summary::-webkit-details-marker { display: none; }
.avatar {
    width: 30px; height: 30px; border-radius: 999px;
    background: var(--strix-yellow); color: #000;
    display: grid; place-items: center;
    font-weight: 700; font-size: 13px;
}
.profile-menu {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 230px;
    background: var(--bg-surface);
    border: 1px solid var(--border-1);
    border-radius: 20px;
    box-shadow: var(--menu-shadow);
    padding: 8px;
    z-index: 40;
    color: var(--text-2);
}
.profile-menu .profile-id { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-1); margin-bottom: 6px; }
.profile-menu .profile-id .email { font-size: 13px; color: var(--text-1); font-weight: 600; word-break: break-all; }
.profile-menu .profile-id .role { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: var(--bg-inset); color: var(--text-3); border-radius: 999px; padding: 3px 10px; }
.profile-menu .menu-item {
    display: block; width: 100%; text-align: left;
    padding: 9px 12px; border: 0; border-radius: 12px;
    background: none; color: var(--text-2);
    font: inherit; font-size: 14px; cursor: pointer;
}
.profile-menu .menu-item:hover { background: var(--bg-inset); color: var(--text-1); }

/* ------------------------------------------------------------------ page */
main { max-width: 1440px; margin: 0 auto; padding: 32px 32px 80px; display: flex; flex-direction: column; gap: 24px; }
/* The poll fragment replaces #stats' innerHTML, so the section gap must
   live on the container itself (Erwin, 17 sep: missing margins). */
#stats { display: flex; flex-direction: column; gap: 24px; }

.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.micro-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.mono { font-family: ui-monospace, Menlo, monospace; }

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-1);
    border-radius: 32px;
    padding: 28px 32px;
}
.metric { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; color: var(--text-1); line-height: 1.05; }

/* ------------------------------------------------------------------ hero */
.hero {
    background: var(--strix-yellow);
    color: #000;
    border-radius: 32px;
    padding: 36px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 40px;
    align-items: end;
}
.hero .eyebrow { color: rgba(0, 0, 0, 0.6); }
.hero h1 { margin: 10px 0 0; font-size: 56px; font-weight: 600; line-height: 1.02; letter-spacing: -0.03em; color: #000; }
.hero .lead { margin-top: 14px; font-size: 17px; line-height: 1.5; max-width: 46ch; color: rgba(0, 0, 0, 0.78); }
.hero .actions { display: flex; gap: 10px; margin-top: 24px; }
.hero .side { border-left: 1px solid rgba(0, 0, 0, 0.18); padding-left: 32px; display: flex; flex-direction: column; gap: 12px; }
.hero .side .block + .block { border-top: 1px solid rgba(0, 0, 0, 0.18); padding-top: 12px; }
.hero .side .micro-label { color: rgba(0, 0, 0, 0.55); }
.hero .side .side-value { font-size: 26px; font-weight: 600; color: #000; }
.hero .side .side-sub { font-size: 13px; color: rgba(0, 0, 0, 0.65); }

.btn {
    display: inline-block;
    border: 0; border-radius: 999px;
    padding: 12px 22px;
    font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn--primary { background: #000; color: var(--strix-yellow); }
.btn--primary:hover { background: #222; }
.btn--ghost { background: transparent; color: #000; border: 1.5px solid rgba(0, 0, 0, 0.35); padding: 10.5px 22px; }
.btn--ghost:hover { border-color: #000; }
.btn--retry { background: var(--strix-yellow); color: #000; font-size: 13px; padding: 8px 16px; border: 0; border-radius: 999px; font-weight: 600; cursor: pointer; }
.btn--retry:hover { background: #000; color: var(--strix-yellow); }

/* ---------------------------------------------------------------- checks */
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.check {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-1);
    border-radius: 20px;
    padding: 18px 20px;
    color: var(--text-2);
    transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.check:hover { transform: translateY(-2px); box-shadow: var(--card-hover-shadow); }
.check .status { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.check .dot { width: 8px; height: 8px; border-radius: 999px; }
.check .dot--ok { background: #1C6589; }
.check .dot--warn { background: var(--strix-yellow); }
.check .dot--alarm { background: var(--alert-text); }
.check .title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.check .detail { font-size: 13px; color: var(--text-3); }

/* ---------------------------------------------------------------- triage */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split .col { display: flex; flex-direction: column; gap: 24px; }

.triage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.triage-count { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; color: var(--alert-text); }
.triage-count.is-zero { color: var(--text-1); }
.triage-meta { font-size: 14px; color: var(--text-3); }
.triage-meta strong { color: var(--alert-text); font-weight: 600; }

.segmented { display: flex; gap: 6px; background: var(--bg-inset); padding: 4px; border-radius: 999px; }
.segmented button {
    border: 0; background: transparent;
    color: var(--text-3);
    font: inherit; font-size: 13px; font-weight: 600;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
    transition: background 200ms var(--ease), color 200ms var(--ease);
}
.segmented button.active { background: #000; color: var(--strix-yellow); }
.segmented .range-tab {
    display: inline-block;
    font-size: 13px; font-weight: 600;
    color: var(--text-3);
    padding: 7px 14px; border-radius: 999px;
    transition: background 200ms var(--ease), color 200ms var(--ease);
}
.segmented .range-tab.active { background: #000; color: var(--strix-yellow); }

.triage-table { margin-top: 18px; }
.triage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 120px;
    gap: 16px; align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-2);
}
.triage-row:hover { background: var(--bg-tile); }
.triage-row.header {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0 0 8px; border-bottom: 1px solid var(--border-1);
}
.triage-row.header:hover { background: transparent; }
.triage-row .cause { font-size: 15px; font-weight: 500; color: var(--text-1); overflow-wrap: anywhere; }
.triage-row .aspect { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.triage-row .count { font-size: 17px; font-weight: 600; text-align: right; color: var(--text-1); }
.triage-row .action { text-align: right; }
.triage-foot {
    margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-1);
    display: flex; justify-content: space-between; gap: 16px;
    font-size: 13px; color: var(--text-3);
}
.triage-foot a { font-weight: 600; color: var(--text-1); border-bottom: 1px solid var(--strix-yellow); }

/* ---------------------------------------------------------- completeness */
.progress-track { height: 12px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; margin-top: 16px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--strix-yellow); }
.progress-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-3); margin-top: 10px; }
.progress-legend strong { color: var(--text-1); }
.progress-legend .missing strong { color: var(--alert-text); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border-1); }
.stat-grid .stat-value { font-size: 20px; font-weight: 600; color: var(--text-1); margin-top: 2px; }
.footnote { font-size: 12px; color: var(--text-muted); margin-top: 14px; }

.card--dark { background: #000; border-color: #000; color: var(--text-on-dark-2); }
.card--dark .eyebrow { color: var(--text-on-dark-3); }
.card--dark .metric { color: var(--strix-yellow); }
.card--dark .metric-sub { font-size: 14px; color: var(--text-on-dark-2); }
.card--dark p { font-size: 14px; line-height: 1.5; color: var(--text-on-dark-2); margin: 12px 0 0; }
.card--dark a { display: inline-block; margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--strix-yellow); border-bottom: 1px solid var(--strix-yellow); }

/* ----------------------------------------------------------------- chart */
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.chart-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.chart-legend { display: flex; gap: 20px; font-size: 13px; color: var(--text-3); align-items: center; }
.chart-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.chart-legend .line-swatch { display: inline-block; width: 14px; height: 2px; background: var(--text-1); margin-right: 6px; vertical-align: middle; }
.chart-plot { position: relative; height: 170px; border-bottom: 1px solid rgba(0, 0, 0, 0.12); margin-top: 24px; display: flex; align-items: flex-end; gap: 4px; }
[data-theme='dark'] .chart-plot { border-bottom-color: rgba(255, 255, 255, 0.2); }
.chart-plot .expected-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(0, 0, 0, 0.35); }
[data-theme='dark'] .chart-plot .expected-line { border-top-color: rgba(255, 255, 255, 0.4); }
.chart-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; opacity: 0.92; }
.chart-bar:hover { opacity: 1; }
.chart-bar .seg-failed { background: var(--alert-text); border-radius: 2px 2px 0 0; }
.chart-bar .seg-done { background: var(--strix-yellow); }
.chart-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.chart-note { font-size: 13px; color: var(--text-3); margin-top: 14px; }

/* ------------------------------------------------------ traffic + server */
.traffic-list { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.traffic-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 16px; align-items: center; }
.traffic-row .name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-row .bar-track { height: 6px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; margin-top: 6px; }
.traffic-row .bar-fill { height: 100%; border-radius: 999px; background: var(--text-1); }
.traffic-row .n { font-size: 14px; font-weight: 600; color: var(--text-1); text-align: right; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 22px; }
.tile { background: var(--bg-tile); border-radius: 20px; padding: 18px 20px; }
.tile .tile-value { font-size: 24px; font-weight: 600; color: var(--text-1); margin-top: 4px; }
.tile .tile-value.alert { color: var(--alert-text); }
.closing-note { font-size: 13px; line-height: 1.5; color: var(--text-3); margin-top: 18px; }

.card-head-right { font-size: 13px; color: var(--text-muted); }
.flex-between { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }

/* ----------------------------------------------------------------- toast */
.toast {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    background: #000; color: #fff;
    font-size: 14px; font-weight: 500;
    padding: 14px 22px; border-radius: 999px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
    z-index: 40;
}

/* ------------------------------------------------------ overige schermen */
.error {
    background: var(--alert-bg);
    border: 1px solid var(--alert-border);
    color: var(--alert-text);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
}
.flash-success { border-color: var(--strix-yellow); margin-bottom: 16px; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td, table.mini th { padding: 8px 6px; border-bottom: 1px solid var(--border-2); text-align: left; }
table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.mini th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
table.writes { table-layout: fixed; }
table.writes .col-time { width: 150px; }
table.writes .col-entity { width: 160px; }
table.writes td { vertical-align: top; }
table.patterns td { vertical-align: top; }
table.patterns td.num { width: 60px; white-space: nowrap; }
.cell-main { color: var(--text-1); overflow-wrap: anywhere; }
.cell-sub { margin-top: 2px; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
details.raw { margin-top: 6px; }
details.raw summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent-text); }
details.raw pre {
    margin: 8px 0 0;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-1);
    background: var(--bg-inset);
    padding: 12px 14px;
    border-radius: 12px;
}
.info-tip { position: relative; cursor: help; border-bottom: 1px dotted currentColor; outline: none; }
.info-tip::before { content: 'ⓘ'; margin-right: 4px; font-size: 11px; opacity: 0.6; }
.info-tip::after {
    content: attr(data-tip);
    position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20;
    width: 280px; padding: 10px 12px; border-radius: 12px;
    background: var(--bg-topbar); color: var(--text-on-dark-1); border: 1px solid var(--border-1);
    font-size: 12px; font-weight: 400; line-height: 1.45; white-space: normal;
    box-shadow: var(--menu-shadow);
    opacity: 0; visibility: hidden; transition: opacity 0.12s var(--ease);
    pointer-events: none;
}
.info-tip:hover::after, .info-tip:focus-visible::after { opacity: 1; visibility: visible; }
.accent-text { color: var(--accent-text); }
.alert-text { color: var(--alert-text); }
.muted-text { color: var(--text-3); }
.btn-small { padding: 6px 14px; font-size: 12px; background: var(--strix-yellow); color: #000; border: 0; border-radius: 999px; font-weight: 600; cursor: pointer; }
.btn-small:hover { background: #000; color: var(--strix-yellow); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cards .card h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.cards .card .value { font-size: 28px; font-weight: 600; color: var(--text-1); }
.cards .card .value.accent { color: var(--accent-text); }
.cards .card .value.alert { color: var(--alert-text); }
.cards .card .sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* login */
.login-wrap { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: min(380px, 92vw); background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: 32px; padding: 32px; }
.login-card h1 { margin: 0 0 20px; font-size: 18px; font-weight: 600; color: var(--text-1); }
.login-card label { display: block; font-size: 13px; color: var(--text-3); margin: 14px 0 6px; }
.login-card input, input.field, select.field {
    width: 100%; padding: 11px 14px; border-radius: 12px;
    border: 1px solid var(--border-1); background: var(--bg-tile);
    color: var(--text-1); font: inherit;
}
.login-card button { margin-top: 22px; width: 100%; padding: 12px; border: 0; border-radius: 999px; background: var(--strix-yellow); color: #000; font-weight: 700; font-size: 14px; cursor: pointer; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
    .hero { grid-template-columns: 1fr; }
    .hero h1 { font-size: 40px; }
    .hero .side { border-left: 0; padding-left: 0; }
    .split { grid-template-columns: 1fr; }
    main { padding: 20px 16px 60px; }
    .topbar { padding: 0 16px; }
}

/* ------------------------------------------- content work list (ADR-0018) */
.worklist-controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 10px; }
.worklist-controls .segmented { flex-wrap: wrap; }
table.worklist td { vertical-align: top; }
table.worklist .claim-cell { min-width: 140px; }
.group-items summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent-text); margin-top: 4px; }
.group-keys { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; max-width: 520px; }
.claim-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg-inset); color: var(--text-2); }
.claim-badge--mine { background: var(--strix-yellow); color: #000; }
.claim-pop summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent-text); list-style: none; }
.claim-pop summary::-webkit-details-marker { display: none; }
.claim-pop[open] form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; min-width: 200px; }
.inline-form { display: inline; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--accent-text); cursor: pointer; text-decoration: underline; }
.link-button:hover { color: var(--text-1); }

.dialog {
    width: min(560px, calc(100vw - 32px));
    border: 1px solid var(--border-1); border-radius: 20px;
    background: var(--bg-surface); color: var(--text-1);
    padding: 22px 24px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-head h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.dialog-x { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--text-3); cursor: pointer; }
.dialog-status { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; background: var(--bg-inset); }
.dialog-status--ok { background: rgba(255, 219, 50, 0.2); border: 1px solid var(--strix-yellow); }
.dialog-status--warn, .dialog-status--error { background: var(--alert-bg); border: 1px solid var(--alert-border); }
.dialog-status--error strong, .dialog-status--warn strong { color: var(--alert-text); }
.dialog-list { list-style: none; padding: 0; margin: 14px 0 0; max-height: 260px; overflow-y: auto; font-size: 13px; }
.dialog-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-2); }
.dialog-icon { flex: 0 0 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--bg-inset); color: var(--text-3); }
.dialog-item--live .dialog-icon { background: var(--strix-yellow); color: #000; }
.dialog-item--unimportable .dialog-icon, .dialog-item--failed .dialog-icon { background: var(--alert-text); color: #fff; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 18px; }
.spinner { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; border-radius: 999px; border: 2.5px solid var(--border-1); border-top-color: var(--text-1); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* --------------------------------------------- results page (ADR-0019) */
/* Series colors validated with the dataviz palette validator, per mode. */
:root {
    --series-synced: #B08A00;
    --series-blocked: #2F6FC2;
    --series-failed: #C62828;
}
[data-theme='dark'] {
    --series-synced: #AD8B00;
    --series-blocked: #4F80D0;
    --series-failed: #E04848;
}
.results-lead { font-size: 15px; color: var(--text-3); margin: -6px 0 18px; max-width: 70ch; }
.results-filter { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.results-filter .segmented { flex-wrap: wrap; }
.results-dates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.results-dates .field { width: auto; padding: 7px 10px; }
.results-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.results-tiles .tile { background: var(--bg-surface); border: 1px solid var(--border-1); }
.tile-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.tile-figure { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-1); margin-top: 6px; }
.tile-note { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.key { display: inline-block; flex: 0 0 10px; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
.key--synced { background: var(--series-synced); }
.key--blocked { background: var(--series-blocked); }
.key--failed { background: var(--series-failed); }
.chart-legend { flex-wrap: wrap; }

.rchart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: var(--plot-h) auto; column-gap: 10px; margin-top: 24px; }
.rchart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-6px); height: calc(var(--plot-h) + 12px); margin-bottom: -12px; }
.rchart-plot { position: relative; height: var(--plot-h); border-bottom: 1px solid var(--border-1); }
.rchart-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--border-2); }
.rchart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.rchart-col { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.rchart-col:hover, .rchart-col:focus-visible { background: var(--bg-inset); border-radius: 4px 4px 0 0; }
.rchart-col:focus-visible { box-shadow: inset 0 0 0 2px var(--text-1); }
.rchart-stack { width: 100%; max-width: 24px; display: flex; flex-direction: column; gap: 2px; }
.rchart-stack .seg:first-child { border-radius: 4px 4px 0 0; }
.seg--synced { background: var(--series-synced); }
.seg--blocked { background: var(--series-blocked); }
.seg--failed { background: var(--series-failed); }
.rchart-tip {
    display: none; position: absolute; top: 4px; left: 60%; z-index: 5;
    min-width: 190px; padding: 10px 12px; border-radius: 10px;
    background: var(--bg-surface); border: 1px solid var(--border-1); box-shadow: var(--card-hover-shadow);
    font-size: 12px; line-height: 1.7; color: var(--text-2); white-space: nowrap; pointer-events: none;
}
.rchart-tip strong { display: block; color: var(--text-1); }
.tip-row { display: flex; align-items: center; }
.tip-row b { margin-left: auto; padding-left: 16px; color: var(--text-1); font-variant-numeric: tabular-nums; }
.rchart-tip--left { left: auto; right: 60%; }
.rchart-col:hover .rchart-tip, .rchart-col:focus-visible .rchart-tip { display: block; }
.rchart-x { grid-column: 2; display: flex; gap: 2px; margin-top: 6px; font-size: 11px; color: var(--text-muted); }
.rchart-x span { flex: 1 1 0; text-align: center; white-space: nowrap; overflow: visible; min-width: 0; }

.results-help { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border-1); }
.results-help h3 { margin: 0 0 8px; font-size: 15px; }
.results-help ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.results-help li { padding-left: 18px; text-indent: -18px; }
.results-help li .key { margin-right: 8px; }
.results-table { margin-top: 18px; }
.results-table summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-text); margin-bottom: 8px; }
@media (max-width: 640px) {
    .rchart-tip { min-width: 160px; }
    .tile-figure { font-size: 26px; }
}

.model-notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; background: var(--bg-inset); color: var(--text-2); }
.model-notice--none { background: rgba(255, 219, 50, 0.2); border: 1px solid var(--strix-yellow); }
