:root {
  --ink: #202124;
  --muted: #5f6368;
  --line: #e8eaed;
  --chip: #f1f3f4;
  --blue: #1a73e8;
  --blue-ink: #174ea6;
  --blue-wash: #e8f0fe;
  --green: #137333;
  --red: #d93025;
  --star: #e37400;
  --pin: #ea4335;
  --sheet: #ffffff;
  font-family: Roboto, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #e5e3df;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.map-stage {
  position: fixed;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 72px;
  left: 560px;
  overflow: hidden;
  background: #e8e6e1;
  cursor: grab;
  touch-action: none;
}
.map-stage.is-drag { cursor: grabbing; }
.map-world { position: absolute; inset: 0; transform-origin: 0 0; }
.basemap { position: absolute; inset: -20%; background: #e4e2dc; }
.water { position: absolute; background: #a7d4f7; }
.w1 { right: -4%; top: 8%; width: 28%; height: 78%; border-radius: 40% 0 0 46%; }
.w2 { left: -8%; top: 0; width: 16%; height: 70%; border-radius: 0 40% 40% 0; }
.park { position: absolute; background: #9ed29a; }
.p1 { width: 18%; height: 14%; left: 16%; top: 16%; border-radius: 46% 40% 50% 42%; }
.p2 { width: 16%; height: 11%; left: 30%; top: 62%; border-radius: 40%; }
.p3 { width: 12%; height: 9%; right: 22%; top: 28%; border-radius: 50%; }
.p4 { width: 10%; height: 8%; left: 48%; bottom: 18%; border-radius: 40% 50%; }
.block { position: absolute; background: #d9d6cf; border-radius: 2px; }
.b1 { left: 20%; top: 34%; width: 7%; height: 5%; }
.b2 { left: 29%; top: 34%; width: 5%; height: 8%; }
.b3 { left: 36%; top: 52%; width: 8%; height: 4%; }
.b4 { left: 52%; top: 40%; width: 6%; height: 6%; }
.b5 { left: 60%; top: 58%; width: 9%; height: 4%; }
.b6 { left: 18%; top: 70%; width: 6%; height: 7%; }
.road { position: absolute; background: #fff; }
.h1, .h2, .h3, .h4 { left: 0; right: 0; }
.h1 { top: 22%; height: 14px; }
.h2 { top: 46%; height: 16px; }
.h3 { top: 68%; height: 10px; background: #f4f2ee; }
.h4 { top: 84%; height: 8px; background: #f4f2ee; }
.v1, .v2, .v3, .v4 { top: 0; bottom: 0; }
.v1 { left: 18%; width: 12px; }
.v2 { left: 42%; width: 16px; }
.v3 { left: 64%; width: 10px; background: #f4f2ee; }
.v4 { left: 78%; width: 8px; background: #f4f2ee; }
.area { position: absolute; color: #6d6860; font-size: 20px; font-weight: 500; }
.a1 { left: 22%; top: 8%; }
.a2 { left: 28%; top: 52%; }
.a3 { right: 18%; top: 18%; }
.a4 { left: 48%; top: 6%; }
.street { position: absolute; color: #8a847a; font-size: 11px; }
.s1 { left: 20%; top: 20%; }
.s2 { left: 30%; top: 44%; }
.s3 { right: 16%; top: 66%; }
.place-label { position: absolute; color: #2f6b32; font-size: 11px; font-weight: 500; }
.l1 { left: 18%; top: 20%; }
.l2 { left: 32%; top: 66%; }
.l3 { right: 8%; top: 40%; color: #1a73e8; }
.here {
  position: absolute;
  left: 24%;
  top: 30%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #174ea6;
  font-size: 12px;
  font-weight: 500;
}
.here-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1a73e8;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.28);
}
.map-ui {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.map-ui button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(60, 64, 67, 0.3);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}
.map-ui button:hover { background: var(--chip); }
.map-ui button:active { transform: scale(0.96); }
.map-ui p { margin: 0; font-size: 12px; color: var(--muted); background: #fff; border-radius: 8px; padding: 4px 8px; }

.sheet {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  min-height: 100dvh;
  background: var(--sheet);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px rgba(60, 64, 67, 0.15);
}
.board { padding: 12px 12px 96px; }

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px rgba(60, 64, 67, 0.15);
  padding: 6px 8px 6px 14px;
  position: sticky;
  top: 12px;
  z-index: 4;
  transition: box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.searchbar:hover,
.searchbar:focus-within {
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.28), 0 8px 20px rgba(26, 115, 232, 0.12);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
}
.pin {
  width: 18px;
  height: 18px;
  background: var(--pin);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: inset 0 0 0 4px #fff;
}
.search { flex: 1; position: relative; }
.search input {
  width: 100%;
  height: 40px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  font-size: 16px;
}
.search input:focus { outline: none; }
.top-note { margin: 12px 6px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.stats div { background: var(--chip); border-radius: 8px; padding: 8px 6px; min-width: 0; }
.stats dt { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 11px; }
.stats dt span { min-width: 0; }
.stats svg, .addr svg, .facts svg { width: 14px; height: 14px; flex: none; color: var(--blue); }
.stats dd { margin: 2px 0 0; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }

.filters { display: grid; gap: 10px; }
.filters label:not(.search):not(.check), .filters fieldset { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pickers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 10px;
}
.pickers label { gap: 6px; }
.filters span, .filters legend { font-size: 12px; color: var(--muted); font-weight: 500; }
.filters select {
  height: 44px;
  width: 100%;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 L6 6.5 L11 1.5' fill='none' stroke='%231a73e8' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding: 0 34px 0 12px;
  appearance: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.pickers label:hover select {
  border-color: var(--blue);
  background-color: #f8fbff;
  box-shadow: 0 1px 4px rgba(26, 115, 232, 0.18);
}
.filters select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #d2e3fc;
  background-color: #fff;
}
.filters select:active { transform: scale(0.99); }
.filters fieldset {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
}
.filters legend { width: 100%; padding: 0; }
.check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
}
.check input { accent-color: var(--blue); }
.check:hover { background: #f8f9fa; }
.check:has(input:checked) { background: var(--blue-wash); color: var(--blue-ink); border-color: transparent; }
.check:has(input:checked):hover { background: #d2e3fc; }
.filter-end, .result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.views {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.16);
}
.views button, .text-btn, .close, .pager button, .card, .table button { border: 0; background: transparent; appearance: none; }
.views button {
  border-radius: 8px;
  padding: 8px 16px;
  color: #3c4043;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.views button:hover {
  background: var(--blue-wash);
  color: var(--blue-ink);
}
.views button:active { transform: scale(0.97); }
.views button[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(26, 115, 232, 0.4);
}
.views button[aria-pressed="true"]:hover { background: #174ea6; color: #fff; }
.text-btn { color: var(--blue); font-weight: 500; }
.result-bar p { margin: 0; font-size: 14px; color: var(--muted); }

.cards { display: flex; flex-direction: column; }
.card {
  position: relative;
  text-align: left;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  width: 100%;
  transition: background 160ms ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(140px circle at var(--x, 50%) var(--y, 40%), rgba(26, 115, 232, 0.12), transparent 68%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.card:hover { background: #f8f9fa; }
.card:hover::after { opacity: 1; }
.card:active { transform: scale(0.99); }
.shot {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eaed;
}
.shot-img {
  width: 100%;
  height: 100%;
  background: #e8eaed center/cover no-repeat;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .shot-img { transform: scale(1.08); }
.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card h2 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.25; }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.addr { display: flex; align-items: flex-start; gap: 4px; }
.addr svg { margin-top: 2px; }
.rate { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.stars { color: #dadce0; letter-spacing: 1px; font-style: normal; }
.stars .on { color: var(--star); }
.open { color: var(--green); font-weight: 500; }
.closed, .warn { color: var(--red); font-weight: 500; }
.bars { display: flex; height: 4px; border-radius: 99px; overflow: hidden; background: #e8eaed; margin-top: 4px; }
.bars i { display: block; height: 100%; }
.bars .s5 { background: #137333; }
.bars .s4 { background: #1e8e3e; }
.bars .s3 { background: #f9ab00; }
.bars .s2 { background: #e37400; }
.bars .s1 { background: #d93025; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.hit { cursor: pointer; }
tr.hit:hover td { background: #f8f9fa; }
.table-wrap button {
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--blue);
  text-align: left;
  background: var(--blue-wash);
  appearance: none;
}
.table-wrap button:hover { background: #d2e3fc; }

.json-box, .raw {
  margin: 0;
  background: #202124;
  color: #e8eaed;
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.json-box { max-height: 640px; overflow: auto; }
.json-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.pager button {
  min-width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid #dadce0;
  background: #fff;
  color: var(--blue);
}
.pager button[aria-current="page"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.empty { padding: 32px 8px; color: var(--muted); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(32, 33, 36, 0.32);
}
.drawer[hidden] { display: none; }
.drawer-panel {
  width: min(420px, 100%);
  height: 100%;
  overflow: auto;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60, 64, 67, 0.28);
  animation: sheet-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheet-in {
  from { transform: translateX(-16px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.close {
  position: sticky;
  top: 8px;
  margin: 8px 8px 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
  font-size: 0;
}
.close::before { content: "×"; font-size: 22px; color: var(--ink); line-height: 1; }
#drawer-body { padding: 0 16px 32px; }
.hero-shot { height: 200px; margin: 0 -16px 14px; overflow: hidden; background: #e8eaed; }
.hero-shot .shot-img { height: 200px; }
.drawer h2 { margin: 0; font-size: 26px; font-weight: 400; line-height: 1.15; }
.kicker { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 8px; margin: 14px 0; }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.action { transition: background 160ms ease, transform 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.action:hover { background: #174ea6; transform: translateY(-1px); }
.action:active { transform: scale(0.98); }
.close { transition: transform 160ms ease, background 160ms ease; }
.close:hover { background: var(--chip); transform: scale(1.06); }
.pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ticker {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  background: linear-gradient(90deg, #e8f0fe 0%, #e6f4ea 34%, #fef7e0 68%, #fce8e6 100%);
  border-top: 1px solid #d2e3fc;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.ticker-track {
  display: flex;
  gap: 10px;
  width: max-content;
  padding-left: 10px;
  animation: tick 70s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 230px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 12px;
  text-align: left;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}
.tick.c1 { background: #e6f4ea; border-color: #137333; }
.tick.c2 { background: #e8f0fe; border-color: #1a73e8; }
.tick.c3 { background: #fef7e0; border-color: #e37400; }
.tick.c4 { background: #fce8e6; border-color: #d93025; }
.tick strong { font-size: 13px; font-weight: 500; color: #202124; }
.tick span { font-size: 12px; }
.tick.c1 span { color: #0d652d; }
.tick.c2 span { color: #174ea6; }
.tick.c3 span { color: #b06000; }
.tick.c4 span { color: #c5221f; }
@keyframes tick { to { transform: translateX(-50%); } }
.mappin {
  position: absolute;
  width: 28px;
  height: 36px;
  margin: -34px 0 0 -14px;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 2px 2px rgba(60, 64, 67, 0.35));
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mappin::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  background: var(--pin);
  transform: rotate(-45deg);
  box-shadow: inset 0 0 0 2px #fff;
}
.mappin::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.mappin.good::before { background: #137333; }
.mappin.mid::before { background: #1a73e8; }
.mappin.fair::before { background: #e37400; }
.mappin:hover,
.mappin.is-hot { transform: translateY(-4px) scale(1.08); z-index: 4; }
.pin-card {
  position: fixed;
  z-index: 8;
  width: 248px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 8px 20px rgba(60, 64, 67, 0.18);
  pointer-events: none;
}
.pin-card[hidden] { display: none; }
.pin-card .shot { width: 76px; height: 76px; }
.pin-card h3 { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.25; }
.pin-card p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.facts { display: grid; gap: 8px; margin: 8px 0 16px; font-size: 14px; }
.facts a, .facts p { margin: 0; }
.facts p { display: flex; align-items: flex-start; gap: 6px; }
.facts svg { margin-top: 2px; }
.facts strong { flex: none; }
.facts a { color: var(--blue); }
.hours { list-style: none; padding: 0; margin: 8px 0 0; }
.hours li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags span { background: var(--chip); border-radius: 999px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.raw { margin-top: 16px; max-height: 240px; overflow: auto; }

@media (max-width: 900px) {
  .map-stage { position: relative; left: 0; height: 46dvh; bottom: auto; }
  .sheet { width: 100%; min-height: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .filter-end, .result-bar { flex-direction: column; align-items: flex-start; }
  .searchbar { top: 8px; }
}
@media (max-width: 520px) {
  .pickers { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .shot-img, .searchbar, .action, .close, .mappin, .card::after, .map-ui button, .filters select { transition: none; }
  .drawer-panel, .ticker-track { animation: none; }
  .card:hover .shot-img, .action:hover { transform: none; }
  .mappin:hover, .mappin.is-hot { transform: none; }
  .ticker { overflow-x: auto; }
}
