:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #1b1b19;
  --muted: #6b6b66;
  --line: #e4e4de;
  --accent: #e8503a;
  --accent-ink: #ffffff;
  --good: #1f8a4c;
  --good-bg: #e5f4ea;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(0 0 0 / .06);
  --wolt: #009de0;
  --glovo: #f2b100;
  --ubereats: #06a85a;
  --bolt: #2a9d6c;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1c1a;
    --surface-2: #262623;
    --text: #f1f1ec;
    --muted: #a3a39c;
    --line: #2f2f2b;
    --accent: #ff6a52;
    --good: #5fd08f;
    --good-bg: #17301f;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); margin: 0; font-size: 13px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 14px; letter-spacing: -.5px; }
.address { display: flex; align-items: center; gap: 6px; border: 0; background: var(--surface-2); border-radius: 999px; padding: 8px 14px; cursor: pointer; max-width: 280px; }
.address:hover { background: var(--line); }
.address svg, .search svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.address span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 999px; padding: 8px 14px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 8px 16px 48px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }

/* Platform badges */
.pb { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; white-space: nowrap; }
.pb.wolt { background: var(--wolt); }
.pb.glovo { background: var(--glovo); color: #2b2100; }
.pb.ubereats { background: var(--ubereats); }
.pb.bolt { background: var(--bolt); }
.dots { display: flex; gap: 4px; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.dot.wolt { background: var(--wolt); } .dot.glovo { background: var(--glovo); color: #2b2100; }
.dot.ubereats { background: var(--ubereats); } .dot.bolt { background: var(--bolt); }

/* Deals carousel */
.deal-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 280px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.deal { scroll-snap-align: start; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; border: 0; padding: 0; text-align: left; }
.deal .img { position: relative; aspect-ratio: 16/9; }
.d-hint { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--muted); }
.deal .info { padding: 10px 12px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.deal .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Image placeholder */
.img { background: var(--surface-2) center/cover no-repeat; }
.img.ph { display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--muted); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.plat.active[data-platform="wolt"] { background: var(--wolt); border-color: var(--wolt); color: #fff; }
.chip.plat.active[data-platform="glovo"] { background: var(--glovo); border-color: var(--glovo); color: #2b2100; }
.chip.plat.active[data-platform="ubereats"] { background: var(--ubereats); border-color: var(--ubereats); color: #fff; }
.chip.plat.active[data-platform="bolt"] { background: var(--bolt); border-color: var(--bolt); color: #fff; }
.sep { width: 1px; height: 22px; background: var(--line); }
.grow { flex: 1; }
.sort { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.sort select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 8px; }

/* Grid of restaurants */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: transparent; border: 0; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.card .img { position: relative; aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; transition: transform .15s ease; }
.card:hover .img, .card:focus-visible .img { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .badge, .deal .badge { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .closed { position: absolute; inset: 0; background: rgb(0 0 0 / .5); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 18px; letter-spacing: .02em; }
.card.is-closed .img { filter: grayscale(1); }
.card.is-closed .row, .card.is-closed .meta { opacity: .55; }
.card .dots { position: absolute; right: 8px; bottom: 8px; }
.card .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .name { font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .rating { font-size: 13px; font-weight: 600; white-space: nowrap; }
.card .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta b { color: var(--text); font-weight: 600; }

.more { display: flex; justify-content: center; margin-top: 24px; }
.more button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 22px; cursor: pointer; font-weight: 600; }
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 40px 0; }

/* Detail dialog */
dialog { border: 0; padding: 0; border-radius: 18px; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.d-hero { position: relative; aspect-ratio: 16/6; background: var(--surface-2) center/cover no-repeat; }
.d-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.d-body { padding: 18px 20px 20px; }
.d-body h2 { margin: 0 0 4px; font-size: 24px; }
.d-verdict { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.verdict { background: var(--good-bg); color: var(--good); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.d-offers { display: grid; gap: 10px; }
.offer { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
.offer.best { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.offer .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer .vname { color: var(--muted); font-size: 13px; }
.offer .stats { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 320px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.stat small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.stat span { font-weight: 650; font-size: 14px; }
.stat .win { color: var(--good); }
.offer .promos { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 6px; }
.promo-tag { font-size: 12.5px; padding: 3px 8px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.promo-tag.dim { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.promo-tag .lbl { opacity: .8; font-weight: 500; }
.go { align-self: center; text-decoration: none; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: 14px; white-space: nowrap; }
.go:hover { opacity: .85; }
.d-note { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; }
  .logo-text { display: none; }
  .address { max-width: none; flex: 1; }
  .search { flex-basis: 100%; }
  .offer .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sep { display: none; }
}

/* Address dialog */
dialog.addr { width: min(560px, calc(100vw - 24px)); }
.addr-body { padding: 18px 20px 20px; }
.addr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.addr-head h2 { margin: 0; font-size: 20px; }
.x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 20px; cursor: pointer; }
.addr-list { display: grid; gap: 6px; margin-bottom: 16px; }
.addr-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.addr-row-item { display: flex; gap: 6px; }
.addr-row-item .addr-item { flex: 1; min-width: 0; }
.addr-refresh { flex: none; width: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; font-size: 18px; cursor: pointer; }
.addr-refresh:hover { border-color: var(--accent); color: var(--accent); }
.addr-refresh:disabled { opacity: .4; cursor: default; }
.addr-item:hover { border-color: var(--text); }
.addr-item.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.addr-item small { color: var(--muted); white-space: nowrap; }
.addr-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.addr-row { display: flex; gap: 8px; }
.addr-row input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.addr-row button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 10px 14px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.addr-row button:disabled { opacity: .5; cursor: default; }
.addr-form .muted { margin-top: 6px; }
.job { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.job-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.job pre { margin: 0; max-height: 240px; overflow: auto; background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: 12px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.spinner.done { animation: none; border-color: var(--good); }
.spinner.fail { animation: none; border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pasek pobierania pod nagłówkiem */
.jobbar { position: sticky; top: 61px; z-index: 9; width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); padding: 8px 16px; cursor: pointer; text-align: left; font-size: 14px; }
.jobbar .jb-text { font-weight: 600; }
.jb-plats, .job-plats { display: flex; gap: 6px; flex-wrap: wrap; }
.pst { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.pst.ok { border-color: var(--good); color: var(--good); }
.pst.fail { border-color: var(--accent); color: var(--accent); }
.pst.ask { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.jb-ask { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 3px 10px; font-weight: 700; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.job-plats { margin-bottom: 10px; }
.job-ask { background: var(--surface-2); border: 2px solid var(--accent); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.job-ask p { margin: 0 0 8px; }
.job-ask button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.job details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.chk { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; font-weight: 500 !important; }
.addr-err { color: var(--accent); font-weight: 600; margin: 8px 0 0; }
@media (max-width: 640px) { .jobbar { top: 105px; } }

/* Pasek postępu pobierania i anulowanie */
.progress { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .6s ease; }
.progress.done > span { background: var(--good); }
.job-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.job-progress .progress { flex: 1; }
.job-pct, .jb-pct { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; min-width: 3.2em; text-align: right; }
.job-phase { margin: 0 0 10px; font-size: 13px; }
.job-cancel { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 6px 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.job-cancel:hover { border-color: var(--accent); color: var(--accent); }
.job-cancel:disabled { opacity: .5; cursor: default; }
.jb-progress { flex: 1 1 120px; min-width: 80px; max-width: 260px; }
.job-note { margin: 0 0 10px; color: var(--muted); }
.job-note.warn { color: var(--accent); font-weight: 600; }
.addr-err.info { color: var(--muted); }
[hidden] { display: none !important; }

/* „Gdzie jesteś”: adres użytkownika i skąd są dane */
.near { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 16px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.near-text { flex: 1 1 320px; min-width: 0; }
.near-text b { display: block; font-size: 16px; }
.near-text .muted { margin-top: 2px; font-size: 14px; }
.near-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.near-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 14px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.near-btn:hover { border-color: var(--text); }
.near-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.near-btn:disabled { opacity: .6; cursor: default; }
@media (max-width: 640px) { .near { padding: 12px; gap: 10px; } .near-actions { width: 100%; } .near-btn { flex: 1; padding: 9px 8px; } }

/* Podpowiedzi adresów */
/* pole adresu z podpowiedziami */
.addr-combo { position: relative; }
.addr-field { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.addr-field > svg { position: absolute; left: 12px; width: 18px; height: 18px; fill: var(--muted); pointer-events: none; }
.addr-row .addr-field input { width: 100%; padding: 12px 38px 12px 38px; font-size: 16px; }
.addr-row .addr-field input:focus { outline: none; border-color: var(--text); }
.addr-row .addr-clear { position: absolute; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.addr-row .addr-clear { display: grid; place-items: center; padding: 0; }
.addr-row .addr-clear svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.addr-row .addr-clear[hidden] { display: none; }
.addr-row .addr-clear:hover { color: var(--text); }
.addr-sugg { list-style: none; margin: 6px 0 0; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; }
.addr-sugg button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 10px; border-radius: 8px; cursor: pointer; }
.addr-sugg button svg { flex: none; width: 18px; height: 18px; fill: var(--muted); }
.addr-sugg button > span { display: flex; flex-direction: column; min-width: 0; }
.addr-sugg .s-main { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-sugg .s-main b { font-weight: 750; }
.addr-sugg .s-sub { font-size: 13px; color: var(--muted); }
.addr-sugg button:hover, .addr-sugg button.active { background: var(--surface-2); }
.addr-geo { display: flex; align-items: center; gap: 8px; margin-top: 12px; border: 0; background: transparent; color: var(--accent); font-weight: 650; cursor: pointer; padding: 6px 0; }
.addr-geo svg { width: 18px; height: 18px; fill: currentColor; }
.addr-geo:disabled { opacity: .5; cursor: default; }
.addr-credit { font-size: 11px; margin-top: 14px; }
.addr-sub { font-size: 14px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }

/* Otwarte / zamknięte z godzin otwarcia */
.open-line { grid-column: 1/-1; font-size: 14px; }
.open-st { font-weight: 650; }
.open-st.is-closed { color: var(--accent); }
details.hours { grid-column: 1/-1; font-size: 13px; }
details.hours summary { cursor: pointer; color: var(--muted); }
details.hours table { border-collapse: collapse; margin-top: 6px; }
details.hours td { padding: 2px 14px 2px 0; }
details.hours tr.today { font-weight: 700; }

/* Zgłoszenie „nieaktualne dane” */
.report-open { margin-top: 12px; border: 0; background: transparent; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: 13px; }
.report { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.report-reasons, .report-plats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.report .chk { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.report button[type="submit"] { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 8px 14px; font-weight: 650; cursor: pointer; margin: 4px 0 6px; }
.report button:disabled { opacity: .5; cursor: default; }
.report-msg { margin: 0; font-weight: 600; color: var(--accent); }
.report-msg.ok { color: var(--good); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* pozycje menu objęte promocją (szczegóły lokalu) */
.deal-items { margin-top: 8px; font-size: 14px; }
.deal-items summary { cursor: pointer; font-weight: 600; }
.deal-items ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.deal-items li { display: flex; gap: 8px; align-items: baseline; }
.deal-items .dk { flex: none; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.deal-items .dn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-items .dp { flex: none; color: var(--muted); }

/* strzałki przy poziomych rzędach */
.scroller { position: relative; }
.scroller .arr { position: absolute; top: calc(50% - 30px); z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; padding: 0; }
.scroller .arr svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.scroller .arr[hidden] { display: none; }
.scroller .prev { left: -14px; }
.scroller .next { right: -14px; }
@media (hover: none) { .scroller .arr { display: none; } } /* na telefonie przewija się palcem */

/* stopka */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 32px; background: var(--bg); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; font-size: 13px; line-height: 1.5; }
.footer-inner p { margin: 0 0 6px; }
