:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --text: #1c1f23;
  --muted: #6b7078;
  --line: #e4e0d7;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --good: #15803d;
  --bad: #b91c1c;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .06);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1f2226;
    --surface-2: #272b30;
    --text: #eceae6;
    --muted: #9aa0a8;
    --line: #33373d;
    --brand: #2dd4bf;
    --brand-ink: #0b1f1d;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
  .leaflet-tile-pane { filter: brightness(.85) contrast(1.05); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}
body.sheet-open { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.35rem; line-height: 1.25; margin: .2rem 0 .3rem; }
h2 { font-size: 1.05rem; margin: 0; }
h2.inline { display: inline; }
h3 { font-size: .95rem; margin: 1.2rem 0 .4rem; }
img { display: block; max-width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-height: 42px;
}
input[type=checkbox] { width: auto; min-height: 0; }
input[type=range] { padding: 0; border: 0; background: none; }
textarea { resize: vertical; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.warn-text { color: var(--warn); }
.danger-text { color: var(--bad) !important; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 12px; }
.pad { padding: 0 16px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; min-height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 600; white-space: nowrap;
}
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .6; }
.btn b { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 0 6px; font-size: .75rem; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0 4px; font-size: .8rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.05rem; }
.icon-btn.on { background: var(--brand); border-color: var(--brand); }

/* ---------- chrome */
.topbar {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.tabs { display: none; gap: 4px; margin-left: 16px; }
.tabs a, .bottomnav a { color: var(--muted); font-weight: 600; }
.tabs a { padding: 8px 14px; border-radius: 999px; display: flex; gap: 6px; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sync { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); text-align: right; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; gap: 2px; }
.bottomnav a .ico { font-size: 1.3rem; filter: grayscale(1); opacity: .7; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.active .ico { filter: none; opacity: 1; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 950;
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--brand); color: var(--brand-ink); font-size: 1.9rem; line-height: 1;
  box-shadow: 0 6px 20px rgb(15 118 110 / .4); cursor: pointer;
}
.view { max-width: 1320px; margin: 0 auto; }

@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .tabs { display: flex; }
  .bottomnav { display: none; }
  .fab { bottom: 28px; right: 28px; }
}

/* ---------- scenario & filters */
.scenario { padding: 10px 16px 0; display: grid; gap: 6px; }
.scenario-row { display: flex; align-items: center; gap: 8px; }
.scenario-row .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.scenario-row .chips::-webkit-scrollbar { display: none; }
.scenario-row .who { flex: 0 0 auto; }
.who { font-weight: 600; font-size: .85rem; display: inline-flex; align-items: center; gap: 6px; }
.who::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: .85rem; cursor: pointer; white-space: nowrap; min-height: 34px;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip small { opacity: .6; margin-left: 2px; }
.status-chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.filters { padding: 10px 16px 0; display: grid; gap: 10px; }
.filter-top { display: flex; gap: 8px; }
.filter-top .search { flex: 1; }
.filter-top select { width: auto; max-width: 42%; }
.filter-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; background: var(--surface); padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.filter-more label { font-size: .82rem; color: var(--muted); display: grid; gap: 4px; }
.filter-more label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .9rem; }
.count { padding: 0 16px; margin: 10px 0 4px; color: var(--muted); font-size: .82rem; }

/* ---------- cards */
.cards { display: grid; gap: 14px; padding: 8px 16px 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card.is-out { opacity: .55; }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: block; overflow: hidden; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; height: 100%; font-size: 2.5rem; opacity: .4; }
.noimg.big { height: 220px; }
.status-pill {
  display: inline-block; background: var(--c); color: #fff; font-weight: 700; font-size: .72rem;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.card-img .status-pill { position: absolute; left: 10px; top: 10px; }
.score-pill {
  position: absolute; right: 10px; top: 10px; background: rgb(0 0 0 / .72); color: #fff;
  font-weight: 700; font-size: .85rem; padding: 3px 9px; border-radius: 999px;
}
.score-pill.inline { position: static; background: var(--brand); color: var(--brand-ink); }
.card-body { padding: 12px 14px 14px; display: grid; gap: 6px; flex: 1; align-content: start; }
.card-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card-price strong { font-size: 1.2rem; }
.card-price .warm { margin-left: auto; font-size: .82rem; color: var(--muted); }
.card-title { color: var(--text); font-weight: 600; }
.card-facts { font-size: .86rem; color: var(--muted); }
.card-commute { display: flex; gap: 6px; flex-wrap: wrap; }
.commute {
  font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 9%, transparent);
}
.commute.good { color: var(--good); }
.commute.bad { color: var(--bad); }
.card-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge { font-size: .74rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-weight: 600; }
.badge.match { background: #fce7f3; color: #9d174d; }
.badge.veto { background: #fee2e2; color: #991b1b; }
.badge.off { background: #e5e7eb; color: #374151; }
.badge.buy { background: #dbeafe; color: #1e40af; }
.badge.view { background: #ffedd5; color: #9a3412; }
.badge.kitchen { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.ratings { display: grid; gap: 2px; }
.rs { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.rs i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.stars { display: inline-flex; gap: 1px; }
.star { color: var(--line); font-size: 1em; background: none; border: 0; padding: 0; line-height: 1; }
.star.on { color: #f59e0b; }
button.star { font-size: 2rem; padding: 0 2px; cursor: pointer; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- detail */
.detail { max-width: 860px; margin: 0 auto; padding-bottom: 40px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.back { font-weight: 600; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; padding: 0 16px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery a { flex: 0 0 88%; max-width: 560px; scroll-snap-align: center; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.gallery a:only-child { flex-basis: 100%; }
.banner { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; background: #fef3c7; color: #78350f; font-size: .9rem; }
.muted-banner { background: var(--surface-2); color: var(--muted); }
.detail-main { padding: 14px 16px 4px; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-row .big { font-size: 1.6rem; }
.score-big { margin-left: auto; background: var(--brand); color: var(--brand-ink); font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.addr { margin: 0 0 8px; color: var(--muted); }
.status-seg { display: flex; gap: 6px; overflow-x: auto; margin-top: 12px; scrollbar-width: none; padding-bottom: 2px; }
.seg {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 12px; cursor: pointer; font-size: .86rem; min-height: 40px;
}
.seg.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 700; }
.panel { background: var(--surface); margin: 14px 16px 0; padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; margin: 0; }
.facts dt { font-size: .76rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts.extra { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.count .link { font-size: inherit; color: var(--brand); padding: 0; }
.features { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag { background: var(--surface-2); padding: 3px 9px; border-radius: 999px; font-size: .8rem; }
.desc { margin-top: 12px; }
.desc summary, details summary { cursor: pointer; font-weight: 600; }
.desc-text { white-space: pre-line; margin-top: 8px; font-size: .92rem; }
.travel-group { margin-bottom: 10px; }
.travel-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.travel-row.dim { opacity: .5; }
.travel-row .tmin { font-weight: 700; }
.travel-row .tmin.good { color: var(--good); }
.travel-row .tmin.bad { color: var(--bad); }
.travel-row .links { display: flex; gap: 6px; }
.travel-row .links a { font-size: 1.1rem; }
.money { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.money div { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; display: grid; }
.money span { font-size: .78rem; }
.money strong { font-size: 1.1rem; }
.money .total { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.detail-map { height: 240px; border-radius: 12px; margin-top: 12px; z-index: 0; }
.my-rating { display: grid; gap: 8px; }
.rate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rate-row.main span:first-child { font-weight: 700; }
.dots { display: inline-flex; gap: 6px; }
.dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; }
.dot.on { background: var(--brand); border-color: var(--brand); }
.other-rating { margin-top: 14px; padding: 10px 12px; border-left: 4px solid var(--c); background: var(--surface-2); border-radius: 8px; }
.quote { margin: 6px 0 0; font-style: italic; }
.veto-note { color: var(--bad); margin: 10px 0 0; }
.score-details { margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 34px; gap: 10px; align-items: center; font-size: .86rem; margin-top: 6px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); }
.checklist { display: grid; gap: 4px; margin: 10px 0; }
.check-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.tri { display: flex; gap: 6px; }
.tri button { width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.tri button.on.ok { background: var(--good); color: #fff; border-color: var(--good); }
.tri button.on.bad { background: var(--bad); color: #fff; border-color: var(--bad); }
.viewing .row label { flex: 1; font-size: .82rem; color: var(--muted); }
.viewing textarea { margin: 6px 0 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.photo-grid figure { margin: 0; }
.photo-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; }
.photo-grid figcaption { font-size: .72rem; color: var(--muted); }
.comments { display: grid; gap: 8px; margin-bottom: 10px; }
.comment { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--c); }
.comment .meta { font-size: .76rem; color: var(--muted); }
.comment .text { white-space: pre-line; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.events { list-style: none; padding: 0; margin: 10px 0 0; font-size: .86rem; display: grid; gap: 4px; }

/* ---------- map */
body.on-map { padding-bottom: 0; }
body.on-map .fab { display: none; }
.map-wrap { position: relative; margin-top: 10px; }
#map { width: 100%; min-height: 320px; z-index: 0; }
.map-panel {
  position: absolute; left: 10px; bottom: 10px; z-index: 500; max-width: min(360px, calc(100% - 20px));
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 10px 12px; border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 8px; font-size: .82rem;
}
.mp-row { display: grid; gap: 4px; }
.mp-toggle { background: none; border: 0; padding: 0; font-weight: 700; text-align: left; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.map-panel.closed > :not(.mp-toggle) { display: none; }
.map-panel.closed .mp-toggle span { display: inline-block; transform: rotate(-90deg); }
.mp-row > span { font-weight: 600; color: var(--muted); }
.mp-row .chip { padding: 4px 10px; min-height: 30px; font-size: .8rem; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.line { width: 16px; height: 0; border-top: 2px dashed; border-radius: 0; }
.legend .grad i { width: 90px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, hsl(130 70% 40%), hsl(65 70% 40%), hsl(0 70% 40%)); }
.iso-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; width: 100%; }
.price-pin {
  display: inline-block; transform: translate(0, 0); white-space: nowrap;
  background: var(--c); color: #fff; font-weight: 700; font-size: 12px; line-height: 1;
  padding: 6px 8px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.price-pin.approx { border-style: dashed; opacity: .9; }
.dest-pin {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 15px;
  background: #fff; border: 3px solid var(--c); box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.leaflet-popup-content { margin: 10px 12px; }
.popup { display: grid; gap: 4px; font-size: 13px; }
.popup img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.popup .row { justify-content: space-between; margin-top: 4px; }
.popup .who { margin-top: 6px; }
.popup .travel-row { grid-template-columns: 1fr auto auto; }

/* ---------- compare */
.compare-wrap { overflow-x: auto; padding: 12px 16px; }
.compare { border-collapse: separate; border-spacing: 0; min-width: 100%; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .88rem; }
.compare th, .compare td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare tbody th { position: sticky; left: 0; background: var(--surface); font-weight: 600; color: var(--muted); min-width: 120px; max-width: 150px; z-index: 1; }
.compare thead th { min-width: 150px; max-width: 200px; }
.compare thead th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.compare thead img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.compare thead a { color: var(--text); display: block; }
.compare td.best { background: color-mix(in srgb, var(--good) 14%, transparent); font-weight: 700; }
.pick-list { display: grid; gap: 8px; padding: 0 16px; max-width: 720px; margin: 0 auto; }
.pick { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }

/* ---------- settings */
.settings { max-width: 900px; margin: 0 auto; padding-bottom: 40px; }
.dest-list { display: grid; gap: 10px; }
.dest { display: grid; grid-template-columns: 1fr 1.4fr .8fr 1fr auto auto; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.dest .row { margin: 0; flex-wrap: nowrap; }
.dest-state { font-size: .8rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.grid-form label, .stack > label { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.weights { display: grid; gap: 8px; }
.weights label { display: grid; grid-template-columns: 130px 1fr 30px; gap: 10px; align-items: center; font-size: .9rem; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.bookmarklet { cursor: grab; }
@media (max-width: 720px) {
  .dest { grid-template-columns: 1fr 1fr; }
  .dest .row { grid-column: 1 / -1; }
}

/* ---------- sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 2000; background: rgb(0 0 0 / .4); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.sheet-wrap.show { opacity: 1; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 20px 20px 0 0; padding: 20px 16px calc(24px + var(--safe-b));
  transform: translateY(30px); transition: transform .2s;
}
.sheet-wrap.show .sheet { transform: none; }
.sheet h2 { margin: 0 40px 14px 0; font-size: 1.2rem; }
.sheet details { margin-top: 16px; background: var(--surface); padding: 12px 14px; border-radius: 12px; }
.sheet details[open] summary { margin-bottom: 12px; }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; }
}

/* ---------- misc */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 90px); z-index: 3000;
  transform: translate(-50%, 20px); opacity: 0; transition: all .25s;
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #991b1b; }
.toast.good { background: #166534; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; background: var(--surface); padding: 28px 24px; border-radius: 20px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-box .login-logo { width: 220px; height: auto; margin: 0 auto 6px; }
@media (prefers-color-scheme: dark) {
  /* The wordmark is dark navy; give it a light plate on dark backgrounds. */
  .login-box .login-logo { background: #fff; border-radius: 18px; padding: 12px; }
}
.login-box h1 { text-align: center; margin: 0 0 6px; }
.login-box label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.login-error { color: var(--bad); margin: 0; text-align: center; }

/* ---------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 4000; background: rgb(0 0 0 / .92); display: grid; place-items: center; touch-action: none; overflow: hidden; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: 0 0; cursor: zoom-in; }
.lightbox.zoomed img { cursor: grab; }
.lb-btn { position: absolute; border: 0; background: rgb(255 255 255 / .14); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgb(255 255 255 / .28); }
.lb-close { top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; font-size: 1.1rem; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); left: 50%; transform: translateX(-50%); color: #fff; font-size: .9rem; opacity: .8; }

/* ---------- kitchen toggle & update bar */
.kitchen-fact dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mini-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.mini { border: 0; background: transparent; padding: 3px 9px; font-size: .75rem; cursor: pointer; color: var(--muted); }
.mini.on { background: var(--brand); color: var(--brand-ink); }
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 3500;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: #1f2937; color: #fff; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); white-space: nowrap;
}
