/* Bản đồ ẩm thực Việt Nam — giao diện */
:root {
  --bg: #F7F3EA;
  --surface: #FFFDF8;
  --surface-2: #F0E9DA;
  --ink: #2A1F17;
  --ink-2: #57483C;
  --muted: #85766A;
  --line: #E4DAC7;
  --line-2: #D5C7AE;
  --accent: #B23A26;
  --accent-2: #8F2A19;
  --accent-soft: #F6E1DA;
  --focus: #1F6FD6;
  --c-star: #B3261E;
  --c-green: #2E7D32;
  --c-bib: #C9520E;
  --c-selected: #46668F;
  --c-local: #1C7A72;
  --shadow-1: 0 1px 2px rgba(60, 40, 20, .06), 0 2px 8px rgba(60, 40, 20, .06);
  --shadow-2: 0 6px 24px rgba(60, 40, 20, .14);
  --r: 14px;
  --r-sm: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 60px;
  /* minh họa */
  --bowl: #F4EEE2; --bowl-band: #3D6FA8; --soup-1: #F3C77A; --soup-2: #D99A45; --noodle: #FFF6E2;
  --beef: #9C5B45; --herb: #3F8A3A; --chili: #C8321F; --chopstick: #6E4B2E; --chopstick-tip: #2A1F17;
  --steam: rgba(120, 100, 80, .22); --shadow: rgba(80, 55, 30, .12);
  --tile-filter: saturate(.78) sepia(.06) brightness(1.01);
  --sea: #B8D5DB; --land: #EFE8DA; --land-vn: #F8EBD3; --land-line: #C9B08A; --wave: rgba(70, 120, 150, .22); --route: #B23A26;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1612; --surface: #241D18; --surface-2: #2E2620; --ink: #F3EADF; --ink-2: #D6C8B8; --muted: #A6968A;
    --line: #3A3029; --line-2: #4A3E35; --accent: #E2694F; --accent-2: #F08C74; --accent-soft: #3A221B; --focus: #7FB2FF;
    --c-star: #F06A5B; --c-green: #5FBF6A; --c-bib: #F08A3E; --c-selected: #86A7D4; --c-local: #4DBDB2;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 30px rgba(0,0,0,.5);
    --bowl: #E8E0D2; --bowl-band: #5C8CC4; --steam: rgba(255,240,220,.18); --shadow: rgba(0,0,0,.35);
    --tile-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55);
    --sea: #2A3C42; --land: #2A241F; --land-vn: #3A2E24; --land-line: #6E5A44; --wave: rgba(140, 190, 220, .16); --route: #E2694F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1B1612; --surface: #241D18; --surface-2: #2E2620; --ink: #F3EADF; --ink-2: #D6C8B8; --muted: #A6968A;
  --line: #3A3029; --line-2: #4A3E35; --accent: #E2694F; --accent-2: #F08C74; --accent-soft: #3A221B; --focus: #7FB2FF;
  --c-star: #F06A5B; --c-green: #5FBF6A; --c-bib: #F08A3E; --c-selected: #86A7D4; --c-local: #4DBDB2;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 30px rgba(0,0,0,.5);
  --bowl: #E8E0D2; --bowl-band: #5C8CC4; --steam: rgba(255,240,220,.18); --shadow: rgba(0,0,0,.35);
  --tile-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55);
  --sea: #2A3C42; --land: #2A241F; --land-vn: #3A2E24; --land-line: #6E5A44; --wave: rgba(140, 190, 220, .16); --route: #E2694F;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); overflow-x: hidden; }
img, svg { display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 19px; }
p { margin: 0 0 .7em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.small { font-size: 13.5px; color: var(--muted); }
[hidden] { display: none !important; }

/* ── Thanh trên ── */
.topbar { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar__in { max-width: 1280px; margin: auto; height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.brand img { border-radius: 8px; }
.brand b { color: var(--accent); font-weight: 600; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 15px; }
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn:hover { border-color: var(--line-2); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#themeBtn .moon { display: none; }
:root[data-theme="dark"] #themeBtn .moon { display: block; }
:root[data-theme="dark"] #themeBtn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .moon { display: block; }
  :root:not([data-theme="light"]) #themeBtn .sun { display: none; }
}

/* ── Nút ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
:root[data-theme="dark"] .btn--primary, :root[data-theme="dark"] .btn--primary:hover { color: #1B1612; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--primary, :root:not([data-theme="light"]) .btn--primary:hover { color: #1B1612; } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ── Hero ── */
main { display: block; }
section { padding: 0 max(16px, env(safe-area-inset-left)); }
.hero { max-width: 1280px; margin: auto; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 24px; padding-top: 48px; padding-bottom: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.025em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--ink-2); max-width: 38em; margin: 18px 0 22px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 24px; max-width: 620px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__art { margin: 0; justify-self: center; width: min(460px, 100%); }
.hero__art svg { width: 100%; height: auto; }
.hero__art svg text { font-family: var(--sans); }
.hland { fill: var(--land-vn); stroke: var(--land-line); stroke-width: 1.2; stroke-linejoin: round; }
.hroute { fill: none; stroke: var(--route); stroke-width: 1.6; stroke-dasharray: 3 5; opacity: .55; }
.hdot__c { fill: var(--c-local); stroke: var(--surface); stroke-width: 1.5; }
.hdot--star .hdot__c { fill: var(--c-star); }
.hdot__halo { fill: var(--c-local); opacity: .18; transform-box: fill-box; transform-origin: center; animation: halo 3.2s ease-out infinite; animation-delay: var(--d); }
.hdot--star .hdot__halo { fill: var(--c-star); }
@keyframes halo { 0% { transform: scale(.4); opacity: .35; } 100% { transform: scale(1.6); opacity: 0; } }
.hlabel { font-size: 11.5px; font-weight: 600; fill: var(--ink-2); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.hisle { fill: var(--land-line); stroke: var(--land-vn); stroke-width: .6; }
.hisl-label { font-size: 10px; font-style: italic; fill: var(--muted); }
.hsea { font-family: var(--serif) !important; font-size: 15px; font-style: italic; fill: var(--muted); letter-spacing: .08em; opacity: .8; }
.steam path { animation: steam 4.5s ease-in-out infinite; transform-origin: center bottom; }
.steam path:nth-child(2) { animation-delay: -1.5s; }
.steam path:nth-child(3) { animation-delay: -3s; }
@keyframes steam { 0%, 100% { opacity: .2; transform: translateY(6px); } 50% { opacity: 1; transform: translateY(-6px); } }

/* ── Tiêu đề mục ── */
.section-head { max-width: 1280px; margin: 0 auto 18px; }
.section-head p { color: var(--ink-2); margin: 8px 0 0; max-width: 46em; }
.explorer, .dishes, .korea, .awards, .tips, .data { padding-top: 48px; padding-bottom: 8px; }
.explorer > *, .dishes > *, .korea > *, .awards > *, .tips > *, .data > * { max-width: 1280px; margin-left: auto; margin-right: auto; }

/* ── Thanh lọc ── */
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 16px; min-height: 48px; box-shadow: var(--shadow-1); }
.search:focus-within { border-color: var(--focus); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 46px; font-size: 16px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.toolbar__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 36px 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2385766A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; font-size: 15px; cursor: pointer; max-width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 14.5px; white-space: nowrap; transition: background .15s, border-color .15s; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c, var(--muted)); box-shadow: 0 0 0 2px var(--surface); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--ink); }
.chip .count { font-size: 12.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.chip svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chip svg .fill { fill: currentColor; }
.chip--tool[aria-busy="true"] { opacity: .6; cursor: progress; }
.filterline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14.5px; color: var(--ink-2); min-height: 26px; }
.filterline b { color: var(--ink); }
.tag-x { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.tag-x::after { content: "✕"; font-size: 11px; opacity: .6; padding: 0 4px; }

/* ── Bố cục bản đồ + danh sách ── */
.explorer__body { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 16px; align-items: start; }
.mapwrap { position: sticky; top: calc(var(--header-h) + 12px); height: calc(100vh - var(--header-h) - 28px); height: calc(100dvh - var(--header-h) - 28px); min-height: 460px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); background: var(--surface-2); order: 2; }
.listwrap { order: 1; }
.map { position: absolute; inset: 0; background: var(--sea); }
.map .leaflet-container, .leaflet-container.map { background: var(--sea); }
.bm-land { fill: var(--land); fill-opacity: 1; stroke: var(--land-line); stroke-opacity: .5; }
.bm-vn { fill: var(--land-vn); fill-opacity: 1; stroke: var(--land-line); stroke-opacity: .9; }
/* Lớp che vùng biển đảo. --sea trùng màu biển của ảnh OSM sau bộ lọc (#AAD3DF qua --tile-filter), nên liền mạch cả khi có hay không có ảnh nền */
.bm-mask { fill: var(--sea); }
.bm-isl { fill: var(--land-vn); fill-opacity: 1; stroke: var(--land-line); }
.map-note { position: absolute; z-index: 600; left: 50%; bottom: 52px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow-1); white-space: nowrap; max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; }
.leaflet-control-base a { width: auto !important; padding: 0 12px; font: 600 12.5px/30px var(--sans); white-space: nowrap; }
.map .leaflet-tile-pane { filter: var(--tile-filter); }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--ink-2); }
.legend { position: absolute; left: 10px; bottom: 10px; z-index: 500; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: calc(100% - 120px); padding: 7px 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--ink-2); pointer-events: none; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }

.list { display: grid; gap: 10px; }
.group-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin: 14px 2px 2px; }
.group-title h3 { white-space: nowrap; }
.group-title:first-child { margin-top: 0; }
.group-title h3 { font-size: 22px; }
.group-title small { color: var(--muted); font-size: 12.5px; }
.group-intro { margin: 0 2px 4px; font-size: 14px; color: var(--ink-2); }

.place { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 12px 18px; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .15s; scroll-margin-top: calc(var(--header-h) + 16px); }
.place::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.place:hover { border-color: var(--line-2); }
.place.is-active { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent), var(--shadow-2); }
.place__top { display: flex; align-items: flex-start; gap: 12px; }
.place__head { flex: 1; min-width: 0; }
.place__name { margin: 0; }
.place__art { flex: none; width: 76px; height: 54px; margin: -2px -4px 0 0; border-radius: 12px; background: color-mix(in srgb, var(--c) 8%, var(--surface-2)); display: grid; place-items: center; }
.place__art svg { width: 70px; height: 49px; }
.place__name button { all: unset; cursor: pointer; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; color: var(--ink); border-radius: 4px; }
.place__name button:hover { color: var(--c); }
.place__name button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--ink)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.badge--plain { --c: var(--muted); }
.badge--new { --c: var(--accent); background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="dark"] .badge--new { color: #1B1612; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge--new { color: #1B1612; } }
.badge--dist { --c: var(--focus); }
.place__what { margin: 0 0 4px; font-size: 15.5px; }
.place__addr { margin: 0 0 4px; color: var(--ink-2); font-size: 14.5px; display: flex; gap: 6px; }
.place__addr svg { width: 15px; height: 15px; flex: none; margin-top: 3px; fill: none; stroke: var(--muted); stroke-width: 2; }
.place__note { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.place__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.act { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 13.5px; text-decoration: none; cursor: pointer; }
.act:hover { background: var(--surface-2); color: var(--ink); }
.act svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.act--save[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.act--save[aria-pressed="true"] svg { fill: currentColor; }
.act--go { color: var(--ink); font-weight: 600; }
.empty { padding: 28px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-2); }
.empty b { display: block; font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 4px; }

/* ── Ghim trên bản đồ ── */
.pin-wrap { background: none; border: 0; }
.pin { --s: 30px; width: var(--s); height: var(--s); border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; transition: transform .15s; }
.pin span { transform: rotate(45deg); color: #fff; font: 700 13px/1 var(--sans); }
.pin svg { transform: rotate(45deg); width: 15px; height: 15px; fill: #fff; }
.pin--approx { border-style: dashed; }
.pin--active { --s: 38px; z-index: 1000 !important; animation: pop .35s ease-out; }
.leaflet-marker-icon:hover .pin { transform: rotate(-45deg) scale(1.12); }
@keyframes pop { 0% { transform: rotate(-45deg) scale(.6); } 70% { transform: rotate(-45deg) scale(1.15); } 100% { transform: rotate(-45deg) scale(1); } }
.cluster { background: none; border: 0; }
.cluster__b { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 3px 10px rgba(0,0,0,.3); font: 600 13px/1 var(--sans); white-space: nowrap; transform: translate(-50%, -50%); width: max-content; cursor: pointer; transition: transform .15s; }
.cluster__b:hover { transform: translate(-50%, -50%) scale(1.06); }
.cluster__n { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; }
.cluster__n.has-star { background: var(--c-star); }
.isle { background: none; border: 0; }
.isle span { display: block; transform: translate(-50%, -50%); width: max-content; font: italic 600 12px/1.25 var(--serif); color: #1d4f7a; text-align: center; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; pointer-events: none; }
:root[data-theme="dark"] .isle span { color: #9cc7f0; text-shadow: 0 0 3px #000, 0 0 3px #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .isle span { color: #9cc7f0; text-shadow: 0 0 3px #000, 0 0 3px #000; } }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #1F6FD6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(31,111,214,.25); }

.leaflet-container { font-family: var(--sans); background: var(--sea); }
.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; line-height: 1.45; min-width: 200px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); width: 28px; height: 28px; font-size: 20px; }
.pop__art { margin: -4px 0 6px; height: 64px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.pop__art svg { height: 60px; width: auto; }
.pop h4 { margin: 0 22px 4px 0; font: 600 17px/1.2 var(--serif); }
.pop p { margin: 0 0 4px; }
.pop .muted { color: var(--muted); font-size: 13px; }
.pop .pop__acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pop .act { min-height: 32px; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow-1) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); font-size: 10.5px; }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-control-home a { display: grid; place-items: center; }
.leaflet-control-home svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tomap { position: fixed; z-index: 900; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display: none; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-2); cursor: pointer; }
.tomap svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

/* ── Món ăn ── */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; margin-bottom: 16px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 14.5px; color: var(--ink-2); min-height: 38px; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.dishgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.dish { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px 16px; box-shadow: var(--shadow-1); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.dish:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.dish__art { margin: 0 -16px 12px; height: 132px; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 100%, var(--rc-soft), transparent 70%), var(--surface-2); border-bottom: 1px solid var(--line); }
.dish__art svg { height: 118px; width: auto; transition: transform .3s; }
.dish:hover .dish__art svg { transform: scale(1.05) rotate(-1deg); }
.dish__head { margin-bottom: 8px; }
.dish__mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--rc-soft); color: var(--rc); font: 600 18px/1 var(--serif); flex: none; }
.dish h3 { font-size: 20px; }
.dish small { display: block; color: var(--muted); font-size: 12.5px; }
.dish p { font-size: 14.5px; color: var(--ink-2); flex: 1; }
.dish .act { align-self: flex-start; }
.dish[data-r="bac"] { --rc: #B23A26; --rc-soft: #F6E1DA; }
.dish[data-r="trung"] { --rc: #A86A0C; --rc-soft: #F6EAD2; }
.dish[data-r="nam"] { --rc: #1C7A72; --rc-soft: #DCEFEC; }
.dish[data-r="all"] { --rc: #46668F; --rc-soft: #E1E8F2; }
:root[data-theme="dark"] .dish { --rc-soft: color-mix(in srgb, var(--rc) 22%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dish { --rc-soft: color-mix(in srgb, var(--rc) 22%, transparent); } }

/* ── Danh hiệu ── */
.awardgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.award { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-1); }
.award__icon { width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 16px/1 var(--sans); margin-bottom: 10px; }
.award__icon svg { width: 18px; height: 18px; fill: #fff; }
.award h3 { font-size: 18px; margin-bottom: 6px; }
.award p { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.award .act { margin-top: 2px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.fact { background: var(--surface-2); border-radius: var(--r); padding: 18px; }
.fact h3 { margin-bottom: 8px; }
.fact p { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--ink-2); }
.timeline li { display: flex; gap: 10px; }
.timeline b { color: var(--accent); min-width: 56px; font-variant-numeric: tabular-nums; }

/* ── Mẹo ── */
.tipgrid { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tipgrid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.tipgrid b { display: block; font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.tipgrid span { font-size: 14.5px; color: var(--ink-2); }

/* ── Dữ liệu ── */
.datagrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.card-plain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card-plain h3 { margin-bottom: 10px; }
.card-plain p { font-size: 14.5px; color: var(--ink-2); }
.legendlist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.legendlist li { display: flex; gap: 10px; align-items: flex-start; }
.geo { width: 18px; height: 18px; border-radius: 50% 50% 50% 3px; transform: rotate(-45deg); background: var(--c-selected); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); flex: none; margin-top: 3px; }
.geo--approx { border-style: dashed; border-color: var(--surface); box-shadow: 0 0 0 1px var(--ink-2); background: color-mix(in srgb, var(--c-selected) 55%, transparent); }
.geo--poi { background: var(--c-local); }
.dl-actions { display: grid; gap: 8px; margin: 10px 0; }

/* ── Chân trang ── */
.footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); padding: 28px max(16px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom)); }
.footer__in { max-width: 1280px; margin: auto; font-size: 13.5px; color: var(--muted); }
.footer__in p { max-width: 70em; }
.footer__brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 17px; color: var(--ink); }
.footer__brand img { border-radius: 6px; }
.footer__legal { color: var(--ink-2); font-weight: 600; }
.footer a { color: var(--ink-2); }

/* ── Hộp thoại điều khoản ── */
.terms { width: min(720px, calc(100vw - 24px)); max-height: min(86vh, 900px); border: 1px solid var(--line); border-radius: 18px; padding: 26px 26px 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.terms::backdrop { background: rgba(20, 14, 10, .55); backdrop-filter: blur(2px); }
.terms h2 { font-size: 28px; margin-right: 48px; }
.terms h3 { font-size: 17.5px; margin: 18px 0 6px; }
.terms p, .terms li { font-size: 14.5px; color: var(--ink-2); }
.terms ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.terms__close { position: sticky; top: 0; float: right; margin: -8px -8px 0 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 3000; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { text-align: center; padding: 16px; }

/* ── Màn hình vừa ── */
@media (max-width: 1100px) {
  .awardgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .explorer__body { grid-template-columns: 360px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero__art { order: -1; width: min(250px, 66%); margin-bottom: -8px; }
  .explorer__body { grid-template-columns: 1fr; }
  .mapwrap { position: relative; top: 0; order: 0; height: 56vh; height: 56svh; min-height: 320px; max-height: 560px; }
  .listwrap { order: 1; }
  .tomap.visible { display: inline-flex; }
  .facts, .tipgrid, .datagrid { grid-template-columns: 1fr; }
  .awardgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { display: none; }
  .brand { margin-right: auto; }
}
@media (max-width: 560px) {
  :root { --header-h: 54px; }
  body { font-size: 15.5px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats dd { font-size: 24px; }
  .hero__cta .btn { flex: 1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { scroll-snap-align: start; }
  .toolbar__row select { flex: 1 1 100%; }
  .toolbar__row .chip { flex: 1; justify-content: center; }
  .awardgrid { grid-template-columns: 1fr; }
  .place__name button { font-size: 19.5px; }
  .terms { padding: 20px 18px 16px; }
  .legend { max-width: calc(100% - 20px); bottom: 24px; }
}

/* ── In ── */
@media print {
  .topbar, .hero__art, .hero__cta, .toolbar, .mapwrap, .tomap, .seg, .dish .act, .award .act, .place__actions, .dl-actions, .toast, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .explorer__body { display: block; }
  .place, .dish, .award, .tipgrid li, .card-plain, .fact { box-shadow: none; break-inside: avoid; border-color: #bbb; }
  a { color: #000; }
  .footer { background: #fff; }
}

/* ── Khách Hàn gợi ý ── */
.badge--kr { --c: #3B5BA9; }
:root[data-theme="dark"] .badge--kr { --c: #8FB0F0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge--kr { --c: #8FB0F0; } }
details.kr { margin-top: 8px; border-radius: 10px; background: var(--surface-2); padding: 6px 12px; font-size: 14px; }
details.kr summary { cursor: pointer; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; list-style: none; min-height: 30px; }
details.kr summary::-webkit-details-marker { display: none; }
details.kr summary::before { content: "▸"; font-size: 12px; transition: transform .15s; }
details.kr[open] summary::before { transform: rotate(90deg); }
.kr__ko { font-weight: 400; color: var(--muted); font-size: 13px; }
details.kr p { margin: 6px 0 4px; color: var(--ink-2); }
.kr__src { font-size: 12.5px; color: var(--muted) !important; }
.kr-taste { background: var(--surface-2); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; }
.kr-taste h3 { margin-bottom: 8px; }
.kr-taste ul { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14.5px; }
.kr-count { color: var(--ink-2); margin: 0 auto 10px; }
.kr-count b { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.krgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.krcard { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-1); }
.krcard__art { flex: none; width: 84px; height: 62px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.krcard__art svg { width: 78px; height: 54px; }
.krcard__body { min-width: 0; }
.krcard__city { margin: 0; font-size: 12.5px; color: var(--muted); }
.krcard h3 { font-size: 19px; margin: 2px 0; }
.krcard__ko { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.krcard__body > p:not([class]) { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.krcard__acts { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) { .krcard { flex-direction: column; } .krcard__art { width: 100%; height: 96px; } .krcard__art svg { width: 130px; height: 90px; } }
@media print { .krcard__acts, details.kr summary::before { display: none !important; } details.kr { display: block; } }
