/* OWMap BSL1 — Web Frontend Styles
   Cinematic cosmic stillness × art-installation warmth
   Tokens are locked to the design brief. */

:root {
  /* Base — cosmos */
  --deep-black:   #050D18;
  --cosmos-blue:  #0A1929;
  --nebula-purple:#1A1040;

  /* Content */
  --story-gold:   #F5C842;
  --candle-orange:#E87A3C;
  --moon-white:   #E8E8F0;
  --dawn-gray:    #8A9BB0;
  --dawn-dim:     #5A6878;

  /* Lines & surfaces */
  --line-soft:    rgba(232, 232, 240, 0.08);
  --line-medium:  rgba(232, 232, 240, 0.14);
  --surface-1:    rgba(10, 25, 41, 0.55);
  --surface-2:    rgba(10, 25, 41, 0.78);
  --surface-glass:rgba(5, 13, 24, 0.65);

  /* Type */
  --font-display: "Fraunces", "Source Han Serif SC", "Songti SC", serif;
  --font-prose:   "Lora", "Source Han Serif SC", "Songti SC", serif;
  --font-ui:      "Sohne-fallback", "General Sans", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "Space Mono", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #02050b; color: var(--moon-white); }
body {
  font-family: var(--font-ui);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
em { font-style: italic; color: var(--story-gold); font-family: var(--font-prose); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232,232,240,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,232,240,0.16); }

/* ---------- App shell ---------- */
.app {
  position: relative;
  width: 100vw; height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

/* Cosmos background — radial deep-space gradient */
.bg-cosmos {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, #0A1929 0%, #050D18 45%, #02050b 100%),
    radial-gradient(circle at 18% 80%, rgba(26, 16, 64, 0.55) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(91, 143, 214, 0.08) 0%, transparent 40%);
}
.bg-vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, transparent 60%, rgba(0,0,0,0.65) 100%);
}
.bg-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.95  0 0 0 0 0.95  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ---------- Top HUD ---------- */
.top-hud {
  position: absolute; top: 20px; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0 24px; pointer-events: none;
}

/* Clock: positioned above globe column (left-panel=280px, so center of globe starts there) */
.hud-clock {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: flex-start;
  font-family: var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  /* 280px left-panel + 22px globe left-padding = 302px, give a little breathing room */
  margin-left: 308px;
  padding: 6px 0;
}
.hud-clock-time { font-size: 12px; color: var(--story-gold); line-height: 1; }
.hud-clock-meta { font-size: 9.5px; color: var(--dawn-gray); margin-top: 3px; white-space: nowrap; }

/* Actions row */
.hud-actions { pointer-events: auto; display: flex; gap: 8px; align-items: center; }
.hud-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-medium); background: var(--surface-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--dawn-gray);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}
.hud-btn:hover { color: var(--moon-white); border-color: var(--story-gold); }
.hud-btn-primary {
  width: auto; height: 40px; padding: 0 18px;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--story-gold); border-color: rgba(245, 200, 66, 0.4);
  border-radius: 999px;
}
.hud-btn-primary:hover { background: rgba(245, 200, 66, 0.08); }
.hud-btn-member { color: rgba(245, 200, 66, 0.65); border-color: rgba(245, 200, 66, 0.22); }
.hud-btn-member:hover { color: var(--story-gold); border-color: rgba(245, 200, 66, 0.55); background: rgba(245,200,66,0.05); }
.hud-btn-brew  { color: #c8973a; border-color: rgba(200, 151, 58, 0.30); }
.hud-btn-brew:hover { color: #f5c842; border-color: rgba(200, 151, 58, 0.55); background: rgba(200,151,58,0.06); }
.hud-btn-brew.is-active { color: #f5c842; border-color: rgba(245, 200, 66, 0.55); background: rgba(200,151,58,0.10); }

/* ---------- Three-column main grid ---------- */
.main-grid {
  position: absolute; inset: 0; z-index: 10;
  display: grid;
  grid-template-columns: 280px 1fr 360px;
  gap: 0;
  padding-bottom: 64px; /* play bar */
}

/* ---------- Left panel ---------- */
.left-panel {
  position: relative; z-index: 11;
  padding: 22px 22px 24px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(5, 13, 24, 0.92) 0%, rgba(5, 13, 24, 0.78) 100%);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 200, 66, 0.12), transparent 70%);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-name {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--moon-white);
}
.brand-sub {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dawn-gray); margin-top: 1px;
}

.search-wrap {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--cosmos-blue);
  border-radius: 10px;
  color: var(--dawn-gray);
  transition: border-color 0.2s;
}
.search-wrap:focus-within { border-color: rgba(245, 200, 66, 0.4); }
.search-icon { color: var(--dawn-gray); flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--moon-white); font-size: 12px; font-family: var(--font-ui);
}
.search-input::placeholder { color: var(--dawn-dim); font-style: italic; }
.kbd {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line-medium); color: var(--dawn-gray);
}

.filter-stack { display: flex; flex-direction: column; gap: 4px; }
.filter-group { border-bottom: 1px solid var(--line-soft); padding: 4px 0 10px; }
.filter-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; background: none; border: none; outline: none;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dawn-gray);
}
.filter-head:hover { color: var(--moon-white); }
.filter-body { padding-top: 4px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; padding: 6px 10px; border-radius: 999px;
  background: rgba(232,232,240,0.04); border: 1px solid var(--line-soft);
  color: var(--dawn-gray); transition: all 0.15s;
}
.chip:hover { color: var(--moon-white); border-color: var(--line-medium); }
.chip-on { background: rgba(245, 200, 66, 0.1); border-color: rgba(245, 200, 66, 0.4); color: var(--story-gold); }

.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 3px;
  background: rgba(0,0,0,0.25);
}
.seg-btn {
  font-size: 11px; padding: 7px 6px; border-radius: 6px;
  background: none; border: none; color: var(--dawn-gray); transition: all 0.15s;
}
.seg-on { background: rgba(245, 200, 66, 0.12); color: var(--story-gold); }

.duration-row { display: flex; align-items: center; gap: 10px; }
.dur-num { font-family: var(--font-mono); font-size: 11px; color: var(--story-gold); width: 16px; text-align: center; }
.dur-track { position: relative; flex: 1; height: 24px; }
.dur-track::before {
  content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: var(--line-soft); transform: translateY(-50%);
}
.dur-fill {
  position: absolute; top: 50%; height: 1px; background: var(--story-gold);
  transform: translateY(-50%);
}
.dur-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.dur-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--story-gold); border: 2px solid var(--deep-black);
  pointer-events: auto; cursor: grab;
  box-shadow: 0 0 8px rgba(245, 200, 66, 0.5);
}
.dur-input::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--story-gold); border: 2px solid var(--deep-black);
  pointer-events: auto; cursor: grab;
}

.culture-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.culture-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  background: rgba(232,232,240,0.03); border: 1px solid var(--line-soft);
  color: var(--moon-white); font-size: 11.5px; transition: all 0.15s;
}
.culture-pill:hover { background: rgba(232,232,240,0.06); }
.culture-off { opacity: 0.4; }
.culture-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.culture-clear {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dawn-dim); background: none; border: none; padding: 4px 0;
}
.culture-clear:hover { color: var(--story-gold); }

.smart-pick {
  position: relative; cursor: pointer;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(232, 122, 60, 0.35);
  background: linear-gradient(135deg, rgba(232, 122, 60, 0.18), rgba(245, 200, 66, 0.08));
  overflow: hidden;
  transition: all 0.2s;
}
.smart-pick:hover { transform: translateY(-1px); border-color: rgba(232, 122, 60, 0.6); }
.smart-glow {
  position: absolute; inset: -1px; pointer-events: none;
  background: radial-gradient(circle at 30% 50%, rgba(245, 200, 66, 0.15), transparent 60%);
  animation: smartPulse 4s ease-in-out infinite;
}
@keyframes smartPulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
.smart-content { position: relative; display: flex; align-items: center; gap: 10px; }
.smart-icon { width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.3); display: inline-flex; align-items: center; justify-content: center; }
.smart-text { flex: 1; }
.smart-title { font-size: 13px; color: var(--moon-white); font-weight: 500; letter-spacing: 0.02em; }
.smart-sub { font-size: 10px; color: var(--dawn-gray); margin-top: 2px; }
.smart-arrow { color: var(--story-gold); }

.left-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.foot-btn {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; background: none; border: none;
  font-size: 11px; color: var(--dawn-gray);
}
.foot-btn:hover { color: var(--moon-white); }
.foot-val { font-family: var(--font-mono); font-size: 10px; color: var(--moon-white); }

/* ---------- Globe area ---------- */
.globe-area { position: relative; overflow: hidden; }
.globe-area > div:first-child { width: 100%; height: 100%; }

/* Reticle / graticule signature ring */
.globe-reticle {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.globe-reticle-svg {
  width: min(96%, 96vh); height: min(96%, 96vh);
  opacity: 0.9;
  animation: reticleDrift 60s linear infinite;
}
@keyframes reticleDrift { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* Top-left HUD upgrade */
.globe-hud-tl {
  position: absolute; top: 22px; left: 22px; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; gap: 6px;
}
.globe-stat-meta {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dawn-dim); padding-left: 4px;
  white-space: nowrap;
}
.meta-key { color: var(--dawn-dim); }
.meta-val { color: var(--dawn-gray); }

/* Legend (refined) */
.legend-head {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--dawn-dim); margin-bottom: 4px;
  white-space: nowrap;
}

/* Top-right geo key */
.globe-hud-tr {
  position: absolute; top: 70px; right: 22px; z-index: 5; pointer-events: none;
}
.geo-key {
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--dawn-gray);
}
.geo-key-row { display: flex; align-items: center; gap: 8px; }
.geo-key-line { display: inline-block; width: 16px; height: 1px; }
.geo-key-eq { background: rgba(245, 200, 66, 0.9); }
.geo-key-tr { background: rgba(245, 200, 66, 0.45); }
.geo-key-pc { background: rgba(245, 200, 66, 0.25); }

/* Readout divider */
.readout-divider { height: 1px; background: var(--line-soft); margin: 6px 0; }

/* Hover tooltip */
.globe-tooltip {
  position: fixed; z-index: 30; pointer-events: none;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(2, 5, 11, 0.92); border: 1px solid var(--line-medium);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-ui);
  animation: ttIn 0.18s ease-out;
}
@keyframes ttIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; } }
.tt-title { font-family: var(--font-display); font-size: 13px; color: var(--moon-white); }
.tt-coord { font-family: var(--font-mono); font-size: 10px; color: var(--story-gold); margin-top: 4px; letter-spacing: 0.04em; }
.tt-hint { font-size: 9.5px; color: var(--dawn-dim); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); letter-spacing: 0.1em; text-transform: uppercase; }

.globe-hud-tl { position: absolute; top: 22px; left: 22px; z-index: 5; pointer-events: none; }
.globe-stat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dawn-gray);
  width: fit-content;
}
.globe-stat-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--candle-orange);
  box-shadow: 0 0 8px var(--candle-orange);
  animation: stat-pulse 2.5s ease-in-out infinite;
}
@keyframes stat-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.globe-hud-bl {
  position: absolute; bottom: 24px; left: 22px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
}
.globe-legend {
  padding: 12px 14px;
  background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 10.5px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-label { color: var(--dawn-gray); letter-spacing: 0.04em; }

.globe-hud-br {
  position: absolute; bottom: 24px; right: 22px; z-index: 5;
  padding: 12px 14px;
  background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  font-family: var(--font-mono); font-size: 10px;
}
.readout-line { display: flex; gap: 10px; padding: 2px 0; }
.readout-key { color: var(--dawn-dim); letter-spacing: 0.1em; min-width: 32px; }
.readout-val { color: var(--story-gold); letter-spacing: 0.04em; }

.globe-hud-top {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 5;
}
.avant-caption {
  display: flex; gap: 14px; align-items: center;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(245, 200, 66, 0.08); border: 1px solid rgba(245, 200, 66, 0.25);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
}
.avant-caption-num { color: var(--candle-orange); font-weight: 700; }
.avant-caption-text { color: var(--moon-white); }

/* ---------- Right panel ---------- */
.right-panel {
  position: relative; z-index: 11;
  /* top: 74px clears top-hud (top:20px + 40px btn + 14px gap) */
  padding: 74px 22px 24px;
  border-left: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(5, 13, 24, 0.92) 0%, rgba(5, 13, 24, 0.82) 100%);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}

/* Default state */
.right-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0 8px; }
.right-title-fr {
  font-family: var(--font-display); font-style: italic; font-size: 16px;
  color: var(--candle-orange); letter-spacing: 0.04em; opacity: 0.85;
}
.right-title-cn {
  font-family: var(--font-display); font-size: 28px; font-weight: 400;
  color: var(--story-gold); letter-spacing: 0.04em; margin-top: 4px;
}
.right-sub { font-size: 11px; color: var(--dawn-gray); margin-top: 8px; letter-spacing: 0.04em; }

.featured-card {
  border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden;
  background: rgba(0,0,0,0.25);
}
.featured-pic {
  position: relative; height: 140px; overflow: hidden;
  background: var(--cosmos-blue);
}
.featured-pic-inner { position: absolute; inset: 0; }
.featured-pic::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(232,232,240,0.025) 0 1px, transparent 1px 14px);
}
.featured-coord-meta { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; }
.culture-tag {
  font-size: 9.5px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid; letter-spacing: 0.1em; text-transform: uppercase;
}
.featured-coord-tech { font-family: var(--font-mono); font-size: 9.5px; color: var(--dawn-gray); }
.featured-body { padding: 14px; }
.featured-name { font-family: var(--font-display); font-size: 18px; color: var(--moon-white); }
.featured-region { font-size: 11px; color: var(--dawn-gray); margin-top: 2px; }
.featured-story { font-family: var(--font-display); font-style: italic; font-size: 13px; color: var(--story-gold); margin-top: 10px; }
.featured-excerpt { font-family: var(--font-prose); font-size: 12.5px; color: var(--moon-white); line-height: 1.65; margin-top: 8px; opacity: 0.85; }
.featured-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.play-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--candle-orange); border: none; color: #fff;
  font-size: 11px; letter-spacing: 0.04em; transition: all 0.2s;
}
.play-pill:hover { background: #f08a4a; box-shadow: 0 4px 16px rgba(232, 122, 60, 0.35); }
.featured-dots { display: flex; gap: 5px; }
.fdot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-medium); }
.fdot-on { background: var(--story-gold); }

.right-block { display: flex; flex-direction: column; gap: 8px; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.block-head > span { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dawn-gray); }
.link-btn { background: none; border: none; font-size: 11px; color: var(--story-gold); }

.recs { display: flex; flex-direction: column; gap: 4px; }
.rec-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; background: none; border: none; border-bottom: 1px solid var(--line-soft);
  text-align: left; transition: padding 0.2s;
}
.rec-row:hover { padding-left: 4px; }
.rec-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.rec-text { flex: 1; }
.rec-title { font-size: 12.5px; color: var(--moon-white); font-family: var(--font-display); }
.rec-meta { font-size: 10.5px; color: var(--dawn-gray); margin-top: 2px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.rec-play { color: var(--candle-orange); }

/* Selected state */
.coord-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.coord-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.coord-tag-dot { width: 5px; height: 5px; border-radius: 50%; }
.coord-name { font-family: var(--font-display); font-size: 30px; font-weight: 400; color: var(--story-gold); margin-top: 10px; letter-spacing: 0.02em; }
.coord-region { font-size: 12px; color: var(--dawn-gray); margin-top: 2px; }
.coord-tech { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-family: var(--font-mono); font-size: 10px; color: var(--dawn-dim); }
.coord-tech-dot { color: var(--dawn-dim); opacity: 0.5; }

.coord-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line-soft); padding: 14px 0; gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--font-display); font-size: 18px; color: var(--moon-white); }
.stat-label { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dawn-gray); margin-top: 4px; }

.story-list { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.story-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(232, 232, 240, 0.02);
  transition: all 0.2s;
}
.story-card:hover { border-color: var(--line-medium); background: rgba(232, 232, 240, 0.04); }
.story-active { border-color: rgba(232, 122, 60, 0.5); background: rgba(232, 122, 60, 0.06); }

.story-card-head { display: flex; gap: 12px; align-items: flex-start; }
.story-num { font-family: var(--font-mono); font-size: 11px; color: var(--dawn-dim); padding-top: 2px; }
.story-card-titles { flex: 1; }
.story-title { font-family: var(--font-display); font-size: 15px; color: var(--moon-white); letter-spacing: 0.01em; }
.story-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 9.5px; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line-soft); color: var(--dawn-gray); letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 4px; }
.tag-genre { background: rgba(0,0,0,0.2); }
.tag-time { color: var(--dawn-dim); }
.tag-paid { color: var(--story-gold); border-color: rgba(245, 200, 66, 0.3); }
.story-bookmark { background: none; border: none; color: var(--dawn-dim); transition: color 0.15s; }
.story-bookmark:hover { color: var(--story-gold); }

.story-excerpt { font-family: var(--font-prose); font-size: 12.5px; color: var(--moon-white); opacity: 0.78; line-height: 1.7; margin: 12px 0 12px; padding-left: 24px; border-left: 1px solid rgba(245, 200, 66, 0.25); }
.story-foot { display: flex; justify-content: space-between; align-items: center; }
.story-gen { font-family: var(--font-mono); font-size: 9.5px; color: var(--dawn-dim); letter-spacing: 0.04em; }
.story-foot-actions { display: flex; align-items: center; gap: 12px; }
.story-plays { font-family: var(--font-mono); font-size: 10px; color: var(--dawn-gray); }
.story-play {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.story-play:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(232, 122, 60, 0.45); }

.generate-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-medium);
  background: none;
  color: var(--dawn-gray);
  text-align: left;
  transition: all 0.2s;
}
.generate-card:hover { border-color: var(--story-gold); color: var(--moon-white); }
.generate-icon { color: var(--story-gold); }
.generate-title { font-family: var(--font-display); font-size: 13px; }
.generate-sub { font-size: 10px; margin-top: 2px; font-family: var(--font-mono); letter-spacing: 0.04em; }

/* ---------- Bottom play bar ---------- */
.play-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 64px; z-index: 25;
  display: grid; grid-template-columns: 280px 1fr 360px;
  align-items: center;
  padding: 0 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(2, 5, 11, 0.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.pb-left { display: flex; align-items: center; gap: 10px; padding-right: 16px; }
.pb-coord-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pb-text { min-width: 0; }
.pb-title { font-family: var(--font-display); font-size: 12.5px; color: var(--moon-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-coord { font-size: 10px; color: var(--dawn-gray); margin-top: 2px; font-family: var(--font-mono); letter-spacing: 0.04em; }

.pb-center { display: flex; flex-direction: column; gap: 4px; padding: 0 32px; }
.pb-progress { position: relative; height: 3px; background: var(--line-soft); border-radius: 2px; cursor: pointer; }
.pb-progress-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--candle-orange); border-radius: 2px; }
.pb-progress-thumb {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%; background: var(--candle-orange);
  box-shadow: 0 0 12px rgba(232, 122, 60, 0.6);
}
.pb-times { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9.5px; color: var(--dawn-gray); letter-spacing: 0.04em; }

.pb-right { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.pb-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: none; border: none; color: var(--dawn-gray);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.pb-icon:hover { color: var(--moon-white); }
.pb-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--candle-orange); border: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pb-toggle:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(232, 122, 60, 0.5); }
.pb-divider { width: 1px; height: 16px; background: var(--line-soft); margin: 0 6px; }
.pb-speed { width: auto; padding: 0 8px; font-family: var(--font-mono); font-size: 10px; }

/* ---------- Onboarding ---------- */
.onb-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at 50% 50%, rgba(10, 25, 41, 0.96) 0%, rgba(2, 5, 11, 0.99) 70%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: onbIn 0.6s ease-out;
  padding: 40px;
}
@keyframes onbIn { from { opacity: 0; } to { opacity: 1; } }
.onb-exit { animation: onbOut 0.7s ease-in forwards; }
@keyframes onbOut { to { opacity: 0; transform: scale(1.05); } }

.onb-bg-orb {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 700px; height: 700px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(245, 200, 66, 0.05) 0%, transparent 60%);
  animation: orbBreath 8s ease-in-out infinite;
}
@keyframes orbBreath { 0%,100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; } 50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } }

.onb-skip {
  position: absolute; top: 24px; right: 24px;
  background: none; border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 8px 14px; font-size: 11px; letter-spacing: 0.1em; color: var(--dawn-gray);
}
.onb-skip:hover { color: var(--moon-white); border-color: var(--line-medium); }

.onb-content { position: relative; max-width: 640px; width: 100%; text-align: center; }
.onb-step-anim { animation: stepIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.onb-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--candle-orange); margin-bottom: 28px;
}
.onb-h {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(38px, 5.5vw, 64px); line-height: 1.1;
  margin: 0 0 28px; letter-spacing: -0.01em;
  display: flex; flex-direction: column; gap: 4px;
}
.onb-h-line { color: var(--moon-white); }
.onb-h-italic { font-style: italic; color: var(--dawn-gray); font-size: 0.85em; }
.onb-h-gold { color: var(--story-gold); }

.onb-p {
  font-family: var(--font-prose); font-size: 16px; line-height: 1.8;
  color: var(--dawn-gray); margin: 0 auto; max-width: 480px;
}

.onb-meta-row { display: inline-flex; gap: 26px; align-items: center; margin-top: 36px; }
.onb-meta-item { display: flex; flex-direction: column; align-items: center; }
.onb-meta-num { font-family: var(--font-display); font-size: 30px; color: var(--story-gold); }
.onb-meta-lbl { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dawn-gray); margin-top: 4px; }
.onb-meta-divider { width: 1px; height: 30px; background: var(--line-soft); }

.onb-firefly-demo { margin: 24px auto; max-width: 360px; }
.onb-demo-svg { width: 100%; height: auto; }
.onb-ff { animation: ffPulse 3s ease-in-out infinite; }
.onb-ff-1 { animation-delay: 0s; }
.onb-ff-2 { animation-delay: 0.7s; }
.onb-ff-3 { animation-delay: 1.4s; }
.onb-ff-4 { animation-delay: 2.1s; }
@keyframes ffPulse { 0%,100% { transform-origin: center; transform: scale(0.8); opacity: 0.6; } 50% { transform: scale(1.1); opacity: 1; } }

.onb-permission { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 30px auto 0; }
.onb-perm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: rgba(232, 232, 240, 0.04); border: 1px solid var(--line-soft);
}
.onb-perm-icon { font-size: 16px; }
.onb-perm-text { flex: 1; text-align: left; font-size: 13px; color: var(--moon-white); }
.onb-perm-tog { width: 32px; height: 18px; border-radius: 999px; background: var(--line-soft); position: relative; transition: background 0.2s; }
.onb-perm-on { background: var(--candle-orange); }
.onb-perm-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.onb-perm-on .onb-perm-knob { left: 16px; }

.onb-foot { position: relative; margin-top: 56px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.onb-dots { display: flex; gap: 8px; }
.onb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-soft); transition: all 0.3s; }
.onb-dot-on { background: var(--story-gold); width: 22px; border-radius: 999px; }
.onb-dot-past { background: var(--dawn-dim); }
.onb-next {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px;
  background: var(--candle-orange); border: none; color: #fff;
  font-size: 13px; letter-spacing: 0.04em;
  transition: all 0.2s;
}
.onb-next:hover { background: #f08a4a; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(232, 122, 60, 0.4); }

/* ---------- H5 shell (in-canvas mobile preview) ---------- */
.h5-shell {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(ellipse at 50% 50%, rgba(10, 25, 41, 0.78) 0%, rgba(2, 5, 11, 0.95) 70%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  gap: 60px;
  animation: onbIn 0.4s ease-out;
}
.h5-frame {
  position: relative;
  width: 375px; height: 760px;
  border-radius: 44px;
  background: var(--deep-black);
  border: 8px solid #16181c;
  box-shadow: 0 0 0 1px #2a2d35, 0 30px 80px rgba(0,0,0,0.7), 0 0 60px rgba(245, 200, 66, 0.06);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.h5-statusbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 6px; }
.h5-time { font-family: var(--font-mono); font-size: 13px; color: var(--moon-white); font-weight: 600; }
.h5-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 999px; background: #000; }
.h5-status-icons { display: flex; gap: 5px; align-items: center; }
.h5-batt { width: 22px; height: 11px; border: 1px solid rgba(255,255,255,0.6); border-radius: 3px; padding: 1px; position: relative; }
.h5-batt::after { content: ""; position: absolute; right: -3px; top: 3px; width: 2px; height: 5px; background: rgba(255,255,255,0.6); border-radius: 0 1px 1px 0; }
.h5-batt-inner { display: block; width: 80%; height: 100%; background: #fff; border-radius: 1px; }

.h5-topnav { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 12px; }
.h5-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 16px; }
.h5-login { font-size: 11px; padding: 5px 11px; border-radius: 999px; background: rgba(245, 200, 66, 0.1); border: 1px solid rgba(245, 200, 66, 0.3); color: var(--story-gold); }

.h5-globe-area { padding: 0 18px; flex-shrink: 0; }
.h5-globe { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.h5-globe-orb {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #1a3050 0%, #0a1a30 40%, #050d18 70%),
    radial-gradient(circle at 60% 60%, rgba(91, 143, 214, 0.2) 0%, transparent 50%);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6), 0 0 60px rgba(91, 143, 214, 0.18);
}
.h5-globe-atmo {
  position: absolute; inset: -8%; border-radius: 50%;
  background: radial-gradient(circle, transparent 48%, rgba(91, 143, 214, 0.18) 50%, transparent 62%);
  pointer-events: none;
}
.h5-globe-clouds {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.06) 0%, transparent 14%),
    radial-gradient(ellipse at 70% 60%, rgba(255,255,255,0.04) 0%, transparent 18%),
    radial-gradient(ellipse at 50% 80%, rgba(255,255,255,0.05) 0%, transparent 12%);
  animation: h5cloud 90s linear infinite;
}
@keyframes h5cloud { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.h5-ff { position: absolute; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 8px currentColor; animation: ffPulse 3s ease-in-out infinite; }
.h5-ff-active { width: 10px; height: 10px; box-shadow: 0 0 18px currentColor, 0 0 4px #fff inset; }
.h5-hint { text-align: center; font-size: 10.5px; color: var(--dawn-gray); margin-top: 12px; font-family: var(--font-prose); font-style: italic; }

.h5-drawer {
  flex: 1;
  margin-top: 14px; padding: 0 16px 8px;
  overflow-y: auto;
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  background: linear-gradient(180deg, rgba(10, 25, 41, 0.4), rgba(10, 25, 41, 0.1));
}
.h5-drawer-handle { display: flex; justify-content: center; padding: 6px 0 10px; background: none; border: none; width: 100%; }
.h5-drawer-pill { width: 32px; height: 3px; border-radius: 2px; background: var(--dawn-dim); }
.h5-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 0 0 10px; }
.h5-drawer-title { font-family: var(--font-display); font-size: 16px; color: var(--moon-white); }
.h5-drawer-sub { font-size: 10px; color: var(--dawn-gray); margin-top: 1px; }
.h5-filter-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--moon-white); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(0,0,0,0.3); }

.h5-card { border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; background: rgba(0,0,0,0.4); margin-bottom: 12px; }
.h5-card-img { height: 96px; position: relative; padding: 10px; }
.h5-card-img::after { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 12px); }
.h5-card-tag { position: absolute; top: 10px; left: 10px; font-size: 9px; padding: 2px 7px; border-radius: 999px; border: 1px solid; letter-spacing: 0.1em; text-transform: uppercase; z-index: 1; }
.h5-card-body { padding: 12px; }
.h5-card-coord { font-family: var(--font-mono); font-size: 10px; color: var(--dawn-gray); letter-spacing: 0.04em; }
.h5-card-title { font-family: var(--font-display); font-style: italic; font-size: 14px; color: var(--story-gold); margin-top: 6px; }
.h5-card-excerpt { font-family: var(--font-prose); font-size: 11.5px; color: var(--moon-white); opacity: 0.85; line-height: 1.65; margin-top: 6px; }
.h5-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.h5-card-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--dawn-dim); }
.h5-card-play { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; background: var(--candle-orange); border: none; color: #fff; font-size: 10.5px; }

.h5-mini-list { display: flex; flex-direction: column; gap: 0; }
.h5-mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.h5-mini-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.h5-mini-text { flex: 1; }
.h5-mini-title { font-family: var(--font-display); font-size: 12.5px; color: var(--moon-white); }
.h5-mini-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--dawn-gray); margin-top: 2px; }
.h5-mini-play { color: var(--candle-orange); }

.h5-cta-banner { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(232, 122, 60, 0.18), rgba(245, 200, 66, 0.06)); border: 1px solid rgba(232, 122, 60, 0.3); }
.h5-cta-text { flex: 1; }
.h5-cta-title { font-size: 12.5px; color: var(--moon-white); font-weight: 500; }
.h5-cta-sub { font-size: 10px; color: var(--dawn-gray); margin-top: 2px; }
.h5-cta-btn { padding: 7px 14px; border-radius: 999px; background: var(--candle-orange); border: none; color: #fff; font-size: 11px; }

.h5-tabbar { display: flex; padding: 8px 18px 4px; border-top: 1px solid var(--line-soft); background: rgba(2, 5, 11, 0.6); }
.h5-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; background: none; border: none; color: var(--dawn-dim); font-size: 9.5px; letter-spacing: 0.04em; transition: color 0.15s; }
.h5-tab-on { color: var(--story-gold); }
.h5-home-bar { width: 130px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.65); margin: 4px auto 8px; }

.h5-close { position: absolute; top: 22px; right: 22px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.5); border: 1px solid var(--line-medium); color: var(--moon-white); display: inline-flex; align-items: center; justify-content: center; }

.h5-label { color: var(--moon-white); max-width: 280px; }
.h5-label-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--candle-orange); }
.h5-label-title { font-family: var(--font-display); font-size: 30px; margin-top: 12px; line-height: 1.15; }
.h5-label-sub { font-family: var(--font-prose); font-size: 13px; color: var(--dawn-gray); margin-top: 14px; line-height: 1.7; }

/* ---------- Variation B (avant) overrides ---------- */
.variation-avant .bg-cosmos {
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, #100422 0%, #050211 45%, #000 100%),
    radial-gradient(circle at 18% 80%, rgba(64, 16, 100, 0.55) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(232, 122, 60, 0.10) 0%, transparent 40%);
}
.variation-avant .left-panel,
.variation-avant .right-panel,
.variation-avant .play-bar {
  background: linear-gradient(180deg, rgba(8, 4, 22, 0.92) 0%, rgba(8, 4, 22, 0.78) 100%);
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .main-grid { grid-template-columns: 260px 1fr 320px; }
  .play-bar { grid-template-columns: 260px 1fr 320px; }
  .hud-clock { margin-left: 270px; }
}

/* ---------- Phase 2: H5 Globe Mini & Shell upgrades ---------- */

/* Canvas globe replaces CSS orb — fit within .h5-globe container */
.h5-globe canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  display: block;
  cursor: grab;
}
.h5-globe canvas:active { cursor: grabbing; }

/* Globe area responsive padding */
.h5-globe-area { padding: 0 18px; flex-shrink: 0; position: relative; }
.h5-globe { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: 50%; }

/* Globe actions row */
.h5-globe-actions {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 8px;
}
.h5-action-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line-soft); background: rgba(0,0,0,0.4);
  color: var(--dawn-gray); display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.h5-action-btn:hover { border-color: var(--line-medium); color: var(--moon-white); }

/* Selected coord badge */
.h5-selected-hint {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.45); border: 1px solid var(--line-soft);
  font-size: 10px; color: var(--moon-white);
}
.h5-sel-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.h5-sel-name { font-family: var(--font-display); }

/* Culture chip filter overlay */
.h5-culture-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 8px 0 4px;
  justify-content: center;
}
.h5-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px; font-size: 10px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.4);
  color: var(--dawn-gray); transition: all 0.15s;
}
.h5-chip-on { color: var(--chip-color, var(--moon-white)); border-color: var(--chip-color, var(--line-medium)); background: rgba(0,0,0,0.5); }
.h5-chip-off { opacity: 0.4; }
.h5-chip-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.h5-chip-clear { color: var(--dawn-dim); border-style: dashed; }

/* Mini list row states */
.h5-mini-row { cursor: pointer; background: none; border: none; width: 100%; text-align: left; transition: background 0.15s; border-radius: 8px; padding: 9px 4px; }
.h5-mini-row:hover { background: rgba(232,232,240,0.04); }
.h5-mini-active { background: rgba(245,200,66,0.07) !important; }

/* Skeleton mini list */
.h5-mini-sk { cursor: default; }
.h5-sk-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(232,232,240,0.1); flex-shrink: 0; }
.h5-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.h5-sk-line { border-radius: 3px; background: rgba(232,232,240,0.08); animation: sk-shimmer 1.4s infinite; background-size: 200% 100%; }
.h5-sk-t { height: 11px; width: 70%; }
.h5-sk-m { height: 9px; width: 45%; }

/* Card heat stars */
.h5-card-heat {
  position: absolute; bottom: 10px; right: 10px; z-index: 1;
  font-size: 9px; color: rgba(245,200,66,0.7);
  letter-spacing: -1px;
}

/* Now-playing mini bar in H5 */
.h5-now-playing {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  border-top: 1px solid;
  background: rgba(0,0,0,0.5);
  font-size: 11px;
}
.h5-np-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; animation: h5npPulse 1.4s ease-in-out infinite; }
@keyframes h5npPulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
.h5-np-title { flex: 1; font-family: var(--font-display); font-size: 11.5px; color: var(--moon-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h5-np-play { background: none; border: none; display: inline-flex; align-items: center; justify-content: center; padding: 4px; }

/* Back button in drawer */
.h5-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--dawn-gray); background: none; border: none;
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line-soft); transition: all 0.15s;
}
.h5-back-btn:hover { color: var(--moon-white); border-color: var(--line-medium); }

/* H5 tab content area */
.h5-tab-content { padding: 16px 4px; }

/* H5 empty state */
.h5-empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 0; color: var(--dawn-gray); }
.h5-empty-icon { font-size: 28px; opacity: 0.35; }
.h5-empty-title { font-size: 13px; color: var(--moon-white); }
.h5-empty-sub { font-size: 11px; text-align: center; line-height: 1.6; max-width: 200px; }

/* H5 profile section */
.h5-profile { display: flex; align-items: center; gap: 12px; }
.h5-avatar { flex-shrink: 0; }
.h5-profile-info { flex: 1; }
.h5-profile-name { font-family: var(--font-display); font-size: 15px; color: var(--moon-white); }
.h5-profile-sub { font-size: 10px; color: var(--dawn-gray); margin-top: 3px; }
.h5-upgrade-btn { padding: 7px 12px; border-radius: 999px; border: none; color: #fff; font-size: 10px; white-space: nowrap; }

/* ---------- Phase 1 additions ---------- */

/* Story skeleton loader */
.story-skeleton { padding: 0 16px; }
.sk-card { margin-bottom: 20px; }
.sk-line {
  background: linear-gradient(90deg, rgba(232,232,240,0.06) 25%, rgba(232,232,240,0.12) 50%, rgba(232,232,240,0.06) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s infinite;
  border-radius: 4px;
  height: 12px;
  margin-bottom: 8px;
}
.sk-line-title   { width: 80%; height: 14px; }
.sk-line-meta    { width: 55%; }
.sk-line-excerpt { width: 95%; height: 10px; }
@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error boundary */
.error-boundary {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; gap: 10px; color: var(--dawn-gray);
}
.eb-icon   { font-size: 28px; opacity: 0.5; }
.eb-title  { font-size: 14px; color: var(--moon-white); font-weight: 500; }
.eb-msg    { font-size: 11px; font-family: var(--font-mono); opacity: 0.6; text-align: center; max-width: 240px; }
.eb-hint   { font-size: 11px; color: var(--dawn-dim); text-align: center; max-width: 240px; margin-top: 4px; line-height: 1.5; }
.eb-retry  { margin-top: 8px; padding: 6px 16px; border: 1px solid rgba(232,232,240,0.2); border-radius: 6px; background: transparent; font-size: 12px; }
.eb-retry:hover { border-color: rgba(232,232,240,0.4); }

/* Globe-area error boundary — must float above reticle (z:4) and HUD overlays (z:5). */
/* Without this, the fallback renders behind the spinning reticle ring and is invisible. */
.globe-area .error-boundary {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(2, 5, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Globe buffering indicator */
.globe-buffering {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 20;
}
.buffering-spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(245,200,66,0.2);
  border-top-color: rgba(245,200,66,0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* PlayBar buffering state */
.pb-toggle.pb-buffering { opacity: 0.7; }
.pb-toggle.pb-buffering svg { animation: spin 1s linear infinite; }

/* Search clear button */
.search-clear {
  background: none; border: none; padding: 0 8px;
  font-size: 16px; color: var(--dawn-gray); line-height: 1;
  opacity: 0.7;
}
.search-clear:hover { opacity: 1; color: var(--moon-white); }

/* Search results dropdown */
.search-results {
  margin: 0 -12px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.search-loading, .search-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--dawn-gray);
}
.search-result-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 14px;
  background: transparent; border: none;
  text-align: left; font-size: 12px; color: var(--moon-white);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}
.search-result-row:hover { background: rgba(232,232,240,0.05); }
.search-result-row:last-child { border-bottom: none; }
.result-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.result-name { font-weight: 500; }
.result-region { margin-left: auto; color: var(--dawn-gray); font-size: 11px; }
.result-icon { font-size: 10px; color: var(--story-gold); flex-shrink: 0; }
.result-story-text { display: flex; flex-direction: column; gap: 2px; }
.result-story-title { font-weight: 500; }
.result-story-meta { font-size: 10px; color: var(--dawn-gray); }

/* Inline genre filter (story panel) */
.inline-filter {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 16px 4px;
}
.inline-chip {
  padding: 3px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: transparent;
  font-size: 11px;
  color: var(--dawn-gray);
  transition: all 0.15s;
}
.inline-chip:hover { border-color: var(--line-medium); color: var(--moon-white); }
.inline-chip.chip-on {
  border-color: var(--story-gold);
  color: var(--story-gold);
  background: rgba(245,200,66,0.08);
}
.inline-chip-clear {
  padding: 3px 10px;
  border: 1px dashed var(--line-soft);
  border-radius: 20px;
  background: transparent;
  font-size: 11px;
  color: var(--dawn-dim);
}
.inline-chip-clear:hover { color: var(--dawn-gray); }

/* Story empty / load more */
.story-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 16px; color: var(--dawn-gray);
}
.empty-icon { font-size: 24px; opacity: 0.4; }
.empty-text { font-size: 12px; }
.load-more-btn {
  display: block; width: 100%; margin: 8px 0;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  font-size: 12px; color: var(--dawn-gray);
  transition: all 0.2s;
}
.load-more-btn:hover { border-color: var(--line-medium); color: var(--moon-white); }

/* Hover tooltip culture tag */
.tt-culture {
  font-size: 10px; font-family: var(--font-mono);
  letter-spacing: 0.05em; margin-bottom: 2px;
  opacity: 0.9;
}
.tt-count {
  font-size: 10px; color: var(--dawn-gray);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════
   Sleep Player Integration — Action Cluster + Overlay
   ══════════════════════════════════════════════════════════════ */

/* ── Action cluster (bottom-right of globe area) ────────────── */
.globe-action-cluster {
  position: absolute;
  /* 64px play-bar + 24px existing hud-br + 16px breathing = 104px */
  bottom: 104px; right: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* ── Sleep launch button ────────────────────────────────────── */
.sleep-launch-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px 13px 14px;
  background: rgba(5, 13, 24, 0.72);
  border: 1px solid rgba(232, 232, 240, 0.10);
  border-radius: 16px;
  color: var(--dawn-gray);
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Shimmer line on hover */
.sleep-launch-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    rgba(245,200,66,0) 0%,
    rgba(245,200,66,0.04) 50%,
    rgba(245,200,66,0) 100%);
  opacity: 0;
  transition: opacity 0.4s;
}
.sleep-launch-btn:hover::before { opacity: 1; }

.sleep-launch-btn:hover {
  border-color: rgba(245,200,66,0.35);
  color: var(--moon-white);
  background: rgba(5,13,24,0.88);
  box-shadow:
    0 0 0 1px rgba(245,200,66,0.10),
    0 8px 32px rgba(0,0,0,0.5),
    0 0 24px rgba(245,200,66,0.06);
  transform: translateY(-1px);
}

.sleep-launch-btn:active { transform: scale(0.97); }

/* Active live-play state */
.sleep-launch-btn.has-story {
  border-color: rgba(245,200,66,0.22);
  color: rgba(245,200,66,0.9);
  background: rgba(5,13,24,0.82);
}
.sleep-launch-btn.has-story:hover {
  border-color: rgba(245,200,66,0.55);
  color: var(--story-gold);
}

.sleep-btn-moon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%,
    rgba(245,200,66,0.14) 0%,
    rgba(245,200,66,0.04) 60%,
    transparent 80%);
  border: 0.5px solid rgba(245,200,66,0.18);
  display: grid; place-items: center;
  color: rgba(245,200,66,0.75);
  flex-shrink: 0;
  transition: all 0.35s ease;
}
.sleep-launch-btn:hover .sleep-btn-moon {
  background: radial-gradient(circle at 40% 38%,
    rgba(245,200,66,0.22) 0%,
    rgba(245,200,66,0.07) 60%,
    transparent 80%);
  color: var(--story-gold);
  border-color: rgba(245,200,66,0.40);
  box-shadow: 0 0 14px rgba(245,200,66,0.12);
}
.sleep-launch-btn.has-story .sleep-btn-moon {
  animation: moonPulse 3.5s ease-in-out infinite;
}
@keyframes moonPulse {
  0%,100% { box-shadow: 0 0 0px rgba(245,200,66,0); }
  50%     { box-shadow: 0 0 18px rgba(245,200,66,0.20); }
}

.sleep-btn-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.sleep-btn-cn {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  transition: color 0.3s;
}
.sleep-btn-en {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  opacity: 0.5;
  line-height: 1;
  transition: opacity 0.3s;
}
.sleep-launch-btn:hover .sleep-btn-en { opacity: 0.75; }

/* Live dot (shown when audio is playing) */
.sleep-btn-live {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--story-gold);
  box-shadow: 0 0 6px rgba(245,200,66,0.6);
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 0.6; transform: scale(1); }
  50%     { opacity: 1; transform: scale(1.3); }
}

/* ── Zen / UI-hide toggle ───────────────────────────────────── */
.zen-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(5,13,24,0.55);
  border: 1px solid rgba(232,232,240,0.07);
  border-radius: 12px;
  color: var(--dawn-dim);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}
.zen-toggle-btn:hover {
  color: var(--moon-white);
  border-color: rgba(232,232,240,0.14);
  background: rgba(5,13,24,0.75);
}
.zen-toggle-btn.is-active {
  color: var(--story-gold);
  border-color: rgba(245,200,66,0.22);
  background: rgba(5,13,24,0.70);
}
.zen-btn-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── UI hidden (zen) mode ───────────────────────────────────── */
.app[data-ui-hidden="true"] .left-panel,
.app[data-ui-hidden="true"] .right-panel,
.app[data-ui-hidden="true"] .top-hud,
.app[data-ui-hidden="true"] .play-bar .play-bar-meta,
.app[data-ui-hidden="true"] .play-bar .play-bar-next,
.app[data-ui-hidden="true"] .globe-hud-tl,
.app[data-ui-hidden="true"] .globe-hud-bl,
.app[data-ui-hidden="true"] .globe-hud-tr,
.app[data-ui-hidden="true"] .globe-hud-br {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* Keep play-bar transport visible but minimal */
.app[data-ui-hidden="true"] .play-bar {
  background: rgba(2,5,11,0.82);
  border-top-color: rgba(232,232,240,0.04);
}

/* Globe expands to fill in zen mode */
.app[data-ui-hidden="true"] .main-grid {
  grid-template-columns: 0 1fr 0;
  transition: grid-template-columns 1s cubic-bezier(0.4,0,0.2,1);
}

/* Cluster stays visible in zen mode — hover to reveal */
.app[data-ui-hidden="true"] .globe-action-cluster {
  opacity: 0.35;
  transition: opacity 0.6s ease;
}
.app[data-ui-hidden="true"] .globe-action-cluster:hover {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Reveal hint on hover in zen mode */
.app[data-ui-hidden="true"]:hover .zen-toggle-btn {
  opacity: 1;
}

/* ── Sleep Player Overlay ───────────────────────────────────── */
.sleep-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000508;
  display: flex;
  align-items: stretch;
  animation: sleepOverlayIn 1.2s cubic-bezier(0.65,0,0.35,1) both;
}
@keyframes sleepOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sleep-overlay__frame {
  position: relative;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.sleep-overlay__frame.is-ready { opacity: 1; }

.sleep-overlay__iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

/* Loading state — sibling of frame, covers entire overlay */
.sleep-overlay__loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
  background: #000508;
  z-index: 10;
  pointer-events: none;
}
.sleep-loading-moon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%,
    #f6f3ea 0%, #e8d89a 30%, #c8973a 62%, transparent 78%);
  box-shadow: 0 0 30px rgba(245,200,66,0.12);
  animation: sleepMoonBreath 3s ease-in-out infinite;
}
@keyframes sleepMoonBreath {
  0%,100% { opacity: 0.6; transform: scale(1); }
  50%     { opacity: 1; transform: scale(1.05); }
}
.sleep-overlay__loading p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 300;
  font-size: 15px; letter-spacing: 0.16em;
  color: rgba(244,241,232,0.45);
}

/* Return button — floats top-left, always on top */
.sleep-overlay__close {
  position: absolute;
  top: 20px; left: 20px;
  z-index: 200;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(5,13,24,0.65);
  border: 0.5px solid rgba(232,232,240,0.10);
  border-radius: 999px;
  color: rgba(232,232,240,0.55);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  opacity: 0.45;
}
.sleep-overlay__close:hover {
  opacity: 1;
  color: var(--moon-white);
  border-color: rgba(232,232,240,0.20);
  background: rgba(5,13,24,0.88);
}

/* ══════════════════════════════════════════════════════════════
   Modal System — Search & Membership
   Apple-style backdrop blur, center card, OWMap design language
   ══════════════════════════════════════════════════════════════ */

/* ── Shared backdrop ────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(2, 5, 11, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: modalBackdropIn 0.22s ease-out;
}
@keyframes modalBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Shared close button ────────────────────────────────────── */
.modal-close-btn {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(232,232,240,0.06);
  border: 1px solid rgba(232,232,240,0.08);
  color: var(--dawn-gray);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close-btn:hover { background: rgba(232,232,240,0.12); color: var(--moon-white); }

/* ══════════════════════════════════════════════════════════════
   Search Modal
   ══════════════════════════════════════════════════════════════ */
.search-modal {
  width: 100%; max-width: 560px;
  background: rgba(8, 16, 30, 0.96);
  border: 1px solid rgba(232,232,240,0.10);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(245,200,66,0.06),
    0 32px 80px rgba(0,0,0,0.7),
    0 4px 24px rgba(0,0,0,0.5);
  animation: modalCardIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(232,232,240,0.07);
}
.search-modal__ico { color: var(--dawn-gray); flex-shrink: 0; }
.search-modal__input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--moon-white);
  font-family: var(--font-ui); font-size: 16px;
  letter-spacing: 0.01em;
}
.search-modal__input::placeholder { color: var(--dawn-dim); }
.search-modal__clear {
  background: none; border: none; color: var(--dawn-dim);
  display: grid; place-items: center;
  cursor: pointer;
  transition: color 0.2s;
}
.search-modal__clear:hover { color: var(--moon-white); }

.search-modal__results {
  list-style: none;
  max-height: 320px; overflow-y: auto;
  padding: 8px 0;
}
.search-modal__result {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.search-modal__result:hover { background: rgba(232,232,240,0.04); }
.search-modal__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.search-modal__result-text { flex: 1; min-width: 0; }
.search-modal__result-name {
  display: block; font-family: var(--font-display);
  font-size: 14px; color: var(--moon-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-modal__result-meta {
  display: block; font-family: var(--font-mono);
  font-size: 10px; color: var(--dawn-dim);
  margin-top: 2px; letter-spacing: 0.04em;
}
.search-modal__result-coord {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--story-gold); flex-shrink: 0;
}

.search-modal__empty {
  padding: 32px 20px; text-align: center;
  font-family: var(--font-prose); font-style: italic;
  color: var(--dawn-dim); font-size: 13px;
}
.search-modal__hint { padding: 16px 20px; }
.search-hint-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.search-hint-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dawn-dim);
}
.search-hint-chip {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(232,232,240,0.04);
  border: 1px solid rgba(232,232,240,0.08);
  color: var(--dawn-gray); font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.search-hint-chip:hover {
  background: rgba(245,200,66,0.08);
  border-color: rgba(245,200,66,0.25);
  color: var(--story-gold);
}

.search-modal__footer {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-top: 1px solid rgba(232,232,240,0.06);
  font-size: 11px; color: var(--dawn-dim);
  letter-spacing: 0.04em;
}
.search-kbd {
  display: inline-block; padding: 2px 6px; border-radius: 5px;
  background: rgba(232,232,240,0.06);
  border: 1px solid rgba(232,232,240,0.10);
  font-family: var(--font-mono); font-size: 10px;
  color: var(--dawn-gray);
}
.search-modal__sep { color: rgba(232,232,240,0.2); }

/* ══════════════════════════════════════════════════════════════
   Membership Modal
   ══════════════════════════════════════════════════════════════ */
.membership-modal {
  position: relative;
  width: 100%; max-width: 820px;
  max-height: 90vh; overflow-y: auto;
  background: rgba(6, 12, 24, 0.97);
  border: 1px solid rgba(232,232,240,0.10);
  border-radius: 24px;
  padding: 40px 36px 36px;
  box-shadow:
    0 0 0 1px rgba(245,200,66,0.07),
    0 40px 100px rgba(0,0,0,0.75);
  animation: modalCardIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.membership-modal__head { text-align: center; margin-bottom: 32px; }
.membership-modal__eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--candle-orange); margin-bottom: 12px;
}
.membership-modal__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: 30px; color: var(--story-gold); letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.membership-modal__sub {
  font-family: var(--font-prose); font-size: 13px;
  color: var(--dawn-gray); margin: 0;
}

/* ── Plan grid — 3 columns ─────────────────────────────────── */
.membership-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 680px) {
  .membership-modal__grid { grid-template-columns: 1fr; }
}

.mem-plan {
  position: relative;
  padding: 24px 20px 20px;
  border-radius: 16px;
  background: rgba(10, 18, 32, 0.70);
  border: 1px solid rgba(232,232,240,0.08);
  display: flex; flex-direction: column; gap: 0;
  transition: border-color 0.2s;
}
.mem-plan:hover { border-color: rgba(232,232,240,0.14); }
.mem-plan--featured {
  border-color: rgba(245,200,66,0.3);
  background: rgba(10, 18, 32, 0.88);
  box-shadow: 0 0 40px rgba(245,200,66,0.06);
}
.mem-plan--featured:hover { border-color: rgba(245,200,66,0.50); }

.mem-plan__badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: 3px 14px; border-radius: 999px;
  background: var(--story-gold); color: var(--deep-black);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; font-weight: 700;
  white-space: nowrap;
}
.mem-plan__tier {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dawn-dim); margin-bottom: 12px;
}
.mem-plan__price { margin-bottom: 16px; }
.mem-plan__amount {
  font-family: var(--font-display); font-size: 32px;
  color: var(--moon-white); letter-spacing: -0.01em;
}
.mem-plan--featured .mem-plan__amount { color: var(--story-gold); }
.mem-plan__period {
  display: block; font-family: var(--font-mono); font-size: 10px;
  color: var(--dawn-dim); margin-top: 4px; letter-spacing: 0.04em;
}
.mem-plan__divider {
  height: 1px; background: rgba(232,232,240,0.07);
  margin-bottom: 16px;
}
.mem-plan__features {
  list-style: none; display: flex; flex-direction: column;
  gap: 9px; flex: 1; margin-bottom: 20px;
}
.mem-feature {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--moon-white); line-height: 1.3;
}
.mem-feature svg { color: var(--story-gold); flex-shrink: 0; }
.mem-feature--off { opacity: 0.38; }
.mem-feature--off svg { color: var(--dawn-dim); }

.mem-plan__cta {
  display: block; text-align: center;
  padding: 11px 16px; border-radius: 10px;
  font-family: var(--font-ui); font-size: 13px;
  letter-spacing: 0.04em; text-decoration: none;
  cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent;
}
.mem-plan__cta--gold {
  background: var(--story-gold); color: var(--deep-black);
  font-weight: 600;
}
.mem-plan__cta--gold:hover {
  background: #f7d060;
  box-shadow: 0 4px 20px rgba(245,200,66,0.35);
}
.mem-plan__cta--plain {
  background: rgba(232,232,240,0.05);
  border-color: rgba(232,232,240,0.08);
  color: var(--dawn-gray);
}
.mem-plan__cta--plain:hover { background: rgba(232,232,240,0.09); color: var(--moon-white); }
.mem-plan__cta--outline {
  background: none;
  border-color: rgba(232,232,240,0.14);
  color: var(--dawn-gray);
}
.mem-plan__cta--outline:hover { border-color: var(--story-gold); color: var(--story-gold); }

.mem-plan__note {
  margin-top: 10px; text-align: center;
  font-family: var(--font-prose); font-style: italic;
  font-size: 10.5px; color: var(--dawn-dim);
}

/* ==========================================================================
   ONBOARDING v2 — Enhanced visual system
   ========================================================================== */

/* Stars field */
.onb-star-field { position: absolute; inset: 0; pointer-events: none; }
.onb-star {
  position: absolute; border-radius: 50%; background: #fff;
  animation: starTwinkle 4s ease-in-out infinite;
}
@keyframes starTwinkle { 0%,100% { opacity: var(--tw-op,0.3); } 50% { opacity: calc(var(--tw-op,0.3)*2.5); } }

/* Nebula ambient clouds */
.onb-nebula {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(80px); mix-blend-mode: screen;
}
.onb-nebula-1 {
  width: 600px; height: 600px; left: 10%; top: 5%;
  background: radial-gradient(circle, rgba(26,16,64,0.7) 0%, transparent 70%);
  animation: nebulaDrift 18s ease-in-out infinite alternate;
}
.onb-nebula-2 {
  width: 500px; height: 500px; right: 5%; bottom: 10%;
  background: radial-gradient(circle, rgba(245,200,66,0.06) 0%, transparent 70%);
  animation: nebulaDrift 22s ease-in-out infinite alternate-reverse;
}
@keyframes nebulaDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(30px,20px) scale(1.06); } }

/* Step indicator (top center) */
.onb-step-indicator {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-mono); pointer-events: none;
}
.onb-step-cur { font-size: 14px; color: var(--story-gold); }
.onb-step-sep { font-size: 10px; color: var(--dawn-dim); }
.onb-step-tot { font-size: 10px; color: var(--dawn-dim); }

/* Globe SVG in step 0 */
.onb-globe-ring { margin: 0 auto 24px; display: flex; justify-content: center; }
.onb-globe-svg { overflow: visible; }
.onb-globe-glow-ring { animation: globeBreath 6s ease-in-out infinite; }
@keyframes globeBreath { 0%,100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
.onb-globe-eq { animation: eqSpin 40s linear infinite; transform-origin: 160px 160px; }
@keyframes eqSpin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.onb-pin-dot { animation: pinPulse 2.5s ease-in-out infinite; }
.onb-pin-aura { animation: auraExpand 2.5s ease-in-out infinite; }
@keyframes pinPulse { 0%,100% { opacity: 0.9; } 50% { opacity: 0.5; } }
@keyframes auraExpand { 0%,100% { r: 0; opacity: 0.6; } 80% { r: 20; opacity: 0; } }

/* Culture nodes in step 1 */
.onb-cultures-demo {
  position: relative; width: 100%; max-width: 420px; height: 220px;
  margin: 20px auto 20px;
}
.onb-culture-node {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  animation: cultureFloat var(--dur, 3.5s) ease-in-out infinite alternate;
}
@keyframes cultureFloat { from { transform: translate(-50%,-50%) translateY(0); } to { transform: translate(-50%,-50%) translateY(-6px); } }
.onb-culture-core {
  width: 10px; height: 10px; border-radius: 50%;
  position: relative; z-index: 2;
  box-shadow: 0 0 12px var(--culture-color,#F5C842);
}
.onb-culture-aura {
  position: absolute; inset: -14px; border-radius: 50%;
  background: radial-gradient(circle, var(--culture-color,#F5C842) 0%, transparent 70%);
  opacity: 0.3; animation: auraBreath 3s ease-in-out infinite;
}
@keyframes auraBreath { 0%,100% { opacity: 0.2; transform: scale(0.85); } 50% { opacity: 0.5; transform: scale(1.1); } }
.onb-culture-lbl {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 9px; letter-spacing: 0.1em; white-space: nowrap;
  color: var(--dawn-gray); font-family: var(--font-mono);
}
.onb-culture-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.onb-conn-line { animation: lineAppear 2s ease-in-out infinite alternate; }
@keyframes lineAppear { from { opacity: 0; } to { opacity: 1; } }

/* Culture legend strip */
.onb-legend-strip {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
  margin-top: 16px;
}
.onb-legend-item { display: flex; align-items: center; gap: 6px; }
.onb-legend-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.onb-legend-label { font-size: 10px; color: var(--dawn-gray); letter-spacing: 0.08em; }

/* Step 2 sleep cards */
.onb-sleep-cards {
  position: relative; max-width: 340px; margin: 20px auto 20px; height: 190px;
}
.onb-sleep-card {
  position: absolute; left: 0; right: 0; border-radius: 16px;
  background: var(--surface-glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
}
.onb-sleep-card-bg  { top: 16px; left: 16px; right: -8px; height: 160px; opacity: 0.3; transform: rotate(2deg); }
.onb-sleep-card-mid { top: 8px;  left: 8px;  right: -4px; height: 160px; opacity: 0.6; transform: rotate(1deg); }
.onb-sleep-card-fg  { top: 0; height: auto; padding: 16px; z-index: 3; }
.onb-sleep-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.onb-sleep-title { font-size: 12px; color: var(--moon-white); letter-spacing: 0.06em; font-weight: 500; }
.onb-sleep-badge {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.2em;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(232,122,60,0.15); color: var(--candle-orange);
  border: 1px solid rgba(232,122,60,0.3);
  animation: badgeBlink 1.8s step-start infinite;
}
@keyframes badgeBlink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0.4; } }
.onb-sleep-now {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--dawn-gray); margin-bottom: 8px;
}
.onb-sleep-now-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--candle-orange);
  animation: stat-pulse 1.5s ease-in-out infinite; flex-shrink: 0;
}
.onb-sleep-bar {
  position: relative; height: 2px; background: var(--line-soft); border-radius: 1px;
  margin-bottom: 4px;
}
.onb-sleep-bar-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--story-gold); border-radius: 1px;
}
.onb-sleep-bar-head {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--story-gold); box-shadow: 0 0 6px rgba(245,200,66,0.6);
}
.onb-sleep-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 9px; color: var(--dawn-dim);
  margin-bottom: 10px;
}
.onb-sleep-settings { display: flex; flex-direction: column; gap: 6px; }
.onb-sleep-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--moon-white);
}
.onb-sleep-icon { font-size: 13px; }

/* Step 3 gestures */
.onb-gestures {
  display: flex; justify-content: center; gap: 24px; margin: 24px auto;
  max-width: 460px; flex-wrap: wrap;
}
.onb-gesture-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.onb-gesture-ico {
  width: 72px; height: 72px; border-radius: 16px;
  background: rgba(245,200,66,0.05); border: 1px solid rgba(245,200,66,0.12);
  display: flex; align-items: center; justify-content: center;
}
.onb-tap-ring { animation: tapRing 2s ease-out infinite; }
@keyframes tapRing { 0% { r: 5; opacity: 1; } 100% { r: 12; opacity: 0; } }
.onb-gesture-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dawn-gray);
}

/* Tutorial callout */
.onb-tut-callout {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 10px 16px; border-radius: 10px;
  background: rgba(245,200,66,0.04); border: 1px solid rgba(245,200,66,0.14);
  font-size: 12px; color: var(--dawn-gray);
}
.onb-tut-ico { color: rgba(245,200,66,0.6); flex-shrink: 0; }
.onb-tut-link {
  background: none; border: none; padding: 0;
  color: var(--story-gold); font-size: 12px; font-family: var(--font-ui);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; transition: color 0.15s;
}
.onb-tut-link:hover { color: #f7d060; }

/* Jump-to-end link */
.onb-jump-end {
  background: none; border: none; padding: 0;
  font-size: 10px; color: var(--dawn-dim); letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer;
  transition: color 0.15s;
}
.onb-jump-end:hover { color: var(--story-gold); }

/* Dot nav clickable */
.onb-dots button { cursor: pointer; background: none; border: none; padding: 2px; }

/* ==========================================================================
   TUTORIAL MODAL
   ========================================================================== */

.tut-overlay {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: tutIn 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes tutIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.tut-closing { animation: tutOut 0.4s ease-in forwards; }
@keyframes tutOut { to { opacity: 0; transform: scale(0.96); } }

.tut-bg-layer {
  position: absolute; inset: 0;
  background: rgba(2, 5, 11, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.tut-nebula-1 {
  position: absolute; top: -100px; left: -100px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,16,64,0.6) 0%, transparent 70%);
  filter: blur(60px); pointer-events: none;
  animation: nebulaDrift 20s ease-in-out infinite alternate;
}
.tut-nebula-2 {
  position: absolute; bottom: -80px; right: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,200,66,0.05) 0%, transparent 70%);
  filter: blur(50px); pointer-events: none;
  animation: nebulaDrift 25s ease-in-out infinite alternate-reverse;
}

/* Shell */
.tut-shell {
  position: relative; z-index: 1;
  display: flex;
  width: 100%; max-width: 1100px; height: min(760px, calc(100vh - 48px));
  border-radius: 20px;
  background: rgba(5, 13, 24, 0.96);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(24px);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(245,200,66,0.04);
}

/* Left nav */
.tut-nav {
  width: 220px; flex-shrink: 0;
  border-right: 1px solid var(--line-soft);
  background: rgba(5, 13, 24, 0.7);
  display: flex; flex-direction: column;
  padding: 0;
}
.tut-nav-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.tut-nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 15px; color: var(--moon-white);
}
.tut-nav-meta {
  margin-top: 6px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--dawn-dim); text-transform: uppercase;
}
.tut-nav-list { flex: 1; padding: 12px 0; list-style: none; margin: 0; }
.tut-nav-item {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: none; border: none;
  color: var(--dawn-gray); font-size: 12px; font-family: var(--font-ui);
  letter-spacing: 0.04em; cursor: pointer; transition: all 0.15s;
  text-align: left;
}
.tut-nav-item:hover { color: var(--moon-white); background: rgba(232,232,240,0.03); }
.tut-nav-active { color: var(--story-gold) !important; background: rgba(245,200,66,0.06) !important; }
.tut-nav-active-bar {
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2px; border-radius: 1px;
  background: var(--story-gold);
}
.tut-nav-num {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--dawn-dim);
  min-width: 18px;
}
.tut-nav-icon { opacity: 0.6; flex-shrink: 0; }
.tut-nav-active .tut-nav-icon { opacity: 1; }
.tut-nav-label { flex: 1; }
.tut-nav-foot { padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.tut-close-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 8px 12px; font-size: 11px; color: var(--dawn-gray);
  cursor: pointer; transition: all 0.15s; width: 100%;
}
.tut-close-btn:hover { color: var(--moon-white); border-color: var(--line-medium); }

/* Main content area */
.tut-main {
  flex: 1; overflow-y: auto; padding: 0;
}
.tut-main::-webkit-scrollbar { width: 4px; }
.tut-main::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 2px; }

.tut-content-inner {
  padding: 36px 44px 44px;
  animation: tutSectionIn 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes tutSectionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Section header */
.tut-section-header { margin-bottom: 32px; }
.tut-section-eyebrow {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--candle-orange);
  margin-bottom: 16px;
}
.tut-section-num { font-size: 14px; }
.tut-section-slash, .tut-section-total, .tut-section-sep { color: var(--dawn-dim); }
.tut-section-title {
  font-family: var(--font-display); font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 400; line-height: 1.1; color: var(--moon-white); margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.tut-section-sub {
  font-family: var(--font-prose); font-size: 15px; line-height: 1.7;
  color: var(--dawn-gray); margin: 0;
}

/* Section body */
.tut-body-anim { animation: tutSectionIn 0.35s ease-out; }
.tut-sub-heading {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dawn-dim);
  margin: 28px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

/* Gesture cards (Globe section) */
.tut-gesture-grid { display: flex; flex-direction: column; gap: 14px; }
.tut-gesture-card {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 16px 18px; border-radius: 12px;
  background: rgba(232,232,240,0.03); border: 1px solid var(--line-soft);
  transition: border-color 0.15s;
}
.tut-gesture-card:hover { border-color: var(--line-medium); }
.tut-gesture-ico {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 12px;
  background: rgba(245,200,66,0.04); border: 1px solid rgba(245,200,66,0.1);
  display: flex; align-items: center; justify-content: center;
}
.tut-gesture-info { flex: 1; }
.tut-gesture-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--moon-white); font-weight: 500; margin-bottom: 6px;
}
.tut-gesture-tag {
  font-size: 9.5px; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 4px;
  font-family: var(--font-mono); text-transform: uppercase;
}
.tut-tag-gold   { background: rgba(245,200,66,0.12); color: var(--story-gold); }
.tut-tag-blue   { background: rgba(91,143,214,0.12); color: #7faadf; }
.tut-tag-orange { background: rgba(232,122,60,0.12);  color: var(--candle-orange); }
.tut-gesture-desc { font-size: 12.5px; color: var(--dawn-gray); line-height: 1.65; }

/* Anatomy grid */
.tut-anatomy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tut-anatomy-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(232,232,240,0.02); border: 1px solid var(--line-soft);
}
.tut-anatomy-zone {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--candle-orange); min-width: 24px;
  padding: 3px 0; text-align: right;
}
.tut-anatomy-info { display: flex; flex-direction: column; gap: 3px; }
.tut-anatomy-label { font-size: 12px; color: var(--moon-white); }
.tut-anatomy-desc { font-size: 11px; color: var(--dawn-dim); line-height: 1.5; }

/* Tip box */
.tut-tip-box {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 20px; padding: 14px 18px; border-radius: 10px;
  background: rgba(245,200,66,0.04); border: 1px solid rgba(245,200,66,0.12);
  font-size: 12.5px; color: var(--dawn-gray); line-height: 1.65;
}
.tut-tip-box strong { color: var(--moon-white); display: block; margin-bottom: 3px; }
.tut-tip-ico { font-size: 13px; color: var(--story-gold); flex-shrink: 0; margin-top: 1px; }
.tut-tip-gold { background: rgba(245,200,66,0.07); border-color: rgba(245,200,66,0.22); }

/* Story section */
.tut-story-demo { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 4px; }
.tut-story-card-demo {
  flex-shrink: 0; width: 280px;
  padding: 18px; border-radius: 14px;
  background: rgba(10,25,41,0.7); border: 1px solid var(--line-medium);
  backdrop-filter: blur(12px);
}
.tut-story-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.tut-story-card-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tut-story-card-region { font-size: 10px; color: var(--dawn-gray); flex: 1; }
.tut-story-card-coords {
  font-family: var(--font-mono); font-size: 9px; color: var(--dawn-dim);
}
.tut-story-card-title {
  font-family: var(--font-display); font-size: 14px; color: var(--moon-white);
  line-height: 1.35; margin-bottom: 10px;
}
.tut-story-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tut-story-chip {
  font-size: 9.5px; padding: 3px 8px; border-radius: 6px;
  background: rgba(232,232,240,0.06); border: 1px solid var(--line-soft);
  color: var(--dawn-gray);
}
.tut-chip-gold { background: rgba(245,200,66,0.1); border-color: rgba(245,200,66,0.3); color: var(--story-gold); }
.tut-story-card-excerpt {
  font-family: var(--font-prose); font-size: 11.5px; line-height: 1.7;
  color: var(--dawn-dim); margin-bottom: 14px;
}
.tut-story-card-actions { display: flex; gap: 8px; }
.tut-story-play-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  background: var(--candle-orange); color: #fff;
  font-size: 11px; letter-spacing: 0.04em;
}
.tut-story-save-btn {
  padding: 7px 12px; border-radius: 8px;
  background: rgba(232,232,240,0.06); border: 1px solid var(--line-soft);
  color: var(--dawn-gray); font-size: 11px;
}

/* Annotations beside story card */
.tut-anno-list { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.tut-anno-item { display: flex; align-items: flex-start; gap: 10px; }
.tut-anno-line { width: 20px; height: 1px; background: var(--story-gold); opacity: 0.4; margin-top: 9px; flex-shrink: 0; }
.tut-anno-info { display: flex; flex-direction: column; gap: 3px; }
.tut-anno-label { font-size: 11.5px; color: var(--moon-white); }
.tut-anno-desc  { font-size: 10.5px; color: var(--dawn-dim); }

/* Type grid */
.tut-type-grid { display: flex; flex-direction: column; gap: 10px; }
.tut-type-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 8px; background: rgba(232,232,240,0.02); border: 1px solid var(--line-soft); }
.tut-type-badge { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; padding: 3px 8px; border-radius: 5px; border: 1px solid; flex-shrink: 0; }
.tut-type-label { font-size: 12px; color: var(--moon-white); margin-bottom: 3px; }
.tut-type-desc  { font-size: 11px; color: var(--dawn-dim); }

/* Player modes */
.tut-player-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
.tut-player-mode {
  padding: 18px; border-radius: 14px;
  background: rgba(232,232,240,0.02); border: 1px solid var(--line-soft);
}
.tut-mode-sleep { border-color: rgba(245,200,66,0.18); background: rgba(245,200,66,0.03); }
.tut-mode-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tut-mode-badge { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; padding: 3px 8px; border-radius: 5px; }
.tut-badge-free { background: rgba(232,232,240,0.08); color: var(--dawn-gray); }
.tut-badge-gold { background: rgba(245,200,66,0.15); color: var(--story-gold); border: 1px solid rgba(245,200,66,0.25); }
.tut-mode-note { font-size: 10px; color: var(--dawn-dim); }
.tut-mode-desc { font-size: 12px; color: var(--dawn-gray); line-height: 1.65; margin-bottom: 14px; }

/* Mini playbar preview */
.tut-mini-playbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(10,25,41,0.6); border: 1px solid var(--line-soft);
}
.tut-mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--candle-orange); flex-shrink: 0; }
.tut-mini-info { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: var(--dawn-gray); }
.tut-mini-progress { height: 2px; background: var(--line-soft); border-radius: 1px; position: relative; }
.tut-mini-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--story-gold); border-radius: 1px; }
.tut-mini-ctrl { color: var(--dawn-gray); flex-shrink: 0; }

/* Sleep preview */
.tut-sleep-preview {
  position: relative; padding: 14px 16px; border-radius: 10px;
  background: rgba(5,13,24,0.8); border: 1px solid rgba(245,200,66,0.12);
  overflow: hidden;
}
.tut-sleep-prev-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(26,16,64,0.5) 0%, transparent 70%);
}
.tut-sleep-prev-text { position: relative; display: flex; flex-direction: column; gap: 6px; }
.tut-sleep-prev-line { font-family: var(--font-prose); font-size: 12px; line-height: 1.6; transition: color 0.3s; }
.tut-line-dim    { color: var(--dawn-dim); }
.tut-line-active { color: var(--moon-white); background: rgba(245,200,66,0.06); padding: 2px 6px; border-radius: 4px; margin: 0 -6px; }
.tut-sleep-prev-moon { position: absolute; top: 10px; right: 12px; opacity: 0.8; }

/* Features list */
.tut-feature-list { display: flex; flex-direction: column; gap: 12px; }
.tut-feature-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 16px; border-radius: 10px;
  background: rgba(232,232,240,0.02); border: 1px solid var(--line-soft);
}
.tut-feature-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tut-feature-label { font-size: 12.5px; color: var(--moon-white); margin-bottom: 3px; }
.tut-feature-desc  { font-size: 11.5px; color: var(--dawn-gray); line-height: 1.6; }

/* Filter section */
.tut-filter-demo { display: flex; gap: 28px; align-items: flex-start; }
.tut-filter-panel {
  flex-shrink: 0; width: 240px; padding: 14px; border-radius: 12px;
  background: rgba(5,13,24,0.8); border: 1px solid var(--line-medium);
}
.tut-fp-header {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.22em;
  color: var(--dawn-dim); margin-bottom: 12px; text-transform: uppercase;
}
.tut-fp-section { margin-bottom: 14px; }
.tut-fp-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dawn-dim); margin-bottom: 7px; font-family: var(--font-mono); }
.tut-fp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tut-fp-chip {
  font-size: 10px; padding: 4px 8px; border-radius: 5px;
  background: rgba(232,232,240,0.04); border: 1px solid var(--line-soft);
  color: var(--dawn-dim);
}
.tut-fp-chip-on { background: rgba(245,200,66,0.08); border-color: rgba(245,200,66,0.35); color: var(--story-gold); }
.tut-fp-seg { display: flex; gap: 3px; background: rgba(0,0,0,0.3); border-radius: 6px; padding: 3px; }
.tut-fp-seg-btn { flex: 1; font-size: 10px; padding: 5px 4px; border-radius: 4px; text-align: center; color: var(--dawn-dim); background: none; border: none; }
.tut-fp-seg-on { background: rgba(245,200,66,0.12); color: var(--story-gold); }
.tut-fp-slider { padding: 4px 0; }
.tut-fp-slider-track { position: relative; height: 2px; background: var(--line-soft); border-radius: 1px; margin-bottom: 6px; }
.tut-fp-slider-fill { position: absolute; height: 100%; background: var(--story-gold); border-radius: 1px; }
.tut-fp-slider-thumb { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--story-gold); box-shadow: 0 0 6px rgba(245,200,66,0.5); }
.tut-fp-slider-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--story-gold); }

/* Filter annotations */
.tut-filter-annos { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.tut-filter-anno { display: flex; align-items: flex-start; gap: 12px; }
.tut-filter-anno-num { font-family: var(--font-mono); font-size: 11px; color: var(--candle-orange); min-width: 22px; padding-top: 1px; }
.tut-filter-anno-label { font-size: 12px; color: var(--moon-white); margin-bottom: 3px; }
.tut-filter-anno-desc  { font-size: 11px; color: var(--dawn-dim); line-height: 1.5; }

/* Smart pick demo */
.tut-smart-pick-demo {
  position: relative; margin-top: 20px; padding: 16px 18px; border-radius: 12px;
  border: 1px solid rgba(232,122,60,0.3); overflow: hidden;
  background: linear-gradient(135deg, rgba(232,122,60,0.1), rgba(245,200,66,0.05));
}
.tut-sp-glow {
  position: absolute; inset: -1px; pointer-events: none;
  background: radial-gradient(circle at 20% 50%, rgba(245,200,66,0.1), transparent 60%);
  animation: smartPulse 4s ease-in-out infinite;
}
.tut-sp-content { position: relative; display: flex; align-items: flex-start; gap: 14px; }
.tut-sp-ico { font-size: 18px; color: var(--story-gold); flex-shrink: 0; margin-top: 2px; }
.tut-sp-title { font-size: 13px; color: var(--moon-white); margin-bottom: 5px; font-weight: 500; }
.tut-sp-desc  { font-size: 12px; color: var(--dawn-gray); line-height: 1.65; }

/* Shortcuts */
.tut-shortcuts-grid { display: flex; flex-direction: column; gap: 0; margin-bottom: 4px; }
.tut-shortcut-row {
  display: flex; align-items: center; gap: 20px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  transition: background 0.1s;
}
.tut-shortcut-row:first-child { border-top: 1px solid var(--line-soft); border-radius: 10px 10px 0 0; }
.tut-shortcut-row:last-child { border-radius: 0 0 10px 10px; }
.tut-shortcut-row:hover { background: rgba(232,232,240,0.03); }
.tut-shortcut-keys { display: flex; align-items: center; gap: 4px; min-width: 140px; }
.tut-kbd-large {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 6px; border-radius: 5px;
  background: rgba(232,232,240,0.06); border: 1px solid rgba(232,232,240,0.14);
  font-family: var(--font-mono); font-size: 10px; color: var(--moon-white);
  box-shadow: 0 1px 0 rgba(232,232,240,0.08);
}
.tut-kbd-plus { font-size: 10px; color: var(--dawn-dim); margin: 0 2px; }
.tut-shortcut-action { font-size: 12.5px; color: var(--dawn-gray); }

/* Keyboard shortcut inline */
.tut-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 5px; border-radius: 4px;
  background: rgba(232,232,240,0.08); border: 1px solid rgba(232,232,240,0.14);
  font-family: var(--font-mono); font-size: 9.5px; color: var(--moon-white);
  box-shadow: 0 1px 0 rgba(232,232,240,0.06);
  vertical-align: middle;
}

/* Flow diagram */
.tut-flow {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  padding: 18px 16px; border-radius: 12px;
  background: rgba(232,232,240,0.02); border: 1px solid var(--line-soft);
}
.tut-flow-step { display: flex; align-items: center; gap: 6px; }
.tut-flow-num {
  font-family: var(--font-mono); font-size: 10px; color: var(--candle-orange); min-width: 20px;
}
.tut-flow-info { display: flex; flex-direction: column; gap: 2px; }
.tut-flow-label { font-size: 11.5px; color: var(--moon-white); white-space: nowrap; }
.tut-flow-sub   { font-size: 10px; color: var(--dawn-dim); white-space: nowrap; }
.tut-flow-arrow { font-size: 12px; color: var(--dawn-dim); margin: 0 10px; flex-shrink: 0; }

/* Done CTA */
.tut-done-cta {
  margin-top: 28px; padding: 28px 24px; border-radius: 16px; text-align: center;
  background: linear-gradient(135deg, rgba(245,200,66,0.05), rgba(232,122,60,0.05));
  border: 1px solid rgba(245,200,66,0.14);
}
.tut-done-eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--candle-orange); margin-bottom: 12px;
}
.tut-done-title { font-family: var(--font-display); font-size: 22px; color: var(--moon-white); margin: 0 0 8px; font-weight: 400; }
.tut-done-sub { font-family: var(--font-prose); font-size: 13px; color: var(--dawn-gray); margin: 0; line-height: 1.7; }

/* Section prev/next nav */
.tut-section-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line-soft);
}
.tut-sec-nav-btn {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 8px 14px; font-size: 11px; color: var(--dawn-gray);
  cursor: pointer; transition: all 0.15s;
}
.tut-sec-nav-btn:hover:not(.tut-sec-nav-disabled) { color: var(--moon-white); border-color: var(--line-medium); }
.tut-sec-nav-right { flex-direction: row-reverse; }
.tut-sec-nav-disabled { opacity: 0.3; cursor: not-allowed; }
.tut-sec-nav-dots {
  display: flex; gap: 6px; align-items: center;
}
.tut-sec-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-soft); transition: all 0.2s; cursor: pointer;
}
.tut-sec-dot:hover { background: var(--dawn-dim); }
.tut-sec-dot-on { background: var(--story-gold); width: 16px; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (768–1200px) and Mobile (≤767px)
   Breakpoint strategy:
     1200px: narrow desktop — slightly compress side panels
      960px: tablet landscape — collapse to 2-col (left hidden by default)
      768px: tablet portrait — single globe + overlay panels
      480px: mobile — full bottom-sheet panels, compact HUD
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1200px: compress columns ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 240px 1fr 300px; }
  .play-bar   { grid-template-columns: 240px 1fr 300px; }
  .hud-clock  { margin-left: 258px; }
}

/* ── 960px: tablet landscape — left panel collapses to icon rail ─────────── */
@media (max-width: 960px) {
  /* Two-column: narrow icon rail + globe center + right panel */
  .main-grid { grid-template-columns: 56px 1fr 280px; }
  .play-bar   { grid-template-columns: 56px 1fr 280px; }
  .hud-clock  { margin-left: 70px; }

  /* Left panel icon-rail mode: hide all text, show only icons */
  .left-panel {
    padding: 18px 10px;
    overflow: hidden;
    align-items: center;
  }
  .brand-name, .brand-sub, .search-wrap,
  .filter-stack, .coord-list-wrap, .nav-section-label,
  .story-list-wrap { display: none; }

  .brand-row { justify-content: center; }
  .brand-mark { width: 32px; height: 32px; }

  /* Expand left panel on hover/focus — fly-out drawer */
  .left-panel:hover,
  .left-panel:focus-within {
    position: fixed; left: 0; top: 0; bottom: 64px;
    width: 260px; z-index: 40;
    padding: 22px;
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
    overflow-y: auto;
  }
  .left-panel:hover .brand-name,
  .left-panel:hover .brand-sub,
  .left-panel:hover .search-wrap,
  .left-panel:hover .filter-stack,
  .left-panel:hover .coord-list-wrap,
  .left-panel:hover .nav-section-label,
  .left-panel:hover .story-list-wrap,
  .left-panel:focus-within .brand-name,
  .left-panel:focus-within .brand-sub,
  .left-panel:focus-within .search-wrap,
  .left-panel:focus-within .filter-stack,
  .left-panel:focus-within .coord-list-wrap,
  .left-panel:focus-within .nav-section-label,
  .left-panel:focus-within .story-list-wrap { display: flex; }
  .left-panel:hover .filter-stack,
  .left-panel:hover .coord-list-wrap,
  .left-panel:hover .story-list-wrap,
  .left-panel:focus-within .filter-stack,
  .left-panel:focus-within .coord-list-wrap,
  .left-panel:focus-within .story-list-wrap { display: block; }
  .left-panel:hover .brand-row,
  .left-panel:focus-within .brand-row { justify-content: flex-start; }
}

/* ── 768px: tablet portrait — full overlay panels ────────────────────────── */
@media (max-width: 768px) {
  /* Single column: full globe */
  .main-grid { grid-template-columns: 1fr; }
  .play-bar   { grid-template-columns: 1fr; }
  .hud-clock  { display: none; }

  /* Left panel: hidden by default, overlay drawer triggered by JS class */
  .left-panel {
    position: fixed; left: 0; top: 0; bottom: 64px;
    width: min(300px, 85vw); z-index: 50;
    padding: 22px; overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
    /* Re-show all content */
  }
  .left-panel.is-open {
    transform: translateX(0);
  }
  /* Re-show hidden content in drawer mode */
  .left-panel .brand-name, .left-panel .brand-sub,
  .left-panel .search-wrap, .left-panel .filter-stack,
  .left-panel .coord-list-wrap, .left-panel .nav-section-label,
  .left-panel .story-list-wrap { display: revert; }
  .left-panel .brand-row { justify-content: flex-start; }

  /* Right panel: always visible, positioned at bottom or right depending on orientation */
  .right-panel {
    position: fixed; right: 0; top: 0; bottom: 64px;
    width: min(300px, 85vw); z-index: 49;
    padding: 72px 18px 18px;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
    box-shadow: -4px 0 32px rgba(0,0,0,0.6);
  }
  .right-panel.is-open {
    transform: translateX(0);
  }

  /* Overlay backdrop */
  .panel-overlay {
    position: fixed; inset: 0 0 64px 0; z-index: 45;
    background: rgba(2,5,11,0.6);
    backdrop-filter: blur(4px);
    display: none;
  }
  .panel-overlay.is-visible { display: block; }

  /* HUD adjustments */
  .top-hud { padding: 0 14px; }
  .hud-actions { gap: 6px; }
  .hud-btn { width: 36px; height: 36px; }
  .hud-btn-primary { height: 36px; padding: 0 14px; font-size: 11px; }

  /* Play bar adjustments */
  .play-bar { padding: 0 14px; }
  .pb-left  { display: none; } /* hide story title in compact bar */
  .pb-center { padding: 0 16px; }
  .pb-right .pb-speed { display: none; }
  .pb-divider { display: none; }

  /* Menu toggle button (injected by JS) */
  .hud-btn-menu {
    display: inline-flex !important;
  }
}

/* ── 480px: mobile — bottom-sheet panels ────────────────────────────────── */
@media (max-width: 480px) {
  /* Left panel: bottom sheet */
  .left-panel {
    top: auto; left: 0; right: 0; bottom: 64px;
    width: 100%; height: 70vh; max-height: 520px;
    border-top: 1px solid var(--line-soft);
    border-right: none;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%) !important;
    transition: transform 0.36s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.7);
    overflow-y: auto;
  }
  .left-panel::before {
    content: ''; display: block;
    width: 36px; height: 3px; border-radius: 2px;
    background: rgba(232,232,240,0.18);
    margin: 0 auto 16px;
  }
  .left-panel.is-open {
    transform: translateY(0) !important;
  }

  /* Right panel: bottom sheet (taller) */
  .right-panel {
    top: auto; left: 0; right: 0; bottom: 64px;
    width: 100%; height: 75vh; max-height: 580px;
    border-top: 1px solid var(--line-soft);
    border-left: none;
    border-radius: 16px 16px 0 0;
    padding: 22px 18px 18px;
    transform: translateY(100%) !important;
    transition: transform 0.36s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.7);
    overflow-y: auto;
  }
  .right-panel::before {
    content: ''; display: block;
    width: 36px; height: 3px; border-radius: 2px;
    background: rgba(232,232,240,0.18);
    margin: 0 auto 16px;
  }
  .right-panel.is-open {
    transform: translateY(0) !important;
  }

  /* Full backdrop */
  .panel-overlay { inset: 0 0 64px 0; }

  /* HUD: smaller */
  .top-hud { top: 12px; padding: 0 12px; }
  .hud-btn { width: 34px; height: 34px; }
  .hud-btn-primary { height: 34px; padding: 0 12px; font-size: 10px; }
  .hud-actions { gap: 5px; }

  /* Play bar: minimal */
  .play-bar { padding: 0 12px; }
  .pb-right .pb-icon:not(.pb-toggle) { display: none; }

  /* Globe HUD corners: hide tl and tr on very small screens */
  .globe-hud-tl, .globe-hud-tr { display: none; }
  .globe-hud-bl { bottom: 78px; left: 12px; }
  .globe-hud-br { bottom: 78px; right: 12px; }
}

/* ── Touch tap target enforcement ───────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .hud-btn { min-width: 44px; min-height: 44px; }
  .hud-btn-primary { min-height: 44px; }
  .pb-icon { min-width: 44px; min-height: 44px; }
  .filter-chip { min-height: 36px; }
  .story-card-sm { min-height: 64px; }
  .coord-dot-hit { /* invisible tap expander for globe dots */
    width: 44px; height: 44px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .left-panel, .right-panel, .panel-overlay {
    transition: none !important;
  }
}

/* ── Safe-area insets (notch / home indicator) ───────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .play-bar {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(64px + env(safe-area-inset-bottom));
    }
    .left-panel, .right-panel {
      bottom: calc(64px + env(safe-area-inset-bottom));
    }
    .panel-overlay {
      bottom: calc(64px + env(safe-area-inset-bottom));
    }
    .globe-hud-bl { bottom: calc(78px + env(safe-area-inset-bottom)); }
    .globe-hud-br { bottom: calc(78px + env(safe-area-inset-bottom)); }
  }
}

