:root {
  --red: #d92f3d;
  --red-hover: #c92e3b;
  --green: #137a44;
  --cream: #fff8f2;
  --ink: #111111;
  --muted: #6e6b70;
  --surface: #ffffff;
  --line: #eee2d9;
  --later: #6e6b70;
  --shadow: 0 16px 40px rgba(60, 35, 20, .16);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--ink);
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.map-app { position: fixed; inset: 0; }
.map-canvas { position: absolute; inset: 0; }

.map-top {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.brand { padding: 4px 12px; display: inline-flex; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.logo { height: 40px; display: block; }
.top-actions { display: flex; gap: 8px; }
.pill {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow);
}
.pill-red { color: #fff; background: var(--red); }
.pill-red:hover { background: var(--red-hover); }
.pill-light { color: var(--ink); background: var(--surface); }
.pill:disabled { opacity: .6; }
.maplibregl-ctrl-top-right { top: 72px; }

/* Pins */
.pin { padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; }
.pin-dot {
  width: 40px; height: 40px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%;
  color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.pin-live .pin-dot { background: var(--red); }
.pin-later .pin-dot { width: 34px; height: 34px; background: var(--later); opacity: .85; }
.pin-time { padding: 3px 8px; border-radius: 999px; color: #111; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pin:focus-visible .pin-dot { outline: 3px solid #3478f6; outline-offset: 2px; }

/* Panel: side card on desktop, bottom sheet on phones */
.panel {
  position: absolute; z-index: 2; top: 76px; left: 16px; bottom: 16px; width: 380px;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px; background: var(--surface); box-shadow: var(--shadow);
}
.panel-handle { display: none; }
.panel-body { padding: 20px; overflow-y: auto; }
.panel-title { margin: 8px 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
#laterTitle { margin-top: 20px; }
.vendor-list { margin: 0; padding: 0; list-style: none; }
.vendor-row {
  width: 100%; min-height: 64px; padding: 8px; display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 16px; background: none; text-align: left; cursor: pointer;
}
.vendor-row:hover { background: color-mix(in srgb, var(--line) 60%, transparent); }
.avatar {
  width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
  border-radius: 50%; color: #fff; background: var(--later); font-weight: 800;
}
.avatar-live { background: var(--red); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--red); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.row-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-text strong { font-size: 16px; }
.row-text span { color: var(--muted); font-size: 14px; }
.status { margin-top: 12px; color: var(--muted); font-size: 15px; }
.status[hidden] { display: none; }

.back { min-height: 44px; padding: 0; border: 0; background: none; color: var(--red); font-weight: 700; cursor: pointer; }
.detail-head { margin-top: 8px; display: flex; align-items: center; gap: 16px; }
.detail-photo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.detail-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.detail-when { margin-top: 4px; color: var(--muted); font-weight: 700; }
.detail-when.is-live { color: var(--green); }
.detail-meta { margin-top: 12px; color: var(--muted); }
.detail-bio { margin-top: 12px; line-height: 1.45; }
.detail-actions { margin: 16px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions .pill { box-shadow: none; }
.detail-actions .pill-light { border: 1px solid var(--line); }

.menu h3 { margin: 20px 0 4px; font-size: 18px; font-weight: 800; }
.menu-items { margin: 0; padding: 0; list-style: none; }
.menu-items li { padding: 12px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.menu-items li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-items li span { color: var(--muted); font-size: 14px; }
.menu-items .price { color: var(--ink); font-weight: 700; }
.menu-items img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.menu-photo { width: 100%; margin-top: 12px; border-radius: 16px; }

@media (max-width: 720px) {
  .logo { height: 32px; }
  .pill { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 34vh;
    border-radius: 24px 24px 0 0; transition: max-height .3s ease;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.expanded { max-height: 78vh; }
  .panel-handle {
    display: block; width: 100%; height: 28px; flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: pointer;
  }
  .panel-handle::after { content: ""; display: block; width: 40px; height: 5px; margin: 10px auto 0; border-radius: 999px; background: var(--line); }
  .panel-body { padding: 4px 16px 16px; }
  .maplibregl-ctrl-top-right { top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}
.captcha-dialog { box-sizing: border-box; width: min(420px, calc(100% - 32px)); border: 0; border-radius: 14px; padding: 0; }
.captcha-dialog::backdrop { background: rgb(0 0 0 / .5); }
.captcha-dialog iframe { display: block; width: 100%; height: min(330px, 75vh); border: 0; }
#captchaRetry[hidden] { display: none; }
