:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --text: #e8eef7;
  --muted: #8fa3bf;
  --accent: #3b82f6;
  --accent2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #2d3f58;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  isolation: isolate;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 901px) {
  .header-inner--compact {
    flex-wrap: nowrap;
  }

  .header-controls {
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.35rem;
  }

  .header-exercise-select {
    flex: 1 1 auto;
    max-width: 220px;
    min-width: 108px;
  }

  .header-app-mode-select {
    min-width: 100px;
    max-width: 120px;
  }

  .header-controls .btn {
    white-space: nowrap;
  }
}

.header-inner--compact {
  align-items: center;
}

.header-brand {
  flex: 0 1 auto;
  min-width: 0;
}

.header-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  white-space: nowrap;
}

.header-tagline {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 1 1 320px;
  min-width: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.header-exercise-select {
  flex: 1 1 200px;
  max-width: 300px;
  min-width: 160px;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.48rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.header-app-mode-select {
  flex: 0 1 auto;
  min-width: 118px;
  max-width: 160px;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.48rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}

.btn-warmup {
  white-space: nowrap;
}

.wellness-disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.2rem 1.25rem 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.25;
}

body.app-mode-research .wellness-only {
  display: none !important;
}

body.app-mode-wellness .research-only {
  display: none !important;
}

body.app-mode-research .video-rep-hud__line--mode {
  display: block;
}

body.app-mode-wellness .video-rep-hud__line--mode {
  display: none;
}

body.app-mode-research .btn-warmup {
  display: none;
}

.header-exercise-select:hover {
  border-color: var(--accent);
}

.header-exercise-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  filter: brightness(1.12);
  border-color: var(--accent);
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.btn-icon {
  min-width: 2.5rem;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  font-size: 1rem;
}

#btnVoiceCoach.is-active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
}

#btnVoiceCoach:not(.is-active) {
  opacity: 0.55;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface2);
}

.btn-ghost {
  background: transparent;
}

/** Підсвітка кнопки після Page Up / Page Down (презентер), ~2 с */
#btnCalibrate.is-presenter-flash {
  animation: presenter-flash-pbm 2s ease-out;
}

#btnReset.is-presenter-flash {
  animation: presenter-flash-reset 2s ease-out;
}

@keyframes presenter-flash-pbm {
  0%,
  100% {
    box-shadow: none;
    border-color: var(--border);
  }
  12%,
  88% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.55), 0 0 18px rgba(59, 130, 246, 0.35);
    border-color: var(--accent);
  }
}

@keyframes presenter-flash-reset {
  0%,
  100% {
    box-shadow: none;
    border-color: var(--border);
  }
  12%,
  88% {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.55), 0 0 18px rgba(34, 197, 94, 0.35);
    border-color: var(--accent2);
  }
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
}

.video-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
}

#video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
  background: #111;
}

.video-wrap--off #video {
  opacity: 0;
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

.status-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.status-badge.ok {
  background: rgba(34, 197, 94, 0.85);
}

.status-badge.warn {
  background: rgba(245, 158, 11, 0.85);
}

.video-rep-hud {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 4;
  max-width: min(12rem, calc(100% - 1.5rem));
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(143, 163, 191, 0.45);
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.35;
}

.video-rep-hud.is-hidden {
  display: none;
}

.video-rep-hud__line {
  margin: 0;
  color: #e2e8f0;
  font-weight: 600;
  white-space: nowrap;
}

.video-rep-hud__line + .video-rep-hud__line {
  margin-top: 0.2rem;
  font-weight: 500;
  color: #94a3b8;
}

.video-rep-hud__line--mode {
  margin-top: 0.3rem;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  width: fit-content;
  max-width: 100%;
}

.video-rep-hud__line--mode-a {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.28);
  border: 1px solid rgba(251, 191, 36, 0.55);
}

.video-rep-hud__line--mode-b {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.55);
}

.video-rep-hud__line--limb {
  font-weight: 600;
  color: #a7f3d0;
}

.video-rep-hud__line--limb.is-hidden {
  display: none;
}

.limb-profile {
  margin-top: 0;
}

.video-overlay-toggles {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: calc(100% - 1.5rem);
  pointer-events: none;
}

.video-overlay-toggle {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 163, 191, 0.55);
  background: rgba(8, 12, 18, 0.72);
  color: #c5d4e8;
  font: 600 0.78rem "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}

.video-overlay-toggle:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.22);
}

.video-overlay-toggle.is-active {
  background: rgba(59, 130, 246, 0.88);
  color: #eff6ff;
  border-color: transparent;
}

#btnRomAngleOverlay.is-active {
  background: rgba(245, 158, 11, 0.88);
  color: #1a1205;
  border-color: transparent;
}

#btnLevelZones.is-active {
  background: rgba(52, 211, 153, 0.88);
  color: #052e1e;
  border-color: transparent;
}

#btnLevelZones:hover {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.2);
}

#btnRomBreakdown.is-active {
  background: rgba(251, 191, 36, 0.9);
  color: #1a1205;
  border-color: transparent;
}

#btnRomBreakdown:hover {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.2);
}

#btnRomAngleOverlay:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
}

.video-overlay-toggle:not(.is-active) {
  opacity: 0.78;
}

.video-overlay-toggle[hidden] {
  display: none;
}

.video-dt-level {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.2rem 0.35rem 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 163, 191, 0.55);
  background: rgba(8, 12, 18, 0.72);
  pointer-events: auto;
  cursor: default;
}

.video-dt-level.is-disabled {
  opacity: 0.5;
}

.video-dt-level__tag {
  font: 700 0.72rem "Segoe UI", system-ui, sans-serif;
  color: #94a3b8;
  line-height: 1;
}

.video-dt-level__select {
  margin: 0;
  padding: 0.12rem 0.35rem 0.12rem 0.2rem;
  min-width: 2.1rem;
  border: none;
  border-radius: 4px;
  background-color: #1e293b;
  color: #f8fafc;
  font: 700 0.78rem "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  accent-color: #2563eb;
}

.video-dt-level__select option {
  background-color: #1e293b;
  color: #f8fafc;
}

.video-dt-level__select:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.75);
  outline-offset: 1px;
}

.video-dt-level:not(.is-disabled):hover .video-dt-level__select {
  background-color: #0f172a;
  color: #ffffff;
}

.video-dt-level__select:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  background-color: #334155;
  color: #cbd5e1;
}

.video-dt-level:not(.is-disabled):hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.18);
}

.dual-task {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 0.65rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  pointer-events: auto;
}

.dual-task.is-hidden {
  display: none;
}

.dual-task-tag {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.85);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dual-task-prompt {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.dual-task-acc {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
}

.dual-task-pad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.25rem;
  max-width: 420px;
}

.dual-task-digit {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.35rem 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(26, 35, 50, 0.92);
  color: #fff;
  cursor: pointer;
}

.dual-task-digit:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.35);
}

.dual-task-digit:active {
  transform: scale(0.96);
}

.guide-details {
  margin-top: 0.85rem;
}

.guide-summary {
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0;
  user-select: none;
}

.guide-summary:hover {
  color: var(--text);
}

.guide-details[open] .guide-summary {
  margin-bottom: 0.35rem;
  color: var(--accent2);
}

.camera-guide {
  margin-top: 0.5rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
}

.camera-guide .guide-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}

.camera-guide .guide-figures {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.camera-guide .guide-figures--count-1 {
  justify-content: center;
}

.camera-guide .guide-figures--count-1 .guide-figure {
  flex: 0 1 auto;
  width: min(420px, 78%);
}

.camera-guide .guide-figures--count-2 .guide-figure {
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(50% - 0.35rem);
}

.camera-guide .guide-figures--count-3 .guide-figure {
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(33.333% - 0.45rem);
}

.camera-guide .guide-figure {
  margin: 0;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  text-align: center;
}

.camera-guide .guide-figure__img {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

/* 1 малюнок — повний розмір пресету */
.camera-guide .guide-figures--count-1 .guide-figure--s .guide-figure__img {
  max-height: 120px;
}

.camera-guide .guide-figures--count-1 .guide-figure--m .guide-figure__img {
  max-height: 180px;
}

.camera-guide .guide-figures--count-1 .guide-figure--l .guide-figure__img {
  max-height: 260px;
}

/* 2 малюнки — трохи компактніше, щоб вміститись в один ряд */
.camera-guide .guide-figures--count-2 .guide-figure--s .guide-figure__img {
  max-height: 100px;
}

.camera-guide .guide-figures--count-2 .guide-figure--m .guide-figure__img {
  max-height: 150px;
}

.camera-guide .guide-figures--count-2 .guide-figure--l .guide-figure__img {
  max-height: 210px;
}

/* 3 положення в ряд — ще компактніше */
.camera-guide .guide-figures--count-3 .guide-figure--s .guide-figure__img {
  max-height: 88px;
}

.camera-guide .guide-figures--count-3 .guide-figure--m .guide-figure__img {
  max-height: 120px;
}

.camera-guide .guide-figures--count-3 .guide-figure--l .guide-figure__img {
  max-height: 170px;
}

@media (max-width: 540px) {
  .camera-guide .guide-figures {
    gap: 0.45rem;
  }

  .camera-guide .guide-figures--count-2 .guide-figure,
  .camera-guide .guide-figures--count-3 .guide-figure {
    max-width: none;
  }

  .camera-guide .guide-figures--count-2 .guide-figure--m .guide-figure__img {
    max-height: 120px;
  }

  .camera-guide .guide-figures--count-3 .guide-figure--m .guide-figure__img {
    max-height: 96px;
  }
}

.camera-guide .guide-distance {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}

.camera-guide .guide-section {
  margin-bottom: 0.85rem;
}

.camera-guide .guide-section:last-child {
  margin-bottom: 0;
}

.camera-guide .guide-heading {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: var(--accent2);
  font-weight: 600;
}

.camera-guide .guide-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.camera-guide .guide-list li {
  margin-bottom: 0.3rem;
}

.camera-guide .guide-list li:last-child {
  margin-bottom: 0;
}

.camera-guide strong {
  color: var(--text);
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.65rem 0 0;
}

.metrics-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.metrics-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metrics-panel__heading {
  margin: 0 0 0.55rem;
}

.exercise-panel-head {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent2) 62%, var(--border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent2) 24%, var(--surface2)),
    color-mix(in srgb, var(--accent2) 11%, var(--surface))
  );
  box-shadow:
    inset 4px 0 0 var(--accent2),
    0 0 20px color-mix(in srgb, var(--accent2) 12%, transparent);
}

.exercise-panel-head__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #86efac;
  text-transform: none;
  letter-spacing: 0.01em;
}

.exercise-panel-head .exercise-illustration {
  margin: 0.55rem 0 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.28rem 1rem;
  margin: 0;
}

.metrics-grid dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.metrics-grid dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.metrics-grid dd.highlight {
  color: var(--warn);
  font-size: 1.1rem;
}

.metrics-grid dd.distance-ok {
  color: var(--accent2);
}

.metrics-grid dd.distance-soft {
  color: var(--muted);
  font-weight: 500;
}

.metrics-grid dd.distance-warn {
  color: var(--warn);
}

.metrics-grid dd.posture-off {
  color: var(--muted);
  font-weight: 500;
}

.metrics-grid dd.posture-ok {
  color: #6ee7b7;
}

.metrics-grid dd.posture-warn {
  color: #fbbf24;
}

.metrics-panel__divider {
  margin: 0.55rem 0 0.5rem;
  border: none;
  border-top: 1px solid var(--border);
  opacity: 0.85;
}

.exercise-hint-wrap {
  margin: 0 0 0.45rem;
}

.exercise-hint {
  margin: 0;
  font-size: 0.88rem;
  display: grid;
  grid-template-rows: 1.25em 1.25em;
  gap: 0.25rem;
  height: calc(2 * 1.25em + 0.25rem);
  overflow: hidden;
  box-sizing: content-box;
}

.exercise-hint-details {
  margin-top: 0.25rem;
  padding: 0.32rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 0.8rem;
}

.exercise-hint-details[hidden] {
  display: none;
}

.exercise-hint-details__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--accent2);
  user-select: none;
  list-style: none;
}

.exercise-hint-details__summary::-webkit-details-marker {
  display: none;
}

.exercise-hint-details__summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.exercise-hint-details[open] .exercise-hint-details__summary::before {
  transform: rotate(90deg);
}

.exercise-hint-full {
  margin: 0.35rem 0 0;
  padding: 0.2rem 0.35rem 0.2rem 0;
  max-height: calc(0.8rem * 1.4 * 5);
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.4;
  font-size: 0.8rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent2) 45%, var(--border)) transparent;
}

.exercise-hint-full::-webkit-scrollbar {
  width: 5px;
}

.exercise-hint-full::-webkit-scrollbar-track {
  background: transparent;
}

.exercise-hint-full::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent2) 40%, var(--border));
  border-radius: 4px;
}

.exercise-hint-details[open] .exercise-hint-full {
  height: calc(0.8rem * 1.4 * 5);
}

.exercise-hint__line {
  display: block;
  margin: 0;
  line-height: 1.25em;
  min-height: 1.25em;
  max-height: 1.25em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Один довгий текст (до PBM): два рядки в тому ж блоці */
.exercise-hint:not(.has-secondary) .exercise-hint__line:first-child {
  grid-row: 1 / span 2;
  min-height: calc(2 * 1.25em + 0.25rem);
  max-height: calc(2 * 1.25em + 0.25rem);
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.exercise-hint__line--sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.exercise-hint__line--sub.is-placeholder {
  visibility: hidden;
}

.rep-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.rep-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rep-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.rep-bar strong {
  font-variant-numeric: tabular-nums;
}

.progress-wrap--session {
  opacity: 0.85;
}

.progress-fill--session {
  background: var(--accent);
}

.session-complete {
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent2);
}

.session-complete.is-hidden {
  display: none;
}

.level-hint {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.level-hint--info {
  color: var(--muted);
}

.level-hint--almost {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

.level-hint--warn {
  color: var(--text);
  border-color: var(--warn);
  background: rgba(245, 158, 11, 0.1);
}

.level-hint--success {
  color: var(--accent2);
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.session-summary li#sLevelAdapt {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.study-mode {
  margin: 0 0 0.38rem;
  padding: 0.32rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  font-size: 0.8rem;
}

.study-mode__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--text);
  user-select: none;
  list-style: none;
}

.study-mode__summary::-webkit-details-marker {
  display: none;
}

.study-mode__field {
  margin: 0.38rem 0 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.study-mode__option {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  cursor: pointer;
  line-height: 1.25;
  font-size: 0.8rem;
}

.study-mode__option input {
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.study-mode:not([open]) .study-mode-hint {
  display: none;
}

.study-mode-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.session-limit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  min-width: 0;
}

.session-limit--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.5rem;
  margin-bottom: 0.5rem;
}

.session-limit--inline .session-limit-hint {
  flex: 0 0 100%;
}

.session-limit label {
  color: var(--muted);
}

.session-limit input.participant-id-input {
  width: min(100%, 7.5rem);
  letter-spacing: 0.02em;
}

.session-limit input {
  width: 4rem;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}

.session-limit input:disabled {
  opacity: 0.55;
}

.session-limit-hint {
  display: block;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.progress-wrap {
  height: 8px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.25s ease;
}

.ramm-score {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent2);
}

.ramm-verdict {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.wellness-recommendations {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
}

.wellness-recommendations h3 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wellness-rec-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text);
}

.wellness-rec-list li + li {
  margin-top: 0.35rem;
}

.wellness-progress {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  padding: 0.5rem 0.65rem;
}

.wellness-progress__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.wellness-progress__body {
  margin-top: 0.5rem;
  overflow-x: auto;
}

.wellness-progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.wellness-progress-table th,
.wellness-progress-table td {
  padding: 0.25rem 0.35rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.wellness-progress-table th {
  color: var(--muted);
  font-weight: 600;
}

.wellness-progress-empty,
.wellness-progress-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.wellness-progress-note {
  margin-top: 0.4rem;
}

.wellness-recommendations.is-hidden {
  display: none;
}

.session-summary {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.session-summary h3 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.session-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.session-summary li {
  margin: 0.18rem 0;
  font-size: 0.85rem;
}

.session-export {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-report {
  border: 1px solid #2563eb;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 50%, #6366f1 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}

.btn-report:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-report:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.log-details {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.event-log {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  max-height: 120px;
  overflow: auto;
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.boot-status {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.boot-status.boot-ok {
  color: var(--accent2);
}

.boot-status.boot-error {
  color: var(--danger);
  font-weight: 600;
}

.file-protocol-banner {
  margin: 0;
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 2px solid var(--danger);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.file-protocol-banner strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #fecaca;
}

.file-protocol-banner p {
  margin: 0.35rem 0;
}

.file-protocol-banner ol {
  margin: 0.5rem 0 0.5rem 1.2rem;
  padding: 0;
}

.file-protocol-banner code {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.is-file-protocol .layout {
  opacity: 0.45;
  pointer-events: none;
}

.btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
}

.modal.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.modal-header {
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
}

.modal-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--text);
}

.modal-subtitle--muted {
  color: var(--muted);
}

.modal-footer__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.modal-footer__actions {
  display: flex;
  gap: 0.55rem;
}

.editor-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.editor-modal__controls,
.editor-modal__preview {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
  padding: 1rem;
}

.editor-validation {
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  font-size: 0.88rem;
  line-height: 1.35;
  min-height: calc(2 * 1.35em + 1.4rem);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.editor-validation.editor-validation--info {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: var(--text);
}

.editor-validation.is-hidden {
  visibility: hidden;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-global-group,
.editor-level-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.22);
  padding: 0.9rem;
}

.editor-global-group h3 {
  margin: 0 0 0.75rem;
  font-size: 0.96rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.editor-level-group__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.editor-level-group__title strong {
  font-size: 1rem;
}

.editor-level-group__title span {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.editor-field:last-child {
  margin-bottom: 0;
}

.editor-field__label {
  font-size: 0.86rem;
  color: var(--text);
}

.editor-field__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.editor-range {
  width: 100%;
  accent-color: var(--accent);
}

.editor-field__value {
  min-width: 4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.editor-field__hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.editor-preview__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-preview__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.editor-preview__metrics div {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.26);
  padding: 0.7rem;
}

.editor-preview__metrics dt {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.editor-preview__metrics dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.editor-preview__status {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.1);
  color: var(--text);
  line-height: 1.35;
  height: calc(2 * 1.35em + 1.5rem);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.editor-preview__levels {
  display: grid;
  gap: 0.7rem;
}

.editor-level-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.24);
  padding: 0.8rem 0.9rem;
}

.editor-level-card.is-match {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.12);
}

.editor-level-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.editor-level-card__head span,
.editor-level-card__hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.editor-level-card__text {
  margin: 0 0 0.2rem;
  font-weight: 600;
}

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

  .header-inner--compact {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .header-title {
    white-space: normal;
  }

  .header-controls {
    justify-content: flex-start;
    flex: 1 1 auto;
  }

  .header-exercise-select {
    flex: 1 1 100%;
    max-width: none;
  }

  .editor-modal__body {
    grid-template-columns: 1fr;
  }

  .editor-level-grid {
    grid-template-columns: 1fr;
  }

  .editor-preview__metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .session-limit input {
    width: 100%;
    max-width: 5rem;
  }

  .header-controls .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.85rem;
  }

  #btnStart {
    flex: 1 1 100%;
  }

  .modal-header,
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer__actions {
    justify-content: stretch;
  }

  .modal-footer__actions .btn {
    flex: 1 1 auto;
  }

  #btnExerciseEditor {
    flex: 0 0 auto;
    min-width: 2.8rem;
  }

  .video-overlay-toggles {
    right: 0.5rem;
    bottom: 0.5rem;
  }
}

.settings-modal {
  width: min(920px, calc(100vw - 2rem));
}

.settings-modal__tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 1.15rem 0;
  border-bottom: 1px solid var(--border);
}

.settings-tab {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font: inherit;
}

.settings-tab.is-active {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border);
}

.settings-modal__body {
  padding: 1rem 1.15rem 1.15rem;
}

.settings-status {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.settings-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(52vh, 520px);
  overflow: auto;
}

.settings-name-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.4fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.settings-name-row__id {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.settings-name-row__default {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text);
}

.settings-name-row__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-name-row__label {
  font-size: 0.82rem;
  color: var(--muted);
}

.settings-name-row__input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.settings-name-row__reset {
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 0.25rem 0.55rem;
}

.settings-placeholder {
  margin: 0;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: var(--surface2);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .settings-name-row {
    grid-template-columns: 1fr;
  }
}

.settings-instructions-note {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.settings-publish-status {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.settings-publish-download {
  margin-bottom: 1rem;
}

.settings-publish-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.settings-publish-steps li {
  margin-bottom: 0.35rem;
}

.settings-instructions-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.settings-instructions-pick__label {
  font-size: 0.9rem;
  color: var(--text);
}

.settings-instructions-pick__select {
  min-width: min(100%, 320px);
  flex: 1 1 220px;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.settings-instructions-defaults {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: grid;
  gap: 0.45rem;
}

.settings-instructions-defaults dt {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.settings-instructions-defaults dd {
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text);
}

.settings-instructions-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-field__label {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 600;
}

.settings-field__textarea,
.settings-field__input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.settings-image-preview {
  margin-top: 0.85rem;
  padding: 0.65rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.settings-image-preview__label {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.settings-image-preview__img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.settings-reset-exercise {
  margin-top: 1rem;
}

.settings-guide-defaults {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.settings-guide-defaults__summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.settings-guide-defaults__body {
  margin-top: 0.65rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.settings-guide-defaults__title {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-weight: 600;
}

.settings-guide-defaults__image {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-guide-defaults__section + .settings-guide-defaults__section {
  margin-top: 0.55rem;
}

.settings-guide-defaults__heading {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-weight: 600;
}

.settings-guide-defaults__list {
  margin: 0;
  padding-left: 1.1rem;
}

.settings-guide-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.85rem 0;
}

.settings-guide-section {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.settings-guide-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-guide-section__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-guide-section__remove {
  min-width: 2rem;
  padding: 0.15rem 0.45rem;
  font-size: 1.1rem;
  line-height: 1;
}

.settings-guide-section__items-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.settings-guide-images-wrap {
  margin: 0.85rem 0;
}

.settings-guide-images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.settings-guide-images {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-guide-image-row {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-guide-image-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-guide-image-row__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-guide-image-row__remove {
  min-width: 2rem;
  padding: 0.15rem 0.45rem;
  font-size: 1.1rem;
  line-height: 1;
}

.settings-guide-image-row__size-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.settings-guide-image-row__preview {
  margin-top: 0.25rem;
}

.settings-guide-add-image:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.settings-guide-image-row__preview-figure {
  margin: 0;
}

.settings-guide-image-row__preview-figure .guide-figure__img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.settings-guide-image-row__preview-figure.guide-figure--s .guide-figure__img {
  max-height: 72px;
}

.settings-guide-image-row__preview-figure.guide-figure--m .guide-figure__img {
  max-height: 108px;
}

.settings-guide-image-row__preview-figure.guide-figure--l .guide-figure__img {
  max-height: 156px;
}

.settings-guide-live-preview-wrap {
  margin: 1rem 0 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.settings-guide-live-preview__label {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-guide-live-preview {
  max-height: min(52vh, 520px);
  overflow: auto;
}

.settings-guide-live-preview__empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.settings-guide-add-section {
  margin-bottom: 0.35rem;
}

.exercise-illustration {
  margin: 0.5rem 0 0.75rem;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  text-align: center;
}

.exercise-illustration__img {
  display: block;
  max-width: 100%;
  max-height: 160px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.settings-mediapipe-active {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text);
}

.settings-pose-model {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.settings-pose-model__legend {
  padding: 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.settings-pose-model__options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.settings-pose-model__option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  cursor: pointer;
}

.settings-pose-model__radio {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.settings-pose-model__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-pose-model__title {
  font-size: 0.92rem;
  color: var(--text);
}

.settings-pose-model__note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-mediapipe-guide {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.settings-mediapipe-guide__summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.settings-mediapipe-guide__body {
  padding: 0 1rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  max-height: min(42vh, 360px);
  overflow: auto;
}

.settings-mediapipe-guide__heading {
  margin: 1rem 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.settings-mediapipe-guide__heading:first-child {
  margin-top: 0.25rem;
}

.settings-mediapipe-guide__list {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.settings-mediapipe-guide__list--ordered {
  list-style: decimal;
}

.settings-mediapipe-guide__body p {
  margin: 0.35rem 0 0;
}
