:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f3;
  --card: #ffffff;
  --text: #1c1c1a;
  --muted: #6d6d68;
  --line: #e8e8e4;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --accent-soft: #fff0eb;
  --ok: #1f9d55;
  --star: #f5a623;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --radius: 14px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --bg-soft: #1c1c1a; --card: #1c1c1a; --text: #f1f1ee; --muted: #a3a39d;
    --line: #2c2c29; --accent-soft: #3a1f17; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.4; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 16px; align-items: center; }
.logo { font-weight: 800; font-size: 26px; letter-spacing: -1px; }
.logo span { color: var(--accent); }
.search { flex: 1; max-width: 560px; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--muted); }
.search input { width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); padding: 0 16px 0 42px; font-size: 15px; outline: none; }
.search input:focus { border-color: var(--accent); background: var(--bg); }
.city { color: var(--muted); font-size: 14px; white-space: nowrap; }
@media (max-width: 640px) { .city { display: none; } .logo { font-size: 22px; } }

main { max-width: 1240px; margin: 0 auto; padding: 8px 16px 40px; min-height: 70vh; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .e { font-size: 17px; }

/* Sections */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section h2 { font-size: 22px; letter-spacing: -.3px; margin: 0; }
.section-head a, .link { color: var(--accent); font-weight: 600; font-size: 14px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 240px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 14px; }
.grid.rest { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 6px 0 4px; color: var(--muted); font-size: 14px; }
.toolbar .count { color: var(--text); font-weight: 600; margin-right: auto; }
.toolbar select { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 8px; font: inherit; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.toolbar input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* Media */
.ph { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft)); }
.ph .badge { position: absolute; left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.ph .badge.off { background: rgba(0,0,0,.7); color: #fff; }

/* Dish card */
.dish { text-align: left; background: none; border: 0; padding: 0; display: block; width: 100%; }
.dish:hover .ph img, .rcard:hover .ph img { transform: scale(1.04); }
.dish .meta { padding: 8px 2px 0; }
.dish .name { font-weight: 650; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish .rest { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 700; color: var(--accent); font-size: 14px; margin-top: 4px; }
.price s { color: var(--muted); font-weight: 400; margin-left: 6px; }
.dish.na { opacity: .5; }

/* Restaurant card */
.rcard { display: block; }
.rcard .ph { aspect-ratio: 16 / 9; }
.rcard .meta { padding: 10px 2px 0; }
.rcard .name { font-weight: 700; font-size: 16px; }
.rcard .sub { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star { color: var(--star); }
.sep { opacity: .6; }
.hero .sub span { overflow-wrap: anywhere; }

/* Restaurant page */
.hero { position: relative; margin: 14px 0 0; border-radius: 20px; overflow: hidden; height: clamp(180px, 24vw, 300px); background: var(--bg-soft); }
.hero img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px) brightness(.55) saturate(1.1); transform: scale(1.08); }
.hero .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft)); }
.hero .over { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 24px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.hero h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.5px; }
.hero .sub { margin-top: 6px; font-size: 14px; opacity: .95; }
.rinfo { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0 4px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 700; font-size: 15px; border: 1px solid var(--line); background: var(--card); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.pill { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.catnav { position: sticky; top: 69px; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); margin: 10px -16px 0; padding: 0 16px; }
.catnav .chips { padding: 10px 0; }
.catnav .chip { height: 32px; font-size: 13px; }
.menu-sec { margin-top: 26px; scroll-margin-top: 130px; }
.menu-sec h3 { font-size: 19px; margin: 0 0 10px; }
.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
@media (max-width: 420px) { .mlist { grid-template-columns: 1fr; } }
.mitem { display: flex; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; width: 100%; }
.mitem:hover { box-shadow: var(--shadow); }
.mitem .txt { flex: 1; min-width: 0; }
.mitem .name { font-weight: 650; }
.mitem .desc { color: var(--muted); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mitem .thumb { width: 116px; flex: none; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.mitem .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mitem.na { opacity: .5; }
.inrest { margin: 14px 0 0; max-width: 360px; }
.inrest input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); padding: 0 12px; font: inherit; }

/* Dish modal */
.dish-modal { border: 0; padding: 0; border-radius: 20px; width: min(520px, calc(100vw - 24px)); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dish-modal::backdrop { background: rgba(0,0,0,.5); }
.dish-modal .ph { border-radius: 0; aspect-ratio: 4 / 3; }
.dish-modal .body { padding: 18px 20px 20px; }
.dish-modal h3 { margin: 0; font-size: 22px; }
.dish-modal .desc { color: var(--muted); margin: 8px 0 0; }
.dish-modal .price { font-size: 18px; margin-top: 10px; }
.dish-modal .from { margin-top: 12px; font-size: 14px; color: var(--muted); }
.dish-modal .from a { color: var(--text); font-weight: 650; text-decoration: underline; }
.dish-modal .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.dish-modal .actions .btn { flex: 1; justify-content: center; min-width: 160px; }
.dish-modal .x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; z-index: 2; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }

.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.sentinel { height: 1px; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; padding: 20px 16px 30px; }

/* Category bar (icon above label) */
.cats { display: flex; gap: 4px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.cat .ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--bg-soft); transition: transform .15s ease; }
.cat:hover .ic { transform: scale(1.06); }
.cat:hover, .cat.on { color: var(--text); }
.cat.on .ic { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cat .lb { white-space: nowrap; }

/* Restaurant sections with dish carousels */
.rlist { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.rsec { padding: 32px 0 36px; border-top: 1px solid var(--line); }
.rsec:first-child { border-top: 0; padding-top: 16px; }
.rsec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rlogo { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; font-size: 26px; box-shadow: 0 0 0 1px var(--line); }
.rlogo img { width: 100%; height: 100%; object-fit: cover; }
.rsec-info { flex: 1; min-width: 0; }
.rname { font-weight: 750; font-size: 18px; letter-spacing: -.2px; }
.rname .chev { color: var(--muted); font-weight: 400; margin-left: 2px; }
.rname:hover { color: var(--accent); }
.rdesc { font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmeta { font-size: 13px; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.btn.small { height: 34px; padding: 0 14px; font-size: 14px; flex: none; }
.arrows { display: flex; gap: 8px; flex: none; }
.arrow { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); font-size: 16px; font-weight: 700; }
.arrow:disabled { opacity: .35; cursor: default; }

.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 24vw, 330px); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.carousel::-webkit-scrollbar { display: none; }
.dcard { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--bg-soft); scroll-snap-align: start; text-align: left; }
.dcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.dcard:hover img { transform: scale(1.04); }
.dcard .tagpill { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); display: flex; gap: 4px; background: rgba(20,20,18,.78); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; backdrop-filter: blur(4px); }
.dcard .tagpill .pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dcard .tagpill .pp { flex: none; }
.dcard .tagpill .price, .dcard .tagpill s { color: inherit; }
.dcard .tagpill s { opacity: .6; font-weight: 400; margin-left: 4px; }
.dcard .dotsep { opacity: .7; margin: 0 2px; }
.dcard .noimg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px 16px 12px; background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft)); text-align: center; }
.dcard .noimg span { font-size: 34px; }
.dcard .noimg b { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .na-badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.dcard.na img { filter: grayscale(.8); opacity: .6; }
.dcard.more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; }
.dcard.more small { color: var(--muted); font-weight: 500; }
.dcard.more b { color: var(--accent); font-size: 22px; }
.dcard.more:hover { background: var(--accent-soft); }

@media (max-width: 720px) {
  .arrows { display: none; }
  .rsec-head { flex-wrap: wrap; gap: 10px 12px; }
  .rsec { padding: 26px 0 28px; }
  .rsec-head .order { order: 3; }
  .rdesc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .carousel { grid-auto-columns: 72%; }
  .cat { width: 78px; } .cat .ic { width: 50px; height: 50px; font-size: 24px; }
}
