/* Exam Select — Wizard full-view (aligned with study premium language) */

:root {
  --es-header-h: var(--qmf-header-h, 60px);
  --es-bg: #f7f4ef;
  --es-surface: #fffdf8;
  --es-surface-2: #f1ebe2;
  --es-text: #1c1914;
  --es-muted: #6b645a;
  --es-border: #e4ddd2;
  --es-accent: #0d9488;
  --es-accent-deep: #0f766e;
  --es-coral: #ea580c;
  --es-warm: #d97706;
  --es-radius: 18px;
  --es-shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 18px 48px rgba(28, 25, 23, 0.07);
  --es-font: "IBM Plex Sans", "Noto Sans", system-ui, sans-serif;
  --es-serif: "Source Serif 4", "Noto Serif", Georgia, serif;
}

[data-theme="dark"] {
  --es-bg: #12100e;
  --es-surface: #1c1916;
  --es-surface-2: #26211c;
  --es-text: #f5f0e8;
  --es-muted: #a8a29a;
  --es-border: #3f3a34;
}

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

html { scroll-behavior: smooth; }

body.has-qmf-header {
  margin: 0;
  background: var(--es-bg) !important;
  color: var(--es-text);
  font-family: var(--es-font);
}

body.has-qmf-header .main-content {
  margin-top: 0 !important;
  min-height: calc(100dvh - var(--es-header-h));
  padding-top: 0;
}

[hidden],
.hidden { display: none !important; }

/* ── Boot loader (kept) ── */
.fc-load {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--es-bg) 92%, #fff);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.fc-load.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.fc-load__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
}
.fc-load__badge {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--es-shadow);
}
.fc-load__logo { width: 100%; height: 100%; object-fit: cover; }
.fc-load__brand {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.fc-load__map { width: min(280px, 70vw); height: 72px; }
.fc-load__path-bg {
  fill: none;
  stroke: #d6d3d1;
  stroke-width: 3;
  stroke-linecap: round;
}
.fc-load__path-fill {
  fill: none;
  stroke: url(#esLoadGradBoot);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: esLoadPath 2.4s ease-in-out infinite;
}
@keyframes esLoadPath {
  0% { stroke-dashoffset: 100; opacity: 0.5; }
  45% { stroke-dashoffset: 0; opacity: 1; }
  55% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -100; opacity: 0.5; }
}
.fc-load__node {
  fill: #d6d3d1;
  stroke: #fff;
  stroke-width: 2;
}
.fc-load__msg {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--es-muted);
}

/* ── Wizard shell ── */
.es-app.es-wizard {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--es-header-h));
}

.es-app__ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(251, 191, 36, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 45% at 92% 10%, rgba(13, 148, 136, 0.1), transparent 50%);
}

.es-wizard__chrome,
.es-wizard__stage {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.es-wizard__chrome {
  padding-top: clamp(20px, 4vw, 36px);
  padding-bottom: 8px;
  display: grid;
  gap: 18px;
}

.es-wizard__kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--es-accent-deep);
}

.es-wizard__title {
  margin: 0;
  font-family: var(--es-serif);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.es-wizard__sub {
  margin: 8px 0 0;
  max-width: 36em;
  color: var(--es-muted);
  font-size: 15px;
  line-height: 1.55;
}

.es-wizard__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.es-wizard__step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--es-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: default;
}

.es-wizard__step span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--es-surface-2);
  font-size: 11px;
  font-weight: 800;
}

.es-wizard__step.is-active {
  color: var(--es-accent-deep);
  background: color-mix(in srgb, var(--es-accent) 12%, transparent);
}

.es-wizard__step.is-active span {
  background: var(--es-accent);
  color: #fff;
}

.es-wizard__step.is-done {
  color: var(--es-text);
}

.es-wizard__step.is-done span {
  background: color-mix(in srgb, var(--es-accent) 22%, var(--es-surface-2));
  color: var(--es-accent-deep);
}

.es-wizard__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
}

.es-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0 24px;
  animation: esStepIn 0.35s ease;
}

@keyframes esStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.es-back,
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: 16px;
  border: 0;
  background: transparent;
  color: var(--es-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.es-back:hover,
.back-button:hover { color: var(--es-accent-deep); }

.es-step-label,
.dock-label {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--es-muted);
}

.es-wizard__foot-link {
  margin: 28px 0 0;
  text-align: center;
  color: var(--es-muted);
  font-size: 13px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.es-wizard__foot-link a {
  color: var(--es-accent-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--es-accent) 35%, transparent);
}

/* ── Entry paths ── */
.es-path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(860px, 100%);
  margin: 0 auto;
}

.es-path {
  text-align: left;
  border: 1px solid var(--es-border);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 32px);
  background: var(--es-surface);
  box-shadow: var(--es-shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  font: inherit;
  color: inherit;
}

.es-path:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--es-accent) 45%, var(--es-border));
  box-shadow: 0 18px 50px rgba(13, 148, 136, 0.12);
}

.es-path:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--es-accent) 35%, transparent);
  outline-offset: 3px;
}

.es-path__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--es-accent-deep);
}

.es-path--key .es-path__eyebrow { color: var(--es-coral); }

.es-path__title {
  font-family: var(--es-serif);
  font-size: clamp(24px, 3.5vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.es-path__desc {
  color: var(--es-muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 28em;
}

.es-path__go {
  margin-top: auto;
  padding-top: 18px;
  font-weight: 700;
  color: var(--es-coral);
  font-size: 14px;
}

/* ── Key panel ── */
.es-panel,
.es-app .access-key-section .section-container {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 28px);
  border-radius: 22px;
  background: var(--es-surface);
  border: 1px solid var(--es-border);
  box-shadow: var(--es-shadow);
}

.es-app .ak-header { margin-bottom: 16px; }
.es-app .ak-title {
  margin: 0;
  font-family: var(--es-serif);
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.es-app .ak-desc {
  margin: 6px 0 0;
  color: var(--es-muted);
  font-size: 14px;
}

.es-app .ak-buy-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #0369a1 100%);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.28);
}

.es-app .access-key-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--es-border);
  background: var(--es-surface-2);
}

.es-app .access-key-main-input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--es-text);
  outline: none;
  min-width: 0;
}

.es-app .access-key-submit-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--es-accent);
  color: #fff;
  cursor: pointer;
}

.es-app .ak-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--es-muted);
}

.es-app .ak-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border-radius: 0;
  background: none;
}

.es-app .ak-hint-warn {
  color: var(--es-warm);
}

.es-app .ak-qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.es-app .ak-qr-btn {
  border: 1px solid var(--es-border);
  border-radius: 12px;
  background: var(--es-surface);
  padding: 12px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--es-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.es-app .ak-file-hidden { display: none !important; }

.es-app .access-key-error {
  margin-top: 10px;
  color: #b91c1c;
  font-size: 13px;
}

.es-app .ak-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(28, 25, 23, 0.55);
  padding: 16px;
}

.es-app .ak-qr-modal-content {
  width: min(420px, 100%);
  background: var(--es-surface);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--es-border);
}

.es-app .ak-qr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.es-app .ak-qr-close {
  border: 0;
  background: var(--es-surface-2);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
}

.es-app .ak-qr-video-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3/4;
}

.es-app .ak-qr-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Levels grid (full view tiles) ── */
.es-app .es-step--version .section-container {
  width: 100%;
}

.es-version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.es-version-card {
  position: relative;
  min-height: 270px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--es-border);
  border-radius: 24px;
  background: var(--es-surface);
  color: var(--es-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform .25s ease, box-shadow .25s ease;
}

.es-version-card:hover { transform: translateY(-4px); box-shadow: var(--es-shadow); }
.es-version-card--20 { background: linear-gradient(145deg, color-mix(in srgb, #14b8a6 15%, var(--es-surface)), var(--es-surface) 65%); }
.es-version-card--30 { background: linear-gradient(145deg, color-mix(in srgb, #f97316 14%, var(--es-surface)), var(--es-surface) 65%); }
.es-version-card__badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--es-accent) 13%, var(--es-surface));
  color: var(--es-accent-deep);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.es-version-card--30 .es-version-card__badge { color: #c2410c; background: color-mix(in srgb, #f97316 14%, var(--es-surface)); }
.es-version-card__art {
  margin: auto 0 10px;
  font-family: var(--es-serif);
  font-size: clamp(58px, 9vw, 86px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.08em;
  color: #0f766e;
}
.es-version-card--30 .es-version-card__art { color: #ea580c; }
.es-version-card strong { font-size: 21px; }
.es-version-card > span:not(.es-version-card__badge):not(.es-version-card__art) { margin-top: 5px; color: var(--es-muted); font-size: 14px; }
.es-version-card em { margin-top: 18px; color: var(--es-accent-deep); font-size: 13px; font-style: normal; font-weight: 800; }

.es-app .levels-section .section-container,
.es-app .options-section .section-container,
.es-app .exams-section .section-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.es-app .levels-grid,
.es-app .dock-items {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  overflow: visible !important;
  flex-wrap: unset !important;
  justify-content: stretch !important;
}

.es-app .dock-shelf {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
}

.es-app .dock-bar { display: none !important; }

.es-app .dock-item,
.es-app .level-card {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 148px;
  padding: 18px 18px 16px !important;
  margin: 0 !important;
  border-radius: 18px !important;
  border: 1px solid var(--es-border) !important;
  background: var(--es-surface) !important;
  box-shadow: none !important;
  cursor: pointer;
  transform: none !important;
  animation: esStepIn 0.4s ease both;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.es-app .dock-item:hover,
.es-app .level-card:hover {
  transform: translateY(-2px) !important;
  border-color: color-mix(in srgb, var(--es-accent) 50%, var(--es-border)) !important;
  background: color-mix(in srgb, var(--es-accent) 6%, var(--es-surface)) !important;
}

.es-app .dock-icon {
  position: relative;
  width: 68px !important;
  height: 68px !important;
  border-radius: 20px !important;
  display: grid !important;
  place-items: center;
  background: linear-gradient(145deg, #f59e0b, #ea580c) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.es-app .level-card--2 .dock-icon { background: linear-gradient(145deg, #22c55e, #0f766e) !important; }
.es-app .level-card--3 .dock-icon { background: linear-gradient(145deg, #06b6d4, #2563eb) !important; }
.es-app .level-card--4 .dock-icon { background: linear-gradient(145deg, #8b5cf6, #6d28d9) !important; }
.es-app .level-card--5 .dock-icon { background: linear-gradient(145deg, #f43f5e, #be123c) !important; }
.es-app .level-card--6 .dock-icon { background: linear-gradient(145deg, #64748b, #1e293b) !important; }

.es-app .level-card__svg {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  fill: rgba(255,255,255,.18);
  stroke: rgba(255,255,255,.7);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.es-app .dock-icon-num {
  position: relative;
  z-index: 1;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1;
}

.es-app .level-card__desc {
  display: block;
  margin-top: 5px;
  color: var(--es-muted);
  font-size: 12px;
  line-height: 1.35;
}

.es-hsk30-group {
  position: relative;
  min-height: 300px;
  padding: clamp(28px, 6vw, 54px);
  overflow: hidden;
  border: 1px solid var(--es-border);
  border-radius: 26px;
  background: linear-gradient(135deg, color-mix(in srgb, #f97316 14%, var(--es-surface)), var(--es-surface));
}
.es-hsk30-group__orb {
  position: absolute;
  right: clamp(22px, 8vw, 80px);
  top: 50%;
  transform: translateY(-50%) rotate(8deg);
  display: grid;
  place-items: center;
  width: clamp(110px, 20vw, 180px);
  aspect-ratio: 1;
  border-radius: 34% 66% 55% 45%;
  background: linear-gradient(145deg, #fb923c, #e11d48);
  color: rgba(255,255,255,.88);
  font-family: var(--es-serif);
  font-size: clamp(50px, 9vw, 84px);
  box-shadow: 0 20px 50px rgba(225,29,72,.2);
}
.es-hsk30-group__eyebrow { color: #c2410c; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.es-hsk30-group h2 { max-width: 55%; margin: 10px 0; font: 600 clamp(28px,5vw,42px)/1.1 var(--es-serif); }
.es-hsk30-group > p:not(.es-hsk30-group__eyebrow) { max-width: 52%; color: var(--es-muted); line-height: 1.55; }
.es-hsk30-group button { margin-top: 14px; padding: 11px 16px; border: 0; border-radius: 12px; background: #ea580c; color: #fff; font: 700 13px var(--es-font); cursor: pointer; }

.es-app .dock-item-label {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--es-text) !important;
  opacity: 1 !important;
  position: static !important;
  transform: none !important;
}

.es-app .hsk30-coming-soon {
  opacity: 0.72;
}

.es-app .dock-icon-soon {
  background: linear-gradient(145deg, #a8a29a, #78716c) !important;
}

/* ── Options ── */
.es-app .options-header,
.es-app .exams-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 18px;
}

.es-app .section-title {
  margin: 0;
  font-family: var(--es-serif);
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.02em;
}

.es-app .section-description {
  margin: 4px 0 0;
  color: var(--es-muted);
  font-size: 14px;
}

.es-app .action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.es-app .action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--es-border);
  background: var(--es-surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.es-app .action-btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--es-accent) 45%, var(--es-border));
}

.es-app .action-btn.primary-btn {
  background: linear-gradient(145deg, color-mix(in srgb, var(--es-accent) 12%, var(--es-surface)), var(--es-surface));
}

.es-app .btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--es-surface-2);
  color: var(--es-accent-deep);
  flex-shrink: 0;
}

.es-app .btn-title {
  display: block;
  font-weight: 700;
  font-size: 17px;
}

.es-app .btn-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--es-muted);
  font-size: 13px;
}

.es-app .wizard-structure-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  box-shadow: none;
}

.es-app .wizard-structure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  margin-bottom: 22px;
  background: none !important;
  box-shadow: none !important;
}

.es-app .wizard-structure-header::before,
.es-app .wizard-structure-card::before {
  display: none !important;
  content: none !important;
}

.es-app .wizard-structure-header h3 {
  margin: 0;
  font-family: var(--es-font);
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--es-text);
}

.es-app .header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--es-accent-deep);
}

.es-app .header-left i { opacity: 0.7; }

.es-app .wizard-expand-btn {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--es-accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.es-app .wizard-expand-btn .expand-mark {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
}

.es-app .wizard-structure-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .95s cubic-bezier(.22,1,.36,1), opacity .45s ease;
}

.es-app .wizard-structure-content::after {
  display: none !important;
}

.es-app .wizard-structure-content.expanded {
  max-height: 4800px;
  opacity: 1;
}

/* ── Structure as diagram ── */
.es-app .es-map {
  display: grid;
  gap: 20px;
}

.es-app .es-map__flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: stretch;
  gap: 34px;
  padding: 12px 4px 4px;
}

.es-app .es-map__node {
  position: relative;
  min-width: 120px;
  padding: 14px 16px;
  border: 1px solid var(--es-border);
  border-radius: 14px;
  background: var(--es-surface);
  text-align: left;
}

.es-app .es-map__node:not(:last-of-type)::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  width: 35px;
  height: 2px;
  background: linear-gradient(90deg, var(--es-accent), #f97316);
  transform-origin: left;
}

.es-app .es-map__node-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--es-accent-deep);
  margin-bottom: 4px;
}

.es-app .es-map__node-title {
  display: block;
  font-family: var(--es-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.es-app .es-map__node-meta {
  display: block;
  margin-top: 6px;
  color: var(--es-muted);
  font-size: 13px;
}

.es-app .es-map__connector {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex: 0 0 28px;
  color: var(--es-accent);
  font-size: 16px;
  opacity: 0.7;
}

.es-app .es-map__lanes {
  gap: 22px;
}

.es-app .es-map__lane {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.es-app .es-map__lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--es-border);
}

.es-app .es-map__lane-head h4 {
  margin: 0;
  font-family: var(--es-serif);
  font-size: 17px;
  font-weight: 600;
}

.es-app .es-map__lane-head span {
  color: var(--es-muted);
  font-size: 13px;
  white-space: nowrap;
}

.es-app .es-map__steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid color-mix(in srgb, var(--es-accent) 35%, var(--es-border));
  display: grid;
  gap: 0;
}

.es-app .wizard-structure-content.is-revealing .es-map__node,
.es-app .wizard-structure-content.is-revealing .es-map__lane,
.es-app .wizard-structure-content.is-revealing .es-map__step {
  animation: esMapNodeIn .48s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--reveal-order, 0) * 110ms);
}
.es-app .wizard-structure-content.is-revealing .es-map__node:not(:last-of-type)::after {
  animation: esMapLineDraw .5s ease both;
  animation-delay: calc((var(--reveal-order, 0) + 1) * 110ms);
}
@keyframes esMapNodeIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes esMapLineDraw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.es-app .es-map__step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0 10px 8px;
}

.es-app .es-map__step:not(:last-child) {
  border-bottom: 1px dashed color-mix(in srgb, var(--es-border) 80%, transparent);
}

.es-app .es-map__step::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--es-surface);
  border: 2px solid var(--es-accent);
}

.es-app .es-map__idx {
  font-size: 12px;
  font-weight: 800;
  color: var(--es-accent-deep);
  padding-top: 2px;
}

.es-app .es-map__body {
  min-width: 0;
}

.es-app .es-map__range {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--es-text);
}

.es-app .es-map__desc {
  display: block;
  margin-top: 2px;
  color: var(--es-muted);
  font-size: 13px;
  line-height: 1.45;
}

.es-app .es-map__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--es-muted);
  padding-top: 2px;
  white-space: nowrap;
}

/* Kill legacy nested-card look inside structure */
.es-app .wizard-structure-section,
.es-app .wizard-section-header,
.es-app .wizard-section-summary,
.es-app .wizard-part-item,
.es-app .wizard-parts-container,
.es-app .wizard-sections-container {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.es-app .wizard-empty-structure {
  color: var(--es-muted);
  font-size: 14px;
  padding: 8px 0;
}

@media (max-width: 700px) {
  .es-app .es-map__flow {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .es-app .es-map__node:not(:last-of-type)::after { left: 50%; top: 100%; width: 2px; height: 9px; }
  .es-app .es-map__connector {
    width: auto;
    height: 20px;
    transform: rotate(90deg);
  }
  .es-app .es-map__step {
    grid-template-columns: 24px 1fr;
  }
  .es-app .es-map__count {
    grid-column: 2;
    padding-top: 0;
  }
}

/* Tree layout: skill trunk → part → format → count */
.es-app .es-map {
  position: relative;
  display: grid;
  gap: 0;
  padding: 4px 0 8px;
}

.es-app .es-map__paths {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.es-app .es-map__path {
  fill: none;
  stroke: color-mix(in srgb, var(--es-accent) 58%, var(--es-border));
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.es-app .es-map__path--2 { stroke: color-mix(in srgb, #2563eb 58%, var(--es-border)); }
.es-app .es-map__path--3 { stroke: color-mix(in srgb, #ea580c 58%, var(--es-border)); }

.es-app .es-map__lane {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  min-height: 76px;
  padding: 0 0 24px;
  animation: none !important;
}

.es-app .es-map__lane:last-child { padding-bottom: 0; }

.es-app .es-map__lane::before {
  display: none;
  content: none;
}

.es-app .es-map__lane:last-child::before { display: none; }

.es-app .es-map__lane::after {
  display: none;
  content: none;
}

.es-app .es-map__lane-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 9px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.es-app .es-map__skill-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--es-accent);
  border-radius: 50%;
  background: var(--es-bg);
  color: var(--es-accent-deep);
  font-size: 13px;
}

.es-app .es-map__lane-head > span:last-child { padding-top: 1px; }

.es-app .es-map__lane-head strong {
  display: block;
  font-family: var(--es-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
}

.es-app .es-map__lane-head small {
  display: block;
  margin-top: 4px;
  color: var(--es-muted);
  font-size: 11px;
  white-space: nowrap;
}

.es-app .es-map__steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  border-left: 0;
  display: grid;
  gap: 12px;
}

.es-app .es-map__step {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border: 0 !important;
}

.es-app .es-map__step::before {
  display: none;
  content: none;
}

.es-app .es-map__idx {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--es-accent) 56%, var(--es-border));
  border-radius: 50%;
  background: var(--es-bg);
  color: var(--es-accent-deep);
  font-size: 13px;
  font-weight: 800;
}

.es-app .es-map__desc {
  display: block;
  margin: 0;
  color: var(--es-text);
  font-size: 14px;
  line-height: 1.35;
}

.es-app .es-map__range {
  display: block;
  margin-top: 3px;
  color: var(--es-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.es-app .es-map__count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 58px;
  padding: 0;
  color: var(--es-accent-deep);
  white-space: nowrap;
}

.es-app .es-map__count strong { font: 600 20px/1 var(--es-serif); }
.es-app .es-map__count small { color: var(--es-muted); font-size: 11px; }

.es-app .wizard-structure-content.is-revealing .es-map__lane-head,
.es-app .wizard-structure-content.is-revealing .es-map__step {
  animation: esMapTreeNodeIn .9s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--reveal-order, 0) * 380ms);
}

.es-app .wizard-structure-content.is-revealing .es-map__path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: esMapPathDraw .8s cubic-bezier(.4,0,.2,1) both;
  animation-delay: calc(var(--reveal-order, 0) * 380ms - 170ms);
}

@keyframes esMapTreeNodeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}

@keyframes esMapLineDrawY {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes esMapPathDraw {
  from { stroke-dashoffset: 1; opacity: .25; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@media (max-width: 700px) {
  .es-app .es-map__lane { grid-template-columns: 82px minmax(0, 1fr); gap: 16px; }
  .es-app .es-map__lane::after { width: 82px; }
  .es-app .es-map__lane-head { display: block; }
  .es-app .es-map__lane-head > span:last-child { display: block; padding-top: 6px; }
  .es-app .es-map__lane-head strong { font-size: 16px; }
  .es-app .es-map__step { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .es-app .es-map__count { grid-column: 2; margin-top: -5px; }
}

@media (prefers-reduced-motion: reduce) {
  .es-app .wizard-structure-content,
  .es-app .wizard-structure-content.is-revealing .es-map__lane-head,
  .es-app .wizard-structure-content.is-revealing .es-map__lane::before,
  .es-app .wizard-structure-content.is-revealing .es-map__lane::after,
  .es-app .wizard-structure-content.is-revealing .es-map__step,
  .es-app .wizard-structure-content.is-revealing .es-map__step::before,
  .es-app .wizard-structure-content.is-revealing .es-map__path {
    animation: none;
    transition-duration: .01ms;
  }
}

/* ── Exam cards ── */
.es-app .exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.es-app .exam-card {
  position: relative;
  min-height: 120px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--es-border);
  background: var(--es-surface);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.es-app .exam-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--es-accent) 45%, var(--es-border));
}

.es-app .exam-card.gradient-blue,
.es-app .exam-card.gradient-green,
.es-app .exam-card.gradient-orange,
.es-app .exam-card.gradient-purple,
.es-app .exam-card.gradient-red {
  background: var(--es-surface) !important;
}

.es-app .message-container {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--es-surface);
  border: 1px solid var(--es-border);
}

/* Hide leftover homepage chrome on this page */
.es-app .hero-section,
.es-app .hskk-section,
.floating-tutorial-btn {
  display: none !important;
}

/* Override legacy exam_select width constraints */
.es-app .levels-section,
.es-app .options-section,
.es-app .exams-section,
.es-app .access-key-section {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.es-app .levels-section::before,
.es-app .levels-section::after,
.es-app .options-section::before,
.es-app .options-section::after,
.es-app .exams-section::before,
.es-app .exams-section::after,
.es-app .access-key-section::before,
.es-app .access-key-section::after {
  display: none !important;
  content: none !important;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .es-path-grid { grid-template-columns: 1fr; }
  .es-version-grid { grid-template-columns: 1fr; }
  .es-path { min-height: 160px; }
  .es-app .levels-grid,
  .es-app .dock-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .es-app .action-buttons { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .es-wizard__chrome { gap: 12px; }
  .es-wizard__steps { gap: 4px; }
  .es-wizard__step {
    font-size: 0;
    padding: 4px;
  }
  .es-wizard__step span {
    margin: 0;
  }
  .es-wizard__step.is-active {
    font-size: 12px;
    padding: 4px 10px 4px 4px;
  }
  .es-app .levels-grid,
  .es-app .dock-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .es-app .dock-item,
  .es-app .level-card {
    min-height: 120px;
    padding: 14px !important;
  }
  .es-app .ak-qr-actions { grid-template-columns: 1fr; }
  .es-hsk30-group__orb { opacity: .22; right: -20px; }
  .es-hsk30-group h2,
  .es-hsk30-group > p:not(.es-hsk30-group__eyebrow) { max-width: 100%; position: relative; }
  .es-app .exams-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .es-app .exams-grid { grid-template-columns: 1fr; }
}

/* ── Pro / key unlock modal ── */
.es-key-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 25, 23, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.es-key-modal__panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 22px;
  border: 1px solid var(--es-border, #e4ddd2);
  background: var(--es-surface, #fffdf8);
  color: var(--es-text, #1c1914);
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.18);
  animation: esKeyIn 0.28s ease;
}

@keyframes esKeyIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.es-key-modal__x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--es-muted, #6b645a);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.es-key-modal__x:hover {
  background: var(--es-surface-2, #f1ebe2);
  color: var(--es-text, #1c1914);
}

.es-key-modal__kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--es-accent-deep, #0f766e);
}

.es-key-modal__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(22px, 4vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  padding-right: 28px;
}

.es-key-modal__lead {
  margin: 10px 0 0;
  color: var(--es-muted, #6b645a);
  font-size: 14px;
  line-height: 1.55;
}

.es-key-modal__buy {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 55%, #0369a1 100%);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.28);
}

.es-key-modal__buy:hover { filter: brightness(1.04); }

.es-key-modal__contact {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--es-muted, #6b645a);
}

.es-key-modal__contact a {
  color: var(--es-accent-deep, #0f766e);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, #0d9488 35%, transparent);
}

.es-key-modal__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--es-muted, #6b645a);
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
}

.es-key-modal__divider::before,
.es-key-modal__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--es-border, #e4ddd2);
}

.es-key-modal__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--es-text, #1c1914);
}

.es-key-modal__row {
  display: flex;
  gap: 8px;
}

.es-key-modal__input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--es-border, #e4ddd2);
  border-radius: 12px;
  background: var(--es-surface-2, #f1ebe2);
  color: var(--es-text, #1c1914);
  font: inherit;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  outline: none;
}

.es-key-modal__input:focus {
  border-color: var(--es-accent, #0d9488);
  box-shadow: 0 0 0 3px color-mix(in srgb, #0d9488 18%, transparent);
  background: var(--es-surface, #fffdf8);
}

.es-key-modal__submit {
  flex-shrink: 0;
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #ea580c;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.es-key-modal__submit:hover { filter: brightness(1.05); }

.es-key-modal__error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  font-size: 13px;
}

[data-theme="dark"] .es-key-modal__panel {
  background: #1c1916;
  border-color: #3f3a34;
  color: #f5f0e8;
}

[data-theme="dark"] .es-key-modal__input {
  background: #26211c;
  border-color: #3f3a34;
  color: #f5f0e8;
}

@media (max-width: 420px) {
  .es-key-modal__row {
    flex-direction: column;
  }
  .es-key-modal__submit {
    width: 100%;
  }
}
