/* ══════════════════════════════════════════════════════════════════════════
   One Global Operations — the shell: rail, top bar, content, and the shared components
   (cards, badges, chips, buttons, tables, forms, drawer base, toasts, sheet). Tokens: tokens.css.
   ══════════════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    background: var(--bg-0); color: var(--text);
    font-family: var(--font); font-size: var(--fs-14); line-height: var(--lh);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

/* ── App grid ────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
html[data-rail="collapsed"] .app, html[data-layout="tower"] .app { grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr); }
html[data-layout="tower"] body { overflow: hidden; }

/* ── Rail ────────────────────────────────────────────────────────────────── */
.rail {
    background: var(--bg-1); border-right: 1px solid var(--line);
    padding: 10px 8px 12px; position: sticky; top: 0; height: 100vh; overflow: hidden auto;
    display: flex; flex-direction: column; gap: 2px; z-index: 30;
}
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 16px; color: var(--text); text-decoration: none; }
.rail-brand:hover { text-decoration: none; }
.rail-brand .mark { flex: none; }
.rail-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.rail-brand-name { font-weight: 600; font-size: var(--fs-14); letter-spacing: -.01em; white-space: nowrap; }
.rail-brand-sub { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: var(--track-label); white-space: nowrap; }
.rail-heading { padding: 14px 12px 6px; font-size: var(--fs-11); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.rail-group { display: flex; flex-direction: column; gap: 1px; }
.rail-item {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius);
    color: var(--text-2); font-weight: 500; font-size: var(--fs-13); text-decoration: none; white-space: nowrap;
    transition: background var(--dur-fast), color var(--dur-fast);
}
.rail-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.rail-item.active { background: var(--accent-wash); color: var(--text); }
.rail-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand); }
.rail-item .ico { width: 18px; text-align: center; flex: none; color: var(--item-hue, inherit); }
.rail-item .count { margin-left: auto; font-size: var(--fs-11); font-weight: 600; background: var(--surface-3); color: var(--text-2); border-radius: var(--radius-pill); padding: 1px 7px; font-variant-numeric: tabular-nums; }
.rail-item-family { color: var(--text-3); font-weight: 400; }
.rail-collapse { margin-top: auto; align-self: flex-end; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text-3); display: grid; place-items: center; }
.rail-collapse:hover { color: var(--text); background: var(--surface-2); }
html[data-rail="collapsed"] .rail, html[data-layout="tower"] .rail { padding-left: 6px; padding-right: 6px; }
html[data-rail="collapsed"] .rail-label, html[data-layout="tower"] .rail-label,
html[data-rail="collapsed"] .rail-brand-text, html[data-layout="tower"] .rail-brand-text,
html[data-rail="collapsed"] .rail-heading, html[data-layout="tower"] .rail-heading { display: none; }
html[data-rail="collapsed"] .rail-item, html[data-layout="tower"] .rail-item { justify-content: center; padding: 10px 0; }
html[data-rail="collapsed"] .rail-item .count, html[data-layout="tower"] .rail-item .count { position: absolute; top: 2px; right: 2px; margin: 0; padding: 0 5px; font-size: 10px; }
html[data-rail="collapsed"] .rail-brand, html[data-layout="tower"] .rail-brand { justify-content: center; padding: 8px 0 14px; }
html[data-rail="collapsed"] .rail-collapse i, html[data-layout="tower"] .rail-collapse i { transform: rotate(180deg); }
html[data-layout="tower"] .rail-collapse { display: none; }

/* ── Main, top bar ───────────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar {
    display: flex; align-items: center; gap: 10px; padding: 0 20px; height: var(--topbar-h);
    background: var(--bg-1); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25;
}
.topbar h1 { font-size: var(--fs-16); font-weight: 600; margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar-title { min-width: 0; display: flex; align-items: center; gap: 8px; }
.topbar-glass { background: var(--glass); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%); border-bottom: 1px solid var(--glass-border); }
.content { padding: 24px 28px 64px; max-width: 1680px; width: 100%; }

.crumbs { display: flex; align-items: center; gap: 2px; }
.crumb { background: transparent; border: none; color: var(--text-2); font-weight: 500; font-size: var(--fs-14); padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.active { color: var(--text); font-weight: 600; }
.crumb + .crumb::before { content: "›"; color: var(--text-3); margin-right: 8px; font-weight: 400; }

.clock-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-12); margin: 0; }
.clock-pill.is-story { border-color: var(--accent-wash); }
.clock-pill-label { font-weight: 600; }
.clock-pill-time { color: var(--text-2); }
.clock-pill-switch { border: none; background: var(--surface-3); color: var(--text-2); border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--fs-11); font-weight: 600; }
.clock-pill-switch:hover { background: var(--accent-wash); color: var(--text); }

.label-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--fs-11); font-weight: 600; letter-spacing: .02em; white-space: nowrap; border: 1px solid var(--line); color: var(--text-2); background: var(--surface); }
.label-chip.label-simulated { color: var(--accent); border-color: var(--accent-wash); background: var(--accent-wash); }
.label-chip.label-computed { color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.label-chip.label-concept { color: var(--text-2); border-style: dashed; }
.label-chip.label-xs { padding: 1px 7px; font-size: 10px; }

.persona { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--text); text-decoration: none; max-width: 320px; }
.persona:hover { background: var(--surface-2); text-decoration: none; }
.persona-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.persona-name { font-size: var(--fs-12); font-weight: 600; white-space: nowrap; }
.persona-title { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; font-size: var(--fs-11); font-weight: 700; letter-spacing: .02em; }
.avatar-lg { width: 40px; height: 40px; font-size: var(--fs-13); }

.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; color: var(--text-2); display: grid; place-items: center; font-size: var(--fs-14); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid transparent; font-size: var(--fs-13); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); box-shadow: var(--shadow-1); }
.btn-accent { background: var(--accent); color: var(--text-inverse); }
.btn-accent:hover { box-shadow: var(--shadow-1); }
.btn-tonal { background: var(--accent-wash); color: var(--accent); }
.btn-tonal:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-text { background: transparent; color: var(--accent); padding-inline: 8px; }
.btn-sm { padding: 5px 12px; font-size: var(--fs-12); }
.btn-xs { padding: 3px 9px; font-size: var(--fs-11); }
.btn .fa-solid, .btn .fa-regular { font-size: .95em; }

/* ── Cards, grid ─────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; box-shadow: var(--shadow-1); }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-14); font-weight: 600; letter-spacing: -.01em; }
.card-head .sub, .sub { margin: 2px 0 0; font-size: var(--fs-12); color: var(--text-2); }
.card-head .spacer { flex: 1; }
.eyebrow { font-size: var(--fs-11); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-3); }
.hero { font-size: var(--fs-40); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: var(--fs-12); }

/* ── Badges, chips ───────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: var(--fs-11); font-weight: 600; white-space: nowrap; border: 1px solid transparent; background: var(--surface-3); color: var(--text-2); line-height: 1.5; }
.badge i { font-size: .95em; }
.badge.good, .badge[data-sla="comfortable"] { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.badge.warn, .badge[data-sla="at-risk"], .badge[data-sla="approaching"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.serious { color: var(--serious); background: color-mix(in srgb, var(--serious) 14%, transparent); }
.badge.critical, .badge[data-sla="breached"], .badge[data-sla="passed"] { color: var(--critical); background: var(--brand-wash); }
.badge.hold { color: var(--hold); background: color-mix(in srgb, var(--hold) 14%, transparent); }
.badge.stage { color: var(--text); background: var(--surface-3); }
.badge.product { color: var(--p, var(--accent)); background: color-mix(in srgb, var(--p, var(--accent)) 14%, transparent); }
.badge.degraded { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.ok { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.tier { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tier.PLATINUM { color: var(--text-2); } .tier.GOLD { color: #c9a227; } .tier.SILVER { color: #9aa3b2; } .tier.BRONZE { color: #a1662f; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font-size: var(--fs-12); font-weight: 500; text-decoration: none; white-space: nowrap; }
.chip:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.chip.active { background: var(--accent-wash); border-color: transparent; color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
table.data th { text-align: left; font-weight: 600; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: var(--fs-11); letter-spacing: .04em; text-transform: uppercase; position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.data td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; height: var(--row-h); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.mono { font-family: var(--font-mono); font-size: var(--fs-12); }
table.data tr.selected td { background: var(--surface-3); }
table.data tr.critical td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty-state .ico { font-size: 1.8rem; color: var(--text-3); margin-bottom: 10px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: var(--fs-12); color: var(--text-2); font-weight: 500; }
.field input, .field select, .field textarea, .input { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: var(--fs-13); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field .hint { font-size: var(--fs-11); color: var(--text-3); }
.select { padding: 5px 28px 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--text-2); font-size: var(--fs-12); appearance: none; }

/* ── Flash, toasts ───────────────────────────────────────────────────────── */
.flash { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: var(--fs-13); background: var(--surface-2); border: 1px solid var(--line); }
.flash.success { color: var(--good); }
.flash.error { color: var(--critical); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--radius); background: var(--glass-strong); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); box-shadow: var(--shadow-2); font-size: var(--fs-13); position: relative; overflow: hidden; animation: toast-in var(--dur-slow) var(--ease); }
.toast .fa-solid { color: var(--good); }
.toast.error .fa-solid { color: var(--critical); }
.toast-text { flex: 1; min-width: 0; }
.toast-action { border: 1px solid var(--line-strong); background: transparent; color: var(--accent); border-radius: var(--radius-pill); padding: 4px 10px; font-size: var(--fs-12); font-weight: 600; white-space: nowrap; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); width: 100%; transform-origin: left; animation: toast-drain var(--toast-ms, 6000ms) linear forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── Sheet (shortcuts) ───────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .5); display: grid; place-items: center; }
.sheet-panel { width: min(720px, 92vw); max-height: 86vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: var(--fs-16); }
.sheet-body { padding: 14px 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.keys-group h3 { margin: 6px 0 6px; font-size: var(--fs-11); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--text-3); }
table.keys { border-collapse: collapse; width: 100%; font-size: var(--fs-12); }
table.keys td { padding: 4px 6px 4px 0; vertical-align: top; color: var(--text-2); }
table.keys td:first-child { width: 110px; white-space: nowrap; }
kbd { font-family: var(--font-mono); font-size: var(--fs-11); background: var(--surface-3); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text); }

/* ── Drawer base (ui/drawer.js) ──────────────────────────────────────────── */
.drawer-host { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: var(--drawer-w); max-width: 100vw; z-index: 60; pointer-events: none; }
.drawer { height: 100%; display: flex; flex-direction: column; background: var(--glass-strong); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%); border-left: 1px solid var(--glass-border); box-shadow: var(--shadow-2); transform: translateX(100%); transition: transform var(--dur-slow) var(--ease); pointer-events: auto; }
.drawer.open { transform: none; }
html[data-layout="page"] .drawer { background: var(--surface); }
.drawer-head { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.drawer-head-row { display: flex; align-items: center; gap: 10px; }
.drawer-ref { font-family: var(--font-mono); font-size: var(--fs-14); font-weight: 600; }
.drawer-title { font-size: var(--fs-16); font-weight: 600; margin: 4px 0 2px; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-12); color: var(--text-2); margin-top: 6px; }
.drawer-meta b { color: var(--text); font-weight: 600; }
.drawer-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.drawer-tab { background: transparent; border: none; padding: 10px 10px; font-size: var(--fs-12); font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.drawer-tab:hover { color: var(--text); }
.drawer-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.drawer-body { flex: 1; overflow: auto; padding: 14px 18px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drawer-foot .spacer { flex: 1; }
.drawer-close { margin-left: auto; }

/* ── KPI tile (shared) ───────────────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; justify-content: space-between; min-height: var(--kpi-h); padding: 8px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; position: relative; overflow: hidden; }
.kpi-label { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: var(--fs-28); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; }
.kpi-value .of { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.kpi-value .unit { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-11); color: var(--text-3); }
.kpi-delta { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.kpi-delta.up { color: var(--good); } .kpi-delta.down { color: var(--serious); }
.kpi-spark { position: absolute; right: 8px; top: 8px; width: 72px; height: 22px; opacity: .8; }
.kpi.is-critical .kpi-value { color: var(--critical); }
.kpi.is-warn .kpi-value { color: var(--warn); }
.kpi[aria-busy="true"] .kpi-value { opacity: .55; }
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link:hover { border-color: var(--accent); text-decoration: none; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.health-ok { color: var(--good); } .health-degraded { color: var(--warn); } .health-retry { color: var(--serious); }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; font-size: var(--fs-12); }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; color: var(--text); font-weight: 500; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; display: flex; gap: 14px; padding: 6px 0 12px 0; }
.tl-node { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 4px; background: var(--surface-3); border: 2px solid var(--line-strong); z-index: 1; }
.tl.done .tl-node { background: var(--p, var(--accent)); border-color: var(--p, var(--accent)); }
.tl.current .tl-node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); animation: pulse 1.6s ease-in-out infinite; }
.tl.pending { opacity: .55; }
.tl.exception .tl-node { background: var(--warn); border-color: var(--warn); }
.tl-body { min-width: 0; flex: 1; }
.tl-title { font-weight: 600; font-size: var(--fs-13); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-when { font-size: var(--fs-11); color: var(--text-3); font-family: var(--font-mono); }
.tl-note { font-size: var(--fs-12); color: var(--text-2); margin-top: 2px; }
.tl-actor { font-size: var(--fs-11); color: var(--text-3); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--accent-wash); } 50% { box-shadow: 0 0 0 8px transparent; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Drawer internals (ui/drawer.js) ─────────────────────────────────────── */
.drawer.shake { animation: shake .45s var(--ease); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.stuck { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-wash); border: 1px solid var(--accent-wash); margin-bottom: 12px; font-size: var(--fs-13); }
.stuck .fa-solid { color: var(--accent); margin-top: 3px; }
.gantt { display: flex; flex-direction: column; gap: 4px; }
.gantt-totals { font-size: var(--fs-13); margin-bottom: 6px; }
.gantt-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; font-size: var(--fs-12); animation: gantt-in var(--dur-slow) var(--ease) both; }
.gantt-name { display: flex; align-items: center; gap: 7px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-name:hover { color: var(--accent); text-decoration: none; }
.gantt-track { position: relative; height: 18px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.gantt-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: var(--accent); opacity: .85; display: flex; align-items: center; padding: 0 6px; font-size: 10px; color: var(--text-inverse); white-space: nowrap; overflow: hidden; transform-origin: left; animation: gantt-grow .6s var(--ease) both; }
.gantt-bar.health-degraded { background: repeating-linear-gradient(135deg, var(--warn) 0 6px, color-mix(in srgb, var(--warn) 70%, transparent) 6px 12px); color: var(--text-inverse); }
.gantt-bar.health-retry { background: var(--serious); }
.gantt-bar span { mix-blend-mode: normal; }
@keyframes gantt-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gantt-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.kv-group { margin-bottom: 14px; }
.kv-group .eyebrow { margin-bottom: 6px; }
.kv.confirm { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 10px; }
.action-form { flex-basis: 100%; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
table.docs td { height: auto; }
.rail-brand-sub { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.rail-item-family .rail-label { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
