:root {
  --cream: #f3e8ce;
  --cream-2: #fbf5e7;
  --ink: #17201b;
  --green: #1a633e;
  --green-dark: #10452d;
  --tomato: #e25a3f;
  --cheese: #f0bc36;
  --ocean: #2c8796;
  --brown: #9e5e2f;
  --line: rgba(23, 32, 27, .3);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  --sans: Inter, "Avenir Next", system-ui, -apple-system, sans-serif;
  --serif: "Iowan Old Style", Baskerville, Georgia, serif;
  --bar-height: 72px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--cream); font-family: var(--sans); }
button, select { color: inherit; font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  padding: 12px 16px; background: white; border: 2px solid var(--ink);
}
.skip-link:focus { top: 12px; }

#map { position: fixed; inset: var(--bar-height) 0 0; }
#map .maplibregl-canvas {
  filter: sepia(.16) saturate(.68) contrast(.94) brightness(1.05);
}
.map-wash {
  position: fixed; inset: var(--bar-height) 0 0; z-index: 1; pointer-events: none;
  background: rgba(243, 232, 206, .09);
  box-shadow: inset 0 0 110px rgba(23, 32, 27, .1);
  mix-blend-mode: multiply;
}
.map-wash::after {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.authority-bar {
  position: fixed; inset: 0 0 auto; height: var(--bar-height); z-index: 20;
  padding: 0 clamp(18px, 3.25vw, 52px); display: grid;
  grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--cream); border-bottom: 1px solid var(--ink);
}
.wordmark { display: inline-flex; align-items: center; gap: 11px; width: max-content; text-decoration: none; font-weight: 750; letter-spacing: -.035em; }
.wordmark-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1.5px solid currentColor; border-radius: 50%;
  font: 500 10px/1 var(--mono); letter-spacing: -.08em;
}
.desk-status { display: flex; align-items: center; gap: 12px; font: 500 9px/1 var(--mono); letter-spacing: .12em; }
.desk-status i { width: 38px; height: 1px; background: currentColor; opacity: .45; }
.bar-actions { justify-self: end; display: flex; align-items: center; }
.language-label { margin-right: 6px; opacity: .55; font: 500 8px/1 var(--mono); letter-spacing: .12em; }
#lang-select {
  height: 34px; min-width: 54px; padding: 0 8px; background: transparent;
  border: 1px solid var(--ink); border-radius: 0; font: 600 10px/1 var(--mono);
}
.storefront-link {
  height: 34px; margin-left: 8px; padding: 0 12px; display: inline-flex;
  align-items: center; gap: 16px; background: var(--ink); color: var(--cream-2);
  text-decoration: none; font: 600 10px/1 var(--mono); letter-spacing: .08em;
}

.map-interface { position: fixed; inset: var(--bar-height) 0 0; z-index: 5; pointer-events: none; }
.map-interface > * { pointer-events: auto; }
.map-dossier {
  position: absolute; left: clamp(18px, 3.25vw, 52px); top: 34px; width: min(410px, calc(100vw - 36px));
  padding: 22px 24px 20px; background: rgba(251, 245, 231, .94);
  border: 1.5px solid var(--ink); box-shadow: 7px 7px 0 rgba(23, 32, 27, .15);
  backdrop-filter: blur(7px);
}
.mobile-brand { display: none; }
.eyebrow { margin: 0 0 16px; display: flex; align-items: center; gap: 9px; font: 500 9px/1.4 var(--mono); letter-spacing: .12em; }
.eyebrow > span { width: 24px; height: 1px; background: currentColor; }
.map-dossier h1 {
  margin: 0 0 16px; font: 700 clamp(40px, 4vw, 58px)/.86 var(--serif);
  letter-spacing: -.055em;
}
.map-dossier h1 em { color: var(--tomato); font-weight: inherit; }
#tagline { margin: 0; max-width: 340px; font-size: 13px; line-height: 1.52; }
#locate-btn, #share-btn, .official-link {
  width: 100%; min-height: 49px; margin-top: 18px; padding: 0 15px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green); color: white; border: 1.5px solid var(--green);
  border-radius: 0; text-decoration: none; cursor: pointer; font-size: 12px; font-weight: 750;
  transition: transform .18s ease, background .18s ease;
}
#locate-btn:hover, #share-btn:hover, .official-link:hover { transform: translateY(-2px); }
#locate-btn:focus-visible, #share-btn:focus-visible, .storefront-link:focus-visible, #lang-select:focus-visible { outline: 3px solid var(--cheese); outline-offset: 3px; }
#locate-btn::after { content: "◎"; font-size: 18px; font-weight: 400; }
#share-btn::after { content: "↗"; font-size: 15px; font-weight: 500; }
.target-mark { font-size: 18px; font-weight: 400; }
.permission-note { margin: 9px 0 0; opacity: .54; font: 400 8px/1.5 var(--mono); letter-spacing: .04em; }

.map-instruction {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(23, 32, 27, .72); font: 500 8px/1 var(--mono); letter-spacing: .11em;
}
.map-instruction i { height: 33px; width: 1px; background: currentColor; position: relative; }
.map-instruction i::after { content: ""; position: absolute; left: -3px; bottom: 0; width: 6px; height: 6px; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); }

.map-key {
  position: absolute; left: clamp(18px, 3.25vw, 52px); bottom: 28px; width: min(330px, calc(100vw - 36px));
  background: rgba(251, 245, 231, .94); border: 1.5px solid var(--ink);
  backdrop-filter: blur(7px);
}
.key-heading { padding: 12px 14px 11px; border-bottom: 1px solid var(--line); font: 700 13px/1 var(--sans); letter-spacing: -.02em; }
.key-row { min-height: 30px; padding: 0 14px; display: grid; grid-template-columns: 13px 25px 1fr; align-items: center; border-bottom: 1px solid rgba(23,32,27,.13); font-size: 10px; }
.key-row:last-child { border-bottom: 0; }
.key-row b { font: 500 8px/1 var(--mono); opacity: .48; }
.swatch { width: 8px; height: 8px; border: 1px solid var(--ink); }
.key-row.exact .swatch { background: #77a65e; }
.key-row.deli .swatch { background: var(--cheese); }
.key-row.sloppy .swatch { background: #c6b06a; }
.key-row.ocean .swatch { background: #a8d1d5; }

.verdict-card {
  position: absolute; right: clamp(18px, 3.25vw, 52px); top: 34px;
  width: min(390px, calc(100vw - 36px)); padding: 18px;
  background: var(--cream-2); border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(23,32,27,.17); overflow: hidden;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
  will-change: transform;
}
.verdict-card.is-dragging { transition: none; }
.sheet-grabber { display: none; }
.verdict-card::before { content: ""; position: absolute; right: -85px; bottom: -85px; width: 210px; height: 210px; border: 1px solid rgba(23,32,27,.12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(23,32,27,.025), 0 0 0 52px rgba(23,32,27,.018); pointer-events: none; }
.verdict-kicker { display: flex; justify-content: space-between; padding: 0 30px 11px 0; border-bottom: 1px solid var(--line); font: 500 8px/1 var(--mono); letter-spacing: .1em; }
#card-close { position: absolute; right: 12px; top: 9px; z-index: 2; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; font: 300 24px/1 var(--sans); }
#card-body { position: relative; z-index: 1; }
#card h2 { margin: 16px 46px 8px 0; font: 700 40px/.9 var(--serif); letter-spacing: -.05em; }
#card p { margin: 9px 0; font-size: 12px; line-height: 1.5; }
#card p.big { font-weight: 750; }
#card p.muted { font: 500 9px/1.45 var(--mono); letter-spacing: .025em; opacity: .58; }
#card table { position: relative; z-index: 1; width: 100%; margin: 15px 0 0; border-collapse: collapse; border-top: 1px solid var(--line); font-size: 10.5px; }
#card tr { border-bottom: 1px solid rgba(23,32,27,.14); }
#card td { padding: 7px 0; vertical-align: top; line-height: 1.35; }
#card td:first-child { width: 33%; padding-right: 10px; color: inherit; font: 500 8px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; opacity: .55; }
.verdict-stamp { position: absolute; right: 22px; top: 65px; width: 58px; height: 58px; display: grid; place-content: center; text-align: center; border: 1.5px solid var(--tomato); border-radius: 50%; color: var(--tomato); transform: rotate(9deg); pointer-events: none; }
.verdict-stamp::after { content: ""; position: absolute; inset: 5px; border: 1px dashed; border-radius: 50%; }
.verdict-stamp span { font: 700 15px/.9 var(--serif); }
.verdict-stamp small { font: 500 6px/1 var(--mono); letter-spacing: .08em; }
#share-btn { position: relative; z-index: 1; margin-top: 14px; min-height: 46px; background: var(--ink); border-color: var(--ink); }
.official-link { position: relative; z-index: 1; min-height: 42px; margin-top: 12px; background: transparent; color: var(--ink); border-color: var(--ink); font-size: 10px; }

#toast { position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 36px)); padding: 12px 18px; background: var(--ink); color: var(--cream-2); border: 1px solid var(--cream-2); font: 500 10px/1.4 var(--mono); text-align: center; }
#attrib { position: fixed; z-index: 8; right: 10px; bottom: 5px; max-width: calc(100vw - 380px); padding: 3px 5px; background: rgba(251,245,231,.76); font: 500 7px/1.3 var(--mono); letter-spacing: .02em; }
#attrib span { letter-spacing: .08em; }
#attrib a { text-underline-offset: 2px; }

.maplibregl-ctrl-top-right { display: none; }
.maplibregl-ctrl-group { border: 1.5px solid var(--ink); border-radius: 0; box-shadow: 4px 4px 0 rgba(23,32,27,.16); overflow: hidden; }
.maplibregl-ctrl-group button { width: 34px; height: 34px; background-color: var(--cream-2); border-radius: 0 !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--ink); }
.maplibregl-ctrl-icon { filter: sepia(1) saturate(.15) brightness(.45); }
.bread-marker {
  font-size: 26px; line-height: 1; cursor: default;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}
.verified-marker {
  font-size: 22px; line-height: 1; cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}

.lobby-fab {
  position: fixed; z-index: 30; right: 18px; bottom: 30px; width: 58px; height: 58px;
  display: block; padding: 0; overflow: hidden; border: 2px solid rgba(251,245,231,.94);
  border-radius: 50%; background: var(--green); box-shadow: none; text-decoration: none;
  transition: transform .2s ease, bottom .24s cubic-bezier(.2,.8,.2,1);
}
.lobby-fab:hover { transform: scale(1.05); }
.lobby-fab:focus-visible { outline: 3px solid var(--cheese); outline-offset: 4px; }
.lobby-fab img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 960px) {
  .authority-bar { grid-template-columns: 1fr auto; }
  .desk-status { display: none; }
  .map-instruction { display: none; }
  .map-dossier { width: 350px; }
  .map-dossier h1 { font-size: 44px; }
  .verdict-card { width: 350px; }
}

@media (max-width: 700px) {
  :root { --bar-height: 0px; }
  .authority-bar { display: none; }
  .map-dossier { left: 10px; top: 10px; width: calc(100vw - 20px); padding: 11px 12px 12px; box-shadow: 4px 4px 0 rgba(23,32,27,.15); transition: transform .24s ease, opacity .18s ease; }
  .mobile-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
  .mobile-brand strong { font-size: 13px; letter-spacing: -.035em; }
  .mobile-brand span { opacity: .52; font: 500 6px/1 var(--mono); letter-spacing: .08em; }
  .eyebrow { display: none; }
  .map-dossier h1 { margin-bottom: 7px; font-size: clamp(25px, 7.2vw, 30px); line-height: .88; }
  #tagline { display: none; }
  #locate-btn { min-height: 36px; margin-top: 9px; padding: 0 11px; font-size: 10px; }
  #locate-btn::after { font-size: 15px; }
  .permission-note { display: none; }
  .map-key { left: 10px; bottom: 12px; width: 174px; transition: transform .24s ease, opacity .18s ease; }
  .key-heading { padding: 8px 9px 7px; font-size: 10px; }
  .key-row { min-height: 22px; padding: 0 9px; grid-template-columns: 11px 20px 1fr; font-size: 7.5px; }
  .key-row b { font-size: 6.5px; }
  .swatch { width: 7px; height: 7px; }
  body.verdict-open .map-dossier { opacity: 0; transform: translateY(calc(-100% - 18px)); pointer-events: none; }
  body.verdict-open .map-key { opacity: 0; transform: translateY(calc(100% + 18px)); pointer-events: none; }
  .verdict-card { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 44svh; overflow-y: auto; overscroll-behavior: contain; padding: 7px 13px 13px; border-width: 2px 0 0; box-shadow: 0 -5px 0 rgba(23,32,27,.11); }
  .sheet-grabber { position: sticky; top: -7px; z-index: 5; width: 72px; height: 25px; margin: 0 auto 1px; display: grid; place-items: center; background: var(--cream-2); cursor: grab; touch-action: none; }
  .sheet-grabber span { width: 38px; height: 4px; border-radius: 999px; background: var(--ink); opacity: .32; }
  .verdict-card.is-dragging .sheet-grabber { cursor: grabbing; }
  .verdict-kicker { padding-bottom: 8px; font-size: 7px; }
  .verdict-kicker { cursor: grab; touch-action: none; }
  #card-close { top: 20px; }
  #card h2 { margin-top: 12px; font-size: 30px; }
  #card p { margin: 6px 0; font-size: 10.5px; }
  #card table { margin-top: 10px; font-size: 9.5px; }
  #card td { padding: 5px 0; }
  .verdict-stamp { top: 51px; right: 18px; width: 50px; height: 50px; }
  #share-btn { min-height: 40px; margin-top: 10px; }
  #attrib { display: none; }
  .lobby-fab { right: 10px; bottom: 12px; width: 48px; height: 48px; box-shadow: none; }
  body.verdict-open .lobby-fab { bottom: calc(44svh + 12px); }
}

@media (max-height: 700px) and (min-width: 701px) {
  .map-dossier { top: 18px; padding: 16px 18px; }
  .map-dossier h1 { font-size: 42px; margin-bottom: 10px; }
  .eyebrow { margin-bottom: 10px; }
  #locate-btn { margin-top: 12px; min-height: 43px; }
  .map-key { bottom: 18px; }
  .verdict-card { top: 18px; max-height: calc(100vh - var(--bar-height) - 36px); overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
