.review-main{max-width:1540px;margin:0 auto;padding:28px 24px 64px}.review-top{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:18px}.review-top h1{margin:.15rem 0 .4rem}.review-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.button-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}.review-transport{display:grid;grid-template-columns:auto auto 1fr auto;align-items:center;gap:14px;margin:18px 0}.review-transport input[type=range]{width:100%}.review-grid{display:grid;grid-template-columns:minmax(420px,.95fr) minmax(520px,1.25fr);gap:18px}.review-video-stage{position:relative;background:#061c26;border-radius:14px;overflow:hidden;aspect-ratio:16/9}.review-video-stage video{width:100%;height:100%;object-fit:contain;display:block}.review-video-stage canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.review-signal-panel canvas,.review-landmark-panel canvas{width:100%;height:340px;display:block}.review-landmark-panel{margin-top:18px}.review-landmark-panel canvas{height:290px}.ai-progress-wrap{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;margin:6px 0 12px}.ai-progress-wrap progress{width:100%;height:12px}.feature-legend{display:flex;gap:18px;flex-wrap:wrap;font-size:.82rem;color:#657c74}.review-editor{margin-top:18px}.manual-editor{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:14px 0}.manual-editor label{min-width:150px}.manual-editor input,.manual-editor select{width:100%}.label-table-wrap{overflow:auto;max-height:440px;border:1px solid #d9e4df;border-radius:12px}.label-table{width:100%;border-collapse:collapse;font-size:.86rem}.label-table th,.label-table td{padding:8px 10px;border-bottom:1px solid #e5ece8;text-align:left;white-space:nowrap}.label-table thead{position:sticky;top:0;background:#f8fbf9;z-index:1}.label-table select{min-width:140px}.label-row-active{background:#edf8f4}.label-source-auto{color:#6b7e77}.label-source-manual{color:#13796a;font-weight:600}.review-video-panel .badge{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#reviewNotice{margin-bottom:12px}.review-actions button,.review-actions .button-link{min-height:42px}.review-editor .row{align-items:center}@media(max-width:980px){.review-grid{grid-template-columns:1fr}.review-top{flex-direction:column}.review-actions{justify-content:flex-start}.review-transport{grid-template-columns:auto 1fr auto}.review-transport #reviewSlider{grid-column:1/-1;grid-row:2}.review-signal-panel canvas{height:300px}}
.review-badges{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.review-model-panel{margin-top:18px}
.review-model-panel .check-line{display:flex;gap:8px;align-items:flex-start;margin:12px 0;font-size:.88rem;color:#526c64}
.review-model-panel .check-line input{margin-top:3px}
.compact-warning{margin-top:14px;padding:10px 12px;font-size:.82rem}


/* v0.6.1 session validity */
.qc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;margin:12px 0}
.qc-card{border:1px solid var(--line,#d8e3df);border-radius:12px;padding:12px;background:#fff}
.qc-card strong{display:block;margin-bottom:6px}.qc-card .small{margin:3px 0}
.qc-card.fail{border-color:#d99b92;background:#fff8f6}.qc-card.warning{border-color:#d9bd78;background:#fffaf0}.qc-card.pass{border-color:#9dcdbb;background:#f7fcfa}
.qc-face-row{align-items:center;border-top:1px solid var(--line,#d8e3df);padding-top:12px;margin-top:8px}

/* v0.6.3 review ergonomics */
.review-video-transport{margin:12px 0 0;padding:10px 12px;box-shadow:none;background:#f7faf8;border:1px solid var(--line,#d8e3df)}
.review-filter-controls{display:flex;gap:8px;align-items:flex-end;justify-content:flex-end;flex-wrap:wrap}
.review-filter-controls .inline{min-width:112px}
.review-filter-note{font-size:.82rem;color:#5e746c;margin:-2px 0 8px}
.review-landmark-panel canvas{height:220px}
.training-eligibility{border:1px solid #d8e3df;border-radius:12px;padding:10px 12px;margin:12px 0;background:#f7faf8;font-size:.88rem;color:#425a52}
.training-eligibility.ready{border-color:#9dcdbb;background:#f4fbf8}
.training-eligibility.blocked{border-color:#d99b92;background:#fff8f6;color:#74443d}
.training-eligibility ul{margin:6px 0 0 20px;padding:0}.training-eligibility li{margin:2px 0}
.model-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#trainInEarModel.blocked{outline:2px solid #d99b92;outline-offset:1px}
.classification-performance{margin-top:16px;border-top:1px solid #d8e3df;padding-top:14px}
.performance-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:8px}.performance-head h3{margin:.1rem 0}
.performance-table-wrap{overflow:auto;border:1px solid #d9e4df;border-radius:12px}
.performance-table{width:100%;border-collapse:collapse;font-size:.86rem}.performance-table th,.performance-table td{padding:8px 10px;border-bottom:1px solid #e5ece8;text-align:left;white-space:nowrap}.performance-table thead{background:#f8fbf9}.performance-table tbody tr:last-child td{border-bottom:0}
@media(max-width:980px){.review-video-transport{grid-template-columns:auto 1fr auto}.review-video-transport #reviewSlider{grid-column:1/-1;grid-row:2}.review-filter-controls{justify-content:flex-start}}


/* v0.6.4 — explicit local-AI state */
.ai-status-banner {
  margin: 0 0 16px;
  padding: 12px 15px;
  border: 1px solid #cbded6;
  border-left: 4px solid #2b8b72;
  border-radius: 8px;
  background: #eef7f2;
  color: #315d51;
  font-size: 13px;
}
.ai-status-banner.pending {
  border-left-color: #b9872b;
  background: #fff8e8;
  color: #765d21;
}
.ai-status-banner.error {
  border-left-color: #bf604b;
  background: #fff0e8;
  color: #93442f;
}
#shareSessionZip, #downloadSessionZip { font-weight: 750; }


/* v0.6.5 — row-normalized 10×10 confusion matrix */
.confusion-section{margin-top:18px;padding-top:16px;border-top:1px solid #dfe8e4}
.confusion-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:4px}
.confusion-head h3{margin:.15rem 0 .2rem}
.confusion-help{margin:.25rem 0 .75rem}
.confusion-matrix-wrap{overflow:auto;border:1px solid #d9e4df;border-radius:12px;background:#fff}
.confusion-matrix{border-collapse:separate;border-spacing:0;min-width:980px;width:100%;font-size:.76rem}
.confusion-matrix th,.confusion-matrix td{border-right:1px solid #e4ece8;border-bottom:1px solid #e4ece8;text-align:center;padding:7px 5px;min-width:78px}
.confusion-matrix thead th{position:sticky;top:0;z-index:2;background:#f6faf8;font-weight:700;white-space:normal;line-height:1.15}
.confusion-matrix tbody th{position:sticky;left:0;z-index:1;background:#f6faf8;text-align:left;min-width:105px;white-space:nowrap}
.confusion-matrix .confusion-corner{left:0;z-index:3;text-align:left;min-width:105px}
.confusion-matrix tr:last-child th,.confusion-matrix tr:last-child td{border-bottom:0}
.confusion-matrix th:last-child,.confusion-matrix td:last-child{border-right:0}
.confusion-cell{background:rgba(20,117,105,calc(.04 + var(--heat) * .58));transition:background .15s ease}
.confusion-cell.diagonal{box-shadow:inset 0 0 0 2px rgba(8,91,82,.42);font-weight:700}
.confusion-cell strong{display:block;font-size:.86rem;line-height:1.05}
.confusion-cell span{display:block;margin-top:3px;font-size:.66rem;opacity:.72}
@media(max-width:760px){.confusion-head{align-items:flex-start}.confusion-matrix{font-size:.7rem;min-width:900px}.confusion-matrix th,.confusion-matrix td{min-width:70px;padding:6px 4px}}

.collapsible-panel summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:16px}.collapsible-panel summary::-webkit-details-marker{display:none}.review-editor-summary{padding:0;margin:0}.review-editor-summary h2{margin:.15rem 0 0}.review-editor-summary .small{margin:.35rem 0 0;color:#657c74}.review-editor-content{margin-top:14px}.collapsible-panel[open] .review-editor-summary{margin-bottom:6px}.collapsible-panel .badge{white-space:nowrap}

.model-method{margin:10px 0 14px;padding:10px 12px;border:1px solid #dbe6e1;border-radius:10px;background:#f8fbf9}.model-method summary{cursor:pointer;font-weight:700;color:#23494b}.model-method p{margin:.55rem 0 .15rem}
#videoAiPerformance,#modelComparison{margin-top:18px}

.confusion-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}.confusion-compare-card{display:flex;flex-direction:column;gap:8px}.compare-card-head{display:flex;justify-content:space-between;align-items:end;gap:10px}.compare-card-head strong{font-size:1rem;color:#133c43}.compare-card-head .small{color:#657c74}.side-by-side-confusions .confusion-matrix-wrap{max-height:none}@media(max-width:1200px){.confusion-compare-grid{grid-template-columns:1fr}}

.confusion-head-simple{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:8px}
.confusion-head-simple .confusion-help{margin:0;color:#657c74}
.side-by-side-confusions .confusion-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
.side-by-side-confusions .confusion-compare-card{min-width:0}
.side-by-side-confusions .compact-compare{overflow:auto}
.side-by-side-confusions .compact-compare .confusion-matrix{font-size:.65rem;min-width:700px}
.side-by-side-confusions .compact-compare .confusion-matrix th,
.side-by-side-confusions .compact-compare .confusion-matrix td{min-width:54px;padding:5px 3px}
.side-by-side-confusions .compact-compare .confusion-matrix tbody th,
.side-by-side-confusions .compact-compare .confusion-matrix .confusion-corner{min-width:90px}
.side-by-side-confusions .compact-compare .confusion-cell strong{font-size:.78rem}
.side-by-side-confusions .compact-compare .confusion-cell span{font-size:.60rem;margin-top:2px}
@media(max-width:1400px){.side-by-side-confusions .compact-compare .confusion-matrix{font-size:.62rem;min-width:660px}.side-by-side-confusions .compact-compare .confusion-matrix th,.side-by-side-confusions .compact-compare .confusion-matrix td{min-width:50px;padding:4px 3px}}

.session-identity{font-size:1.05rem;font-weight:700;color:#173e41;margin:.65rem 0 .15rem}.review-top #reviewMeta{margin:.1rem 0 0;color:#657c74}

.model-source{margin:.7rem 0 .35rem;padding:9px 12px;border-radius:10px;background:#f0f7f4;color:#173f43;border:1px solid #d7e7e1}.model-source strong{font-weight:700}

.custom-detectability-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:14px 0}.detectability-card{border:1px solid #d9e4df;border-radius:12px;padding:14px;background:#fbfdfc}.detectability-card .row{align-items:center}.detectability-card p{margin:.6rem 0 0}.custom-discovery-panel .protocol-actions{margin-top:14px}@media(max-width:800px){.custom-detectability-grid{grid-template-columns:1fr}}

/* v0.6.21 — MediaPipe face overlay controls */
.review-overlay-controls{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin:0 0 10px;padding:8px 10px;border:1px solid #d9e4df;border-radius:10px;background:#f8fbf9}
.review-overlay-controls .compact-check{display:inline-flex;align-items:center;gap:6px;margin:0;min-width:auto;font-size:.84rem;color:#31565b}
.review-overlay-controls input{margin:0}

@media(max-width:720px){.review-video-stage.portrait-video{max-height:72vh;margin-left:auto;margin-right:auto}}

/* v0.6.38 review workflow hierarchy */
.workflow-task{margin:14px 0 18px}.workflow-task-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.workflow-task-head h2{margin:.15rem 0 .25rem}.workflow-task-head .hint{margin:.15rem 0 0}.workflow-task-state{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.task-progress-wrap{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;margin:14px 0}.task-progress-wrap progress{width:100%;height:13px;accent-color:#13846f}.task-progress-wrap span{min-width:42px;text-align:right;font-size:.82rem;color:#536f68;font-variant-numeric:tabular-nums}.workflow-task-footer{display:grid;grid-template-columns:1fr auto;align-items:center;gap:14px}.workflow-task-footer .ai-status-banner{margin:0}.workflow-task-footer button{white-space:nowrap}.custom-discovery-panel,.review-model-panel{margin:14px 0 18px}.review-actions{max-width:520px}.review-actions::before{content:"FILE ACTIONS";flex-basis:100%;font-size:.7rem;font-weight:750;letter-spacing:.1em;color:#6a817a;text-align:right}.review-landmark-panel{margin-top:18px}
@media(max-width:980px){.workflow-task-head,.workflow-task-footer{grid-template-columns:1fr;display:grid}.workflow-task-state{justify-content:flex-start}.workflow-task-footer button{width:100%}.review-actions::before{text-align:left}}

/* v0.6.41 — simplified EEG workflow controls */
.model-workflow-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:stretch;margin:12px 0 14px;padding:12px 14px;border:1px solid #cfe0d9;border-radius:12px;background:#f4faf7}
.model-workflow-left{display:flex;gap:10px;align-items:center;flex-wrap:wrap;min-width:0}
.model-workflow-next{display:flex;align-items:stretch;padding-left:18px;border-left:1px solid #d6e4de}
.model-workflow-next button{min-width:245px;white-space:nowrap}
.eeg-auto-status{margin:12px 0 0}
@media(max-width:980px){.model-workflow-row{grid-template-columns:1fr}.model-workflow-next{padding-left:0;padding-top:10px;border-left:0;border-top:1px solid #d6e4de}.model-workflow-next button{width:100%;min-width:0}.model-workflow-left button{flex:1 1 220px}}

/* v0.6.43 — simplify visible model-performance metrics */
.performance-primary{font-size:.98rem;font-weight:700;color:#173f43;margin-top:.65rem!important}.performance-details{margin-top:.55rem;border-top:1px solid #e3ece8;padding-top:.5rem}.performance-details summary{cursor:pointer;color:#55716a;font-size:.82rem;font-weight:650;list-style:none}.performance-details summary::-webkit-details-marker{display:none}.performance-details summary::before{content:"▸ ";color:#13846f}.performance-details[open] summary::before{content:"▾ "}.performance-details p{margin:.45rem 0 0!important;color:#657c74}.model-source + #customClassificationMetrics{margin:.5rem 0 .25rem;font-weight:700;color:#173f43}


/* v0.6.58 — fit both Model confusion matrices fully in their cards */
.side-by-side-confusions .compact-compare{overflow:hidden}
.side-by-side-confusions .compact-compare .confusion-matrix{
  width:100%;
  min-width:0;
  table-layout:fixed;
  font-size:.58rem;
}
.side-by-side-confusions .compact-compare .confusion-matrix th,
.side-by-side-confusions .compact-compare .confusion-matrix td{
  min-width:0;
  padding:4px 1px;
  overflow-wrap:anywhere;
}
.side-by-side-confusions .compact-compare .confusion-matrix thead th{
  white-space:normal;
  line-height:1.08;
}
.side-by-side-confusions .compact-compare .confusion-matrix tbody th,
.side-by-side-confusions .compact-compare .confusion-matrix .confusion-corner{
  width:82px;
  min-width:0;
  white-space:normal;
  line-height:1.08;
  overflow-wrap:normal;
  word-break:normal;
}
.side-by-side-confusions .compact-compare .confusion-cell strong{font-size:.72rem}
.side-by-side-confusions .compact-compare .confusion-cell span{font-size:.56rem;margin-top:2px}
@media(max-width:1400px){
  .side-by-side-confusions .compact-compare .confusion-matrix{font-size:.55rem;min-width:0}
  .side-by-side-confusions .compact-compare .confusion-matrix th,
  .side-by-side-confusions .compact-compare .confusion-matrix td{min-width:0;padding:3px 1px}
  .side-by-side-confusions .compact-compare .confusion-matrix tbody th,
  .side-by-side-confusions .compact-compare .confusion-matrix .confusion-corner{width:76px;min-width:0}
}
@media(max-width:1200px){
  .side-by-side-confusions .confusion-compare-grid{grid-template-columns:1fr}
  .side-by-side-confusions .compact-compare .confusion-matrix{font-size:.65rem}
  .side-by-side-confusions .compact-compare .confusion-matrix tbody th,
  .side-by-side-confusions .compact-compare .confusion-matrix .confusion-corner{width:96px}
}


/* v0.6.58 — compact Review spectrogram */
.review-signal-panel #reviewSpectrogram{width:100%;height:92px;display:block;margin-top:0}
.review-spectrogram-note{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:4px 0 2px;font-size:.76rem;color:#5e746c}
.review-spectrogram-note strong{color:#244f46}
@media(max-width:980px){.review-signal-panel #reviewSpectrogram{height:86px}.review-spectrogram-note{justify-content:flex-start}}


/* v0.6.58 — fixed, manually adjustable spectrogram color scale */
.review-spectrogram-meta{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.review-spectrogram-scale{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.review-spectrogram-scale .scale-label{font-weight:650;color:#385c54}
.review-spectrogram-scale label{display:inline-flex;align-items:center;gap:4px;margin:0;white-space:nowrap;color:#526c64}
.review-spectrogram-scale input{width:58px;height:28px;padding:2px 5px;border:1px solid #cddbd5;border-radius:6px;background:#fff;color:#173f43;font:inherit;font-variant-numeric:tabular-nums}
.review-spectrogram-scale input:focus{outline:2px solid rgba(19,132,111,.18);border-color:#13846f}
.review-spectrogram-scale input.scale-invalid{border-color:#bf604b;background:#fff8f6}
.compact-scale-reset{min-height:28px;padding:3px 7px;font-size:.74rem}
@media(max-width:980px){.review-spectrogram-meta{justify-content:flex-start}.review-spectrogram-scale{flex-basis:100%}}

/* v0.7.5 lightweight Review video overlays */
.review-overlay-controls .overlay-control-title{font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#6c817a;margin-right:2px}
.review-overlay-controls .compact-check{white-space:nowrap}
@media(max-width:720px){.review-overlay-controls{gap:9px}.review-overlay-controls .compact-check{font-size:.79rem}}


/* v0.7.5 face-following Review zoom */
.review-video-stage video{transform:scale(var(--review-face-zoom,1));transform-origin:var(--review-face-origin-x,50%) var(--review-face-origin-y,50%);will-change:transform,transform-origin}
.review-face-zoom-control{display:inline-flex;align-items:center;gap:6px;margin-left:auto;font-size:.82rem;font-weight:700;color:#31565b;white-space:nowrap}
.review-face-zoom-control select{min-width:118px;padding:5px 7px;border:1px solid #cadbd4;border-radius:8px;background:#fff;color:#294f52;font:inherit;font-weight:600}
@media(max-width:720px){.review-face-zoom-control{margin-left:0;flex-basis:100%}.review-face-zoom-control select{min-width:132px}}

/* v0.7.5 cognitive sensitivity */
.cognitive-sensitivity-panel{margin-top:12px;padding:12px 14px;border:1px solid var(--line,#d7e5df);border-radius:14px;background:rgba(242,249,246,.75)}
.cognitive-sensitivity-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cognitive-sensitivity-select{display:flex;align-items:center;gap:8px;font-weight:700}
.cognitive-sensitivity-select select{min-width:132px}
.cognitive-sensitivity-advanced{margin-top:8px}
.cognitive-sensitivity-advanced summary{cursor:pointer;font-weight:700;color:var(--ink,#173f43)}
.cognitive-advanced-grid{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr)) auto;gap:10px;align-items:end;margin-top:10px}
.cognitive-advanced-grid label{display:grid;gap:5px;font-size:.86rem}
.cognitive-advanced-grid input{width:100%;box-sizing:border-box}
@media(max-width:900px){.cognitive-advanced-grid{grid-template-columns:repeat(2,minmax(140px,1fr))}.cognitive-advanced-grid button{grid-column:1/-1}}


/* v0.7.6 stable Review status chips + in-video EEG label */
.review-video-panel .panel-head{align-items:flex-start}
.review-video-panel .review-badges{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:32px;gap:8px;width:min(470px,68%);min-height:72px;flex:0 0 auto}
.review-video-panel .review-badges .badge{display:flex;align-items:center;justify-content:center;min-width:0;max-width:none;width:100%;height:32px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
@media(max-width:720px){.review-video-panel .panel-head{flex-direction:column}.review-video-panel .review-badges{width:100%;grid-template-columns:repeat(2,minmax(0,1fr));min-height:72px}}

/* v0.7.9 dual EEG performance: behavior + cognition */
.eeg-performance-block{padding-top:4px}
.eeg-performance-block + .eeg-performance-block{margin-top:24px;padding-top:22px;border-top:1px solid #dce8e3}
.cognitive-confusion .confusion-matrix{max-width:760px}
.cognitive-performance-block .performance-table{max-width:860px}

/* v0.7.10 — make the two EEG models explicit and pair metrics with confusion matrices */
.dual-model-intro{margin:0 0 16px;padding:14px 16px;border:1px solid #cfe2da;border-radius:14px;background:#f4faf7}
.dual-model-intro h3{margin:.15rem 0 .35rem}
.dual-model-intro .small{margin:0;color:#5f756e}
.model-performance-card{border:1px solid #d8e5df;border-radius:16px;padding:16px;background:#fff}
.eeg-performance-block + .eeg-performance-block{margin-top:18px;padding-top:16px;border-top:0}
.performance-pair{display:grid;grid-template-columns:minmax(420px,.92fr) minmax(600px,1.08fr);gap:18px;align-items:start}
.performance-column{min-width:0}
.performance-confusion{margin-top:0;padding-top:0;border-top:0;min-width:0}
.performance-matrix{min-width:0;overflow:hidden}
.behavior-performance-matrix .confusion-matrix{width:100%;min-width:0;table-layout:fixed;font-size:.56rem}
.behavior-performance-matrix .confusion-matrix th,
.behavior-performance-matrix .confusion-matrix td{min-width:0;padding:4px 1px;overflow-wrap:anywhere}
.behavior-performance-matrix .confusion-matrix thead th{white-space:normal;line-height:1.05}
.behavior-performance-matrix .confusion-matrix tbody th,
.behavior-performance-matrix .confusion-matrix .confusion-corner{width:78px;min-width:0;white-space:normal;line-height:1.05;overflow-wrap:normal;word-break:normal}
.behavior-performance-matrix .confusion-cell strong{font-size:.70rem}
.behavior-performance-matrix .confusion-cell span{font-size:.54rem;margin-top:2px}
.cognitive-performance-pair{grid-template-columns:minmax(380px,.85fr) minmax(460px,1.15fr)}
.cognitive-performance-pair .cognitive-confusion .confusion-matrix{width:100%;min-width:0;table-layout:fixed;font-size:.76rem}
.cognitive-performance-pair .cognitive-confusion .confusion-matrix th,
.cognitive-performance-pair .cognitive-confusion .confusion-matrix td{min-width:0;padding:7px 5px}
.model-method-bottom{margin-top:16px}
@media(max-width:1280px){
  .performance-pair,.cognitive-performance-pair{grid-template-columns:1fr}
  .performance-matrix{overflow:auto}
  .behavior-performance-matrix .confusion-matrix{min-width:760px;table-layout:auto}
}

/* v0.7.11 — explicit Session file actions with compact comprehension icons */
.review-actions .file-action-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
.review-actions .button-icon{width:17px;height:17px;flex:0 0 17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:720px){.review-actions .file-action-button{flex:1 1 185px}}

/* v0.7.12 — review-first hierarchy: video + predictions, compact legends, model identity */
.review-primary-grid{display:grid;grid-template-columns:minmax(520px,1.08fr) minmax(430px,.92fr);gap:18px;align-items:start;margin-top:18px}
.review-predictions-panel{min-width:0}
.predictions-head{align-items:center}
.prediction-live-dot{width:11px;height:11px;border-radius:50%;background:#29b881;box-shadow:0 0 0 4px rgba(41,184,129,.12);flex:0 0 auto}
.prediction-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:4px 0 14px}
.prediction-card{display:flex;align-items:center;gap:10px;min-height:54px;padding:10px 12px;border:1px solid #d9e6e1;border-radius:13px;background:#f8fbfa;min-width:0}
.prediction-card .prediction-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;flex:0 0 34px;background:#e8f6f1;color:#117a6b}
.prediction-card .prediction-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.prediction-cognitive .prediction-icon{background:#eaf2ff;color:#2c68b4}
.prediction-inear .prediction-icon{background:#eef0ff;color:#6757bd}
.prediction-protocol .prediction-icon{background:#f2f5f4;color:#60756e}
.prediction-text{display:block;min-width:0;font-weight:700;color:#173f43;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prediction-timeline-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:8px 0 4px;padding-top:10px;border-top:1px solid #e1ebe7}
.review-predictions-panel #reviewFeatures{width:100%;height:290px;display:block}
.review-signal-fullwidth{margin-top:18px}
.review-signal-fullwidth #reviewEeg{height:320px}

.compact-legend{margin-top:10px;border-top:1px solid #e4ece9;padding-top:8px}
.compact-legend summary{cursor:pointer;display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:750;color:#5d756d;list-style:none;user-select:none}
.compact-legend summary::-webkit-details-marker{display:none}
.compact-legend summary::before{content:"▸";color:#13846f;font-size:.78rem}
.compact-legend[open] summary::before{content:"▾"}
.compact-legend .hint,.compact-legend .small{margin:8px 0 0;color:#667d75;line-height:1.45}
.compact-caveat{margin-bottom:12px}
.compact-caveat summary{cursor:pointer;font-weight:750;list-style:none}
.compact-caveat summary::-webkit-details-marker{display:none}
.compact-caveat summary::before{content:"▸ ";color:#b8573f}
.compact-caveat[open] summary::before{content:"▾ "}
.compact-caveat .caveat-body{margin-top:8px;line-height:1.45}
.model-training-legend{margin-bottom:12px}

.model-card-head{align-items:center}
.model-title-group{display:flex;align-items:center;gap:12px;min-width:0}
.model-title-icon{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;flex:0 0 42px;color:#fff;background:#13796a}
.model-title-icon.cognitive-icon{background:#3969b1}
.model-title-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.model-title-group .eyebrow{margin-bottom:2px}
.model-title-group h3{margin:0}

@media(max-width:1100px){
  .review-primary-grid{grid-template-columns:1fr}
  .review-predictions-panel #reviewFeatures{height:250px}
}
@media(max-width:720px){
  .prediction-cards{grid-template-columns:1fr}
  .review-predictions-panel #reviewFeatures{height:230px}
  .review-signal-fullwidth #reviewEeg{height:280px}
}

/* v0.7.13 — synchronized sources first: video left, EEG/spectrogram right, classifications below */
.review-primary-grid{grid-template-columns:minmax(520px,1.03fr) minmax(500px,.97fr);align-items:stretch}
.review-primary-grid .review-video-panel,
.review-primary-grid .review-signal-panel{min-width:0;height:100%}
.review-primary-grid .review-signal-panel{margin-top:0}
.review-primary-grid .review-signal-panel #reviewEeg{height:315px}
.review-primary-grid .review-signal-panel #reviewSpectrogram{height:92px}
.review-primary-grid .review-filter-controls .inline{min-width:92px}
.review-predictions-fullwidth{margin-top:18px}
.review-predictions-fullwidth .prediction-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.review-predictions-fullwidth #reviewFeatures{height:260px}
@media(max-width:1250px){
  .review-primary-grid{grid-template-columns:1fr}
  .review-primary-grid .review-signal-panel #reviewEeg{height:300px}
  .review-predictions-fullwidth .prediction-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .review-predictions-fullwidth .prediction-cards{grid-template-columns:1fr}
  .review-predictions-fullwidth #reviewFeatures{height:230px}
}

/* v0.7.15 — compact adjustable spectrogram display frequency range */
.review-spectrogram-frequency{flex-wrap:nowrap}
.review-spectrogram-frequency input{width:58px}
@media(max-width:1180px){.review-spectrogram-meta{justify-content:flex-start}.review-spectrogram-frequency{flex-wrap:wrap}}


/* v0.7.16 — single-line spectrogram controls: frequency immediately left of color scale */
.review-spectrogram-meta{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:nowrap;
}
.review-spectrogram-meta #reviewSpectrogramSource{
  margin-right:auto;
  white-space:nowrap;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.review-spectrogram-frequency,
.review-spectrogram-meta > .review-spectrogram-scale{
  flex:0 0 auto;
  flex-wrap:nowrap;
}
.review-spectrogram-meta .review-spectrogram-scale{gap:5px}
.review-spectrogram-meta .review-spectrogram-scale input{width:54px}
.review-spectrogram-meta .compact-scale-reset{white-space:nowrap}
@media(max-width:1180px){
  .review-spectrogram-meta{gap:6px;flex-wrap:nowrap;justify-content:flex-end}
  .review-spectrogram-meta #reviewSpectrogramSource{font-size:.71rem}
  .review-spectrogram-meta .review-spectrogram-scale{flex-basis:auto}
  .review-spectrogram-meta .review-spectrogram-scale input{width:50px}
}
@media(max-width:900px){
  .review-spectrogram-meta{flex-wrap:wrap;justify-content:flex-start}
  .review-spectrogram-meta #reviewSpectrogramSource{flex-basis:100%;margin-right:0}
}

/* v0.7.17 — vertically expand spectrogram to balance video/EEG columns */
@media(min-width:1251px){
  .review-primary-grid .review-signal-panel{
    display:flex;
    flex-direction:column;
    height:100%;
  }
  .review-primary-grid .review-signal-panel #reviewSpectrogram{
    flex:1 1 170px;
    height:auto;
    min-height:170px;
  }
  .review-primary-grid .review-signal-panel > .compact-legend{
    margin-top:auto;
  }
}
@media(max-width:1250px){
  .review-primary-grid .review-signal-panel #reviewSpectrogram{
    height:110px;
    min-height:110px;
  }
}

/* v0.7.18 — compact video-only Attention Index below the video column */
.attention-index-grid{
  display:grid;
  grid-template-columns:minmax(520px,1.03fr) minmax(500px,.97fr);
  gap:18px;
  margin-top:18px;
}
.attention-index-panel{grid-column:1;min-width:0;padding-top:14px;padding-bottom:12px}
.attention-index-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
.attention-index-head h3{margin:.1rem 0 0}
.attention-index-panel #reviewAttentionIndex{width:100%;height:112px;display:block}
.attention-index-caption{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:2px;color:#647b74;font-size:.72rem}
.attention-index-caption .small{text-align:center;flex:1}
@media(max-width:1250px){
  .attention-index-grid{grid-template-columns:1fr}
  .attention-index-panel{grid-column:1}
}
@media(max-width:720px){
  .attention-index-panel #reviewAttentionIndex{height:96px}
  .attention-index-caption .small{font-size:.68rem}
}


/* v0.7.19 — move Face zoom into the video header so all review panels fit together more easily */
.review-video-head-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  flex:0 0 auto;
}
.review-video-head-actions .review-face-zoom-control{
  margin-left:0;
}
.review-video-panel .review-overlay-controls{
  min-height:0;
  padding-top:7px;
  padding-bottom:7px;
}
@media(max-width:720px){
  .review-video-panel .panel-head{align-items:flex-start}
  .review-video-head-actions{width:100%;align-items:flex-start}
  .review-video-head-actions .review-face-zoom-control{flex-basis:auto}
}


/* v0.7.20 — compact Review header + full-width session Visual Attention Index */
@media(min-width:721px){
  .review-video-head-actions{
    flex-direction:row;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
  }
  .review-video-head-actions .review-face-zoom-control{
    margin-left:0;
  }
}
.attention-index-grid{
  display:block;
  margin-top:12px;
}
.attention-index-panel{
  width:100%;
  min-width:0;
  padding-top:10px;
  padding-bottom:9px;
}
.attention-index-panel #reviewAttentionIndex{
  width:100%;
  height:108px;
  display:block;
}
@media(max-width:720px){
  .attention-index-grid{margin-top:12px}
  .attention-index-panel #reviewAttentionIndex{height:96px}
}

/* v0.7.42: Quality window strip using Session Amp/RMS/1/f limits plus gap mask. */
.eeg-quality-review{padding:13px 17px;margin:5px 13px 12px;border:1px solid #d5e4de;border-radius:13px;background:#f9fcfa;display:grid;gap:9px}
.eeg-quality-head{display:flex;justify-content:space-between;align-items:center;gap:10px;color:#163d3a}.eeg-quality-head>div{display:grid;gap:3px}.eeg-quality-head strong{font-size:14px}.eeg-quality-head .small{font-size:11px;color:#687d76}
.eeg-quality-strip{height:13px;display:flex;gap:4px;width:100%}.eeg-qc-tick{flex:1;min-width:2px;border-radius:5px;background:#b9c9c3}.eeg-qc-tick.green{background:#178b7c}.eeg-qc-tick.orange{background:#e2a65d}.eeg-qc-tick.red{background:#d57369}
.eeg-qc-state{font-size:12px;font-weight:750}.eeg-qc-state.valid{color:#087c60}.eeg-qc-state.insufficient{color:#ab593b}.eeg-qc-detail{font-size:11px;line-height:1.5;color:#55716b}

.eeg-qc-criteria{display:flex;flex-wrap:wrap;gap:5px}.eeg-qc-criterion{border:1px solid #d2dfd9;background:#f1f6f2;color:#6d827a;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:750}.eeg-qc-criterion.green{background:#e0f5eb;border-color:#add8c4;color:#16745d}.eeg-qc-criterion.orange{background:#fff3e3;border-color:#ead0a7;color:#a56b25}.eeg-qc-criterion.red{background:#ffefec;border-color:#ebbbaf;color:#a44739}

/* v0.7.44 — VAI follows video playback; missing spectral data is NOT low EEG power. */
.review-video-panel .attention-index-inline{
  display:block;
  margin:7px 15px 13px;
  padding:12px 12px 8px;
  border:1px solid #dce8e3;
  border-radius:12px;
  background:#fcfefd;
}
.review-video-panel .attention-index-panel{
  width:100%;
  padding:0;
  margin:0;
}
.review-video-panel .attention-index-head{margin-bottom:5px}
.review-video-panel .attention-index-panel #reviewAttentionIndex{
  display:block;
  width:100%;
  height:116px;
}
.review-video-panel .attention-index-caption{margin-top:0}
.review-spectrogram-legend{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 9px;
  padding:7px 16px 9px;
  color:#49645e;
  font-size:11px;
}
.review-spec-power-swatch{width:60px;height:12px;border-radius:3px;background:linear-gradient(90deg,#000096,#0061ff,#00ceff,#faee00,#ff8f00,#af0000);border:1px solid #b9cbd1;}
.review-spec-nodata-swatch{width:28px;height:12px;margin-left:15px;border-radius:3px;background:#11164e;border:1px solid #3d4a84;}
@media(max-width:720px){
  .review-video-panel .attention-index-inline{margin:5px 10px 11px;padding:10px 8px 6px}
  .review-video-panel .attention-index-panel #reviewAttentionIndex{height:100px}
  .review-spec-nodata-swatch{margin-left:6px}
}

/* v0.7.54 — explicit archive and destructive action */
#reviewArchiveZip{font-weight:800;background:#167e70;color:white;border-color:#167e70;}
#reviewArchiveZip:disabled{opacity:.5;cursor:wait;}
.review-actions .review-delete-button{color:#a33e33;border-color:#dfb8b0;background:#fff8f6;font-weight:700;}
.review-delete-dialog{border:1px solid #d8c6be;border-radius:16px;max-width:510px;width:calc(100% - 36px);padding:23px;box-shadow:0 25px 70px #192b2f5c;color:#243f3e;}
.review-delete-dialog::backdrop{background:#142d36aa;}
.review-delete-dialog h2{margin:0 0 12px;}.review-delete-dialog p{line-height:1.5;}
.review-delete-ack{display:flex;align-items:flex-start;gap:10px;margin:14px 0;font-weight:650;}
.review-delete-ack input{margin-top:4px;flex:none;}
.review-delete-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;}
.review-delete-confirm{background:#ab4037!important;border-color:#ab4037!important;color:white!important;}
.review-delete-confirm:disabled{opacity:.45;cursor:not-allowed;}

.review-stale-warning{padding:11px 13px;border:1px solid #e7bd90;border-radius:9px;background:#fff4e8;color:#7b4b14;line-height:1.45}
