/* ─────────────────────────────────────────────────
   Classroom Analyzer — Revamped Premium Design System
   ───────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Core Branding ── */
  --primary:           #d63a54;   /* Cogni-5 coral (matches the dashboard) */
  --primary-active:    #b52a42;
  --primary-disabled:  #f4c4cc;
  --on-primary:        #ffffff;

  /* Canvas & Surface */
  --canvas:            #f7f5f1;
  --surface-soft:      #f7f5f1;
  --surface-strong:    #f3f0ea;
  --surface-card:      #ffffff;

  /* Borders */
  --hairline:          #e6e1d8;
  --hairline-soft:     #efebe4;
  --border-strong:     #cfc8bc;

  /* Text */
  --ink:               #1d2330;
  --body-text:         #3a4150;
  --muted-text:        #5b6270;
  --muted-soft:        #8a909b;

  /* Legacy compatibility */
  --bg:                #ffffff;
  --bg1:               #f7f5f1;
  --bg2:               #f3f0ea;
  --bg3:               #efebe4;
  --border:            #e6e1d8;
  --blit:              #cfc8bc;
  --text:              #1d2330;
  --muted:             #5b6270;
  --dim:               #8a909b;
  --blue:              #d63a54;
  --blue-bg:           rgba(214,58,84,.08);

  /* Score palette — pastel on white */
  --red:               #a8352b;   /* s1 rose */
  --red-bg:            #fbe8e5;
  --orange:            #c2410c;   /* s2 */
  --orange-bg:         #fff4ed;
  --yellow:            #8a5a0c;   /* s3 honey */
  --yellow-bg:         #fcf1da;
  --green:             #2b6648;   /* s4 sage */
  --green-bg:          #e5f2ea;
  --purple:            #54489e;   /* s5 lavender */
  --purple-bg:         #eeebfa;

  /* Shadows */
  --shadow: rgba(0,0,0,0.02) 0 0 0 1px,
            rgba(29,35,48,0.04) 0 2px 6px 0,
            rgba(29,35,48,0.06) 0 4px 14px 0;
  --shadow-hover: rgba(0,0,0,0.02) 0 0 0 1px,
                  rgba(0,0,0,0.06) 0 4px 12px 0,
                  rgba(0,0,0,0.12) 0 8px 20px 0;

  /* Layout dimensions */
  --topbar-h:  72px;
  --repnav-h:  52px;
  --r-sm:       8px;
  --r-md:      16px;
  --r-full: 9999px;
  --max-w:   1440px;
}

/* Light only: the app stays light even when the computer uses dark mode. */
:root { color-scheme: light; }

html { scroll-behavior: smooth; }

/* Keyboard-accessible focus ring, consistent across every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body {
  background: var(--surface-soft);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Top Bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted-text);
}

.topbar-nav {
  display: flex;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.tnav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all .15s;
}
.tnav:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); }
.tnav.active { background: var(--surface-strong); color: var(--ink); }
.tnav:disabled { opacity: .38; cursor: not-allowed; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-recent-toggle {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--muted-text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.btn-recent-toggle:hover { border-color: var(--border-strong); color: var(--ink); background: var(--surface-soft); }

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--muted-text);
  background: var(--canvas);
  font-weight: 500;
}
.sdot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted-soft);
  flex-shrink: 0;
}
.sdot.working { background: #f59e0b; animation: blink 1.2s infinite; }
.sdot.done    { background: #22c55e; }
.sdot.error   { background: var(--primary); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ── Wizard Step-by-Step Upload ── */
.upload-wrap {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.upload-card {
  width: 100%;
  max-width: 720px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 36px;
  box-shadow: var(--shadow);
}
.wizard-header {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.wizard-intro {
  font-size: 14px;
  color: var(--muted-text);
  margin-bottom: 32px;
}

.wizard-steps-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.wizard-step {
  display: flex;
  gap: 18px;
  opacity: 1;
  transition: opacity .3s ease;
}
.wizard-step.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.step-num {
  width: 28px; height: 28px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.wizard-step.disabled .step-num {
  background: var(--muted-soft);
}
.step-body {
  flex: 1;
  min-width: 0;
}
.step-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
.privacy-choice {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; margin-bottom: 8px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); cursor: pointer;
  background: var(--surface-soft);
}
.privacy-choice input { margin-top: 3px; accent-color: var(--primary); }
.privacy-choice span { display: flex; flex-direction: column; gap: 3px; }
.privacy-choice strong { font-size: 12px; color: var(--body-text); }
.privacy-choice small { font-size: 10px; line-height: 1.4; color: var(--muted-text); }
.privacy-choice + .btn-start-analysis { margin-top: 12px; }
.privacy-line { margin: 24px 0 0; color: var(--muted-text); font-size: 10px; line-height: 1.5; }

.drop-zone {
  border: 2px dashed var(--hairline);
  border-radius: var(--r-sm);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-soft);
  transition: all .2s;
}
.drop-zone:hover {
  border-color: var(--primary);
  background: rgba(214,58,84,.02);
}
.session-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}
.session-mode-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--body-text);
  cursor: pointer;
  text-align: left;
}
.session-mode-option:hover { border-color: var(--border-strong); }
.session-mode-option.active {
  border-color: var(--primary);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.session-mode-option strong { font-size: 12px; }
.session-mode-option small { color: var(--muted-text); font-size: 9px; }
.session-mode-help {
  margin: 0 0 12px;
  color: var(--muted-text);
  font-size: 11px;
  line-height: 1.45;
}
.drop-icon { width: 36px; height: 36px; color: var(--primary); margin: 0 auto 12px; opacity: .8; }
.drop-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.drop-sub { font-size: 12px; color: var(--muted-text); margin-bottom: 16px; }
.btn-browse {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--primary);
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.btn-browse:hover { filter: brightness(.96); }
.btn-browse:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.clip-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.clip-sequence-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--muted-text);
  font-size: 10px;
  line-height: 1.4;
}
.clip-sequence-summary strong { color: var(--ink); }
.clip-sequence-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.clip-sequence-add {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.clip-sequence-add:hover { text-decoration: underline; }
.clip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(214, 58, 84, 0.06);
  border: 1px solid rgba(214, 58, 84, 0.2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
.clip-row.active-area-clip {
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}
.clip-row-time {
  min-width: 64px;
  color: var(--muted-text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.clip-row-index { font-weight: 700; color: var(--primary); font-size: 12px; min-width: 44px; }
.clip-row-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-row-size { font-size: 12px; color: var(--muted-text); }
.clip-row-area-state {
  color: var(--muted-text);
  font-size: 10px;
  white-space: nowrap;
}
.clip-row-area {
  padding: 5px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--primary);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.clip-row-area:hover { border-color: var(--primary); }
.clip-row-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
  padding: 2px 4px;
}
.clip-row-btn:disabled { opacity: .3; cursor: not-allowed; }
.clip-row-remove { font-size: 18px; font-weight: bold; }

/* Analysis-area selector */
.roi-selector {
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 10px;
  background: var(--surface-soft);
}
.roi-clip-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  padding: 8px 9px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
  font-size: 10px;
}
.roi-clip-context > span:first-child { color: var(--primary); font-weight: 700; }
.roi-clip-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roi-clip-context > span:last-child { color: var(--muted-text); white-space: nowrap; }
.roi-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
  border-radius: var(--r-sm);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  outline: none;
}
.roi-stage:focus-visible { box-shadow: 0 0 0 3px rgba(214,58,84,.28); }
.roi-stage.drawing { cursor: crosshair; }
.roi-stage.drawing-ignore { cursor: crosshair; }
.roi-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.roi-stage video { position: relative; z-index: 0; }
.roi-shade {
  position: absolute;
  z-index: 1;
  background: rgba(0,0,0,.58);
  pointer-events: none;
}
.roi-box {
  position: absolute;
  z-index: 2;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(255,255,255,.65), inset 0 0 0 1px rgba(255,255,255,.35);
  cursor: move;
}
.roi-box.full-frame { pointer-events: none; }
.roi-box-label {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.roi-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  background: var(--primary);
  border-radius: 50%;
}
.roi-box.full-frame .roi-handle { display: none; }
.roi-handle-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.roi-handle-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.roi-handle-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.roi-handle-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.roi-ignore-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}
.roi-ignore-zone {
  position: absolute;
  border: 2px solid #ef4444;
  background: rgba(127, 29, 29, .56);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
  cursor: move;
  pointer-events: auto;
}
.roi-ignore-zone-label {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2px 5px;
  border-radius: 3px;
  background: #b91c1c;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}
.roi-ignore-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: #7f1d1d;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.roi-ignore-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef4444;
}
.roi-ignore-handle[data-ignore-handle="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.roi-ignore-handle[data-ignore-handle="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.roi-ignore-handle[data-ignore-handle="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.roi-ignore-handle[data-ignore-handle="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.roi-timeline-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}
.roi-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
}
.roi-icon-btn svg { width: 15px; height: 15px; fill: currentColor; }
.roi-time { width: 100%; accent-color: var(--primary); }
.roi-time-label {
  color: var(--muted-text);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.roi-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}
.roi-action-btn {
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--body-text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.roi-action-btn:hover { border-color: var(--border-strong); }
.roi-action-btn.active { border-color: var(--primary); color: var(--primary); }
.roi-action-btn.roi-ignore-action.active { border-color: #ef4444; color: #b91c1c; }
.roi-action-btn:disabled { opacity: .42; cursor: not-allowed; }
.roi-selection-status {
  margin-left: auto;
  color: var(--muted-text);
  font-size: 10px;
  text-align: right;
}

/* Options */

.btn-start-analysis {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.btn-start-analysis:hover:not(.disabled) { background: var(--primary-active); }
.btn-start-analysis.disabled { opacity: 0.4; cursor: not-allowed; }

/* Processing timer & panel */
.proc-timers {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  background: var(--surface-soft);
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
}
.timer-box { flex: 1; text-align: center; }
.timer-label { font-size: 10px; text-transform: uppercase; font-weight: 700; color: var(--muted-soft); }
.timer-val { font-size: 18px; font-weight: 700; color: var(--ink); font-feature-settings: 'tnum'; }

/* =================================================
   SPLIT WORKSPACE LAYOUT
   ================================================= */
.workspace-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px;
  align-items: start;
}

.workspace-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.workspace-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.workspace-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sticky-element {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  z-index: 90;
}

/* Video Block */
.video-container {
  background: #000;
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}
.video-container video { width: 100%; display: block; max-height: 40vh; object-fit: contain; }

.video-time-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.video-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease;
}
.video-loading-overlay.hidden { opacity: 0; pointer-events: none; }
.video-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: video-spin 0.8s linear infinite;
}
@keyframes video-spin { to { transform: rotate(360deg); } }

.video-shortcuts-hint {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.video-container:hover .video-shortcuts-hint { opacity: 1; }

/* Student Roster Rework */

/* Key Timestamps */
.timestamps-section { margin-bottom: 8px; }
.section-subtitle { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--muted-text); margin-bottom: 8px; }

/* Interactive Note panel */
.btn-action-primary {
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-action-primary:hover { background: var(--primary); }

.btn-action-secondary {
  width: 100%;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-action-secondary:hover { background: var(--surface-strong); border-color: var(--border-strong); }
.empty-list { font-size: 12px; color: var(--muted-soft); font-style: italic; text-align: center; padding: 12px; }

/* Recent sessions panel details */
.recent-sessions-panel {
  display: flex;
  flex-direction: column;
  max-height: 350px;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hairline-soft); padding-bottom: 8px; margin-bottom: 10px; }
.btn-close-panel { border: none; background: transparent; font-size: 20px; color: var(--muted-soft); cursor: pointer; }
.btn-close-panel:hover { color: var(--ink); }

.recent-sessions-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.recent-item {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s;
}
.recent-item:hover { background: var(--surface-soft); border-color: var(--border-strong); }
.recent-item.active { border-color: var(--primary); background: rgba(214, 58, 84, 0.03); }
.recent-item-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-soft); margin-top: 4px; }
.recent-item-title { font-weight: 700; font-size: 12px; color: var(--ink); }

/* =================================================
   RIGHT WORKSPACE PANEL (Tabs & Content)
   ================================================= */
.rnav-link {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-text);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.rnav-link:hover { background: var(--surface-strong); color: var(--ink); border-color: var(--border-strong); }

/* Overview tab layout */

/* AI Review (Claude coaching review + GPT verification) */

/* Action Planner Print view styles */
.empty-text { font-size: 13px; color: var(--muted-soft); font-style: italic; }

/* ── Legacy Section details and cards styling ── */
.ev-chip {
  display: inline-flex; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  color: var(--primary); background: rgba(214,58,84,.06); border-radius: 4px; padding: 3px 6px; cursor: pointer; text-decoration: none;
}
.ev-chip:hover { background: rgba(214,58,84,.15); }

/* Thrive specific */

/* Owner review banner styling */

/* Utilities */
.hidden { display: none !important; }

/* ── Print Media Query ──
   "Print Action Planner" (window.print(), unchanged) still uses this. The
   "Download PDF Summary" button no longer uses window.print() at all -- it
   renders a separate condensed .print-summary node via html2pdf instead, so
   the full-report print mode that used to live here has been removed. */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .topbar, .topbar-nav, .topbar-right, .workspace-left { display: none !important; }
  .workspace-layout { display: block; padding: 0; }
  .workspace-right { width: 100%; }
  .empty-text { color: #555; }
}

/* ─────────────────────────────────────────────────
   Condensed PDF summary (rendered off-screen, captured by html2pdf)
   ─────────────────────────────────────────────── */
/* Deliberately NOT position:fixed/absolute -- confirmed by direct testing
   that html2canvas's internal DOM-cloning collapses absolutely/fixed
   positioned source elements to zero height (even though the live element
   itself has correct layout), producing a blank PDF. Left in normal static
   document flow instead; the full-screen fixed overlay (which always covers
   the viewport regardless of scroll position) hides it visually instead. */

/* ── Responsive ── */
@media (max-width: 1024px) {
  .workspace-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    width: 100%;
    max-width: 100%;
  }
  .workspace-left,
  .workspace-right { min-width: 0; width: 100%; max-width: 100%; }
  .sticky-element { position: static; }
}
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .topbar-nav { display: none; } /* On mobile/tablet use the standard toggle */
  .brand-sub { display: none; }
  .roi-actions { align-items: flex-start; flex-wrap: wrap; }
  .roi-selection-status { width: 100%; margin-left: 0; text-align: left; }
}
@media (max-width: 480px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-brand { gap: 8px; }
  .brand-name { font-size: 14px; }
  .topbar-right { gap: 6px; }
  .status-pill { display: none; }
  .btn-recent-toggle { padding: 7px 10px; }
  .upload-wrap { padding: 20px 12px; justify-content: flex-start; }
  .upload-card { padding: 22px 16px; border-radius: var(--r-sm); }
  .wizard-intro { margin-bottom: 24px; }
  .wizard-step { gap: 10px; }
  .step-num { width: 24px; height: 24px; }
  .drop-zone { padding: 24px 12px; }
  .clip-row { flex-wrap: wrap; }
  .clip-row-name { min-width: 120px; }
  .clip-row-area-state { margin-left: 52px; }
  .roi-clip-context { grid-template-columns: 1fr; gap: 3px; }
  .roi-clip-context > span:last-child { white-space: normal; }
  .session-mode-options { grid-template-columns: 1fr; }
  .clip-sequence-summary { flex-direction: column; }
}

/* ───────────────────────────────────────────────
   Belt legend (upload Step 2)
   ─────────────────────────────────────────────── */
.step-help { font-size: 12px; color: var(--muted-text); margin: 4px 0 10px; }

/* Belt chip on roster pills */

/* Roster pill — name + belt swatch + belt name */

/* ───────────────────────────────────────────────
   Confirm modal
   ─────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(2px);
}
.confirm-modal {
  background: var(--surface-card); border-radius: var(--r-md);
  padding: 24px; max-width: 620px; width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.confirm-modal h3 { font-size: 18px; margin-bottom: 12px; color: var(--ink); }
.confirm-file { font-size: 13px; color: var(--body-text); margin-bottom: 8px; word-break: break-all; }
.confirm-file-size { color: var(--muted-soft); font-size: 12px; margin-left: 6px; }
.confirm-sub { font-size: 12px; color: var(--muted-text); margin-bottom: 18px; }
.confirm-privacy { margin: -6px 0 18px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-soft); color: var(--body-text); font-size: 11px; line-height: 1.7; }
.confirm-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px; align-items: stretch; }
.btn-confirm-cancel, .btn-confirm-standard {
  padding: 9px 18px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border);
}
.btn-confirm-cancel { background: var(--surface-soft); color: var(--body-text); }
.btn-confirm-standard { background: var(--canvas); color: var(--ink); }
.btn-confirm-standard:hover { background: var(--surface-soft); }
@media (max-width: 620px) {
  .confirm-modal { max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px; }
  .confirm-actions { grid-template-columns: 1fr; }
  .btn-confirm-cancel { order: 3; }
  .btn-confirm-standard, .btn-confirm-cancel { width: 100%; min-height: 42px; }
}

/* ───────────────────────────────────────────────
   Scene summary (mat / excluded people)
   ─────────────────────────────────────────────── */
.proc-back-btn {
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--primary);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.proc-back-btn:hover { background: var(--surface-soft); }

/* ───────────────────────────────────────────────
   Family reports and end-of-overview cost summary
   ─────────────────────────────────────────────── */
.owner-report-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 18px;
  border-bottom: 1px solid var(--hairline);
}
.owner-report-head h2 { margin: 3px 0 5px; font-size: 24px; }
.owner-report-head p { max-width: 640px; color: var(--muted-text); font-size: 12px; line-height: 1.5; }
.owner-download-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.owner-download-actions .btn-action-primary,
.owner-download-actions .btn-action-secondary { width: auto; min-width: 172px; white-space: nowrap; }
.owner-download-actions button:disabled { cursor: wait; opacity: .55; }
.owner-eyebrow {
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Purpose-built A4 Family Report exports. Each page is captured independently
   so the live app viewport and scroll position cannot offset the PDF canvas. */
@media (max-width: 560px) {
  .owner-report-head { align-items: flex-start; flex-direction: column; }
  .owner-download-actions { width: 100%; flex-direction: column; }
  .owner-download-actions .btn-action-primary,
  .owner-download-actions .btn-action-secondary { width: 100%; }
}

/* ───────────────────────────────────────────────
   Per-student MA blocks
   ─────────────────────────────────────────────── */

/* ───────────────────────────────────────────────
   Instructor evaluation cards (rich per-criterion)
   ─────────────────────────────────────────────── */

/* ───────────────────────────────────────────────
   Thrive-specific per-trait styling
   ─────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────
   Landing Dashboard: stats, processing queue, recent
   ─────────────────────────────────────────────── */
.dashboard-section {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  transition: box-shadow .15s ease, transform .1s ease;
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.stat-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.stat-card-label {
  font-size: 12px;
  color: var(--muted-text);
  margin-top: 4px;
  font-weight: 500;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .dashboard-columns { grid-template-columns: 1fr; }
}
.dashboard-col-header h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text);
  margin-bottom: 10px;
}

.processing-queue-list, .dashboard-recent-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
}
.pq-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  animation: pq-pulse 1.4s ease-in-out infinite;
}
@keyframes pq-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(0.75); }
}
.pq-label { font-weight: 600; color: var(--ink); }
.pq-stage { color: var(--muted-text); margin-left: auto; font-size: 12px; }

.dash-recent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dash-recent-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.dash-recent-title { font-weight: 600; color: var(--ink); }
.dash-recent-meta { color: var(--muted-text); font-size: 11px; margin-top: 2px; }
.dash-recent-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--muted-soft); flex-shrink: 0;
}
.dashboard-empty {
  font-size: 13px; color: var(--muted-text); padding: 12px 0;
}

.skeleton-card {
  height: 64px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface-strong) 37%, var(--surface-soft) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-card { animation: none; }
}

/* ─────────────────────────────────────────────────
   Executive Summary bar (Overview tab)
   ─────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────
   Timeline (evidence + flags + notable moments)
   ─────────────────────────────────────────────── */
.evidence-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
}
.timeline-item {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  border-radius: var(--r-sm);
  transition: background-color .15s ease;
}
.timeline-item[data-start]:not([data-start=""]) { cursor: pointer; }
.timeline-item:hover { background: var(--surface-soft); }
.timeline-item.active {
  background: var(--blue-bg);
}
.timeline-dot {
  width: 9px; height: 9px; border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-dot.sev-good { background: var(--green); }
.timeline-dot.sev-attention { background: var(--red); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-row-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.timeline-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted-text);
  flex-shrink: 0;
}
.timeline-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-score {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-text);
  flex-shrink: 0;
}
.timeline-detail {
  font-size: 11.5px;
  color: var(--muted-text);
  margin-top: 2px;
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────
   AI Findings tab: Recommendations + Findings explorer
   ─────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────
   Top Priorities + Biggest Risk
   ─────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────
   Analytics (Chart.js)
   ─────────────────────────────────────────────── */

/* Overall Score ring */
.score-ring-wrap { position: relative; width: 64px; height: 64px; margin-bottom: 6px; }
.score-ring { transform: rotate(-90deg); }
.score-ring-track { fill: none; stroke: var(--hairline-soft); stroke-width: 6; }
.score-ring-fill {
  fill: none; stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}
.score-ring-value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--ink);
}

.owner-focus .workspace-layout { grid-template-columns:minmax(230px,300px) minmax(0,1fr); gap:22px; }
.owner-focus .workspace-left { position:sticky; top:110px; align-self:start; }
.owner-focus .owner-report-head h2 { font-size:26px; }
.owner-focus .owner-report-head p { font-size:14px; }
.owner-focus .owner-report-head { gap:20px; align-items:center; }
.owner-focus .owner-download-actions { grid-template-columns:repeat(2,1fr); }
.owner-focus .owner-download-actions button { min-width:120px; }
.owner-focus #owner-report-content { overflow-x:auto; }
.owner-focus .workspace-right { min-width:0; }
@media(max-width:1050px) { .owner-focus .workspace-layout { grid-template-columns:1fr; }.owner-focus .workspace-left { position:static; max-width:500px; }.owner-focus .owner-report-head { flex-wrap:wrap; } }

.owner-focus .pma-mat-controls { display:none; }

.owner-focus .workspace-layout { max-width:1840px; }

/* ── Owner report shell (v2) ─────────────────────── */
.pose-preview-note { font-size: 12px; color: #626b65; margin: 8px 0; }
.headcount-card {
  display: flex; align-items: center; gap: 14px; margin: 12px 0;
  padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-soft);
}
.headcount-card.review { border-color: #d4a017; background: #fff8e1; }
.headcount-num { font-size: 34px; font-weight: 800; line-height: 1; min-width: 44px; text-align: center; color: var(--ink); }
.headcount-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.headcount-text strong { font-size: 13px; }
.headcount-text small { color: var(--muted-text); font-size: 11px; line-height: 1.45; }
.timestamps-section > summary { cursor: pointer; list-style: none; }
.timestamps-section > summary::-webkit-details-marker { display: none; }
.timestamps-section > summary::before { content: "▾ "; }
.timestamps-section:not([open]) > summary::before { content: "▸ "; }
#eval-banner { margin: 0 0 12px; }

.reference-field { display:flex; flex-direction:column; gap:6px; margin:10px 0; }
.reference-field label { display:flex; flex-direction:column; gap:2px; font-size:13px; }
.reference-field small { color:var(--muted-text); font-size:11px; line-height:1.4; }
.reference-field textarea { width:100%; padding:8px 10px; border:1px solid var(--hairline); border-radius:8px; font:inherit; font-size:13px; resize:vertical; }

.owner-usage { margin:4px 0 0; font-size:12px; color:var(--muted-text); }

/* Authentication recovery is visible above either report workspace. */
.session-required { margin: 24px auto; padding: 24px; max-width: 1100px; border: 1px solid #d6b66a; border-radius: 12px; background: #fff8e7; color: #183b28; scroll-margin-top: 110px; }
.session-required h2 { margin: 0 0 12px; }
.session-required p { margin-bottom: 18px; line-height: 1.5; }
.session-required a, .session-required button { display: inline-block; padding: 12px 18px; background: #073d24; color: white; border-radius: 8px; text-decoration: none; font-weight: 600; }

/* ── UI/UX pass 2026-11-13 ─────────────────────────
   The left panel scrolls on its own, so the video stays visible while the
   report scrolls and an evidence click always shows the moment it jumped to. */
@media (min-width: 1051px) {
  .owner-focus .workspace-left {
    top: calc(var(--topbar-h) + 16px);
    max-height: calc(100vh - var(--topbar-h) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .owner-focus .video-workspace-card { position: static; overflow: visible; }
  .owner-focus .video-container { position: sticky; top: 0; z-index: 2; }
  .owner-focus .evidence-timeline { max-height: none; }
  /* "Wider report": hide the panel; an evidence click brings it back. */
  .owner-focus.video-panel-hidden .workspace-layout { grid-template-columns: minmax(0, 1fr); }
  .owner-focus.video-panel-hidden .workspace-left { display: none; }
}
@media (max-width: 1050px) { #toggle-video-panel { display: none; } }
.video-container.seek-flash { box-shadow: 0 0 0 3px var(--primary); transition: box-shadow .2s; }
.headcount-more summary { cursor: pointer; font-size: 11px; color: var(--muted-text); margin-top: 2px; }
.headcount-more small { display: block; margin-top: 4px; }
.dashboard-link { text-decoration: none; }
.owner-focus .owner-download-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.owner-focus .owner-download-actions button { min-width: 0; }
