:root {
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --orange-500: #f97316;
    --orange-600: #ea580c;

    --bg-main: var(--slate-50);
    --bg-panel: #ffffff;
    --bg-card: var(--slate-100);
    --bg-sidebar: var(--slate-900);

    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-muted: var(--slate-500);

    --border: var(--slate-200);
    --border-strong: var(--slate-300);
    --border-light: var(--slate-300);

    --c-truth: var(--blue-600);
    --c-outcome: #7E22CE;
    --c-gov-pass: var(--emerald-600);
    --c-gov-fail: #dc2626;
    --c-worker: var(--orange-600);
    --c-sys-error: #BE123C;

    --font-sans: "Inter", system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", sans-serif;
    --font-mono: "Fira Code", ui-monospace, monospace;

    --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.10),
                   0 1px 2px 0 rgba(15, 23, 42, 0.06);
    --shadow-card-soft: 0 2px 10px rgba(15, 23, 42, 0.04),
                        0 8px 30px rgba(15, 23, 42, 0.06);
    --shadow-card-hover: 0 4px 15px rgba(15, 23, 42, 0.06),
                         0 12px 40px rgba(15, 23, 42, 0.12);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --radius-2xl: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-layout { display: flex; min-height: 100vh; height: auto; align-items: stretch; }
.sidebar { width: 64px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding-top: 16px; flex-shrink:0;}
.sidebar .logo { font-weight: 900; font-size: 20px; color: #38BDF8; margin-bottom: 32px; letter-spacing: -1px; }
.nav-item { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; cursor: pointer; color: #9CA3AF; font-weight: 600; }
.nav-item:hover { color: #FFFFFF; background: rgba(255,255,255,0.1); }
.nav-item.active { color: #38BDF8; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; overflow: visible; position:relative;}

/* Header */
.matter-header { background: var(--bg-panel); border-bottom: 1px solid var(--border); flex-shrink: 0; min-width: 0; }
.header-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--border); }
.scenario-selector { display: grid; grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 240px); align-items: center; gap: 10px; width: min(620px, 100%); min-width: 0; }
.scenario-selector[hidden] { display: none; }
.scenario-selector label { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0; }
.scenario-selector select { width: 100%; min-height: 34px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text-primary); padding: 6px 9px; font: inherit; }
.scenario-selector-copy { display: grid; gap: 2px; min-width: 0; font-size: 12px; color: var(--text-secondary); }
.scenario-selector-copy strong, .scenario-selector-copy span { min-width: 0; overflow-wrap: anywhere; }
.breadcrumb { color: var(--text-secondary); text-decoration: none; font-size: 12px; }
.breadcrumb:hover { color: var(--text-primary); }

@media (max-width: 1100px) {
    .header-top { flex-wrap: wrap; align-items: stretch; }
    .scenario-selector { width: 100%; grid-template-columns: 1fr; }
}

.btn { background: var(--bg-panel); border: 1px solid var(--border-strong); color: var(--text-primary); padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 600; box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);}
.btn:hover { background: var(--slate-50); border-color: var(--slate-400); }
.btn.primary { background: var(--c-truth); color: #FFFFFF; border-color: var(--c-truth); font-weight: 700;}
.btn.primary:hover { background: var(--blue-500); border-color: var(--blue-500); }
.btn.tiny { font-size: 10px; padding: 4px 8px; }

.header-main { padding: 12px 24px 14px; }
.matter-header-inner { max-width: 1680px; margin: 0 auto; }
.identity-block { margin-bottom: 10px; }
.matter-identity-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.identity-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.status-badge { padding: 2px 8px; border-radius: var(--radius-sm); font-weight: 800; font-size: 11px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.045em; border: 1px solid var(--blue-500); color: var(--blue-600); background: rgba(59, 130, 246, 0.08); }
.status-badge-review { border-color: var(--orange-500); color: var(--orange-600); background: rgba(249, 115, 22, 0.08); }
.status-badge-retainer { border-color: var(--emerald-500); color: var(--emerald-600); background: rgba(16, 185, 129, 0.08); }
.status-badge-fee { border-color: var(--slate-400); color: var(--slate-600); background: var(--slate-50); }
.matter-title-wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.identity-block h1 { font-size: 19px; font-weight: 800; color: var(--text-primary); letter-spacing: 0; }
.matter-id { font-size: 13px; font-family: var(--font-mono); color: var(--text-muted); }
.header-metadata { font-size: 13px; }
.matter-header-body { display: grid; grid-template-columns: minmax(360px, 0.72fr) minmax(520px, 1.28fr); gap: 16px; align-items: start; }
.matter-facts-compact { display: grid; grid-template-columns: repeat(2, minmax(130px, max-content)); gap: 8px 22px; max-width: 760px; align-items: start; }
.matter-truth-zone { min-width: 0; }
.matter-state-stack { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.matter-callouts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.mh-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mh-item span { color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.055em; font-weight: 800; }
.mh-item strong { font-weight: 700; line-height: 1.3; color: var(--text-primary); overflow-wrap: anywhere; }
.mh-item strong .matter-state-line { display: block; color: var(--text-primary); font-size: 13px; letter-spacing: 0; line-height: 1.34; text-transform: none; }
.mh-item strong .matter-state-revenue { color: var(--orange-600); margin-top: 3px; }
.mh-item strong .matter-boundary-line { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 11px; font-weight: 650; letter-spacing: 0; line-height: 1.35; text-transform: none; }
.mh-item strong .matter-proof-chain { color: var(--text-secondary); margin-top: 3px; }
.mh-item strong .matter-primitive-line { display: block; margin-top: 3px; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 650; letter-spacing: 0; line-height: 1.3; text-transform: none; }
.mh-fact strong { color: var(--slate-800); font-weight: 700; }
.mh-state { background: var(--slate-50); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px 10px; }
.mh-callout { border-radius: var(--radius-lg); padding: 8px 10px; border: 1px solid var(--border); }
.mh-next { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.16); }
.mh-next span { color: #1e40af; }
.mh-next strong { color: #1e3a8a; }
.mh-risk { background: rgba(249, 115, 22, 0.09); border-color: rgba(249, 115, 22, 0.18); }
.mh-risk span { color: #9a3412; }
.mh-risk strong { color: #7c2d12; }
.text-truth { color: var(--c-truth); }
.text-worker { color: var(--c-worker); }
.text-error { color: var(--c-gov-fail); }

/* Outcome Strip */
.outcome-strip {
    display: flex;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(248,250,252,0.88));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 14px 24px;
    gap: 18px;
    font-size: 11px;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    scroll-padding-inline: 24px;
}
.outcome-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
    pointer-events: none;
}
.os-group { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; position: relative; z-index: 1; }
.os-group-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0;
    text-transform: uppercase;
}
.os-group-title:hover { color: var(--text-primary); }
.os-group-title:focus { outline: none; }
.os-group-title:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.35); outline-offset: 4px; border-radius: var(--radius-sm); }
.os-group-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--slate-400); flex: 0 0 auto; }
.os-toggle-indicator {
    width: 17px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.85);
    color: var(--slate-600);
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.os-group-body { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 10px; width: max-content; }
.os-group-cards { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 10px; align-items: stretch; }
.os-group.collapsed .os-group-cards { display: none; }
.os-group:not(.collapsed) .os-summary-card { display: none; }
.os-summary-card {
    width: 188px;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-top: 3px solid var(--emerald-500);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    box-shadow: var(--shadow-card-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.os-summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: var(--emerald-500); }
.os-summary-card:focus { outline: none; }
.os-summary-card:focus-visible { outline: 2px solid rgba(5, 150, 105, 0.35); outline-offset: 3px; }
.os-summary-card strong,
.os-summary-card span { position: relative; z-index: 1; }
.os-summary-card strong { font-size: 14px; font-weight: 850; color: var(--emerald-600); line-height: 1.2; }
.os-summary-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 850; }
.os-summary-card span:last-child { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.os-summary-card.needs-review {
    border-color: rgba(249, 115, 22, 0.35);
    border-top-color: var(--orange-500);
    background: rgba(255, 247, 237, 0.96);
}
.os-summary-card.needs-review strong { color: var(--orange-600); }
.os-summary-card.is-active {
    border-color: rgba(100, 116, 139, 0.30);
    border-top-color: var(--slate-400);
}
.os-summary-card.is-active strong { color: var(--slate-700); }
.os-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-strong);
    border-top-width: 3px;
    border-top-color: var(--slate-400);
    padding: 11px 12px;
    border-radius: var(--radius-md);
    width: 188px;
    min-height: 104px;
    box-shadow: var(--shadow-card-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.os-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.os-item.status-Achieved { border-top-color: var(--emerald-500); }
.os-item.status-Blocked,
.os-item.status-HumanJudgmentRequired { border-top-color: var(--orange-500); }
.os-item.status-InProgress { border-top-color: var(--c-outcome); }
.os-item.status-Evaluated { border-top-color: var(--slate-400); }

.os-name { font-weight: 800; font-size: 12px; color: var(--text-primary); margin-bottom: 5px; position: relative; z-index: 1; line-height: 1.25; }
.os-state { display: flex; align-items: center; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.055em; font-weight: 800; position: relative; z-index: 1; }
.os-status-dot { width: 7px; height: 7px; border-radius: 999px; border: 1px solid currentcolor; background: currentcolor; flex: 0 0 auto; }
.os-state.status-Blocked,
.os-state.status-HumanJudgmentRequired { color: var(--c-worker); }
.os-state.status-Achieved { color: var(--c-gov-pass); }
.os-state.status-InProgress { color: var(--c-outcome); }
.os-state.status-Evaluated { color: var(--text-secondary); }
.os-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-secondary); font-size: 11px; font-weight: 800; margin-top: 7px; position: relative; z-index: 1; }
.os-progress { width: 64px; height: 6px; background: var(--slate-200); border-radius: 999px; overflow: hidden; }
.os-progress-fill { height: 100%; background: var(--slate-400); border-radius: inherit; }
.os-item.status-Achieved .os-progress-fill { background: var(--emerald-500); }
.os-item.status-Blocked .os-progress-fill,
.os-item.status-HumanJudgmentRequired .os-progress-fill { background: var(--orange-500); }
.os-item.status-InProgress .os-progress-fill { background: var(--c-outcome); }
.os-blocker { color: var(--c-gov-fail); font-size: 11px; line-height: 1.25; margin-top: 6px; position: relative; z-index: 1; font-weight: 700; overflow-wrap: anywhere; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; background: var(--bg-panel); flex-shrink: 0; gap: 8px; overflow-x: auto;}
.tab { padding: 10px 0 9px; margin-right: 18px; color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 700; border: 0; border-bottom: 2px solid transparent; background: transparent; font-family: inherit; white-space: nowrap; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--c-truth); border-bottom-color: var(--c-truth); }
.tab:focus { outline: none; }
.tab:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.35); outline-offset: 3px; border-radius: var(--radius-sm); }

.tab-content-area { flex: 1; overflow: visible; display: block; }
.tab-pane { display: block; overflow: visible; }
.tab-pane.hidden { display: none; }

/* Control Tower */
.control-tower-view { padding: 20px 24px 28px; max-width: 1680px; margin: 0 auto; display: grid; gap: 14px; }
.control-tower-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-card); }
.control-tower-header h2 { margin: 2px 0 6px; font-size: 20px; line-height: 1.2; letter-spacing: 0; }
.control-tower-header p { margin: 0; color: var(--text-secondary); max-width: 840px; line-height: 1.45; }
.control-tower-source { flex: 0 0 auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; padding: 7px 10px; font-size: 12px; font-weight: 800; color: var(--text-secondary); }
.control-tower-summary { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 10px; }
.control-tower-metric { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; box-shadow: var(--shadow-card); min-width: 0; }
.control-tower-metric span { display: block; color: var(--text-secondary); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; overflow-wrap: anywhere; }
.control-tower-metric strong { display: block; margin-top: 5px; color: var(--text-primary); font-size: 24px; line-height: 1; }
.control-tower-groups { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; }
.control-tower-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: #fff; min-width: 0; }
.control-tower-group strong { display: block; font-size: 18px; line-height: 1; }
.control-tower-group span { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.control-tower-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.control-tower-table th { position: static; }
.control-tower-row-title { display: grid; gap: 4px; min-width: 0; }
.control-tower-row-title strong, .control-tower-row-title span { overflow-wrap: anywhere; }
.control-tower-row-title span, .control-tower-detail { color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.control-tower-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.control-tower-pill { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 7px; background: var(--slate-50); color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.control-tower-boundary { color: var(--text-secondary); font-size: 12px; line-height: 1.35; }

/* Document Readiness Operator */
.document-readiness-operator { padding: 20px 24px 28px; max-width: 1680px; margin: 0 auto; display: grid; gap: 14px; }
.dro-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.84fr); gap: 16px; align-items: stretch; }
.dro-eyebrow { color: var(--c-truth); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.dro-header h2 { margin-top: 4px; font-size: 20px; line-height: 1.2; letter-spacing: 0; }
.dro-header p { margin-top: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 650; line-height: 1.45; }
.dro-priority { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dro-priority div,
.dro-runtime div,
.dro-fabric-grid div { border: 1px solid var(--border); background: #ffffff; border-radius: var(--radius-md); padding: 9px 10px; min-width: 0; }
.dro-priority span,
.dro-runtime span,
.dro-fabric-grid span { display: block; color: var(--text-muted); font-size: 10.5px; font-weight: 900; letter-spacing: 0.055em; text-transform: uppercase; }
.dro-priority strong,
.dro-runtime strong,
.dro-fabric-grid strong { display: block; margin-top: 3px; color: var(--text-primary); font-size: 13px; line-height: 1.28; overflow-wrap: anywhere; }
.dro-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.dro-badge { display: inline-flex; align-items: center; border: 1px solid rgba(249, 115, 22, 0.28); background: rgba(249, 115, 22, 0.07); color: #9a3412; border-radius: var(--radius-sm); min-height: 24px; padding: 3px 8px; font-size: 11px; font-weight: 850; }
.dro-badge.muted { border-color: var(--border); background: #ffffff; color: var(--text-secondary); }
.dro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dro-panel { border: 1px solid var(--border); background: #ffffff; border-radius: var(--radius-md); padding: 13px; box-shadow: var(--shadow-card); min-width: 0; }
.dro-panel.span-2 { grid-column: span 2; }
.dro-panel-head { display: grid; gap: 4px; margin-bottom: 10px; }
.dro-panel-head h3 { font-size: 13px; font-weight: 900; letter-spacing: 0; }
.dro-panel-head p { color: var(--text-secondary); font-size: 11.5px; line-height: 1.4; font-weight: 650; }
.dro-requirement-grid { display: grid; gap: 8px; }
.dro-doc-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) repeat(5, minmax(120px, 1fr)); gap: 8px; align-items: start; border: 1px solid var(--border); border-left: 4px solid var(--slate-400); border-radius: var(--radius-sm); padding: 9px; background: var(--slate-50); min-width: 0; }
.dro-doc-row.status-missing,
.dro-doc-row.status-waiting_external,
.dro-doc-row.status-returned_unreviewed,
.dro-doc-row.status-wrong,
.dro-doc-row.status-partial,
.dro-doc-row.status-unclear,
.dro-doc-row.status-stale,
.dro-doc-row.status-rejected { border-left-color: var(--orange-500); }
.dro-doc-row.status-received_under_governed_path,
.dro-doc-row.status-accepted_for_requirement,
.dro-doc-row.status-waived { border-left-color: var(--emerald-500); }
.dro-doc-row div { min-width: 0; }
.dro-doc-row span,
.dro-card span,
.dro-mini-list span { display: block; color: var(--text-secondary); font-size: 11.5px; line-height: 1.35; overflow-wrap: anywhere; }
.dro-doc-row strong,
.dro-card strong { display: block; color: var(--text-primary); font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; }
.dro-card { display: grid; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--slate-50); padding: 10px; margin-top: 8px; min-width: 0; }
.dro-fabric-grid,
.dro-runtime { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dro-fabric-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.dro-fabric-section { min-width: 0; }
.dro-fabric-section h4 { color: var(--text-primary); font-size: 12px; font-weight: 900; letter-spacing: 0; }
.dro-mini-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dro-mini-list span { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--slate-50); padding: 4px 7px; color: var(--text-primary); font-weight: 750; }
.dro-empty { color: var(--text-muted); font-size: 12px; font-weight: 650; }
.dro-boundary { display: flex; flex-wrap: wrap; gap: 6px; }
.dro-boundary span { display: inline-flex; border: 1px solid rgba(100, 116, 139, 0.25); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.82); color: var(--text-secondary); padding: 4px 7px; font-size: 10.5px; font-weight: 850; }

/* Flow Layout */
.flow-layout { display: flex; flex: 1; height: calc(100vh - 220px); min-height: 560px; overflow: hidden;}
.flow-timeline { width: 250px; border-right: 1px solid var(--border); background: var(--bg-panel); padding: 16px; overflow-y: auto; }
.flow-center { flex: 1; padding: 24px; overflow-y: auto; background: var(--bg-main); display: flex; flex-direction: column;}
.flow-inspector { width: 320px; border-left: 1px solid var(--border); background: var(--bg-panel); padding: 16px; overflow-y: auto; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 16px; font-weight: 700; }

.stage-item { padding: 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-secondary); transition: all 0.2s;}
.stage-item:hover { background: var(--bg-card); border-color: var(--border-light); }
.stage-item.active { background: rgba(2, 132, 199, 0.1); border-color: var(--c-truth); color: var(--text-primary); }

/* Stage Header Card */
.stage-header-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 24px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stage-header-card:first-child { margin-top: 0; }
.sh-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); }
.sh-grid { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px 16px; gap: 16px; font-size: 12px; }
.sh-col strong { display: block; color: var(--text-muted); text-transform: uppercase; font-size: 10px; margin-bottom: 4px; letter-spacing: 0.05em; }
.sh-col { color: var(--text-primary); line-height: 1.4; font-weight: 500;}

/* Filter Rail */
.filter-rail { display: flex; gap: 8px; margin: 24px 0 16px 0; border-bottom: 1px solid var(--border); padding-bottom: 16px;}
.filter-pill { padding: 6px 14px; border-radius: 16px; background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; cursor: pointer; font-weight: 600; font-family: inherit;}
.filter-pill.active { background: var(--text-primary); color: #FFFFFF; border-color: var(--text-primary);}
.filter-pill:hover:not(.active) { background: var(--bg-card); }

/* View Toggle */
.view-toggle { display: flex; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; font-size: 11px; font-weight: 600;}
.vt-btn { padding: 6px 14px; cursor: pointer; color: var(--text-secondary); border: 0; border-right: 1px solid var(--border); background: transparent; font-family: inherit; font-size: inherit; font-weight: inherit; }
.vt-btn:last-child { border-right: none; }
.vt-btn.active { background: var(--bg-card); color: var(--text-primary); }
.vt-btn:hover:not(.active) { background: var(--bg-card); }

/* Events Feed */
.event-feed { display: flex; flex-direction: column; gap: 8px; }
.time-gap { text-align: center; font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); padding: 4px; display: flex; align-items: center; justify-content: center; gap: 8px;}
.time-gap::before, .time-gap::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.time-gap.gap-warning { color: var(--c-worker); font-weight: 600;}

/* Timeline View specifically */
.tl-row { display: flex; align-items: stretch; position: relative; }
.tl-time { width: 64px; text-align: right; padding-right: 16px; padding-top: 24px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); flex-shrink: 0;}
.tl-node { width: 24px; position: relative; flex-shrink: 0;}
.tl-node::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--border); transform: translateX(-50%); }
.tl-row:first-child .tl-node::before { top: 24px; }
.tl-row:last-child .tl-node::before { bottom: calc(100% - 24px); }
.tl-icon { width: 10px; height: 10px; border-radius: 50%; background: var(--border-light); position: absolute; top: 24px; left: 50%; transform: translate(-50%, -50%); z-index: 2; border: 2px solid var(--bg-main);}
.tl-row.type-truth .tl-icon { background: var(--c-truth); }
.tl-row.type-outcome .tl-icon { background: var(--c-outcome); }
.tl-row.type-gov .tl-icon { background: var(--c-gov-pass); }
.tl-row.type-worker .tl-icon { background: var(--c-worker); }
.tl-row.type-sys-error .tl-icon { background: var(--c-sys-error); }
.tl-card { flex: 1; padding: 12px 0; padding-left: 12px; }

.ef-card { background: var(--bg-panel); border: 1px solid var(--border); padding: 12px 16px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-left: 3px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,0.05);}
.ef-card:hover { background: var(--bg-card); border-color: var(--border-light); }
.ef-card.active { background: #FFFFFF; border-color: var(--c-truth); box-shadow: 0 0 0 1px var(--c-truth); }
.ef-card.type-truth { border-left-color: var(--c-truth); }
.ef-card.type-outcome { border-left-color: var(--c-outcome); }
.ef-card.type-gov { border-left-color: var(--c-gov-pass); }
.ef-card.type-worker { border-left-color: var(--c-worker); }
.ef-card.type-sys-error { border-color: var(--c-sys-error); background: rgba(190, 18, 60, 0.05); }

.ef-type { font-weight: 600; font-size: 13px; color: var(--text-primary);}
.ef-type.sys-error-text { color: var(--c-sys-error); }
.ef-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-right: 12px; flex-shrink: 0; white-space: nowrap;}
.ef-story { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.ef-title { font-size: 14px; line-height: 1.35; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.ef-details { color: var(--text-secondary); font-size: 12px; flex: 1; margin-top: 2px;}
.ef-meta-row { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--text-secondary); font-size: 11px; }
.ef-secondary { display: grid; gap: 4px; color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.flow-audit-details { margin-top: 4px; color: var(--text-muted); }
.flow-audit-details summary { font-size: 11px; }

/* Inspector */
.inspector-empty { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 40px; }
.ins-block { margin-bottom: 24px; }
.ins-lbl { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 4px; font-weight: 600;}
.ins-val { font-size: 13px; line-height: 1.4; color: var(--text-primary); overflow-wrap: break-word;}
.ins-val.pre-formatted { font-family: var(--font-mono); font-size: 11px; background: var(--bg-card); padding: 12px; border-radius: 4px; color: var(--c-sys-error); overflow-x: auto;}

/* Interactive Supervision */
.ins-interactive { background: rgba(2, 132, 199, 0.05); border: 1px solid rgba(2, 132, 199, 0.3); padding: 16px; border-radius: 8px; margin-top: 24px;}
.ins-interactive h4 { margin-bottom: 12px; color: var(--c-truth); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;}
.action-input { width: 100%; background: #FFFFFF; border: 1px solid var(--border); color: var(--text-primary); padding: 8px; border-radius: 4px; margin-bottom: 12px; font-family: inherit;}
.action-input:focus { outline: none; border-color: var(--c-truth); }
.action-submit { width: 100%; padding: 8px; border-radius: 4px; background: var(--c-truth); color: #FFFFFF; border: none; font-weight: 600; cursor: pointer;}
.sys-action-btn { display: block; width: 100%; margin-bottom: 8px; padding: 8px; background: #FFFFFF; border: 1px solid var(--border); color: var(--text-primary); cursor: pointer; border-radius: 4px; font-weight: 500;}
.sys-action-btn:hover { border-color: var(--text-primary); }

/* Outcomes Operating Board */
.dag-wrapper { padding: 24px; display: block; background: var(--bg-main); height: 100%; overflow-y: auto;}
.outcomes-operating-board { width: 100%; max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.outcome-board-section { background: var(--bg-panel); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); }
.outcome-section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.outcome-section-heading span { color: var(--text-primary); font-size: 16px; font-weight: 900; line-height: 1.25; }
.outcome-section-heading p { color: var(--text-secondary); font-size: 12px; line-height: 1.4; max-width: 560px; text-align: right; }
.snapshot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.snapshot-callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-top: 14px; color: var(--text-primary); font-size: 13px; line-height: 1.45; }
.outcome-spine-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.outcome-category-group { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--slate-50); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.outcome-category-group.status-NeedsReview { border-left: 4px solid var(--c-gov-fail); }
.outcome-category-group.status-Complete { border-left: 4px solid var(--c-gov-pass); }
.outcome-category-group.status-InProgress { border-left: 4px solid var(--c-outcome); }
.outcome-category-header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; min-width: 0; }
.outcome-category-header > div { min-width: 0; }
.outcome-category-header h3 { color: var(--text-primary); font-size: 15px; line-height: 1.25; margin-bottom: 3px; }
.outcome-category-header p { color: var(--text-secondary); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.outcome-category-header span { flex: 0 1 auto; max-width: 45%; min-width: 0; color: var(--text-muted); font-size: 11px; font-weight: 850; line-height: 1.35; text-align: right; overflow-wrap: anywhere; }
.outcome-category-guidance { display: grid; gap: 6px; min-width: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.42; overflow-wrap: anywhere; }
.outcome-leaf-list { display: grid; gap: 10px; }
.outcome-leaf-card,
.outcome-operator-card,
.dependency-leaf { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px; min-width: 0; overflow: hidden; }
.outcome-leaf-card.status-Blocked,
.outcome-operator-card.blocked-card { border-left: 4px solid var(--c-gov-fail); }
.outcome-leaf-card.status-HumanJudgmentRequired { border-left: 4px solid var(--orange-500); }
.outcome-leaf-card.status-Achieved,
.outcome-operator-card.moved-card { border-left: 4px solid var(--c-gov-pass); }
.outcome-leaf-card.status-Evaluated,
.outcome-leaf-card.status-InProgress { border-left: 4px solid var(--c-outcome); }
.outcome-card-primary { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.outcome-card-primary > div { min-width: 0; }
.outcome-card-primary h3,
.outcome-card-primary h4 { color: var(--text-primary); font-size: 14px; line-height: 1.25; margin-bottom: 4px; overflow-wrap: anywhere; }
.outcome-card-primary p { color: var(--text-secondary); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.outcome-card-primary > span { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: var(--slate-50); color: var(--text-secondary); font-size: 11px; font-weight: 850; line-height: 1.2; padding: 4px 8px; text-align: right; }
.outcome-card-copy { display: grid; gap: 6px; min-width: 0; margin-top: 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.42; overflow-wrap: anywhere; }
.outcome-card-copy p { min-width: 0; overflow-wrap: anywhere; }
.outcome-card-copy strong,
.outcome-category-guidance strong { color: var(--text-muted); font-size: 11px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.outcome-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.outcome-empty { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.dependency-category-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dependency-category { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--slate-50); padding: 14px; min-width: 0; }
.dependency-category h3 { color: var(--text-primary); font-size: 14px; margin-bottom: 10px; }
.dependency-leaves { display: grid; gap: 10px; }
.dependency-leaf-main { display: flex; justify-content: space-between; gap: 10px; color: var(--text-primary); font-size: 13px; line-height: 1.3; }
.dependency-leaf-main span { color: var(--text-secondary); font-size: 12px; font-weight: 800; }
.dependency-relations { display: grid; gap: 5px; margin-top: 8px; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.outcome-audit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outcome-audit-list > .audit-details { border: 1px solid var(--border); border-radius: var(--radius-md); margin-top: 0; padding: 12px; background: var(--slate-50); }
.outcome-audit-details summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.outcome-audit-summary-main { min-width: 0; color: var(--text-primary); font-size: 12px; font-weight: 850; line-height: 1.3; overflow-wrap: anywhere; }
.outcome-audit-summary-action { color: var(--text-muted); font-size: 11px; font-weight: 800; white-space: nowrap; }

/* DAG View */
.dag-node { background: var(--bg-panel); border: 1px solid var(--border); padding: 16px; border-radius: 8px; width: 280px; text-align: center; margin-bottom: 40px; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,0.1);}
.dag-node h4 { margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text-primary);}
.dag-node .status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 12px; display: inline-block;}
.dag-node.status-InProgress { border-color: var(--c-outcome); }
.dag-node.status-InProgress .status { background: rgba(126, 34, 206, 0.1); color: var(--c-outcome); }
.dag-node.status-Blocked { border-color: var(--c-gov-fail); }
.dag-node.status-Blocked .status { background: rgba(220, 38, 38, 0.1); color: var(--c-gov-fail); }
.dag-node.status-Achieved { border-color: var(--c-gov-pass); }
.dag-node.status-Achieved .status { background: rgba(5, 150, 105, 0.1); color: var(--c-gov-pass); }
.dag-node.status-Open { border-color: var(--border-light); }

.dag-blocker { font-size: 11px; color: var(--c-gov-fail); margin-top: 12px; background: rgba(220, 38, 38, 0.05); padding: 4px; border-radius: 4px; font-weight: 500;}

/* CSS Tree for precise DAG edges */
.tree-container { display: flex; justify-content: center; padding: 20px; overflow-x: auto; }
.tree ul { padding-top: 30px; position: relative; display: flex; justify-content: center; margin: 0; padding-left: 0; }
.tree li { list-style-type: none; position: relative; padding: 30px 20px 0 20px; text-align: center; }
.tree li::before, .tree li::after { content: ''; position: absolute; top: 0; right: 50%; border-top: 2px solid var(--border-light); width: 50%; height: 30px; }
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--border-light); }
.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid var(--border-light); border-radius: 0 4px 0 0; }
.tree li:first-child::after { border-radius: 4px 0 0 0; }
.tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid var(--border-light); width: 0; height: 30px; transform: translateX(-50%); }

.tree .dag-node { margin-bottom: 0; width: 240px; display: inline-block; position: relative; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Data Tables */
.work-section { padding: 24px; background: var(--bg-main); border-bottom: 1px solid var(--border); }
.work-section h3 { margin: 0 0 12px; color: var(--text-primary); font-size: 14px; font-weight: 850; letter-spacing: 0.02em; }
.work-panel { padding: 0; background: transparent; border-bottom: 0; margin-top: 14px; }
.work-section .work-panel:first-of-type { margin-top: 0; }
.work-panel h4 { margin-bottom: 8px; color: var(--text-primary); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.policy-note { margin-bottom: 16px; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.review-work-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.review-work-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-card); }
.review-work-primary { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.review-work-title { font-weight: 800; color: var(--text-primary); line-height: 1.3; }
.review-work-proof { color: var(--c-truth); font-weight: 700; margin-top: 4px; line-height: 1.35; }
.review-work-status { flex: 0 0 auto; border: 1px solid rgba(5, 150, 105, 0.30); color: var(--emerald-600); background: rgba(16, 185, 129, 0.08); border-radius: var(--radius-sm); padding: 3px 7px; font-size: 11px; font-weight: 800; }
.review-work-secondary { display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.35; margin-bottom: 10px; }
.review-lifecycle { border-top: 1px solid var(--border); padding-top: 10px; }
.review-lifecycle summary { cursor: pointer; color: var(--c-truth); font-weight: 800; }
.lifecycle-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.lifecycle-event { background: var(--slate-50); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.lifecycle-event strong { display: block; color: var(--text-primary); margin-bottom: 5px; }
.lifecycle-empty { margin-top: 10px; color: var(--text-secondary); }
.review-audit-details { margin-top: 10px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.fact-review-indicator { display: inline-flex; align-items: center; min-height: 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--slate-50); padding: 3px 8px; color: var(--text-secondary); font-size: 12px; font-weight: 800; }
.inspectable-claim { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-card); overflow-wrap: anywhere; }
.payment-claim-stack { display: flex; flex-direction: column; gap: 12px; }
.claim-primary { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; color: var(--text-primary); font-weight: 800; line-height: 1.35; }
.claim-primary span { color: var(--text-secondary); font-weight: 750; }
.claim-secondary { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.audit-details { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.audit-details summary { cursor: pointer; color: var(--c-truth); font-weight: 800; }
.audit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-top: 10px; }
.audit-grid div { min-width: 0; overflow-wrap: anywhere; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--bg-panel); color: var(--text-secondary); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; position: sticky; top:0; z-index: 10;}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.4;}
.work-card-table th { position: static; }
.operator-work-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--blue-500); border-radius: var(--radius-md); background: var(--bg-panel); box-shadow: var(--shadow-card); overflow-wrap: anywhere; }
.operator-work-card.permit-card { border-left-color: var(--emerald-500); }
.operator-work-card.attention-card { border-left-color: var(--orange-500); }
.operator-work-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.operator-work-title { color: var(--text-primary); font-size: 14px; font-weight: 850; line-height: 1.25; }
.operator-work-subtitle { margin-top: 3px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.operator-work-status { flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--slate-50); color: var(--text-secondary); padding: 3px 8px; font-size: 11px; font-weight: 850; }
.operator-work-summary { color: var(--text-primary); font-size: 13px; line-height: 1.35; font-weight: 650; }
.operator-work-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.operator-work-secondary strong { color: var(--text-muted); font-weight: 900; }
#handoffs-tbody > tr > td { padding: 10px 0 0; border-bottom: 0; }
#handoffs-tbody > tr:first-child > td { padding-top: 0; }
.handoff-review-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--orange-500); border-radius: var(--radius-md); background: var(--bg-panel); box-shadow: var(--shadow-card); }
.handoff-audit-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--slate-400); border-radius: var(--radius-md); background: var(--bg-panel); box-shadow: var(--shadow-card); }
.handoff-card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.handoff-card-eyebrow { margin-bottom: 4px; color: var(--text-muted); font-size: 10px; font-weight: 850; letter-spacing: 0.05em; text-transform: uppercase; }
.handoff-card-title { color: var(--text-primary); font-size: 14px; font-weight: 850; line-height: 1.3; overflow-wrap: anywhere; }
.handoff-card-subtitle { margin-top: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.handoff-card-summary { margin-top: 8px; color: var(--text-primary); font-size: 13px; line-height: 1.45; }
.handoff-card-status { flex-shrink: 0; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--slate-50); color: var(--text-secondary); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.handoff-card-status.status-completed { border-color: rgba(5, 150, 105, 0.24); background: rgba(5, 150, 105, 0.08); color: var(--c-gov-pass); }
.handoff-card-status.status-active { border-color: rgba(14, 165, 233, 0.26); background: rgba(14, 165, 233, 0.09); color: #0369a1; }
.handoff-card-status.status-attention { border-color: rgba(249, 115, 22, 0.28); background: rgba(249, 115, 22, 0.09); color: var(--orange-600); }
.handoff-card-ops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.handoff-card-ops span { min-width: 0; overflow-wrap: anywhere; }
.handoff-card-lifecycle { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--slate-50); padding: 8px 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.handoff-card-lifecycle summary { cursor: pointer; color: var(--text-primary); font-weight: 800; }
.handoff-card-lifecycle ol { margin: 8px 0 0 20px; padding: 0; }
.handoff-card-lifecycle li { margin-bottom: 8px; padding-left: 2px; }
.handoff-card-lifecycle li strong,
.handoff-card-lifecycle li span { display: block; overflow-wrap: anywhere; }
.handoff-lifecycle-empty,
.handoff-lifecycle-boundary { margin-top: 8px; color: var(--text-muted); font-size: 11px; }
.handoff-card-audit { padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .control-tower-header { flex-direction: column; }
    .control-tower-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .control-tower-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .handoff-card-main { flex-direction: column; }
    .handoff-card-ops { grid-template-columns: 1fr; }
}

/* Drawer */
.ledger-drawer { position: absolute; bottom: 0; left: 0; right: 0; height: 40%; background: var(--bg-panel); border-top: 1px solid var(--border); box-shadow: 0 -10px 30px rgba(0,0,0,0.1); display: flex; flex-direction: column; z-index: 100;}
.drawer-header { padding: 12px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--text-primary);}
.drawer-body { flex: 1; padding: 16px 24px; overflow-y: auto; background: var(--bg-main); }
.drawer-body pre { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); white-space: pre-wrap; background: #FFFFFF; padding: 16px; border: 1px solid var(--border); border-radius: 8px;}
.hidden { display: none !important; }

/* Overview Tab Dashboard */
.overview-wrap { padding: 22px 24px 40px; max-width: 1440px; margin: 0 auto; width: 100%;}
.overview-dashboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.overview-card { background: var(--bg-panel); border: 1px solid var(--border-strong); border-radius: var(--radius-2xl); padding: 20px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.overview-card.span-2 { grid-column: span 2; }
.overview-card h2 { font-size: 17px; line-height: 1.3; color: var(--text-primary); letter-spacing: 0; }
.overview-card h3 { font-size: 13px; line-height: 1.3; color: var(--text-primary); margin-bottom: 10px; }
.overview-card p { font-size: 13px; line-height: 1.55; color: var(--text-primary); }
.card-kicker { margin: -20px -20px 0; padding: 10px 20px; border-bottom: 1px solid var(--border); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; background: linear-gradient(180deg, var(--slate-50), rgba(248, 250, 252, 0.78)); color: var(--text-muted); font-size: 11px; font-weight: 850; letter-spacing: 0.07em; text-transform: uppercase; }
.operating-summary { background: linear-gradient(180deg, #fff, rgba(248, 250, 252, 0.72)); }
.overview-status-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.summary-status-chip { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--slate-50); padding: 9px 10px; }
.summary-status-chip span { display: block; color: var(--text-muted); font-size: 10px; font-weight: 850; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 4px; }
.summary-status-chip strong { display: block; color: var(--text-primary); font-size: 12px; line-height: 1.2; }
.action-required { border-color: rgba(249, 115, 22, 0.30); background: rgba(255, 247, 237, 0.45); }
.alert-box { border-left: 4px solid var(--orange-500); border-radius: var(--radius-lg); background: #fff; padding: 13px 14px; box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.16); }
.alert-box strong { display: block; color: #9a3412; font-size: 13px; margin-bottom: 8px; }
.alert-box p { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.overview-cta { margin-top: auto; width: 100%; justify-content: center; }
.fact-stack { display: flex; flex-direction: column; gap: 10px; }
.fact-stack.compact { gap: 8px; }
.fact-stack div { display: grid; grid-template-columns: minmax(118px, 0.8fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: start; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.fact-stack div:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-stack span { color: var(--text-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.fact-stack strong { color: var(--text-primary); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.fact-secondary { display: block; margin-top: 4px; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 650; }
.claim-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.claim-link { align-self: start; border: 1px solid rgba(37, 99, 235, 0.18); border-radius: var(--radius-sm); background: rgba(59, 130, 246, 0.07); color: var(--blue-600); cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 850; line-height: 1; padding: 6px 8px; white-space: nowrap; }
.claim-link:hover { background: rgba(59, 130, 246, 0.12); border-color: rgba(37, 99, 235, 0.30); }
.claim-link:focus { outline: none; }
.claim-link:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.status-pill.blocked { color: var(--orange-600); background: rgba(249, 115, 22, 0.10); border: 1px solid rgba(249, 115, 22, 0.22); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric-tile { min-height: 82px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--slate-50); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.metric-tile span { display: block; color: var(--text-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }
.metric-tile strong { display: block; font-size: 16px; line-height: 1.2; color: var(--text-primary); }
.metric-tile em { display: block; margin-top: 6px; color: var(--text-secondary); font-size: 12px; font-style: normal; font-weight: 750; }
.metric-tile .claim-link { margin-top: 12px; }
.metric-tile.positive { border-color: rgba(16, 185, 129, 0.30); background: rgba(236, 253, 245, 0.55); }
.metric-tile.positive strong { color: var(--emerald-600); }
.metric-tile.warning { border-color: rgba(249, 115, 22, 0.30); background: rgba(255, 247, 237, 0.68); }
.metric-tile.warning strong { color: var(--orange-600); }
.metric-tile.neutral strong { color: var(--slate-700); }
.revenue-readiness { border-color: rgba(37, 99, 235, 0.20); background: linear-gradient(180deg, #fff, rgba(248, 250, 252, 0.86)); }
.revenue-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.revenue-safety-row { display: flex; flex-wrap: wrap; gap: 8px; }
.revenue-safety-row span { display: inline-flex; align-items: center; min-height: 26px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-secondary); font-size: 12px; font-weight: 850; padding: 5px 9px; }
.revenue-copy { display: flex; flex-direction: column; gap: 8px; }
.why-unblock { border: 1px solid rgba(37, 99, 235, 0.18); border-left: 4px solid var(--blue-600); border-radius: var(--radius-lg); background: rgba(59, 130, 246, 0.07); padding: 13px 14px; }
.why-unblock p { color: var(--text-secondary); font-size: 12px; line-height: 1.48; }
.revenue-path { gap: 7px; }
.revenue-path li::before { background: var(--blue-600); }
.revenue-proof-meta { padding-top: 2px; }
.value-split { display: flex; flex-direction: column; gap: 7px; }
.value-split-labels { display: flex; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 11px; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.value-split-bar { display: flex; height: 10px; overflow: hidden; border-radius: 999px; border: 1px solid var(--border); background: var(--slate-100); }
.value-split-bar span { display: block; height: 100%; }
.value-split-bar .received { background: var(--emerald-500); }
.value-split-bar .blocked { background: var(--orange-500); }
.boundary-note { color: var(--text-secondary) !important; font-size: 12px !important; padding-top: 2px; }
.movement-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.35; color: var(--text-primary); }
.check-list li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 999px; transform: translateY(-50%); background: var(--slate-400); }
.check-list.success li::before { background: var(--emerald-500); }
.check-list.danger li::before { background: var(--orange-500); }
.proof-feed { display: flex; flex-direction: column; gap: 10px; }
.proof-feed div { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--slate-50); }
.proof-type { display: inline-flex !important; width: fit-content; margin-bottom: 6px; padding: 2px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-muted) !important; font-size: 10px !important; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.proof-feed strong { display: block; color: var(--text-primary); font-size: 12px; margin-bottom: 4px; }
.primitive-secondary { display: block; width: fit-content; margin: 0 0 5px; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 650; background: transparent; }
.proof-feed span { display: block; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.proof-card-table th { color: var(--text-muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.proof-card-table td { padding: 8px; background: var(--slate-50); }
.proof-card { display: flex; flex-direction: column; gap: 11px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--slate-400); border-radius: var(--radius-md); background: var(--bg-panel); box-shadow: var(--shadow-card); }
.proof-card.business-signal { border-left-color: var(--blue-600); }
.proof-card.proof-evidence { border-left-color: #0f766e; }
.proof-card.execution-receipt { border-left-color: var(--emerald-500); }
.proof-card.outcome-movement { border-left-color: #0284c7; }
.proof-card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.proof-card-title { color: var(--text-primary); font-size: 14px; font-weight: 850; line-height: 1.25; }
.proof-card-subtitle { margin-top: 3px; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.proof-card-status { flex: 0 0 auto; max-width: 42%; border: 1px solid var(--border); border-radius: 999px; background: var(--slate-50); color: var(--text-secondary); font-size: 11px; font-weight: 850; line-height: 1.2; padding: 4px 8px; text-align: right; overflow-wrap: anywhere; }
.proof-card-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.proof-card-primary span,
.proof-card-secondary span { min-width: 0; overflow-wrap: anywhere; }
.proof-card-primary strong,
.proof-card-secondary strong { color: var(--text-muted); font-size: 11px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.proof-card-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; border-top: 1px solid var(--border); padding-top: 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.42; }
.overview-link { margin-top: auto; border: 1px solid rgba(37, 99, 235, 0.20); border-radius: var(--radius-lg); background: rgba(59, 130, 246, 0.08); color: var(--blue-600); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 800; padding: 11px 12px; text-align: left; }
.overview-link:hover { background: rgba(59, 130, 246, 0.12); border-color: rgba(37, 99, 235, 0.30); }
.source-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.source-metric { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--slate-50); padding: 10px; }
.source-metric strong { display: block; color: var(--text-primary); font-size: 20px; line-height: 1; margin-bottom: 6px; }
.source-metric span { display: block; color: var(--text-muted); font-size: 11px; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.overview-focus-pulse { outline: 2px solid rgba(37, 99, 235, 0.35); outline-offset: 4px; border-radius: var(--radius-md); animation: overview-focus-pulse 1.4s ease-out; }
@keyframes overview-focus-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25); }
    100% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
}

/* Ask Catena Copilot */
.ask-catena-fab { position: fixed; bottom: 24px; right: 24px; background: var(--c-truth); color: #FFFFFF; padding: 12px 20px; border-radius: 24px; font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3); display: flex; align-items: center; gap: 8px; z-index: 90; transition: transform 0.2s; border: 1px solid rgba(255,255,255,0.2);}
.ask-catena-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4); }

.copilot-drawer { position: fixed; top: 0; bottom: 0; right: 0; width: 360px; background: var(--bg-panel); border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0,0,0,0.1); z-index: 100; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); visibility: hidden;}
.copilot-drawer.visible { transform: translateX(0); visibility: visible; }
.cp-header { padding: 16px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--text-primary);}
.cp-body { flex: 1; padding: 20px; overflow-y: auto; background: var(--bg-main); display: flex; flex-direction: column; gap: 16px;}
.cp-msg { padding: 12px 16px; border-radius: 12px; font-size: 13px; line-height: 1.5; max-width: 90%; }
.cp-msg.ai { background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-primary); border-bottom-left-radius: 4px; align-self: flex-start;}
.cp-msg.user { background: var(--c-truth); color: #FFFFFF; border-bottom-right-radius: 4px; align-self: flex-end;}
.cp-input-area { padding: 16px; background: var(--bg-panel); border-top: 1px solid var(--border); display: flex; gap: 8px;}
.cp-input-area input { flex: 1; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-main); color: var(--text-primary); outline: none; font-family: inherit;}
.cp-input-area input:focus { border-color: var(--c-truth); }

/* Matter Progress Replay Rail */
.replay-rail { background: var(--slate-100); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px 24px; flex-shrink: 0; box-shadow: inset 0 1px 6px rgba(15, 23, 42, 0.04);}
.replay-rail-inner { width: 100%; max-width: 1680px; margin: 0 auto; display: block; }
.replay-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.replay-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.replay-top { display: flex; align-items: center; justify-content: flex-end; min-width: max-content; }
.replay-title { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-truth); }
.replay-subtitle { margin-top: 2px; color: var(--text-secondary); font-size: 11.5px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.replay-controls { display: inline-flex; align-items: center; flex-shrink: 0; gap: 8px; white-space: nowrap; }
.replay-control-group { display: inline-flex; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #ffffff; box-shadow: var(--shadow-card); }
.replay-control-group .btn { height: 28px; padding: 0 11px; border: 0; border-right: 1px solid var(--border-strong); border-radius: 0; background: #ffffff; color: var(--text-secondary); font-size: 12px; font-weight: 800; box-shadow: none; }
.replay-control-group .btn:last-child { border-right: 0; }
.replay-control-group .btn.primary { background: var(--c-truth); color: #ffffff; border-right-color: var(--c-truth); }
.replay-control-group .btn:disabled { color: var(--slate-400); background: var(--slate-50); cursor: not-allowed; }
.replay-counter { height: 28px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--text-muted); font-family: var(--font-mono); background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 9px; white-space: nowrap;}
.replay-content { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.replay-step-title { font-weight: 800; font-size: 14px; color: var(--text-primary); }
.replay-step-msg { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.replay-operator-primary { color: var(--text-primary); font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.replay-operator-secondary { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; color: var(--text-secondary); font-size: 11.5px; line-height: 1.35; }
.replay-operator-secondary strong { color: var(--text-muted); font-weight: 900; }
.replay-operator-audit { margin-top: 3px; color: var(--text-muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.025em; text-transform: uppercase; }
.replay-context-indicator { display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: center; margin-top: 5px; font-size: 11px; color: var(--text-secondary); }
.replay-context-label { font-weight: 800; color: var(--text-primary); }
.replay-context-meta { color: var(--text-muted); font-family: var(--font-mono); }
.replay-context-scope { color: var(--text-muted); font-weight: 700; }
.replay-inspector { margin-top: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.76); border-radius: var(--radius-md); padding: 7px 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); }
.replay-inspector-grid { display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(180px, 1fr)); gap: 8px; align-items: stretch; }
.replay-inspector-grid.consult-layout { grid-template-columns: minmax(260px, 1.15fr) repeat(2, minmax(190px, 1fr)); }
.replay-inspector-grid.human-gate-layout { grid-template-columns: minmax(280px, 1.1fr) repeat(3, minmax(180px, 1fr)); }
.replay-inspector-grid.documents-layout { grid-template-columns: minmax(280px, 1.12fr) repeat(4, minmax(170px, 1fr)); }
.replay-inspector-grid.limited-scope-layout { grid-template-columns: minmax(260px, 1.12fr) repeat(5, minmax(160px, 1fr)); }
.replay-inspector-grid.revenue-readiness-layout { grid-template-columns: minmax(260px, 1.08fr) repeat(5, minmax(155px, 1fr)); }
.replay-inspector-grid.billing-approval-layout { grid-template-columns: minmax(260px, 1.08fr) repeat(5, minmax(155px, 1fr)); }
.replay-inspector-grid.probate-blocked-layout { grid-template-columns: minmax(280px, 1.1fr) repeat(3, minmax(190px, 1fr)); }
.replay-inspector-grid.payment-layout { grid-template-columns: minmax(230px, 0.95fr) minmax(300px, 1.24fr) repeat(3, minmax(170px, 1fr)); }
.replay-inspector-signal { display: flex; flex-direction: column; gap: 6px; }
.replay-signal-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.replay-inspector-section { border: 1px solid var(--border); background: var(--bg-panel); border-radius: var(--radius-sm); padding: 6px 8px; min-width: 0; }
.replay-inspector-section h4 { margin: 0 0 4px; color: var(--text-muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.replay-inspector-section ul { margin: 0; padding-left: 15px; color: var(--text-primary); font-size: 12px; line-height: 1.45; }
.replay-inspector-section li + li { margin-top: 3px; }
.replay-active-signal { padding: 6px 9px; }
.replay-active-signal p { margin: 0; color: var(--text-primary); font-size: 12px; line-height: 1.25; font-weight: 650; }
.replay-kv-list { display: flex; flex-direction: column; gap: 3px; }
.replay-kv-row { display: grid; grid-template-columns: minmax(86px, 0.72fr) minmax(0, 1.28fr); gap: 8px; align-items: baseline; font-size: 11.5px; line-height: 1.16; }
.replay-kv-row span { color: var(--text-muted); font-weight: 800; overflow-wrap: anywhere; }
.replay-kv-row strong { color: var(--text-primary); font-weight: 700; overflow-wrap: anywhere; }
.replay-empty-note { margin: 0; color: var(--text-muted); font-size: 12px; }
.replay-action-rows { display: flex; flex-direction: column; gap: 3px; }
.replay-pill-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: start; }
.replay-pill-label { color: var(--text-muted); font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.045em; padding-top: 3px; }
.replay-pill-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.replay-pill { display: inline-flex; align-items: center; min-height: 18px; border: 1px solid var(--border); border-radius: 999px; background: #ffffff; color: var(--text-secondary); padding: 1px 7px; font-size: 11px; font-weight: 800; line-height: 1.15; }
.replay-pill-prefix { margin-right: 5px; color: var(--text-muted); font-size: 9.5px; font-weight: 900; letter-spacing: 0.045em; text-transform: uppercase; white-space: nowrap; flex: 0 0 auto; }
.replay-pill.tone-allowed { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.07); color: var(--emerald-600); }
.replay-pill.tone-prohibited { border-color: rgba(100, 116, 139, 0.24); background: rgba(248, 250, 252, 0.86); color: var(--slate-600); }
.replay-pill.tone-upstream { border-color: rgba(100, 116, 139, 0.28); background: rgba(248, 250, 252, 0.92); color: var(--slate-700); }
.replay-pill.tone-movement { border-color: rgba(14, 165, 233, 0.28); background: rgba(14, 165, 233, 0.07); color: #0369a1; }
.replay-pill.tone-receipt { border-color: rgba(16, 185, 129, 0.28); background: rgba(16, 185, 129, 0.07); color: var(--emerald-600); }
.replay-pill.tone-proof { border-color: rgba(20, 184, 166, 0.28); background: rgba(20, 184, 166, 0.07); color: #0f766e; }
.replay-pill.tone-context { border-color: rgba(37, 99, 235, 0.24); background: rgba(59, 130, 246, 0.06); color: var(--blue-600); }
.replay-pill.tone-gated { border-color: rgba(249, 115, 22, 0.28); background: rgba(249, 115, 22, 0.06); color: #9a3412; }
.replay-pill.tone-ready { border-color: rgba(16, 185, 129, 0.28); background: rgba(16, 185, 129, 0.07); color: var(--emerald-600); }
.replay-pill.tone-accepted { border-color: rgba(37, 99, 235, 0.28); background: rgba(59, 130, 246, 0.07); color: var(--blue-600); }
.replay-pill.tone-evaluated { border-color: rgba(99, 102, 241, 0.3); background: rgba(99, 102, 241, 0.07); color: #4338ca; }
.replay-pill.tone-approved { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.08); color: var(--emerald-600); }
.replay-pill-section .replay-pill-list { align-content: flex-start; }
.replay-proof-movement { display: flex; flex-direction: column; gap: 5px; }
.replay-proof-group { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 7px; align-items: start; }
.replay-acceptance-movement .replay-proof-group { grid-template-columns: 88px minmax(0, 1fr); }
.replay-readiness-movement .replay-proof-group { grid-template-columns: 82px minmax(0, 1fr); }
.replay-approval-movement .replay-proof-group,
.replay-action-boundary .replay-proof-group { grid-template-columns: 74px minmax(0, 1fr); }
.replay-payment-proof-chain .replay-proof-group { grid-template-columns: 1fr; gap: 2px; }
.replay-acceptance-movement .replay-pill { max-width: 100%; white-space: normal; }
.replay-readiness-movement .replay-pill { max-width: 100%; white-space: normal; }
.replay-approval-movement .replay-pill,
.replay-action-boundary .replay-pill,
.replay-payment-proof-chain .replay-pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.replay-proof-label { color: var(--text-muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 3px; }
.replay-payment-proof-chain .replay-proof-label { padding-top: 0; }
.replay-audit-detail { color: var(--text-muted); font-size: 10.5px; line-height: 1.2; }
.replay-causal-footer { border-top: 1px solid var(--border); padding-top: 5px; color: var(--text-secondary); font-size: 12px; line-height: 1.2; }
.replay-causal-footer strong { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; margin-right: 6px; }
.replay-inspector-section.tone-primary { border-color: rgba(37, 99, 235, 0.28); background: rgba(59, 130, 246, 0.06); }
.replay-inspector-section.tone-warning { border-color: rgba(249, 115, 22, 0.3); background: rgba(249, 115, 22, 0.06); }
.replay-inspector-section.tone-allowed { border-color: rgba(16, 185, 129, 0.28); background: rgba(16, 185, 129, 0.06); }
.replay-inspector-section.tone-prohibited { border-color: rgba(239, 68, 68, 0.28); background: rgba(239, 68, 68, 0.05); }
.replay-inspector-section.tone-muted { background: rgba(248, 250, 252, 0.85); }

body.replay-context-active [data-replay-role] { transition: opacity 0.18s ease, filter 0.18s ease, background-color 0.18s ease, outline-color 0.18s ease; }
body.replay-context-active [data-replay-role="later_state_context"] { opacity: 0.56; filter: saturate(0.72); }
body.replay-context-active [data-replay-role="anchor"],
body.replay-context-active [data-replay-role="available_at_step"],
body.replay-context-active [data-replay-role="replay_relevant"] { outline: 1px solid rgba(37, 99, 235, 0.38); background-color: rgba(59, 130, 246, 0.07); }
body.replay-context-active [data-replay-role="causal_outcome"],
body.replay-context-active [data-replay-role="movement_after_step"] { outline: 1px solid rgba(14, 165, 233, 0.4); background-color: rgba(14, 165, 233, 0.06); }
body.replay-context-active [data-replay-role="unresolved_at_step"],
body.replay-context-active [data-replay-role="blocked_at_step"],
body.replay-context-active [data-replay-role="safety_boundary"] { outline: 1px solid rgba(249, 115, 22, 0.4); background-color: rgba(249, 115, 22, 0.07); }
body.replay-context-active [data-replay-role="allowed_at_step"],
body.replay-context-active [data-replay-role="proof_available"] { outline: 1px solid rgba(16, 185, 129, 0.4); background-color: rgba(16, 185, 129, 0.07); }
body.replay-context-active [data-replay-role="prohibited_at_step"] { outline: 1px solid rgba(239, 68, 68, 0.38); background-color: rgba(239, 68, 68, 0.06); }
body.replay-context-active [data-replay-role="current_state_context"] { outline: 1px solid rgba(100, 116, 139, 0.36); background-color: rgba(100, 116, 139, 0.06); }
body.replay-context-active[data-replay-step-kind="signal"] .os-item[data-replay-role="causal_outcome"]::after,
body.replay-context-active[data-replay-step-kind="signal"] .os-item[data-replay-role="movement_after_step"]::after { content: "causal path"; position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; min-height: 18px; padding: 1px 6px; border-radius: 999px; background: rgba(14, 165, 233, 0.1); border: 1px solid rgba(14, 165, 233, 0.26); color: #0369a1; font-size: 10px; font-weight: 900; letter-spacing: 0.02em; text-transform: uppercase; }
body.replay-context-active[data-replay-step-kind="consult"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="human_gate"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="documents"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="limited_scope"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="retainer_readiness"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="billing"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="probate_blocked"] .os-item[data-replay-badge]::after,
body.replay-context-active[data-replay-step-kind="payment"] .os-item[data-replay-badge]::after { content: attr(data-replay-badge); position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; min-height: 18px; padding: 1px 6px; border-radius: 999px; background: rgba(14, 165, 233, 0.1); border: 1px solid rgba(14, 165, 233, 0.26); color: #0369a1; font-size: 10px; font-weight: 900; letter-spacing: 0.02em; text-transform: uppercase; }
body.replay-context-active[data-replay-step-kind="human_gate"] .os-item[data-replay-badge="gated"]::after { background: rgba(249, 115, 22, 0.09); border-color: rgba(249, 115, 22, 0.28); color: #9a3412; }
body.replay-context-active[data-replay-step-kind="documents"] .os-item[data-replay-badge="blocked"]::after { background: rgba(249, 115, 22, 0.09); border-color: rgba(249, 115, 22, 0.28); color: #9a3412; }
body.replay-context-active[data-replay-step-kind="limited_scope"] .os-item[data-replay-badge="ready"]::after { background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.28); color: var(--emerald-600); }
body.replay-context-active[data-replay-step-kind="retainer_readiness"] .os-item[data-replay-badge="ready"]::after { background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.28); color: var(--emerald-600); }
body.replay-context-active[data-replay-step-kind="retainer_readiness"] .os-item[data-replay-badge="evaluated"]::after { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.28); color: #4338ca; }
body.replay-context-active[data-replay-step-kind="billing"] .os-item[data-replay-badge="evaluated"]::after { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.28); color: #4338ca; }
body.replay-context-active[data-replay-step-kind="billing"] .os-item[data-replay-badge="approved"]::after { background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.28); color: var(--emerald-600); }
body.replay-context-active[data-replay-step-kind="probate_blocked"] .os-item[data-replay-badge="received"]::after { background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.28); color: var(--emerald-600); }
body.replay-context-active[data-replay-step-kind="probate_blocked"] .os-item[data-replay-badge="blocked"]::after { background: rgba(249, 115, 22, 0.09); border-color: rgba(249, 115, 22, 0.28); color: #9a3412; }
body.replay-context-active[data-replay-step-kind="payment"] .os-item[data-replay-badge="received"]::after { background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.28); color: var(--emerald-600); }
body.replay-context-active[data-replay-step-kind="payment"] .os-item[data-replay-badge="blocked"]::after { background: rgba(249, 115, 22, 0.09); border-color: rgba(249, 115, 22, 0.28); color: #9a3412; }

/* Replay Highlights */
.replay-highlight { box-shadow: 0 0 0 2px var(--c-outcome) !important; position: relative; z-index: 10; border-radius: inherit; }
.replay-muted { opacity: 0.4; pointer-events: none; transition: opacity 0.3s; }
.replay-pulse { animation: replay-pulse 2s infinite; }
@keyframes replay-pulse { 0% { box-shadow: 0 0 0 0 rgba(126, 34, 206, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(126, 34, 206, 0); } 100% { box-shadow: 0 0 0 0 rgba(126, 34, 206, 0); } }

@media (prefers-reduced-motion: reduce) {
    .overview-focus-pulse,
    .replay-pulse {
        animation: none;
        box-shadow: none;
    }
}

@media (max-width: 1100px) {
    .matter-header-body,
    .dro-header,
    .matter-state-stack,
    .matter-callouts { grid-template-columns: 1fr; }
    .matter-facts-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
    .overview-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid,
    .overview-status-row,
    .snapshot-grid,
    .outcome-card-grid,
    .outcome-spine-groups,
    .dependency-category-map,
    .outcome-audit-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-layout { display: block; }
    .sidebar { display: none; }
    .review-work-items { grid-template-columns: 1fr; }
    .header-top { flex-direction: column; align-items: stretch; gap: 12px; }
    .replay-rail-inner { grid-template-columns: 1fr; }
    .replay-header-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .replay-top { justify-content: flex-start; min-width: 0; }
    .replay-controls { flex-wrap: wrap; }
    .replay-inspector-grid,
    .replay-inspector-grid.signal-layout,
    .replay-signal-main { grid-template-columns: 1fr; }
    .replay-pill-row { grid-template-columns: 1fr; gap: 4px; }
    .matter-identity-row { align-items: flex-start; }
    .identity-block h1 { width: 100%; }
    .matter-facts-compact,
    .overview-dashboard,
    .dro-grid,
    .dro-doc-row,
    .dro-runtime,
    .dro-fabric-sections,
    .dro-fabric-grid,
    .movement-columns,
    .proof-card-primary,
    .proof-card-secondary,
    .snapshot-callouts { grid-template-columns: 1fr; }
    .dag-wrapper { padding: 14px; }
    .outcome-board-section { padding: 14px; }
    .outcome-section-heading,
    .outcome-card-primary,
    .outcome-category-header,
    .dependency-leaf-main { flex-direction: column; align-items: flex-start; }
    .outcome-section-heading p,
    .outcome-category-header span,
    .outcome-card-primary > span { max-width: 100%; text-align: left; }
    .proof-card-main { flex-direction: column; }
    .proof-card-status { max-width: 100%; text-align: left; }
    .fact-stack div { grid-template-columns: 1fr; gap: 5px; }
    .source-metrics { grid-template-columns: 1fr; }
    .overview-card.span-2 { grid-column: span 1; }
    .dro-panel.span-2 { grid-column: span 1; }
    .flow-layout { flex-direction: column; height: auto; overflow: visible; }
    .flow-timeline,
    .flow-center,
    .flow-inspector { width: 100%; overflow-y: visible; border-left: 0; border-right: 0; }
    .copilot-drawer { width: min(100vw, 360px); }
}
