/* ---------- Tokens ---------- */
:root {
  --bg: #faf8f4;
  --bg-2: #ffffff;
  --bg-3: #f1ede6;
  --line: #e6e1d8;
  --line-2: #d6cfc3;
  --ink: #1c1a17;
  --ink-2: #5f5a52;
  --ink-3: #9a948a;
  --accent: #c8502a;
  --accent-2: #f6e6df;
  --ok: #2f8f5b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(30, 20, 10, .05), 0 6px 20px rgba(30, 20, 10, .06);
  --shadow-lg: 0 10px 40px rgba(20, 15, 10, .18);
  --topbar-h: 60px;
  --tabbar-h: 62px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --bg-2: #1d1b18;
    --bg-3: #26231f;
    --line: #2f2b26;
    --line-2: #403a33;
    --ink: #f2eee7;
    --ink-2: #b3ab9f;
    --ink-3: #7d766c;
    --accent: #f07a4f;
    --accent-2: #3a2419;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
[hidden] { display: none !important; }
::selection { background: var(--accent-2); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1500;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  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: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.brand-text { font-weight: 600; font-size: 16px; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text small { font-weight: 400; font-size: 11px; color: var(--ink-3); }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 8px;
  font-weight: 500; color: var(--ink-2); font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav a svg { width: 16px; height: 16px; opacity: .75; }
.nav a.active svg { opacity: 1; color: var(--accent); }
[data-icon] { display: inline-flex; line-height: 0; }
.ico-sm svg { width: 15px; height: 15px; }
.nav a:hover { background: var(--bg-3); color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--bg-3); }
.search { position: relative; margin-left: auto; width: min(380px, 100%); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px;
  padding: 0 34px 0 38px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg-2); color: var(--ink);
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-3); font-size: 12px;
}
.search-clear:hover { background: var(--bg-3); color: var(--ink); }
.hdr-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2); flex-shrink: 0; }
.hdr-btn:hover, .hdr-btn.active { color: var(--accent); border-color: var(--accent); }
.hdr-btn svg { width: 17px; height: 17px; }
.hdr-btn.lang { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.saved-count { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* open / closed */
.open { color: var(--ok); font-weight: 500; }
.closed { color: var(--ink-3); }

/* hearts */
.heart { border: 0; background: transparent; color: var(--ink-3); padding: 4px; border-radius: 8px; line-height: 0; }
.heart svg { width: 18px; height: 18px; }
.heart:hover { color: var(--accent); background: var(--accent-2); }
.heart.on { color: var(--accent); }
.heart.on svg { fill: var(--accent); }
.heart-card { float: right; margin: -4px -6px 0 6px; }
.heart-btn.on { color: var(--accent); border-color: var(--accent); }
.heart-btn.on svg { fill: var(--accent); }

/* today panel */
.today { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.today-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.today-head svg { width: 18px; height: 18px; color: var(--accent); }
.today-head b { color: var(--ink); }
.today-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.today-open { border: 1px solid var(--line-2); background: var(--bg); border-radius: 999px; height: 34px; padding: 0 14px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.today-open b { color: var(--ok); font-size: 15px; }
.today-open:hover { border-color: var(--ok); }
.today-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.today-quick .chip { height: 30px; padding: 0 11px; font-size: 13px; }
.today-events { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13.5px; }
.today-lbl { color: var(--ink-3); }
.today-events a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.today-events a svg { width: 14px; height: 14px; color: var(--accent); }
.today-events a small { color: var(--ink-3); }
.today-events a:hover span { text-decoration: underline; }

/* gallery */
.d-gallery { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; }
.d-gallery::-webkit-scrollbar { display: none; }
.d-gallery img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .7; border: 2px solid transparent; flex-shrink: 0; }
.d-gallery img.on, .d-gallery img:hover { opacity: 1; border-color: var(--accent); }

/* footer */
.footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 22px 20px calc(var(--tabbar-h) + 20px); color: var(--ink-3); font-size: 13.5px; }
.footer-in { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); }
.footer-brand .brand-mark { width: 26px; height: 26px; font-size: 10px; border-radius: 7px; }
.footer-brand b { color: var(--ink); }
.footer a:hover { color: var(--accent); }
.about { max-width: 720px; }
.support { max-width: 760px; }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.support-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.support-qr { grid-row: span 3; align-items: center; }
.support-qr img { width: 100%; max-width: 300px; height: auto; border-radius: var(--radius-sm); }
.support-card-head { display: flex; flex-direction: column; gap: 2px; align-self: stretch; }
.support-card-head b { font-size: 16px; }
.support-card-head span { font-size: 13px; color: var(--ink-3); }
.support-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.support-row code { flex: 1; min-width: 0; font-size: 14px; background: var(--bg-3); padding: 8px 10px; border-radius: var(--radius-sm); word-break: break-all; }
.support-thanks { margin-top: 20px; color: var(--ink-2); }
@media (max-width: 640px) { .support-grid { grid-template-columns: 1fr; } .support-qr { grid-row: auto; } }
.view-map.active ~ .footer, body:has(#view-map.active) .footer { display: none; }

/* ---------- Layout ---------- */
#app { max-width: 1200px; margin: 0 auto; padding: 20px 20px calc(var(--tabbar-h) + 24px); }
.view { display: none; }
.view.active { display: block; }
.page-head { margin: 8px 0 22px; }
.page-head h1 { font-size: 28px; margin-bottom: 6px; }
.lead { margin: 0 0 14px; color: var(--ink-2); max-width: 640px; }
.h2 { font-size: 19px; margin: 28px 0 14px; }

/* ---------- Buttons / controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg-2); color: var(--ink);
  font-size: 14px; font-weight: 500;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-ghost { background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.select {
  height: 36px; padding: 0 30px 0 12px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a948a' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink); font: inherit; font-size: 14px;
  appearance: none; -webkit-appearance: none;
  max-width: 220px;
}
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.count { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.seg { display: inline-flex; background: var(--bg-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg button.active { background: var(--bg-2); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Filters ---------- */
.filters { margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
  font-size: 14px; font-weight: 500;
  transition: all .12s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { font-size: 12px; opacity: .6; }
.chip svg { width: 15px; height: 15px; }
.chips-tags { padding-left: 2px; }
.chips-tags .chip { height: 30px; padding: 0 11px; font-size: 13px; border-color: var(--line); background: var(--bg-3); }
.chips-tags .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips-compact .chip { height: 30px; padding: 0 11px; font-size: 13px; }
.filters-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-3); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; opacity: .55; }
.card-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.badge svg { width: 12px; height: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(20, 15, 10, .72); color: #fff;
  font-size: 12px; font-weight: 500; backdrop-filter: blur(6px);
}
.badge.dist { background: rgba(255, 255, 255, .9); color: var(--ink); }
.card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.card-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-meta .dot::before { content: "·"; }
.card-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--bg-3); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.pill.veg { background: #e7f4ea; color: #2b7a48; }
.pill.rating { color: var(--ink); }
@media (prefers-color-scheme: dark) { .pill.veg { background: #1f3326; color: #7fd49a; } }
.empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.more-wrap { display: flex; justify-content: center; padding: 24px 0 8px; }

/* Wiki hits inside search results */
.wiki-hits { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.wiki-hits a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); font-size: 14px; }
.wiki-hits a:hover { border-color: var(--accent); }

/* ---------- Events ---------- */
.events { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.event-day { margin: 18px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.event {
  position: relative; display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.event:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.event-date { text-align: center; line-height: 1.1; }
.event-date b { display: block; font-size: 24px; font-weight: 700; }
.event-date span { font-size: 12px; color: var(--ink-3); text-transform: uppercase; }
.event-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.event-title { font-weight: 600; font-size: 15.5px; margin-bottom: 2px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--ink-2); align-items: center; }
.event-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.event-venue { color: var(--ink); font-weight: 500; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.btn-map { background: var(--bg-1); border: 1px solid var(--line-2); color: var(--ink); font-size: 12.5px; padding: 5px 11px; }
.btn-map:hover { border-color: var(--accent, #d97706); color: var(--accent, #d97706); }
.event.past { opacity: .6; }
.event-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--bg-3); }

/* Modal Venue Card */
.d-venue-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 10px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.d-venue-title { font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.d-venue-address { font-size: 13px; color: var(--ink-2); }
.d-venue-sub { font-size: 12px; color: var(--ink-3); text-transform: uppercase; font-weight: 600; letter-spacing: .03em; margin-top: 2px; }

/* ---------- Routes ---------- */
.grid-routes { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.route-card .card-img { aspect-ratio: 16 / 9; }
.route-card h3 { font-size: 17px; line-height: 1.25; margin-bottom: 4px; }
.route-kind { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.route-stats { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.route-head { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 24px; }
.route-head h1 { font-size: 26px; margin-bottom: 6px; }
.route-map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.steps { display: flex; flex-direction: column; gap: 0; max-width: 760px; position: relative; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding-bottom: 22px; position: relative; }
.step::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.step-body { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 1fr 96px; gap: 14px; cursor: pointer; }
.step-body:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.step-body img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.step-note { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--accent); }
.list-simple { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

/* ---------- Wiki ---------- */
.wiki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wiki-card { display: flex; gap: 14px; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: all .12s; }
.wiki-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.wiki-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-2); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.wiki-card h3 { font-size: 15.5px; margin-bottom: 4px; }
.wiki-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article { max-width: 760px; }
.article .prose { font-size: 16px; line-height: 1.65; }
.prose h1 { font-size: 28px; margin: 0 0 16px; }
.prose h2 { font-size: 20px; margin: 30px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 5px; }
.prose li p { margin: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.prose img { border-radius: var(--radius); margin: 8px 0 18px; }
.prose blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.prose blockquote p { margin: 0; }
.prose code { background: var(--bg-3); padding: 1px 6px; border-radius: 5px; font-size: 90%; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 16px; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.related { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.related h2 { font-size: 18px; margin-bottom: 12px; }
.article-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.article-nav a { color: var(--ink-2); }
.article-nav a:hover { color: var(--accent); }
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; border: 1px solid; }
.alert-warning { background: #fff6e5; border-color: #f2d39b; color: #7a4d00; }
.alert-caution { background: #fdeaea; border-color: #f2b5b5; color: #8a1f1f; }
.alert-tip { background: #e9f6ee; border-color: #b6dfc5; color: #1f5c38; }
.alert-note { background: var(--bg-3); border-color: var(--line-2); color: var(--ink-2); }
.alert p { margin: 0; }
@media (prefers-color-scheme: dark) {
  .alert-warning { background: #33270f; border-color: #6a5220; color: #f5d488; }
  .alert-caution { background: #3a1a1a; border-color: #6e2c2c; color: #f4a8a8; }
  .alert-tip { background: #163021; border-color: #2c5a3d; color: #9ad8b0; }
}

/* ---------- Map view ---------- */
.view-map.active { display: grid; grid-template-columns: 380px 1fr; gap: 0; height: calc(100vh - var(--topbar-h)); margin: -20px -20px calc(-1 * var(--tabbar-h) - 24px); max-width: none; }
.map-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
.map-side-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.map-side-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.map-list { overflow-y: auto; flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; align-items: center; }
.map-row:hover, .map-row.hl { background: var(--bg-3); }
.map-row img, .map-row .ph { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; font-size: 22px; }
.map-row b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.map-row span { font-size: 12.5px; color: var(--ink-3); }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--bg-3); }
.map-strip { display: none; }
.map-filters-mobile { display: none; }
.leaflet-container { font-family: var(--font); }
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: grid; place-items: center; }
.pin span { transform: rotate(45deg); line-height: 0; color: #fff; }
.pin span svg { width: 14px; height: 14px; }
.pin.num { border-radius: 50%; transform: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.pin.num span { transform: none; }
.marker-cluster { background: rgba(200, 80, 42, .25); border-radius: 50%; }
.marker-cluster div { background: var(--accent); color: #fff; font-weight: 600; font-family: var(--font); border-radius: 50%; width: 32px; height: 32px; margin: 4px; display: grid; place-items: center; font-size: 13px; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-lg); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 240px !important; }
.pop { cursor: pointer; }
.pop img { width: 100%; height: 120px; object-fit: cover; }
.pop div { padding: 10px 12px 12px; }
.pop b { display: block; font-size: 14px; margin-bottom: 2px; }
.pop span { font-size: 12.5px; color: #6b6b6b; }
.leaflet-popup-tip { box-shadow: none; }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #2b7bff; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(43,123,255,.25); }

/* ---------- Detail panel ---------- */
.detail { position: fixed; inset: 0; z-index: 2000; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(15, 12, 8, .45); animation: fade .18s; }
.detail-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg); overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slide .22s cubic-bezier(.2,.8,.2,1);
  overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0 } }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }
.d-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(20,15,10,.6); color: #fff; font-size: 16px; backdrop-filter: blur(6px); }
.d-hero { aspect-ratio: 16 / 10; background: var(--bg-3); position: relative; }
.d-hero img { width: 100%; height: 100%; object-fit: cover; }
.d-hero .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 64px; opacity: .5; }
.d-body { padding: 18px 22px 40px; }
.d-cat { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.d-cat .cat { color: var(--accent); font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.d-cat .cat svg { width: 14px; height: 14px; }
.d-title { font-size: 24px; line-height: 1.2; margin: 6px 0 10px; }
.d-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 16px; }
.d-facts b { color: var(--ink); font-weight: 600; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.d-section { margin-bottom: 22px; }
.d-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.d-section ul { margin: 0; padding-left: 18px; }
.d-section li { margin-bottom: 5px; font-size: 14.5px; }
.d-section p { margin: 0; font-size: 14.5px; color: var(--ink-2); white-space: pre-line; }
.d-map { height: 180px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 22px; }
.hours { font-size: 14px; display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; }
.hours .today { font-weight: 600; color: var(--ink); }
.review { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 14px; }
.review-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.review-head b { color: var(--ink-2); font-weight: 500; }
.review p { margin: 0; white-space: pre-line; }
.review a { color: var(--accent); font-size: 12.5px; }
.nearby { display: flex; flex-direction: column; gap: 6px; }
.nearby a { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; }
.nearby a:hover { background: var(--bg-3); }
.nearby img, .nearby .ph { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; }
.nearby b { display: block; font-size: 14px; }
.nearby span { font-size: 12.5px; color: var(--ink-3); }
details.d-details summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.d-details summary::-webkit-details-marker { display: none; }
details.d-details summary::before { content: "▸"; transition: transform .15s; color: var(--ink-3); }
details.d-details[open] summary::before { transform: rotate(90deg); }
details.d-details > div { margin-top: 10px; }

/* ---------- Tab bar (mobile) ---------- */
.tabbar { display: none; }
.toast { position: fixed; bottom: calc(var(--tabbar-h) + 14px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 2100; box-shadow: var(--shadow-lg); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); font-weight: 500; }
  .tabbar a.active { color: var(--accent); }
  .tab-ico svg { width: 22px; height: 22px; }
  .view-map.active { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - var(--tabbar-h)); margin-bottom: calc(-1 * var(--tabbar-h) - 24px); }
  .map-side { display: none; }
  .map-strip { display: flex; position: absolute; left: 0; right: 0; bottom: 12px; gap: 10px; overflow-x: auto; padding: 0 12px; scroll-snap-type: x mandatory; scrollbar-width: none; z-index: 400; }
  .map-strip::-webkit-scrollbar { display: none; }
  .strip-card { flex: 0 0 260px; scroll-snap-align: center; background: var(--bg-2); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px; cursor: pointer; }
  .strip-card img, .strip-card .ph { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; font-size: 26px; }
  .strip-card b { display: block; font-size: 13.5px; line-height: 1.25; }
  .strip-card span { font-size: 12px; color: var(--ink-3); }
  .map-filters-mobile { display: block; position: absolute; top: 10px; left: 54px; right: 0; z-index: 400; padding: 0 12px 0 0; }
  .map-filters-mobile .chips { gap: 6px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; gap: 12px; }
  .brand-text { display: none; }
  .hdr-btn { width: 34px; height: 34px; }
  .today-row { flex-direction: column; align-items: flex-start; }
  #app { padding: 14px 14px calc(var(--tabbar-h) + 20px); }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { flex-direction: row; }
  .card-img { width: 118px; flex-shrink: 0; aspect-ratio: auto; }
  .card-img .ph { font-size: 28px; }
  .card-badges { display: none; }
  .route-card { flex-direction: column; }
  .route-card .card-img { width: 100%; aspect-ratio: 16 / 9; }
  .card-body { padding: 11px 12px; gap: 4px; }
  .card-title { font-size: 15px; }
  .card-text { -webkit-line-clamp: 2; font-size: 13px; }
  .page-head h1 { font-size: 24px; }
  .event { grid-template-columns: 52px 1fr; }
  .event-thumb { display: none; }
  .event-date b { font-size: 20px; }
  .detail-panel { width: 100%; }
  .d-body { padding: 16px 16px 40px; }
  .d-title { font-size: 21px; }
  .route-map { height: 240px; }
  .step-body { grid-template-columns: 1fr; }
  .step-body img { display: none; }
  .select { max-width: 160px; }
  .count { width: 100%; margin-left: 0; }
}

/* ---------- local admin ---------- */
.publish-btn { position: relative; }
.publish-btn.dirty::after { content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.adm-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(20,15,10,.55); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; backdrop-filter: blur(4px); }
.card:hover .adm-x, .event:hover .adm-x, .adm-x:focus-visible { opacity: 1; }
.adm-x:hover { background: #dc2626; }
.event .adm-x { top: 10px; right: 10px; background: var(--bg-3); color: var(--ink-3); }
.event .adm-x:hover { background: #dc2626; color: #fff; }
@media (hover: none) { .adm-x { opacity: 1; } }
.adm-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 8px 10px; border-radius: 10px; background: var(--bg-3); font-size: 12px; color: var(--ink-3); }
.adm-bar span { margin-right: auto; font-family: ui-monospace, monospace; }
.adm-danger:hover { border-color: #dc2626; color: #dc2626; }
.adm-form { display: flex; flex-direction: column; gap: 12px; }
.adm-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.adm-field input, .adm-field textarea, .adm-field select { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; }
.adm-field textarea { resize: vertical; line-height: 1.45; }
.adm-field input:focus, .adm-field textarea:focus, .adm-field select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.toast { display: inline-flex; align-items: center; gap: 12px; }
.toast-btn { border: 0; background: none; color: #f6b48a; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

/* ---------- VIP Items & Styling ---------- */
.card.card-vip {
  border: 1.5px solid rgba(217, 119, 6, 0.45);
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.1);
}
.card.card-vip:hover {
  border-color: #d97706;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.22);
}
.vip-mark {
  color: #d97706;
  margin-left: 5px;
  font-size: 14px;
}
.badge.badge-vip {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: .03em;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.35);
}
.pin.pin-vip {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.5) !important;
  border: 2px solid #fff;
}
.event.event-vip {
  border-left: 4px solid #d97706;
  box-shadow: 0 2px 12px rgba(217, 119, 6, 0.08);
}
.event-day.event-day-vip {
  color: #d97706;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .02em;
}
.badge-vip-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  vertical-align: middle;
  margin-left: 6px;
  box-shadow: 0 1px 4px rgba(180, 83, 9, 0.3);
}
