:root {
  --wine: #B3262E;
  --accent: #C98A4B;
  --sky: #2E8FD0;
  --cream: #F2E8D5;
  --bg: #F7F0E4;
  --surface: #FFFBF5;
  --surface-2: #F2E8D5;
  --text: #2A1F1A;
  --muted: #6B5344;
  --border: #E2D2BC;
  --hh: #B3262E;
  --food: #2E8A5A;
  --drink: #2E8FD0;
  --sin: #8B5CF6;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(80, 40, 20, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--wine); color: #fff; padding: .5rem 1rem; z-index: 10000;
}
.skip-link:focus { left: .5rem; top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .65rem 1rem; background: var(--surface);
  border-bottom: 1px solid var(--border); z-index: 20;
}
.brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.brand-mark { font-size: 1.45rem; }
.brand h1 { font-size: 1.02rem; margin: 0; letter-spacing: .01em; white-space: nowrap; color: var(--wine); }
.tagline { margin: 0; font-size: .7rem; color: var(--muted); line-height: 1.25; }
.ig-cta {
  display: inline-flex; align-items: center; gap: .4rem;
  background: linear-gradient(135deg, #C98A4B, #B3262E 55%, #dd2a7b);
  color: #fff; text-decoration: none; font-weight: 700; font-size: .78rem;
  padding: .5rem .85rem; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(179, 38, 46, .28);
}
.ig-cta:hover, .ig-cta:focus-visible { filter: brightness(1.06); outline: 2px solid var(--wine); outline-offset: 2px; }

.toolbar {
  background: var(--surface); padding: .55rem 1rem .7rem; border-bottom: 1px solid var(--border); z-index: 15;
}
.when-row, .search-row, .area-jumps, .quick-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.quick-chips { margin-top: .4rem; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: .35rem .75rem; font-size: .8rem; cursor: pointer;
}
.chip.active { background: var(--wine); border-color: var(--wine); color: #fff; font-weight: 600; }
.chip.feat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.ghost { background: transparent; }
.chip:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.pick-row { display: flex; gap: .5rem; margin-top: .45rem; }
.pick-row select, .pick-row input, #search, #sort-select, .modal-card input, .modal-card select, .modal-card textarea {
  background: #fff; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: .5rem .65rem; font: inherit;
}
.search-row { margin-top: .45rem; }
#search { flex: 1; min-width: 0; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: .5rem .75rem; cursor: pointer; font-size: .8rem;
}
.filters {
  margin-top: .55rem; padding: .65rem; background: var(--surface-2); border-radius: var(--radius);
  display: grid; gap: .65rem;
}
.filters fieldset { border: 0; margin: 0; padding: 0; }
.filters legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .35rem; }
.filters label { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; margin: .15rem .7rem .15rem 0; }
.area-jumps button {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 999px; padding: .3rem .65rem; font-size: .75rem; cursor: pointer;
}
.fav-only { font-size: .82rem; }

.layout { flex: 1; display: grid; grid-template-columns: 1fr; min-height: 0; position: relative; }
#map { width: 100%; height: 100%; min-height: 280px; background: #d9e8f2; }
.list-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  max-height: 42%; background: var(--surface); border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow); overflow: auto; padding: .75rem 1rem calc(.75rem + var(--safe-b));
  border-top: 1px solid var(--border);
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 1fr 380px; }
  #map { height: 100%; }
  .list-panel {
    position: relative; max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--border);
  }
}

.spot-week {
  background: linear-gradient(135deg, #FFF4E5, #F8DFD8);
  border: 1px solid #E8C4A8; border-radius: var(--radius); padding: .7rem .85rem; margin-bottom: .65rem;
}
.spot-week .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--wine); font-weight: 700; }
.spot-week h3 { margin: .2rem 0; font-size: 1rem; }
.spot-week p { margin: 0; font-size: .8rem; color: var(--muted); }
.list-meta { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: .45rem; gap: .5rem; }
.venue-list { list-style: none; margin: 0; padding: 0; }
.venue-card {
  display: grid; grid-template-columns: 8px 1fr auto; gap: .65rem; align-items: start;
  padding: .7rem .2rem; border-bottom: 1px solid var(--border); cursor: pointer;
}
.venue-card:hover, .venue-card:focus-visible { background: var(--surface-2); outline: none; }
.venue-card h3 { margin: 0 0 .15rem; font-size: .95rem; }
.venue-card .meta { font-size: .75rem; color: var(--muted); }
.venue-card .deal-line { font-size: .8rem; margin-top: .25rem; }
.venue-card .feat-mini {
  display: inline-block; margin-top: .25rem; font-size: .68rem; font-weight: 700;
  color: var(--wine); background: rgba(179,38,46,.1); padding: .12rem .4rem; border-radius: 6px;
}
.dot { width: 8px; height: 100%; min-height: 36px; border-radius: 4px; background: var(--hh); }
.dot.food_special { background: var(--food); }
.dot.drink_special { background: var(--drink); }
.dot.industry_night { background: var(--sin); }
.fav-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: .2rem;
}
.fav-btn.on { color: var(--accent); }

.app-footer { margin-top: 1rem; font-size: .75rem; color: var(--muted); }
.app-footer a { color: var(--wine); font-weight: 600; }
.fine { opacity: .9; }

.leaflet-container { font: inherit; background: #d9e8f2; }
.marker-pin {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.marker-pin.happy_hour { background: var(--hh); }
.marker-pin.food_special { background: var(--food); }
.marker-pin.drink_special { background: var(--drink); }
.marker-pin.industry_night { background: var(--sin); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background: rgba(179,38,46,.28) !important;
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--wine) !important; color: #fff !important; font-weight: 700;
}

#map, .leaflet-container { z-index: 0; isolation: isolate; }

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(42,31,26,.45); z-index: 2000;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2100;
  max-height: min(85vh, 720px); overflow: auto; background: var(--surface);
  border-radius: 18px 18px 0 0; padding: .5rem 1rem calc(1.1rem + var(--safe-b));
  box-shadow: 0 -8px 40px rgba(80,40,20,.25);
  color: var(--text);
  transform: translateY(0);
  animation: sheet-up .28s ease-out;
}
@keyframes sheet-up {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
.sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: #C9B8A4; margin: .35rem auto .5rem; }
.sheet-close {
  position: sticky; float: right; top: .25rem; right: 0; z-index: 2;
  border: 0; background: var(--surface-2);
  color: var(--text); width: 36px; height: 36px; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
  margin: 0 0 .25rem .5rem;
}
#sheet-body { clear: both; min-height: 120px; }
#sheet-body h2 { color: var(--text); }
@media (min-width: 900px) {
  .sheet {
    left: auto; right: 12px; bottom: 12px; top: auto;
    width: min(400px, calc(380px - 8px));
    max-height: calc(100vh - 140px);
    border-radius: 16px;
    animation: sheet-fade .2s ease-out;
    padding-top: .75rem;
  }
  .sheet-handle { display: none; }
  @keyframes sheet-fade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
.sheet h2 { margin: .2rem 2rem .35rem 0; font-size: 1.25rem; }
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: .2rem .45rem; border-radius: 6px; margin-right: .3rem; margin-bottom: .3rem;
}
.badge.hh { background: rgba(179,38,46,.12); color: #8E1C24; }
.badge.food { background: rgba(46,138,90,.14); color: #1F6B44; }
.badge.drink { background: rgba(46,143,208,.14); color: #1A6FA8; }
.badge.sin { background: rgba(139,92,246,.14); color: #6D28D9; }
.badge.feat, a.badge.feat {
  background: linear-gradient(135deg, #C98A4B, #B3262E);
  color: #fff; text-decoration: none;
}
.badge.feat:hover { filter: brightness(1.05); }
.deal-block {
  background: var(--surface-2); border-radius: 12px; padding: .7rem .8rem; margin: .55rem 0;
}
.deal-block h4 { margin: 0 0 .25rem; font-size: .85rem; }
.deal-block p { margin: 0; font-size: .82rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.actions a, .primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wine); color: #fff; text-decoration: none; border: 0;
  border-radius: 10px; padding: .55rem .8rem; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.actions a.secondary { background: #fff; border: 1px solid var(--border); color: var(--text); }
.source-line { font-size: .72rem; color: var(--muted); }
.source-line a { color: var(--sky); }

.modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(42,31,26,.45);
  display: grid; place-items: center; padding: 1rem;
}
.modal-card {
  background: var(--surface); border-radius: 16px; padding: 1.1rem 1.1rem 1.3rem;
  width: min(440px, 100%); position: relative; max-height: 90vh; overflow: auto;
  border: 1px solid var(--border);
}
.modal-card h2 { margin-top: 0; color: var(--wine); }
.modal-card form { display: grid; gap: .65rem; }
.modal-card label { display: grid; gap: .25rem; font-size: .82rem; }

.empty-state {
  padding: 1.25rem .5rem; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.45;
}
.empty-state strong { color: var(--wine); }

/* IG photos (optional on venues) */
.venue-thumb {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover;
  background: var(--surface-2); flex-shrink: 0;
}
.venue-card.has-photo {
  grid-template-columns: 8px 52px 1fr auto;
}
.sheet-photo {
  width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px;
  background: var(--surface-2); margin: .35rem 0 .25rem; display: block;
}
.sheet-photo-credit {
  display: inline-block; font-size: .72rem; color: var(--muted); margin: 0 0 .55rem;
  text-decoration: none;
}
.sheet-photo-credit:hover { color: var(--wine); }

.spot-week-btn {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 0; color: inherit; font: inherit; cursor: pointer;
}
.spot-week-btn:disabled { cursor: default; }
.spot-row { display: flex; gap: .65rem; align-items: flex-start; margin-top: .25rem; }
.spot-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  background: #fff;
}
.spot-week h3 { margin: 0 0 .2rem; font-size: 1rem; }
.spot-week p { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.35; }

/* Partner (sponsored) — distinct from editorial Featured */
.badge.partner {
  background: #1F2937;
  color: #F9FAFB;
  border: 1px solid #F59E0B;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .35);
}
.badge.partner .partner-sub {
  display: inline-block;
  margin-left: .25rem;
  font-size: .62rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: .02em;
  opacity: .85;
  color: #FCD34D;
}
.partner-mini {
  display: inline-block; margin-top: .25rem; margin-right: .3rem;
  font-size: .68rem; font-weight: 700;
  color: #92400E; background: rgba(245, 158, 11, .18);
  border: 1px solid rgba(245, 158, 11, .45);
  padding: .12rem .4rem; border-radius: 6px;
}
.venue-card.is-partner {
  background: linear-gradient(90deg, rgba(245, 158, 11, .10), transparent 55%);
  border-left: 3px solid #F59E0B;
  padding-left: .35rem;
}
.dot.partner { box-shadow: 0 0 0 2px #F59E0B; }
.marker-pin.partner {
  position: relative;
  width: 32px; height: 32px;
  box-shadow: 0 0 0 3px #F59E0B, 0 2px 8px rgba(0,0,0,.4);
  border-width: 3px;
}
.marker-pin.partner::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: rotate(45deg);
}


/* Primary CTA row — Directions + Call (large tap targets) */
.actions-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  margin: .85rem 0 .45rem;
}
.actions-primary.one { grid-template-columns: 1fr; }
.actions-primary .action-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: .85rem 1rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .01em;
  background: var(--wine);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(179, 38, 46, .25);
  cursor: pointer;
}
.actions-primary .action-lg[data-track="call"] {
  background: linear-gradient(135deg, #2E8A5A, #1F6B45);
  box-shadow: 0 4px 14px rgba(46, 138, 90, .28);
}
.actions-primary .action-lg:hover,
.actions-primary .action-lg:focus-visible {
  filter: brightness(1.06);
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
