:root {
  color-scheme: light;
  --bg: #d5c6e4;
  --panel: #fff9fc;
  --panel-soft: #fcf3f9;
  --text: #222027;
  --muted: #7d6d8f;
  --inactive: #b6aec2;
  --line: #e6cfea;
  --blue: #4aa0d8;
  --green: #2f9f73;
  --amber: #b77a20;
  --red: #be535b;
  --red-soft: #a178ff;
  --accent: #8b5cf6;
  --accent-soft: #efe6ff;
}

@property --orb-r {
  syntax: "<number>";
  inherits: true;
  initial-value: 139;
}

@property --orb-g {
  syntax: "<number>";
  inherits: true;
  initial-value: 92;
}

@property --orb-b {
  syntax: "<number>";
  inherits: true;
  initial-value: 246;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e4d9ed 0%, var(--bg) 58%, #cbb9dc 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(230, 207, 234, 0.96);
  border-radius: 10px;
  padding: 16px;
  box-shadow:
    0 10px 26px rgba(74, 47, 96, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 26px 24px 16px;
  background: #fff8fc;
}

.hero-identity {
  display: grid;
  min-width: 0;
  justify-items: center;
  text-align: center;
}

.hero-identity .eyebrow {
  color: #796394;
  letter-spacing: 0.14em;
}

.hero-identity h1 {
  margin: 9px 0 10px;
  color: #28222f;
}

.hero-identity .subtitle {
  color: #796b86;
  font-size: clamp(1rem, 3.4vw, 1.16rem);
  line-height: 1.45;
}

.mode-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  background: rgba(255, 249, 252, 0.94);
}

.mode-panel-heading {
  display: grid;
  gap: 5px;
}

.mode-panel-heading strong {
  font-size: 1.18rem;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-button {
  display: grid;
  min-height: 72px;
  gap: 4px;
  place-content: center;
  border: 1px solid var(--line);
  background: rgba(239, 230, 255, 0.58);
  color: #5d477c;
  text-align: center;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    color 220ms ease;
}

.mode-button span {
  font-size: 1.05rem;
}

.mode-button small {
  font-size: 0.76rem;
  font-weight: 650;
  opacity: 0.78;
}

.mode-button.active {
  border-color: rgba(139, 92, 246, 0.72);
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(105, 69, 181, 0.2);
  color: #fff;
}

body.focus-mode .mode-button.active {
  border-color: rgba(47, 113, 165, 0.72);
  background: #477fae;
  box-shadow: 0 7px 18px rgba(47, 96, 139, 0.2);
}

.mode-button:disabled {
  opacity: 0.72;
}

.mode-sync-select {
  display: none;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 9vw, 3.6rem);
  line-height: 1;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
}

.setup-actions {
  padding-top: 16px;
}

.setup-actions .participant-field {
  flex: 1 1 180px;
}

.setup-actions .age-field {
  flex: 0 1 150px;
}

.setup-actions .session-mode-field {
  flex: 0 1 190px;
}

.setup-actions .device-count {
  flex: 0 1 150px;
}

.setup-actions .device-version {
  flex: 0 1 230px;
}

.setup-actions .previous-settings-button,
.setup-actions .view-mode-button {
  flex-basis: auto;
}

.device-count,
.session-mode-field,
.device-version,
.participant-field,
.age-field {
  display: grid;
  min-width: 132px;
  gap: 6px;
}

.device-version small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.technical-device-version {
  max-width: 360px;
  margin-bottom: 14px;
}

body:not(.technical-view) .technical-device-version {
  display: none;
}

.focus-only {
  display: none !important;
}

body.focus-mode .focus-only {
  display: block !important;
}

body.focus-mode:not(.technical-view) .technical-quick-guide.focus-only {
  display: none !important;
}

body.focus-mode:not(.technical-view) .focus-technical-panel {
  display: none !important;
}

body.focus-mode.technical-view .focus-technical-panel {
  display: block !important;
}

body.focus-mode.technical-view .relaxation-technical-only {
  display: none !important;
}

body.focus-mode .relaxation-only {
  display: none !important;
}

.participant-field {
  min-width: 150px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
}

button:disabled {
  background: #d8ccec;
  color: #8f84a0;
}

button.secondary {
  min-height: 34px;
  background: var(--accent-soft);
  color: #4c3974;
  border: 1px solid var(--line);
}

.previous-settings-button {
  flex-basis: 100%;
  min-height: 38px;
  background: #f7f1ff;
  color: #604789;
}

.view-mode-button {
  flex-basis: 100%;
}

body:not(.technical-view) .technical-live-panel {
  display: none;
}

body:not(.technical-view) .technical-quick-guide {
  display: none !important;
}

body.technical-view .user-quick-guide {
  display: none !important;
}

body.focus-mode.technical-view .technical-quick-guide.focus-only {
  display: block !important;
}

body.technical-view .session-experience {
  display: none;
}

body.technical-view .session-only-panel {
  display: none;
}

body:not(.technical-view) #operatorPanel {
  display: none;
}

body:not(.technical-view) #qualityPanel {
  display: none;
}

body:not(.technical-view) .experience-signal {
  display: none;
}

body:not(.technical-view) .technical-status-grid {
  display: none;
}

select,
input[type="text"],
input[type="password"],
input[type="range"] {
  width: 100%;
}

select,
input[type="text"],
input[type="password"] {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
}

input[type="text"] {
  font-weight: 750;
}

input[type="range"] {
  accent-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.collapsible-panel {
  margin-top: 12px;
}

.compact-panel-summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
}

.compact-panel-summary::-webkit-details-marker {
  display: none;
}

#qualityCompactStatus {
  min-width: 0;
  text-align: right;
  line-height: 1.25;
  transition: color 220ms ease;
}

#qualityCompactStatus.coach-movement,
#qualityCompactStatus.coach-drift {
  color: #a1444d;
}

#qualityCompactStatus.coach-weak,
#qualityCompactStatus.coach-contact {
  color: #94621a;
}

#qualityCompactStatus.coach-good {
  color: #277b5b;
}

#qualityCompactStatus.coach-waiting {
  color: var(--muted);
}

.compact-panel-summary::after {
  content: "+";
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 900;
}

.collapsible-panel[open] > .compact-panel-summary::after {
  content: "-";
}

.compact-panel-summary > strong {
  margin-left: auto;
  color: var(--text);
  font-size: 0.92rem;
}

.quality-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(220px, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: center;
}

.quality-panel-body > div:first-child > strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  line-height: 1;
}

.quality-details {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.quality-details > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.quality-details strong {
  display: inline;
  margin: 0;
  font-size: 1rem;
}

.device-quality-list {
  display: grid;
  gap: 8px;
}

.device-quality-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(178, 140, 230, 0.32);
  border-radius: 8px;
  background: var(--panel-soft);
}

.device-quality-row strong {
  color: var(--text);
}

.device-quality-row span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.device-quality-metrics {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) 6.8em 6.8em 5.2em;
  gap: 6px;
  align-items: baseline;
  white-space: nowrap;
}

.device-quality-metrics span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-quality-metrics .metric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.device-quality-row.good {
  border-color: rgba(47, 159, 115, 0.46);
}

.device-quality-row.warning {
  border-color: rgba(183, 122, 32, 0.46);
}

.device-quality-row.poor {
  border-color: rgba(190, 83, 91, 0.46);
}

.operator-panel {
  display: block;
  margin-top: 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.operator-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.operator-panel.recording {
  border-color: rgba(47, 159, 115, 0.62);
  background: linear-gradient(180deg, #ffffff 0%, #f3fff9 100%);
  box-shadow: 0 8px 24px rgba(47, 159, 115, 0.12);
}

.operator-panel-body > div:first-child > strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  line-height: 1.1;
}

.recording-badge {
  display: inline-grid;
  min-height: 24px;
  margin-top: 10px;
  padding: 3px 10px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #4c3974;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.operator-panel.recording .recording-badge {
  background: rgba(47, 159, 115, 0.14);
  color: var(--green);
}

.operator-time {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.operator-time strong {
  display: inline;
  margin: 0 0 0 5px;
  color: var(--text);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.usage-guide {
  margin-top: 12px;
}

.hero-guide {
  flex-basis: 100%;
  width: 100%;
  margin-top: 0;
  padding-top: 14px;
  padding-bottom: 4px;
  border-top: 1px solid rgba(230, 207, 234, 0.82);
}

.usage-guide summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.usage-guide summary::-webkit-details-marker {
  display: none;
}

.usage-guide summary strong {
  color: var(--muted);
  font-size: 0.95rem;
}

.usage-guide summary::after {
  content: "+";
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
}

.usage-guide[open] summary::after {
  content: "-";
}

.usage-guide ol {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.usage-guide li + li {
  margin-top: 5px;
}

.user-quick-guide ol {
  padding-left: 24px;
  color: #675b73;
  line-height: 1.55;
}

.user-quick-guide li::marker {
  color: var(--accent);
  font-weight: 850;
}

.guide-note {
  margin: 14px 0 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.07);
  color: #675b73;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
}

.ble-capability-banner {
  margin: 10px 0 6px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(183, 122, 32, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ble-capability-banner > strong {
  display: block;
  margin-bottom: 4px;
}

.ble-capability-banner p,
.ble-capability-banner ul {
  margin: 4px 0;
}

.ble-capability-banner ul {
  padding-left: 1.3em;
}

#bleCapabilityBannerExtra {
  color: var(--muted);
}

.operator-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.session-experience {
  position: relative;
  margin-top: 12px;
  overflow: hidden;
  border-color: rgba(123, 159, 200, 0.3);
  background: #fff6fb;
  transition:
    background-color 2.2s ease,
    border-color 2.2s ease,
    box-shadow 2.2s ease;
}

.session-experience.experience-waiting {
  background-color: #faf5fa;
}

.session-experience.experience-preparing {
  background-color: #f5f7fc;
  border-color: rgba(74, 160, 216, 0.25);
}

.session-experience.experience-ready {
  background-color: #eefaf5;
  border-color: rgba(47, 159, 115, 0.34);
  box-shadow:
    0 12px 30px rgba(47, 159, 115, 0.10),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.session-experience.experience-active {
  background-color: #fff8eb;
  border-color: rgba(211, 139, 54, 0.28);
}

.session-experience.experience-settling {
  background-color: #f0faf5;
  border-color: rgba(70, 157, 121, 0.28);
}

.session-experience.experience-calm {
  background-color: #eef9f4;
  border-color: rgba(70, 157, 121, 0.30);
}

.session-experience.experience-deep {
  background-color: #eef3fc;
  border-color: rgba(46, 91, 168, 0.30);
  box-shadow:
    0 12px 30px rgba(46, 91, 168, 0.09),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.session-experience.experience-complete {
  background-color: #eefaf5;
  border-color: rgba(47, 159, 115, 0.32);
  box-shadow:
    0 12px 30px rgba(47, 159, 115, 0.10),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.session-experience.experience-adjust {
  background-color: #fff5f6;
  border-color: rgba(190, 83, 91, 0.24);
}

.experience-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.experience-topline > div:first-child {
  display: grid;
  gap: 4px;
}

.experience-topline strong {
  color: var(--text);
  font-size: clamp(1.15rem, 4vw, 1.6rem);
}

.experience-time {
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.experience-time strong {
  margin-top: 3px;
  color: var(--accent);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.experience-stage {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  gap: 18px;
  text-align: center;
}

.calm-orb {
  --orb-r: 139;
  --orb-g: 92;
  --orb-b: 246;
  --orb-scale: 0.84;
  position: relative;
  display: grid;
  width: min(420px, 90vw);
  aspect-ratio: 1;
  place-items: center;
  cursor: default;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  transform: scale(var(--orb-scale));
  transition:
    transform 4s cubic-bezier(0.22, 1, 0.36, 1),
    filter 2.2s ease,
    --orb-r 2.2s ease,
    --orb-g 2.2s ease,
    --orb-b 2.2s ease;
}

.calm-orb.actionable {
  cursor: pointer;
}

.calm-orb.actionable:focus-visible {
  border-radius: 50%;
  outline: none;
}

.calm-orb.end-armed {
  --orb-r: 190;
  --orb-g: 83;
  --orb-b: 91;
}

.calm-orb::before,
.calm-orb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.calm-orb::before {
  z-index: 0;
  inset: 12%;
  background: radial-gradient(
    circle,
    rgba(var(--orb-r), var(--orb-g), var(--orb-b), 0.10) 0%,
    rgba(var(--orb-r), var(--orb-g), var(--orb-b), 0.045) 48%,
    transparent 72%
  );
  filter: blur(12px);
  animation: enso-halo 9s ease-in-out infinite;
}

.calm-orb::after {
  z-index: 0;
  inset: 20%;
  background: rgba(255, 255, 255, 0.24);
  filter: blur(24px);
  opacity: 0.5;
}

.enso-brush {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: rgb(var(--orb-r), var(--orb-g), var(--orb-b));
  filter:
    drop-shadow(0 0 8px rgba(var(--orb-r), var(--orb-g), var(--orb-b), 0.14))
    drop-shadow(0 8px 14px rgba(79, 46, 121, 0.06));
  transform-origin: 50% 50%;
  transform-box: view-box;
  animation: enso-rotate 80s linear infinite;
  animation-play-state: running;
  will-change: transform;
  transition: color 2.2s ease, filter 2.2s ease;
  pointer-events: none;
}

.enso-ink {
  fill: currentColor;
}

.calm-orb-core {
  position: absolute;
  z-index: 2;
  display: grid;
  top: 50%;
  left: 50%;
  width: 58%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.90) 0%,
    rgba(255, 249, 252, 0.62) 54%,
    rgba(255, 249, 252, 0) 76%
  );
}

.calm-orb-core span {
  display: grid;
  min-width: 4.2ch;
  min-height: 2.15em;
  place-items: center;
  max-width: 160px;
  color: rgb(var(--orb-r), var(--orb-g), var(--orb-b));
  font-size: clamp(1.35rem, 6.5vw, 2.02rem);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.92);
  transition: color 2.2s ease;
}

.calm-orb.waiting {
  --orb-r: 166;
  --orb-g: 157;
  --orb-b: 181;
  --orb-scale: 0.50;
  filter: saturate(0.55);
}

.calm-orb.preparing {
  --orb-r: 74;
  --orb-g: 160;
  --orb-b: 216;
  --orb-scale: 0.84;
}

.calm-orb.ready {
  --orb-r: 47;
  --orb-g: 159;
  --orb-b: 115;
  --orb-scale: 0.94;
}

.calm-orb.active {
  --orb-r: 211;
  --orb-g: 139;
  --orb-b: 54;
  --orb-scale: 0.90;
}

.calm-orb.settling {
  --orb-r: 70;
  --orb-g: 157;
  --orb-b: 121;
  --orb-scale: 0.96;
}

.calm-orb.calm {
  --orb-r: 70;
  --orb-g: 157;
  --orb-b: 121;
  --orb-scale: 0.96;
}

.calm-orb.deep {
  --orb-r: 46;
  --orb-g: 91;
  --orb-b: 168;
  --orb-scale: 1;
}

.calm-orb.adjust {
  --orb-r: 190;
  --orb-g: 83;
  --orb-b: 91;
  --orb-scale: 0.80;
  filter: saturate(0.7);
}

.calm-orb.adjust.signal-collapsed {
  --orb-scale: 0.50;
}

.calm-orb.complete {
  --orb-r: 47;
  --orb-g: 159;
  --orb-b: 115;
  --orb-scale: 0.94;
}

/* Keep the desktop Zen circle visually steady while calm states change. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .calm-orb.active,
  .calm-orb.settling,
  .calm-orb.calm,
  .calm-orb.deep {
    --orb-scale: 0.96;
  }
}

@keyframes enso-rotate {
  from {
    transform: translate(4px, 6px) rotate(0deg) scale(1.045);
    opacity: 0.88;
  }
  to {
    transform: translate(4px, 6px) rotate(360deg) scale(1.045);
    opacity: 0.88;
  }
}

@keyframes enso-halo {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.48;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.78;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calm-orb,
  .calm-orb::before,
  .calm-orb::after {
    animation: none;
    transition-duration: 0.2s;
  }

  .enso-brush {
    animation: enso-rotate 120s linear infinite;
  }
}

.experience-stage p {
  display: grid;
  width: min(100%, 520px);
  height: 4.35em;
  max-width: 520px;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
  text-wrap: balance;
}

.experience-stage p.signal-coach-message {
  color: #50445c;
  font-size: clamp(1.05rem, 3.8vw, 1.22rem);
  font-weight: 800;
}

.experience-stage p.signal-coach-message.coach-movement,
.experience-stage p.signal-coach-message.coach-drift {
  color: #a1444d;
}

.experience-stage p.signal-coach-message.coach-weak,
.experience-stage p.signal-coach-message.coach-contact {
  color: #8b5c18;
}

.experience-stage p.signal-coach-message.coach-good {
  color: #277b5b;
}

.experience-signal {
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #5d477c;
  font-size: 0.78rem;
  font-weight: 850;
}

.experience-signal.good {
  background: rgba(47, 159, 115, 0.12);
  color: #277b5b;
}

.experience-signal.warning {
  background: rgba(183, 122, 32, 0.12);
  color: #94621a;
}

.experience-signal.poor {
  background: rgba(190, 83, 91, 0.11);
  color: #a1444d;
}

.experience-events {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.experience-events-header,
.experience-event-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.experience-events-header strong {
  color: var(--text);
  font-size: 1.05rem;
}

.experience-event-rail {
  position: relative;
  height: 38px;
}

.experience-event-line {
  position: absolute;
  top: 50%;
  right: 3px;
  left: 3px;
  height: 2px;
  border-radius: 999px;
  background: #e6d9f6;
  transform: translateY(-50%);
}

.experience-event-marker {
  position: absolute;
  top: 50%;
  display: grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(123, 159, 200, 0.44);
  box-shadow: 0 0 7px rgba(73, 49, 107, 0.14);
  transform: translate(-50%, -50%);
}

.experience-event-marker.level-2 {
  width: 15px;
  height: 15px;
  background: rgba(125, 101, 216, 0.55);
}

.experience-event-marker.level-3 {
  width: 18px;
  height: 18px;
  background: rgba(47, 159, 115, 0.66);
}

.experience-event-legend {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.operator-actions button {
  min-height: 56px;
  font-size: 1.1rem;
  font-weight: 850;
}

.start-button {
  background: var(--green);
  color: #ffffff;
}

.baseline-button {
  background: var(--accent);
  color: #ffffff;
}

.end-button {
  background: var(--red);
  color: #ffffff;
}

.start-button:disabled,
.baseline-button:disabled,
.end-button:disabled {
  background: #d8ccec;
  color: #8f84a0;
}

.save-operator-button {
  grid-column: 1 / -1;
  min-height: 42px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.save-operator-button.save-ready:not(:disabled) {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(47, 159, 115, 0.2);
}

.save-operator-button.save-done {
  background: #efe6ff;
  border-color: var(--line);
  color: #604789;
  box-shadow: none;
}

.save-operator-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.bar {
  height: 14px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee6f8;
}

.quality-bar #qualityBar,
#alphaBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 140ms linear, background-color 180ms linear;
}

#alphaBar {
  background: linear-gradient(90deg, #c4a5ff, var(--accent));
}

.feedback-panel.alpha-muted .alpha-readout strong {
  color: var(--inactive);
}

.feedback-panel.alpha-muted #alphaBar {
  background: #c9c2d4;
}

.feedback-panel.alpha-muted .label {
  color: #a79db5;
}

.trend-panel {
  margin-top: 12px;
}

.trend-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

#alphaChart {
  display: block;
  width: 100%;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.hidden {
  display: none !important;
}

.summary-panel {
  margin-top: 12px;
  border-color: rgba(139, 92, 246, 0.42);
  background: linear-gradient(180deg, #fffafd 0%, #fcf3fa 100%);
}

.summary-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.summary-header h2 {
  margin: 5px 0 0;
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  line-height: 1.05;
}

.summary-narrative {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.45;
}

.summary-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.summary-actions > strong {
  color: var(--accent);
  font-size: clamp(1.35rem, 6vw, 2.4rem);
  line-height: 1;
}

.summary-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.summary-primary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.summary-primary-stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 8px;
  background: rgba(247, 242, 253, 0.72);
}

.summary-primary-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-primary-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  line-height: 1.1;
}

.summary-cue-recovery {
  margin: 0 0 14px;
  padding: 14px 15px;
  border: 1px solid rgba(83, 111, 180, 0.22);
  border-radius: 8px;
  background: rgba(83, 111, 180, 0.08);
}

.summary-cue-recovery strong {
  display: block;
  margin-top: 5px;
  color: #315f9b;
  font-size: 0.96rem;
  line-height: 1.45;
}

.summary-suggestion {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid rgba(70, 157, 121, 0.24);
  border-radius: 8px;
  background: rgba(238, 249, 244, 0.82);
}

.summary-suggestion p {
  margin: 0;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.45;
}

.summary-chart-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 9px;
}

.summary-chart-header > div:first-child {
  display: grid;
  gap: 2px;
}

.summary-chart-header strong {
  color: var(--text);
  font-size: 1rem;
}

.summary-chart-header span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.summary-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 13px;
}

.summary-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.event-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
}

.event-dot.level-one {
  color: #7b9fc8;
}

.event-dot.level-two {
  color: #7d65d8;
}

.event-dot.level-three {
  color: #2f9f73;
}

#summaryAlphaChart {
  display: block;
  width: 100%;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-technical {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 8px;
  background: rgba(255, 247, 252, 0.78);
}

.summary-technical summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.summary-technical summary::-webkit-details-marker {
  display: none;
}

.summary-technical summary strong {
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-technical summary::after {
  content: "+";
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #4c3974;
  font-weight: 900;
}

.summary-technical[open] summary::after {
  content: "-";
}

.summary-export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 8px;
  background: rgba(247, 241, 255, 0.82);
}

.summary-export > div {
  display: grid;
  gap: 5px;
}

.summary-export strong {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-export button {
  min-inline-size: 150px;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-remote-status {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-inline-size: 150px;
}

.export-remote-status strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.export-remote-status a {
  color: #3b6db1;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.export-remote-status a:hover {
  text-decoration: underline;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.summary-stats div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.summary-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: clamp(1rem, 4vw, 1.45rem);
  line-height: 1.05;
  white-space: nowrap;
}

.history-panel {
  margin-top: 12px;
}

.history-toggle {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
}

.history-toggle::-webkit-details-marker {
  display: none;
}

.history-toggle h2 {
  margin: 5px 0 0;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  line-height: 1.05;
}

.history-toggle-hint {
  min-width: 62px;
  color: var(--accent);
  font-weight: 850;
  text-align: right;
}

.history-toggle-hint::after {
  content: " +";
}

.history-panel[open] .history-toggle-hint {
  font-size: 0;
}

.history-panel[open] .history-toggle-hint::after {
  content: "Close -";
  font-size: 0.88rem;
}

.history-content {
  margin-top: 16px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.history-description {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button.danger {
  background: #fff1f2;
  border-color: #f3b6bf;
  color: #a83f4b;
}

#historyChart {
  display: block;
  width: 100%;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.history-empty {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 750;
}

.history-table {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.history-session {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.history-session summary::-webkit-details-marker {
  display: none;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) repeat(4, minmax(56px, 0.62fr)) 28px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.history-row::after {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  justify-self: end;
  border-radius: 50%;
  background: #efe5fb;
  color: var(--muted);
  font-weight: 900;
}

.history-session[open] .history-row::after {
  content: "-";
}

.history-detail {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.history-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding-top: 6px;
}

.history-session-chart {
  display: block;
  width: 100%;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.history-detail-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.history-date {
  display: grid;
  align-content: center;
  color: var(--muted);
  font-size: 0.74rem;
  min-width: 0;
}

.history-date strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.05;
  white-space: nowrap;
}

.history-date span {
  display: none;
}

.history-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-metric span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-metric strong {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.05;
  white-space: nowrap;
}

.session-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 1.1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.feedback-panel {
  display: grid;
  align-content: center;
  gap: 18px;
}

.alpha-readout strong {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: clamp(3.6rem, 18vw, 7rem);
  line-height: 0.95;
}

.threshold-control label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.chime-panel {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 12px;
}

.progress-ring {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1;
}

.progress-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg,
.ring-fg {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: #eee6f8;
}

.ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 220ms linear, stroke 220ms linear;
}

.progress-ring strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 12vw, 4rem);
}

.ring-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.ring-details strong {
  color: var(--text);
}

.score-card strong {
  color: var(--accent);
}

.export-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.edf-progress {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.edf-progress .bar {
  height: 8px;
  margin-top: 0;
}

#edfBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms linear;
}

.audio-panel {
  display: block;
  margin-top: 12px;
}

.audio-panel-body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
}

.control {
  display: grid;
  gap: 8px;
}

.inline-audio-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-audio-control button {
  min-inline-size: 86px;
}

.mindscape-tuning {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid rgba(135, 87, 246, 0.22);
  border-radius: 8px;
  background: rgba(245, 239, 255, 0.55);
}

.mindscape-tuning-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mindscape-tuning-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.mindscape-tuning-header button {
  min-inline-size: 132px;
}

.mindscape-tuning-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.mindscape-tuning input[type="number"] {
  min-width: 0;
}

.focus-audio-settings {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid rgba(71, 104, 174, 0.24);
  border-radius: 8px;
  background: rgba(239, 245, 255, 0.72);
}

.focus-audio-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.focus-audio-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.focus-audio-heading > strong {
  color: #38588f;
  text-align: right;
}

.focus-audio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: end;
  gap: 12px;
}

.focus-cue-volume-control {
  grid-column: 1 / -1;
}

.focus-cue-volume-control .label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.focus-cue-volume-control .label strong {
  color: #38588f;
}

.focus-technical-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(260px, 1fr);
  gap: 16px;
  padding-top: 16px;
}

.focus-threshold-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.focus-risk-readout {
  display: grid;
  gap: 7px;
}

.focus-risk-readout > strong {
  color: #38588f;
  font-size: 1.45rem;
}

#focusRiskBar {
  width: 0;
  background: #5477b7;
}

.focus-technical-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.focus-technical-facts > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(71, 104, 174, 0.18);
  border-radius: 8px;
  background: rgba(239, 245, 255, 0.72);
}

.focus-technical-facts span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.focus-technical-facts strong {
  color: #38588f;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.focus-technical-body .focus-rule {
  grid-column: 1 / -1;
}

.auditory-erp-body {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.auditory-erp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.auditory-probe-protocol {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.auditory-probe-protocol span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.auditory-probe-live-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.auditory-probe-response {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(55, 109, 190, 0.24);
  border-radius: 8px;
  background: rgba(225, 238, 255, 0.74);
}

.auditory-probe-response button {
  width: min(100%, 520px);
  min-height: 82px;
  background: #376dbe;
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  letter-spacing: 0;
}

.auditory-probe-response button:active:not(:disabled) {
  transform: scale(0.985);
  background: #28599e;
}

.auditory-probe-response p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.auditory-probe-performance {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.auditory-probe-performance > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(55, 109, 190, 0.20);
  border-radius: 8px;
  background: rgba(235, 244, 255, 0.72);
}

.auditory-probe-performance span,
.auditory-probe-performance strong {
  display: block;
}

.auditory-probe-performance span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auditory-probe-performance strong {
  margin-top: 5px;
  color: #315f9b;
  font-size: 1rem;
}

.auditory-probe-live-stats > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(135, 87, 223, 0.22);
  border-radius: 8px;
  background: rgba(245, 240, 255, 0.72);
}

.auditory-probe-live-stats span,
.auditory-probe-live-stats strong {
  display: block;
}

.auditory-probe-live-stats span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auditory-probe-live-stats strong {
  margin-top: 5px;
  color: #6542a5;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.auditory-erp-save-status {
  align-self: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.auditory-erp-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.auditory-erp-stats > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auditory-erp-stats span,
.auditory-erp-stats strong {
  display: block;
}

.auditory-erp-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auditory-erp-stats strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.auditory-erp-chart-wrap {
  min-height: 280px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

#auditoryErpChart,
#passiveN1Chart {
  display: block;
  width: 100%;
  height: 360px;
}

.auditory-erp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.auditory-erp-legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 3px;
  background: currentColor;
}

.auditory-erp-legend .standard {
  color: #6f7f91;
}

.auditory-erp-legend .oddball {
  color: #8757df;
}

.auditory-erp-legend .difference {
  color: #d55266;
}

.auditory-erp-legend .window {
  color: #8b73af;
}

.auditory-erp-legend .window::before {
  height: 10px;
  opacity: 0.28;
}

.auditory-erp-history {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.auditory-erp-history > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.auditory-erp-history > summary::-webkit-details-marker,
.auditory-erp-history-item > summary::-webkit-details-marker {
  display: none;
}

.auditory-erp-history-empty {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.auditory-erp-history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.auditory-erp-history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.auditory-erp-history-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.auditory-erp-history-item > summary div {
  display: grid;
  gap: 2px;
}

.auditory-erp-history-item > summary span {
  color: var(--muted);
  font-size: 0.76rem;
}

.auditory-erp-history-peak {
  text-align: right;
  font-weight: 750;
}

.auditory-erp-history-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.auditory-erp-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.76rem;
}

.auditory-erp-history-stats strong {
  color: var(--text);
}

.auditory-erp-history-chart {
  display: block;
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.focus-rule {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.focus-rule strong {
  color: #38588f;
}

body.focus-mode .session-experience.experience-active {
  border-color: rgba(223, 135, 50, 0.32);
  background-color: #fff3e5;
}

body.focus-mode .session-experience.experience-settling,
body.focus-mode .session-experience.experience-calm {
  border-color: rgba(126, 98, 190, 0.28);
  background-color: #f4effc;
}

body.focus-mode .session-experience.experience-deep {
  border-color: rgba(62, 112, 171, 0.30);
  background-color: #edf4fc;
}

body.focus-mode {
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 222, 255, 0.42), transparent 46%),
    linear-gradient(180deg, #8fb5df 0%, #76a1d2 58%, #668fc2 100%);
  background-attachment: fixed;
}

body.focus-mode .panel:not(.session-experience) {
  border-color: rgba(92, 139, 198, 0.66);
  background-color: #e8f0fa;
  box-shadow:
    0 12px 28px rgba(25, 62, 108, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.66) inset;
}

body.focus-mode .panel.hero,
body.focus-mode .setup-panel,
body.focus-mode .audio-panel {
  background-color: #e1ecf9;
}

body.focus-mode .focus-audio-settings {
  border-color: rgba(65, 116, 184, 0.34);
  background: rgba(232, 241, 251, 0.94);
}

body.focus-mode .experience-event-marker.focus-stable,
.event-dot.focus-stable {
  background: rgba(60, 112, 186, 0.72);
}

body.focus-mode .experience-event-marker.focus-drift,
.event-dot.focus-drift {
  width: 16px;
  height: 16px;
  background: rgba(223, 135, 50, 0.78);
}

.summary-legend .event-dot.focus-drift {
  width: 10px;
  height: 10px;
}

.event-dot.focus-neutral {
  background: rgba(126, 98, 190, 0.62);
}

body.focus-mode .calm-orb.deep {
  color: #315fa8;
}

body.focus-mode .calm-orb.calm,
body.focus-mode .calm-orb.settling {
  color: #765bb4;
}

body.focus-mode .calm-orb.active {
  color: #d47c28;
}

body.focus-mode .calm-orb.actionable:focus-visible {
  outline: none;
}

body.focus-mode .calm-orb::before {
  background: none;
  filter: none;
  animation: none;
}

body.focus-mode .summary-legend.focus-only {
  display: flex !important;
}

.file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.band-details {
  margin-top: 12px;
}

.band-details summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.band-details summary::-webkit-details-marker {
  display: none;
}

.band-details summary strong {
  color: var(--muted);
  font-size: 0.95rem;
}

.band-details summary::after {
  content: "+";
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #4c3974;
  font-weight: 900;
}

.band-details[open] summary::after {
  content: "-";
}

.band-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.mini-band {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-band.active {
  border-color: rgba(139, 92, 246, 0.62);
  background: rgba(139, 92, 246, 0.10);
}

.mini-band span,
.mini-band strong {
  display: block;
}

.mini-band span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-band strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 1.1rem;
}

.status-card {
  min-height: 86px;
}

.status-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.1rem, 5vw, 1.7rem);
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .actions {
    justify-content: stretch;
  }

  .mode-panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .actions button {
    flex: 1;
  }

  .setup-actions .participant-field,
  .setup-actions .age-field,
  .setup-actions .session-mode-field,
  .setup-actions .device-version,
  .setup-actions .device-count {
    flex: 1 1 100%;
  }

  .setup-actions .previous-settings-button,
  .setup-actions .view-mode-button {
    flex-basis: calc(50% - 5px);
  }

  .grid,
  .quality-panel-body,
  .operator-panel-body,
  .session-panel,
  .audio-panel-body,
  .band-panel {
    grid-template-columns: 1fr;
  }

  .mindscape-tuning-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mindscape-tuning-grid {
    grid-template-columns: 1fr;
  }

  .focus-audio-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .focus-audio-heading > strong {
    text-align: left;
  }

  .focus-audio-grid {
    grid-template-columns: 1fr;
  }

  .focus-threshold-controls {
    grid-template-columns: 1fr;
  }

  .auditory-erp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auditory-probe-live-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auditory-probe-performance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auditory-probe-actions button {
    flex: 1 1 180px;
  }

  #auditoryErpChart,
  #passiveN1Chart {
    height: 300px;
  }

  .focus-technical-body,
  .focus-technical-facts {
    grid-template-columns: 1fr;
  }

  .summary-header {
    align-items: start;
    flex-direction: column;
  }

  .summary-actions {
    justify-items: start;
  }

  .summary-export {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-export button {
    width: 100%;
  }

  .export-actions,
  .export-remote-status {
    width: 100%;
  }

  .export-remote-status {
    justify-items: start;
  }

  .history-header {
    align-items: stretch;
    flex-direction: column;
  }

  .history-actions {
    justify-content: stretch;
  }

  .history-actions button {
    flex: 1;
  }

  .summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-primary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-chart-header {
    align-items: start;
    flex-direction: column;
  }

  .summary-legend {
    justify-content: flex-start;
  }

  .experience-stage {
    min-height: 320px;
  }

  .experience-topline {
    align-items: start;
  }

  .history-row {
    grid-template-columns: minmax(72px, 0.95fr) repeat(4, minmax(40px, 0.6fr)) 24px;
    gap: 5px;
    padding: 8px 6px;
  }

  .history-detail {
    padding: 0 6px 8px;
  }

  .history-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-date strong,
  .history-metric strong {
    font-size: 0.76rem;
  }

  .history-metric span {
    font-size: 0.46rem;
  }
}

@media (max-width: 420px) {
  .summary-stats {
    grid-template-columns: 1fr;
  }

  .summary-primary-stats strong {
    font-size: 0.95rem;
  }

  .session-experience {
    padding: 14px;
  }

  .experience-stage {
    min-height: 285px;
  }

  .calm-orb {
    width: min(347px, 92vw);
  }
}
