:root {
  --bg: #0f1115;
  --panel: #161922;
  --panel-2: #1c202b;
  --border: #262b38;
  --text: #e8eaf0;
  --muted: #8a90a2;
  --accent: #7c5cff;
  --accent-2: #4fd1c5;
  --user-bubble: #2a2f3d;
  --assistant-bubble: #1f2937;
  --error: #ff6b6b;
  --radius: 12px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr 340px;
  height: 100vh;
  height: 100dvh;   /* phones: the visible height, without the browser's address bar */
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;

  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--panel);
  background-clip: padding-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-orb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.5);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.muted { color: var(--muted); font-size: 13px; }

.panel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

input[type="text"], input[type="number"], input[type="password"], input:not([type]), select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

input:focus, select:focus { outline: 1px solid var(--accent); }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
  margin-top: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: span 2;
}
.checkbox-row input { width: auto; margin: 0; }

details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent-2);
  user-select: none;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b3df0);
  color: white;
  width: 100%;
  margin-top: 12px;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent-2); }

.session-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent-2);
  word-break: break-all;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-on { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.dot-off { background: #4b5160; }
.dot-speaking { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

#voiceStopBtn { width: 100%; margin-top: 4px; }
#audioInfo { font-size: 11px; margin-right: 6px; }

/* ---------- Chat ---------- */
.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
.chat-header-group { display: flex; align-items: center; gap: 8px; }

.map-wrap {
  position: relative;
  height: 50%;
  flex-shrink: 0;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
/* the map fills the wrap; the placeholder, route summary, toasts and buttons are its siblings over it */
.map { position: absolute; inset: 0; }

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 32px;
  font-size: 13px;
  line-height: 1.5;
}
.map-placeholder p { margin: 0; max-width: 560px; }

.route-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: none;
}
.route-toggle.visible { display: inline-block; }
.route-toggle:hover { border-color: var(--accent-2); }

.route-summary {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: none;
}
.route-summary.visible { display: inline-block; }

/* Travel-time chip drawn at the middle of each route leg (LegLabel overlay). */
.leg-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #7c5cff;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* ---------- Place detail InfoWindow (Google's own chrome, re-themed) ---------- */
.gm-style .gm-style-iw-c {
  background: var(--panel-2) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5) !important;
}
/* Google caps the content height to the map's free space. With "hidden" the
   carousel pushed the title/rating/description below that cap and they were
   simply cut off — scroll instead, so the card's info is always reachable. */
.gm-style .gm-style-iw-d {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0 !important;
  scrollbar-width: thin;
}
.gm-style .gm-style-iw-tc::after { background: var(--panel-2) !important; }
.gm-style .gm-ui-hover-effect { filter: invert(1); opacity: 0.7; top: 6px !important; right: 6px !important; }
.gm-style .gm-ui-hover-effect:hover { opacity: 1; }

.place-card {
  width: 272px;
  font-family: inherit;
  color: var(--text);
}

/* --- media: main photo + carousel controls --- */
.pc-media {
  position: relative;
  height: 152px;
  background: var(--panel);
  overflow: hidden;
}
.pc-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pc-media::after { /* soft fade into the card body */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.pc-media-empty {
  display: grid;
  place-items: center;
  height: 72px;
  font-size: 28px;
  background: linear-gradient(135deg, var(--panel), var(--border));
}
.pc-media-empty::after { display: none; }

.pc-counter {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.pc-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 26px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.pc-prev { left: 8px; }
.pc-next { right: 8px; }
.pc-media:hover .pc-nav { opacity: 1; }
.pc-nav:hover { background: rgba(0, 0, 0, 0.75); }

.pc-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pc-thumbs::-webkit-scrollbar { display: none; }
.pc-thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  opacity: 0.55;
  cursor: pointer;
  scroll-snap-align: start;
  transition: opacity 0.15s, border-color 0.15s, transform 0.15s;
}
.pc-thumb:hover { opacity: 0.9; transform: translateY(-1px); }
.pc-thumb.active { opacity: 1; border-color: var(--accent-2); }

/* --- body --- */
.pc-body { padding: 12px 14px 14px; }

.pc-kind {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: rgba(79, 209, 197, 0.12);
}
.pc-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.pc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 12px;
}
.pc-rating { display: inline-flex; align-items: center; gap: 4px; }
.pc-rating b { font-weight: 700; }
.pc-stars { color: #f5b301; letter-spacing: 1px; font-size: 11px; }
.pc-stars-off { color: var(--border); }
.pc-muted { color: var(--muted); }
.pc-status { font-weight: 600; }
.pc-status.is-open { color: #3ecf8e; }
.pc-status.is-closed { color: var(--error); }

.pc-desc {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.pc-actions:empty { display: none; }
.pc-btn {
  flex: 1 1 auto;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  background: var(--panel);
  transition: border-color 0.15s, background 0.15s;
}
.pc-btn:hover { border-color: var(--accent); background: rgba(124, 92, 255, 0.12); }

/* --- loading / error --- */
.pc-skeleton,
.pc-skel-line {
  background: linear-gradient(90deg, var(--panel) 25%, var(--border) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: pc-shimmer 1.2s ease-in-out infinite;
}
.pc-skeleton::after { display: none; }
.pc-skel-line { height: 10px; margin-top: 8px; border-radius: 6px; }
.pc-skel-title { height: 14px; }
@keyframes pc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.pc-error {
  width: auto;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--error);
}

.messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.jump-to-bottom {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.jump-to-bottom.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.jump-to-bottom:hover { border-color: var(--accent-2); }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  padding-right: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;

  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.messages::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--panel);
  background-clip: padding-box;
}
.messages::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

.empty-state {
  margin: auto;
  color: var(--muted);
  font-size: 14px;
}

.msg {
  max-width: 72%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: rise 0.15s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-assistant { align-self: flex-start; align-items: flex-start; }

.msg-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg-text {
  padding: 12px 16px;
  border-radius: 16px;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 14.5px;
}

.msg-user .msg-text { background: var(--user-bubble); border-bottom-right-radius: 4px; }
.msg-assistant .msg-text { background: var(--assistant-bubble); border-bottom-left-radius: 4px; }
.msg-error .msg-text { background: rgba(255, 107, 107, 0.12); color: var(--error); border: 1px solid rgba(255,107,107,0.3); }

.msg-text.streaming::after {
  content: "▍";
  animation: blink 1s step-start infinite;
  color: var(--accent-2);
}
@keyframes blink { 50% { opacity: 0; } }

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.option-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.option-chip:hover { border-color: var(--accent-2); }

.composer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.composer input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
}

.composer .btn { margin-top: 0; width: auto; padding: 0 20px; }

/* ---------- Voice input (mic) ---------- */
.mic-btn {
  flex: 0 0 auto;
  width: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, opacity .15s;
}
.mic-btn:disabled { opacity: .4; cursor: not-allowed; }
.mic-btn:not(:disabled):hover { color: var(--text); border-color: var(--accent-2); }
.mic-btn[data-state="loading"] { color: var(--accent-2); animation: mic-pulse 1s ease-in-out infinite; }
.mic-btn[data-state="listening"] { color: var(--accent-2); border-color: var(--accent-2); }
.mic-btn[data-state="hearing"] {
  color: #fff;
  background: var(--error);
  border-color: var(--error);
  animation: mic-ring 1.2s ease-out infinite;
}
.mic-btn[data-state="waiting"] { color: var(--accent-2); border-color: var(--border); opacity: .6; }

@keyframes mic-pulse { 50% { opacity: .4; } }
@keyframes mic-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .55); }
  100% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
}

/* Reply the user didn't ask for (auto search) */
.msg-badge {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  text-transform: none;
  letter-spacing: 0;
}
.auto-search-row { margin-top: 10px; font-size: 12px; }

/* Voice message waiting for its transcript */
.msg-user.pending .msg-text { opacity: .6; font-style: italic; }

/* ---------- Debug ---------- */
.debug {
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  min-height: 0;

  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.debug::-webkit-scrollbar { width: 10px; }
.debug::-webkit-scrollbar-track { background: transparent; }
.debug::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--panel);
  background-clip: padding-box;
}

.debug h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.debug pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--accent-2);
}

/* ---------- JSON viewer ---------- */
.json-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.json-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.json-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.json-chip:hover { color: var(--text); border-color: var(--accent-2); }
.json-chip[aria-pressed="true"] {
  color: var(--bg);
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.json-filter {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}
.json-filter:focus { outline: 1px solid var(--accent); }
.json-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.json-actions .btn { padding: 4px 10px; font-size: 12px; }

.json-tree {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: auto;
}
.json-empty { color: var(--muted); }
.jrow { white-space: pre-wrap; word-break: break-word; }
.jchildren { padding-left: 16px; border-left: 1px dashed var(--border); margin-left: 6px; }
.jclose { padding-left: 16px; color: var(--muted); }
.jtoggle {
  display: inline-block;
  width: 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.jtoggle:hover { color: var(--accent-2); }
.jtoggle-leaf { cursor: default; }
.jk { color: #c4b5fd; margin-right: 6px; }
.jk-index { color: var(--muted); }
.jhead { color: var(--muted); cursor: pointer; }
.jhead-collapsed { font-style: italic; }
.jhead-collapsed:hover { color: var(--text); }
.jv-str { color: var(--accent-2); }
.jv-num { color: #fbbf24; }
.jv-bool { color: #f472b6; }
.jv-null { color: var(--muted); font-style: italic; }

/* ---------- Token usage ---------- */
.usage {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  max-width: 100%;
}
.usage summary {
  cursor: pointer;
  user-select: none;
  font-family: "JetBrains Mono", monospace;
  list-style: none;
}
.usage summary::before { content: "▸ "; }
.usage[open] summary::before { content: "▾ "; }
.usage-body {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.usage-table-title {
  margin: 8px 0 4px;
  color: var(--accent-2);
  font-weight: 600;
}
.usage-table-title:first-child { margin-top: 0; }
.usage-table {
  border-collapse: collapse;
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.usage-table th, .usage-table td {
  padding: 2px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.usage-table th { color: var(--muted); font-weight: 500; }
.usage-table td { color: var(--text); }
.usage-table .num { text-align: right; }
.usage-hint { font-size: 11px; margin-top: 6px; }
.usage-rate {
  margin-bottom: 6px;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
}

/* ---------- Auth (auth.js): login / registration / email code ---------- */
input[type="email"] {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(600px circle at 30% 20%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(500px circle at 75% 80%, rgba(79, 209, 197, 0.12), transparent 60%),
    rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
.auth-overlay[hidden] { display: none; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-brand { margin-bottom: 22px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.auth-tabs[hidden] { display: none; }
.auth-tabs button {
  border: none;
  border-radius: 7px;
  padding: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.auth-tabs button.active { background: var(--panel-2); color: var(--text); }

.auth-form[hidden] { display: none; }
.auth-form label { margin-bottom: 12px; }
.auth-hint { display: block; margin-top: 4px; font-size: 11px; }

.auth-error {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.08);
  color: var(--error);
  font-size: 12px;
  white-space: pre-line;
}
.auth-error[hidden] { display: none; }

.code-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.code-note { margin-top: 8px; font-size: 12px; color: var(--accent-2); }
.code-note[hidden] { display: none; }

.code-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 18px 0 6px;
}
.code-boxes input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  aspect-ratio: 5 / 6;
  text-align: center;
  font: 600 22px "JetBrains Mono", monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  caret-color: var(--accent);
}
.code-boxes input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
.code-boxes input.filled { border-color: var(--accent-2); }

.code-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.code-actions .btn-ghost:disabled { opacity: 0.6; cursor: default; }
.code-actions .btn-ghost:disabled:hover { color: var(--muted); border-color: var(--border); }

.auth-server { margin-top: 18px; }
.auth-server label { margin-top: 8px; }

.account-info { margin-bottom: 10px; }
.account-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }

/* ---------- Profile & forgot password (auth.js) ---------- */
.link-btn {
  display: block;
  margin: 12px auto 0;
  padding: 2px 4px;
  border: none;
  background: none;
  color: var(--accent-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.auth-lead { margin-bottom: 14px; }

.account-actions { display: flex; gap: 8px; }
.account-actions .btn { flex: 1; }

.profile-card { max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; }

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.35);
}
.profile-head-text { flex: 1; min-width: 0; }
.profile-title { margin: 0 0 2px; font-size: 18px; font-weight: 700; }

.close-btn {
  align-self: flex-start;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.close-btn:hover { color: var(--text); border-color: var(--accent-2); }

.profile-section {
  padding: 16px;
  margin-bottom: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.section-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.readonly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  word-break: break-all;
}
.badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 600;
}
.badge[hidden] { display: none; }

/* ---------- Route edits from the map ---------- */
button.pc-btn { cursor: pointer; font-family: inherit; }
.pc-route { background: rgba(124, 92, 255, 0.18); color: #c9bcff; }
.pc-route:hover { background: rgba(124, 92, 255, 0.3); }
.route-info { margin-bottom: 10px; }
#routeDeleteBtn:disabled, #routeMode:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Route progress (walking the route) ---------- */
.route-summary {
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 220px;
  max-width: 300px;
  font-weight: 500;
}
.route-summary.visible { display: block; }
.route-summary .rs-next { font-size: 12px; color: var(--muted); }
.route-summary .rs-next b { color: var(--text); font-size: 14px; font-weight: 700; }
.route-summary .rs-meta { margin-top: 2px; font-size: 18px; font-weight: 700; color: #f59e0b; }
.route-summary .rs-bar {
  height: 6px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.route-summary .rs-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}
.route-summary .rs-total { font-size: 12px; color: var(--muted); }
.route-summary .rs-arrived { font-size: 14px; font-weight: 700; color: #22c55e; }
.route-summary .rs-arrived b { color: var(--text); }

.route-toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.route-toast-item {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(22, 25, 34, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: opacity 0.5s, transform 0.5s;
}
.route-toast-item.hide { opacity: 0; transform: translateY(6px); }

.route-actions { display: flex; gap: 8px; }
.route-actions .btn { flex: 1; }
.route-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.route-hint { margin-top: 8px; font-size: 11.5px; line-height: 1.4; }

/* ---------- Photo message ---------- */
.photo-btn { margin-right: 0; }
.msg-photo-img {
  display: block;
  max-width: 240px;
  max-height: 240px;
  margin: 4px 0 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

/* ---------- Place card: like, tabs, my rating, tell about ---------- */
.pc-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pc-like {
  flex-shrink: 0;
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.15s;
}
.pc-like:hover { transform: scale(1.15); }
.pc-tabs { display: flex; gap: 4px; margin: 8px 0 6px; border-bottom: 1px solid var(--border); }
.pc-tab {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.pc-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.pc-pane[hidden] { display: none; }
.pc-address { margin: 4px 0 0; font-size: 12px; }
.pc-my-stars { display: flex; gap: 4px; margin: 8px 0 4px; }
.pc-star, .reply-star {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #3a4152;
  cursor: pointer;
  padding: 0 1px;
  transition: color 0.12s, transform 0.12s;
}
.pc-star.on, .reply-star.on { color: #f5b301; }
.pc-my-stars:hover .pc-star { color: #f5b301; }
.pc-my-stars .pc-star:hover ~ .pc-star { color: #3a4152; }
.pc-star:hover, .reply-star:hover { transform: scale(1.12); }
.pc-my-hint { font-size: 11.5px; }
.pc-link { border: none; background: none; color: var(--accent-2); font-family: inherit; font-size: 12px; cursor: pointer; padding: 4px 0 0; }
.pc-tell {
  display: block;
  width: 100%;
  margin: 10px 0 2px;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(79, 209, 197, 0.18));
}

/* ---------- Rating a guide reply ---------- */
.reply-rating { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.reply-rating-label { font-size: 11.5px; color: var(--muted); margin-right: 6px; }
.reply-rating .reply-star { font-size: 18px; }
.reply-rating:hover .reply-star { color: #f5b301; }
.reply-rating .reply-star:hover ~ .reply-star { color: #3a4152; }

/* ---------- Right aside: JSON / favorites / session places ---------- */
.aside-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.aside-tab {
  border: none;
  border-radius: 7px;
  padding: 7px 4px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.aside-tab.active { background: var(--panel-2); color: var(--text); }
.aside-view[hidden] { display: none; }
.places-view { display: flex; flex-direction: column; gap: 10px; }
.places-search { width: 100%; }
.places-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.places-filters select { margin-top: 0; }
.places-list { display: flex; flex-direction: column; gap: 6px; }
.place-row {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 11px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.place-row:hover { border-color: var(--accent); }
.place-row-top { display: flex; justify-content: space-between; gap: 6px; }
.place-row-name { font-weight: 600; font-size: 13px; }
.place-row-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.place-row-mine { color: #f5b301; }
.places-empty { padding: 12px 2px; }
.places-pager { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.places-pager .btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- App feedback (profile) ---------- */
.app-stars .pc-star { font-size: 28px; }
.feedback-text {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.feedback-text:focus { outline: 1px solid var(--accent); }

/* ---------- Credits ("Штампи") ---------- */
.credits-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.credits-line:hover { border-color: var(--accent); }
.credits-line.low { border-color: rgba(250, 178, 25, 0.6); }
.credits-icon { font-size: 15px; }
.credits-add { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--accent-2); }
.charge-chip {
  display: inline-block;
  cursor: pointer;
  max-width: 100%;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.14);
  color: #c9bcff;
  font-size: 11.5px;
  font-weight: 600;
  cursor: help;
}
.msg-credits .msg-text { border: 1px solid rgba(250, 178, 25, 0.4); }
.credits-topup { width: auto; margin-top: 8px; }
.credits-card { max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; }
.credits-avatar { font-size: 22px; }
.credits-big { font-size: 30px; font-weight: 800; margin: 2px 0 16px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.pack {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 6px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.pack:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.pack:disabled { opacity: 0.55; cursor: default; }
.pack-amount { font-size: 20px; font-weight: 800; }
.pack-word { font-size: 11.5px; color: var(--muted); }
.pack-bonus { font-size: 11px; color: var(--accent-2); margin: 4px 0; }
.pack-price { font-size: 13px; font-weight: 700; }
.credits-details { margin-top: 14px; font-size: 13px; }
.credits-details summary { cursor: pointer; color: var(--accent-2); font-weight: 600; }
.credits-prices, .credits-history { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.price-row, .tx { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.price-row b { white-space: nowrap; }
.price-desc { display: block; font-size: 11.5px; }
.tx-amount { font-weight: 800; white-space: nowrap; }
.tx-amount.plus { color: #22c55e; }
.tx-amount.minus { color: var(--muted); }

.credits-how { margin: 8px 0 4px; font-size: 12px; line-height: 1.45; }

/* Beta gift + monthly plans in the credits window */
.beta-banner { background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin: -6px 0 14px; }
.plans-block { border-radius: 14px; margin-bottom: 14px; }
.plans-block.highlight { padding: 10px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.plans-lead { font-size: 12.5px; margin: -2px 0 8px; line-height: 1.45; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-2, transparent); color: inherit; cursor: pointer; font: inherit; }
.plan:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.plan:disabled { opacity: 0.6; cursor: default; }
.plan.current { border-color: var(--accent); }
.plan-name { font-size: 12px; font-weight: 700; color: var(--accent); }
.plan-amount { font-size: 20px; font-weight: 800; }
.plan-cta { margin-top: 6px; font-size: 12px; font-weight: 700; }
.current-plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; font-size: 13px; }
@media (max-width: 480px) { .plans { grid-template-columns: 1fr; } }

/* Place card: photos load lazily (one paid lookup per photo actually shown) */
.pc-media.pc-loading { background: linear-gradient(90deg, var(--panel-2) 25%, var(--border) 50%, var(--panel-2) 75%);
  background-size: 200% 100%; animation: pc-shimmer 1.2s linear infinite; }
@keyframes pc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pc-dots { display: flex; justify-content: center; gap: 6px; padding: 6px 0 0; }
.pc-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: none; background: var(--border); cursor: pointer; }
.pc-dot.active { background: var(--accent); }

/* ---------- Phone & tablet ----------
   ≤ 1000 px: the JSON / places panel becomes a drawer from the right ({ } in the chat header).
   ≤ 760 px: one column — the settings sidebar is a drawer from the left (☰), the map shrinks, the
   chat and composer get compact spacing and phone-sized touch targets. responsive.js opens/closes. */
.map-toggle, .drawer-close, .send-icon, .clear-icon, .header-credits, .phone-only { display: none; }
@media (max-width: 760px) {
  .phone-only { display: inline; }
  .desktop-only { display: none; }
}

/* Tablet: the 260 px sidebar — account buttons wrap instead of running out of the panel */
.account-actions { flex-wrap: wrap; }
.account-actions .btn { flex: 1 1 auto; white-space: nowrap; }
.credits-line > span { white-space: nowrap; }

/* The empty chat: one big "start" button */
.start-state { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  max-width: 320px; }
.start-state p { margin: 0; }
.start-state p:first-child { font-size: 17px; font-weight: 600; color: var(--text); }
.start-btn { min-height: 48px; padding: 0 26px; font-size: 15px; border-radius: 999px; }
.start-state .muted { font-size: 12.5px; line-height: 1.45; }

/* ⏹ over the chat while the guide is talking */
.voice-stop-fab { position: absolute; right: 14px; bottom: 14px; z-index: 5; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.voice-stop-fab[hidden] { display: none; }

/* Foldable sidebar panels (the title is the toggle) */
.panel.foldable h2 { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.panel.foldable h2::after { content: "▾"; font-size: 12px; transition: transform 0.15s ease; }
.panel.foldable.collapsed h2 { margin-bottom: 0; }
.panel.foldable.collapsed h2::after { transform: rotate(-90deg); }
.panel.foldable.collapsed > :not(h2) { display: none; }
.drawer-toggle { display: none; min-width: 40px; height: 36px; padding: 0 10px; font-size: 16px; line-height: 1; }
.drawer-backdrop { display: none; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 260px 1fr; }
  .debug {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 92vw);
    z-index: 900;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  body.drawer-right .debug { transform: none; }
  #debugToggle { display: inline-flex; align-items: center; justify-content: center; }
  .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 850;
    background: rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  }
  body.drawer-left .sidebar { transform: none; }
  #sidebarToggle { display: inline-flex; align-items: center; justify-content: center; }

  .chat-header { padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  .map-wrap { height: 32%; min-height: 180px; }
  /* 🗺 in the header folds the map away — the chat gets the whole screen (responsive.js remembers it) */
  .map-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 36px;
    padding: 0 10px; font-size: 16px; }
  body.map-collapsed .map-wrap { display: none; }
  body.map-collapsed .map-toggle { background: rgba(124, 92, 255, 0.18); }
  /* ✕ at the top of an open drawer (a tap outside closes it too); opaque, so the content scrolling
     under it never shows through */
  .drawer-close { display: flex; align-items: center; justify-content: center; position: sticky; top: 0;
    margin: 0 0 8px auto; width: 44px; height: 44px; z-index: 3; flex: 0 0 auto; font-size: 18px;
    background: var(--panel); box-shadow: 0 0 0 6px var(--panel); }
  /* the header: the balance instead of the "Чат" label, an icon instead of "Очистити" */
  .header-title { display: none; }
  .header-credits:not([hidden]) { display: inline-flex; align-items: center; height: 36px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
  .clear-icon { display: inline; font-size: 16px; }
  .clear-label { display: none; }
  .voice-stop-fab { left: 50%; right: auto; transform: translateX(-50%); }
  #clearBtn { height: 36px; padding: 0 10px; }
  /* Send is an icon — the text field gets the room */
  .composer #sendBtn { display: inline-flex; align-items: center; justify-content: center; width: 46px; padding: 0;
    flex: 0 0 auto; }
  .send-icon { display: block; }
  .send-label { display: none; }
  .route-summary { min-width: 0; max-width: calc(100% - 24px); }
  .route-toggle { top: 8px; right: 8px; }

  .messages { padding: 12px; padding-right: 10px; }
  .msg { max-width: 88%; }
  .msg-photo-img { max-width: 100%; }

  .composer { gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer input { min-width: 0; }
  .composer .btn { padding: 0 12px; }
  .mic-btn { width: 42px; }

  /* 16 px stops iOS Safari from zooming the page in when a field gets focus */
  input, select, textarea { font-size: 16px; }

  .auth-overlay { padding: 10px; }
  .auth-card { padding: 22px 16px 16px; }
  .profile-card, .credits-card { max-height: calc(100dvh - 20px); }
}

/* ---------- the admin layer over the console (responsive.js) ---------- */
.admin-layer { position: fixed; inset: 0; z-index: 3000; background: var(--bg); transform: translateY(100%);
  opacity: 0; visibility: hidden; transition: transform 0.28s ease, opacity 0.28s ease, visibility 0s linear 0.28s; }
.admin-layer.open { transform: none; opacity: 1; visibility: visible;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0s; }
.admin-layer iframe { display: block; width: 100%; height: 100%; border: 0; }
body.admin-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .admin-layer, .admin-layer.open { transition: none; } }

/* ---------- My sessions ---------- */
.my-sessions-btn { width: 100%; margin: 4px 0 10px; }
.start-history-btn { min-height: 44px; border-radius: 999px; padding: 0 20px; }
.sessions-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.session-item { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); color: var(--text);
  font: inherit; cursor: pointer; }
.session-item:hover, .session-item:focus-visible { border-color: var(--accent); outline: none; }
.session-item.current { border-color: var(--accent-2); }
.session-item-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.session-item-top .muted { font-size: 12px; white-space: nowrap; }
.session-item-preview { font-size: 13.5px; line-height: 1.4; color: var(--muted); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sessions-more { width: 100%; margin-top: 10px; }
.history-note { text-align: center; font-size: 12px; margin: 4px 0 8px; }

/* ---------- Place card: views; on a phone the card opens as a sheet from the bottom ---------- */
.pc-views { margin: 4px 0 0; font-size: 12px; }
.place-sheet { position: fixed; inset: 0; z-index: 2500; display: flex; align-items: flex-end;
  background: rgba(0, 0, 0, 0); transition: background 0.22s ease; }
.place-sheet[hidden] { display: none; }
.place-sheet.open { background: rgba(0, 0, 0, 0.55); }
.place-sheet-panel { position: relative; width: 100%; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(100%); transition: transform 0.22s ease;
  padding-bottom: env(safe-area-inset-bottom); }
.place-sheet.open .place-sheet-panel { transform: none; }
.place-sheet-handle { width: 40px; height: 4px; margin: 8px auto 4px; border-radius: 999px; background: var(--border); }
.place-sheet-close { position: absolute; top: 8px; right: 10px; z-index: 2; width: 40px; height: 40px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer; }
.place-sheet-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; }
.place-sheet-body .place-card { width: 100%; }
.place-sheet-body .pc-media { border-radius: 12px; overflow: hidden; }
.place-sheet-body .pc-btn { min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .place-sheet, .place-sheet-panel { transition: none; } }

/* ---------- 📍 Real movement (GPS) ---------- */
.track-status { font-size: 12px; margin: -4px 0 6px 26px; }
.map-track-btn { position: absolute; top: 54px; right: 12px; z-index: 5; width: 40px; height: 40px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); font-size: 18px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.map-track-btn.on { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.35); }
.msg-geo .msg-text { background: rgba(250, 178, 25, 0.10); color: var(--text); border-color: rgba(250, 178, 25, 0.4); }
