:root{color-scheme:light;--ink:#202a35;--muted:#74808c;--line:#e5e9ed;--paper:#f5f7fa;--white:#fff;--navy:#203548;--teal:#0d7e79;--teal-soft:#e8f5f3;--green:#27836f;--green-bg:#eaf5f0;--red:#cb5c56;--red-bg:#fff0ed;--amber:#c78128;--amber-bg:#fff5e7;--purple:#8265ad;--purple-bg:#f2edfa;--shadow:0 9px 28px rgba(31,51,67,.045);font-family:'DM Sans',Arial,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility}
:root{--button-hover-bg:#e6f0ee;--button-hover-ink:#155f5b}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-size:13px}.hidden{display:none!important}button,input,select{font:inherit}button{cursor:pointer}.app-frame{min-height:100vh}.topbar{height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:20}.brand{display:flex;gap:10px;align-items:center;color:#1d2d3b;text-decoration:none;font-family:Manrope,sans-serif;font-weight:800;font-size:15px;letter-spacing:-.4px}.brand-light{font-weight:500;color:#81909d}.brand-mark{width:22px;height:22px;border-radius:7px;background:#e8f5f3;display:flex;align-items:center;justify-content:center;gap:2px}.brand-mark i{width:3px;border-radius:2px;background:#167d77;display:block}.brand-mark i:nth-child(1){height:8px}.brand-mark i:nth-child(2){height:14px}.brand-mark i:nth-child(3){height:10px}.topbar-right{display:flex;align-items:center;gap:18px}.local-indicator{display:flex;align-items:center;gap:7px;background:#eef6f3;border:1px solid #dcece5;border-radius:20px;padding:6px 10px;color:#527365;font:500 9px 'DM Mono',monospace;letter-spacing:.7px}.local-indicator span,.status-dot{width:6px;height:6px;border-radius:100%;background:#56a97e;box-shadow:0 0 0 3px #dcefe4}.icon-button{width:25px;height:25px;border:1px solid #dce2e7;border-radius:50%;background:#fff;color:#687784;font:600 12px Georgia}.layout{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:calc(100vh - 64px)}.sidebar{border-right:1px solid var(--line);background:#fbfcfd;display:flex;flex-direction:column;padding:28px 15px 17px;gap:30px}.sidebar-section{padding:0 5px}.side-label,.eyebrow{color:#84919c;font:500 9px 'DM Mono',monospace;letter-spacing:1.15px}.field-label{display:block;color:#61707c;font-size:11px;font-weight:600;margin:13px 0 7px}.field-label.spaced{margin-top:17px}select,.search-wrap input{appearance:none;background:#fff;border:1px solid #dfe5e9;color:#3f4c58;border-radius:7px;padding:9px 31px 9px 10px;width:100%;font-size:11px;outline:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%237c8994' stroke-width='1.3'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 11px center}select:focus,input:focus{border-color:#79b8b1;box-shadow:0 0 0 3px #e7f3f1}select:disabled{opacity:.55}.nav-stack{display:grid;gap:4px;margin-top:12px}.nav-item{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;color:#697783;padding:10px 9px;border-radius:7px;text-align:left;font-size:11px;font-weight:600}.nav-item:hover{background:#f1f4f6}.nav-item.active{background:#eaf4f3;color:#1f6e6b}.nav-icon{width:16px;text-align:center;font-size:15px}.nav-count{margin-left:auto;font:10px 'DM Mono',monospace;color:#93a0aa}.segmented{display:grid;grid-template-columns:1fr 1fr;background:#eef1f3;border-radius:7px;padding:3px;margin-top:17px}.segment{border:0;background:transparent;border-radius:5px;padding:7px;color:#71808b;font-size:10px;font-weight:700}.segment.active{background:#fff;color:#256f6b;box-shadow:0 1px 4px #14263512}.sidebar-bottom{margin-top:auto}.dataset-status{display:flex;gap:9px;align-items:flex-start;border:1px solid #e1e7ea;background:white;border-radius:8px;padding:11px 10px}.dataset-status .status-dot{flex:none;margin:5px 2px}.dataset-status b{font-size:10px;display:block}.dataset-status small{display:block;color:#8a969f;font-size:9px;margin-top:3px;line-height:1.45}.sidebar-bottom p{font-size:9px;line-height:1.5;color:#929da6;padding:0 3px;margin:9px 0 0}.main-content{padding:33px clamp(22px,3.1vw,48px) 18px;max-width:1640px;width:100%;margin:0 auto}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:23px}.eyebrow span{color:#b3bdc5;margin:0 4px}.page-heading h1{font:700 25px Manrope,sans-serif;letter-spacing:-.8px;margin:7px 0 5px;color:#263746}.page-heading p{margin:0;color:#82909b;font-size:11px}.threshold-chip{display:flex;align-items:center;gap:12px;border:1px solid #e0e5e8;border-radius:8px;background:#fff;padding:9px 12px;white-space:nowrap}.threshold-chip .chip-label{font:9px 'DM Mono',monospace;letter-spacing:.5px;color:#89959e}.threshold-chip b{color:#31525e;font:600 13px 'DM Mono',monospace}.threshold-chip.compact{font:10px 'DM Mono',monospace;padding:7px 10px;color:#536671}.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:15px}.kpi-card{background:#fff;border:1px solid var(--line);border-radius:9px;padding:14px 16px;box-shadow:var(--shadow);min-height:86px}.kpi-top{display:flex;justify-content:space-between;align-items:center}.kpi-label{font:9px 'DM Mono',monospace;letter-spacing:.7px;color:#88949e}.kpi-icon{color:#8da3a6;font-size:13px}.kpi-value{font:700 23px Manrope,sans-serif;letter-spacing:-.8px;color:#2b3c49;margin-top:9px}.kpi-sub{font-size:9px;color:#96a1aa;margin-top:2px}.card{background:#fff;border:1px solid var(--line);border-radius:9px;box-shadow:var(--shadow);margin-bottom:14px}.patient-card{display:grid;grid-template-columns:minmax(250px, .85fr) minmax(400px,1.8fr);align-items:center;padding:17px 18px;gap:18px}.patient-main{display:flex;gap:12px;align-items:center}.patient-avatar{width:43px;height:43px;border-radius:12px;display:grid;place-items:center;background:#eff3f5;color:#37505d;font:700 13px 'DM Mono',monospace}.patient-main h2{font:700 16px Manrope,sans-serif;letter-spacing:-.25px;margin:4px 0}.patient-main p{font-size:10px;color:#89959e;margin:0}.patient-meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px 14px;border-left:1px solid #edf0f2;padding-left:18px}.meta-item span{display:block;color:#96a0a9;font:8px 'DM Mono',monospace;letter-spacing:.45px;text-transform:uppercase}.meta-item b{display:block;color:#465560;font-size:10px;font-weight:600;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:14px}.section-heading h2{font:700 14px Manrope,sans-serif;letter-spacing:-.2px;margin:4px 0 0;color:#2c3e4a}.chart-card{padding:17px 18px 12px}.legend{display:flex;gap:15px;align-items:center;color:#83909a;font-size:9px}.legend span{display:flex;align-items:center;gap:5px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%}.dot-correct{background:#4a9b83}.dot-error{background:#dc7968}.dot-disagreement{border:1.5px solid #9379bb;background:white}.probability-wrap{width:100%;min-height:210px;margin-top:10px}.probability-svg{display:block;width:100%;height:auto;max-height:250px}.chart-grid{stroke:#edf0f2;stroke-width:1}.chart-axis{fill:#94a0a9;font:9px 'DM Mono',monospace}.chart-threshold{stroke:#cf9362;stroke-width:1.2;stroke-dasharray:5 4}.chart-threshold-label{fill:#b37a49;font:8px 'DM Mono',monospace}.event-point{cursor:pointer;stroke:#fff;stroke-width:1.4}.event-point:hover,.event-point.selected{stroke:#213c4b;stroke-width:2.5}.chart-footnote{color:#a0a9b0;font-size:9px;padding-top:4px}.table-card{overflow:hidden}.table-heading{padding:16px 18px 12px}.table-heading h2{display:flex;align-items:center;gap:8px}.subtle-count{font:10px 'DM Mono',monospace;color:#9aa4ac}.search-wrap{position:relative;width:180px}.search-wrap span{position:absolute;left:9px;top:7px;font-size:15px;color:#8c9aa3}.search-wrap input{padding:8px 9px 8px 29px;font-size:10px;background-image:none}.table-scroll{width:100%;overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}thead{background:#f9fafb}th{padding:9px 13px;text-align:left;font:9px 'DM Mono',monospace;font-weight:400;letter-spacing:.55px;color:#8a969e;border-top:1px solid #f0f2f4;border-bottom:1px solid #edf0f2}td{padding:10px 13px;border-bottom:1px solid #f0f2f4;color:#53616c;font-size:10px}tbody tr{transition:background .12s;cursor:pointer}tbody tr:hover{background:#f6faf9}tbody tr.selected-row{background:#eef7f5}.event-id{font-family:'DM Mono',monospace;color:#798792}.label-pair{font-family:'DM Mono',monospace}.probability-cell{font:600 10px 'DM Mono',monospace;color:#314956}.badge{display:inline-flex;align-items:center;border-radius:4px;padding:4px 6px;font:9px 'DM Mono',monospace}.badge.good{background:var(--green-bg);color:#43816f}.badge.error{background:var(--red-bg);color:#b75a51}.badge.disagreement{background:var(--purple-bg);color:#8066a6}.badge.neutral{background:#f0f2f4;color:#7e8a94}.badge.warn{background:var(--amber-bg);color:#a86f27}.empty-cell,.empty-inline{color:#95a0a8;text-align:center;padding:25px;font-size:10px}.signal-card{padding:17px 18px 14px}.signal-tools{width:215px}.signal-tools .field-label{margin:0 0 6px}.signal-provenance{margin:13px 0 8px;background:#f5f8f9;border-radius:6px;padding:9px 10px;color:#77858f;font-size:9px;line-height:1.5}.signal-grid,.psd-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.signal-plot-panel,.psd-grid>div{min-width:0}.plot-title{color:#71808a;font:9px 'DM Mono',monospace;letter-spacing:.65px;margin:12px 0 5px}.plot-title span{font-size:8px;color:#a0aab1;letter-spacing:0;margin-left:4px;text-transform:none}.signal-plot-panel canvas,.psd-grid canvas{display:block;width:100%;height:auto;background:#fff}.axis-caption{font:8px 'DM Mono',monospace;color:#9ca6ad;text-align:center;margin:2px 0}.signal-empty{border:1px dashed #dfe5e8;border-radius:7px;padding:22px;text-align:center;color:#99a4ac;font-size:10px;margin-top:9px}.psd-section{border-top:1px solid #edf0f2;margin-top:16px;padding-top:13px}.psd-heading{display:flex;justify-content:space-between;align-items:end}.psd-heading h3{font:700 12px Manrope,sans-serif;margin:4px 0 0}.band-note{display:flex;align-items:center;gap:6px;color:#8d969d;font-size:9px}.band-note i{width:9px;height:9px;background:#eaf4f1;border:1px solid #c8e3da;border-radius:2px}.data-limitation{margin:13px 0 9px;padding:10px 12px;background:#f6f8f9;border-left:2px solid #b6c6ce;color:#788690;font-size:10px;line-height:1.55}.data-limitation b{color:#54636e;font-weight:600}.seed-overview{padding:16px 18px}.seed-overview .table-scroll{margin:12px -18px -3px;width:calc(100% + 36px)}.seed-overview th,.seed-overview td{text-align:right}.seed-overview th:first-child,.seed-overview td:first-child,.seed-overview th:nth-child(2),.seed-overview td:nth-child(2){text-align:left}.seed-event-scroll{max-height:410px;margin-top:8px}.test-summary{padding:17px 18px}.test-content{display:grid;grid-template-columns:1fr 1.1fr;gap:22px;margin-top:14px}.test-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.test-metric{border:1px solid #edf0f2;border-radius:7px;padding:11px}.test-metric span{display:block;font:8px 'DM Mono',monospace;color:#8b979f;letter-spacing:.5px}.test-metric b{display:block;font:600 16px Manrope,sans-serif;color:#3b5260;margin-top:5px}.confusion-title{font:9px 'DM Mono',monospace;color:#7b8992;margin-bottom:7px}.confusion-table{max-width:360px}.confusion-table td,.confusion-table th{text-align:center}.confusion-table td{font:600 13px 'DM Mono',monospace}.page-footer{display:flex;justify-content:space-between;color:#a2abb2;font-size:9px;padding:5px 2px 14px}.state-card{max-width:480px;margin:12vh auto;background:#fff;border:1px solid var(--line);border-radius:10px;padding:34px;text-align:center;box-shadow:var(--shadow)}.state-card h1{font:700 19px Manrope,sans-serif;margin:14px 0 7px}.state-card p{color:#7f8b94;font-size:11px;line-height:1.6}.loader{width:23px;height:23px;margin:auto;border:2px solid #e3eeec;border-top-color:#27867e;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.error-icon{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#fff0ed;color:#bd5d54;margin:auto;font-weight:700}.button{border:0;border-radius:6px;padding:8px 13px;font-size:10px;font-weight:700}.button.secondary{background:#eaf3f1;color:#287670}.about-dialog{border:1px solid var(--line);border-radius:12px;padding:24px 26px;max-width:480px;box-shadow:0 20px 70px #20354830}.about-dialog::backdrop{background:#15263270}.about-dialog h2{font:700 19px Manrope,sans-serif;line-height:1.3}.about-dialog p{font-size:11px;color:#73818b;line-height:1.7}.dialog-close{float:right;border:0;background:none;font-size:21px;color:#84919b}

@media(max-width:1050px){.layout{grid-template-columns:205px minmax(0,1fr)}.main-content{padding:26px 21px}.patient-card{grid-template-columns:1fr}.patient-meta{border-left:0;border-top:1px solid #edf0f2;padding:13px 0 0}.kpi-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.topbar{height:56px;padding:0 15px}.layout{display:block}.sidebar{border-right:0;border-bottom:1px solid var(--line);padding:14px 14px 10px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.sidebar-section{padding:0}.sidebar-section:first-child{grid-column:1/-1}.sidebar-section:nth-child(2){grid-column:1/-1}.sidebar-bottom{display:none}.context-controls{grid-column:1/-1}.nav-stack{display:grid;grid-template-columns:1fr 1fr}.nav-item{padding:8px 7px}.nav-count{display:none}.field-label{margin-top:8px}.field-label.spaced{margin-top:8px}.segmented{margin-top:8px}.main-content{padding:22px 13px}.page-heading{align-items:flex-start;flex-direction:column;gap:12px;margin-bottom:15px}.page-heading h1{font-size:22px}.threshold-chip{align-self:flex-start}.kpi-grid{gap:8px}.kpi-card{padding:11px;min-height:78px}.kpi-value{font-size:20px}.patient-card{padding:14px}.patient-meta{grid-template-columns:repeat(2,1fr)}.chart-card,.signal-card,.seed-overview,.test-summary{padding:14px}.legend{gap:7px;flex-wrap:wrap;justify-content:flex-end}.legend span{font-size:8px}.table-heading{padding:14px}.search-wrap{width:135px}.signal-grid,.psd-grid{grid-template-columns:1fr;gap:6px}.signal-tools{width:150px}.test-content{grid-template-columns:1fr}.test-metrics{grid-template-columns:repeat(2,1fr)}.page-footer{gap:12px;flex-direction:column}.threshold-chip .chip-label{font-size:8px}}

.patient-stats{grid-column:1/-1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;border-top:1px solid #edf0f2;padding-top:12px}.patient-stat{background:#f7f9fa;border-radius:6px;padding:8px 10px}.patient-stat span{display:block;color:#92a0a8;font:8px monospace;letter-spacing:.45px;text-transform:uppercase}.patient-stat b{display:block;color:#3f5360;font:600 12px Inter,"Segoe UI",Arial,sans-serif;margin-top:4px}.patient-stat small{display:block;color:#9aa4ac;font-size:8px;margin-top:2px}@media(max-width:720px){.patient-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Color theme follows the selected setting or the operating system. */
.band-power-table{width:100%;margin-top:3px;border-collapse:collapse;white-space:nowrap}.band-power-table th,.band-power-table td{padding:4px 3px;border-bottom:1px solid var(--line);font:8px 'DM Mono',monospace;color:var(--muted);text-align:right}.band-power-table th:first-child,.band-power-table td:first-child{text-align:left}.band-power-table thead th{font-weight:500}
.brand-icon{display:block;width:32px;height:32px;object-fit:contain;flex:none}
.topbar{justify-content:flex-start;gap:clamp(12px,2vw,30px)}.brand{gap:9px;min-width:0;white-space:nowrap}.brand-title{font-size:14px;line-height:1.15}.team-attribution{display:flex;align-items:center;gap:7px;min-width:0;padding-left:16px;border-left:1px solid var(--line)}.team-attribution img{width:30px;height:30px;object-fit:contain;flex:none}.team-name{display:-webkit-box;max-width:116px;overflow:hidden;color:var(--muted);font:600 10px/1.2 Manrope,sans-serif;-webkit-box-orient:vertical;-webkit-line-clamp:2}.topbar-right{margin-left:auto;gap:14px}
@media(max-width:720px){.topbar{height:auto;min-height:56px;padding:7px 12px;gap:10px;flex-wrap:wrap}.brand{gap:6px;font-size:12px}.brand-icon{width:28px;height:28px}.brand-title{font-size:12px;white-space:normal;max-width:155px}.team-attribution{gap:5px;padding-left:8px}.team-attribution img{width:26px;height:26px}.team-name{max-width:90px;font-size:9px}.topbar-right{gap:9px}.local-indicator{display:none}.theme-control select{width:88px}}
.brand{white-space:normal}.brand-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.brand-kicker{color:var(--muted);font:600 9px/1.15 'DM Mono',monospace;white-space:nowrap;letter-spacing:.15px}.brand-title{color:#1d2d3b;font:700 14px/1.15 Manrope,sans-serif;white-space:nowrap;letter-spacing:-.25px}
:root[data-theme="dark"]{--button-hover-bg:#2a3d49;--button-hover-ink:#e3eef1}
button:not(:disabled){transition:background-color .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease}
button:not(:disabled):hover{background-color:var(--button-hover-bg);color:var(--button-hover-ink)}
button:not(:disabled):focus-visible{outline:2px solid var(--teal);outline-offset:2px}
:root[data-theme="dark"] button:not(:disabled):focus-visible{outline-color:#75c5b9}
:root[data-theme="dark"] .button:not(:disabled):hover,:root[data-theme="dark"] #cohort-reset:hover{background-color:#2a3d49;color:#e3eef1}
:root[data-theme="dark"] #cohort-reset:focus-visible{outline-color:#75c5b9}
.team-logo-link{display:inline-flex;align-items:center;justify-content:center;flex:none;border-radius:5px}.team-logo-link:focus-visible{outline:2px solid var(--teal);outline-offset:3px}
:root[data-theme="dark"] .brand-title{color:#e4edf2}
@media(max-width:720px){.brand-copy{max-width:190px}.brand-kicker{font-size:8px}.brand-title{font-size:11px}}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5edf3;
  --muted: #a8b6c0;
  --line: #33424f;
  --paper: #111922;
  --white: #1b2732;
  --navy: #e3edf3;
  --teal-soft: #193b3a;
  --green-bg: #1b3931;
  --red-bg: #412b2b;
  --amber-bg: #3d3325;
  --purple-bg: #342c42;
  --shadow: 0 9px 28px rgba(0,0,0,.18);
}
:root[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .kpi-card,
:root[data-theme="dark"] .state-card,
:root[data-theme="dark"] .about-dialog { background: var(--white); color: var(--ink); }
:root[data-theme="dark"] .sidebar { background: #151f29; }
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .page-heading h1,
:root[data-theme="dark"] .section-heading h2,
:root[data-theme="dark"] .patient-main h2,
:root[data-theme="dark"] .kpi-value,
:root[data-theme="dark"] .patient-avatar,
:root[data-theme="dark"] .test-metric b,
:root[data-theme="dark"] .probability-cell,
:root[data-theme="dark"] .event-id,
:root[data-theme="dark"] .psd-heading h3 { color: #e4edf2; }
:root[data-theme="dark"] .brand-light,
:root[data-theme="dark"] .page-heading p,
:root[data-theme="dark"] .patient-main p,
:root[data-theme="dark"] .dataset-status small,
:root[data-theme="dark"] .about-dialog p,
:root[data-theme="dark"] .state-card p,
:root[data-theme="dark"] .meta-item span,
:root[data-theme="dark"] .patient-stat span,
:root[data-theme="dark"] .meta-item b,
:root[data-theme="dark"] .patient-stat b { color: #b3c0c9; }
:root[data-theme="dark"] select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .threshold-chip,
:root[data-theme="dark"] .test-metric { background-color: #17232d; color: #e0e9ef; border-color: #3a4a57; }
:root[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23b4c1ca' stroke-width='1.3'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .local-indicator,
:root[data-theme="dark"] .dataset-status,
:root[data-theme="dark"] .patient-stat { background: #1b2b33; border-color: #344c50; color: #a7c5ba; }
:root[data-theme="dark"] .patient-avatar,
:root[data-theme="dark"] .signal-provenance,
:root[data-theme="dark"] .data-limitation,
:root[data-theme="dark"] .signal-empty,
:root[data-theme="dark"] .empty-cell,
:root[data-theme="dark"] .empty-inline { background: #202d38; color: #b0bdc6; }
:root[data-theme="dark"] .patient-meta,
:root[data-theme="dark"] .patient-stats,
:root[data-theme="dark"] .psd-section { border-color: #33424f; }
:root[data-theme="dark"] thead { background: #202c37; }
:root[data-theme="dark"] th { color: #afbdc6; border-color: #33424f; }
:root[data-theme="dark"] td { color: #d1dbe2; border-color: #2e3d49; }
:root[data-theme="dark"] tbody tr:hover { background: #22352f; }
:root[data-theme="dark"] tbody tr.selected-row { background: #203b3a; }
:root[data-theme="dark"] .badge.neutral { background: #2a3742; color: #c2cdd4; }
:root[data-theme="dark"] .badge.good { color: #8fd0b7; }
:root[data-theme="dark"] .badge.error { color: #f0a39a; }
:root[data-theme="dark"] .badge.disagreement { color: #c1a9e4; }
:root[data-theme="dark"] .badge.warn { color: #e5bd7e; }
:root[data-theme="dark"] .nav-item { color: #b3c0c9; }
:root[data-theme="dark"] .nav-item.active { background: #203b3a; color: #90d3c8; }
:root[data-theme="dark"] .threshold-chip .chip-label,
:root[data-theme="dark"] .threshold-chip b,
:root[data-theme="dark"] .confusion-title,
:root[data-theme="dark"] .data-limitation b { color: #c1cdd5; }
:root[data-theme="dark"] .test-metric { border-color: #33424f; }
:root[data-theme="dark"] .data-limitation { border-left-color: #617884; }
:root[data-theme="dark"] .chart-grid { stroke: #33424f; }
:root[data-theme="dark"] .chart-axis { fill: #b0bdc6; }
:root[data-theme="dark"] .chart-threshold-label { fill: #e0ad7c; }
:root[data-theme="dark"] .event-point { stroke: #1b2732; }
:root[data-theme="dark"] .event-point:hover,
:root[data-theme="dark"] .event-point.selected { stroke: #e5edf3; }
:root[data-theme="dark"] .dot-disagreement { background: #1b2732; }
:root[data-theme="dark"] .signal-plot-panel canvas,
:root[data-theme="dark"] .psd-grid canvas { background: #1b2732; }
:root[data-theme="dark"] .chart-footnote,
:root[data-theme="dark"] .page-footer,
:root[data-theme="dark"] .axis-caption,
:root[data-theme="dark"] .plot-title span { color: #9eacb6; }
:root[data-theme="dark"] .about-dialog::backdrop { background: #05090dc9; }

.theme-control { display:flex; align-items:center; gap:8px; color:#778590; font-size:11px; }
.theme-control select { width:112px; padding:6px 25px 6px 9px; font-size:11px; }
:root[data-theme="dark"] .theme-control { color:#b2bec7; }

/* Use larger native type and controls on desktop; let the grid reflow naturally. */
@media (min-width: 1400px) {
  body { font-size: 15px; }
  .main-content { max-width: 2100px; padding-top: 40px; }
  .layout { grid-template-columns: 270px minmax(0, 1fr); }
  .topbar { height: 72px; }
  .brand { font-size: 18px; }
  .side-label, .eyebrow { font-size: 11px; }
  .field-label { font-size: 14px; }
  select, .search-wrap input { font-size: 14px; padding-top: 11px; padding-bottom: 11px; }
  .nav-item { font-size: 14px; padding: 12px 11px; }
  .segment { font-size: 13px; padding: 9px; }
  .local-indicator { font-size: 11px; }
  .theme-control { font-size: 13px; }
  .theme-control select { width: 125px; font-size: 13px; }
  .page-heading h1 { font-size: 34px; }
  .page-heading p { font-size: 15px; }
  .threshold-chip .chip-label { font-size: 11px; }
  .threshold-chip b { font-size: 16px; }
  .threshold-chip.compact { font-size: 12px; }
  .kpi-card { padding: 19px 21px; min-height: 108px; }
  .kpi-label { font-size: 11px; }
  .kpi-value { font-size: 30px; }
  .kpi-sub { font-size: 12px; }
  .patient-card { padding: 22px 24px; }
  .patient-avatar { width: 52px; height: 52px; font-size: 16px; }
  .patient-main h2 { font-size: 20px; }
  .patient-main p, .meta-item b { font-size: 13px; }
  .meta-item span { font-size: 10px; }
  .patient-stat span { font-size: 10px; }
  .patient-stat b { font-size: 15px; }
  .patient-stat small { font-size: 11px; }
  .section-heading h2 { font-size: 18px; }
  .legend { font-size: 12px; }
  .chart-axis { font-size: 11px; }
  .chart-threshold-label { font-size: 10px; }
  .chart-footnote, .signal-provenance, .data-limitation { font-size: 13px; }
  th { font-size: 12px; padding: 12px 15px; }
  td { font-size: 13px; padding: 13px 15px; }
  .probability-cell { font-size: 13px; }
  .badge { font-size: 11px; padding: 5px 8px; }
  .plot-title { font-size: 11px; }
  .axis-caption { font-size: 10px; }
  .band-note { font-size: 11px; }
  .test-metric span, .confusion-title { font-size: 11px; }
  .test-metric b { font-size: 20px; }
  .page-footer { font-size: 11px; }
}

.stratified-card{padding:17px 18px 13px}.stratified-heading{margin-bottom:13px}.stratified-heading h2{font:700 14px Manrope,sans-serif;margin:4px 0 0}.stratified-threshold{font:9px 'DM Mono',monospace;color:var(--muted)}.stratified-grid{display:grid;grid-template-columns:1fr;gap:16px}.stratified-grid h3{font:600 11px Manrope,sans-serif;color:var(--muted);margin:7px 0}.stratified-grid table{min-width:900px}.stratified-grid tbody tr{cursor:default}.stratified-grid td:first-child{font-weight:600;color:var(--ink)}.stratified-note{font-size:9px;color:var(--muted);line-height:1.55;margin:12px 0 0}
#diagnosis-performance-summary .table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}.diagnosis-performance-table{min-width:1280px}
:root[data-theme="dark"] .stratified-grid td:first-child{color:var(--ink)}
@media(max-width:720px){.stratified-card{padding:14px}.stratified-heading{align-items:flex-start;flex-direction:column}}

.global-tabs{display:flex;gap:5px;border-bottom:1px solid var(--line);margin:0 0 14px}.global-tab{border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);padding:10px 14px 9px;font:600 11px Manrope,sans-serif;cursor:pointer}.global-tab.active{color:var(--ink);border-bottom-color:#27867e}.global-tab span{font:9px 'DM Mono',monospace;color:var(--muted);margin-left:4px}.cohort-intro,.cohort-table-card{padding:16px 18px}.cohort-intro p{font-size:10px;line-height:1.55;color:var(--muted);margin:11px 0 0}.cohort-controls{display:grid;grid-template-columns:1.4fr 1fr 1.1fr .8fr;gap:12px;padding:15px 18px}.cohort-controls label{min-width:0}.cohort-controls label>span{display:block;font:9px 'DM Mono',monospace;letter-spacing:.35px;color:var(--muted);margin-bottom:6px}.cohort-controls select,.cohort-controls input{width:100%;min-width:0}.cohort-table{min-width:1000px}.cohort-table tbody .cohort-patient-row{cursor:pointer}.cohort-table tbody .cohort-patient-row:hover,.cohort-table tbody .cohort-patient-row:focus-visible{background:var(--teal-soft);outline:2px solid #27867e;outline-offset:-2px}.cohort-table td:first-child{font-family:'DM Mono',monospace;color:var(--muted)}#cohort-reset{transition:background-color .15s,color .15s,transform .15s}#cohort-reset:hover{background:#d8ebe6;color:#155f5b;transform:translateY(-1px)}#cohort-reset:focus-visible{outline:2px solid #27867e;outline-offset:2px}.cohort-table-card .chart-footnote{padding:0 18px 2px;line-height:1.5}.cohort-table-card .table-scroll{margin:0 -18px;width:calc(100% + 36px)}
.cohort-table th,.cohort-table td{font-size:12px}.cohort-table th:nth-child(2),.cohort-table th:nth-child(3),.cohort-table th:nth-child(4),.cohort-table th:nth-child(5),.cohort-table th:nth-child(6),.cohort-table td:nth-child(2),.cohort-table td:nth-child(3),.cohort-table td:nth-child(4),.cohort-table td:nth-child(5),.cohort-table td:nth-child(6){text-align:center}.cohort-sort-button{width:100%;border:0;background:transparent;padding:0;color:inherit;font:inherit;letter-spacing:inherit;text-align:inherit}.cohort-sort-button:hover,.cohort-sort-button:focus-visible{color:var(--teal);outline:0;text-decoration:underline;text-underline-offset:3px}.cohort-sort-button span{color:var(--teal);font-size:13px}.cohort-patient-link{border:0;background:transparent;padding:0;color:inherit;font:inherit;font-family:'DM Mono',monospace;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:2px}.cohort-patient-link:hover,.cohort-patient-link:focus-visible{text-decoration-color:currentColor;outline:0}.cohort-fraction{font:600 12px 'DM Mono',monospace;color:var(--ink)}
:root[data-theme="dark"] .global-tab.active{color:var(--ink)}
@media(max-width:900px){.cohort-controls{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.cohort-controls{grid-template-columns:1fr}.cohort-intro,.cohort-table-card{padding:14px}.cohort-table-card .table-scroll{margin:0 -14px;width:calc(100% + 28px)}}
.cohort-table th,.cohort-table td,.cohort-table td:first-child{font-family:inherit;font-size:12px;font-weight:400}.cohort-table .cohort-patient-link{font-family:inherit}.cohort-table .cohort-fraction{font:inherit;color:var(--ink)}.cohort-table .cohort-sort-button span{font-size:12px}
#cohort-panel .cohort-table th,#cohort-panel .cohort-table td,#cohort-panel .cohort-table th *,#cohort-panel .cohort-table td *{font-family:inherit!important;font-size:12px!important;font-weight:400!important}
#cohort-panel .cohort-table th:nth-child(4),#cohort-panel .cohort-table td:nth-child(4){width:1%;white-space:nowrap}
#cohort-panel .cohort-controls label>span{font-size:12px}
#cohort-panel .cohort-table-card .table-scroll{max-height:65vh;overflow:auto;overscroll-behavior:contain}
#cohort-panel .cohort-table thead th{position:sticky;top:0;z-index:3;background:var(--white)}
.action-boxplot-card{padding:17px 18px 13px}.action-boxplot-legend{display:flex;flex-wrap:wrap;gap:10px 18px;margin:13px 0 4px;color:var(--muted);font-size:10px}.action-boxplot-legend span{display:flex;align-items:center;gap:6px}.boxplot-swatch{width:10px;height:10px;border:1px solid currentColor;border-radius:2px}.consensus-negative{color:#318c7d;background:#318c7d33}.consensus-positive{color:#cc8752;background:#cc875233}.disagreement-group{color:#8870b2;background:#8870b233}.other-consensus{color:#85939e;background:#85939e33}.action-boxplot-scroll{width:100%;overflow:auto;margin-top:5px}.action-boxplot-svg{display:block;width:100%;min-width:900px;height:auto}.boxplot-grid{stroke:var(--line);stroke-width:1}.boxplot-axis,.boxplot-count{fill:var(--muted);font:10px 'DM Mono',monospace}.boxplot-action{fill:var(--ink);font:11px 'DM Sans',Arial,sans-serif}.boxplot-threshold{stroke:#c78128;stroke-width:1.4;stroke-dasharray:6 4}.boxplot-threshold-label{fill:#a66c23;font:10px 'DM Mono',monospace}.action-boxplot-card .stratified-note{margin-top:9px}
.boxplot-outlier{cursor:pointer;stroke:transparent;stroke-width:3}.boxplot-outlier:hover,.boxplot-outlier:focus-visible{stroke:var(--ink);outline:0}
/* In-memory dataset/run upload screen. */
#loading-state{max-width:790px;margin:7vh auto;padding:30px;text-align:left}
#loading-state>h1,#loading-state>.eyebrow,#loading-state>p{text-align:center}
.upload-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:24px 0 12px}
.upload-block{position:relative;display:flex;min-height:180px;flex-direction:column;align-items:flex-start;justify-content:center;gap:9px;padding:20px;border:1px dashed #bdcbd1;border-radius:9px;background:#fbfcfd;cursor:pointer;transition:border-color .15s,background .15s}
.upload-block:hover,.upload-block:focus-within{border-color:var(--teal);background:var(--teal-soft)}
.upload-block strong{font:700 16px Manrope,sans-serif;color:#334957}
.upload-kicker{font:500 9px 'DM Mono',monospace;letter-spacing:.8px;color:#71838e}
.upload-description{font-size:11px;color:#75838c}
.upload-file-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:var(--teal)}
.upload-block input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.upload-status{min-height:18px;margin:10px 0;color:#687984!important;text-align:center}
.upload-submit{display:block;margin:0 auto;padding:10px 18px;font-size:11px}
.upload-submit:disabled{opacity:.45;cursor:not-allowed}
#change-data-button{font-size:10px}
@media(max-width:620px){#loading-state{margin:20px auto;padding:22px 16px}.upload-grid{grid-template-columns:1fr;gap:10px}.upload-block{min-height:145px;padding:16px}}
:root[data-theme="dark"] .upload-block{background:#17232d;border-color:#3a4a57}
:root[data-theme="dark"] .upload-block:hover,:root[data-theme="dark"] .upload-block:focus-within{background:#203b3a;border-color:#4a827a}
:root[data-theme="dark"] .upload-block strong{color:#e4edf2}
:root[data-theme="dark"] .upload-kicker,:root[data-theme="dark"] .upload-description,:root[data-theme="dark"] .upload-status{color:#b3c0c9!important}
:root[data-theme="dark"] .upload-file-name{color:#90d3c8}
:root[data-theme="dark"] .segment.active{background:#263b45;color:#d8ebe8;box-shadow:0 1px 4px #0005}
:root[data-theme="dark"] .button.secondary{background:#263b45;color:#a8ddd4}
.seed-workspace-tabs{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 14px;border-bottom:1px solid var(--line)}
.seed-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-width:0}
.seed-tab{border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);padding:10px 14px 9px;font:600 11px Manrope,sans-serif}
.seed-tab.active{color:var(--ink);border-bottom-color:#27867e}
.seed-split-tabs{flex:none;grid-template-columns:1fr 1fr;width:190px;margin:0 0 5px}
:root[data-theme="dark"] .seed-workspace-tabs{border-color:var(--line)}
:root[data-theme="dark"] .seed-tab.active{color:var(--ink)}
@media(max-width:620px){.seed-workspace-tabs{align-items:flex-start;flex-direction:column;gap:4px;padding-bottom:8px}.seed-tabs{width:100%}.seed-tab{padding:9px 10px}.seed-split-tabs{align-self:flex-end;margin-bottom:0}}
.signal-filter-controls{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin:10px 0 12px;padding:10px;background:var(--panel-soft,#f5f8f9);border-radius:6px}
.signal-filter-controls>label{display:grid;gap:4px;color:var(--muted);font-size:9px;min-width:128px}
.signal-filter-controls select,.signal-filter-controls input[type="number"]{min-height:31px;padding:6px 8px;font:inherit;font-size:10px}
.signal-filter-controls>label:first-child{min-width:245px}
.signal-filter-controls .filter-overlay-control{display:flex;align-items:center;gap:6px;min-width:190px;padding-bottom:7px}
.filter-overlay-control input{accent-color:var(--teal)}
.filter-status{margin-left:auto;padding-bottom:8px;color:var(--muted);font:9px 'DM Mono',monospace}
:root[data-theme="dark"] .signal-filter-controls{background:#17232d}
@media(max-width:620px){.signal-filter-controls{align-items:stretch}.signal-filter-controls>label:first-child{min-width:100%;}.signal-filter-controls>label{flex:1}.filter-status{width:100%;margin-left:0}}
.seed-oof-view-tabs{margin-top:13px}
.seed-summary-heading{margin:16px 0 8px;color:var(--ink);font:600 12px Manrope,sans-serif}
.seed-patient-cohort,.seed-patient-detail{padding:16px 18px}
.seed-patient-cohort .table-scroll,.seed-patient-detail .table-scroll{margin:10px -18px 0;width:calc(100% + 36px)}
.seed-patient-cohort .cohort-patient-row,.seed-patient-detail tbody tr{cursor:pointer}
.seed-patient-cohort table th,.seed-patient-cohort table td,.seed-patient-detail table th,.seed-patient-detail table td{font-family:inherit!important;font-size:13px!important}
.seed-patient-cohort table th:nth-child(n+2):nth-child(-n+6),.seed-patient-cohort table td:nth-child(n+2):nth-child(-n+6){text-align:center}
.seed-holdout-sort-button{width:100%;border:0;background:transparent;padding:0;color:inherit;font:inherit;letter-spacing:inherit;text-align:inherit}
.seed-holdout-sort-button:hover,.seed-holdout-sort-button:focus-visible{color:var(--teal);outline:0;text-decoration:underline;text-underline-offset:3px}
.seed-holdout-sort-button span{color:var(--teal);font-size:inherit}
#test-patient-panel .section-heading{gap:14px}
#holdout-patient-inspection{margin-top:12px}
@media(max-width:720px){.seed-patient-cohort,.seed-patient-detail{padding:14px}.seed-patient-cohort .table-scroll,.seed-patient-detail .table-scroll{margin:10px -14px 0;width:calc(100% + 28px)}}

@media(orientation:portrait){.signal-grid,.psd-grid{grid-template-columns:minmax(0,1fr)}}

/* Keep the wide stratified LOSO tables inside the viewport and scroll them locally. */
#overview-panel,.stratified-card,.stratified-grid,.stratified-grid>div{min-width:0;max-width:100%}
.stratified-grid .table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
