:root {
  --ink: #e8f0f4;
  --ink-dim: rgba(232, 240, 244, 0.62);
  --ink-mute: rgba(232, 240, 244, 0.38);
  --void: #000000;
  --void-2: #05080e;
  --panel: rgba(10, 24, 34, 0.82);
  --panel-solid: #0e2230;
  --line: rgba(126, 196, 186, 0.28);
  --line-strong: rgba(126, 196, 186, 0.55);
  --teal: #7ec4ba;
  --teal-bright: #a8e6dc;
  --amber: #e8b86d;
  --amber-deep: #c8893a;
  --coral: #e07a5f;
  --mint: #8fbf7a;
  --sky: #6aa6d8;
  --sand: #d4b483;
  --glow: 0 0 28px rgba(126, 196, 186, 0.18);
  --radius: 18px;
  --font-display: "Noto Serif SC", "Songti SC", serif;
  --font-ui: "Noto Sans SC", "PingFang SC", sans-serif;
  --font-mono: "Space Grotesk", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.stars,
.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stars {
  z-index: 0;
  pointer-events: none;
}

.globe-canvas {
  z-index: 1;
  cursor: grab;
}

.globe-canvas:active {
  cursor: grabbing;
}

.topbar,
.layer-dock,
.hint-bar,
.panel,
.legend,
.bottom-bar {
  z-index: 2;
  position: absolute;
}

.topbar {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 16, 24, 0.72) 0%, transparent 100%);
  padding-bottom: 48px;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  animation: rise 0.9s ease both;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #fff6e4 0 8%, transparent 9%),
    radial-gradient(circle at 58% 48%, #2f6f63 0 34%, #163a46 35% 68%, #0a1d28 69%);
  box-shadow:
    0 0 0 1px rgba(168, 230, 220, 0.35),
    0 0 24px rgba(126, 196, 186, 0.28);
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  gap: 10px;
  animation: rise 0.9s ease 0.08s both;
}

.ghost-btn,
.primary-btn,
.stamp-btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(14, 34, 48, 0.55);
  backdrop-filter: blur(10px);
}

.ghost-btn:hover {
  border-color: var(--line-strong);
  background: rgba(20, 48, 64, 0.75);
}

.sun-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sun-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-mute);
  box-shadow: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sun-toggle.is-on .sun-dot {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(232, 184, 109, 0.85);
}

.sun-toggle.is-on {
  border-color: rgba(232, 184, 109, 0.45);
  color: var(--amber);
}

.glow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.glow-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-mute);
  box-shadow: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.glow-toggle.is-on .glow-dot {
  background: #6eb6ff;
  box-shadow: 0 0 12px rgba(110, 182, 255, 0.9);
}

.glow-toggle.is-on {
  border-color: rgba(110, 182, 255, 0.45);
  color: #9dceff;
}

.cloud-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cloud-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-mute);
  box-shadow: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cloud-toggle.is-on .cloud-dot {
  background: #e8f2f6;
  box-shadow: 0 0 12px rgba(232, 242, 246, 0.75);
}

.cloud-toggle.is-on {
  border-color: rgba(220, 232, 240, 0.4);
  color: #dce8f0;
}

.primary-btn,
.stamp-btn {
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  color: #1a1208;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(200, 137, 58, 0.28);
}

.primary-btn:hover,
.stamp-btn:hover {
  transform: translateY(-1px);
}

.layer-dock {
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: min(220px, calc(100vw - 40px));
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--glow);
  animation: slide-left 0.85s ease 0.15s both;
}

.dock-label {
  margin: 0 0 4px 6px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

.layer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.layer-btn:hover {
  background: rgba(126, 196, 186, 0.08);
}

.layer-btn.active {
  background: rgba(126, 196, 186, 0.14);
  border-color: var(--line-strong);
}

.layer-btn strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.layer-btn small {
  display: block;
  margin-top: 2px;
  color: var(--ink-dim);
  font-size: 0.75rem;
}

.layer-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.layer-icon.countries {
  background:
    linear-gradient(135deg, rgba(106, 166, 216, 0.35), rgba(14, 34, 48, 0.9)),
    repeating-linear-gradient(90deg, transparent, transparent 7px, rgba(126, 196, 186, 0.25) 7px, rgba(126, 196, 186, 0.25) 8px);
}

.layer-icon.climates {
  background: conic-gradient(from 210deg, #e07a5f, #e8b86d, #8fbf7a, #6aa6d8, #e07a5f);
  opacity: 0.9;
}

.layer-icon.mountains {
  background:
    linear-gradient(160deg, transparent 40%, rgba(212, 180, 131, 0.85) 40% 55%, transparent 55%),
    linear-gradient(200deg, transparent 35%, rgba(168, 230, 220, 0.55) 35% 62%, transparent 62%),
    #163a46;
}

.layer-icon.continents {
  background:
    radial-gradient(circle at 35% 60%, rgba(127, 212, 196, 0.9) 0 22%, transparent 23%),
    radial-gradient(circle at 70% 35%, rgba(127, 212, 196, 0.7) 0 16%, transparent 17%),
    radial-gradient(circle at 25% 30%, rgba(127, 212, 196, 0.6) 0 12%, transparent 13%),
    #0f3340;
}

.layer-icon.oceans {
  background:
    radial-gradient(circle at 50% 50%, rgba(106, 166, 216, 0.55) 0 55%, transparent 56%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 6px, rgba(159, 208, 255, 0.25) 6px 7px),
    #0a2030;
}

.layer-icon.landforms {
  background:
    linear-gradient(180deg, transparent 55%, rgba(176, 141, 87, 0.85) 55% 70%, transparent 70%),
    linear-gradient(180deg, rgba(255, 209, 102, 0.6) 0 18%, transparent 18%),
    radial-gradient(circle at 70% 75%, rgba(255, 209, 102, 0.5) 0 14%, transparent 15%),
    #2a2118;
}

.layer-icon.seafloor {
  background:
    linear-gradient(180deg, rgba(106, 166, 216, 0.85) 0 22%, transparent 22% 40%, rgba(63, 127, 176, 0.7) 40% 55%, transparent 55% 72%, rgba(10, 32, 48, 0.95) 72%),
    #0a2030;
}

.layer-icon.plates {
  background:
    conic-gradient(from 30deg, #ff9f43, #ff5d8f, #ff9f43, #ff5d8f, #ff9f43);
  opacity: 0.85;
}

/* ---------- Search box ---------- */
.search-box {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--glow);
  width: min(420px, calc(100vw - 40px));
  animation: rise 0.7s ease 0.2s both;
}

.search-icon {
  color: var(--ink-dim);
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.search-box input::placeholder {
  color: var(--ink-mute);
}

.search-go {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: rgba(126, 196, 186, 0.16);
  color: var(--ink);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.search-go:hover {
  background: rgba(126, 196, 186, 0.32);
  border-color: rgba(126, 196, 186, 0.5);
}

.search-status {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--ink-dim);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-status.error { color: #e07a5f; }
.search-status.ok { color: #7fd4c4; }

.hint-bar {
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 24, 34, 0.7);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  font-size: 0.84rem;
  color: var(--ink-dim);
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: rise 1s ease 0.35s both;
  pointer-events: none;
}

.hint-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 12px var(--teal);
  flex-shrink: 0;
  animation: pulse 2.2s ease infinite;
}

.panel {
  top: 108px;
  right: 28px;
  width: min(360px, calc(100vw - 40px));
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 24px 24px 18px;
  border-radius: 22px;
  background:
    linear-gradient(165deg, rgba(18, 40, 52, 0.94), rgba(10, 24, 34, 0.92)),
    radial-gradient(circle at 100% 0%, rgba(232, 184, 109, 0.12), transparent 45%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow), 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  animation: panel-in 0.35s ease both;
}

.panel[hidden] {
  display: none;
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  color: var(--ink-dim);
  line-height: 1;
}

.panel-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.panel-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.2;
}

.panel-sub {
  margin: 8px 0 0;
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 4px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  border: 1px solid var(--line);
  color: var(--teal-bright);
  background: rgba(126, 196, 186, 0.08);
}

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

.panel-body section {
  padding: 14px 0;
  border-top: 1px solid rgba(126, 196, 186, 0.14);
}

.panel-body h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  font-weight: 600;
}

.panel-body p,
.panel-body li {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink);
}

.panel-body ul {
  margin: 0;
  padding-left: 1.1rem;
}

.panel-body li + li {
  margin-top: 6px;
}

.panel-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(126, 196, 186, 0.14);
}

.panel-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.show-cities-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(126, 196, 186, 0.45);
  background: rgba(126, 196, 186, 0.18);
  color: var(--ink);
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.show-cities-btn:hover {
  background: rgba(126, 196, 186, 0.34);
  border-color: rgba(126, 196, 186, 0.7);
}

.show-cities-btn:active {
  transform: scale(0.98);
}

.stamp-count {
  font-size: 0.8rem;
  color: var(--ink-dim);
  font-family: var(--font-mono);
}

.stamp-btn.stamped {
  background: linear-gradient(135deg, var(--mint), #5f9a52);
  color: #0d1a0c;
}

.legend {
  right: 28px;
  bottom: 108px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(10, 24, 34, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  color: var(--ink-dim);
  max-width: 200px;
  animation: rise 0.8s ease 0.25s both;
}

.legend[hidden] {
  display: none;
}

.legend-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.bottom-bar {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px 24px;
  background: linear-gradient(0deg, rgba(6, 16, 24, 0.88) 0%, transparent 100%);
  pointer-events: none;
}

.bottom-bar > * {
  pointer-events: auto;
}

.progress-wrap {
  flex: 1;
  max-width: 360px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-dim);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.45s ease;
}

.zoom-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 36vw);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10, 24, 34, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.zoom-label {
  font-size: 0.74rem;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126, 196, 186, 0.25), rgba(232, 184, 109, 0.55));
  outline: none;
  cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe2a8, var(--amber-deep));
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 10px rgba(200, 137, 58, 0.45);
  cursor: grab;
}

.zoom-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.zoom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe2a8, var(--amber-deep));
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 10px rgba(200, 137, 58, 0.45);
  cursor: grab;
}

.hotkeys {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-mute);
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(14, 34, 48, 0.8);
  color: var(--teal-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.quiz-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 16, 0.72);
  backdrop-filter: blur(8px);
  animation: fade 0.25s ease both;
}

/* Hide globe name chips while quiz is open — they shared z-index and punched through */
.app.is-quiz .label-layer {
  visibility: hidden;
}

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

.quiz-card {
  width: min(440px, calc(100vw - 40px));
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(165deg, #132b3a, #0c1d28);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.quiz-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--amber);
}

.quiz-card h2 {
  margin: 10px 0 18px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.35;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(126, 196, 186, 0.1);
}

.quiz-option.correct {
  border-color: var(--mint);
  background: rgba(143, 191, 122, 0.16);
}

.quiz-option.wrong {
  border-color: var(--coral);
  background: rgba(224, 122, 95, 0.14);
}

.quiz-feedback {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--ink-dim);
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.quiz-score {
  margin: 14px 0 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-mute);
}

/* ---------- Review handbook ---------- */
.review-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 16, 0.78);
  backdrop-filter: blur(8px);
  animation: fade 0.25s ease both;
  z-index: 20;
}
.review-overlay[hidden] { display: none; }

.review-card {
  width: min(720px, calc(100vw - 32px));
  max-height: min(82vh, 860px);
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(165deg, #132b3a, #0c1d28);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.review-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--amber);
  white-space: nowrap;
}
.review-head input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--ink);
  font-size: 0.86rem;
  outline: none;
}
.review-head input::placeholder { color: var(--ink-mute); }

.review-body {
  overflow-y: auto;
  padding-right: 4px;
  line-height: 1.55;
}
.review-part {
  margin: 4px 0 14px;
}
.review-part-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--mint);
  margin: 10px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.review-chapter > summary,
.review-section > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.review-chapter > summary::-webkit-details-marker,
.review-section > summary::-webkit-details-marker { display: none; }
.review-chapter > summary {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 8px 0 4px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(126, 196, 186, 0.08);
}
.review-chapter > summary::before {
  content: "▸ ";
  color: var(--ink-dim);
}
.review-chapter[open] > summary::before { content: "▾ "; }
.review-section > summary {
  font-size: 0.86rem;
  color: var(--ink-dim);
  margin: 4px 0 2px 6px;
  padding: 3px 8px;
}
.review-section > summary::before { content: "· "; color: var(--amber); }
.review-section[open] > summary { color: var(--ink); }
.review-points {
  margin: 4px 0 8px 14px;
  padding: 0 0 0 10px;
  border-left: 2px solid rgba(126, 196, 186, 0.25);
}
.review-points li {
  list-style: none;
  font-size: 0.84rem;
  color: var(--ink-dim);
  margin: 3px 0;
}
.review-points li strong { color: var(--ink); }
.review-section.hide-empty, .review-chapter.hide-empty, .review-part.hide-empty { display: none; }


.label-chip {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border-radius: 999px;
  background: rgba(8, 20, 28, 0.88);
  border: 1px solid rgba(232, 184, 109, 0.45);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.label-chip.visible {
  opacity: 1;
}

.label-chip .pin {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(232, 184, 109, 0.8);
}

.label-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-left {
  from {
    opacity: 0;
    transform: translate(-18px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

@media (max-width: 860px) {
  .topbar {
    padding: 18px 16px 40px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .search-box {
    top: auto;
    bottom: 168px;
    width: calc(100vw - 24px);
  }

  .search-status {
    display: none;
  }

  .layer-dock {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 96px;
    transform: none;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px;
    animation: rise 0.8s ease both;
  }

  .dock-label,
  .layer-btn small {
    display: none;
  }

  .layer-btn {
    padding: 8px;
  }

  .layer-btn strong {
    font-size: 0.78rem;
  }

  .panel {
    top: auto;
    bottom: 160px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: 42vh;
  }

  .legend {
    display: none;
  }

  .hint-bar {
    bottom: 168px;
    font-size: 0.75rem;
  }

  .bottom-bar {
    padding: 12px 16px 18px;
    flex-direction: column;
    align-items: stretch;
  }

  .hotkeys {
    display: none;
  }

  .progress-wrap {
    max-width: none;
  }

  .zoom-wrap {
    min-width: 0;
    width: 100%;
  }
}
