:root {
  color-scheme: light;
  --cream: #f7efe0;
  --ink: #3d2b26;
  --terracotta: #a65c40;
  --sand: #d8c6b4;
  --raspberry: #a32c60;
  --light: #fffaf2;
  --shadow: 0 3px 12px #3d2b2629;
  font: 16px/1.48 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); }
body.map-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
h1, h2, p { margin: 0; }
button, select { font: inherit; color: inherit; }
button, a, select, summary { cursor: pointer; }
button { touch-action: manipulation; }
:where(button, a, summary, select, canvas):focus-visible { outline: 3px solid #793e2a; outline-offset: 2px; }
[hidden] { display: none !important; }

header, #tagFilters {
  --gutter: clamp(16px, 2.6vw, 44px);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: var(--cream); flex: none;
}
header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 4px;
}
.brand-stack { min-width: 0; }
.brand-stack h1 { line-height: 0; }
#titleButton { display: inline-flex; align-items: center; min-height: 44px; border: 0; padding: 0; background: transparent; }
.wordmark { display: block; width: clamp(126px, 13vw, 154px); height: auto; image-rendering: pixelated; }
.slogan { font-size: clamp(14px, 1.3vw, 16px); font-weight: 540; margin-top: 5px; }
#aboutButton { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
#aboutButton span { display: grid; place-items: center; width: 25px; height: 25px; border: 1.5px solid var(--ink); border-radius: 50%; font: 600 16px/1 system-ui, sans-serif; }
#tagFilters, #districtDock { display: flex; align-items: center; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x; }
#tagFilters::-webkit-scrollbar, #districtDock::-webkit-scrollbar { display: none; }
#tagFilters { padding-top: 3px; padding-bottom: 5px; }
.tag-chip, .district-chip { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; border-radius: 15px; border: 1px solid var(--sand); }
.tag-chip { min-height: 38px; padding: 4px 14px; font-size: 14px; font-weight: 600; background: transparent; }
.tag-chip[aria-pressed=true] { background: var(--terracotta); border-color: var(--terracotta); color: white; }
.tag-chip[aria-pressed=true]::before { content: ""; width: 9px; height: 5px; border: solid currentColor; border-width: 0 0 1.8px 1.8px; transform: translateY(-1px) rotate(-45deg); }
#mapbox { position: relative; flex: 1; min-height: 0; background: #2eb3c1; isolation: isolate; overflow: hidden; }
#mapbox::after { content: ""; position: absolute; inset: 0 0 auto; height: 26px; z-index: 1; background: linear-gradient(to bottom, var(--cream), rgba(247,239,224,.70) 30%, rgba(247,239,224,.20) 72%, rgba(247,239,224,0)); pointer-events: none; }
#google, #atlas, #actors { position: absolute; inset: 0; width: 100%; height: 100%; }
#atlas { touch-action: none; cursor: grab; outline-offset: -4px; }
#atlas:active { cursor: grabbing; }
#actors { z-index: 2; pointer-events: none; overflow: hidden; }
.pin { pointer-events: auto; position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 46px; height: 50px; padding: 0; border: 0; background: none; transform: translate(-50%,-100%); z-index: 3; }
.pin .bob { position: relative; display: grid; place-items: center; transform-origin: bottom; filter: drop-shadow(0 2px 2px #3d2b2659); }
.pin svg { display: block; width: 39px; height: 47px; overflow: visible; }
.pin:hover .bob, .pin:focus-visible .bob { scale: 1.08; }
.cluster-pin { width: 48px; height: 55px; z-index: 4; }
.cluster-pin svg { width: 45px; height: 54px; }
.pin-number { position: absolute; top: 3px; left: 0; width: 100%; height: 33px; display: grid; place-items: center; color: white; font: 750 21px/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.trending-star { position: absolute; right: -5px; top: -5px; color: #ffd568; font: 900 23px/1 sans-serif; -webkit-text-stroke: 1.1px var(--ink); filter: drop-shadow(0 0 1px var(--cream)); }
.sail { pointer-events: none; position: absolute; left: 0; top: 0; transform: translate(-50%,-75%); }
.sail canvas { display: block; image-rendering: pixelated; }
@media (prefers-reduced-motion:no-preference) {
  .pin .bob { animation: bob 2.4s ease-in-out infinite; animation-delay: var(--delay,0s); }
  .sail canvas { animation: sailing 15s ease-in-out infinite alternate; animation-delay: var(--delay,0s); }
  @keyframes bob { 0%,38%,100% { transform: translateY(0); } 65% { transform: translateY(-3px); } }
  @keyframes sailing { from { transform: translate(-7px,0); } to { transform: translate(7px,-3px); } }
}
#districtDock { position: absolute; z-index: 5; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; padding: 6px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left)); }
.district-chip { min-height: 44px; padding: 6px 9px 6px 14px; background: var(--cream); box-shadow: var(--shadow); font-weight: 650; }
.district-chip[aria-pressed=true] { border-color: var(--terracotta); background: #f1deca; }
.district-count { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 20px; background: var(--terracotta); color: white; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
#mapStatus, #noMatches { position: absolute; z-index: 4; left: 50%; top: 17px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 34px); padding: 8px 12px; font-size: 14px; border: 1px solid var(--sand); border-radius: 12px; background: var(--light); box-shadow: var(--shadow); }
#mapStatus button, #noMatches button { min-height: 36px; border: 0; background: transparent; font-weight: 650; text-decoration: underline; }
dialog, .sheet { border: 1px solid var(--sand); border-radius: 17px; background: var(--light); color: var(--ink); box-shadow: var(--shadow); }
dialog { width: min(365px,calc(100vw - 32px)); padding: 22px; max-height: 83dvh; overflow: auto; }
dialog::backdrop { background: #30231e64; }
dialog h2, .sheet h2 { font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
dialog form { float: right; }
.close { font: 25px/1 sans-serif; border: 0; background: transparent; width: 44px; height: 44px; margin: -9px -9px 0 0; }
dialog label { display: block; font-size: 14px; margin: 18px 0 4px; }
dialog select, dialog>button, .actions button, .back { border: 1px solid var(--sand); border-radius: 10px; min-height: 44px; padding: 7px 12px; background: var(--cream); }
dialog select, dialog>button { width: 100%; margin-bottom: 8px; text-align: left; }
dialog>button, .actions button, .back { font-weight: 650; }
dialog details, .sub { font-size: 13px; }
dialog p { margin: 9px 0; }
a { color: #81452f; }
summary { padding: 8px 0; min-height: 44px; display: list-item; }
#aboutGuide h2, #clusterDialog h2 { margin: 2px 30px 12px 0; font-size: 20px; }
#reviewPreview { width: min(360px,calc(100vw - 32px)); max-height: 60vh; max-height: 60dvh; }
#reviewPreview h2 { margin: 6px 22px 12px 0; font-size: 24px; }
.preview-district, .kicker { color: #87482f; font-size: 13px; font-weight: 700; }
.preview-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-tags span, .copy .paid { background: var(--cream); border: 1px solid var(--sand); border-radius: 16px; padding: 2px 8px; font-size: 13px; }
#reviewPreview .address-label { margin: 13px 0 2px; font-size: 12px; }
#reviewPreview address { font-style: normal; font-size: 15px; }
#reviewPreview .full-review, .actions button { background: var(--terracotta); color: white; border-color: var(--terracotta); }
#reviewPreview .full-review { margin: 15px 0 0; text-align: center; }
#detail, #saved { max-width: 720px; margin: 0 auto; padding: 16px 16px max(35px,env(safe-area-inset-bottom)); }
.back { margin-bottom: 12px; }
.sheet { overflow: hidden; }
.cover { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.copy, #saved .sheet { padding: 20px; }
.copy h1 { font-size: clamp(25px,4vw,38px); line-height: 1.12; letter-spacing: -.035em; margin: 9px 0; }
.copy .paid { display: inline-block; font-weight: 650; }
.sub, .address-label { color: #69574d; }
.copy p { margin: 7px 0 14px; }
.copy h2 { font-size: 18px; margin-top: 21px; }
.actions { margin: 13px 0; }
.copy details { margin: 18px 0 0; border-top: 1px solid var(--sand); }
.copy summary { font-weight: 650; }
.copy details img, .copy video { width: 100%; display: block; }
.copy iframe { width: 100%; max-width: 500px; height: 570px; border: 1px solid var(--sand); }
#savedCards { margin-top: 16px; }
.entry { width: 100%; background: none; border: 0; border-top: 1px solid var(--sand); display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 0; }
.entry img { width: 64px; height: 54px; border-radius: 6px; object-fit: cover; }
.entry strong, .entry small { display: block; }
@media (max-width:600px) {
  .tag-chip { min-height: 44px; }
  .copy { padding: 16px; }
  #reviewPreview { margin: auto auto calc(72px + env(safe-area-inset-bottom)); }
}
@media (max-height:475px) {
  header { padding-top: calc(5px + env(safe-area-inset-top)); }
  .wordmark { width: 95px; }
  .brand-stack { display: flex; align-items: center; gap: 12px; }
  .slogan { margin: 0; }
  #reviewPreview { margin: auto; max-height: 76dvh; }
}
.review-prose { white-space: pre-line; }
.cloud-status { position:absolute; z-index:4; left:12px; top:12px; max-width:calc(100% - 24px); background:var(--cream); border-radius:10px; padding:8px 12px; font-size:14px; }
