/* =============================================================
   EMOTIONAL LANDSCAPE — DESIGN SYSTEM
   Themes: Mist (light, default) · Bioluminescent (dark)
   One palette, one component kit, one spacing scale.
   ============================================================= */

/* ─── reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; cursor: pointer; }
svg { display: block; }

/* =============================================================
   1 — TOKENS
   ============================================================= */

:root {
  /* type — single sans family for everything */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* spacing — 4px scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px;

  /* radii */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;

  /* eases */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-breath: cubic-bezier(0.45, 0, 0.55, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* layout */
  --nav-h: 60px;
  --rail-w: 264px;
  --dock-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0);

  /* z layers */
  --z-map: 1;
  --z-rail: 50;
  --z-dock: 60;
  --z-drawer: 70;
  --z-nav: 100;
  --z-modal: 1000;
  --z-onboard: 3000;
  --z-drag: 5000;
}

/* ─── MIST (light, default) ─── */
:root,
[data-theme="light"] {
  --paper:        #fafaf8;
  --paper-2:      #f3f2ee;
  --paper-3:      #e9e8e3;
  --surface:        rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-soft:   rgba(255, 255, 255, 0.55);

  --ink:       #16171d;
  --ink-soft:  rgba(22, 23, 29, 0.72);
  --muted:     #6c6e76;
  --faint:     #a1a3aa;
  --dim:       rgba(22, 23, 29, 0.18);

  --hairline:        rgba(22, 23, 29, 0.08);
  --hairline-strong: rgba(22, 23, 29, 0.18);

  --accent:        #6b7fb8;
  --accent-soft:   #a8b5d6;
  --accent-deep:   #4f6398;
  --accent-glow:   rgba(107, 127, 184, 0.22);
  --accent-tint:   rgba(107, 127, 184, 0.10);
  --accent-on:     #ffffff;

  --shadow-xs:   0 1px 0 rgba(22, 23, 29, 0.04);
  --shadow-sm:   0 4px 12px -8px rgba(22, 23, 29, 0.10);
  --shadow-md:   0 12px 30px -18px rgba(22, 23, 29, 0.14);
  --shadow-lg:   0 24px 60px -28px rgba(22, 23, 29, 0.18);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --atmos-1: rgba(168, 196, 228, 0.10);
  --atmos-2: rgba(196, 184, 220, 0.08);
  --atmos-3: rgba(218, 232, 255, 0.10);

  --map-filter: saturate(0.7) brightness(1.0) contrast(0.95);

  --good:  #4a8a6a;
  --warn:  #c08355;
  --error: #b8504c;
}

/* ─── BIOLUMINESCENT (dark) ─── */
[data-theme="dark"] {
  --paper:        #0d0f1a;
  --paper-2:      #161928;
  --paper-3:      #1f2335;
  --surface:        rgba(22, 25, 40, 0.78);
  --surface-strong: rgba(22, 25, 40, 0.96);
  --surface-soft:   rgba(22, 25, 40, 0.50);

  --ink:       #f4f1ea;
  --ink-soft:  rgba(244, 241, 234, 0.82);
  --muted:     #8a8fa3;
  --faint:     #5a5e72;
  --dim:       rgba(244, 241, 234, 0.16);

  --hairline:        rgba(244, 241, 234, 0.08);
  --hairline-strong: rgba(244, 241, 234, 0.20);

  --accent:        #7ee5d4;
  --accent-soft:   #a5f0e3;
  --accent-deep:   #4fc6b0;
  --accent-glow:   rgba(126, 229, 212, 0.32);
  --accent-tint:   rgba(126, 229, 212, 0.10);
  --accent-on:     #0d0f1a;

  --shadow-xs:   0 1px 0 rgba(0, 0, 0, 0.40);
  --shadow-sm:   0 4px 12px -8px rgba(0, 0, 0, 0.55);
  --shadow-md:   0 12px 30px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(126, 229, 212, 0.06);
  --shadow-lg:   0 24px 60px -28px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(126, 229, 212, 0.08);
  --shadow-glow: 0 0 32px var(--accent-glow);

  --atmos-1: rgba(126, 229, 212, 0.08);
  --atmos-2: rgba(212, 165, 232, 0.06);
  --atmos-3: rgba(168, 196, 228, 0.04);

  --map-filter: invert(0.92) hue-rotate(180deg) saturate(0.7) brightness(0.95) contrast(0.95);

  --good:  #7ee5b4;
  --warn:  #f0c89a;
  --error: #f08580;
}

/* =============================================================
   2 — BASE
   ============================================================= */

html { color-scheme: light dark; }
[data-theme="dark"] html { color-scheme: dark; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  height: 100vh;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%,  var(--atmos-1), transparent 65%),
    radial-gradient(50% 45% at 92% 88%, var(--atmos-2), transparent 70%),
    radial-gradient(45% 40% at 88% 18%, var(--atmos-3), transparent 70%);
  transition: opacity 0.4s var(--ease);
}

::selection { background: var(--accent-tint); color: var(--ink); }

.accent { color: var(--accent); font-style: normal; }

#particles { display: none; }

/* =============================================================
   3 — TYPOGRAPHY UTILITIES
   ============================================================= */

.eyebrow {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.display-xl {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.display-lg {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.text-sm  { font-size: 13px; color: var(--ink-soft); }
.text-meta {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* =============================================================
   4 — COMPONENT PRIMITIVES
   ============================================================= */

/* button */
.btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease),
              box-shadow 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background: var(--accent-deep); box-shadow: 0 0 36px var(--accent-glow); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-soft); }

.btn-text {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}
.btn-text:hover { color: var(--ink); }

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid transparent;
}
.btn-icon:hover { background: var(--paper-2); color: var(--ink); }
.btn-icon svg { width: 16px; height: 16px; stroke-width: 1.6; }

.btn-block { width: 100%; }
.btn-sm { font-size: 12px; padding: 8px 14px; }

/* card */
.card {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-5);
}
.card-floating {
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-md);
}

/* input / textarea */
.input,
input.input,
textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus,
input.input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.input::placeholder,
textarea::placeholder { color: var(--faint); }

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* segmented (auth tabs etc.) */
.segmented {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 2px;
}
.segmented-option {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.segmented-option:hover { color: var(--ink); }
.segmented-option.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

/* chip */
.chip {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip:hover { background: var(--paper-2); color: var(--ink); }
.chip.selected,
.chip.active {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}

/* legacy hides */
.tab-bar { display: none !important; }
.sidebar { display: none !important; }

/* =============================================================
   5 — VIEWS (top-level)
   ============================================================= */

.view {
  display: none;
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
.view.active {
  display: flex;
  flex-direction: column;
  animation: viewIn 0.5s var(--ease) backwards;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* =============================================================
   6 — NAV BAR (top pill)
   ============================================================= */

.nav-bar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-md);
}
.nav-bar-tabs { display: flex; gap: 2px; }
.nav-tab {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active {
  color: var(--ink);
  background: var(--paper-2);
}
.nav-bar-trailing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
  margin-left: 4px;
  border-left: 1px solid var(--hairline);
}
.nav-bar-profile {
  width: 38px; height: 38px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-on);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: var(--shadow-glow);
  border: none;
}
.nav-bar-profile:hover { transform: scale(1.05); }
.nav-bar-title { display: none; }

/* theme toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.4s var(--ease);
  border: none;
  background: transparent;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--paper-2); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; stroke-width: 1.6; }
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }

/* =============================================================
   7 — MAP VIEW (map + left rail + bottom dock + slide-out feed)
   ============================================================= */

#map-view {
  flex-direction: column;
  position: absolute;
  inset: 0;
}
#map {
  width: 100%;
  height: 100%;
  background: var(--paper-2);
}
.maplibregl-canvas { outline: none; filter: var(--map-filter); transition: filter 0.4s var(--ease); }

/* maplibre controls (zoom etc.) */
.maplibregl-ctrl-top-right { margin-top: calc(var(--nav-h) + 24px) !important; margin-right: 18px !important; }
.maplibregl-ctrl-group {
  background: var(--surface-strong) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button {
  background: transparent !important;
  border-bottom: 1px solid var(--hairline) !important;
  width: 36px; height: 36px;
}
.maplibregl-ctrl-group button:hover { background: var(--paper-2) !important; }
.maplibregl-ctrl-group button:last-child { border-bottom: none !important; }
.maplibregl-ctrl-attrib {
  background: var(--surface) !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  border-radius: var(--r-sm) !important;
}
.maplibregl-ctrl-attrib a { color: var(--ink-soft) !important; }
[data-theme="dark"] .maplibregl-ctrl-attrib { color: var(--ink-soft) !important; }

/* ─── LEFT RAIL ─── */
.map-rail {
  position: fixed;
  top: calc(var(--nav-h) + 32px);
  left: 18px;
  width: var(--rail-w);
  z-index: var(--z-rail);
  pointer-events: none;
}
.map-rail > * { pointer-events: auto; }

.rail-card {
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.rail-section { padding: var(--s-5); }
.rail-section + .rail-section { border-top: 1px solid var(--hairline); }
.rail-section .eyebrow { display: block; margin-bottom: var(--s-3); }

.rail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.rail-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-stat .v {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.rail-stat .k {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.rail-mood {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.rail-mood strong {
  font-family: var(--font-ui);
  font-style: normal;
  color: var(--ink);
  font-weight: 400;
}

/* GPS button — inline pill */
.gps-toggle {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  justify-content: space-between;
  transition: all 0.2s var(--ease);
}
.gps-toggle:hover { border-color: var(--ink-soft); color: var(--ink); }
.gps-knob {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--faint);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.gps-toggle.on { color: var(--ink); border-color: var(--accent); }
.gps-toggle.on .gps-knob {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* nearby button (kept id="nearby-fab" for JS) */
.nearby-fab {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s var(--ease);
}
.nearby-fab:hover { background: var(--paper-2); border-color: var(--ink-soft); }

.rail-controls {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

/* ─── BOTTOM DOCK (dropper + jellyfish chat in one bar) ─── */
.dock {
  position: fixed;
  bottom: calc(18px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  width: min(640px, calc(100vw - 36px));
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  overflow: hidden;
}

.dock-dropper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--ink);
  cursor: grab;
  user-select: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.dock-dropper:hover { background: var(--paper-3); }
.dock-dropper:active { cursor: grabbing; transform: scale(0.96); }
.dock-dropper svg {
  width: 18px; height: 18px;
  color: var(--accent);
  stroke-width: 1.8;
  filter: drop-shadow(0 0 6px var(--accent-glow));
  animation: jellyBob 4.5s var(--ease-breath) infinite;
}
@keyframes jellyBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.dock-dropper.hidden { visibility: hidden; }

/* dropper-ghost — floating clone while dragging */
.dropper-ghost {
  position: fixed;
  z-index: var(--z-drag);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.4);
  width: 48px; height: 48px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-on);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px var(--accent-glow), var(--shadow-lg);
  animation: ghostPulse 1.4s var(--ease-breath) infinite;
}
.dropper-ghost svg { width: 22px; height: 22px; }
.dropper-ghost span { display: none; }
@keyframes ghostPulse {
  0%, 100% { box-shadow: 0 0 30px var(--accent-glow), var(--shadow-lg); }
  50%      { box-shadow: 0 0 50px var(--accent-glow), var(--shadow-lg); }
}
body.is-dragging-dropper { cursor: grabbing; }
body.is-dragging-dropper * { cursor: grabbing !important; }

/* dock chat input */
.dock-chat {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding-left: var(--s-3);
  gap: 6px;
}
.dock-chat input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 10px 6px;
  outline: none;
}
.dock-chat input::placeholder { color: var(--faint); }
.dock-send {
  width: 38px; height: 38px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-on);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: var(--shadow-glow);
  border: none;
  cursor: pointer;
}
.dock-send:hover { background: var(--accent-deep); }
.dock-send:active { transform: scale(0.96); }
.dock-send svg { width: 16px; height: 16px; stroke-width: 2; }

/* toggle to expand/collapse the jellyfish chat popup */
.dock-popup-toggle {
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.dock-popup-toggle:hover { background: var(--paper-2); color: var(--ink); }
.dock-popup-toggle svg { width: 18px; height: 18px; stroke-width: 1.6; }
.jelly-popup.open ~ .dock .dock-popup-toggle { color: var(--accent); }

/* jellyfish popup — contained, scrollable chat above the dock */
.jelly-popup {
  position: fixed;
  bottom: calc(94px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: var(--z-dock);
  width: min(560px, calc(100vw - 36px));
  max-height: min(520px, 60vh);
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease-out);
}
.jelly-popup.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.jelly-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.jelly-popup-title {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.jelly-popup-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: feedPulse 2.4s ease-in-out infinite;
}
.dock-feed {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.dock-feed::-webkit-scrollbar { width: 4px; }
.dock-feed::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }

/* jdm — single message (kept class names for JS) */
.jdm {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: var(--r-md);
  max-width: 85%;
  animation: jdmIn 0.4s var(--ease-out);
  border: 1px solid transparent;
}
@keyframes jdmIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.jdm-you {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-on);
}
.jdm-jelly {
  align-self: flex-start;
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--hairline);
  font-size: 14.5px;
  line-height: 1.5;
}
.jdm-jelly-loading { padding: 12px 16px; }
.jdm-jelly-loading .jdm-dots {
  display: inline-flex; gap: 4px; align-items: center;
}
.jdm-jelly-loading .jdm-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: jdmDot 1.2s ease-in-out infinite;
}
.jdm-jelly-loading .jdm-dots span:nth-child(2) { animation-delay: 0.18s; }
.jdm-jelly-loading .jdm-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes jdmDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%           { opacity: 1; transform: scale(1.1); }
}

/* ─── RIGHT-EDGE FEED HANDLE + DRAWER (live world feed) ─── */
.feed-handle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: var(--z-drawer);
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: padding-right 0.2s var(--ease);
  border: none;
}
.feed-handle:hover { padding-right: 16px; }
.feed-handle-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: feedPulse 2.4s ease-in-out infinite;
}
@keyframes feedPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.6; }
}
.feed-handle-label {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.feed-handle-count {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--ink);
  background: var(--paper-2);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.feed-drawer {
  position: fixed;
  top: calc(var(--nav-h) + 32px);
  bottom: calc(var(--dock-h) + 36px + var(--safe-bottom));
  right: 18px;
  width: 320px;
  z-index: var(--z-drawer);
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease);
}
.feed-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.feed-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline);
}
.feed-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.feed-drawer-list::-webkit-scrollbar { width: 4px; }
.feed-drawer-list::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }

/* world chat message — used inside feed-drawer */
.wc-message {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.2s var(--ease);
  border: 1px solid transparent;
}
.wc-message:hover { background: var(--paper-2); border-color: var(--hairline); }
.wc-message .emo-dot {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--m-color, var(--accent));
  margin-top: 6px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--m-color, var(--accent)) 50%, transparent);
}
.wc-message .body { flex: 1; min-width: 0; }
.wc-message .line {
  display: flex; align-items: baseline; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.wc-message .emo-label {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
}
.wc-message .place-txt {
  font-size: 12px;
  color: var(--muted);
}
.wc-message .meta {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.wc-empty {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: var(--s-8) var(--s-4);
}

/* drop reticle (rendered in map's vector layer mostly; legacy DOM) */
.drop-reticle { display: none; }

/* ── transient hint above dock ── */
.map-instructions {
  position: fixed;
  bottom: calc(96px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.map-instructions.visible { opacity: 1; }
.map-instructions.fading { opacity: 0; }

/* time scrub — small pill at top center, only visible when there's history */
.time-scrub {
  position: fixed;
  top: calc(var(--nav-h) + 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 14px;
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-md);
  width: min(440px, calc(100vw - 36px));
}
.time-scrub-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: left;
}
.time-scrub-slider,
#time-scrub-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  outline: none;
  cursor: pointer;
}
#time-scrub-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--paper);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: grab;
}
#time-scrub-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--paper);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: grab;
}
.time-scrub-now {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.time-scrub-now:hover { background: var(--accent-tint); }

/* map splash — animated ripple where a new check-in appears */
.map-splash {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--splash-color, var(--accent));
  pointer-events: none;
  animation: mapSplash 1.6s var(--ease-out) forwards;
}
@keyframes mapSplash {
  0% {
    transform: scale(0.5);
    opacity: 1;
    box-shadow: 0 0 0 0 var(--splash-color, var(--accent));
  }
  60% {
    transform: scale(7);
    opacity: 0.55;
    box-shadow: 0 0 28px var(--splash-color, var(--accent));
  }
  100% {
    transform: scale(13);
    opacity: 0;
    box-shadow: 0 0 0 0 var(--splash-color, var(--accent));
  }
}

/* hidden legacy elements (DOM kept for JS, visually retired) */
.map-info-panel,
.dropper-dock,
.jelly-chat,
.jelly-hint,
.world-chat:not(.feed-drawer) { display: none !important; }

/* ── jelly-chat (legacy panel — fully hidden, JS still references nodes) ── */
.jelly-chat-toggle,
.jelly-chat-panel { display: none !important; }

/* ── jelly-msg (used inside legacy jelly-chat-log; kept stylable) ── */
.jelly-msg { display: none; }

/* =============================================================
   8 — DASHBOARD VIEW (editorial spread)
   ============================================================= */

#dashboard-view {
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  align-items: stretch;
  position: relative;
}
#dashboard-view::-webkit-scrollbar { width: 6px; }
#dashboard-view::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 3px; }

/* full-bleed terrain canvas as background */
#dashboard-view .dashboard-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}
#dashboard-view .dashboard-bg-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--paper) 35%, transparent) 0%,
    color-mix(in srgb, var(--paper) 55%, transparent) 60%,
    color-mix(in srgb, var(--paper) 75%, transparent) 100%);
}
.dash-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--nav-h) + 36px) var(--s-8) var(--s-12);
  min-height: 100%;
}

.dash-header {
  width: 100%;
  max-width: 1080px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-10);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--hairline);
}
.dash-header > div:first-child::before {
  content: 'Insights';
  display: block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(40px, 5.5vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 6px;
}
.dash-header p {
  font-family: var(--font-ui);
  font-size: 17px;
  color: var(--muted);
  line-height: 1.45;
}
.dash-header-meta {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.dash-bento {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(120px, auto);
  gap: var(--s-4);
}
.dash-card,
.stat-card,
.mood-card {
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-sm);
}
.dash-card h3,
.mood-card h3 {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
  margin-bottom: var(--s-4);
}

.bento-stat     { grid-column: span 1; grid-row: span 1; }
.bento-mood     { grid-column: span 1; grid-row: span 2; }
.bento-bars     { grid-column: span 2; grid-row: span 2; }
.bento-timeline { grid-column: span 4; grid-row: span 2; }

/* stat card */
.stat-card .stat-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
}
.stat-card .stat-value {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 48px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-top: var(--s-2);
}
.stat-card .stat-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--s-2);
}

/* mood card */
.mood-card { align-items: flex-start; gap: var(--s-3); }
.mood-orb {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 28px var(--accent-glow), inset 0 0 16px rgba(255,255,255,0.18);
  margin-top: var(--s-2);
  animation: orbBreathe 5s var(--ease-breath) infinite;
}
@keyframes orbBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
.mood-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-top: var(--s-2);
}
.mood-desc {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.45;
}

/* emotion bars */
.emotion-bars {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
}
.bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 28px;
  align-items: center;
  gap: var(--s-3);
}
.bar-label {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
}
.bar-track {
  height: 6px;
  background: var(--paper-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 0.6s var(--ease-out);
}
.bar-count {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
}
.timeline::-webkit-scrollbar { width: 4px; }
.timeline::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }
.timeline-entry {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--hairline);
}
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-content .time {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.timeline-content .place {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  margin-top: 2px;
}
.timeline-content .note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}
.timeline .empty {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
  padding: var(--s-6);
  text-align: center;
}

@media (max-width: 880px) {
  .dash-bento { grid-template-columns: repeat(2, 1fr); }
  .bento-landscape, .bento-mood, .bento-bars, .bento-timeline { grid-column: span 2; }
}

/* =============================================================
   9 — MESSAGES VIEW (chat / world feed)
   ============================================================= */

#journal-view {
  flex-direction: column;
  padding: calc(var(--nav-h) + 36px) var(--s-6) var(--s-6);
  overflow: hidden;
  align-items: center;
}

.chat-hero {
  width: 100%;
  max-width: 760px;
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
.chat-hero-silhouette { display: none; } /* retire the sunset SVG */
.chat-hero-text { display: flex; flex-direction: column; gap: 4px; }
.chat-hero-eyebrow {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.chat-hero h1 {
  font-family: var(--font-ui);
  font-size: clamp(40px, 5.5vw, 56px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
}
.chat-hero p {
  font-family: var(--font-ui);
  font-size: 17px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}

.chat-body {
  width: 100%;
  max-width: 760px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* messages tab sub-view toggle (Lobby ↔ Loggings) */
.msg-toggle {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 2px;
  margin-bottom: var(--s-3);
  align-self: flex-start;
}
.msg-toggle-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.msg-toggle-btn:hover { color: var(--ink); }
.msg-toggle-btn.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

/* loggings list — community check-ins */
.loggings-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding-right: var(--s-2);
  margin-bottom: var(--s-3);
}
.loggings-list::-webkit-scrollbar { width: 4px; }
.loggings-list::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }

/* lobby chat — shared real-time room */
.lobby-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-2);
  margin-bottom: var(--s-3);
}
.lobby-list::-webkit-scrollbar { width: 4px; }
.lobby-list::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }

.lobby-empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--muted);
  margin: auto;
}
.lobby-empty h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--s-2);
}

.lobby-group {
  display: flex;
  align-items: flex-end;
  gap: var(--s-3);
  max-width: 80%;
}
.lobby-group.me {
  flex-direction: row-reverse;
  margin-left: auto;
}
.lobby-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--user-hue, var(--accent));
  color: var(--accent-on);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.lobby-bubble-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.lobby-group.me .lobby-bubble-stack { align-items: flex-end; }

.lobby-meta {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-bottom: 2px;
  padding: 0 4px;
}
.lobby-group.me .lobby-meta { flex-direction: row-reverse; }
.lobby-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.lobby-time {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.lobby-bubble {
  font-size: 14px;
  line-height: 1.45;
  padding: 9px 14px;
  border-radius: 16px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  color: var(--ink);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  animation: lobbyIn 0.3s var(--ease-out);
  max-width: 100%;
}
.lobby-group.me .lobby-bubble {
  background: var(--accent);
  color: var(--accent-on);
  border-color: transparent;
}
.lobby-bubble.sending { opacity: 0.6; }
.lobby-bubble.failed {
  border-color: var(--error);
  color: var(--error);
}
.lobby-bubble.failed::after {
  content: ' · failed';
  font-size: 11px;
  opacity: 0.7;
}
@keyframes lobbyIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* presence bar — who is online right now */
.chat-presence {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
  padding: var(--s-2) 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.presence-count {
  font-weight: 500;
  color: var(--ink);
  margin-right: var(--s-2);
}
.presence-empty {
  color: var(--muted);
}
.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink);
}
.presence-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--user-hue, var(--accent));
  box-shadow: 0 0 6px color-mix(in srgb, var(--user-hue, var(--accent)) 60%, transparent);
}
.presence-more {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px;
}
.user-online-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 6px var(--good);
  margin-left: 6px;
  vertical-align: middle;
  animation: feedPulse 2.4s ease-in-out infinite;
}

/* per-message actions: echo (heart) + reply */
.chat-msg-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding-top: var(--s-2);
  border-top: 1px dashed var(--hairline);
  flex-wrap: wrap;
}
.chat-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.chat-action:hover { background: var(--paper-3); color: var(--ink); }
.chat-action.on { color: var(--accent); }
.chat-action svg { width: 14px; height: 14px; }
.chat-msg-actions .chat-msg-coords { margin-left: auto; }

/* reply thread */
.reply-thread {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.reply {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}
.reply-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--user-hue, var(--accent));
  color: var(--accent-on);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.reply-body { flex: 1; min-width: 0; }
.reply-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}
.reply-time {
  margin-left: var(--s-2);
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.reply-text {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  line-height: 1.45;
}
.reply-form {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin-top: var(--s-2);
}
.reply-input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.reply-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.reply-send {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-on);
  background: var(--accent);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.reply-send:hover { background: var(--accent-deep); }

.chat-filter-row {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.chat-filter {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chat-filter:hover { color: var(--ink); }
.chat-filter.active {
  color: var(--accent-on);
  background: var(--accent);
  border-color: var(--accent);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding-right: var(--s-2);
  margin-bottom: var(--s-4);
}
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }

.chat-msg {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
  animation: chatMsgIn 0.4s var(--ease-out) backwards;
}
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.chat-msg:hover { background: var(--paper-3); border-color: var(--hairline-strong); }
.chat-msg.self {
  background: var(--accent-tint);
  border-color: var(--accent-glow);
}
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--user-hue, var(--accent));
  color: var(--accent-on);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  flex-shrink: 0;
}
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.chat-username {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
}
.chat-emotion-chip {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.chat-time {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--faint);
  margin-left: auto;
}
.chat-msg-place {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-soft);
}
.chat-msg-place em { color: var(--ink); font-style: normal; font-weight: 600; }
.chat-msg-note {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  margin-top: var(--s-2);
}
.chat-msg-coords {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--faint);
  margin-top: var(--s-2);
}
.chat-empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
}
.chat-empty h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--s-2);
}
.chat-empty p {
  font-family: var(--font-ui);
  color: var(--muted);
}

.chat-composer {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  padding: 6px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  transition: border-color 0.2s var(--ease);
}
.chat-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.chat-composer input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 14px;
  background: transparent;
  border: none;
  padding: 10px 14px;
  outline: none;
  color: var(--ink);
}
.chat-composer input::placeholder { color: var(--faint); }
.chat-send {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-on);
  background: var(--accent);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  box-shadow: var(--shadow-glow);
}
.chat-send:hover { background: var(--accent-deep); }

/* =============================================================
   10 — MODAL (log a feeling)
   ============================================================= */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--s-5);
}
.modal-overlay.active { display: flex; animation: viewIn 0.25s var(--ease); }

.modal {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 60px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.4s var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  padding: var(--s-6) var(--s-6) 0;
}
.modal-header h2 {
  font-family: var(--font-ui);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.modal-header h2 em { font-style: normal; color: var(--accent); }
.modal-header p {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
  margin-top: var(--s-2);
  line-height: 1.4;
}

.modal-body {
  padding: var(--s-5) var(--s-6) var(--s-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 2px; }

.question-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.question-group > label {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

/* log-pad: small valence/arousal grid inside modal */
.log-pad-group { padding: 0; gap: var(--s-3); }
.log-pad-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}
.log-pad-emotion {
  font-family: var(--font-ui);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.log-pad-intensity {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.log-pad {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-strong);
  background:
    radial-gradient(circle at 10% 10%, var(--atmos-1), transparent 65%),
    radial-gradient(circle at 90% 90%, var(--atmos-2), transparent 65%),
    var(--paper-2);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.log-pad::before,
.log-pad::after {
  content: '';
  position: absolute;
  background: var(--hairline-strong);
  pointer-events: none;
}
.log-pad::before { left: 8%; right: 8%; top: 50%; height: 1px; }
.log-pad::after  { top: 8%; bottom: 8%; left: 50%; width: 1px; }

.log-pad-anchors { position: absolute; inset: 0; pointer-events: none; }

/* axis labels live OUTSIDE the pad in a grid so they never collide
   with the emotion anchors that sit on the pad's edges */
.log-pad-frame {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: var(--s-2);
  align-items: center;
  justify-items: center;
  width: 100%;
}
.log-pad-frame .log-pad {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
}
.log-axis {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
}
.log-axis-top    { grid-column: 2; grid-row: 1; }
.log-axis-bottom { grid-column: 2; grid-row: 3; }
.log-axis-left {
  grid-column: 1; grid-row: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.log-axis-right {
  grid-column: 3; grid-row: 2;
  writing-mode: vertical-rl;
}

/* hide any legacy axis labels that were inside the pad (cached HTML safety) */
.log-pad .affect-axis-label { display: none !important; }
.log-pad-anchor {
  position: absolute;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-soft);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  transition: all 0.2s var(--ease);
}
.log-pad-anchor:hover { background: var(--surface-strong); color: var(--ink); }
.log-pad-anchor.nearest {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* affect-thumb — used in both log-pad and affect-pad */
.affect-thumb {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 14px var(--accent-glow);
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
  left: 50%; top: 50%;
}
.affect-thumb.visible { display: block; }

/* affect-axis-label (used in both pads) */
.affect-axis-label {
  position: absolute;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  pointer-events: none;
}
.affect-axis-top    { top: 10px;    left: 50%; transform: translateX(-50%); }
.affect-axis-bottom { bottom: 10px; left: 50%; transform: translateX(-50%); }
.affect-axis-left   { left: 12px;   top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; }
.affect-axis-right  { right: 12px;  top: 50%; transform: translateY(-50%) rotate(90deg);  transform-origin: right center; }

/* trigger chips inside modal */
.emotion-grid {
  display: grid;
  gap: var(--s-2);
}
.emotion-chip {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s var(--ease);
}
.emotion-chip:hover { background: var(--paper-2); color: var(--ink); }
.emotion-chip.selected,
.trigger-chip.selected {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline);
}
.modal-actions .btn-secondary {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.modal-actions .btn-secondary:hover { color: var(--ink); }
.modal-actions .btn-primary {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-on);
  background: var(--accent);
  border: none;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: background 0.2s var(--ease);
}
.modal-actions .btn-primary:hover { background: var(--accent-deep); }

/* =============================================================
   11 — AFFECT ONBOARDING (full-screen circumplex pad)
   ============================================================= */

.affect-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-onboard);
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: var(--s-5);
}
.affect-overlay.active { display: flex; animation: viewIn 0.4s var(--ease); }

.affect-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 12% 8%,  var(--atmos-1), transparent 65%),
    radial-gradient(50% 45% at 92% 88%, var(--atmos-2), transparent 70%);
  pointer-events: none;
}

.affect-panel {
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-8) var(--s-6) var(--s-6);
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.affect-header { margin-bottom: var(--s-6); }
.affect-header h2 {
  font-family: var(--font-ui);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: var(--s-2);
}
.affect-header h2 em { font-style: normal; color: var(--accent); }
.affect-header p {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 340px;
}

.affect-readout { display: none; }

.affect-pad {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-strong);
  background:
    radial-gradient(circle at 10% 10%, var(--atmos-1), transparent 65%),
    radial-gradient(circle at 90% 10%, var(--atmos-3), transparent 65%),
    radial-gradient(circle at 10% 90%, var(--atmos-2), transparent 65%),
    radial-gradient(circle at 90% 90%, var(--atmos-1), transparent 65%),
    var(--paper-2);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.affect-pad::before,
.affect-pad::after {
  content: '';
  position: absolute;
  background: var(--hairline-strong);
  pointer-events: none;
}
.affect-pad::before { left: 8%; right: 8%; top: 50%; height: 1px; }
.affect-pad::after  { top: 8%; bottom: 8%; left: 50%; width: 1px; }

.affect-quadrant-label {
  position: absolute;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  opacity: 0.45;
  pointer-events: none;
}
.q-tl { top: 14%; left: 14%; }
.q-tr { top: 14%; right: 14%; }
.q-bl { bottom: 14%; left: 14%; }
.q-br { bottom: 14%; right: 14%; }

.affect-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.affect-actions .btn-secondary {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: var(--r-pill);
}
.affect-actions .btn-secondary:hover { color: var(--ink); }
.affect-actions .btn-primary {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-on);
  background: var(--accent);
  border: none;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: background 0.2s var(--ease);
}
.affect-actions .btn-primary:hover { background: var(--accent-deep); }

/* =============================================================
   12 — LOGIN
   ============================================================= */

#login-page {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  overflow: hidden;
  transition: opacity 0.4s var(--ease);
}
#login-page.hidden { display: none !important; opacity: 0; }

.login-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
}
.login-glow-back {
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  top: -200px; left: -200px;
  animation: blobFloat 14s var(--ease-breath) infinite;
}
.login-glow-mid {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--atmos-2), transparent 60%);
  bottom: -100px; right: -100px;
  animation: blobFloat 18s var(--ease-breath) infinite reverse;
}
.login-glow-core {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent-tint), transparent 60%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: blobPulse 6s var(--ease-breath) infinite;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(40px, 30px); }
}
@keyframes blobPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50%      { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.login-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  animation: viewIn 0.6s var(--ease) backwards;
}

.login-brand {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.login-tagline {
  font-family: var(--font-ui);
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
}
.login-tagline em { font-style: normal; color: var(--accent); }

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.login-input-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.login-input {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 14px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.login-input::placeholder { color: var(--faint); }

.login-error {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--error);
  min-height: 14px;
}

.login-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-on);
  background: var(--accent);
  border: none;
  border-radius: var(--r-pill);
  padding: 16px 24px;
  cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-btn:hover { background: var(--accent-deep); box-shadow: 0 0 36px var(--accent-glow); }
.login-btn:active { transform: scale(0.98); }
.text_button { display: inline-flex; align-items: center; gap: 6px; }

.login-skip {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--s-2);
  align-self: center;
  transition: color 0.2s var(--ease);
}
.login-skip:hover { color: var(--ink); }

.login-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: var(--s-2);
}

/* =============================================================
   13 — RESPONSIVE
   ============================================================= */

@media (max-width: 720px) {
  .map-rail {
    width: calc(100vw - 36px);
    top: calc(var(--nav-h) + 24px);
    left: 18px; right: 18px;
  }
  .feed-drawer { width: calc(100vw - 36px); right: 18px; }
  .dock { width: calc(100vw - 24px); }
  .dock-dropper span { display: none; }
  .dock-dropper { padding: 8px; }
}

@media (max-width: 540px) {
  .nav-bar { width: calc(100vw - 24px); justify-content: space-between; }
  .nav-tab { padding: 8px 12px; font-size: 12px; }
  #dashboard-view { padding: calc(var(--nav-h) + 24px) var(--s-4) var(--s-8); }
  #journal-view { padding: calc(var(--nav-h) + 24px) var(--s-4) var(--s-4); }
}
