/* BabyMapper: a calm, grown-up map for parents. Neutral chrome, one coral accent,
   colour only where it carries meaning (open/closed, yes/no, the pins themselves). */
:root {
  --accent: #e8664a;
  --accent-ink: #b8462d;
  --ink: #1f1d24;
  --muted: #6b6873;
  --faint: #9a97a1;
  --paper: #ffffff;
  --soft: #f5f4f2;
  --line: #e6e4e1;
  --yes: #1e8a5a;
  --no: #c4412f;
  --shadow: 0 1px 2px rgba(20, 18, 26, .08), 0 4px 14px rgba(20, 18, 26, .10);
  --r: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--soft); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#map { position: fixed; inset: 0; }

/* ---------- top: wordmark + search, then the three filters ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: max(8px, env(safe-area-inset-top)) 10px 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.bar { display: flex; gap: 8px; align-items: center; max-width: 640px; }
.brand {
  flex: none; display: flex; align-items: center; height: 38px; padding: 0 12px;
  background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: -.2px;
}
.brand b { font-weight: 700; }
.brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 3px; align-self: center; transform: translateY(-5px); }
.search { position: relative; flex: 1; min-width: 0; }
#q {
  width: 100%; height: 38px; font: inherit; font-size: 15px; font-weight: 400;
  padding: 0 14px; border: 0; border-radius: var(--r);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow); outline: none;
}
#q::placeholder { color: var(--faint); }
#q:focus { box-shadow: var(--shadow), 0 0 0 2px rgba(232, 102, 74, .35); }
#results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 4px;
  list-style: none; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto;
}
#results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
#results li:hover, #results li.on { background: var(--soft); }
#results .ic { font-size: 16px; width: 20px; text-align: center; }
#results .t { font-weight: 600; font-size: 14px; }
#results .sub { color: var(--muted); font-size: 12px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 8px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 1px 2px rgba(20, 18, 26, .06); cursor: pointer;
}
.chip .e { font-size: 15px; line-height: 1; opacity: .45; filter: grayscale(1); }
.chip .c { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip.on { color: var(--ink); border-color: var(--ink); background: var(--paper); }
.chip.on .e { opacity: 1; filter: none; }
@media (max-width: 420px) { .chip .c { display: none; } }

/* ---------- where the 10-minute ring is (bottom left) ---------- */
.where {
  position: fixed; left: 10px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 4;
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 10px;
  background: rgba(255, 255, 255, .95); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 500; color: var(--muted); max-width: calc(100% - 70px);
}
.where:empty { display: none; }
.where span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where button {
  flex: none; height: 24px; border: 0; border-radius: 999px; padding: 0 9px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; background: var(--ink); color: #fff;
}
.where span:only-child { padding-right: 8px; }

.maplibregl-ctrl-bottom-right { bottom: 8px; }
.maplibregl-ctrl-attrib { font-family: Inter, sans-serif; font-size: 10px; }

/* ---------- 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: 16px 16px 0 0; box-shadow: 0 -4px 24px rgba(20, 18, 26, .16);
  padding: 6px 16px max(14px, env(safe-area-inset-bottom)); max-height: 70vh; overflow: auto;
  animation: up .16s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.card .grab { width: 36px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 10px; }
.card .x {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--soft); color: var(--muted); font-size: 15px; cursor: pointer;
}
.card .head { display: flex; gap: 12px; align-items: center; padding-right: 36px; }
.card .badge {
  width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--soft); font-size: 24px;
}
.card .badge.private { filter: grayscale(1); opacity: .6; }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.2px; }
.card .kind { color: var(--muted); font-size: 13px; margin-top: 1px; }
.card .tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 6px;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.card .hours { margin-top: 3px; font-size: 13px; font-weight: 600; }
.card .hours.open { color: var(--yes); }
.card .hours.shut { color: var(--no); }

.facts { list-style: none; margin: 12px 0 4px; padding: 0; }
.facts li {
  display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500;
}
.facts .m { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700; }
.facts .yes .m { background: var(--yes); }
.facts .no .m { background: var(--no); }
.facts small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 1px; line-height: 1.4; }
.facts .dishes { display: block; margin-top: 3px; color: var(--ink); font-size: 12.5px; }
.facts small a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.meta { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; line-height: 1.45; }
.meta a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }

.foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check {
  flex: 1; display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 4px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--muted);
}
.check span { flex: 1; min-width: 0; }
.check button { border: 0; background: none; font-size: 17px; padding: 4px 6px; cursor: pointer; border-radius: 8px; }
.check button:hover { background: var(--soft); }
.check.done { color: var(--yes); border-color: var(--yes); padding-right: 12px; }
.mini {
  width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid var(--line);
  display: grid; place-items: center; background: var(--paper); color: var(--ink);
  font-size: 17px; cursor: pointer; text-decoration: none;
}
.mini:hover { background: var(--soft); }

@media (min-width: 760px) {
  .card {
    left: 10px; right: auto; top: 96px; bottom: auto; width: 360px;
    border-radius: var(--r); max-height: calc(100vh - 116px); box-shadow: var(--shadow); animation: none;
  }
  .card .grab { display: none; }
}

/* ---------- emoji glyphs (device font or bundled set) ---------- */
.ico { width: 1em; height: 1em; display: block; }
.ico.nat { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center; width: auto; height: auto; }

/* ---------- you are here, tap feedback, messages ---------- */
.me {
  width: 16px; height: 16px; border-radius: 50%; background: #2f6fd1;
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 111, 209, .2), 0 1px 4px rgba(0, 0, 0, .25);
}
.pulse { width: 18px; height: 18px; pointer-events: none; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; border: 2px solid var(--accent); opacity: 0;
}
.pulse.go::before { animation: ring 1s ease-out 2; }
.pulse.go::after { animation: ring 1s ease-out .3s 2; }
@keyframes ring { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 9;
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 9px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}
@media (max-width: 420px) {
  .chips { gap: 5px; }
  .chip { padding: 0 9px 0 7px; gap: 5px; font-size: 12.5px; }
}

/* ---------- card v2: menu, hours, actions ---------- */
.card .badge.logo { background: #fff; border: 1px solid var(--line); overflow: hidden; }
.card .badge.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.sec { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sec span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); font-size: 12px; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.menu .it { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu .it small { display: block; color: var(--muted); font-size: 12px; }
.menu.events .it { display: block; overflow: visible; }            /* the date line must never be cut */
.menu.events .it a { color: inherit; text-decoration: none; font-weight: 500; }
.menu.events .it a:hover { text-decoration: underline; }
.menu .pr { flex: none; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu .deal { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #fbf4ea; font-size: 12.5px; color: var(--muted);
  line-height: 1.4; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu .deal.open { -webkit-line-clamp: unset; }
.menu .deal b { color: var(--ink); font-weight: 600; }
.menu .more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.hrs table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.hrs td { padding: 3px 0; }
.hrs td:first-child { color: var(--muted); width: 42%; }
.hrs td:last-child { text-align: right; }
.hrs tr.today td { color: var(--ink); font-weight: 600; }
.hrs .raw { font-size: 13px; color: var(--muted); }
.foot { gap: 6px; }
.foot .gap { flex: 1; }
.act { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--paper); font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.act span { font-size: 14px; }
.act:hover { background: var(--soft); }
.act[hidden] { display: none; }
.foot .mini { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
.panel { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.panel .stars { display: flex; align-items: center; gap: 2px; }
.panel .stars button { border: 0; background: none; font-size: 24px; color: #d6d3cf; cursor: pointer; padding: 0 2px; }
.panel .stars button.on { color: #e9a23b; }
.panel .stars span { margin-left: 8px; color: var(--muted); }
.panel .report { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.panel .report b { width: 100%; font-weight: 600; }
.panel .report button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 10px;
  font: inherit; font-size: 12.5px; cursor: pointer; }
.panel .report.done { color: var(--yes); }

.menu .deal { display: block; -webkit-line-clamp: unset; overflow: visible; }
.menu .deal .dt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu .deal.open .dt { -webkit-line-clamp: unset; }

.menu li.later { display: none; }
.menu.expanded li.later { display: flex; }
.menu .all { margin-top: 6px; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--accent-ink); cursor: pointer; }
.menu .dishes-line { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu .dishes-line.open { -webkit-line-clamp: unset; }
.menu .dishes-line b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.menu .all { margin-right: 18px; }

/* options: one per line, four shown */
.menu .sub-sec { margin: 10px 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.menu .opts { list-style: none; margin: 0; padding: 0; }
.menu .opts li { padding: 3px 0; font-size: 13.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.menu .opts li::before { content: "·"; color: var(--faint); margin-right: 8px; }
.menu .opts li.later { display: none; }
.menu .opts.expanded li.later { display: -webkit-box; }
.menu .opts-more { margin-top: 2px; border: 0; background: none; padding: 0; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--accent-ink); cursor: pointer; }
/* share + directions beside the close button */
.card .tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.card .tools .x { position: static; }
.card .tools .mini { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--soft); font-size: 14px; }
.card .head { padding-right: 112px; }
.foot { gap: 6px; }
.foot .act { flex: 1; justify-content: center; }
.foot .act:first-child { flex: 1.6; }
.menu .opts li { border: 0; padding: 2px 0; }
.menu .opts-more { margin-right: 18px; }

.where select { flex: none; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--ink); padding: 0 2px 0 0; cursor: pointer; max-width: 110px; }
.where select + span { padding-left: 4px; border-left: 1px solid var(--line); }
.where select { field-sizing: content; width: auto; max-width: none; }
@media (max-width: 420px) { .where button { padding: 0 8px; } .where { gap: 3px; } }

.card .walk { margin-top: 3px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card .walk button { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--accent-ink); cursor: pointer; }
.card .walk .ok { color: var(--accent-ink); font-weight: 600; }

.walk-tag { padding: 3px 8px; border-radius: 999px; background: var(--paper); color: var(--ink);
  font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); border: 1.5px solid var(--accent);
  white-space: nowrap; pointer-events: none; }
.walk-tag { border-color: #1a73e8; }

/* ---------- see-through card: the map stays visible behind it ---------- */
.card {
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
}
.card .badge, .card .x, .card .tools .mini { background: rgba(245, 244, 242, .85); }
.check, .act, .mini { background: rgba(255, 255, 255, .7); }
.menu .deal { background: rgba(251, 244, 234, .85); }
@media (max-width: 759px) {
  .card { max-height: 52vh; }     /* the map keeps at least the top half of the phone */
}
/* owner: more see-through, no blur */
.card { background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: none; backdrop-filter: none; }

@media (max-width: 759px) {   /* under a see-through card these would show through its buttons */
  body.card-open .where, body.card-open .maplibregl-ctrl-bottom-right { display: none; }
}

/* route label: walk / car / bike switch */
.walk-tag { display: flex; gap: 2px; padding: 2px; pointer-events: auto; }
.walk-tag button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 2px 7px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.walk-tag button.on { background: #1a73e8; color: #fff; }
.recentre button { color: var(--ink); }

/* route modes in the card head */
.card .modes { display: flex; gap: 4px; margin-top: 6px; }
.card .modes button { border: 1px solid var(--line); background: rgba(255, 255, 255, .8); font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--muted); padding: 3px 9px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.card .modes button.on { background: #1a73e8; border-color: #1a73e8; color: #fff; }
/* phone: folded card shows only its title row */
@media (max-width: 759px) {
  .card .grab { cursor: pointer; padding: 6px 0; margin-top: -4px; }
  .card .head { cursor: pointer; }
  .card.collapsed > :not(.grab):not(.head):not(.tools) { display: none; }
  .card.collapsed { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .card.collapsed .modes { display: flex; }
}

/* ---------- reviews ---------- */
.card .avg { color: #b8860b; font-weight: 600; }
.reviews { margin-top: 6px; }
.reviews .rv { padding: 8px 0; border-top: 1px solid var(--line); }
.reviews .rv.later { display: none; }
.reviews.expanded .rv.later { display: block; }
.reviews .rv-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.reviews .st { color: #e9a23b; letter-spacing: 1px; }
.reviews .dt { color: var(--faint); flex: 1; }
.reviews .flag { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.reviews p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.reviews .all { margin-top: 4px; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent-ink); cursor: pointer; }
.panel textarea { width: 100%; margin-top: 8px; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; resize: vertical; }
.panel .form-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.panel .count { color: var(--faint); font-size: 12px; }
.panel .send { border: 0; border-radius: 8px; padding: 7px 14px; background: var(--ink); color: #fff; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; }
.panel .send:disabled { opacity: .35; cursor: default; }
.panel .kinds { display: grid; gap: 4px; margin-top: 6px; font-size: 13.5px; }
.panel .kinds label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.review-form .note, .report-form .note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.review-form .note a, .report-form .note a { color: inherit; }
