/* In My Area — the realtime voice guide dock.
   The ON/OFF indicator is the point: OFF is dead grey, ON is an unmistakable
   pulsing green halo, so there is never any doubt whether the mic is live. */

#guide-dock {
  position: fixed;
  left: 50%;
  translate: -50% 0;
  bottom: 18px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Patrick Hand', cursive;
  pointer-events: none;
}

#guide-dock > * { pointer-events: auto; }

/* ── the power button ─────────────────────────────────────────────────── */
#guide-power {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #111;
  border: 3px solid #555;
  color: #eee;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: border-color .25s, box-shadow .25s, background .25s;
}

#guide-power .guide-face {
  font-size: 26px;
  line-height: 1;
}

#guide-power .guide-face img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

#guide-power .guide-label {
  font-size: 10px;
  letter-spacing: .5px;
  color: #aaa;
}

/* ── state: OFF — dead grey, no glow ──────────────────────────────────── */
#guide-dock[data-state="off"] #guide-power {
  border-color: #555;
  box-shadow: none;
  opacity: .85;
}

/* ── state: CONNECTING — amber, slow throb ────────────────────────────── */
#guide-dock[data-state="connecting"] #guide-power {
  border-color: #ffb020;
  animation: guide-throb 1.1s ease-in-out infinite;
}

/* ── state: LISTENING — unmistakable pulsing green ────────────────────── */
#guide-dock[data-state="listening"] #guide-power {
  border-color: #22dd55;
  animation: guide-pulse-green 1.4s ease-out infinite;
}

/* ── state: TALKING — brighter, faster pulse ──────────────────────────── */
#guide-dock[data-state="talking"] #guide-power {
  border-color: #7dff9e;
  background: #0d2a16;
  animation: guide-pulse-green 0.75s ease-out infinite;
}

/* ── state: THINKING — blue, working ──────────────────────────────────── */
#guide-dock[data-state="thinking"] #guide-power {
  border-color: #4c8dff;
  animation: guide-throb 0.9s ease-in-out infinite;
}

/* ── state: ERROR ─────────────────────────────────────────────────────── */
#guide-dock[data-state="error"] #guide-power {
  border-color: #ff4d4d;
}

@keyframes guide-pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34, 221, 85, .85), 0 0 14px 2px rgba(34, 221, 85, .55); }
  70%  { box-shadow: 0 0 0 18px rgba(34, 221, 85, 0), 0 0 22px 6px rgba(34, 221, 85, .35); }
  100% { box-shadow: 0 0 0 0 rgba(34, 221, 85, 0), 0 0 14px 2px rgba(34, 221, 85, .45); }
}

@keyframes guide-throb {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .0); }
  50%      { box-shadow: 0 0 0 10px rgba(255, 176, 32, .25); }
}

/* ── status + cost readout ────────────────────────────────────────────── */
#guide-dock .guide-status {
  font-size: 12px;
  color: #ddd;
  background: rgba(0, 0, 0, .72);
  padding: 2px 10px;
  border-radius: 10px;
}

#guide-dock .guide-transcript {
  max-width: min(88vw, 460px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

#guide-dock .guide-line {
  font-size: 13px;
  line-height: 1.3;
  color: #eee;
  background: rgba(0, 0, 0, .78);
  border-left: 3px solid #444;
  padding: 3px 8px;
  border-radius: 4px;
  max-width: 100%;
}

#guide-dock .guide-line-anna { border-left-color: #22dd55; }
#guide-dock .guide-line-user { border-left-color: #4c8dff; }
#guide-dock .guide-line-sys  { border-left-color: #888; color: #bbb; font-size: 12px; }
#guide-dock .guide-line-err  { border-left-color: #ff4d4d; color: #ffb3b3; }

/* ── the numbered result pins the guide drops on the map ──────────────── */
.guide-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #4c8dff;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.guide-pin span > * { transform: rotate(45deg); }

.guide-pin-top span {
  background: #22dd55;
  color: #04310f;
  width: 30px;
  height: 30px;
  font-size: 14px;
}

/* ── the connect/disconnect modal ───────────────────────────────────────
   Its own modal, opened by the icon in the top row (or by tapping the dock).
   Red = disconnected, LIME = connected and listening. Never ambiguous. */

#guide-icon {
  cursor: pointer;
}

/* on the map page there is no icon row, so the headset gets its own spot */
#guide-icon-wrap {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999999;
  font-size: 20px;
}

#guide-icon-wrap i { color: #fff; cursor: pointer; }

/* the icon itself reflects the state, so it is readable while the modal is shut */
#guide-icon.guide-icon-on {
  color: #b6ff3b !important;
  text-shadow: 0 0 8px rgba(182, 255, 59, .8);
}

#guide-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .62);
  font-family: 'Patrick Hand', cursive;
}

#guide-modal[hidden] { display: none; }

.guide-card {
  width: min(92vw, 340px);
  padding: 16px 18px 18px;
  background: #141414;
  border: 2px solid #2c2c2c;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  text-align: center;
}

.guide-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.guide-card-head h3 {
  margin: 0;
  font-family: 'Patrick Hand', cursive;
  font-size: 22px;
  color: #fff;
}

#guide-close {
  background: transparent;
  border: 0;
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

#guide-close:hover { color: #fff; }

/* ── modal header: YOUR profile image, at the top ──────────────────────
   The picture is yours, not the AI's. It sits up here labelled as you and is
   never used as the guide's face. */

.guide-me {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #262626;
  text-align: left;
}

.guide-me-face {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: #232323;
  border: 2px solid #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

.guide-me-face img { width: 100%; height: 100%; object-fit: cover; display: block; }

.guide-me-name { font-size: 15px; color: #ddd; }
.guide-me-name small { display: block; color: #777; font-size: 11px; }

/* ── the two buttons: connect and disconnect ─────────────────────────── */

.guide-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 10px;
}

.guide-actions button {
  flex: 1;
  padding: 14px 8px;
  border-radius: 12px;
  border: 3px solid #555;
  background: #1a1a1a;
  color: #ccc;
  font-family: 'Patrick Hand', cursive;
  font-size: 17px;
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}

.guide-actions button[disabled] { opacity: .38; cursor: default; }

/* Verbinden — lime, because that is the thing you would press now */
#guide-connect {
  border-color: #b6ff3b;
  background: #16240a;
  color: #e6ffc2;
}

/* Trennen — dead until something is actually connected */
#guide-disconnect {
  border-color: #555;
  background: #1a1a1a;
  color: #888;
}

/* connected: Trennen becomes the live, red, pulsing way out */
#guide-modal[data-state="listening"] #guide-disconnect,
#guide-modal[data-state="talking"] #guide-disconnect,
#guide-modal[data-state="thinking"] #guide-disconnect {
  border-color: #e74c3c;
  background: #2a0f0f;
  color: #ffb3b3;
  animation: guide-throb-red 1.4s ease-in-out infinite;
}

/* the card itself carries the state, so it is unmistakable at a glance */
#guide-modal[data-state="listening"] .guide-card,
#guide-modal[data-state="talking"] .guide-card {
  border-color: #b6ff3b;
  box-shadow: 0 0 0 3px rgba(182, 255, 59, .28), 0 18px 50px rgba(0, 0, 0, .6);
}

#guide-modal[data-state="connecting"] .guide-card {
  border-color: #ffb020;
  box-shadow: 0 0 0 3px rgba(255, 176, 32, .22), 0 18px 50px rgba(0, 0, 0, .6);
}

@keyframes guide-throb-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
  50%      { box-shadow: 0 0 0 10px rgba(231, 76, 60, .25); }
}

/* The dock is raised clear of the bottom bar: the current-location display
   lives down there and must never be covered. */
#guide-dock { bottom: 158px; }

#guide-modal .guide-status {
  font-size: 14px;
  color: #ddd;
  min-height: 20px;
  margin-bottom: 6px;
}

#guide-modal .guide-transcript {
  max-height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

#guide-modal .guide-line {
  font-size: 13px;
  line-height: 1.3;
  color: #eee;
  background: rgba(255, 255, 255, .05);
  border-left: 3px solid #444;
  padding: 3px 8px;
  border-radius: 4px;
}

#guide-modal .guide-line-anna { border-left-color: #b6ff3b; }
#guide-modal .guide-line-user { border-left-color: #4c8dff; }
#guide-modal .guide-line-sys  { border-left-color: #888; color: #bbb; font-size: 12px; }
#guide-modal .guide-line-err  { border-left-color: #ff4d4d; color: #ffb3b3; }

.guide-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #7a7a7a;
}

/* the dock's OFF state matches the modal's red, so both agree */
#guide-dock[data-state="off"] #guide-power {
  border-color: #e74c3c;
  background: #1a0d0d;
}

/* ── the conversation, behind an accordion ──
   It starts collapsed and stays small when open: on a map page the transcript
   is only ever in the way, so it is something you ask for, never something
   that is just there. */
.guide-log-toggle {
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  color: #9aa0a6;
  background: none;
  border: 0;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-log-toggle:hover { color: #e8e8e8; }

/* when it IS open it may not cover the map: bounded height, its own scroll */
#guide-dock .guide-transcript {
  max-height: 22vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#guide-modal .guide-transcript {
  max-height: 30vh;
  overflow-y: auto;
}


/* ── Navi: the banner that follows you and says each turn ──────────────────── */
.navi-bar { position: fixed; left: 12px; right: 12px; top: 12px; z-index: 9500;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(160deg, #1c1710, #120e08);
  border: 1px solid rgba(217, 180, 74, .5); box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
.navi-bar[hidden] { display: none; }
.navi-arrow { font-size: 22px; color: #d9b44a; line-height: 1; }
.navi-text { flex: 1; min-width: 0; }
.navi-next { font-size: 16px; font-weight: 900; color: #fff; }
.navi-next, .navi-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navi-sub { margin-top: 2px; font-size: 12.5px; color: #a2967f; }
.navi-modes { display: flex; gap: 4px; }
.navi-mode { appearance: none; border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05); border-radius: 10px; font-size: 15px;
  padding: 5px 7px; cursor: pointer; }
.navi-mode.on { background: #d9b44a; border-color: #d9b44a; }
.navi-go { display: none; appearance: none; border: none; border-radius: 11px;
  padding: 9px 13px; font-weight: 800; font-size: 13px; cursor: pointer;
  color: #14110c; background: linear-gradient(135deg, #d9b44a, #a8872f); }
.navi-bar.offer .navi-go { display: inline-flex; align-items: center; }
.navi-bar.offer .navi-modes { display: none; }
.navi-stop { appearance: none; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04); color: #f5f0e4; width: 30px; height: 30px;
  border-radius: 50%; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.navi-stop:hover { background: rgba(255, 255, 255, .12); }

/* ── the camera button (bottom left) ───────────────────────────────────────
   Straight to Anna: sending a picture is also what connects her. Sits above the
   safe area, left of nothing else that matters on a phone. */
#guide-compass {
  position: fixed;
  left: 14px;
  bottom: 88px;
  z-index: 1200;
}

/* On the map page his own icons already sit on the left, so these two move to the
   right there — they were covering his icons. anna.html (Anna's own page) has no such
   icons and keeps them bottom-left. */
body.map-page #guide-cam {
  left: auto;
  right: max(14px, env(safe-area-inset-right));
}

body.map-page #guide-compass {
  left: auto;
  right: max(14px, env(safe-area-inset-right));
}

body.map-page #guide-cam { align-items: flex-end; }

#guide-compass-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(217, 180, 74, 0.5);
  border-radius: 999px;
  background: rgba(20, 22, 26, 0.82);
  color: #e9e6df;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

#guide-compass-btn.on {
  border-color: #4da3ff;
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.35);
  color: #cfe6ff;
}

#guide-cam { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 8600; }
#guide-cam-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 15px 0 14px;
  border-radius: 24px;
  border: 1px solid rgba(217, 180, 74, .5);
  background: linear-gradient(160deg, rgba(28, 23, 16, .94), rgba(18, 14, 8, .94));
  color: #e8c96a; font: inherit; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .42);
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#guide-cam-btn i { font-size: 16px; }
#guide-cam-btn:hover { border-color: rgba(217, 180, 74, .85); }
#guide-cam-btn:active { transform: scale(.98); }
@media (max-width: 430px) { #guide-cam-btn span { display: none; } #guide-cam-btn { padding: 0; width: 52px; justify-content: center; } }


/* a pin wears the emoji of what it is, with the number kept as a badge */
.guide-pin .pin-emoji { font-size: 22px; line-height: 1; display: block; }
.guide-pin .pin-num {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #0b3d0b;
  color: #b6ffb6;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.guide-pin { width: 30px; height: 30px; text-align: center; }

/* ── writing instead of speaking ─────────────────────────────────────────
   Sits above the microphone, in the same dock, so nothing on the page has to
   move. Sending leaves nothing on screen: no echo, no transcript. */
#guide-chat {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(78vw, 320px);
  padding: 3px 4px 3px 10px;
  border-radius: 18px;
  background: rgba(12, 12, 12, .9);
  border: 1px solid #3a3a3a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.guide-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #eee;
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;   /* 16px keeps iOS from zooming the whole page on focus */
  padding: 5px 0;
}
.guide-chat-input:focus { outline: none; }
.guide-chat-input::placeholder { color: #8a8a8a; }
.guide-chat-send {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #40521a;
  background: #16240a;
  color: #b6ff3b;
  font-size: 14px;
  cursor: pointer;
}


/* The recording control in the dock: a quiet grey dot when it is off, a pulsing red one when it is on,
   so the state of the recording is never something you have to go and look up. */
.guide-rec {
  flex: 0 0 auto;
  width: 32px; height: 32px; margin-right: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: rgba(255,255,255,.45);
  font-size: 11px; cursor: pointer; padding: 0;
}
.guide-rec.on { color: #ff3b30; border-color: rgba(255,59,48,.6); background: rgba(255,59,48,.16); }
.guide-rec.on i { animation: recPulse 1.4s ease-in-out infinite; }
@keyframes recPulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
