/* ─────────────────────────────────────────────
   CONCIERGE — STYLES
   Aesthetic: refined light editorial, warm parchment
───────────────────────────────────────────── */

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

:root {
  --bg:        #EDE6D4;
  --surface:   #E4DAC4;
  --border:    #C8BCA8;
  --gold:      #7A5810;
  --gold-dim:  #A87E20;
  --text:      #1A1608;
  --text-dim:  #5A5040;
  --text-mute: #9A9080;
  --agent-bg:  #EBE4D2;
  --user-bg:   #D8D0BC;
  --red:       #9A3828;
  --green:     #386030;
  --radius:    4px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html, body { height: var(--app-height, 100dvh); overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--text); }

/* ── Ambient background ── */
.bg-layer {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 70% 20%, #E6D9BE 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, #EAE2CC 0%, transparent 70%),
    var(--bg);
}

.grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px;
}

#app { position: fixed; top: 0; left: 0; right: 0; z-index: 2; height: var(--app-height, 100dvh); display: flex; flex-direction: column; background: var(--bg); }

/* ── Header ── */
.header {
  background: rgba(237, 230, 212, 0.92);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  box-shadow: 0 4px 24px rgba(26,22,8,0.06);
}

.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 14px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem; font-weight: 400; letter-spacing: 0.2em;
  color: var(--text);
  position: absolute; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}

.notes-toggle {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  position: relative;
  grid-column: 3; justify-self: end;
  transition: transform 0.2s;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}
.notes-toggle:hover { transform: scale(1.08); }

.notes-heart-svg {
  width: 1.05rem; height: 1.05rem;
  flex-shrink: 0;
  z-index: 1;
  overflow: visible;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notes-toggle:hover .notes-heart-svg { transform: scale(1.2); }

.heart-outline {
  fill: none;
  stroke: rgba(180, 60, 40, 0.8);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.2s ease;
}
.heart-fill {
  fill: url(#heartGrad);
  stroke: none;
  transform-origin: center;
  transform-box: fill-box;
  transform: scale(0);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notes-toggle.notes-open .heart-fill    { transform: scale(1); }
.notes-toggle.notes-open .heart-outline { opacity: 0; }

.notes-label {
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.9rem; line-height: 1; letter-spacing: 0.04em;
  color: var(--text);
  position: relative; z-index: 1;
}

.notes-badge {
  position: absolute; top: 2px; right: 4px;
  background: var(--gold); color: var(--bg);
  font-size: 0.6rem; width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 600; z-index: 2;
}

/* ── Layout ── */
.layout {
  flex: 1; display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

/* ── Chat panel ── */
.chat-panel {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
  min-width: 0;
  transition: flex 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
}

.layout.map-active .chat-panel {
  flex: 0 0 420px;
  max-width: 420px;
  border-right: 1px solid var(--border);
}

.location-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(to bottom, var(--surface) 60%, transparent);
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim); letter-spacing: 0.05em;
  flex-shrink: 0;
}

.location-text {
  font-weight: 600;
  color: var(--text);
}

.location-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-mute);
  transition: background 0.4s;
  flex-shrink: 0;
}
.location-dot.active { background: var(--green); box-shadow: 0 0 6px var(--green); }
.location-dot.error  { background: var(--red); }

.messages {
  flex: 1; overflow-y: auto; padding: 20px 20px 10px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
  min-height: 0;
}

.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message {
  max-width: 75%; animation: fadeUp 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.message-content.msg-selectable {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  cursor: text;
}
.message.agent { align-self: flex-start; position: relative; margin-bottom: 10px; }
.message.user  { align-self: flex-end; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-content {
  padding: 10px 14px;
  font-family: var(--font-serif);
  font-size: 1rem; line-height: 1.55; font-weight: 300;
  border-radius: 18px;
}

.message-content strong { font-weight: 600; }
.message-content ul { margin: 6px 0; padding-left: 20px; }
.message-content li { margin: 3px 0; }

.message.agent .message-content {
  background: var(--user-bg);
  color: var(--text);
  border-radius: 18px 18px 18px 4px;
}

.message.user .message-content {
  background: var(--gold);
  color: #FFF8EC;
  border-radius: 18px 18px 4px 18px;
}

.message.feedback .message-content {
  background: rgba(237, 230, 212, 0.18);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(26, 158, 106, 0.35);
  color: var(--text);
  border-radius: 18px 18px 4px 18px;
}

.message.agent .message-content .dim { color: var(--text-dim); }
.message.user  .message-content .dim { color: rgba(255,248,236,0.75); }

.message-image {
  max-width: 180px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 8px;
  display: block;
}

.message.image-only .message-content {
  background: none;
  padding: 0;
  border-radius: 0;
}

.message.image-only .message-image {
  border: 1px solid var(--gold);
  border-radius: 16px;
  margin-bottom: 0;
}

/* Typing indicator */
.typing .message-content {
  padding: 14px 16px;
}
.typing-dots { display: flex; gap: 5px; align-items: center; }
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-dim);
}
.typing-dots span:nth-child(1) { animation: typingPulse 1.1s  ease-in-out          infinite; }
.typing-dots span:nth-child(2) { animation: typingPulse 1.3s  ease-in-out 0.18s    infinite; }
.typing-dots span:nth-child(3) { animation: typingPulse 0.95s ease-in-out 0.35s    infinite; }
@keyframes typingPulse {
  0%, 100% { opacity: 0.18; transform: scale(0.82); }
  45%      { opacity: 1;    transform: scale(1.15); }
}


/* ── Input bar ── */
.input-bar {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px 12px;
  padding-bottom: calc(14px + var(--safe-bottom));
  margin: 0 20px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  flex-shrink: 0;
}

.upload-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  color: var(--gold); cursor: pointer; font-size: 1.3rem;
  transition: color 0.2s; background: none; font-weight: 700;
  align-self: center;
}
.upload-btn:hover { color: var(--text); }

.input-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.image-preview {
  background: transparent; border: none;
  padding: 4px 8px;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--gold);
  display: flex; align-items: center; justify-content: space-between;
}
.image-preview-remove {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 0.8rem; padding: 0 2px;
}
.image-preview-remove:hover { color: var(--red); }

.user-input {
  width: 100%; background: transparent;
  border: none; outline: none;
  color: var(--text); font-family: var(--font-serif); font-size: 0.95rem;
  font-weight: 300; padding: 6px 4px; resize: none;
  line-height: 1.5; max-height: 120px; overflow-y: auto;
}
.user-input::placeholder { color: var(--text-mute); }

.send-btn {
  width: 58px; height: 40px; flex-shrink: 0;
  background: var(--gold); border: none; border-radius: 999px;
  color: #fff; font-size: 1.55rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  padding-bottom: 12px;
  align-self: center;
}
.send-btn:focus { outline: none; }
.send-btn:active { transform: scale(0.88); transition: transform 0.1s ease; }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── @ mention dropdown ── */
.at-dropdown {
  margin: 0 20px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
}
.at-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 16px;
  background: none; border: none; cursor: pointer;
  text-align: left; transition: background 0.15s;
}
.at-option:hover, .at-option:focus { background: rgba(0,0,0,0.04); outline: none; }
.at-option-tag {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: #1a9e6a; font-weight: 500;
}
.at-option-desc {
  font-family: var(--font-serif); font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Mention pill (inside input bar) ── */
.mention-pill-row {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 4px 4px;
}
.mention-pill {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: #1a9e6a; font-weight: 500;
  background: rgba(26, 158, 106, 0.10);
  border: 1px solid rgba(26, 158, 106, 0.35);
  border-radius: 999px; padding: 2px 9px;
  white-space: nowrap;
}
.mention-pill-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 1rem; padding: 0 2px;
  line-height: 1; display: flex; align-items: center;
}
.mention-pill-clear:hover { color: var(--text); }

/* ── Map panel ── */
.map-panel {
  flex: 0 0 0;
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0; min-width: 0;
  position: relative;
  transition: flex 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout.map-active .map-panel {
  flex: 1 1 auto;
}

.map { flex: 1; min-height: 0; background: #f0e8d4; }

.results-list {
  max-height: 240px; overflow-y: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.results-list::-webkit-scrollbar { width: 3px; }
.results-list::-webkit-scrollbar-thumb { background: var(--border); }

.result-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  cursor: pointer; transition: background 0.15s;
}
.result-item:hover { background: var(--agent-bg); }

.result-rank {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--gold-dim); padding-top: 3px; flex-shrink: 0;
  width: 20px;
}

.result-body { flex: 1; min-width: 0; }

.result-name {
  font-family: var(--font-serif); font-size: 1rem;
  font-weight: 400; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.result-meta {
  font-family: var(--font-mono); font-size: 0.66rem;
  color: var(--text-dim); margin-top: 3px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.status-open  { color: var(--green); }
.status-closed { color: var(--red); }

.result-saved-tag {
  font-family: var(--font-mono); font-size: 0.6rem;
  background: rgba(122,88,16,0.10); border: 1px solid var(--gold-dim);
  color: var(--gold-dim); padding: 1px 6px; border-radius: 2px;
  flex-shrink: 0;
}

/* ── Clarifying-question choice bubbles ── */
.choice-bubble {
  align-self: flex-start;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 2px 0 6px;
  max-width: 85%;
  animation: fadeUp 0.25s ease;
}

.choice-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 6px 14px;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.choice-btn:hover {
  border-color: var(--gold-dim);
  background: rgba(122, 88, 16, 0.06);
}

.choice-btn-own {
  color: var(--text-mute);
}
.choice-btn-own:hover {
  border-color: var(--text-dim);
  background: transparent;
  color: var(--text-dim);
}

/* ── Social search links ── */
.result-social-links {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 7px;
}

.social-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em;
  text-decoration: none; white-space: nowrap;
  transition: opacity 0.15s;
}
.social-btn:hover { opacity: 0.78; }

.social-btn-tiktok {
  background: #111111; color: #ffffff;
}

.social-btn-instagram {
  background: linear-gradient(90deg, #e1306c, #833ab4);
  color: #ffffff;
}

/* ── Notes overlay (circle expand) ── */
.notes-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--app-height, 100dvh);
  z-index: 99;
  background: radial-gradient(ellipse at var(--ox, 90%) var(--oy, 5%),
    #ffd4bf 0%, #ff9972 45%, #e06848 100%);
  clip-path: circle(0% at var(--ox, 90%) var(--oy, 5%));
  transition: clip-path 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.notes-overlay.expanded {
  clip-path: circle(170% at var(--ox, 90%) var(--oy, 5%));
  pointer-events: auto;
}

/* ── Notes overlay content ── */
.notes-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 24px 28px;
  padding-top: max(24px, calc(env(safe-area-inset-top) + 16px));
  padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease 0.32s;
  min-height: 0;
}
.notes-overlay.expanded .notes-content {
  opacity: 1; pointer-events: auto;
}

.notes-content-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  font-family: 'Fredoka One', sans-serif; font-size: 2rem;
  color: var(--text); letter-spacing: 0.06em;
  flex-shrink: 0;
}

.notes-content-close {
  background: none; border: none; color: var(--text);
  cursor: pointer; font-size: 1.2rem; font-weight: 700; padding: 4px;
  opacity: 0.6; transition: opacity 0.2s;
}
.notes-content-close:hover { opacity: 1; }

.notes-body { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.notes-body::-webkit-scrollbar { width: 3px; }
.notes-body::-webkit-scrollbar-thumb { background: rgba(26, 22, 8, 0.25); }

.empty-notes { font-family: var(--font-serif); font-size: 0.9rem; color: var(--text-dim); font-style: italic; }

.note-card {
  background: var(--bg); border: 1px solid var(--border);
  border-left: 2px solid var(--gold-dim);
  border-radius: var(--radius); padding: 12px 14px;
  animation: fadeUp 0.3s ease;
}
.note-name { font-family: var(--font-serif); font-size: 0.95rem; color: var(--text); font-weight: 400; }
.note-reason { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); margin-top: 5px; line-height: 1.5; }
.note-time { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-mute); margin-top: 6px; }
.note-delete {
  background: none; border: none; color: var(--text-mute);
  cursor: pointer; font-size: 0.7rem; float: right; padding: 0;
  transition: color 0.2s;
}
.note-delete:hover { color: var(--red); }

/* ── Nearby alert ── */
.nearby-alert {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--gold-dim);
  border-radius: var(--radius); padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-size: 0.9rem; color: var(--text);
  z-index: 200; max-width: 480px; width: 90%;
  box-shadow: 0 8px 32px rgba(26,22,8,0.12);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nearby-icon { color: var(--gold); font-size: 0.8rem; flex-shrink: 0; }
.nearby-text { flex: 1; line-height: 1.4; }
.nearby-dismiss {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 0.8rem; padding: 2px; flex-shrink: 0;
  transition: color 0.2s;
}
.nearby-dismiss:hover { color: var(--text); }

/* ── Sessions panel ── */
.sessions-panel {
  flex: 0 0 200px;
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  border-right: none;
  background: var(--surface);
  transition: flex 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sessions-panel.collapsed {
  flex: 0 0 36px;
}

.sessions-panel.collapsed .sessions-label,
.sessions-panel.collapsed .sessions-new-wrap,
.sessions-panel.collapsed .session-list {
  display: none;
}


.sessions-panel.collapsed .sessions-header {
  justify-content: center;
  padding: 14px 6px;
}

.sessions-panel.collapsed .sessions-tgl {
  border-color: transparent;
}

.sessions-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  flex-shrink: 0;
}

.sessions-label {
  font-family: var(--font-serif);
  font-size: 1rem; font-weight: 600;
  color: var(--text); letter-spacing: 0.04em;
}

.sessions-new-wrap {
  padding: 10px 12px 4px;
  flex-shrink: 0;
}

.sessions-new {
  display: block; width: 100%;
  background: none;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-serif); font-size: 0.9rem; font-weight: 600;
  padding: 8px 14px; text-align: center;
  transition: border-color 0.2s, color 0.2s;
}
.sessions-new:hover { border-color: var(--gold); color: var(--text); }

.session-list {
  display: flex; flex-direction: column;
  overflow-y: auto; gap: 8px;
  padding: 10px 12px;
  flex: 1; min-height: 0;
  align-items: center;
}
.session-list::-webkit-scrollbar { width: 3px; }
.session-list::-webkit-scrollbar-thumb { background: var(--border); }

.session-card {
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(168,126,32,0.35);
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(26,22,8,0.07);
  cursor: pointer; position: relative;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  text-align: center;
}
.session-card:hover {
  box-shadow: 0 4px 16px rgba(26,22,8,0.13);
  border-color: var(--gold-dim);
  transform: translateY(-1px);
}
.session-card.active {
  border-color: var(--gold-dim);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(122,88,16,0.13);
}

.session-title {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 14px;
}

.session-meta {
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px; justify-content: center;
}

.session-time {
  font-family: var(--font-mono); font-size: 0.58rem;
  color: var(--text-mute);
}

.session-loc {
  font-family: var(--font-mono); font-size: 0.58rem;
  color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 80px;
}

.session-delete {
  position: absolute; top: 50%; right: 10px;
  transform: translateY(-50%);
  display: none;
  background: none; border: none;
  color: var(--text-mute); cursor: pointer;
  font-size: 0.65rem; padding: 0;
  transition: color 0.15s;
}
.session-card:hover .session-delete { display: block; }
.session-delete:hover { color: var(--red); }

/* Sessions toggle inside the panel header */
.sessions-tgl {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim); cursor: pointer;
  font-family: var(--font-mono); font-size: 0.75rem;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.sessions-tgl:hover { color: var(--gold); border-color: var(--gold-dim); }

.sessions-actions {
  display: flex; align-items: center; gap: 6px;
}

/* Mobile hamburger — only shown on narrow screens */
.sessions-tgl-mobile {
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 1rem; padding: 4px 8px;
  grid-column: 1; justify-self: start;
  display: none;
  transition: color 0.2s;
}
.sessions-tgl-mobile:hover { color: var(--text); }

/* ── Sign-in chat bubble ── */
.signin-bubble-content {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.signin-bubble-btn {
  background: none; border: 1px solid var(--gold-dim);
  border-radius: 999px; color: var(--gold);
  cursor: pointer; font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.06em;
  padding: 4px 12px; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.signin-bubble-btn:hover { background: var(--gold); color: #FFF8EC; }

/* ── Auth screen ── */
.auth-screen {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}

.auth-card {
  max-width: 380px; width: 90%;
  display: flex; flex-direction: column; gap: 32px;
}

.auth-logo {
  font-family: var(--font-mono);
  font-size: 0.82rem; letter-spacing: 0.22em;
  color: var(--text);
  align-self: center;
}

.auth-tabs {
  display: flex; gap: 6px;
}

.auth-tab {
  padding: 10px 26px;
  border-radius: 24px; border: none;
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  color: var(--text-mute); background: transparent;
}
.auth-tab.active { background: var(--text); color: #FFF8EC; }
.auth-tab:not(.active):hover { color: var(--text-dim); }

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.auth-field { display: flex; flex-direction: column; gap: 8px; }

.auth-label {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-dim); letter-spacing: 0.04em;
}

.auth-label-row {
  display: flex; align-items: center; justify-content: space-between;
}

.auth-show-pw {
  background: none; border: none;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim); cursor: pointer; padding: 0;
  transition: color 0.2s;
}
.auth-show-pw:hover { color: var(--text); }

.auth-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-serif); font-size: 0.95rem;
  padding: 14px 16px; outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--text-dim); }
.auth-input::placeholder { color: var(--text-mute); }

.auth-error {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--red);
  padding: 8px 12px;
  background: rgba(192,96,74,0.08);
  border: 1px solid rgba(192,96,74,0.2);
  border-radius: 12px;
}

.auth-submit {
  width: 100%;
  background: var(--text); border: none;
  border-radius: 28px;
  color: #FFF8EC;
  font-family: var(--font-serif); font-size: 1rem; letter-spacing: 0.03em;
  padding: 16px; cursor: pointer;
  transition: background 0.2s;
}
.auth-submit:hover { background: #2A2410; }
.auth-submit:disabled { background: var(--border); cursor: not-allowed; }

.auth-note {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-mute); text-align: center;
}

.auth-subtitle {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-dim); text-align: center; letter-spacing: 0.05em;
}

.auth-hint {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--gold-dim); text-align: center; margin-bottom: 4px;
}

/* ── Waitlist join ── */
.waitlist-form { display: flex; flex-direction: column; gap: 18px; }

.waitlist-intro {
  font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.45;
  color: var(--text-dim); text-align: center;
}

.waitlist-consents { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.waitlist-check {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.45;
  color: var(--text-dim); cursor: pointer;
}
.waitlist-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold); cursor: pointer; flex-shrink: 0;
}
.waitlist-check a { color: var(--gold); text-decoration: underline; }

.waitlist-success { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.waitlist-success-title {
  font-family: var(--font-serif); font-size: 1.3rem; color: var(--text);
}
.waitlist-success-note {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); line-height: 1.5;
}

/* ── Logout button ── */
.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em;
  padding: 5px 14px;
  grid-column: 1; justify-self: start;
  transition: color 0.2s, border-color 0.2s;
}
.logout-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

/* ── Sessions drawer backdrop ── */
.sessions-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 299;
  background: rgba(26,22,8,0.35);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.sessions-backdrop.visible { display: block; }

/* ── Responsive (narrow / iPhone) ── */
@media (max-width: 800px) {
  .sessions-tgl-mobile { display: block; }

  /* On mobile, logout lives inside the sessions panel */
  .logout-btn { display: none !important; }

  .header-inner { padding: 10px 16px; }
  .logo         { font-size: 0.78rem; letter-spacing: 0.12em; left: 44%; }
  .notes-toggle    { padding: 6px 4px; gap: 5px; }
  .notes-heart-svg { width: 0.95rem; height: 0.95rem; }
  .notes-label     { font-size: 0.75rem; white-space: nowrap; }

  /* Drawer — slides in from left, overlays the chat */
  .sessions-panel {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 300; width: 260px;
    box-shadow: 4px 0 32px rgba(26,22,8,0.18);
    flex: none; pointer-events: auto;
    display: flex !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    /* Safe area: push content below the notch */
    padding-top: env(safe-area-inset-top);
  }
  .sessions-panel.open {
    transform: translateX(0);
  }
  /* Hide the desktop collapse toggle on mobile */
  .sessions-tgl { display: none; }

  .session-card  { padding: 10px 14px; }
  .session-title { font-size: 0.72rem; }
  .sessions-new  { font-size: 0.85rem; padding: 10px 14px; }

  /* Sign out footer */
  .sessions-panel-footer {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sessions-signout-btn {
    background: none; border: 1px solid var(--border);
    border-radius: 999px; color: var(--text-dim);
    cursor: pointer; width: 100%;
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em;
    padding: 10px 14px;
    transition: color 0.2s, border-color 0.2s;
  }
  .sessions-signout-btn:active { color: var(--gold); border-color: var(--gold-dim); }

  .message         { max-width: 88%; }
  .message-content { font-size: 1.05rem; padding: 10px 14px; }

  .input-bar {
    margin: 0 12px;
    margin-bottom: max(12px, env(safe-area-inset-bottom));
    padding: 10px 14px;
  }
  .user-input           { font-size: 1rem; }
  .send-btn { width: 58px; height: 40px; }
  .upload-btn { width: 36px; height: 36px; }

  /* Map: stacks below chat on mobile */
  .layout.map-active               { flex-direction: column; }
  .layout.map-active .chat-panel   { flex: 0 0 auto; max-width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .layout.map-active .map-panel    { flex: 0 0 300px; }
}

/* ── Recommendation bubble (single message bubble, Option A) ── */
.rec-bubble {
  padding: 0;
  overflow: hidden;
}

.rec-bubble-intro {
  padding: 10px 16px 12px;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 300;
  color: var(--text);
}

.rec-place-list {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rec-divider {
  height: 1px;
  background: var(--border);
}

.rec-place-row {
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.rec-place-row:hover,
.rec-place-row.open {
  background: rgba(122, 88, 16, 0.04);
}

.rec-place-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
}

.rec-place-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.rec-tag {
  font-size: 1rem;
  flex-shrink: 0;
}

.rec-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.12s;
}
.rec-name:active {
  opacity: 0.55;
}

@keyframes venueNamePop {
  from { opacity: 0; transform: translateX(-50%) translateY(calc(-100% - 8px)) scale(0.82); }
  to   { opacity: 1; transform: translateX(-50%) translateY(calc(-100% - 8px)) scale(1); }
}
.venue-name-popup {
  position: fixed;
  z-index: 9999;
  background: rgba(232, 224, 206, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(200, 188, 168, 0.6);
  border-radius: 20px;
  padding: 8px 18px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%) translateY(calc(-100% - 8px));
  animation: venueNamePop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
}

.rec-chevron {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 3px solid var(--text);
  border-bottom: 3px solid var(--text);
  border-radius: 1px;
  transform: rotate(-45deg);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  margin-left: 14px;
  margin-bottom: 2px;
}

.rec-tiktok-btn {
  flex-shrink: 0;
  font-size: 0.6rem;
  padding: 3px 10px;
}

.rec-desc {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rec-desc-inner {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 300;
  color: var(--text-dim);
  padding: 8px 16px 14px;
  border-top: 1px solid var(--border);
}

.rec-desc-inner strong:first-child {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

.rec-bubble-outro {
  padding: 10px 16px 12px;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 300;
  color: var(--text-dim);
}

/* ── 3D-touch press feedback ── */
.message {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.2s ease, opacity 0.2s ease;
}
.message.msg-pressing {
  transform: scale(1.06);
}

/* Blur & dim everything else in the message list */
.messages.has-press .message:not(.msg-pressing) {
  filter: blur(2.5px);
  opacity: 0.45;
}

/* Dim the surrounding UI chrome */
body.has-press .header,
body.has-press .input-bar,
body.has-press .reply-bar,
body.has-press .map-panel {
  filter: blur(3px);
  opacity: 0.5;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* ── Message context menu ── */
.msg-context-menu {
  position: fixed;
  z-index: 9999;
  background: rgba(248, 244, 236, 0.55);
  backdrop-filter: blur(40px) saturate(200%) brightness(1.08);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.08);
  border: 0.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  min-width: 180px;
  animation: ctxPop 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
  transform-origin: top center;
}

@keyframes ctxPop {
  from { opacity: 0; transform: scale(0.78); }
  to   { opacity: 1; transform: scale(1); }
}

.msg-context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: none;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.msg-context-menu button:active {
  background: rgba(122, 88, 16, 0.1);
}

.msg-context-menu button + button {
  border-top: 0.5px solid rgba(200, 188, 168, 0.4);
}

.msg-context-menu button .ctx-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.65;
}

.msg-context-menu:not(.agent-ctx) {
  background: rgba(252, 250, 246, 0.82);
  backdrop-filter: blur(40px) saturate(140%) brightness(1.14);
  -webkit-backdrop-filter: blur(40px) saturate(140%) brightness(1.14);
}

/* ── Reaction bubbles (single pill with heart + sad) ── */
.msg-reactions {
  position: absolute;
  bottom: -11px;
  right: 0;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(26,22,8,0.12);
  opacity: 0;
  transition: opacity 0.15s;
  overflow: hidden;
}

.msg-reaction-btn {
  width: 26px;
  height: 22px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}


/* heart: fill when active */
.msg-reaction-btn .reaction-fill-path { fill: none; transition: fill 0.2s; }
.msg-like-btn.active .reaction-fill-path { fill: currentColor; }
.msg-like-btn.active { color: var(--red); }

/* sad: bolder stroke only, no fill */
.msg-dislike-btn.active { color: var(--text-dim); }
.msg-dislike-btn.active svg { stroke-width: 2.8; }

@media (hover: none) {
  .msg-reactions { opacity: 0.55; }
}
.message.agent:hover .msg-reactions { opacity: 0.65; }
.msg-reactions:hover { opacity: 1; }
.msg-reactions:has(.active) { opacity: 1; }

@keyframes reaction-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.55); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.msg-reaction-btn.reaction-pop { animation: reaction-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── Inline message edit ── */
.message-content.msg-editing {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,248,236,0.45);
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}
.msg-edit-actions button {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  padding: 4px 13px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.msg-edit-cancel {
  background: rgba(0,0,0,0.07);
  color: var(--text-dim);
}
.msg-edit-save {
  background: var(--gold);
  color: #FFF8EC;
}

/* ── Reply bar (above input) ── */
.reply-bar {
  display: none;
  align-items: center; gap: 8px;
  padding: 6px 12px 2px;
  margin: 0 20px;
  border-left: 3px solid var(--gold);
  background: var(--surface);
  border-radius: 4px 4px 0 0;
  font-family: var(--font-serif); font-size: 0.82rem;
  color: var(--text-dim); line-height: 1.35;
}
.reply-bar.active { display: flex; }
.reply-bar-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-bar-cancel {
  background: none; border: none; cursor: pointer;
  color: var(--text-mute); font-size: 1rem;
  padding: 0 2px; line-height: 1;
  transition: color 0.2s;
}
.reply-bar-cancel:hover { color: var(--red); }

/* ── Safe areas for iPhone notch + home indicator ── */
.header {
  padding-top: env(safe-area-inset-top);
}

/* ── PWA standalone mode (installed on home screen) ── */
@media (display-mode: standalone) {
  .header { padding-top: max(env(safe-area-inset-top), 14px); }
  .nearby-alert { bottom: calc(env(safe-area-inset-bottom) + 80px); }
}

/* ── Pick card (photo recommendation) ── */
.pick-card {
  background: var(--agent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  margin: 0;
}

.pick-card.open {
  border-color: var(--gold-dim);
}

.pick-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.pick-header:hover {
  background: rgba(201, 168, 76, 0.05);
}

.pick-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  background: transparent;
}

.pick-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pick-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gold);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.pick-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}

.pick-chevron {
  font-size: 1.1rem;
  color: var(--text-dim);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.pick-desc {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pick-desc-inner {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 300;
  color: var(--text-dim);
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
}
