/* כשר לי. Phone first, RTL. Modeled on how people already find food (Rest, Wolt, Google Maps):
   a photo hero with one search box, city and category shortcuts, swipeable photo cards,
   a compact list, and a page per restaurant. The kashrut "stamp" (violet ink) is the trust signal:
   full ink = verified, outlined = valid certificate, faint dashed = no certificate yet.
   Kitchen color code: red meat, blue dairy, green parve, teal fish. */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1F0F5;
  --ink: #17151F;
  --muted: #676373;
  --line: #E6E4EC;
  --accent: #5B3CC4;          /* brand violet / stamp ink */
  --accent-soft: #EFEAFD;
  --accent-ink: #FFFFFF;
  --meat: #C8372D;
  --dairy: #1F64B8;
  --parve: #2B7D4E;
  --fish: #167A76;
  --ok: #1F7A45;
  --owner: #8A5A00;
  --owner-bg: #FBF1DC;
  --danger: #B42B22;
  --font-logo: "Suez One", "Frank Ruhl Libre", serif;
  --font-body: "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(20, 15, 40, .06), 0 4px 16px rgba(20, 15, 40, .07);
  --shadow-fab: 0 6px 18px rgba(45, 25, 110, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111017; --surface: #1A1822; --surface-2: #24212F; --ink: #EEEDF3; --muted: #A5A1B3;
    --line: #2F2B3C; --accent: #B3A0FF; --accent-soft: #2B2445; --accent-ink: #111017;
    --meat: #F28B81; --dairy: #8BB8F2; --parve: #84CFA2; --fish: #73D0CB; --ok: #84CFA2;
    --owner: #E8BA55; --owner-bg: #2E2614; --danger: #F28B81;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .35); --shadow-fab: 0 6px 18px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111017; --surface: #1A1822; --surface-2: #24212F; --ink: #EEEDF3; --muted: #A5A1B3;
  --line: #2F2B3C; --accent: #B3A0FF; --accent-soft: #2B2445; --accent-ink: #111017;
  --meat: #F28B81; --dairy: #8BB8F2; --parve: #84CFA2; --fish: #73D0CB; --ok: #84CFA2;
  --owner: #E8BA55; --owner-bg: #2E2614; --danger: #F28B81;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .35); --shadow-fab: 0 6px 18px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* Flags for the phone country menu. Phones draw flag emoji themselves; Windows doesn't, so this
   small font (loaded only where a flag is shown) draws them there. */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* while a window is open, the page behind it stays still (scrolling inside the window doesn't move it either) */
html:has(dialog[open]) { overflow: hidden; }
dialog { overscroll-behavior: contain; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
button, select, input, textarea { font: inherit; color: inherit; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 28px; }
.muted { color: var(--muted); }

/* ---------- logo + kashrut stamp ---------- */
.logo {
  display: inline-block; text-decoration: none; color: var(--accent);
  font-family: var(--font-logo); font-size: 1.3rem; line-height: 1;
  padding: 5px 11px 6px; border: 2.5px solid currentColor; border-radius: 8px;
  outline: 1px solid currentColor; outline-offset: 2.5px; transform: rotate(-3deg); margin: 6px 4px;
}
.logo.small { font-size: 1rem; padding: 4px 9px 5px; border-width: 2px; }
.stamp {
  align-self: start; justify-self: end; text-align: center;
  color: var(--accent); border: 2px solid currentColor; border-radius: 7px;
  outline: 1px solid currentColor; outline-offset: 2px;
  padding: 3px 10px 4px; max-width: 150px; line-height: 1.25;
  font-weight: 700; font-size: .82rem; transform: rotate(-2deg);
}
.stamp small { display: block; font-weight: 500; font-size: .72rem; }
.stamp .ico svg { width: 13px; height: 13px; vertical-align: -2px; }
.stamp.full { background: var(--accent); color: var(--accent-ink); outline-color: var(--accent); border-color: var(--accent-ink); }
.stamp.faint { color: var(--muted); border-style: dashed; outline-style: dashed; transform: rotate(-1deg); }
.stamp.mini {
  font-size: .72rem; padding: 0 7px 1px; border-width: 1.5px; outline-offset: 1.5px; border-radius: 5px;
  max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-self: start; margin: 2px;
}
@keyframes stamp-press {
  0% { transform: scale(1.6) rotate(-8deg); opacity: 0; }
  55% { transform: scale(.94) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1) rotate(-2deg); }
}
.stamps { display: grid; gap: 10px; justify-items: end; align-self: start; }
.stamp.extra { font-size: .74rem; padding: 2px 8px 3px; }
.cert-kind { font-weight: 700; }
.cert-kind small { font-weight: 500; color: var(--muted); }
.extra-certs { display: grid; gap: 8px; justify-items: start; padding-top: 10px; border-top: 1px dashed var(--line); }
.extra-certs .lbl { font-weight: 700; font-size: .85rem; }
.more-stamps { background: none; border: 0; padding: 2px 4px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--accent); text-decoration: underline; cursor: pointer; }
.more-k { font-size: .78rem; font-weight: 700; color: var(--accent); }
.fits { justify-self: start; font-size: .75rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 6px; }
.chip.near[aria-busy="true"] { opacity: .7; }
.nearby { margin-top: 18px; }
.nearby .sec-title { font-size: 1.1rem; }
.stamp.press { animation: stamp-press .45s cubic-bezier(.3, 1.4, .5, 1) both; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; padding-top: env(safe-area-inset-top, 0px); }
body.scrolled .bar { border-bottom-color: var(--line); box-shadow: 0 2px 12px rgba(20, 15, 40, .06); }
.bar-in { max-width: 1040px; margin: 0 auto; padding: 6px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.account .meta { font-size: .85rem; }
.logo { white-space: nowrap; flex: none; }
/* account: a round photo button with a small menu */
.me-menu { position: relative; }
.me-menu summary { list-style: none; cursor: pointer; position: relative; display: block; width: 40px; height: 40px; border-radius: 50%; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu summary img, .me-menu .initial { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; }
.me-menu .initial { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.1rem; }
.me-menu[open] summary { box-shadow: 0 0 0 3px var(--accent-soft); }
.me-menu .dot { position: absolute; top: -4px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.me-menu .menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 20; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.me-menu .menu-hello { padding: 10px 12px 8px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.me-menu .menu a, .me-menu .menu button { display: block; width: 100%; text-align: start; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; }
.me-menu .menu a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me-menu .pill { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .78rem; line-height: 1.6; }
.me-menu .menu a:hover, .me-menu .menu button:hover { background: var(--surface-2); }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- hero ---------- */
.hero {
  color: #fff; padding: 44px 16px 34px;
  background: linear-gradient(180deg, rgba(12, 10, 22, .45), rgba(12, 10, 22, .72)), #2a2433 url("img/hero-sm.jpg") center / cover no-repeat;
}
@media (min-width: 720px) { .hero { background-image: linear-gradient(180deg, rgba(12, 10, 22, .4), rgba(12, 10, 22, .7)), url("img/hero.jpg"); padding-block: 72px 56px; } }
.hero-in { max-width: 680px; margin: 0 auto; display: grid; gap: 12px; }
.hero h1 { margin: 0; font-weight: 700; font-size: clamp(2rem, 8.5vw, 3.2rem); letter-spacing: -.01em; text-wrap: balance; }
.hero p { margin: 0; color: rgba(255, 255, 255, .88); font-size: 1.05rem; max-width: 46ch; text-wrap: pretty; }
.hero .stats { font-size: .9rem; color: rgba(255, 255, 255, .75); }
.search-row { position: relative; margin-top: 8px; }
.search-row input[type="search"] {
  width: 100%; height: 56px; padding: 0 52px 0 18px; font-size: 1.05rem; color: #17151F;
  border: 0; border-radius: 999px; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.search-row input[type="search"]::placeholder { color: #7a7685; }
.search-row input[type="search"]:focus { outline: 3px solid rgba(179, 160, 255, .9); outline-offset: 2px; }
.search-row .ico { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: #5B3CC4; pointer-events: none; }
.search-row .ico svg { width: 22px; height: 22px; }

/* ---------- home sections ---------- */
.home { display: grid; gap: 28px; }
.sec { display: grid; gap: 12px; min-width: 0; }
.sec-title { margin: 0; font-size: 1.3rem; font-weight: 700; }
/* scroll-padding: snapping keeps the 16px side gap, so a row starts at its first button (not 16px past it) */
.scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; margin-inline: -16px; padding: 2px 16px 6px; scroll-padding-inline: 16px; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { flex: none; scroll-snap-align: start; }
@media (min-width: 720px) { .scroller { margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; } }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 16px; cursor: pointer; font-size: .95rem; font-weight: 600;
}
.chip small { color: var(--muted); font-weight: 500; font-size: .8rem; }
a.chip { text-decoration: none; color: var(--ink); }
.more-btn { justify-self: center; margin-top: 8px; }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, transparent); display: var(--dot-display, none); }
.chip[data-v="meat"] { --dot: var(--meat); --dot-display: block; }
.chip[data-v="dairy"] { --dot: var(--dairy); --dot-display: block; }
.chip[data-v="parve"] { --dot: var(--parve); --dot-display: block; }
.chip[data-v="fish"] { --dot: var(--fish); --dot-display: block; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] small { color: inherit; }


/* the finder: three steps, each a row of buttons */
.finder { display: grid; gap: 20px; min-width: 0; }
.step { display: grid; gap: 10px; min-width: 0; }
.step-title { margin: 0; font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.step-title .num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: .8rem; flex: none; }
.cat-row { display: grid; grid-template-columns: repeat(4, 76px); justify-content: space-between; }
@media (min-width: 720px) { .cat-row { justify-content: start; gap: 18px; } }
.cat-pick { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--ink); }
.cat-pick img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; outline: 3px solid transparent; outline-offset: 2px; }
.cat-pick[aria-pressed="true"] img { outline-color: var(--accent); }
.cat-pick[aria-pressed="true"] span { color: var(--accent); font-weight: 700; }
@media (hover: hover) { .cat-pick:hover img { outline-color: var(--line); } .cat-pick[aria-pressed="true"]:hover img { outline-color: var(--accent); } }
/* sideways rows (arrowRow in app.js): a side that has more to see fades out at the edge and shows a round arrow,
   so it is clear the row can be swiped (phone) or dragged / clicked (computer). */
.row-wrap { position: relative; min-width: 0; --edge: -16px; }   /* on a phone the rows reach the screen edges */
@media (min-width: 720px) { .row-wrap { --edge: 0px; } }
.row-wrap::before, .row-wrap::after { content: ""; position: absolute; top: 0; bottom: 6px; width: 64px; z-index: 1;
  pointer-events: none; opacity: 0; transition: opacity .2s; }
/* the page is right-to-left: the start is the right edge, the end is the left edge */
.row-wrap::before { inset-inline-start: var(--edge); background: linear-gradient(to right, transparent, var(--bg)); }
.row-wrap::after { inset-inline-end: var(--edge); background: linear-gradient(to left, transparent, var(--bg)); }
.row-wrap.more-start::before, .row-wrap.more-end::after { opacity: 1; }
.row-arrow { display: grid; place-items: center; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .16); cursor: pointer; }
.row-arrow[hidden] { display: none; }
.row-arrow svg { width: 16px; height: 16px; }
.row-arrow.to-start { inset-inline-start: -10px; }
.row-arrow.to-end { inset-inline-end: -10px; }
.row-wrap:has(.cards) .row-arrow { top: 38%; }
@media (hover: hover) and (pointer: fine) {
  .row-arrow { width: 44px; height: 44px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
  .row-arrow svg { width: 20px; height: 20px; }
  .row-arrow:hover { background: var(--surface-2); }
  .row-arrow.to-start { inset-inline-start: -8px; }
  .row-arrow.to-end { inset-inline-end: -8px; }
  .row-wrap .scroller { cursor: grab; }
  .row-wrap .scroller.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
  .row-wrap .scroller.dragging * { cursor: grabbing; }
}
@media (prefers-reduced-motion: reduce) { .row-wrap::before, .row-wrap::after { transition: none; } }
.chip.near, .chip.find-city { color: var(--accent); border-color: var(--accent); }
.chip.find-city { border-style: dashed; }
.chip .ico svg { width: 15px; height: 15px; vertical-align: -3px; }
.city-search .ac { position: relative; }
.city-search input { width: 100%; height: 46px; padding: 0 16px; font: inherit; font-size: 1rem; color: var(--ink);
  border: 1.5px solid var(--accent); border-radius: 999px; background: var(--surface); }
.city-search input:focus { outline: 3px solid var(--accent-soft); }
.city-search .ac-list small { direction: rtl; }

/* swipeable photo cards */
.scroller.cards { gap: 14px; }
.card-big { width: 250px; text-decoration: none; color: var(--ink); display: grid; gap: 8px; }
.card-photo { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-tag { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(255, 255, 255, .94); color: var(--cat); font-weight: 700; font-size: .78rem; padding: 2px 10px; border-radius: 999px; }
.cat-tag.meat { --cat: #C8372D; } .cat-tag.dairy { --cat: #1F64B8; } .cat-tag.parve { --cat: #2B7D4E; } .cat-tag.fish { --cat: #167A76; }
.card-text { display: grid; gap: 2px; padding-inline: 2px; }
.card-text h3 { margin: 0; font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* how it works (the stamp legend) */
.how { background: var(--surface-2); border-radius: 18px; padding: 18px; }
.how-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.how h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how li { display: grid; gap: 8px; align-content: start; justify-items: start; }
.how li div { display: grid; gap: 2px; }
.how li strong { font-size: .95rem; }
.how li span:not(.stamp) { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.how .stamp { justify-self: start; }

/* ---------- results ---------- */
.results { display: grid; gap: 12px; min-width: 0; }
.res-head { display: flex; align-items: baseline; gap: 10px; }
.res-head .count { color: var(--muted); font-size: .95rem; }
.results.bare .res-head { display: none; }
.res-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res-tools .sort { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.res-tools select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .9rem; }
.filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 14px; background: var(--surface-2); border-radius: 14px; }
.filter-panel .field span { font-weight: 600; font-size: .85rem; }
.filter-panel select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); width: 100%; }
.notice { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; color: var(--muted); background: var(--surface); }

/* list rows (like Google Maps) */
.list { display: grid; }
@media (min-width: 900px) { .list { grid-template-columns: 1fr 1fr; column-gap: 32px; } }
.row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.thumb { width: 88px; height: 88px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-main { display: grid; gap: 3px; min-width: 0; }
.row-main h3 { margin: 0; font-size: 1.08rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); font-size: .88rem; }
.row-trust { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .85rem; margin-top: 2px; }
.row-trust .ok, .ok { color: var(--ok); font-weight: 600; }
@media (hover: hover) { .row:hover h3 { color: var(--accent); } .card-big:hover h3 { color: var(--accent); } }
.cat { font-weight: 700; font-size: .78rem; padding: 1px 9px; border-radius: 999px; color: var(--cat, var(--muted)); background: color-mix(in srgb, var(--cat, var(--muted)) 12%, transparent); }
.cat.meat { --cat: var(--meat); } .cat.dairy { --cat: var(--dairy); } .cat.parve { --cat: var(--parve); } .cat.fish { --cat: var(--fish); }
.verified { color: var(--ok); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.verified .ico svg { width: 15px; height: 15px; }

/* loading placeholders */
.row.skeleton .sk.thumb { width: 88px; height: 88px; border-radius: 14px; }
.sk { display: block; height: 13px; border-radius: 7px; margin: 3px 0; background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk.w40 { width: 45%; height: 18px; } .sk.w25 { width: 25%; } .sk.w70 { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* empty states */
.empty { text-align: center; padding: 40px 20px; background: var(--surface-2); border-radius: 18px; display: grid; gap: 10px; justify-items: center; grid-column: 1 / -1; }
.empty h3 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.empty p { margin: 0; color: var(--muted); max-width: 44ch; }
.empty .stamp.big { font-size: 1.35rem; padding: 8px 18px 10px; max-width: none; justify-self: center; margin: 6px 0 4px; }
.empty .stamp.big small { font-size: .85rem; }
.empty.first { padding-block: 48px; }
.actions.center { justify-content: center; }

/* ---------- restaurant page ---------- */
dialog.page { padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); }
.place-cover { position: relative; height: 240px; background: var(--surface-2); }
.place-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-btns { position: absolute; top: 12px; inset-inline: 12px; display: flex; justify-content: space-between; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); color: #17151F; display: grid; place-items: center; cursor: pointer; font-size: 1.05rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.round-btn .ico svg { width: 20px; height: 20px; }
.place-in { padding: 18px 20px 24px; display: grid; gap: 10px; }
.place-in h2 { margin: 0; font-size: 1.8rem; font-weight: 700; }
.sub-title { margin: 10px 0 0; font-size: 1.1rem; font-weight: 700; }
.place-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding-top: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .85rem; }
.notes { margin: 0; color: var(--muted); overflow-wrap: anywhere; max-width: 62ch; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }
.src.owner { color: var(--owner); background: var(--owner-bg); }
.src.community { color: var(--muted); background: var(--surface-2); }
.src.pending { color: var(--accent); background: var(--accent-soft); border: 1px dashed var(--accent); }
.src .ico svg { width: 12px; height: 12px; }

/* branches (inside the restaurant page) */
.branches { display: grid; }
.branch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding-block: 14px; border-top: 1px solid var(--line); }
.branch .where { display: grid; gap: 4px; min-width: 0; }
.place { overflow-wrap: anywhere; }
.branch .city { font-weight: 700; font-size: 1.05rem; }
.branch .addr { color: var(--muted); }
.branch .addr::before { content: ", "; }
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .85rem; color: var(--muted); }
.trust .bad, .bad { color: var(--danger); font-weight: 600; }
.meter { display: inline-flex; gap: 2px; vertical-align: middle; }
.meter i { width: 6px; height: 11px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line); }
.meter i.on { background: var(--ok); border-color: var(--ok); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.link-ico { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: .9rem; min-height: 38px; padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.link-ico .ico svg { width: 17px; height: 17px; }
.link-ico.phone, .phone { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.more { grid-column: 1 / -1; }
.more summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg) translateY(-2px); transition: transform .15s; }
.more[open] summary::after { transform: rotate(135deg) translate(-2px, 0); }
.more-body { display: grid; gap: 10px; padding: 12px; margin-top: 4px; background: var(--surface-2); border-radius: 12px; }
.more-body .row2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.verify { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .85rem; color: var(--muted); }
.btn.confirm[aria-pressed="true"] { border-color: var(--ok); color: var(--ok); }
.cert { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .85rem; }
.cert .missing { color: var(--muted); }
.cert-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); padding: 0; display: block; }
.cert-thumb.wide { width: 160px; height: 110px; }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
.cert-thumb .zoom { position: absolute; inset-inline-start: 3px; bottom: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.cert-thumb .zoom .ico svg { width: 11px; height: 11px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); padding: 8px 16px;
  border-radius: 999px; cursor: pointer; font-weight: 600; min-height: 42px; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 4px 14px; font-size: .88rem; min-height: 36px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.big { min-height: 50px; font-size: 1.05rem; width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn[aria-busy] { opacity: .85; }
.btn[aria-busy]::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn .ico svg { width: 18px; height: 18px; }
.ico { display: inline-flex; }
.ico svg { width: 1.1em; height: 1.1em; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .85rem; padding-bottom: 96px; }
.foot-in { max-width: 1040px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 12px; justify-items: start; }
.foot p { margin: 0; max-width: 64ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
/* donations box, above the footer text */
.support { padding: 24px 16px 0; }
.support-in { max-width: 1040px; margin: 0 auto; background: var(--accent-soft); border-radius: 20px; padding: 20px; display: grid; gap: 10px; justify-items: start; color: var(--ink); font-size: .95rem; }
.support h2 { margin: 0; font-size: 1.25rem; }
.support p { margin: 0; }
.support ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 3px; }
.support-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.support-btns .btn { text-decoration: none; min-width: 140px; justify-content: center; }
.support-abroad { font-size: .85rem; color: var(--muted); }

/* ---------- dialogs and forms ---------- */
dialog { border: 0; border-radius: 20px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(15, 10, 30, .55); }
dialog form { display: grid; gap: 14px; padding: 22px 20px; }
dialog h2 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.stack { display: grid; gap: 14px; }
.sub { margin: 0; color: var(--muted); }
.lbl { font-weight: 600; font-size: .9rem; }
.fine { margin: 0; color: var(--muted); font-size: .8rem; }
.field { display: grid; gap: 5px; }
.field label, .field legend { font-weight: 600; font-size: .9rem; }
/* text boxes only: round choice buttons and check boxes keep their own look */
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea { padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); width: 100%; min-width: 0; }
.field input:not([type="radio"]):not([type="checkbox"]):focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field .hint { color: var(--muted); font-size: .8rem; }
/* city: country flag menu and the city box with suggestions */
.city-in { display: flex; gap: 6px; }
.city-in .ac { position: relative; flex: 1; min-width: 0; }
.field .city-in select.cc { width: 64px; flex: none; padding-inline: 6px; font-family: "Twemoji Country Flags", var(--font-body); font-size: 1.1rem; }
.ac-list { position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 30; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.ac-list li { padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac-list li small { color: var(--muted); direction: ltr; }
.ac-list li:hover, .ac-list li[aria-selected="true"] { background: var(--accent-soft); }
/* phone: country code menu then the number, left to right like a written number */
.phone-in { display: flex; gap: 6px; direction: ltr; }
.phone-in input { flex: 1; min-width: 0; }
.field .phone-in select.cc { width: 118px; flex: none; padding-inline: 8px; font-family: "Twemoji Country Flags", var(--font-body); font-size: 1rem; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios input { flex: none; margin: 0; width: 18px; height: 18px; }
.radios.col label { display: flex; }
.radios label { display: inline-flex; gap: 8px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; font-weight: 500; }
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radios.col { flex-direction: column; align-items: stretch; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.actions { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
dialog .actions:last-child { justify-content: center; }
.err { color: var(--danger); font-size: .9rem; margin: 0; }
.pick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 78px; padding: 10px 8px; border: 1.5px dashed var(--accent); border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; cursor: pointer; }
.pick.wide { flex-direction: row; min-height: 56px; gap: 8px; }
.pick .ico svg { width: 24px; height: 24px; }
/* the add form: the certificate first, in its own box; the place photo looks plainer so the two don't mix up */
.cert-first { background: var(--accent-soft); border-radius: 16px; padding: 14px; }
.cert-first .pick { background: var(--surface); }
.cert-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 1rem; }
.cert-lbl .ico svg { width: 20px; height: 20px; color: var(--accent); }
.cert-first { display: grid; gap: 14px; }
.cert-first select { background: var(--surface); }
.extra-item { position: relative; display: grid; gap: 12px; border-top: 1.5px dashed var(--accent); padding-top: 14px; }
.extra-remove { position: absolute; inset-inline-end: 0; top: 8px; }
.cert-first .add-cert { justify-self: start; background: var(--surface); border-color: var(--accent); color: var(--accent); }
.pick-btns.plain .pick { border-color: var(--line); background: var(--surface-2); color: var(--ink); min-height: 62px; }
.more-details { border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.more-details > summary { cursor: pointer; padding: 13px 0; font-weight: 600; list-style-position: inside; }
.more-details > summary span { color: var(--muted); font-weight: 400; }
.more-details > summary small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; margin-top: 2px; }
.more-details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.more-details > .stack { padding-bottom: 14px; }
.photo-pick { display: flex; align-items: end; gap: 10px; }
.photo-pick img { max-height: 160px; border-radius: 12px; object-fit: cover; }
.picked { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.picked img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.picked .pdf { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); color: var(--accent); font-weight: 700; flex: none; }
.picked .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.tabs button { border: 0; background: transparent; padding: 8px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.gsi { display: flex; justify-content: center; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
#loginDlg input[type="tel"], #loginDlg input[type="email"] { font-size: 1.1rem; padding: 12px; }
.sheet-actions { position: sticky; bottom: -22px; background: var(--surface); padding-block: 12px; margin-block: -4px -10px; border-top: 1px solid var(--line); z-index: 1; }
#lightbox { width: min(900px, calc(100vw - 24px)); }
#lightbox .lb { display: grid; gap: 10px; padding: 12px; }
#lightbox img { width: 100%; height: auto; max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 10px; background: var(--surface-2); }
/* while the next photo loads: no old photo, just a spinner in a photo-sized space */
#lightbox .lb.loading img, #lightbox .lb.failed img { display: none; }
.lb-status { margin: 0; padding: 24px 12px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 600; text-align: center; }
.lb.loading .lb-status { min-height: min(60dvh, 420px); background: var(--surface-2); border-radius: 10px; }
.lb-status .spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--accent); border-inline-end-color: transparent; animation: spin .7s linear infinite; flex: none; }
.toast { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); inset-inline: 16px; margin-inline: auto; max-width: 420px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; text-align: center; font-weight: 600; z-index: 10; }
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- admin + privacy pages ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; min-width: 0; }
.intro h1 { margin: 0; font-size: 1.8rem; font-weight: 700; }

/* ---------- phone ---------- */
@media (max-width: 719px) {
  #addBtn {
    position: fixed; z-index: 5; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    min-height: 54px; padding-inline: 22px; font-size: 1.05rem; box-shadow: var(--shadow-fab);
  }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .how ol { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -18px; padding-inline: 18px; }
  .how ol::-webkit-scrollbar { display: none; }
  .how li { scroll-snap-align: start; }
  /* dialogs become bottom sheets with a handle (pull down to close: common.js); the restaurant page fills the screen */
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  dialog[open] { animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1); }
  dialog form { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  dialog form::before, dialog .off-in::before, #lightbox .lb::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -8px 0 2px; }
  dialog.page { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .place-cover { height: 220px; }
  .stamp { max-width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .more summary::after, .bar { transition: none; }
  .stamp.press, dialog[open], .sk { animation: none; }
}

/* ---------- the Rabbinate's list: its own tab, greyed, with a grey dashed stamp, so it never looks like a checked place ---------- */
.layer-tabs { max-width: 480px; }
.official-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .9rem; line-height: 1.5; }
button.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.row.official .thumb img { filter: grayscale(.85); opacity: .7; }
.stamp.official { color: var(--muted); border-color: var(--muted); outline-color: var(--muted); border-style: dotted; outline-style: dotted; transform: none; }
.off-in { display: grid; gap: 12px; padding: 20px; }
.off-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.off-head h2 { font-size: 1.5rem; }
.off-head .round-btn { flex: none; box-shadow: none; background: var(--surface-2); color: var(--ink); }
.off-in > .stamp { justify-self: start; }
.off-source { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.off-add { display: grid; gap: 6px; padding-top: 4px; }
.off-add .hint { color: var(--muted); font-size: .82rem; text-align: center; }
.from-official { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: .9rem; }

/* loading the next 30, and the end of a long list */
.list-status { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.list-status .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--accent); border-inline-end-color: transparent; animation: spin .7s linear infinite; }
.list-status.end { font-weight: 500; font-size: .88rem; }
