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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0d0d0d;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Menu Screen ─────────────────────────────────────────── */
#menu-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: #0d0d0d;
  padding-bottom: 70px;
}
#menu-screen.active {
  display: flex;
}

/* ── Regiment Builder Tab ──────────────────────────────────── */
.regiment-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  width: 100%;
  max-width: 1280px;
  padding: 20px 24px 80px;
  box-sizing: border-box;
  align-items: start;
}
@media (max-width: 900px) {
  .regiment-layout { grid-template-columns: 1fr; }
}
.regiment-col {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  min-height: 400px;
}
.regiment-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
  font-weight: 700;
  color: #e0e0e0;
}
.regiment-header-actions {
  display: flex;
  gap: 6px;
}
.regiment-handout-hint {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Handout Preview (screen) ──────────────────────────────── */
.regiment-handout-preview {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 14px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  font-size: 0.82rem;
}
.ho-root { color: #e0e0e0; }
.ho-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid #4fc3f7; padding-bottom: 12px; margin-bottom: 16px;
}
.ho-title { font-size: 1.05rem; font-weight: 700; color: #fff; }
.ho-meta { font-size: 0.72rem; color: #888; margin-top: 2px; }
.ho-clinic-name { font-size: 0.88rem; font-weight: 700; color: #4fc3f7; text-align: right; }
.ho-clinic-sub { font-size: 0.68rem; color: #666; text-align: right; }
.ho-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.ho-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 12px 14px;
}
.ho-card-header { margin-bottom: 6px; }
.ho-card-tag {
  background: rgba(79,195,247,0.15); color: #4fc3f7;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 7px; border-radius: 4px;
  display: inline-block; margin-bottom: 3px;
}
.ho-card-title { font-size: 0.92rem; font-weight: 700; color: #fff; }
.ho-what { font-size: 0.80rem; color: #bbb; margin-bottom: 8px; line-height: 1.6; }
.ho-params-block { background: rgba(79,195,247,0.07); border-radius: 5px; padding: 6px 10px; margin-bottom: 8px; }
.ho-params { font-size: 0.75rem; color: #81d4fa; padding: 1px 0; }
.ho-steps-title { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; color: #666; letter-spacing: 0.05em; margin-bottom: 4px; }
.ho-steps { padding-left: 16px; color: #ccc; line-height: 1.75; font-size: 0.80rem; }
.ho-tip { background: rgba(255,193,7,0.08); border-left: 3px solid #ffc107; padding: 6px 10px; border-radius: 0 5px 5px 0; font-size: 0.75rem; color: #ffe082; margin-top: 8px; line-height: 1.5; }
.ho-nrs, .ho-tips {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 10px;
}
.ho-nrs-title, .ho-tips-title { font-size: 0.80rem; font-weight: 700; color: #e0e0e0; margin-bottom: 6px; }
.ho-nrs-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 0.78rem; color: #bbb; }
.ho-nrs-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 0.75rem; min-width: 36px; text-align: center; }
.ho-nrs-good { background: rgba(39,174,96,0.2); color: #2ecc71; }
.ho-nrs-warn { background: rgba(241,196,15,0.2); color: #f1c40f; }
.ho-nrs-stop { background: rgba(192,57,43,0.2); color: #e74c3c; }
.ho-tips ul { padding-left: 16px; color: #bbb; line-height: 1.7; font-size: 0.78rem; }
.ho-footer { font-size: 0.68rem; color: #555; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 8px; line-height: 1.6; }

/* Regiment Builder overlay body uses wider max-width */
.regiment-overlay-body { max-width: 1300px !important; padding: 20px; }

#menu-screen h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
}

.menu-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.menu-card {
  width: 220px;
  height: 150px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  padding: 16px;
  text-align: center;
}
.menu-card:hover {
  transform: translateY(-2px);
  border-color: #2e7dd1;
  background: rgba(46,125,209,0.07);
}

.card-abbr {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.card-name {
  font-size: 0.68rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.card-desc {
  font-size: 0.65rem;
  color: #484848;
}

.built-by {
  font-size: 0.72rem;
  color: #666;
  text-align: center;
  padding: 8px 16px;
  margin-bottom: 0;
}

.menu-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.menu-logo-svg {
  width: 128px;
  height: auto;
}

/* ── Canvas ──────────────────────────────────────────────── */
#canvas {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#canvas.visible {
  display: block;
}

/* ── Controls Panel ──────────────────────────────────────── */
.controls-panel {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: rgba(8,8,8,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 16px;
  z-index: 10;
  flex-wrap: wrap;
  max-width: calc(100vw - 32px);
}
.controls-panel.visible {
  display: flex;
}

.ctrl-divider {
  width: 1px;
  height: 44px;
  background: rgba(255,255,255,0.09);
  align-self: center;
  flex-shrink: 0;
}

/* ── Back Button ─────────────────────────────────────────── */
.back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: #888;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.back-btn:hover {
  background: rgba(255,255,255,0.06);
}

/* ── Reset Button ────────────────────────────────────────── */
.reset-btn {
  background: transparent;
  border: 1px solid rgba(255,100,100,0.2);
  color: #666;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.reset-btn:hover {
  background: rgba(255,80,80,0.08);
  color: #bbb;
  border-color: rgba(255,100,100,0.45);
}

/* ── Control Section ─────────────────────────────────────── */
.ctrl-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.section-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #444;
  letter-spacing: 0.15em;
  align-self: flex-start;
}

.section-body {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.ctrl-group label {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.1em;
}

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-label input:checked + .toggle-track { background: #4caf50; }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}
.toggle-label input:checked + .toggle-track .toggle-thumb { left: 19px; }
.toggle-text { font-size: 0.78rem; color: #aaa; }

/* ── Button Rows ─────────────────────────────────────────── */
.btn-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.okn-dir-row {
  max-width: 160px;
}

/* ── Direction / Paradigm Buttons ────────────────────────── */
.vor-paradigm-btn,
.vor-dir-btn,
.okn-dir-btn,
.mdds-dir-btn,
.level-dir-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aaa;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.vor-paradigm-btn:hover,
.vor-dir-btn:hover,
.okn-dir-btn:hover,
.mdds-dir-btn:hover,
.level-dir-btn:hover {
  background: rgba(255,255,255,0.1);
}
.vor-paradigm-btn.active,
.vor-dir-btn.active,
.okn-dir-btn.active,
.mdds-dir-btn.active,
.level-dir-btn.active {
  background: #1a3a5c;
  border-color: #2e7dd1;
  color: #fff;
}

/* ── Slider Row ──────────────────────────────────────────── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="range"] {
  width: 100px;
  accent-color: #2e7dd1;
  cursor: pointer;
}

.slider-row input[type="number"] {
  width: 50px;
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #ccc;
  font-size: 0.85rem;
  padding: 3px 4px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.slider-row input[type="number"]::-webkit-outer-spin-button,
.slider-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Color Row ───────────────────────────────────────────── */
.color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="color"] {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  padding: 2px;
}

.color-row input[type="text"] {
  width: 66px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #ccc;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  padding: 4px 6px;
}

/* ── Instruction Button ──────────────────────────────────── */
.instr-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.12s ease;
}
.instr-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Start Button ────────────────────────────────────────── */
.start-btn {
  background: #1a3a5c;
  border: 1px solid #2e7dd1;
  color: #fff;
  padding: 8px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}
.start-btn:hover {
  background: #1f4878;
}
.start-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.start-btn.running {
  background: #5c1a1a;
  border-color: #d12e2e;
}
.start-btn.running:hover {
  background: #781f1f;
}

/* ── MdDS Instructions Overlay ───────────────────────────── */
#mdds-instructions {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(660px, calc(100vw - 40px));
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  background: rgba(8,8,8,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  z-index: 25;
  padding: 0;
}
#mdds-instructions.visible {
  display: block;
}

.instr-content {
  padding: 24px 28px;
  position: relative;
}

.instr-text p {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 14px;
}
.instr-text p:last-child {
  margin-bottom: 0;
}

/* ── VOR Info Overlay ────────────────────────────────────── */
#vor-info-overlay {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 40px));
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  background: rgba(8,8,8,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  z-index: 25;
}
#vor-info-overlay.visible { display: block; }

/* ── VOR Paradigm Label ──────────────────────────────────── */
#vor-paradigm-label {
  font-size: 0.72rem;
  color: #aaa;
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── RSV Read-only Displays ──────────────────────────────── */
.rsv-readout {
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ccc;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* ── Shared close button ─────────────────────────────────── */
#vor-info-close,
#level-info-close,
#mdds-instr-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.12s ease;
}
#vor-info-close:hover,
#level-info-close:hover,
#mdds-instr-close:hover { color: #ccc; }

/* ── Level Info Overlay ──────────────────────────────────── */
#level-info-overlay {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 40px));
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  background: rgba(8,8,8,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  z-index: 25;
}
#level-info-overlay.visible { display: block; }

/* ── Level Selector Buttons ──────────────────────────────── */
.level-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aaa;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.level-btn:hover { background: rgba(255,255,255,0.1); }
.level-btn.active {
  background: #1a3a5c;
  border-color: #2e7dd1;
  color: #fff;
}

/* ── Level Name Display ──────────────────────────────────── */
#level-name-display {
  font-size: 0.72rem;
  color: #aaa;
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Conflict Index Bar ──────────────────────────────────── */
.conflict-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.conflict-track {
  width: 90px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.conflict-fill {
  height: 100%;
  border-radius: 3px;
  background: #c0392b;
  transition: width 0.4s ease;
}
#conflict-label {
  font-size: 0.7rem;
  color: #888;
  white-space: nowrap;
}

/* ── Timer Display ───────────────────────────────────────── */
.timer-display {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: 0.05em;
}

/* ── Duration Input ──────────────────────────────────────── */
.duration-input {
  width: 60px;
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #ccc;
  font-size: 0.85rem;
  padding: 3px 4px;
  -moz-appearance: textfield;
}
.duration-input::-webkit-outer-spin-button,
.duration-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Unit Label ──────────────────────────────────────────── */
.unit {
  font-size: 0.72rem;
  color: #666;
  white-space: nowrap;
}

/* ── TF Display ──────────────────────────────────────────── */
.tf-display {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
#level-tf-hz {
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  white-space: nowrap;
}
.tf-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.tf-ok    { background: rgba(39,174,96,0.2);   color: #2ecc71; border: 1px solid rgba(39,174,96,0.35); }
.tf-vsm   { background: rgba(79,195,247,0.15); color: #4fc3f7; border: 1px solid rgba(79,195,247,0.35); }
.tf-low   { background: rgba(241,196,15,0.2);  color: #f1c40f; border: 1px solid rgba(241,196,15,0.35); }
.tf-high  { background: rgba(241,196,15,0.2);  color: #f1c40f; border: 1px solid rgba(241,196,15,0.35); }
.tf-error { background: rgba(192,57,43,0.2);   color: #e74c3c; border: 1px solid rgba(192,57,43,0.35); }

/* ── Calibration Input ───────────────────────────────────── */
.cal-input {
  width: 56px;
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #ccc;
  font-size: 0.85rem;
  padding: 3px 4px;
  -moz-appearance: textfield;
}
.cal-input::-webkit-outer-spin-button,
.cal-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Info Sections ───────────────────────────────────────── */
.info-section {
  margin-bottom: 16px;
}
.info-section:last-child { margin-bottom: 0; }
.info-section h4 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 4px;
}

/* ── NRS Modal ───────────────────────────────────────────── */
#nrs-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 40;
  align-items: center;
  justify-content: center;
}
#nrs-modal.visible { display: flex; }

.nrs-content {
  background: #111;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 28px 36px 24px;
  text-align: center;
  max-width: 560px;
  width: calc(100vw - 40px);
}
.nrs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}
.nrs-content > p {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 16px;
}
.nrs-scale {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.nrs-btn {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #ccc;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.nrs-btn:hover { background: #1a3a5c; border-color: #2e7dd1; color: #fff; }
.nrs-btn.active { background: #1a3a5c; border-color: #2e7dd1; color: #fff; }
.nrs-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #555;
  padding: 0 2px;
  margin-bottom: 10px;
}

/* ── NRS Guidance Chips ──────────────────────────────────── */
.nrs-guidance {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.nrs-guide-chip {
  font-size: 0.62rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── NRS Extras (fixation + params) ─────────────────────── */
.nrs-extras {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nrs-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.nrs-field-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555;
}
.nrs-fix-btn,
.nrs-param-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aaa;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.nrs-fix-btn:hover,
.nrs-param-btn:hover { background: rgba(255,255,255,0.1); }
.nrs-fix-btn.active,
.nrs-param-btn.active {
  background: #1a3a5c;
  border-color: #2e7dd1;
  color: #fff;
}

/* ── Session Log Modal ───────────────────────────────────── */
#session-log-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 40;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
}
#session-log-modal.visible { display: flex; }

.log-content {
  background: #111;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  width: min(960px, calc(100vw - 40px));
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.log-header h3 { font-size: 1rem; font-weight: 600; color: #fff; }
#log-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
}
#log-close:hover { color: #ccc; }
.log-table-wrap {
  overflow-y: auto;
  padding: 12px 16px 20px;
}
#log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
#log-table th {
  text-align: left;
  padding: 6px 8px;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}
#log-table td {
  padding: 7px 8px;
  color: #bbb;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}
#log-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.log-empty {
  text-align: center;
  color: #444;
  font-size: 0.85rem;
  padding: 20px 0;
}

/* ── Select Controls ─────────────────────────────────────── */
.ctrl-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #ccc;
  font-size: 0.78rem;
  padding: 4px 6px;
  cursor: pointer;
  max-width: 140px;
  -webkit-appearance: none;
  appearance: none;
}
.ctrl-select:focus { outline: 1px solid #2e7dd1; }
.ctrl-select option { background: #111; color: #ccc; }

/* ── Gain Input Wrapper ───────────────────────────────────── */
.gain-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ── OKN Target Detail ───────────────────────────────────── */
#okn-target-detail {
  margin-top: 6px;
  padding: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
}

/* ── Tools Row ───────────────────────────────────────────── */
.tools-row {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.tool-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #888;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  padding: 0;
  line-height: 1;
}
.tool-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #ccc;
  border-color: rgba(255,255,255,0.25);
}

.tool-btn.proto-add-btn {
  background: rgba(25,118,210,0.15);
  border-color: rgba(46,125,209,0.35);
  color: #5a9fd4;
  width: 30px;
  height: 30px;
  font-size: 1.05rem;
  font-weight: 600;
}
.tool-btn.proto-add-btn:hover {
  background: rgba(25,118,210,0.28);
  color: #7ab8e8;
}

/* ── Timer Inline ────────────────────────────────────────── */
.timer-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-inline .duration-input {
  width: 56px;
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #ccc;
  font-size: 0.88rem;
  padding: 4px 5px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.timer-inline .duration-input::-webkit-outer-spin-button,
.timer-inline .duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.timer-inline .unit {
  font-size: 0.7rem;
  color: #555;
  letter-spacing: 0.05em;
}

/* ── Param Sub-label ─────────────────────────────────────── */
.param-sublabel {
  font-size: 0.6rem;
  color: #555;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

/* ── ABC Scale Overlay ───────────────────────────────────── */
#abc-overlay {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: rgba(8,8,8,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  z-index: 35;
}
#abc-overlay.visible { display: block; }

#abc-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.12s ease;
}
#abc-close:hover { color: #ccc; }

/* ── ABC Scale Items ─────────────────────────────────────── */
.abc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.abc-item:last-child { border-bottom: none; }
.abc-item-label {
  font-size: 0.82rem;
  color: #ccc;
  line-height: 1.4;
}
.abc-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.abc-item-controls input[type="range"] {
  flex: 1;
  accent-color: #2e7dd1;
}
.abc-value {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  min-width: 36px;
  text-align: right;
}

/* ── NRS PPPD Section (hidden until PPPD mode) ───────────── */
.nrs-pppd-section {
  display: none;
}
#nrs-modal.pppd-mode .nrs-pppd-section {
  display: flex;
}

/* ── NRS Symptom-Type Buttons ────────────────────────────── */
.nrs-symtype-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aaa;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.nrs-symtype-btn:hover { background: rgba(255,255,255,0.1); }
.nrs-symtype-btn.active {
  background: #1a3a5c;
  border-color: #2e7dd1;
  color: #fff;
}

/* ── Dosage Tracker ──────────────────────────────────────── */
.dosage-tracker { margin-top: 4px; min-width: 120px; }
.dosage-bar-wrap {
  height: 5px; background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden; margin-bottom: 3px;
}
.dosage-bar-fill {
  height: 100%; width: 0%; background: #2e7dd1;
  border-radius: 3px; transition: width 0.4s ease;
}
.dosage-bar-fill.warn { background: #ff9800; }
.dosage-bar-fill.done { background: #4caf50; }
.dosage-label { font-size: 0.65rem; color: rgba(255,255,255,0.5); }
.dosage-status { font-size: 0.62rem; margin-top: 1px; color: rgba(255,255,255,0.4); }

/* ── RSV Ceiling Note ────────────────────────────────────── */
.rsv-ceiling-note {
  font-size: 0.6rem; color: #555; margin-top: 2px;
  text-align: center; white-space: nowrap;
}

/* ── Metronome Hint ──────────────────────────────────────── */
.metronome-hint {
  font-size: 0.68rem; color: #888; margin-top: 4px;
  text-align: center;
}
.metronome-hint strong { color: #f1c40f; }

/* ── Canal Rehab Buttons ─────────────────────────────────── */
.canal-rehab-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #aaa; padding: 6px 10px; border-radius: 5px;
  cursor: pointer; font-size: 0.78rem; font-weight: 600;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  display: flex; flex-direction: column; align-items: center;
}
.canal-rehab-btn:hover { background: rgba(255,255,255,0.1); }
.canal-rehab-btn.active { background: #1a3a5c; border-color: #2e7dd1; color: #fff; }

.canal-paradigm-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  color: #aaa; padding: 4px 8px; border-radius: 5px; cursor: pointer; font-size: 0.78rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.canal-paradigm-btn:hover { background: rgba(255,255,255,0.1); }
.canal-paradigm-btn.active { background: #1a3a5c; border-color: #2e7dd1; color: #fff; }

/* DVA overlay — dark theme */
#dva-overlay {
  position: fixed; inset: 0;
  background: #0d0d0d;
  z-index: 100;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 24px 20px; box-sizing: border-box;
}
.dva-screen { width: 100%; max-width: 680px; margin: 0 auto; }
.dva-screen h2 { color: #fff; font-size: 1.4rem; margin-bottom: 8px; }
.dva-screen h3 { color: #e0e0e0; font-size: 1.1rem; }
.dva-subtitle  { color: #aaa; font-size: 0.88rem; margin-bottom: 20px; line-height: 1.5; }
.dva-canal-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.canal-pair-group { border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 12px; background: rgba(255,255,255,0.03); }
.canal-pair-label { font-size: 0.75rem; font-weight: 600; color: #888; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.canal-pair-row   { display: flex; gap: 10px; }
.dva-canal-btn {
  flex: 1; padding: 10px 6px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: all 0.15s;
}
.dva-canal-btn.selected { border-color: #1976d2; background: rgba(25,118,210,0.15); }
.dva-canal-btn .canal-abbr { font-size: 1.0rem; font-weight: 700; color: #fff; }
.dva-canal-btn .canal-full { font-size: 0.7rem; color: #bbb; }
.dva-canal-btn .canal-sub  { font-size: 0.6rem; color: #888; }
.dva-quick-select { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.dva-quick-select button {
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  color: #ccc; cursor: pointer; font-size: 0.78rem;
}
.dva-params { background: rgba(255,255,255,0.04); border-radius: 8px; padding: 12px; margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.08); }
.param-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.param-row label { font-size: 0.82rem; color: #bbb; flex: 1; }
.param-row input, .param-row select {
  width: 100px; padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: #1a1a1a; color: #fff;
}
.param-note { font-size: 0.72rem; color: #777; }
.dva-primary-btn {
  display: block; width: 100%; padding: 13px;
  background: #1976d2; color: white; border: none;
  border-radius: 8px; font-size: 0.95rem; cursor: pointer; margin-top: 14px;
}
.dva-primary-btn:disabled { background: #333; color: #666; cursor: not-allowed; }
.dva-back-btn {
  display: block; width: 100%; padding: 9px;
  background: transparent; color: #888;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; font-size: 0.85rem; cursor: pointer; margin-top: 8px;
}
.dva-back-btn:hover { color: #ccc; border-color: rgba(255,255,255,0.25); }
.dva-baseline-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dva-baseline-select-btn {
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  color: #ccc; cursor: pointer; font-size: 0.82rem;
}
.dva-baseline-select-btn.selected { background: #1976d2; color: white; border-color: #1976d2; }
.dva-selected-display { text-align: center; color: #4fc3f7; margin-bottom: 10px; font-size: 0.9rem; }
.dva-baseline-instruction { color: #bbb; font-size: 0.85rem; margin-bottom: 8px; }
/* Snellen chart area — KEEP WHITE for clinical validity */
.dva-baseline-chart-area {
  background: #ffffff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 20px 16px;
  margin-bottom: 16px;
}
.dva-chart-line-wrap {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px; padding: 2px 4px; border-radius: 4px;
}
.dva-chart-line-wrap.dva-selected-line {
  background: #e3f2fd; outline: 2px solid #1976d2; border-radius: 4px;
}
.dva-chart-line { display: block; white-space: nowrap; overflow: hidden; color: #000; }
.dva-chart-line-label { font-size: 11px; color: #999; font-family: sans-serif; min-width: 44px; text-align: right; flex-shrink: 0; }
.dva-instruction-block   { display: flex; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.dva-instruction-section {
  flex: 1; min-width: 200px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 10px;
}
.dva-instruction-section h4 { margin: 0 0 6px; color: #e0e0e0; font-size: 0.88rem; }
.dva-instruction-section p  { margin: 0; font-size: 0.83rem; color: #aaa; line-height: 1.5; }
.dva-clinical-note {
  background: rgba(255,152,0,0.1);
  border-left: 3px solid #ff9800;
  padding: 8px 12px; border-radius: 0 6px 6px 0;
  font-size: 0.80rem; color: #ffcc80; margin: 10px 0;
}
.dva-plane-badge { display: inline-block; background: rgba(25,118,210,0.25); color: #4fc3f7; padding: 3px 8px; border-radius: 10px; font-size: 0.75rem; margin-bottom: 10px; }
.dva-test-count { font-size: 0.80rem; color: #888; margin: 6px 0; }
/* Testing screen line display — white background for clinical validity */
.dva-line-display {
  width: 100%; background: #ffffff;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 24px 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 16px 0; min-height: 120px;
  box-sizing: border-box;
}
.dva-test-line {
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold; color: #000000;
  user-select: none; text-align: center;
  letter-spacing: 0.25em; line-height: 1;
  display: block;
}
.dva-test-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dva-test-instructions { text-align: center; margin-bottom: 12px; color: #aaa; font-size: 0.88rem; }
.dva-response-btns { display: flex; gap: 10px; }
.dva-resp-btn {
  flex: 1; padding: 18px 8px;
  border: none; border-radius: 10px;
  font-size: 1.05rem; font-weight: 700; cursor: pointer; letter-spacing: 0.5px;
}
.dva-resp-clear  { background: #2e7d32; color: #fff; }
.dva-resp-blur   { background: #b71c1c; color: #fff; }
.dva-thrust-counter { text-align: center; font-size: 0.82rem; color: #888; }
.dva-results-grid { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.dva-result-card { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 12px 14px; }
.dva-result-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dva-result-canal { font-weight: 700; font-size: 0.92rem; flex: 1; color: #e0e0e0; }
.dva-result-status { font-size: 0.82rem; font-weight: 600; }
.dva-result-details { display: flex; gap: 14px; font-size: 0.78rem; color: #888; }
.dva-deficit-summary { background: rgba(255,255,255,0.04); border-radius: 8px; padding: 12px; margin: 12px 0; font-size: 0.85rem; line-height: 1.6; color: #ccc; }
.dva-results-disclaimer { font-size: 0.75rem; color: #666; font-style: italic; line-height: 1.5; margin-bottom: 12px; }
.dva-results-actions { display: flex; flex-direction: column; gap: 6px; }
.dva-objective-score { text-align: center; font-size: 1.0rem; margin: 10px 0; color: #e0e0e0; }
.dva-progress-bar { height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-bottom: 16px; }

/* ── VOR Direction Buttons (canal-specific) ──────────────── */
.vor-dir-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  min-width: 64px;
}
.dir-abbr {
  font-weight: 700;
  font-size: 0.85rem;
}
.dir-label {
  font-size: 0.65rem;
  text-align: center;
  line-height: 1.2;
  color: rgba(255,255,255,0.75);
}
.vor-dir-btn.active .dir-label { color: #fff; }

/* ── Canal Direction Hint ────────────────────────────────── */
.canal-dir-hint {
  font-size: 0.75rem;
  color: #4fc3f7;
  margin-top: 4px;
  padding: 4px 0;
}

/* ── Menu Card Icon/Title/Subtitle (DVA card) ────────────── */
.menu-card-icon {
  font-size: 2rem;
  color: #4fc3f7;
  line-height: 1;
}
.menu-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.menu-card-subtitle {
  font-size: 0.65rem;
  color: #666;
  text-align: center;
}

/* ── Control Group layout fix ────────────────────────────── */
.control-group {
  transition: height 0.15s ease, opacity 0.15s ease;
}

/* ── Gain Interpretation Note ────────────────────────────── */
.gain-interp-note { font-size: 0.75rem; margin-top: 2px; }
.gain-interp-tf-ok    { color: #4caf50; }
.gain-interp-tf-vsm   { color: #4fc3f7; }
.gain-interp-tf-high  { color: #ff9800; }
.gain-interp-tf-error { color: #f44336; }
.gain-interp-tf-low   { color: #bdbdbd; }


.about-overlay {
  position: fixed; inset: 0;
  background: #0d0d0d;
  z-index: 200;
  flex-direction: column; overflow-y: auto; padding: 0;
}
.about-header {
  position: sticky; top: 0;
  background: #111; color: white;
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 10; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.about-header h2 { margin: 0; font-size: 1.05rem; color: #fff; }
.about-body { padding: 20px; max-width: 900px; margin: 0 auto; }
.about-body .info-section { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.about-body .info-section:last-child { border-bottom: none; }
.about-body .info-section h3 { font-size: 1.1rem; font-weight: 700; color: #e0e0e0; margin: 0 0 12px; letter-spacing: -0.01em; }
.about-body .info-section h4 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #555; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.about-body .info-section p { font-size: 0.88rem; color: #bbb; line-height: 1.75; margin: 0 0 12px; }
.about-body .info-section p:last-child { margin-bottom: 0; }
.about-body .info-section strong { color: #ddd; }
.about-body .info-section ul, .about-body .info-section ol { font-size: 0.88rem; color: #bbb; line-height: 1.75; padding-left: 20px; margin: 0 0 12px; }
.about-body .info-section li { margin-bottom: 4px; }
.about-toc {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.about-toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.about-toc-link {
  display: block;
  color: #4fc3f7;
  font-size: 0.82rem;
  text-decoration: none;
  padding: 3px 0;
  line-height: 1.4;
}
.about-toc-link:hover { color: #fff; text-decoration: underline; }
.about-toc-indent {
  padding-left: 16px;
  color: #8ab4d4;
  font-size: 0.78rem;
}
.about-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 18px; margin-bottom: 14px;
}
.about-section h3 {
  color: #fff; font-size: 1.0rem; margin: 0 0 10px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.about-section h4 { color: #4fc3f7; font-size: 0.9rem; margin: 12px 0 5px; }
.about-section p { font-size: 0.85rem; line-height: 1.6; color: #bbb; }
.about-section ul { font-size: 0.83rem; line-height: 1.7; color: #aaa; padding-left: 18px; }
.about-diag-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 14px; margin-bottom: 12px;
}
.about-diag-card h4 {
  margin-top: 0; font-size: 0.95rem; color: #e0e0e0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 8px; margin-bottom: 10px;
}
.about-diag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .about-diag-grid { grid-template-columns: 1fr; } }
.about-diag-card strong { color: #fff; font-size: 0.82rem; display: block; margin-top: 10px; margin-bottom: 3px; }
.about-table { width: 100%; border-collapse: collapse; font-size: 0.80rem; margin: 8px 0; }
.about-table th { background: rgba(255,255,255,0.08); padding: 6px 10px; text-align: left; font-weight: 600; color: #e0e0e0; }
.about-table td { padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; color: #bbb; }
.about-table-red th { background: rgba(183,28,28,0.25); color: #ef9a9a; }
.about-note {
  background: rgba(255,193,7,0.08);
  border-left: 3px solid #ffc107;
  padding: 8px 12px; border-radius: 0 6px 6px 0;
  font-size: 0.80rem; color: #ffe082; margin-top: 10px;
}
.about-refs { font-size: 0.72rem; color: #666; line-height: 1.8; }

/* ── About Page Tabs ────────────────────────────────────────── */
.about-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0;
}
.about-tab-btn {
  padding: 8px 20px;
  background: transparent;
  color: #888;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.about-tab-btn:hover { color: #ccc; }
.about-tab-btn.active { color: #4fc3f7; border-bottom-color: #4fc3f7; }
.about-tab-pane { display: none; }
.about-tab-pane.active { display: block; }

/* ── Functional Anatomy Page ────────────────────────────────── */

/* Intro section */
.anat-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.anat-intro-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #bbb;
  line-height: 1.6;
}
.anat-intro-card p { margin: 4px 0 8px; }
.anat-intro-icon { font-size: 1.4rem; margin-bottom: 4px; }
.anat-intro-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #81d4fa;
  margin-bottom: 6px;
}
.anat-intro-exp {
  background: rgba(79,195,247,0.06);
  border-left: 3px solid rgba(79,195,247,0.3);
  padding: 6px 10px;
  border-radius: 0 5px 5px 0;
  font-size: 0.78rem;
  color: #aaa;
  line-height: 1.5;
}
.anat-intro-qa {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
}
.anat-intro-q {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e0e0e0;
  margin: 12px 0 4px;
}
.anat-intro-q:first-child { margin-top: 0; }
.anat-intro-qa p {
  font-size: 0.82rem;
  color: #aaa;
  line-height: 1.6;
}

.anat-structure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.anat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #bbb;
}
.anat-card p { margin: 4px 0; }
.anat-card strong { color: #e0e0e0; }
.anat-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #81d4fa;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(79,195,247,0.2);
}
.anat-exercise-tag {
  margin-top: 8px;
  font-size: 0.74rem;
  color: #4fc3f7;
  background: rgba(79,195,247,0.08);
  border-radius: 4px;
  padding: 4px 8px;
  line-height: 1.5;
}

/* Anatomy diagnosis selector */
.anat-diag-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #e0e0e0;
  padding: 6px 10px;
  font-size: 0.84rem;
  width: 100%;
  max-width: 400px;
  cursor: pointer;
}
.anat-diag-panel {
  background: rgba(79,195,247,0.07);
  border: 1px solid rgba(79,195,247,0.25);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #bbb;
}
.anat-diag-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.anat-diag-section { color: #ccc; }
.anat-diag-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  margin: 2px 3px 2px 0;
}
.anat-diag-damaged {
  background: rgba(244,67,54,0.15);
  border: 1px solid rgba(244,67,54,0.3);
  color: #ef9a9a;
}

/* ── About Page: Symptom Profile Tables ─────────────────────── */
.about-profile-table {
  width: 100%; border-collapse: collapse; font-size: 0.77rem; margin: 10px 0;
}
.about-profile-table th {
  background: rgba(79,195,247,0.12); padding: 5px 8px;
  text-align: left; font-weight: 600; color: #90caf9;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}
.about-profile-table td {
  padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top; color: #bbb;
}
.about-profile-table tr:last-child td { border-bottom: none; }
.about-profile-table td:first-child { color: #e0e0e0; font-weight: 500; }

/* ── Symptom Checker ─────────────────────────────────────────── */
.checker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 800px) { .checker-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .checker-grid { grid-template-columns: 1fr; } }

.checker-col {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 12px;
}
.checker-cat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4fc3f7;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(79,195,247,0.2);
}
.checker-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 0.80rem;
  color: #bbb;
  cursor: pointer;
  line-height: 1.35;
}
.checker-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #4fc3f7;
}
.checker-item:hover { color: #e0e0e0; }

.checker-run-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: linear-gradient(135deg, #0288d1, #4fc3f7);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  transition: opacity 0.15s;
}
.checker-run-btn:hover { opacity: 0.88; }

.checker-result { display: none; }
.checker-matches { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.checker-match {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 16px;
}
.checker-match-top {
  border-color: rgba(79,195,247,0.35);
  background: rgba(79,195,247,0.07);
}
.checker-match-other { opacity: 0.85; }

.checker-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.checker-match-header strong { font-size: 0.92rem; color: #fff; }
.checker-match-score { font-size: 0.78rem; color: #4fc3f7; font-weight: 600; }

.checker-match-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(79,195,247,0.2);
  margin-bottom: 10px;
  overflow: hidden;
}
.checker-match-bar-fill {
  height: 100%;
  background: #4fc3f7;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.checker-protocol-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #81d4fa;
  margin: 10px 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.checker-steps {
  list-style: decimal;
  padding-left: 20px;
  font-size: 0.80rem;
  color: #bbb;
  line-height: 1.6;
  margin: 0;
}
.checker-steps li { margin-bottom: 3px; }

.checker-warning {
  background: rgba(255,193,7,0.08);
  border-left: 3px solid #ffc107;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 0.78rem;
  color: #ffe082;
  margin-top: 8px;
}

/* ── Protocol Builder Panel ──────────────────────────────────── */
#protocol-panel {
  position: fixed; inset: 0;
  background: #111;
  z-index: 150;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
}
.protocol-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.protocol-panel-title { font-size: 1.1rem; font-weight: 700; color: #fff; }
.protocol-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.proto-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 8px 10px;
  color: #fff; font-size: 0.85rem; width: 100%; box-sizing: border-box;
}
.protocol-step-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; min-height: 60px; }
.protocol-empty { color: #666; font-size: 0.85rem; text-align: center; padding: 24px 0; }
.proto-step {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 10px 12px;
}
.proto-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: #1976d2; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.proto-step-body { flex: 1; min-width: 0; }
.proto-step-label { font-size: 0.82rem; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proto-step-meta  { font-size: 0.72rem; color: #888; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.proto-sets-input {
  width: 44px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
  color: #fff; font-size: 0.72rem; text-align: center; padding: 2px 4px;
}
.proto-step-actions { display: flex; gap: 4px; flex-shrink: 0; }
.proto-move-up, .proto-move-down, .proto-remove {
  background: rgba(255,255,255,0.07); border: none;
  border-radius: 4px; color: #aaa; cursor: pointer;
  width: 24px; height: 24px; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.proto-remove:hover { background: rgba(183,28,28,0.4); color: #fff; }
.proto-action-row {
  display: flex; gap: 8px; margin-bottom: 0;
}
.proto-action-row .proto-btn-primary {
  flex: 1; margin-bottom: 8px;
}
.proto-btn-primary {
  display: block; width: 100%; padding: 12px;
  background: #1976d2; color: #fff; border: none;
  border-radius: 8px; font-size: 0.92rem; cursor: pointer; margin-bottom: 8px;
}
.proto-btn-small {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; color: #aaa; cursor: pointer; font-size: 0.78rem;
  padding: 4px 10px;
}
.proto-btn-back {
  display: block; width: 100%; padding: 10px;
  background: transparent; color: #666;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; font-size: 0.85rem; cursor: pointer;
}
.proto-add-btn:not(.tool-btn) {
  display: block; width: 100%; padding: 8px;
  background: rgba(25,118,210,0.2);
  border: 1px solid rgba(25,118,210,0.5);
  border-radius: 6px; color: #4fc3f7; cursor: pointer;
  font-size: 0.82rem; margin-top: 6px;
}
.color-input-wrap { display: flex; align-items: center; gap: 8px; }
.target-color-picker { width: 36px; height: 30px; border: 1px solid rgba(255,255,255,0.15); border-radius: 4px; cursor: pointer; background: transparent; padding: 2px; }
.target-color-hex { width: 80px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 4px; padding: 4px 8px; color: #fff; font-size: 0.82rem; font-family: monospace; }

.settings-toggle-btn {
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  font-size: 0.75rem;
  margin-bottom: 8px;
  text-align: left;
  transition: color 0.15s;
}
.settings-toggle-btn:hover { color: #ccc; }

/* ── Main menu bottom bar ──────────────────────────────────────── */
.menu-bottom-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; width: 100%; box-sizing: border-box;
  position: fixed; bottom: 0; left: 0;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.menu-util-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #ccc;
  cursor: pointer; font-size: 0.82rem;
}
.menu-util-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
/* ── Patient Mode Overlay ──────────────────────────────────────── */
#patient-mode-overlay {
  position: fixed; inset: 0; z-index: 180;
  flex-direction: column;
  pointer-events: none;
  background: transparent;
}
#patient-mode-overlay > * { pointer-events: auto; }
.patient-header {
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(12px);
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.patient-header-left { display: flex; flex-direction: column; }
.patient-protocol-name { font-size: 0.95rem; font-weight: 700; color: #fff; }
.patient-header-sub    { font-size: 0.72rem; color: #888; }
.pm-exit-btn {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; color: #aaa; cursor: pointer; font-size: 0.78rem;
  padding: 4px 10px;
}
.pm-status-bar {
  background: rgba(13,13,13,0.85);
  padding: 6px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pm-status-counter { font-size: 0.8rem; font-weight: 700; color: #ccc; }
.pm-status-total   { font-size: 0.75rem; color: #888; }
.pm-status-total span { color: #4fc3f7; font-weight: 700; font-variant-numeric: tabular-nums; }
.pm-exercise-card {
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  margin: 12px 12px 8px; border-radius: 12px;
  padding: 20px 18px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.pm-exercise-name { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.pm-sets-display  { font-size: 0.82rem; color: #888; margin-bottom: 8px; }
.pm-timer-display { font-size: 3rem; font-weight: 700; color: #4fc3f7; font-variant-numeric: tabular-nums; }
.pm-head-note {
  background: rgba(255,152,0,0.15);
  border-left: 3px solid #ff9800;
  margin: 0 12px; padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 0.80rem; color: #ffcc80;
}
.pm-controls {
  padding: 10px 12px;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 8px;
}
.pm-start-btn {
  display: block; width: 100%; padding: 16px;
  background: #2e7d32; color: #fff; border: none;
  border-radius: 10px; font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.pm-next-btn {
  display: block; width: 100%; padding: 12px;
  background: #1976d2; color: #fff; border: none;
  border-radius: 10px; font-size: 0.95rem; cursor: pointer;
}
.pm-done-btn {
  display: block; width: 100%; padding: 12px;
  background: #388e3c; color: #fff; border: none;
  border-radius: 10px; font-size: 0.95rem; cursor: pointer;
}
.pm-upcoming {
  background: rgba(13,13,13,0.88);
  padding: 10px 16px; margin-top: auto;
}
.pm-upcoming-label { font-size: 0.7rem; color: #666; margin-bottom: 6px; text-transform: uppercase; }
.pm-upcoming-step {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pm-upcoming-num  { font-size: 0.72rem; color: #666; min-width: 20px; }
.pm-upcoming-name { font-size: 0.80rem; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-complete-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}
.pm-complete-icon {
  font-size: 3rem;
  color: #4fc3f7;
  margin-bottom: 8px;
}
.pm-complete-sub {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ── Go / No-Go Test ─────────────────────────────────────── */
#gng-overlay {
  position: fixed; inset: 0;
  background: #0d0d0d;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}
.gng-screen { width: 100%; max-width: 600px; margin: 0 auto; }
.gng-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.gng-header h2 { color: #fff; margin: 0; margin-bottom: 8px; }
.gng-intro { color: #bbb; font-size: 0.88rem; line-height: 1.6; margin-bottom: 16px; }
.gng-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.gng-param label { font-size: 0.75rem; color: #888; display: block; margin-bottom: 4px; }
.gng-clinical-note { background: rgba(255,193,7,0.08); border-left: 3px solid #ffc107; padding: 10px 12px; border-radius: 0 6px 6px 0; font-size: 0.80rem; color: #ffe082; margin-bottom: 14px; }
.gng-trial-bar { font-size: 0.78rem; color: #888; margin-bottom: 8px; }
.gng-trial-bar-inner { display: block; height: 3px; background: #1976d2; border-radius: 2px; margin-top: 4px; transition: width 0.2s; }
.gng-stimulus-area { width: 100%; min-height: 300px; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); user-select: none; }
.gng-fixation { font-size: 3rem; color: #fff; font-weight: 300; display: flex; align-items: center; justify-content: center; width: 100%; height: 300px; }
.gng-stimulus { width: 180px; height: 180px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: #fff; box-shadow: 0 0 40px rgba(255,255,255,0.2); }
.gng-feedback { width: 100%; height: 300px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.gng-abort-row { position: sticky; bottom: 0; background: #0d0d0d; padding: 12px 0 8px; display: flex; gap: 8px; justify-content: center; z-index: 2; }
.gng-results-body { margin-bottom: 16px; }
.gng-results-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.gng-result-tile { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 12px; text-align: center; }
.grt-value { font-size: 1.3rem; font-weight: 700; color: #fff; }
.grt-label { font-size: 0.72rem; color: #888; margin-top: 2px; }
.grt-norm  { font-size: 0.65rem; color: #555; margin-top: 2px; }
.gng-flags { background: rgba(244,67,54,0.08); border: 1px solid rgba(244,67,54,0.2); border-radius: 8px; padding: 12px; margin-top: 8px; }
.gng-flags-ok { background: rgba(76,175,80,0.08); border-color: rgba(76,175,80,0.2); }
.gng-flags-title { font-size: 0.80rem; font-weight: 700; color: #ef9a9a; margin-bottom: 6px; }
.gng-flags-ok .gng-flags-title { color: #a5d6a7; }
.gng-flag-item { font-size: 0.78rem; color: #ffcdd2; margin-bottom: 4px; line-height: 1.4; }
@media (max-width: 480px) { .gng-results-grid { grid-template-columns: 1fr 1fr; } }

/* ── GNG Info Overlay ─────────────────────────────────────── */
#gng-info-overlay {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(660px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: rgba(8,8,8,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  z-index: 300;
}
.gng-norm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 10px 0;
}
.gng-norm-table th {
  background: rgba(255,255,255,0.08);
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: #e0e0e0;
}
.gng-norm-table td {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #bbb;
  vertical-align: top;
}
.gng-norm-table tr:last-child td { border-bottom: none; }
#gng-info-body .info-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#gng-info-body .info-section:last-child { border-bottom: none; }
#gng-info-body h4 {
  color: #4fc3f7;
  font-size: 0.92rem;
  margin: 0 0 8px;
}
#gng-info-body ul { padding-left: 18px; margin: 6px 0; }
#gng-info-body li { color: #bbb; font-size: 0.83rem; line-height: 1.6; margin-bottom: 3px; }

/* ── GNG Mode Select ─────────────────────────────────────────── */
.gng-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.gng-mode-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.gng-mode-card:hover { background: rgba(255,255,255,0.1); border-color: rgba(79,195,247,0.4); }
.gmc-icon { font-size: 2rem; margin-bottom: 8px; }
.gmc-title { font-size: 1rem; font-weight: 700; color: #e0e0e0; margin-bottom: 6px; }
.gmc-desc  { font-size: 0.8rem; color: #888; line-height: 1.5; }
.gng-mode-icon { margin-bottom: 10px; }
.gng-mode-title { font-size: 1.2rem; font-weight: 700; color: #e0e0e0; }

/* ── GNG Profile Result (in results screen) ──────────────────── */
.gng-profile-result {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  text-align: center;
}
.gng-profile-result-label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.gng-profile-result-name  { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.gng-profile-result-sub   { font-size: 0.82rem; color: #aaa; }

/* ── GNG Rehab Select ────────────────────────────────────────── */
.gng-profile-banner {
  text-align: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 12px;
  background: #666;
}
.gng-profile-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.gng-profile-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.gng-profile-card:hover { background: rgba(255,255,255,0.08); }
.gpc-name { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.gpc-desc { font-size: 0.75rem; color: #888; line-height: 1.4; }

.gng-rehab-levels {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.gng-level-card {
  flex: 1 1 80px;
  min-width: 80px;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.gng-level-card:hover { background: rgba(255,255,255,0.09); }
.gng-level-card-active { border-color: #4fc3f7 !important; background: rgba(79,195,247,0.1) !important; }
.glc-level     { font-size: 0.9rem; font-weight: 700; color: #e0e0e0; margin-bottom: 4px; }
.glc-criterion { font-size: 0.72rem; color: #4caf50; margin-bottom: 3px; }
.glc-detail    { font-size: 0.68rem; color: #777; }

/* ── GNG Rehab Session ───────────────────────────────────────── */
.gng-rehab-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #aaa;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.grp-level { font-weight: 700; color: #4fc3f7; }
.gng-rehab-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.gng-rehab-progress-bar {
  height: 100%;
  background: #4fc3f7;
  border-radius: 3px;
  transition: width 0.3s;
}
.gng-rehab-instruction {
  font-size: 0.88rem;
  color: #ccc;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  text-align: center;
}
.gng-rehab-criterion-disp {
  font-size: 0.78rem;
  color: #4caf50;
  text-align: center;
  margin-bottom: 10px;
}
.gng-live-perf {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 0.8rem;
  color: #888;
  margin-top: 10px;
  flex-wrap: wrap;
}
.gng-live-perf strong { color: #e0e0e0; }

.gng-block-complete {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 32px 24px;
  z-index: 10;
}
.gbc-title  { font-size: 1.1rem; font-weight: 700; color: #e0e0e0; margin-bottom: 12px; }
.gbc-result { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
#gng-screen-rehab { position: relative; }

/* ── Video Export Modal ───────────────────────────────────────── */
#vid-export-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.vid-export-modal {
  background: #111;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 24px;
  width: min(460px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.vid-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.vid-modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0e0e0;
  margin: 0;
}
.vid-close-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.vid-close-btn:hover { color: #ccc; background: rgba(255,255,255,0.06); }
.vid-intro {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 16px;
  line-height: 1.5;
}
.vid-mode-display {
  font-size: 0.88rem;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.vid-params {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.vid-param { display: flex; flex-direction: column; gap: 4px; }
.vid-param label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}
.vid-format-row { margin-bottom: 6px; }
.vid-fmt-status {
  font-size: 0.8rem;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  line-height: 1.5;
}
.vid-rec-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f44336;
  text-align: center;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  animation: vid-blink 1s step-end infinite;
}
@keyframes vid-blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
.vid-progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}
.vid-progress-bar {
  height: 100%;
  background: #f44336;
  border-radius: 5px;
  transition: width 0.2s linear;
}
.vid-elapsed {
  text-align: center;
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.vid-rec-note {
  font-size: 0.75rem;
  color: #555;
  text-align: center;
  margin: 0;
}
.vid-status-msg {
  text-align: center;
  font-size: 0.92rem;
  color: #e0e0e0;
  padding: 20px 0;
  line-height: 1.6;
}

.nrs-symptom-examples { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin:6px 0; }
.nrs-sym { background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15); border-radius:12px; padding:2px 10px; font-size:0.72rem; color:#bbb; }
