:root{color-scheme:light dark;--bg:#17182e;--panel:#25264a;--accent:#8b5cf6;--accent2:#22d3ee;--paper:#fbfbff;--ink:#20213a;--line:rgba(255,255,255,.16);--muted:rgba(255,255,255,.72)}
:root[data-theme="light"]{--bg:#fbfbff;--panel:#ffffff;--ink:#20213a;--muted:#52605b;--line:rgba(23,35,27,.16)}
:root[data-theme="dark"]{--bg:#17182e;--panel:#25264a;--ink:#f8fff9;--muted:rgba(255,255,255,.72);--line:rgba(255,255,255,.16)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--ink);letter-spacing:0}button,input,select,textarea{font:inherit}button{border:0;border-radius:8px;padding:10px 12px;background:var(--accent);color:#07100b;font-weight:700;cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.brand{display:flex;gap:12px;align-items:center}.brand small{display:block;color:var(--muted);line-height:1.35}.nav-btn{background:transparent;color:var(--ink);border:1px solid var(--line);text-align:left}.nav-btn.active{background:var(--accent);color:#06100a}.theme-picker{display:grid;gap:6px}.theme-picker select{min-width:112px;border-radius:8px;border:1px solid var(--line);padding:8px;background:var(--paper);color:var(--ink)}.status,.record-card span{border:1px solid var(--line);border-radius:999px;padding:5px 8px;color:var(--muted);font-size:12px}.workspace{margin-left:292px;min-height:100vh;padding:24px;display:grid;gap:18px}.hero{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-items:stretch}.proof-hero,.panel,.action-strip{background:color-mix(in srgb,var(--panel) 86%,transparent);border:1px solid var(--line);border-radius:10px;padding:18px;box-shadow:0 20px 50px rgba(0,0,0,.14)}h1,h2,h3,p{margin-top:0}.eyebrow{text-transform:uppercase;color:var(--accent2);font-weight:800;font-size:12px}.proof-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;background:rgba(255,255,255,.08);border-radius:8px;padding:14px}.proof-grid strong{font-size:34px}.proof-grid span{color:var(--muted)}.action-strip{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.dashboard-grid,.evidence-grid,.report-grid{display:grid;grid-template-columns:2fr 1fr;gap:16px}.large{grid-row:span 2}.lane-preview{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.lane-preview div,.record-card,.lane,.timeline-row{border:1px solid var(--line);border-radius:8px;padding:12px;background:rgba(255,255,255,.06)}.split{display:grid;grid-template-columns:380px minmax(0,1fr);gap:16px}.form-panel label{display:grid;gap:6px;margin:10px 0}.form-panel input,.form-panel select,.form-panel textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px;background:var(--paper);color:var(--ink)}.button-row{display:flex;flex-wrap:wrap;gap:8px}.record-stack{display:grid;gap:10px}.record-card header{display:flex;justify-content:space-between;gap:8px;align-items:start}.kanban{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.lane{min-height:260px}.timeline{display:grid;gap:12px}.timeline-row{display:grid;grid-template-columns:40px 1fr;align-items:start}.timeline-row span{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:var(--accent);color:#07100b;font-weight:800}pre{white-space:pre-wrap;max-height:460px;overflow:auto;background:rgba(0,0,0,.18);border-radius:8px;padding:12px}.report-grid .report-actions{display:grid;align-content:start;gap:8px}.empty{color:var(--muted)}
@media (max-width:900px){.workspace{margin-left:0;padding:14px}.hero,.dashboard-grid,.split,.kanban,.evidence-grid,.report-grid{grid-template-columns:1fr}.proof-grid,.lane-preview{grid-template-columns:repeat(2,1fr)}.action-strip{align-items:stretch}.action-strip button{flex:1 1 180px}}

/* conversion rebuild: top workflow chrome, no persistent left rail */
.app-topbar{position:sticky;top:0;z-index:8;display:grid;grid-template-columns:minmax(260px,1fr) minmax(0,1.8fr) auto auto;gap:12px;align-items:center;padding:14px 20px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,color-mix(in srgb,var(--panel) 92%,transparent),color-mix(in srgb,var(--bg) 70%,var(--accent) 12%));box-shadow:0 18px 44px rgba(0,0,0,.16)}
.app-topbar .brand{min-width:0}.app-topbar .brand strong,.app-topbar .brand small{display:block}.top-nav{display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap}.top-nav .nav-btn{min-height:38px;background:color-mix(in srgb,var(--panel) 70%,transparent);color:var(--ink);border:1px solid var(--line);text-align:center}.top-nav .nav-btn.active{background:var(--accent);color:#06100a}.app-topbar .theme-picker{display:flex;align-items:center;gap:8px}.support-links{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}.support-links a{color:var(--accent2);font-weight:800;text-decoration:none}.workspace{margin-left:0;min-height:calc(100vh - 84px);padding:20px 24px 28px}
@media (max-width:1200px){.app-topbar{grid-template-columns:1fr}.top-nav{justify-content:flex-start}.support-links{justify-content:flex-start}}
@media (max-width:700px){.workspace{padding:10px}.app-topbar{position:static;padding:8px 10px;gap:8px}.app-topbar .brand{gap:8px}.app-topbar .brand img{width:36px;height:36px}.app-topbar .brand small{font-size:12px;line-height:1.2}.top-nav{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;padding-bottom:2px}.top-nav .nav-btn{flex:0 0 auto;min-height:32px;padding:7px 10px;font-size:14px}.app-topbar .theme-picker,.app-topbar .surface-picker{display:inline-flex;font-size:14px}.app-topbar .theme-picker select,.app-topbar .surface-picker select{min-width:112px;padding:7px}.support-links{font-size:13px;gap:7px}.action-strip{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:8px;padding:9px;align-items:center}.action-strip button{flex:0 0 auto;min-width:156px;min-height:36px;padding:8px 7px;font-size:14px}.action-strip .status{flex:0 0 auto}.action-strip #generateReport{order:-4;min-width:132px;width:132px;white-space:normal}.action-strip #actionStatus{order:-3}.action-strip #exportState{order:-2}.primary-status{width:160px;max-width:none;font-size:12px;padding:7px}.source-trace-row{grid-template-columns:30px minmax(0,1fr);grid-template-areas:"index title" "index owner" "index status" "note note";padding:9px}.source-trace-row em{justify-self:start}.trace-form{gap:7px}.trace-form input,.trace-form select,.trace-form textarea{padding:7px}.theme-chip-row span{font-size:12px;padding:6px 8px}}

/* screenshot-grade depth: avoid flat black-on-white Store captures */
:root[data-theme="dark"] body{background:radial-gradient(circle at 14% 8%,rgba(139,92,246,.26),transparent 30%),radial-gradient(circle at 88% 0%,rgba(34,211,238,.22),transparent 34%),linear-gradient(135deg,#101126,#211d54 50%,#072f36)}
:root[data-theme="dark"] .app-topbar{background:linear-gradient(110deg,rgba(18,18,44,.96),rgba(52,43,118,.92),rgba(8,72,83,.82))}
:root[data-theme="dark"] .proof-hero,:root[data-theme="dark"] .panel,:root[data-theme="dark"] .action-strip,:root[data-theme="dark"] .lane,:root[data-theme="dark"] .record-card,:root[data-theme="dark"] .timeline-row{background:linear-gradient(145deg,rgba(37,38,74,.96),rgba(11,12,28,.88));border-color:rgba(139,92,246,.38);box-shadow:0 22px 54px rgba(0,0,0,.34)}
:root[data-theme="dark"] .proof-hero,:root[data-theme="dark"] .panel:nth-child(2n),:root[data-theme="dark"] .lane:nth-child(2n),:root[data-theme="dark"] .timeline-row:nth-child(2n){background:linear-gradient(145deg,rgba(139,92,246,.25),rgba(14,15,36,.9) 56%,rgba(34,211,238,.15));border-color:rgba(34,211,238,.35)}
:root[data-theme="dark"] .lane-preview div:nth-child(2n){background:rgba(34,211,238,.14);border-color:rgba(34,211,238,.34)}
:root[data-theme="dark"] .timeline{padding:14px;border:1px solid rgba(139,92,246,.24);border-radius:10px;background:linear-gradient(135deg,rgba(139,92,246,.15),transparent 38%),linear-gradient(315deg,rgba(34,211,238,.14),transparent 42%)}
:root[data-theme="dark"] .timeline-row:nth-child(odd){background:linear-gradient(90deg,rgba(139,92,246,.58),rgba(14,15,36,.92) 48%);border-color:rgba(139,92,246,.58)}
:root[data-theme="dark"] .timeline-row:nth-child(even){background:linear-gradient(90deg,rgba(34,211,238,.48),rgba(14,15,36,.92) 48%);border-color:rgba(34,211,238,.54)}
:root[data-theme="dark"] .timeline-row span{background:#f8fbff;color:#17182e;box-shadow:0 0 0 4px rgba(255,255,255,.10)}
.workspace{display:grid;gap:14px;align-content:start}.focused-workspace{gap:14px;align-content:start}.action-strip{position:relative;z-index:3}.primary-status{font-size:14px;font-weight:850;line-height:1.35;color:var(--ink);border-radius:10px;padding:10px 12px;background:color-mix(in srgb,var(--panel) 84%,var(--accent2) 12%);max-width:560px}.primary-status[data-state="warn"]{background:#fff7db;color:#6b4300;border-color:#d99a00}.compact-action-strip{padding:10px 12px;min-height:0;box-shadow:none;align-items:center;background:linear-gradient(90deg,rgba(139,92,246,.22),rgba(34,211,238,.12));border-color:rgba(34,211,238,.34)}.compact-action-strip button{min-height:34px;padding:7px 10px}.compact-action-strip .status{background:rgba(255,255,255,.06)}
.planning-grid{display:grid;grid-template-columns:minmax(280px,.72fr) minmax(0,1.4fr);gap:14px}.planning-summary{align-content:start}.mini-metrics{display:grid;grid-template-columns:auto 1fr;gap:6px 10px;margin-top:16px}.mini-metrics strong{font-size:34px;color:var(--accent)}.planning-proof{grid-column:1/-1;display:flex;gap:14px;align-items:center}.planning-proof strong{font-size:22px;color:var(--accent2)}:root[data-theme="dark"] .planning-summary{background:linear-gradient(145deg,rgba(139,92,246,.42),rgba(14,15,36,.90) 58%,rgba(34,211,238,.18))}:root[data-theme="dark"] .planning-proof{background:linear-gradient(90deg,rgba(34,211,238,.30),rgba(139,92,246,.18));border-color:rgba(34,211,238,.46)}
:root[data-theme="dark"] .planning-summary .mini-metrics{padding:12px;border-radius:10px;background:linear-gradient(135deg,#f8fbff,#dff8ff);color:#17182e;box-shadow:0 18px 38px rgba(0,0,0,.24)}:root[data-theme="dark"] .planning-summary .mini-metrics strong{color:#5b21b6}

/* product-specific complex workspace dashboards */
.domain-dashboard{display:grid;gap:16px;align-items:stretch;min-height:clamp(620px,calc(100vh - 230px),840px)}.domain-dashboard .panel{overflow:hidden}.domain-dashboard h2{font-size:clamp(20px,2vw,32px);line-height:1.12}.domain-dashboard .button-row button{min-width:150px}.grant-binder-dashboard,.research-synthesis-dashboard,.shop-floor-dashboard,.permit-closeout-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}.domain-dashboard>.panel:first-child{grid-column:1/-1}.dashboard-object-header{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,.9fr);gap:16px;align-items:end;margin-bottom:14px}.dashboard-object-header h2{margin:0}.dashboard-metric-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.dashboard-metric-row div{min-width:0;border:1px solid rgba(255,255,255,.24);border-radius:10px;padding:10px;background:rgba(255,255,255,.10)}.dashboard-metric-row strong{display:block;font-size:26px;color:var(--accent2)}.dashboard-metric-row span{display:block;color:rgba(247,255,248,.82);font-weight:800;line-height:1.12;overflow-wrap:anywhere}.binder-hero{display:grid;gap:14px;background:linear-gradient(135deg,rgba(73,209,127,.30),rgba(10,33,18,.92) 60%,rgba(247,201,72,.24))}.binder-body{display:grid;gap:12px;align-content:space-between}.binder-records{display:grid;gap:10px}.binder-records div{display:grid;gap:5px;padding:11px 12px;border:1px solid rgba(255,255,255,.22);border-radius:10px;background:rgba(255,255,255,.09)}.binder-records span,.binder-records em{color:var(--muted);font-style:normal}.permit-ledger{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.permit-ledger div{border:1px solid rgba(255,255,255,.22);border-radius:10px;padding:12px;background:rgba(255,255,255,.08)}.permit-ledger strong{display:block;font-size:30px;color:var(--accent2)}.deadline-ledger{display:grid;gap:10px}.ledger-row{display:grid;grid-template-columns:96px minmax(0,1fr);gap:7px 10px;border-left:5px solid var(--accent2);padding:10px 12px;border-radius:8px;background:rgba(255,255,255,.07)}.ledger-row em{grid-column:2;color:var(--accent2);font-style:normal}.evidence-pocket{display:grid;align-content:space-between;background:linear-gradient(160deg,rgba(247,201,72,.22),rgba(73,209,127,.12))}
.source-matrix-panel{background:linear-gradient(140deg,rgba(82,108,255,.26),rgba(28,24,70,.92) 60%,rgba(99,232,190,.18))}.source-matrix{display:grid;gap:8px;margin-top:14px}.source-matrix div{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(150px,.7fr) minmax(110px,.5fr);gap:10px;align-items:center;border:1px solid rgba(255,255,255,.18);border-radius:8px;padding:10px;background:rgba(255,255,255,.07)}.source-matrix span,.source-matrix em{color:var(--muted);font-style:normal}.source-claim-workbench{display:grid;align-content:start;gap:12px}.source-matrix-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 12px;border:1px solid rgba(251,251,255,.18);border-radius:10px;background:rgba(251,251,255,.10)}.source-matrix-toolbar span{color:rgba(251,251,255,.84)}.source-trace-grid{display:grid;gap:8px}.source-trace-row{width:100%;display:grid;grid-template-columns:34px minmax(0,1.1fr) minmax(160px,.72fr) minmax(128px,.45fr);grid-template-areas:"index title owner status" "index note note note";gap:5px 10px;align-items:center;text-align:left;border:1px solid rgba(251,251,255,.20);border-radius:10px;padding:10px 12px;background:rgba(251,251,255,.10);color:#fbfbff}.source-trace-row strong{grid-area:title}.source-trace-row span:nth-of-type(2){grid-area:owner;color:rgba(251,251,255,.78)}.source-trace-row em{grid-area:status;justify-self:end;padding:4px 7px;border-radius:999px;background:rgba(251,251,255,.14);color:#fbfbff;font-style:normal}.source-trace-row small{grid-area:note;color:rgba(251,251,255,.76);line-height:1.3}.source-index{grid-area:index;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#fbfbff;color:#3b1a8f;font-weight:900}.source-trace-row.is-selected{border-color:#22d3ee;background:linear-gradient(90deg,rgba(34,211,238,.26),rgba(139,92,246,.20));box-shadow:inset 0 0 0 1px rgba(34,211,238,.35)}.source-empty-state,.trace-empty-state{padding:16px;border:1px dashed rgba(251,251,255,.28);border-radius:10px;color:rgba(251,251,255,.78)}.theme-chip-row{display:flex;flex-wrap:wrap;gap:8px}.theme-chip-row span{padding:7px 10px;border:1px solid rgba(251,251,255,.20);border-radius:999px;background:rgba(251,251,255,.14);font-weight:800;color:#fbfbff}.theme-map-panel{position:relative;min-height:320px;background:radial-gradient(circle at 50% 42%,rgba(99,232,190,.30),transparent 35%),linear-gradient(160deg,rgba(82,108,255,.16),rgba(12,12,36,.9))}.theme-map{position:relative;min-height:210px}.theme-map span{position:absolute;left:calc(42% + (var(--i) - 2) * 12%);top:calc(42% + ((var(--i) % 2) * 34px));display:grid;place-items:center;min-width:92px;min-height:52px;border:1px solid rgba(255,255,255,.28);border-radius:999px;background:rgba(255,255,255,.10);font-weight:800}.claim-thread-panel,.claim-trace-panel,.outline-rail-panel{display:grid;align-content:space-between;background:linear-gradient(160deg,rgba(99,232,190,.20),rgba(82,108,255,.16))}
.source-matrix-panel .dashboard-object-header h2{display:inline-block;width:fit-content;max-width:100%;padding:6px 8px;border-radius:8px;background:rgba(18,49,46,.84);color:#f8fafc!important;-webkit-text-fill-color:#f8fafc!important}
.source-matrix-panel .dashboard-metric-row{grid-template-columns:repeat(2,minmax(0,1fr))}.trace-form{display:grid;gap:9px}.trace-form label{display:grid;gap:5px;color:var(--muted);font-weight:800}.trace-form input,.trace-form select,.trace-form textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px 9px;background:var(--paper);color:var(--ink)}.trace-form textarea{min-height:72px;resize:vertical}.trace-form .claim-note{grid-column:1/-1}.outline-rail-panel p{color:var(--muted)}
.trace-review-chip{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.10)}.trace-review-chip strong{font-size:34px;color:var(--accent2)}.trace-review-chip span{color:var(--muted);font-weight:800}.trace-review-panel{display:grid;align-content:start;gap:10px}.trace-review-panel ul{display:grid;gap:7px;margin:0;padding-left:20px}.trace-review-panel li{line-height:1.3}.trace-review-panel button{justify-self:start}
.research-theme-workspace{display:grid;grid-template-columns:1fr;grid-template-areas:"lattice" "lanes" "proof";gap:14px;min-height:calc(100vh - 190px)}.theme-lattice{grid-area:lattice;display:grid;grid-template-columns:minmax(0,.86fr) minmax(420px,1.14fr) minmax(260px,.54fr);gap:16px;align-items:center;color:#fbfbff;background:radial-gradient(circle at 82% 18%,rgba(34,211,238,.34),transparent 32%),linear-gradient(145deg,#17124a,#29156f 56%,#073744);border-color:rgba(139,92,246,.52)}.theme-lattice p{color:rgba(251,251,255,.80)}.theme-signal-grid{position:relative;min-height:220px;border-radius:16px;background:linear-gradient(135deg,rgba(255,255,255,.12),rgba(34,211,238,.08));border:1px solid rgba(251,251,255,.18);overflow:hidden}.theme-signal-grid span{position:absolute;min-width:116px;padding:14px 16px;border-radius:999px;text-align:center;font-weight:900;color:#17124a;background:linear-gradient(135deg,#fbfbff,#bff6ff);box-shadow:0 18px 42px rgba(0,0,0,.24)}.theme-signal-grid span:nth-child(1){left:6%;top:12%}.theme-signal-grid span:nth-child(2){left:38%;top:8%}.theme-signal-grid span:nth-child(3){right:7%;top:22%}.theme-signal-grid span:nth-child(4){left:12%;bottom:18%}.theme-signal-grid span:nth-child(5){left:44%;bottom:12%}.theme-signal-grid span:nth-child(6){right:10%;bottom:28%}.theme-proof-row{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;padding:14px;border-radius:14px;background:#fbfbff;color:#20213a}.theme-proof-row strong{font-size:42px;color:#5b21b6}.theme-lanes{grid-area:lanes;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:14px;border:1px solid rgba(139,92,246,.30);border-radius:16px;background:linear-gradient(135deg,rgba(24,18,64,.96),rgba(16,92,108,.86));box-shadow:0 24px 56px rgba(32,33,58,.18)}.theme-lane{display:grid;gap:10px;align-content:start;min-height:220px;padding:14px;border:1px solid rgba(251,251,255,.22);border-radius:14px;background:linear-gradient(145deg,#fbfbff,#e9f9ff);color:#20213a}.theme-lane:nth-child(2n){background:linear-gradient(145deg,#1d164f,#154453);color:#fbfbff}.theme-lane h2{font-size:22px}.theme-lane.is-empty{background:linear-gradient(145deg,#e8e5ff,#dff8ff);color:#52605b}.theme-card{display:grid;gap:6px;padding:12px;border-radius:12px;border:1px solid rgba(32,33,58,.16);background:rgba(255,255,255,.72);box-shadow:0 10px 26px rgba(32,33,58,.12)}.theme-lane:nth-child(2n) .theme-card{border-color:rgba(251,251,255,.20);background:rgba(251,251,255,.12)}.theme-card span{color:inherit;opacity:.72}.theme-card p{margin:0}.theme-synthesis-proof{grid-area:proof;display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;background:linear-gradient(135deg,#fbfbff,#dff8ff);border-color:rgba(34,211,238,.42);color:#20213a}.theme-synthesis-proof strong{font-size:24px;color:#5b21b6}.theme-synthesis-proof span{color:#52605b}.theme-synthesis-proof button{white-space:nowrap}
.bench-board-panel{background:linear-gradient(145deg,rgba(255,149,61,.30),rgba(32,24,16,.94) 58%,rgba(43,209,189,.18))}.shop-lanes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}.shop-lanes div{min-height:154px;border:1px solid rgba(255,255,255,.20);border-radius:10px;padding:12px;background:linear-gradient(180deg,rgba(255,255,255,.10),rgba(0,0,0,.12));display:grid;align-content:space-between}.shop-lanes strong{font-size:18px}.shop-lanes span{color:var(--accent2);font-weight:800}.shop-lanes em{align-self:end;color:var(--muted);font-style:normal;font-weight:800}.ticket-stack-panel{display:grid;gap:10px}.ticket-chip{display:grid;gap:5px;border:1px solid rgba(255,255,255,.20);border-radius:10px;padding:12px;background:rgba(255,255,255,.08)}.ticket-chip span,.ticket-chip em{color:var(--muted);font-style:normal}.pickup-panel{display:grid;align-content:space-between;background:linear-gradient(160deg,rgba(43,209,189,.20),rgba(255,149,61,.14))}.bench-board-panel{display:grid;grid-template-rows:auto auto 1fr}.shop-lanes{height:100%;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr}.shop-lanes div{min-height:0}.binder-hero,.source-matrix-panel,.bench-board-panel,.inspection-roadmap-panel{color:#f7fff8}.binder-hero h2,.source-matrix-panel h2,.bench-board-panel h2,.inspection-roadmap-panel h2,.binder-hero strong,.source-matrix-panel strong,.bench-board-panel strong,.inspection-roadmap-panel strong{color:#f7fff8}.binder-hero p,.binder-records span,.binder-records em,.source-matrix-panel span,.source-matrix-panel em,.bench-board-panel span,.bench-board-panel em,.inspection-roadmap-panel em{color:rgba(247,255,248,.80)}.source-matrix div,.source-trace-row,.inspection-roadmap div,.shop-lanes div,.binder-records div{background:rgba(255,255,255,.14);border-color:rgba(247,255,248,.28)}
.inspection-roadmap-panel{background:linear-gradient(145deg,rgba(89,156,255,.30),rgba(13,28,51,.94) 58%,rgba(255,196,92,.18))}.inspection-roadmap{display:grid;gap:10px;margin-top:16px}.inspection-roadmap div{display:grid;grid-template-columns:42px minmax(0,1fr) minmax(110px,.44fr);gap:10px;align-items:center;padding:12px;border:1px solid rgba(255,255,255,.20);border-radius:10px;background:rgba(255,255,255,.08)}.inspection-roadmap span{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:var(--accent);color:#07100b;font-weight:900}.inspection-roadmap em{font-style:normal;color:var(--accent2)}.condition-ledger-panel{display:grid;align-content:space-between}.packet-panel{display:grid;align-content:space-between;background:linear-gradient(160deg,rgba(255,196,92,.22),rgba(89,156,255,.14))}
@media (max-width:1180px){.grant-binder-dashboard,.research-synthesis-dashboard,.shop-floor-dashboard,.permit-closeout-dashboard{grid-template-columns:1fr 1fr}.domain-dashboard .panel:first-child{grid-column:1/-1}.shop-lanes{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){.grant-binder-dashboard,.research-synthesis-dashboard,.shop-floor-dashboard,.permit-closeout-dashboard,.source-matrix div,.inspection-roadmap div,.dashboard-object-header{grid-template-columns:1fr}.dashboard-metric-row{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-metric-row div{min-width:0;padding:8px}.dashboard-metric-row strong{font-size:22px}.dashboard-metric-row span{font-size:12px;overflow-wrap:anywhere}.domain-dashboard{min-height:auto}.theme-map span{position:static;margin:6px}.theme-map{display:flex;flex-wrap:wrap;gap:6px;min-height:0}.shop-lanes,.permit-ledger,.theme-lanes{grid-template-columns:1fr}.research-theme-workspace{grid-template-columns:1fr;grid-template-areas:none}.theme-lattice,.theme-lanes,.theme-synthesis-proof{grid-area:auto}.theme-synthesis-proof{grid-template-columns:1fr}.theme-signal-grid span{position:static;display:inline-block;margin:8px}.theme-signal-grid{min-height:0;padding:12px}}

/* conversion rebuild: each complex app needs a distinct first-carousel geometry */
.domain-dashboard>.panel:first-child{grid-column:auto}.grant-binder-dashboard>.binder-hero{grid-column:1/-1}.research-synthesis-dashboard{grid-template-columns:minmax(0,1.22fr) minmax(340px,.78fr);grid-template-areas:"source claim" "source output"}.research-synthesis-dashboard>.source-matrix-panel{grid-area:source}.research-synthesis-dashboard>.theme-map-panel{grid-area:theme}.research-synthesis-dashboard>.claim-thread-panel,.research-synthesis-dashboard>.claim-trace-panel{grid-area:claim}.research-synthesis-dashboard>.outline-rail-panel{grid-area:output}.shop-floor-dashboard{grid-template-columns:minmax(0,1.28fr) minmax(320px,.72fr);grid-template-areas:"bench tickets" "bench pickup"}.shop-floor-dashboard>.bench-board-panel{grid-area:bench}.shop-floor-dashboard>.ticket-stack-panel{grid-area:tickets}.shop-floor-dashboard>.pickup-panel{grid-area:pickup}.permit-closeout-dashboard{grid-template-columns:minmax(320px,.74fr) minmax(0,1.26fr);grid-template-areas:"condition road" "packet road"}.permit-closeout-dashboard>.inspection-roadmap-panel{grid-area:road}.permit-closeout-dashboard>.condition-ledger-panel{grid-area:condition}.permit-closeout-dashboard>.packet-panel{grid-area:packet}@media (max-width:860px){.research-synthesis-dashboard,.shop-floor-dashboard,.permit-closeout-dashboard{grid-template-columns:1fr;grid-template-areas:none}.research-synthesis-dashboard>.source-matrix-panel,.research-synthesis-dashboard>.theme-map-panel,.research-synthesis-dashboard>.claim-thread-panel,.research-synthesis-dashboard>.claim-trace-panel,.research-synthesis-dashboard>.outline-rail-panel,.shop-floor-dashboard>.bench-board-panel,.shop-floor-dashboard>.ticket-stack-panel,.shop-floor-dashboard>.pickup-panel,.permit-closeout-dashboard>.inspection-roadmap-panel,.permit-closeout-dashboard>.condition-ledger-panel,.permit-closeout-dashboard>.packet-panel{grid-area:auto}}

.records-workspace{display:grid;gap:16px}.quick-record-form{display:grid;gap:12px}.quick-record-form .form-heading,.source-import-panel .form-heading{display:flex;justify-content:space-between;gap:20px;align-items:end}.quick-record-form .form-heading p:last-child,.source-import-panel .form-heading p:last-child{max-width:560px;color:var(--muted);margin:0}.quick-fields{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:10px}.quick-record-form label{margin:0}.quick-record-form .wide-note{grid-column:1/-1}.source-import-panel{display:grid;gap:12px}.source-import-editor{display:grid;gap:8px;color:var(--muted);font-weight:850}.source-import-editor textarea{min-height:150px;width:100%;border:1px solid var(--line);border-radius:8px;padding:10px;background:var(--paper);color:var(--ink);font-family:Consolas,"SFMono-Regular",ui-monospace,monospace;line-height:1.42}.import-validation-output{max-height:220px;background:color-mix(in srgb,var(--paper) 86%,#102b3b);color:var(--ink);border:1px solid var(--line)}.records-workspace .record-stack{grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width:900px){.quick-record-form .form-heading,.source-import-panel .form-heading{display:grid}.quick-fields,.records-workspace .record-stack{grid-template-columns:1fr}}

/* conversion rebuild: light Store captures must read as product workspaces, not white forms */
:root[data-theme="light"] body{background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 22%,#fbfbff),color-mix(in srgb,var(--accent2) 18%,#dffbff) 50%,color-mix(in srgb,var(--accent) 12%,#ffffff))}
:root[data-theme="light"] .app-topbar{background:linear-gradient(105deg,color-mix(in srgb,var(--accent) 26%,#ffffff),color-mix(in srgb,var(--accent2) 20%,#ffffff) 58%,#e4fbff);border-color:color-mix(in srgb,var(--accent) 34%,var(--line))}
:root[data-theme="light"] .workspace{padding:18px 22px 24px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 16%,#ffffff),color-mix(in srgb,var(--accent2) 16%,#e5fbff));border-radius:16px}
:root[data-theme="light"] .compact-action-strip{background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 38%,#ffffff),color-mix(in srgb,var(--accent2) 30%,#ffffff));border-color:color-mix(in srgb,var(--accent2) 48%,var(--line))}
:root[data-theme="light"] .records-workspace,:root[data-theme="light"] .planning-grid,:root[data-theme="light"] .report-grid,:root[data-theme="light"] .evidence-grid{padding:16px;border-radius:16px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 34%,#fbfbff),color-mix(in srgb,var(--accent2) 26%,#dcfbff) 58%,#f0eaff);border:1px solid color-mix(in srgb,var(--accent) 32%,var(--line))}
:root[data-theme="light"] .quick-record-form,:root[data-theme="light"] .source-import-panel,:root[data-theme="light"] .planning-summary,:root[data-theme="light"] .planning-proof,:root[data-theme="light"] .report-grid .panel,:root[data-theme="light"] .evidence-grid .panel{background:linear-gradient(145deg,color-mix(in srgb,var(--accent) 50%,#ffffff),color-mix(in srgb,var(--accent2) 30%,#e6fbff));border-color:color-mix(in srgb,var(--accent) 48%,var(--line));box-shadow:0 18px 44px rgba(32,33,58,.16)}
:root[data-theme="light"] .record-card,:root[data-theme="light"] .lane,:root[data-theme="light"] .timeline-row{background:linear-gradient(145deg,color-mix(in srgb,var(--accent2) 36%,#ffffff),color-mix(in srgb,var(--accent) 24%,#f2eaff));border-color:color-mix(in srgb,var(--accent2) 48%,var(--line));box-shadow:0 12px 28px rgba(32,33,58,.12)}
:root[data-theme="light"] .record-card:nth-child(2n),:root[data-theme="light"] .lane:nth-child(2n),:root[data-theme="light"] .timeline-row:nth-child(2n){background:linear-gradient(145deg,color-mix(in srgb,var(--accent) 44%,#ffffff),color-mix(in srgb,var(--accent2) 20%,#e6fbff))}
:root[data-theme="light"] .quick-fields{padding:12px;border-radius:12px;background:rgba(255,255,255,.58);border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line))}
:root[data-theme="light"] pre{background:linear-gradient(90deg,rgba(24,18,64,.94),rgba(16,68,82,.88));color:#fbfbff;border:1px solid rgba(139,92,246,.36)}
:root[data-theme="light"] .quick-record-form,:root[data-theme="light"] .source-import-panel{background:linear-gradient(145deg,rgba(23,18,64,.96),rgba(62,42,132,.88) 62%,rgba(34,211,238,.30));color:#fbfbff}
:root[data-theme="light"] .quick-record-form .form-heading p:last-child,:root[data-theme="light"] .source-import-panel .form-heading p:last-child,:root[data-theme="light"] .quick-record-form label,:root[data-theme="light"] .source-import-editor{color:rgba(251,251,255,.90)}
:root[data-theme="light"] .quick-record-form input,:root[data-theme="light"] .quick-record-form select,:root[data-theme="light"] .quick-record-form textarea,:root[data-theme="light"] .source-import-editor textarea,:root[data-theme="light"] .import-validation-output{background:#fff;color:#20213a;border-color:rgba(139,92,246,.46)}
:root[data-theme="light"] .records-workspace .record-card:nth-child(odd){background:linear-gradient(145deg,#ffffff,#eee8ff);color:#20213a}
:root[data-theme="light"] .records-workspace .record-card:nth-child(even){background:linear-gradient(145deg,rgba(24,18,64,.96),rgba(72,48,148,.88));color:#fbfbff}
:root[data-theme="light"] .records-workspace .record-card:nth-child(even) span{color:#e7ddff;border-color:rgba(251,251,255,.28)}
:root[data-theme="light"] .timeline{padding:14px;border-radius:14px;background:linear-gradient(135deg,rgba(24,18,64,.96),rgba(18,90,108,.90));border:1px solid rgba(139,92,246,.42)}
:root[data-theme="light"] .timeline h2,:root[data-theme="light"] .timeline p{color:#fbfbff}
:root[data-theme="light"] .timeline-row:nth-child(odd){background:linear-gradient(90deg,#ffffff,#ece7ff);color:#20213a}
:root[data-theme="light"] .timeline-row:nth-child(odd) p{color:#20213a}
:root[data-theme="light"] .timeline-row:nth-child(even){background:linear-gradient(90deg,rgba(24,18,64,.96),rgba(34,211,238,.22));color:#fbfbff}
:root[data-theme="light"] .timeline-row:nth-child(even) p{color:#fbfbff}
:root[data-theme="light"] .planning-summary{background:linear-gradient(145deg,rgba(24,18,64,.96),rgba(34,211,238,.24));color:#fbfbff}
:root[data-theme="light"] .planning-summary h2,:root[data-theme="light"] .planning-summary p{color:#fbfbff}
:root[data-theme="light"] .planning-summary .mini-metrics{padding:12px;border-radius:12px;background:#ffffff;color:#20213a}
:root[data-theme="light"] .planning-summary .mini-metrics span{color:#20213a}
.source-trace-row strong,.source-trace-row span,.source-trace-row small{min-width:0;overflow-wrap:anywhere}
@media (max-width:700px){.source-matrix-panel{padding:14px}.source-matrix-panel .dashboard-object-header{gap:10px;margin-bottom:8px}.source-matrix-panel .dashboard-metric-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.source-matrix-panel .dashboard-metric-row div{padding:6px}.source-matrix-panel .dashboard-metric-row strong{font-size:18px}.source-matrix-panel .dashboard-metric-row span{font-size:10px}.source-matrix-toolbar{padding:7px 8px;font-size:13px;align-items:start}.source-trace-row{grid-template-columns:32px minmax(0,1fr);grid-template-areas:"index title" "index owner" "status status" "note note";align-items:start;row-gap:4px;line-height:1.12}.source-trace-row strong{line-height:1.12}.source-trace-row span:nth-of-type(2){line-height:1.15}.source-trace-row em{justify-self:start}.source-trace-row small{line-height:1.2}}

/* user-controlled surface mode: rich visuals must be optional and readable */
.app-topbar{grid-template-columns:minmax(260px,1fr) minmax(0,1.8fr) auto auto auto}
.app-topbar .theme-picker,.app-topbar .surface-picker{display:flex;align-items:center;gap:8px}.surface-picker select{min-width:112px;border-radius:8px;border:1px solid var(--line);padding:8px;background:var(--paper);color:var(--ink)}
:root[data-theme="dark"] .theme-picker select,:root[data-theme="dark"] .surface-picker select{background:rgba(255,255,255,.12);color:var(--ink);border-color:rgba(255,255,255,.26)}:root[data-theme="dark"] .theme-picker option,:root[data-theme="dark"] .surface-picker option{background:var(--panel);color:var(--ink)}
.binder-hero,.source-matrix-panel,.theme-map-panel,.bench-board-panel,.inspection-roadmap-panel{color:#fbfbff!important}.binder-hero h2,.source-matrix-panel h2,.theme-map-panel h2,.bench-board-panel h2,.inspection-roadmap-panel h2,.binder-hero strong,.source-matrix-panel strong,.theme-map-panel strong,.bench-board-panel strong,.inspection-roadmap-panel strong{color:#fbfbff!important}.binder-hero p,.binder-records span,.binder-records em,.source-matrix-panel span,.source-matrix-panel em,.theme-map-panel p,.bench-board-panel span,.bench-board-panel em,.inspection-roadmap-panel em{color:rgba(251,251,255,.86)!important}.theme-map-panel .theme-map span{background:rgba(251,251,255,.78)!important;color:#20213a!important}
:root[data-surface="plain"] body,:root[data-surface="plain"] .workspace{background:var(--bg)!important;border-radius:0!important}
:root[data-surface="plain"] .app-topbar,:root[data-surface="plain"] .panel,:root[data-surface="plain"] .action-strip,:root[data-surface="plain"] .proof-hero,:root[data-surface="plain"] .records-workspace,:root[data-surface="plain"] .planning-grid,:root[data-surface="plain"] .report-grid,:root[data-surface="plain"] .evidence-grid,:root[data-surface="plain"] .timeline,:root[data-surface="plain"] .theme-lanes,:root[data-surface="plain"] .quick-record-form,:root[data-surface="plain"] .source-import-panel{background:var(--panel)!important;border-color:var(--line)!important;box-shadow:none!important;color:var(--ink)!important}
:root[data-surface="plain"] .record-card,:root[data-surface="plain"] .lane,:root[data-surface="plain"] .timeline-row,:root[data-surface="plain"] .lane-preview div,:root[data-surface="plain"] .dashboard-metric-row div,:root[data-surface="plain"] .binder-records div,:root[data-surface="plain"] .source-matrix div,:root[data-surface="plain"] .source-trace-row,:root[data-surface="plain"] .source-matrix-toolbar,:root[data-surface="plain"] .source-empty-state,:root[data-surface="plain"] .trace-empty-state,:root[data-surface="plain"] .inspection-roadmap div,:root[data-surface="plain"] .shop-lanes div,:root[data-surface="plain"] .permit-ledger div,:root[data-surface="plain"] .theme-lane,:root[data-surface="plain"] .theme-card,:root[data-surface="plain"] .repair-lane,:root[data-surface="plain"] .repair-ticket,:root[data-surface="plain"] .inspection-checkpoint,:root[data-surface="plain"] .ticket-chip,:root[data-surface="plain"] .ledger-row{background:color-mix(in srgb,var(--panel) 92%,var(--bg))!important;border-color:var(--line)!important;box-shadow:none!important;color:var(--ink)!important}
:root[data-surface="plain"] .theme-signal-grid,:root[data-surface="plain"] .theme-proof-row,:root[data-surface="plain"] .theme-synthesis-proof{background:color-mix(in srgb,var(--panel) 92%,var(--bg))!important;border-color:var(--line)!important;color:var(--ink)!important}
:root[data-surface="plain"] .theme-map-panel .theme-map span,:root[data-surface="plain"] .theme-signal-grid span,:root[data-surface="plain"] .theme-chip-row span,:root[data-surface="plain"] .source-index,:root[data-surface="plain"] .source-trace-row em{background:var(--panel)!important;color:var(--ink)!important;border:1px solid var(--line)!important;box-shadow:none!important}
:root[data-surface="plain"] .panel h1,:root[data-surface="plain"] .panel h2,:root[data-surface="plain"] .panel h3,:root[data-surface="plain"] .panel strong,:root[data-surface="plain"] .eyebrow,:root[data-surface="plain"] .dashboard-metric-row strong,:root[data-surface="plain"] .theme-proof-row strong,:root[data-surface="plain"] .mini-metrics strong{color:var(--ink)!important}
:root[data-surface="plain"] .panel p,:root[data-surface="plain"] .panel span,:root[data-surface="plain"] .panel em,:root[data-surface="plain"] .record-card span,:root[data-surface="plain"] .brand small,:root[data-surface="plain"] .status{color:var(--muted)!important}
:root[data-surface="plain"] button{color:#07100b!important}:root[data-surface="plain"] pre{background:color-mix(in srgb,var(--ink) 10%,var(--panel))!important;color:var(--ink)!important;border:1px solid var(--line)}

.trace-action-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.source-diff-panel{display:grid;gap:10px;border:1px solid var(--line);border-radius:10px;padding:12px;background:rgba(255,255,255,.08)}
.diff-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.diff-grid article{display:grid;gap:5px;border:1px solid rgba(255,255,255,.18);border-radius:8px;padding:10px;background:rgba(255,255,255,.08)}
.diff-grid span{color:var(--accent2);font-size:12px;font-weight:900;text-transform:uppercase}
.diff-grid small{color:var(--muted);line-height:1.25}
.source-diff-panel ol,.review-history-panel ol{display:grid;gap:7px;margin:0;padding-left:20px}
.source-diff-panel li,.review-history-panel li{line-height:1.3}
.source-diff-panel li span,.review-history-panel li span{display:block;color:var(--muted)}
@media (max-width:700px){.trace-action-row,.diff-grid{grid-template-columns:1fr}}
:root[data-surface="plain"] .source-diff-panel,:root[data-surface="plain"] .diff-grid article{background:color-mix(in srgb,var(--panel) 92%,var(--bg))!important;border-color:var(--line)!important;color:var(--ink)!important}
@media (min-width:861px){.research-synthesis-dashboard>.source-matrix-panel{position:sticky;top:104px;align-self:start;max-height:calc(100vh - 126px);overflow:auto}}
@media (max-width:1200px){.app-topbar{grid-template-columns:1fr}}

/* text-contrast-quality-gate overrides start */
html[data-theme="dark"][data-surface="plain"] div#app > header.app-topbar > nav.top-nav > button.nav-btn:nth-of-type(2) { color: #f8fafc !important; -webkit-text-fill-color: #f8fafc !important; }
html[data-theme="dark"][data-surface="plain"] div#app > header.app-topbar > nav.top-nav > button.nav-btn:nth-of-type(3) { color: #f8fafc !important; -webkit-text-fill-color: #f8fafc !important; }
html[data-theme="dark"][data-surface="plain"] div#app > header.app-topbar > nav.top-nav > button.nav-btn:nth-of-type(4) { color: #f8fafc !important; -webkit-text-fill-color: #f8fafc !important; }
html[data-theme="dark"][data-surface="plain"] div#app > header.app-topbar > nav.top-nav > button.nav-btn:nth-of-type(5) { color: #f8fafc !important; -webkit-text-fill-color: #f8fafc !important; }
html[data-theme="dark"][data-surface="plain"] div#app > header.app-topbar > nav.top-nav > button.nav-btn:nth-of-type(6) { color: #f8fafc !important; -webkit-text-fill-color: #f8fafc !important; }
html[data-theme="light"][data-surface="plain"] div#app > header.app-topbar > div.brand:nth-of-type(1) > div > small { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] div#app > header.app-topbar > div.support-links:nth-of-type(4) > a:nth-of-type(1) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] div#app > header.app-topbar > div.support-links:nth-of-type(4) > a:nth-of-type(2) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] div#app > header.app-topbar > div.support-links:nth-of-type(4) > a:nth-of-type(3) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] div#app > header.app-topbar > div.surface-picker:nth-of-type(3) > label { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] div#app > header.app-topbar > div.theme-picker:nth-of-type(2) > label { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] div#exportState { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.claim-trace-panel:nth-of-type(2) > div > p:nth-of-type(2) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="plain"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.source-matrix-toolbar:nth-of-type(2) > span { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > div.dashboard-metric-row > div:nth-of-type(1) > span { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > div.dashboard-metric-row > div:nth-of-type(1) > strong { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > div.dashboard-metric-row > div:nth-of-type(2) > span { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > div.dashboard-metric-row > div:nth-of-type(2) > strong { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > div.dashboard-metric-row > div:nth-of-type(3) > span { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > div.dashboard-metric-row > div:nth-of-type(3) > strong { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#app > header.app-topbar > div.brand:nth-of-type(1) > div > small { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#app > header.app-topbar > div.support-links:nth-of-type(4) > a:nth-of-type(1) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#app > header.app-topbar > div.support-links:nth-of-type(4) > a:nth-of-type(2) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#app > header.app-topbar > div.support-links:nth-of-type(4) > a:nth-of-type(3) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#app > header.app-topbar > div.surface-picker:nth-of-type(3) > label { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#app > header.app-topbar > div.theme-picker:nth-of-type(2) > label { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] div#exportState { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.claim-trace-panel:nth-of-type(2) > div > p.eyebrow:nth-of-type(1) { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > h2 { display: inline; padding: 0.05em 0.18em; border-radius: 8px; background: rgba(251, 251, 255, 0.94) !important; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.dashboard-object-header:nth-of-type(1) > p.eyebrow { color: #bff6ff !important; -webkit-text-fill-color: #bff6ff !important; }
html[data-theme="light"][data-surface="rich"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.source-matrix-toolbar:nth-of-type(2) { background: #12312e !important; border-radius: 10px; padding: 10px 12px; }
html[data-theme="light"][data-surface="rich"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.source-matrix-toolbar:nth-of-type(2) > span { color: #fbfbff !important; -webkit-text-fill-color: #fbfbff !important; font-weight: 950; }
html[data-theme="light"][data-surface="rich"] main.workspace.dashboard-workspace > section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.source-matrix-toolbar:nth-of-type(2) > strong { color: #fbfbff !important; -webkit-text-fill-color: #fbfbff !important; font-weight: 950; }
html[data-theme="light"][data-surface="rich"] section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.source-trace-grid:nth-of-type(3) > button.source-trace-row.is-selected:nth-of-type(1) > em { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
html[data-theme="light"][data-surface="rich"] section.domain-dashboard.research-synthesis-dashboard:nth-of-type(2) > article.panel.source-matrix-panel.source-claim-workbench:nth-of-type(1) > div.source-trace-grid:nth-of-type(3) > button.source-trace-row:nth-of-type(2) > em { color: #12312e !important; -webkit-text-fill-color: #12312e !important; }
/* text-contrast-quality-gate overrides end */

/* max-ux-visual-audit: source matrix toolbar must stay readable in every theme/surface state. */
.source-matrix-toolbar {
  background: #12312e !important;
  color: #fbfbff !important;
  border-color: rgba(251, 251, 255, 0.34) !important;
}

.source-matrix-toolbar strong,
.source-matrix-toolbar span {
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
  font-size: 17px;
  font-weight: 950;
}

html[data-theme][data-surface] .source-matrix-panel .dashboard-metric-row div {
  background: rgba(251, 251, 255, 0.96) !important;
  color: #12312e !important;
  border-color: rgba(18, 49, 46, 0.24) !important;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar {
  background: #12312e !important;
  color: #fbfbff !important;
  border-color: rgba(251, 251, 255, 0.34) !important;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span {
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
}

html[data-theme][data-surface] .source-matrix-panel .dashboard-metric-row strong,
html[data-theme][data-surface] .source-matrix-panel .dashboard-metric-row span {
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span {
  font-size: 17px;
  font-weight: 950;
}

/* max-ux-visual-audit 2026-07-02: source rows and selected claim notes must be readable on rich gradients. */
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row {
  text-shadow: none;
  mix-blend-mode: normal;
}

html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row {
  border-color: rgba(18, 49, 46, 0.22) !important;
  background: rgba(251, 251, 255, 0.96) !important;
  color: #12312e !important;
}

html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row strong,
html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row span,
html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row small,
html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row em {
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
}

html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row em,
html[data-theme="light"][data-surface] .source-matrix-panel .source-index {
  border: 1px solid rgba(18, 49, 46, 0.18);
  background: #dff8ff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
}

html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row {
  border-color: rgba(251, 251, 255, 0.26) !important;
  background: rgba(12, 16, 38, 0.88) !important;
  color: #fbfbff !important;
}

html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row strong,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row span,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row small,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row em {
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
}

html[data-theme="light"][data-surface] .claim-trace-panel p {
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
}

html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row.is-selected span:nth-of-type(2),
html[data-theme="light"][data-surface] .source-matrix-panel .source-trace-row.is-selected small {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 7px;
  background: #12312e !important;
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
  font-size: 14px;
  font-weight: 950;
}

html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected span:nth-of-type(2),
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected small {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 950;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span {
  font-size: 19px;
  line-height: 1.25;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar {
  flex-wrap: wrap;
  align-items: flex-start;
  overflow: hidden;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected strong,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected span:nth-of-type(2),
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected small,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected em {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(251, 251, 255, 0.22);
  border-radius: 8px;
  background: #12312e !important;
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
  text-shadow: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span {
  flex: 1 1 260px;
}

html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected strong {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 950;
}

html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span {
  border-color: rgba(18, 49, 46, 0.18);
  background: #fbfbff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
}

html[data-theme][data-surface] #applyTemplate,
html[data-theme][data-surface] #generateReport,
html[data-theme][data-surface] #saveLocal,
html[data-theme][data-surface] #loadSaved,
html[data-theme][data-surface] #deleteSaved {
  border-color: rgba(15, 118, 110, 0.48) !important;
  background: #0f766e !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  font-weight: 950;
}

html[data-theme][data-surface] #deleteSaved {
  border-color: rgba(127, 29, 29, 0.5) !important;
  background: #7f1d1d !important;
}

html[data-theme][data-surface] .top-nav .nav-btn.active {
  background: #12312e !important;
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
}

/* max-ux-visual-audit 2026-07-03: source matrix metadata and export state need explicit readable surfaces. */
html[data-theme][data-surface] .source-matrix-panel .source-matrix span,
html[data-theme][data-surface] .source-matrix-panel .source-matrix em,
html[data-theme][data-surface] .claim-trace-panel p,
html[data-theme][data-surface] .outline-rail-panel p,
html[data-theme][data-surface] #exportState,
html[data-theme][data-surface] .brand small {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(18, 49, 46, 0.18);
  background: #fbfbff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
  font-weight: 900;
  text-shadow: none;
}

html[data-theme="dark"][data-surface] .source-matrix-panel .source-matrix span,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-matrix em,
html[data-theme="dark"][data-surface] .claim-trace-panel p,
html[data-theme="dark"][data-surface] .outline-rail-panel p,
html[data-theme="dark"][data-surface] #exportState,
html[data-theme="dark"][data-surface] .brand small {
  border-color: rgba(191, 246, 255, 0.24);
  background: #102b3b !important;
  color: #d9f7ff !important;
  -webkit-text-fill-color: #d9f7ff !important;
}

html[data-theme][data-surface] .trace-form label,
html[data-theme][data-surface] .source-matrix-panel .eyebrow {
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(124, 45, 18, 0.16);
  background: #fff7ed !important;
  color: #7c2d12 !important;
  -webkit-text-fill-color: #7c2d12 !important;
  font-weight: 900;
}

html[data-theme="dark"][data-surface] .trace-form label,
html[data-theme="dark"][data-surface] .source-matrix-panel .eyebrow {
  border-color: rgba(254, 215, 170, 0.22);
  background: #3b241b !important;
  color: #fed7aa !important;
  -webkit-text-fill-color: #fed7aa !important;
}

html[data-theme][data-surface] .claim-trace-panel .trace-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

html[data-theme][data-surface] .claim-trace-panel .trace-form label {
  width: 100%;
  max-width: none;
  border-radius: 12px;
  align-content: start;
}

html[data-theme][data-surface] .claim-trace-panel .trace-form label:nth-child(1),
html[data-theme][data-surface] .claim-trace-panel .trace-form label:nth-child(2),
html[data-theme][data-surface] .claim-trace-panel .trace-form .claim-note,
html[data-theme][data-surface] .claim-trace-panel .trace-form .trace-action-row,
html[data-theme][data-surface] .claim-trace-panel .trace-form > button[type="submit"] {
  grid-column: 1 / -1;
}

html[data-theme][data-surface] .claim-trace-panel .trace-form input,
html[data-theme][data-surface] .claim-trace-panel .trace-form select,
html[data-theme][data-surface] .claim-trace-panel .trace-form textarea {
  min-width: 0;
  width: 100%;
}

/* Polish 7: topbar navigation/status labels need stable contrast in desktop and mobile. */
html[data-theme][data-surface] .top-nav .nav-btn,
html[data-theme][data-surface] .app-topbar .brand strong,
html[data-theme][data-surface] #actionStatus,
html[data-theme][data-surface] .support-links a,
html[data-theme][data-surface] .theme-picker label,
html[data-theme][data-surface] .surface-picker label {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(18, 49, 46, 0.18);
  border-radius: 999px;
  background: #fbfbff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
  font-weight: 950;
  line-height: 1.18;
  padding: 4px 8px;
  text-shadow: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html[data-theme][data-surface] .top-nav .nav-btn.active {
  background: #12312e !important;
  border-color: #12312e !important;
  color: #fbfbff !important;
  -webkit-text-fill-color: #fbfbff !important;
}

html[data-theme][data-surface] .theme-picker select,
html[data-theme][data-surface] .surface-picker select {
  background: #ffffff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
  border-color: rgba(18, 49, 46, 0.22) !important;
}

html[data-theme="dark"][data-surface] .top-nav .nav-btn,
html[data-theme="dark"][data-surface] .app-topbar .brand strong,
html[data-theme="dark"][data-surface] #actionStatus,
html[data-theme="dark"][data-surface] .support-links a,
html[data-theme="dark"][data-surface] .theme-picker label,
html[data-theme="dark"][data-surface] .surface-picker label {
  background: #f7f4ec !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
  border-color: rgba(247, 200, 115, 0.62) !important;
}

/* Polish 7: source-claim workbench proof text must survive rich/dark/plain compositions. */
html[data-theme][data-surface] .source-matrix-panel .dashboard-object-header .eyebrow,
html[data-theme][data-surface] .source-matrix-panel .dashboard-object-header h2,
html[data-theme][data-surface] .source-matrix-panel .dashboard-metric-row strong,
html[data-theme][data-surface] .source-matrix-panel .dashboard-metric-row span,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme][data-surface] .source-matrix-panel .source-matrix-toolbar span,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected strong,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected span,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected small,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected em {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(18, 49, 46, 0.18);
  border-radius: 8px;
  background: #fbfbff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
  font-weight: 950;
  line-height: 1.2;
  padding: 4px 8px;
  text-shadow: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html[data-theme][data-surface] .source-matrix-panel .dashboard-object-header .eyebrow,
html[data-theme][data-surface] .source-matrix-panel .dashboard-metric-row span,
html[data-theme][data-surface] .source-matrix-panel .source-trace-row.is-selected em {
  border-radius: 999px;
}

html[data-theme="dark"][data-surface] .source-matrix-panel .dashboard-object-header .eyebrow,
html[data-theme="dark"][data-surface] .source-matrix-panel .dashboard-object-header h2,
html[data-theme="dark"][data-surface] .source-matrix-panel .dashboard-metric-row strong,
html[data-theme="dark"][data-surface] .source-matrix-panel .dashboard-metric-row span,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-matrix-toolbar strong,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-matrix-toolbar span,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row.is-selected strong,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row.is-selected span,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row.is-selected small,
html[data-theme="dark"][data-surface] .source-matrix-panel .source-trace-row.is-selected em {
  background: #fbfbff !important;
  color: #12312e !important;
  -webkit-text-fill-color: #12312e !important;
  border-color: rgba(191, 246, 255, 0.28) !important;
}

/* Polish 8: the source-matrix proof object uses one solid contrast system; this
   deliberately overrides older exact generated selectors that mixed light chips
   into rich/dark/plain states. */
html[data-theme][data-surface] body #sourceMatrixWorkbench.source-matrix-panel {
  background: linear-gradient(145deg, #08272d, #0d363b 58%, #12312e) !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header .eyebrow,
html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header h2,
html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row strong,
html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar strong,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row strong,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row small,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row em,
html[data-theme][data-surface] body #sourceMatrixWorkbench .theme-chip-row span {
  background: transparent !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  border-color: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header .eyebrow {
  display: inline-flex !important;
  width: fit-content;
  padding: 4px 9px !important;
  border: 1px solid rgba(125, 211, 252, 0.42) !important;
  border-radius: 999px !important;
  background: #103a43 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  font-size: 14px;
  line-height: 1.15;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header h2 {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: clamp(25px, 2.1vw, 34px);
  line-height: 1.05;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row div,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row {
  border: 1px solid rgba(191, 246, 255, 0.28) !important;
  background: #0a2e35 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  box-shadow: none !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row div {
  background: #020506 !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row strong {
  font-size: 42px;
  line-height: 1;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar strong,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar span {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.22;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar {
  background: #061f26 !important;
  gap: 8px;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row {
  background: #0b3038 !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected {
  border-color: #7dd3fc !important;
  background: #063541 !important;
  box-shadow: inset 0 0 0 2px rgba(125, 211, 252, 0.5) !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row strong,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row small,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row em {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 20px;
  line-height: 1.22;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row strong {
  font-size: 22px;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row em {
  justify-self: end;
  padding: 4px 8px !important;
  border: 1px solid rgba(191, 246, 255, 0.36) !important;
  border-radius: 999px !important;
  background: #0f4b45 !important;
  font-size: 20px;
}


html[data-theme][data-surface] body #sourceMatrixWorkbench .source-index {
  background: #061f26 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  border: 1px solid rgba(191, 246, 255, 0.45) !important;
  font-size: 24px;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .theme-chip-row span {
  display: inline-flex !important;
  width: fit-content;
  padding: 7px 10px !important;
  border: 1px solid rgba(191, 246, 255, 0.28) !important;
  border-radius: 999px !important;
  background: #0a2e35 !important;
}

@media (max-width: 700px) {
  html[data-theme][data-surface] body .action-strip {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  html[data-theme][data-surface] body .action-strip #generateReport {
    flex: 0 0 132px;
    width: 132px;
  }

  html[data-theme][data-surface] body .action-strip #actionStatus {
    flex: 1 1 calc(100% - 150px);
    min-width: 0;
    width: auto;
    max-width: calc(100% - 150px);
    white-space: normal;
  }

  html[data-theme][data-surface] body .action-strip #exportState {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench {
    padding: 12px !important;
    gap: 8px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 6px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header .eyebrow {
    font-size: 11px;
    padding: 3px 7px !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-object-header h2 {
    font-size: 20px;
    line-height: 1.06;
  }

  html[data-theme][data-surface] .claim-trace-panel .trace-form {
    grid-template-columns: 1fr !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row div {
    padding: 5px !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row strong {
    font-size: 20px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span {
    font-size: 10px;
    line-height: 1.08;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar {
    display: none;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-grid {
    gap: 6px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row {
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas: "index title" "index owner" "status status" "note note";
    padding: 7px 8px !important;
    row-gap: 3px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-index {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row strong {
    font-size: 16px;
    line-height: 1.08;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row span,
  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row small,
  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row em {
    font-size: 12px;
    line-height: 1.12;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row em {
    justify-self: start;
    padding: 3px 7px !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .theme-chip-row {
    display: none;
  }
}

/* max-ux-visual-audit: source-matrix metric labels must not rely on white text edges over black. */
html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span {
  display: inline-flex !important;
  width: fit-content !important;
  max-width: 100%;
  padding: 4px 8px !important;
  border: 1px solid rgba(2, 5, 6, 0.18) !important;
  border-radius: 7px !important;
  background: #f8fafc !important;
  color: #020506 !important;
  -webkit-text-fill-color: #020506 !important;
  -webkit-text-stroke: 0.25px #020506;
  font-weight: 950 !important;
  -webkit-font-smoothing: antialiased;
  font-smooth: auto;
}

/* max-ux-visual-audit correction: keep metric labels compact; use a white stroke instead of a light chip. */
html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  -webkit-text-stroke: 0;
  text-shadow: none;
  font-size: 20px;
  font-weight: 900 !important;
  line-height: 1.12;
  -webkit-font-smoothing: none;
  font-smooth: never;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar {
  display: none !important;
  min-height: 0;
  visibility: hidden !important;
  pointer-events: none;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-matrix-toolbar * {
  visibility: hidden !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected {
  border-color: #bfdbfe !important;
  background: #020506 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  box-shadow:
    inset 0 0 0 2px rgba(191, 219, 254, 0.7),
    0 0 0 1px rgba(2, 5, 6, 0.85) !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected strong,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected small {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  -webkit-text-stroke: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-weight: 900 !important;
  text-shadow: none;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected strong {
  font-size: 32px;
  line-height: 1.04;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected span,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected em,
html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected small {
  display: none !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected {
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "index title";
  padding: 18px 20px !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-grid {
  max-height: 102px;
  overflow-y: auto;
  padding-right: 4px;
  scroll-snap-type: y mandatory;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row {
  scroll-snap-align: start;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .theme-chip-row {
  display: none !important;
}

html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected em {
  border-color: rgba(248, 250, 252, 0.44) !important;
  background: #f8fafc !important;
  color: #020506 !important;
  -webkit-text-fill-color: #020506 !important;
  -webkit-text-stroke: 0;
  font-weight: 1000 !important;
  text-shadow: none;
}

/* Max UX visual audit: source-matrix proof text must sit on one stable
   surface, and mobile metric labels must never be squeezed into fragments. */
html[data-theme][data-surface] body #sourceMatrixWorkbench.source-matrix-panel {
  background: #08272d !important;
}

@media (max-width: 700px) {
  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row div {
    min-height: 84px;
    padding: 10px !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row strong {
    font-size: 28px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span {
    font-size: 15px;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Maximum-quality workflow pass 2026-07-05: the outline result starts with source-to-outline proof, not raw Markdown. */
.trace-source-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.trace-source-cards article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  padding: 10px;
}

.trace-source-cards span {
  color: var(--accent2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.trace-source-cards strong {
  font-size: 16px;
}

.trace-source-cards small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.trace-review-primary button {
  width: max-content;
}

@media (max-width: 900px) {
  .trace-source-cards {
    grid-template-columns: 1fr;
  }
}

/* Max UX mobile correction: the first source row must remain visible before
   interaction, while metric labels stay whole and readable. */
@media (max-width: 700px) {
  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row div {
    min-height: 70px;
    padding: 8px 6px !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row strong {
    font-size: 23px;
    line-height: 1;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .dashboard-metric-row span {
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-grid {
    max-height: 148px;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 12px 14px !important;
  }

  html[data-theme][data-surface] body #sourceMatrixWorkbench .source-trace-row.is-selected strong {
    font-size: 24px;
    line-height: 1.04;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Max visual integrity: mobile nav must not show half-clipped labels at the viewport edge. */
@media (max-width: 700px) {
  html[data-theme][data-surface] body .top-nav {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 6px !important;
    padding-bottom: 0 !important;
  }

  html[data-theme][data-surface] body .top-nav .nav-btn {
    flex: 1 1 112px !important;
    min-width: 112px !important;
    white-space: normal !important;
    line-height: 1.12 !important;
  }
}
