body.emdr-support-page {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 32%),
    linear-gradient(180deg, #08111f 0%, #050a13 58%, #03060d 100%) !important;
  color: #e5eefc;
  min-height: 100vh;
}

body.emdr-support-page .topbar {
  background: rgba(8, 17, 31, 0.92);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

body.emdr-support-page .btnTop,
body.emdr-support-page .connPill {
  background: rgba(11, 18, 32, 0.88);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.24);
}

body.emdr-support-page #soundToggleBtn {
  display: none;
}

body.emdr-support-page .emdrLegacyHidden {
  display: none !important;
}

.emdr-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  max-width: 1680px;
  margin: 18px auto 0;
  min-height: calc(100vh - 110px);
}

.emdr-patient {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 130px);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at center, rgba(59, 130, 246, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.38);
}

.emdr-patient__canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.emdr-patient__dim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.2);
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.emdr-side-glow {
  position: absolute;
  top: 14%;
  bottom: 14%;
  width: 16%;
  pointer-events: none;
  opacity: 0.12;
  filter: blur(28px);
  transition: opacity 0.16s linear, background 0.2s ease;
}

.emdr-side-glow--left {
  left: -4%;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.65), transparent);
}

.emdr-side-glow--right {
  right: -4%;
  background: linear-gradient(270deg, rgba(59, 130, 246, 0.65), transparent);
}

.emdr-target {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fef9c3, #60a5fa 48%, #1d4ed8 78%);
  box-shadow:
    0 0 28px rgba(96, 165, 250, 0.75),
    0 0 70px rgba(59, 130, 246, 0.22);
  will-change: transform, opacity;
}

.emdr-target--hidden {
  opacity: 0;
}

.emdr-target--centered {
  transition: transform 0.25s ease;
}

.emdr-patient__hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.emdr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(8, 15, 28, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #dbeafe;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.emdr-patient__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.emdr-patient__instruction {
  min-height: 24px;
  color: rgba(226, 232, 240, 0.92);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.44);
  max-width: min(90%, 720px);
}

.emdr-patient__subtle {
  min-height: 18px;
  color: rgba(148, 163, 184, 0.92);
  font-size: 0.92rem;
  text-align: center;
}

.emdr-grounding-overlay,
.emdr-between-set,
.emdr-help-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(10px);
  z-index: 6;
}

.emdr-grounding-overlay.is-visible,
.emdr-between-set.is-visible,
.emdr-help-modal.is-visible {
  display: flex;
}

.emdr-grounding-card,
.emdr-between-set__card,
.emdr-help-card {
  width: min(560px, 92%);
  padding: 28px;
  border-radius: 24px;
  background: rgba(8, 15, 28, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow: 0 28px 54px rgba(2, 6, 23, 0.46);
  text-align: center;
}

.emdr-help-card {
  max-height: min(86vh, 820px);
  overflow-y: auto;
  text-align: left;
}

.emdr-grounding-orb {
  width: 124px;
  height: 124px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #dbeafe, #60a5fa 48%, #1d4ed8 75%);
  box-shadow: 0 0 34px rgba(96, 165, 250, 0.6);
  animation: emdrGroundPulse 4.8s ease-in-out infinite;
}

@keyframes emdrGroundPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.emdr-grounding-title,
.emdr-between-set__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #eff6ff;
}

.emdr-grounding-copy,
.emdr-between-set__copy {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.emdr-between-set__controls,
.emdr-grounding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.emdr-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  background: rgba(8, 15, 28, 0.96);
}

.emdr-help-copy {
  text-align: left;
  color: #cbd5e1;
  line-height: 1.65;
}

.emdr-help-copy p {
  margin: 0 0 12px;
}

.emdr-help-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.emdr-help-block strong {
  display: block;
  color: #eff6ff;
  margin-bottom: 6px;
}

.emdr-help-block--safety strong {
  color: #fde68a;
}

.emdr-therapist {
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(8, 15, 28, 0.95);
  box-shadow: 0 24px 44px rgba(2, 6, 23, 0.32);
  padding: 18px;
  overflow: auto;
}

.emdr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.emdr-panel-title {
  margin: 0;
  font-size: 1.35rem;
  color: #eff6ff;
}

.emdr-panel-copy {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.5;
}

.emdr-pill-row,
.emdr-button-row,
.emdr-marker-row,
.emdr-voice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.emdr-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.emdr-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.emdr-section h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
}

.emdr-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.86);
  color: #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
}

.emdr-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(30, 41, 59, 0.96);
}

.emdr-btn:active {
  transform: translateY(0);
}

.emdr-btn--primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-color: rgba(96, 165, 250, 0.45);
}

.emdr-btn--accent {
  background: linear-gradient(135deg, #0f766e, #0ea5a4);
  border-color: rgba(45, 212, 191, 0.4);
}

.emdr-btn--warning {
  background: linear-gradient(135deg, #b45309, #ea580c);
  border-color: rgba(251, 146, 60, 0.4);
}

.emdr-btn--danger {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  border-color: rgba(248, 113, 113, 0.42);
}

.emdr-btn--recording {
  position: relative;
  padding-left: 34px;
}

.emdr-btn--recording::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 999px;
  background: #fecaca;
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.9);
  animation: emdrRecordPulse 1s ease-in-out infinite;
}

.emdr-btn--ghost {
  background: rgba(15, 23, 42, 0.48);
}

.emdr-btn.is-active {
  outline: 2px solid rgba(147, 197, 253, 0.55);
  outline-offset: 1px;
}

.emdr-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.emdr-metric {
  padding: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.emdr-metric__label {
  display: block;
  font-size: 0.72rem;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.emdr-metric__value {
  font-size: 1.18rem;
  font-weight: 700;
  color: #f8fafc;
}

.emdr-metric__hint {
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 0.78rem;
}

.emdr-slider {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.emdr-slider:first-child {
  margin-top: 0;
}

.emdr-slider label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.emdr-slider input,
.emdr-slider select,
.emdr-between-set input,
.emdr-note-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  padding: 10px 12px;
}

.emdr-slider input[type="range"] {
  padding: 0;
}

.emdr-note-input {
  min-height: 72px;
  resize: vertical;
}

.emdr-compact-status {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-top: 10px;
}

.emdr-fullscreen {
  margin-left: auto;
}

.emdr-session-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.5;
}

@keyframes emdrRecordPulse {
  0%, 100% {
    background: #fee2e2;
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
    opacity: 0.78;
  }
  50% {
    background: #ef4444;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .emdr-shell {
    grid-template-columns: 1fr;
  }

  .emdr-patient {
    min-height: 68vh;
  }

  .emdr-therapist {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .emdr-help-modal {
    align-items: flex-start;
    padding: 14px;
    overflow-y: auto;
  }

  .emdr-help-card {
    width: 100%;
    max-height: none;
    margin: 0 auto;
    padding: 18px;
  }

  .emdr-help-head {
    top: -2px;
  }
}
