:root {
  --brand: #ff7a59;
  --brand-ink: #c2492b;
  --ink: #2b2433;
  --muted: #6f6878;
  --paper: #ffffff;
  --cream: #fff8f3;
  --line: #efe6df;
  --yes: #1f9d6b;
  --no: #d0453a;
  --unk: #a39cab;
  --shadow: 0 6px 24px rgba(43, 36, 51, .16);
  --r: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  overflow: hidden;
}
#map { position: fixed; inset: 0; }

/* ---------- top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: max(10px, env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.bar { display: flex; gap: 10px; align-items: center; max-width: 720px; }
.brand {
  display: flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--brand); color: #fff; padding: 9px 14px 9px 10px;
  border-radius: 999px; box-shadow: var(--shadow); flex: none;
}
.brand .logo { font-size: 20px; line-height: 1; }
.brand .word { font-weight: 900; font-size: 19px; letter-spacing: -.3px; }
.search { position: relative; flex: 1; min-width: 0; }
#q {
  width: 100%; font: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 16px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow); outline: none;
}
#q:focus { box-shadow: var(--shadow), 0 0 0 3px rgba(255, 122, 89, .35); }
#results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px;
  list-style: none; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto;
}
#results li {
  padding: 9px 10px; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center;
}
#results li:hover, #results li.on { background: var(--cream); }
#results .ic { font-size: 18px; width: 22px; text-align: center; }
#results .sub { color: var(--muted); font-size: 12.5px; font-weight: 600; }
#results .t { font-weight: 800; font-size: 14.5px; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 800; font-size: 13.5px; color: var(--ink);
  background: var(--paper); border: 2px solid transparent; border-radius: 999px;
  padding: 7px 12px 7px 9px; box-shadow: 0 2px 10px rgba(43, 36, 51, .12); cursor: pointer;
}
.chip .e { font-size: 16px; line-height: 1; }
.chip .c { color: var(--muted); font-weight: 700; font-size: 12px; }
.chip.on { background: var(--chip, var(--brand)); color: #fff; }
.chip.on .c { color: rgba(255, 255, 255, .85); }

/* ---------- near me ---------- */
.fab {
  position: fixed; right: 12px; bottom: 44px; z-index: 4;
  font: inherit; font-weight: 800; font-size: 14px; color: var(--ink);
  background: var(--paper); border: 0; border-radius: 999px; padding: 11px 16px;
  box-shadow: var(--shadow); cursor: pointer;
}
.fab:active { transform: scale(.97); }

/* ---------- place card (bottom sheet on phones, side card on desktop) ---------- */
.card {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(43, 36, 51, .18);
  padding: 8px 18px max(18px, env(safe-area-inset-bottom));
  max-height: 72vh; overflow: auto;
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.card .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 2px auto 10px; }
.card .x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--cream); font-size: 18px; cursor: pointer; color: var(--muted);
}
.card .head { display: flex; gap: 12px; align-items: center; padding-right: 40px; }
.card .badge {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; flex: none; color: #fff;
}
.card h2 { margin: 0; font-size: 19px; font-weight: 900; line-height: 1.2; }
.card .kind { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 2px; }
.facts { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 2px; }
.facts li {
  display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start;
  padding: 8px 10px; border-radius: 12px; font-size: 14.5px; font-weight: 700;
}
.facts li:nth-child(odd) { background: var(--cream); }
.facts .m { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 900; }
.facts .yes .m { background: var(--yes); }
.facts .no .m { background: var(--no); }
.facts .unk .m { background: var(--unk); }
.facts .unk { color: var(--muted); }
.facts small { display: block; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.meta { color: var(--muted); font-size: 13px; font-weight: 600; margin: 8px 2px; line-height: 1.45; }
.meta a { color: var(--brand-ink); }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 130px; text-align: center; text-decoration: none; cursor: pointer;
  font: inherit; font-weight: 900; font-size: 15px; padding: 12px 14px; border-radius: 14px; border: 0;
  background: var(--brand); color: #fff;
}
.btn.ghost { background: var(--cream); color: var(--ink); }
.check {
  margin-top: 14px; padding: 12px; border-radius: 14px; border: 2px dashed var(--line);
  font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.check span { flex: 1; min-width: 150px; }
.check button {
  font: inherit; font-size: 18px; border: 0; border-radius: 12px; padding: 7px 14px;
  background: var(--cream); cursor: pointer;
}
.check.done { border-style: solid; border-color: var(--yes); color: var(--yes); }
.src { color: var(--unk); font-size: 11.5px; font-weight: 700; margin-top: 12px; }

/* ---------- demo note ---------- */
.demo-note {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 8px; z-index: 3;
  background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap;
  box-shadow: 0 2px 8px rgba(43, 36, 51, .1); max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis;
}
.demo-note b { color: var(--brand-ink); }

.maplibregl-ctrl-bottom-right { bottom: 92px; }
.maplibregl-ctrl-attrib { font-family: Nunito, sans-serif; font-size: 10.5px; }

@media (min-width: 760px) {
  .card {
    left: 14px; right: auto; top: 128px; bottom: auto; width: 380px;
    border-radius: var(--r); max-height: calc(100vh - 150px);
    box-shadow: var(--shadow); animation: none;
  }
  .card .grab { display: none; }
  .fab { bottom: 44px; }
}

/* ---------- you are here + messages ---------- */
.me {
  width: 18px; height: 18px; border-radius: 50%; background: #2f6fd1;
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 111, 209, .22), 0 2px 6px rgba(0, 0, 0, .25);
}
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 9;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px;
  padding: 10px 16px; border-radius: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}

.where {
  display: inline-flex; align-items: center; gap: 8px; margin: -4px 2px 0;
  background: rgba(255, 255, 255, .95); border-radius: 999px; padding: 5px 6px 5px 12px;
  font-size: 12.5px; font-weight: 800; color: var(--brand-ink); box-shadow: 0 2px 10px rgba(43, 36, 51, .12);
}
.where:empty { display: none; }
.where span:only-child { padding-right: 6px; }
.where button {
  font: inherit; font-size: 12px; border: 0; border-radius: 999px; padding: 5px 10px;
  background: var(--brand); color: #fff; cursor: pointer;
}
@media (max-width: 420px) { .brand .word { font-size: 17px; } }

/* ---------- tapped place ---------- */
.pulse { width: 18px; height: 18px; pointer-events: none; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -38px 0 0 -32px;
  border-radius: 50%; border: 3px solid var(--brand); opacity: 0;
}
.pulse.go::before { animation: ring 1.1s ease-out 2; }
.pulse.go::after { animation: ring 1.1s ease-out .35s 2; }
@keyframes ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- card additions ---------- */
.card .tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: #4a4452; color: #fff; font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.card .hours { margin-top: 4px; font-size: 13px; font-weight: 800; }
.card .hours.open { color: var(--yes); }
.card .hours.shut { color: var(--no); }
.foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.foot .check { flex: 1; margin: 0; }
.mini {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--cream); color: var(--ink); font-size: 19px; font-weight: 900; cursor: pointer; text-decoration: none;
}
.mini:hover { background: var(--line); }
.foot .check { flex-wrap: nowrap; padding: 6px 6px 6px 12px; gap: 6px; font-size: 13px; }
.foot .check span { min-width: 0; flex: 1; line-height: 1.2; }
.foot .check button { font-size: 16px; padding: 6px 9px; }
.pulse::before, .pulse::after { margin: -32px 0 0 -32px; }

.facts .dishes { display: block; margin-top: 3px; color: var(--ink); font-weight: 700; font-size: 12.5px; }
.facts small a { color: var(--brand-ink); font-weight: 800; }

/* ---------- silhouette icons ---------- */
.ico { width: 1em; height: 1em; display: block; }
.chip .e { font-size: 19px; color: var(--chip); }
.chip.on .e { color: #fff; }
.chip { padding: 8px 14px 8px 11px; font-size: 14px; }
.card .badge { font-size: 28px; }

@media (max-width: 420px) {
  .chips { gap: 6px; }
  .chip { padding: 7px 11px 7px 9px; font-size: 13.5px; gap: 5px; }
  .chip .c { display: none; }   /* three categories fit across a phone without the counts */
}
