/* Echo — fully responsive prototype, no phone wrapper.
   Aesthetic: silent, heavy, sanctuary-like. Teal city + amber pulse. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  background: #02080a;
  font-family: 'Libre Baskerville', Georgia, serif;
  color: #e8e3d5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ Map (persistent layer 0) ============ */
#map {
  position: fixed; inset: 0;
  z-index: 0;
  transition: filter 700ms ease, transform 700ms ease, opacity 700ms ease;
}
#map .maplibregl-control-container,
#map .maplibregl-ctrl { display: none !important; }

body.on-communion #map {
  filter: blur(22px) saturate(1.4) brightness(0.55);
  transform: scale(1.10);
}
body.on-trace #map { opacity: 0; }

/* Vignette + tilt-shift fade */
#map-vignette {
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 55%, transparent 0%, transparent 38%, rgba(2,8,10,0.7) 88%, rgba(0,0,0,0.95) 100%),
    linear-gradient(180deg, rgba(2,8,10,0.6) 0%, transparent 22%, transparent 78%, rgba(2,8,10,0.75) 100%);
}

/* Hot intersection — bright amber bloom dead-centre, screen-blended */
#map-glow {
  position: fixed; inset: 0;
  z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 200, 130, 0.55) 0%,
    rgba(255, 130, 50, 0.35) 8%,
    rgba(255, 90, 30, 0.18) 18%,
    transparent 38%);
  mix-blend-mode: screen;
  transition: opacity 700ms ease;
}
body.on-communion #map-glow,
body.on-trace #map-glow { opacity: 0; }

/* Film grain — sits above map+glow, below screens. SVG fractalNoise tiled. */
#grain {
  position: fixed; inset: 0;
  z-index: 2; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.18;
  mix-blend-mode: overlay;
  transition: opacity 700ms ease;
}
body.on-trace #grain { opacity: 0; }

/* ============ Screens ============ */
.screen {
  position: fixed; inset: 0;
  z-index: 3;
  opacity: 0; pointer-events: none;
  transition: opacity 700ms ease;
}
.screen.is-active { opacity: 1; pointer-events: auto; }

/* On the glade, every pointer event falls through to the map. The pulse is
   purely visual; chat triggers come from the Talk button (which has its own
   explicit pointer-events:auto and lives outside any screen). */
.screen.glade.is-active { pointer-events: none; }

/* Shared back button */
.back-btn {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  left: 12px;
  width: 38px; height: 38px;
  background: transparent; border: none;
  color: rgba(232, 227, 213, 0.6);
  cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.back-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; }

/* ============ Screen 1: The Glade ============ */
.glade { background: transparent; }

.glade-hint {
  position: absolute;
  top: max(60px, env(safe-area-inset-top, 40px) + 30px);
  left: 0; right: 0;
  text-align: center;
  font-size: 11px; letter-spacing: 0.32em;
  color: rgba(245, 230, 200, 0.6);
  text-transform: uppercase; font-style: italic;
  text-shadow: 0 0 16px rgba(0,0,0,0.9);
}
.glade-foot {
  position: absolute;
  bottom: max(100px, env(safe-area-inset-bottom, 20px) + 84px);
  left: 0; right: 0;
  padding: 0 24px;
  text-align: center;
  font-size: 11px; letter-spacing: 0.18em;
  line-height: 1.5;
  color: rgba(245, 230, 200, 0.5);
  font-style: italic;
  text-shadow: 0 0 14px rgba(0,0,0,0.9);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

/* Forward direction hint — soft amber warmth biased upward from the pulse.
   Pure radial gradient, no clip-path, no hard edges. Reads as "you facing
   forward" without becoming a UI element. */
.heading-cone {
  position: absolute;
  top: 50%; left: 50%;
  width: 380px; height: 460px;
  transform: translate(-50%, calc(-100% + 32px));
  pointer-events: none;
  background: radial-gradient(ellipse 48% 72% at 50% 100%,
    rgba(255, 215, 165, 0.36) 0%,
    rgba(255, 170,  95, 0.16) 24%,
    rgba(255, 120,  55, 0.05) 48%,
    transparent 68%);
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 0.55;
  z-index: 1;
}

/* Pulse-wrap is the visual container only — pointer-events pass through
   so markers underneath stay clickable. Only the small white core itself
   captures clicks and triggers the chat. */
.pulse-wrap {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 86px; height: 86px;
  background: transparent; border: none;
  padding: 0;
  z-index: 2;
  pointer-events: none;
}
.pulse-core {
  position: absolute; inset: 32%;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow:
    0 0 24px rgba(255, 220, 160, 0.85),
    0 0 60px rgba(255, 170, 80, 0.6),
    0 0 140px rgba(255, 110, 40, 0.45);
  z-index: 2;
  pointer-events: none;   /* purely visual — Talk button triggers chat now */
}
.pulse-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 170, 0.6);
  animation: pulse 3.2s ease-out infinite;
  pointer-events: none;
}
.pulse-ring.delay { animation-delay: 1.6s; }
@keyframes pulse {
  0%   { transform: scale(0.4); opacity: 0.95; }
  100% { transform: scale(2.0); opacity: 0; }
}

/* ============ Screen 2: The Communion ============ */
.communion::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(6,12,14,0.55) 0%, rgba(6,12,14,0.88) 80%);
  pointer-events: none;
  transition: background 1400ms ease;
}

/* "Listening" state — the world holds its breath while she's gathering her
   reply. Communion vignette deepens, map dims further, all on a slow ease.
   Released the moment her first word hits the wire (hideThinking removes the
   class), so words emerge out of the dim into restored warmth — like a
   candle being lit. Pace is slow enough to feel ambient, not anxious. */
body.is-listening .communion::before {
  background: radial-gradient(ellipse at center, rgba(6,12,14,0.82) 0%, rgba(6,12,14,0.96) 80%);
}
body.is-listening #map {
  filter: blur(28px) saturate(1.15) brightness(0.32);
}

.chat {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column;
  padding:
    max(48px, env(safe-area-inset-top, 28px) + 22px)
    24px
    max(20px, env(safe-area-inset-bottom, 12px) + 8px);
  max-width: 600px;
  margin: 0 auto;
}

.chat-header { text-align: center; margin-bottom: 16px; }
.elder-name {
  font-style: italic; font-size: 14px;
  letter-spacing: 0.18em;
  color: rgba(245, 230, 200, 0.78);
  text-transform: lowercase;
}
.elder-place {
  margin-top: 8px;
  font-size: 10px; letter-spacing: 0.18em;
  color: rgba(232, 227, 213, 0.42);
  text-transform: lowercase;
}

.chat-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding-right: 4px; min-width: 0; }
.msg {
  margin-bottom: 26px;
  line-height: 1.65; font-size: 17px;
  font-family: 'Libre Baskerville', serif;
  opacity: 0;
  animation: fade-in 1200ms ease forwards;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.msg.elder { font-style: italic; color: #f5e6c8; }
.msg.you {
  color: rgba(232, 227, 213, 0.78);
  text-align: right; font-size: 15px;
}
.msg.thinking {
  font-style: normal;
  color: rgba(245, 200, 130, 0.62);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgba(245, 200, 130, 0.35);
  transform-origin: center;
  animation: fade-in 600ms ease forwards, sowilo-pulse 1.7s ease-in-out infinite;
}

/* Pulse register: ~35 bpm — slower than a heartbeat, faster than a breath.
   Subordinate signal now: the world-dim does the heavy lifting; the dot is
   just a tiny "yes, I heard you" punctuation. Small scale + soft glow swell. */
@keyframes sowilo-pulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(1.0);
    text-shadow: 0 0 5px rgba(245, 200, 130, 0.25);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
    text-shadow: 0 0 11px rgba(245, 200, 130, 0.55);
  }
}

/* "What stayed" — the curated wisdom that just landed in the ground when an
   offering was accepted. Sits above her conversational reply so the offerer
   sees what their moment became first. */
.msg.wisdom-block {
  margin: 6px 0 30px;
  padding: 14px 16px 14px 18px;
  border-left: 2px solid rgba(245, 200, 130, 0.55);
  background: rgba(245, 200, 130, 0.04);
  border-radius: 0 8px 8px 0;
  animation: fade-in 1000ms ease forwards;
  opacity: 0;
}
.wisdom-label {
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-style: italic;
  color: rgba(245, 200, 130, 0.7);
  margin-bottom: 10px;
}
.wisdom-text {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1.55;
  color: #f5e6c8;
}
@keyframes breathe-text {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.95; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-footer { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 14px 20px;
  color: #e8e3d5;
  font-family: 'Libre Baskerville', serif;
  font-size: 15px; font-style: italic;
  outline: none;
}
.chat-input::placeholder { color: rgba(232, 227, 213, 0.32); }
.chat-input:focus { border-color: rgba(245, 230, 200, 0.28); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(245, 230, 200, 0.08);
  border: 1px solid rgba(245, 230, 200, 0.18);
  color: rgba(245, 230, 200, 0.8);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 200ms;
}
.icon-btn:hover { background: rgba(245, 230, 200, 0.14); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.4; }

/* Always-visible action buttons (Talk + Offer) on the glade. Subtle amber
   breathing — counter-rhythm so they read as alive but never pull attention
   from the central pulse. Hidden on communion + trace screens via body class. */
.action-btn {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom, 0px) + 24px);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(245, 230, 200, 0.06);
  border: 1px solid rgba(245, 230, 200, 0.22);
  color: rgba(245, 230, 200, 0.85);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 4;
  padding: 0;
  transition: opacity 400ms ease, background 200ms ease;
  animation: action-breathe 4.8s ease-in-out infinite;
}
.action-btn svg { width: 22px; height: 22px; }
.action-btn:hover { background: rgba(245, 230, 200, 0.16); }
.offer-btn { left: 24px; animation-delay: 0s; }
.talk-btn  { right: 24px; animation-delay: 2.4s; }
@keyframes action-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 200, 130, 0.0); transform: scale(1.0); }
  50%      { box-shadow: 0 0 18px 2px rgba(245, 200, 130, 0.22); transform: scale(1.05); }
}
body.on-communion .action-btn,
body.on-trace .action-btn { opacity: 0; pointer-events: none; }

/* Camera-to-offer sits inline in the chat-footer alongside the send button.
   Amber tint distinguishes it from the cooler send icon. */
.icon-btn.trace-inline {
  background: rgba(255, 138, 62, 0.12);
  border-color: rgba(255, 138, 62, 0.40);
  color: rgba(245, 220, 180, 0.92);
  flex-shrink: 0;
}
.icon-btn.trace-inline:hover { background: rgba(255, 138, 62, 0.22); }

/* ============ Screen 3: The Trace ============ */
.trace {
  background: #050608;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 18px;
  padding:
    max(80px, env(safe-area-inset-top, 40px) + 56px)
    24px
    max(110px, env(safe-area-inset-bottom, 20px) + 90px);
  overflow-y: auto;
}
.trace-top {
  position: absolute;
  top: max(56px, env(safe-area-inset-top, 40px) + 28px);
  left: 0; right: 0;
  text-align: center;
  font-size: 11px; letter-spacing: 0.32em;
  color: rgba(232, 227, 213, 0.45);
  text-transform: uppercase; font-style: italic;
  pointer-events: none;
}

.viewfinder {
  width: min(86vw, 380px); aspect-ratio: 1 / 1;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0e2228 0%, #06141a 100%);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.viewfinder-hint {
  font-size: 11px; letter-spacing: 0.3em;
  text-transform: uppercase; font-style: italic;
  color: rgba(232, 227, 213, 0.55);
  z-index: 1;
  pointer-events: none;
}
.viewfinder-preview {
  display: none;
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.viewfinder.is-loaded .viewfinder-preview { display: block; }
.viewfinder.is-loaded .viewfinder-hint { display: none; }
.viewfinder::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 32% 38%, rgba(255, 138, 62, 0.10) 0%, transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(60, 180, 200, 0.09) 0%, transparent 60%);
}
.viewfinder::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px, transparent 3px);
}
.corner {
  position: absolute; width: 22px; height: 22px;
  border: 1.5px solid rgba(245, 230, 200, 0.7);
}
.corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* Trace screen offering form — the textarea sits below the viewfinder,
   above the shutter at the bottom. */
.trace-text {
  width: min(86vw, 380px);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 12px 16px;
  color: #e8e3d5;
  font-family: 'Libre Baskerville', serif;
  font-size: 15px; font-style: italic;
  line-height: 1.55;
  outline: none;
  resize: none;
}
.trace-text::placeholder { color: rgba(232, 227, 213, 0.32); }
.trace-text:focus { border-color: rgba(245, 230, 200, 0.30); }

.shutter {
  position: absolute;
  bottom: max(40px, env(safe-area-inset-bottom, 20px) + 24px);
  left: 50%; transform: translateX(-50%);
  min-width: 120px; height: 48px;
  border-radius: 24px;
  background: rgba(245, 230, 200, 0.08);
  border: 1px solid rgba(245, 230, 200, 0.42);
  cursor: pointer; padding: 0 24px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(245, 230, 200, 0.92);
  font-family: 'Libre Baskerville', serif;
  font-style: italic; font-size: 14px;
  letter-spacing: 0.2em; text-transform: uppercase;
  transition: background 200ms, opacity 200ms;
}
.shutter:hover { background: rgba(245, 230, 200, 0.16); }
.shutter:disabled { opacity: 0.5; cursor: not-allowed; }
.shutter.is-thinking .shutter-label { animation: breathe-text 1.8s ease-in-out infinite; }

.trace-error {
  position: absolute;
  bottom: max(96px, env(safe-area-inset-bottom, 20px) + 80px);
  left: 50%; transform: translateX(-50%);
  max-width: min(86vw, 380px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 95, 109, 0.10);
  border: 1px solid rgba(255, 95, 109, 0.45);
  color: rgba(255, 200, 200, 0.95);
  font-family: 'Libre Baskerville', serif;
  font-size: 12px; line-height: 1.5;
  text-align: center;
  display: none;
}
.trace-error.is-shown { display: block; }

/* ============ Atom + Offering markers ============ */
.atom-marker {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255, 200, 130, 0.85);
  border: 1px solid rgba(255, 230, 180, 0.9);
  box-shadow:
    0 0 8px rgba(255, 180, 90, 0.7),
    0 0 22px rgba(255, 140, 60, 0.45);
  cursor: pointer;
  padding: 0;
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: atom-breathe 4.2s ease-in-out infinite;
}
.atom-marker:hover {
  transform: scale(1.25);
  box-shadow:
    0 0 14px rgba(255, 200, 130, 0.85),
    0 0 36px rgba(255, 140, 60, 0.6);
}
@keyframes atom-breathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1.0; }
}

.offering-marker {
  width: 9px; height: 9px;
  background: rgba(245, 200, 175, 0.7);
  border: 1px solid rgba(255, 220, 200, 0.65);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(220, 130, 120, 0.5);
  cursor: pointer;
  padding: 0;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.offering-marker:hover {
  transform: rotate(45deg) scale(1.4);
  box-shadow: 0 0 12px rgba(245, 200, 175, 0.85);
}

/* ============ Atom card (tap to read) ============ */
.echo-card {
  position: absolute;
  left: 50%; bottom: max(28px, env(safe-area-inset-bottom, 24px) + 8px);
  transform: translate(-50%, calc(100% + 40px));
  width: min(92vw, 520px);
  background: rgba(8, 12, 14, 0.92);
  border: 1px solid rgba(245, 230, 200, 0.18);
  border-radius: 14px;
  padding: 22px 24px 18px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 350ms ease, transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.echo-card.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translate(-50%, 0);
}
.echo-card-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: none;
  color: rgba(216, 212, 200, 0.5);
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 8px;
}
.echo-card-close:hover { color: rgba(245, 230, 200, 0.9); }
.echo-card-image {
  display: none;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 14px;
  background: rgba(20, 20, 24, 0.4);
}
.echo-card-image.is-shown { display: block; }

.echo-card-content {
  font-family: 'Libre Baskerville', serif;
}
.card-block { margin-bottom: 16px; }
.card-block:last-child { margin-bottom: 0; }
.card-block-label {
  font-size: 10px; letter-spacing: 0.32em;
  text-transform: uppercase; font-style: italic;
  color: rgba(245, 230, 200, 0.55);
  margin-bottom: 8px;
}
.card-block-text {
  font-size: 17px; line-height: 1.6;
  color: #e8e3d5; font-style: italic;
}
.card-block-text.upright { font-style: normal; color: rgba(232, 227, 213, 0.8); }
.card-block-text.foot {
  font-size: 11px; letter-spacing: 0.18em;
  color: rgba(216, 212, 200, 0.4);
}

/* Tiny hidden role toggle — double-click to switch visitor↔contributor.
   16x16 in upper-left, barely visible until hovered or active. */
.role-toggle {
  position: fixed;
  top: 8px; right: 8px;
  width: 16px; height: 16px;
  background: rgba(120, 120, 130, 0.05);
  border: 1px solid rgba(160, 160, 170, 0.10);
  border-radius: 50%;
  z-index: 100;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: background 200ms, border-color 200ms;
}
.role-toggle:hover {
  background: rgba(180, 180, 190, 0.20);
  border-color: rgba(220, 220, 220, 0.30);
}
.role-toggle.is-contributor {
  background: rgba(220, 130, 120, 0.42);
  border-color: rgba(245, 200, 175, 0.65);
  box-shadow: 0 0 8px rgba(220, 130, 120, 0.4);
}

/* Model-provider toggle — sits next to the role-toggle in the upper-left.
   Default state (gold ring) = Opus, real corpus commits.
   Active state (gray) = free model, dryRun (no commits, no pollution). */
.provider-toggle {
  position: fixed;
  top: 8px; right: 30px;
  width: 16px; height: 16px;
  background: rgba(245, 200, 130, 0.18);
  border: 1px solid rgba(245, 200, 130, 0.55);
  border-radius: 50%;
  z-index: 100;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 6px rgba(245, 200, 130, 0.30);
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}
.provider-toggle:hover {
  background: rgba(245, 200, 130, 0.32);
}
.provider-toggle.is-free {
  background: rgba(140, 140, 150, 0.20);
  border-color: rgba(180, 180, 185, 0.45);
  box-shadow: none;
}

/* "Fellback" state — the user picked free, but the server quietly used opus
   (Gemini at quota). Gray dot keeps its identity (the user's choice is still
   free) but gains a soft gold halo so the substitution is visible. Pulses
   gently so the eye lands on it. */
.provider-toggle.is-fellback {
  border-color: rgba(245, 200, 130, 0.65);
  box-shadow: 0 0 10px 2px rgba(245, 200, 130, 0.45);
  animation: fellback-halo 3.2s ease-in-out infinite;
}
@keyframes fellback-halo {
  0%, 100% { box-shadow: 0 0 8px 1px rgba(245, 200, 130, 0.32); }
  50%      { box-shadow: 0 0 14px 3px rgba(245, 200, 130, 0.55); }
}

/* Sandbox/draft state is indicated by the gray provider-toggle dot in the
   upper-right; no separate banner needed. */

/* ============ Unlock gate ============
   Shown on first visit, dismissed forever (per device) once the right word
   is entered. Sits above everything else; map + screens don't render
   meaningfully until it's gone. */
.unlock {
  position: fixed; inset: 0;
  z-index: 9999;
  background: #02080a;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease;
}
.unlock.is-shown {
  opacity: 1;
  pointer-events: auto;
}
.unlock-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 24px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
}
.unlock-hint {
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: rgba(245, 230, 200, 0.55);
  text-align: center;
}
.unlock-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(245, 230, 200, 0.32);
  padding: 12px 4px;
  color: #f5e6c8;
  font-family: 'Libre Baskerville', serif;
  font-size: 22px;
  font-style: italic;
  text-align: center;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 240ms ease;
}
.unlock-input:focus {
  border-color: rgba(245, 200, 130, 0.65);
}
.unlock-error {
  min-height: 1em;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(232, 180, 150, 0.65);
  text-transform: lowercase;
}
.unlock.is-wrong .unlock-input {
  animation: unlock-shake 320ms ease;
  border-color: rgba(232, 130, 110, 0.55);
}
@keyframes unlock-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Offering inline in the chat thread — image + the offerer's text. Lets the
   conversation feel like one continuous record (photo, what was offered,
   what stayed, her line). Image is square-ish max-height so it doesn't
   dominate when the chat scrolls back. */
.msg.offering-block {
  display: flex; flex-direction: column;
  margin-bottom: 26px;
  opacity: 0;
  animation: fade-in 1200ms ease forwards;
}
.msg-offering-img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.45);
  margin-bottom: 10px;
}
.msg-offering-text {
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(232, 227, 213, 0.7);
  text-align: right;
  letter-spacing: 0.02em;
}

/* "Find me" GPS affordance. Sits in the upper-right next to the role/provider
   dots. Visible only when location is idle or denied; hides once granted.
   Tap target is generous so iOS treats it as a clean gesture for
   getCurrentPosition(). */
.locate-me {
  position: fixed;
  top: 6px; right: 60px;
  max-width: calc(100vw - 80px);
  background: transparent;
  border: 1px solid rgba(245, 200, 130, 0.42);
  border-radius: 12px;
  padding: 4px 12px;
  color: rgba(245, 230, 200, 0.78);
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  cursor: pointer;
  z-index: 100;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 400ms ease;
}
.locate-me:active { background: rgba(245, 200, 130, 0.14); }
body.gps-granted .locate-me {
  opacity: 0;
  pointer-events: none;
}
body.gps-denied .locate-me {
  border-color: rgba(232, 130, 110, 0.55);
  color: rgba(232, 180, 150, 0.78);
}
