:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --text: #1c1b19;
  --muted: #6b6860;
  --border: #e5e1d8;
  --border-strong: #d4cfc3;
  --accent: #c2410c;
  --accent-hover: #a8380a;
  --accent-soft: #fdeee3;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(28 27 25 / 0.04), 0 4px 16px rgb(28 27 25 / 0.05);
  --shadow-lg: 0 8px 32px rgb(28 27 25 / 0.14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1b19;
    --surface-2: #232220;
    --text: #edebe6;
    --muted: #9c988e;
    --border: #312f2b;
    --border-strong: #45423c;
    --accent: #fb923c;
    --accent-hover: #fdba74;
    --accent-soft: #3a2415;
    --danger: #f87171;
    --danger-soft: #3b1717;
    --ok: #4ade80;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 120px; }
.muted { color: var(--muted); }

/* Controls */
input, select, textarea, button {
  font: inherit; color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button, select { cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
input[type="checkbox"], input[type="radio"], label.check { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 10px 20px; white-space: nowrap; }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; }
/* Every button lays out its icon and label the same way: centred in line, 6px apart. */
.btn-primary, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary svg, .btn-ghost svg, .btn-danger svg { flex-shrink: 0; }
.btn-ghost:not(:disabled):hover { background: var(--surface-2); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; flex: none;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
td.actions { white-space: nowrap; text-align: right; }
.code-chip {
  font: 600 13px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em;
  padding: 6px 8px; border-radius: 8px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.code-chip:hover { border-color: var(--accent); color: var(--accent); }
.code-chip.show-sm { display: none; }
td.actions .icon-btn + .icon-btn { margin-left: 6px; }
.icon-btn.is-disabled, .icon-btn.is-disabled:hover { opacity: .3; cursor: default; color: var(--muted); border-color: var(--border); background: var(--surface); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); }
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Restaurant list (admin) ---------- */
header.top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
header.top h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
header.top .sub { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { flex: 1 1 160px; }
.filters input[type="search"] { flex: 2 1 240px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.name a { font-weight: 600; text-decoration: none; }
td.name a:hover { text-decoration: underline; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.empty, .error { padding: 32px; text-align: center; color: var(--muted); }
.error { color: var(--danger); }

/* ---------- Menu editor ---------- */
.back { display: inline-flex; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }

/* Restaurant header */
.hero { padding: 22px 24px; margin-bottom: 16px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.hero h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); overflow-wrap: anywhere;
}
.chip svg { flex-shrink: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.link-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* Photos (from Google Places) */
.photos {
  display: flex; gap: 10px; margin-top: 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 4px;
}
.photo { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.photo img {
  display: block; height: 150px; width: auto; max-width: 280px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
}
.photo figcaption {
  margin-top: 4px; max-width: 200px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo figcaption a { text-decoration: none; }
.photo figcaption a:hover { text-decoration: underline; }

/* Menu list */
.menus-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.menus-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.menus-head .btn-primary, .menu-card-actions button { display: inline-flex; align-items: center; gap: 6px; }
.menu-cards { display: grid; gap: 12px; }
.menu-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; }
.menu-card.is-current, .menu-card.is-weekly { border-color: var(--accent); }
.menu-card.is-ended { opacity: .7; }
.menu-card-main { min-width: 0; }
.menu-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.menu-card h3 { margin: 0; font-size: 17px; }
.menu-card p { margin: 4px 0 0; font-size: 14px; }
.menu-note { color: var(--text); font-style: italic; }
.menu-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.menu-card-actions button { font-size: 14px; padding: 7px 12px; }
.badge-current, .badge-weekly { background: var(--accent); color: #fff; }
.badge-upcoming { background: color-mix(in srgb, #0f766e 14%, transparent); color: #0f766e; }
.badge-ended { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:not(:disabled):hover { background: var(--danger-soft); }
.empty.card { padding: 32px; }

/* Menu editor */
.linkish { background: none; border: 0; padding: 0; cursor: pointer; }
.editor-title { margin: 0 0 14px; font-size: 22px; letter-spacing: -.01em; }
.menu-section { padding: 18px 20px; margin-bottom: 14px; }
.menu-section h3 { margin: 0 0 12px; font-size: 17px; }
.menu-section h4 { margin: 18px 0 4px; font-size: 15px; }
.hint { margin: -6px 0 12px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding-bottom: 9px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.note-field { margin-top: 16px; }
.note-field textarea { width: 100%; resize: vertical; }

/* Prices: "2 500 Ft" boxes */
.price { position: relative; display: block; min-width: 0; }
.price input { width: 100%; padding-right: 34px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.price span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 13px; pointer-events: none; }
input.invalid, textarea.invalid, .tags.invalid { border-color: var(--danger) !important; background: var(--danger-soft); border-radius: 10px; }

/* Day card */
.day { padding: 18px 20px; margin-bottom: 14px; scroll-margin-top: 96px; }
.day.is-today { border-color: var(--accent); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.day h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.day-count { font-size: 13px; color: var(--muted); }
.no-offer { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.offers { display: grid; gap: 10px; margin-bottom: 12px; }

/* Item row: course · label · dish · price · delete, then tags + "More", then the details panel */
.item {
  display: grid; align-items: center; gap: 8px 10px;
  grid-template-columns: 150px 120px minmax(0, 1fr) 130px 40px;
  grid-template-areas: "course label name price trash" "tags tags tags tags tags" "details details details details details";
  padding: 10px 10px 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.item:focus-within { border-color: var(--border-strong); }
.item > * { min-width: 0; }
.item > .course { grid-area: course; }
.item > .label { grid-area: label; font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.item > .name { grid-area: name; font-weight: 500; }
.item > .price { grid-area: price; }
.item > .item-tags { grid-area: tags; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.item > .trash { grid-area: trash; }
.item > .item-details { grid-area: details; padding: 12px 4px 4px; border-top: 1px dashed var(--border); }
.item.is-sold-out > .name { text-decoration: line-through; color: var(--muted); }
.item.course-starter { box-shadow: inset 3px 0 0 #0891b2; }
.item.course-soup { box-shadow: inset 3px 0 0 #0f766e; }
.item.course-salad { box-shadow: inset 3px 0 0 #65a30d; }
.item.course-main { box-shadow: inset 3px 0 0 var(--accent); }
.item.course-side { box-shadow: inset 3px 0 0 #a16207; }
.item.course-set { box-shadow: inset 3px 0 0 #7c3aed; }
.item.course-dessert { box-shadow: inset 3px 0 0 #db2777; }
.item.course-drink { box-shadow: inset 3px 0 0 #2563eb; }
.item.course-other { box-shadow: inset 3px 0 0 var(--muted); }
.more-btn {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: transparent; border: 1px dashed var(--border-strong); color: var(--muted);
}
.more-btn:hover { color: var(--accent); border-color: var(--accent); }
.more-btn[aria-expanded="true"] { color: var(--accent); border-style: solid; border-color: var(--accent); }
.more-summary { font-weight: 600; }
.allergen-legend { margin-top: 6px; font-size: 12px; line-height: 1.5; }

/* Dietary tags and combo course toggles */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
}
.tag:hover { border-color: var(--border-strong); }
.tag[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Form layouts */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 4px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input:not([type="checkbox"]), .form-grid select { width: 100%; }
.form-grid .check { padding-bottom: 10px; }
.row-3 { display: grid; grid-template-columns: minmax(0, 220px) 140px 40px; gap: 8px; align-items: center; }
.course-price-rows, .variants, .discounts { display: grid; gap: 8px; margin-bottom: 10px; }
.inline-add { display: flex; gap: 8px; align-items: center; }
.inline-add .btn-ghost { display: inline-flex; align-items: center; gap: 4px; }
.date-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.chip-x button { border: 0; background: none; padding: 0 6px; font-size: 16px; line-height: 1; color: var(--muted); }
.chip-x button:hover { color: var(--danger); }
.add.small { width: auto; padding: 6px 12px; font-size: 13px; }
.price.percent input { padding-right: 28px; }

/* Combos */
.combos { display: grid; gap: 10px; margin-bottom: 10px; }
.combo-card { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 8px; }
.combo-head { display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px 40px; gap: 8px; align-items: center; }
.combo-description { width: 100%; }
.slots { display: grid; gap: 6px; border-radius: 10px; }
.slot { display: grid; grid-template-columns: 200px minmax(0, 1fr) 40px; gap: 8px; align-items: start; padding: 4px; border-radius: 10px; }
.slot > select, .slot > input { width: 100%; }
.slot-items { display: grid; gap: 6px; }
.slot-items .hint { margin: 0; }
.slot.invalid, .slots.invalid { outline: 1.5px solid var(--danger); background: var(--danger-soft); }

/* Discounts */
.discount { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px 130px 40px; gap: 8px; align-items: center; }

/* Translations */
.translations { margin-top: 12px; }
.translations summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.translations[open] summary { margin-bottom: 8px; }
.translation-row { display: grid; grid-template-columns: 70px repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; margin-bottom: 6px; }
.lang-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lang-flag img { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px rgb(0 0 0 / .1); }
.menu-name { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); width: 100%; }

.trash {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--danger);
}
.trash:hover { background: var(--danger-soft); border-color: var(--danger-soft); }

.add {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 10px; border: 1.5px dashed var(--border-strong); border-radius: 12px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 14px;
}
.add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Offer editor: a panel from the right (full screen on phones), with tabs and its own save bar */
.offer-panel {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--border);
  width: min(760px, 100vw); max-width: none; height: 100dvh; max-height: none;
  background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg);
  flex-direction: column;
}
.offer-panel[open] { display: flex; animation: panel-in .22s ease-out; }
.offer-panel::backdrop { background: rgb(20 16 12 / .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.offer-panel[open]::backdrop { animation: fade-in .22s ease-out; }
@keyframes panel-in { from { transform: translateX(48px); opacity: 0; } }
body.panel-open { overflow: hidden; }
.offer-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; background: var(--surface); }
.offer-panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.offer-panel-tabs { padding: 0 20px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.offer-panel-tabs .tabs { margin: 0; }
.offer-panel-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.tab-count:not(:empty) { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 18px; text-align: center; }
.offer-panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 24px; }
.offer-panel-body .offer-section:last-child { margin-bottom: 0; }
.offer-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
@media (max-width: 700px) {
  .offer-panel { border-left: 0; }
  .offer-panel-head, .offer-panel-tabs, .offer-panel-body, .offer-panel-foot { padding-left: 16px; padding-right: 16px; }
}
/* Date and time pickers (editor.js dateField, timeField) */
.picker {
  position: relative; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.picker:hover { border-color: var(--border-strong); }
.picker:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.picker > svg { flex: none; color: var(--accent); }
.picker.is-empty > svg, .picker.is-empty .picker-text { color: var(--muted); }
.picker-text { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer;
}
.picker input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.picker:has(input.invalid) { border-color: var(--danger); background: var(--danger-soft); }
.select-field.time-field > svg { color: var(--accent); }
.select-field.time-field.is-empty > svg { color: var(--muted); }
.time-field .select-ui-trigger { cursor: pointer; }
.time-field:not(.is-empty) .select-ui-label { font-weight: 600; }
.time-field.is-empty .select-ui-label { color: var(--muted); }
.time-field:has(select.invalid) .select-ui-trigger { border-color: var(--danger); background: var(--danger-soft); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.offer-panel-foot .status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--border-strong);
}
.status.dirty { color: var(--accent); }
.status.dirty::before { background: var(--accent); }
.status.ok { color: var(--ok); }
.status.ok::before { background: var(--ok); }
.status.err { color: var(--danger); }
.status.err::before { background: var(--danger); }

/* App version (admin) */
.version-form { padding: 14px 0; border-top: 1px solid var(--border); }
.version-form h3 { margin: 0 0 10px; font-size: 15px; }
.version-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field { display: grid; gap: 4px; font-size: 13px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field input { width: 100%; }
.version-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

/* Restaurant details form (admin) */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }

/* Cities and countries (admin) */
.places-section { margin-bottom: 32px; }
.places-section h2 { margin: 0 0 12px; font-size: 18px; }
.places-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.places-head h2 { margin: 0; }
.places-head .select-ui { min-width: 240px; }
.places-section .table-card { overflow-x: auto; }
.places-order { width: 72px; }
.places-zone { width: 180px; }
.city-thumb-cell { width: 64px; }
.sugg-meta { margin-top: 2px; font-size: 13px; }
.sugg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sugg-tags:empty { display: none; }
.sugg-note { max-width: 280px; white-space: pre-wrap; font-size: 14px; }
.sugg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.msg-text { max-width: 520px; min-width: 240px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg-from a { overflow-wrap: anywhere; }
.city-thumb {
  display: grid; place-items: center; width: 56px; height: 38px; padding: 0; overflow: hidden; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.city-thumb img { width: 100%; height: 100%; object-fit: cover; }
.city-thumb:hover { border-color: var(--accent); }
.city-image-row td { background: var(--surface-2); }
.city-image-form { display: grid; gap: 8px; max-width: 560px; }
.city-image-form p { margin: 0; font-size: 13px; }
.city-image-form input { width: 100%; }
.city-image-preview { width: 100%; max-width: 360px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.places-empty { padding: 18px; margin: 0; }
.places-add { margin-bottom: 12px; padding: 16px; }
.places-add-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 10px 12px; }
.places-add-grid .field input { width: 100%; height: 40px; }
.places-add-actions { display: flex; gap: 8px; }
.places-add-actions button { height: 40px; }
.places-add .status:empty { display: none; }
.places-add .status { margin-top: 10px; }
@media (max-width: 700px) {
  .places-add-grid { grid-template-columns: 1fr 1fr; }
  .places-add-grid .field:first-child, .places-add-actions { grid-column: 1 / -1; }
  .places-add-actions { justify-content: flex-end; }
}

/* On/off switch: a checkbox with class "switch" (and role="switch") */
input.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; display: inline-block; vertical-align: middle;
  width: 40px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 12px;
  background: var(--border-strong); cursor: pointer; transition: background .15s;
}
input.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s;
}
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:disabled { opacity: .5; cursor: default; }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.details-grid .field input, .details-grid .field select { width: 100%; height: 40px; }
.details-form .version-actions { margin-top: 16px; }

/* Share box (admin) */
.share { padding: 14px 20px; margin-bottom: 16px; }
.share summary { cursor: pointer; font-weight: 600; }
.share p { margin: 8px 0 12px; font-size: 14px; }
.copy-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.copy-row code {
  min-width: 0; overflow-wrap: anywhere;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 13px;
}
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Admin sign-in */
body.admin-locked .wrap, body.admin-locked .savebar { display: none !important; }
.admin-gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.admin-gate .lock { width: 100%; }
.logout { font-size: 14px; padding: 6px 12px; }
.brand-actions { display: flex; align-items: center; gap: 8px; }
.brand-actions tm-language-picker { font-size: 14px; }

/* Restaurant-facing page */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.brand-mark {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--accent); text-decoration: none;
}
.brand-mark img { display: block; height: 32px; width: auto; }
.lock { padding: 24px; max-width: 480px; }
.lock h2 { margin: 0 0 4px; font-size: 20px; }
.lock p { margin: 0 0 14px; }
.lock-row { display: flex; gap: 8px; }
.lock-row input { flex: 1; min-width: 0; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.lock-row input::placeholder { text-transform: none; letter-spacing: normal; }
.lock .status { margin: 10px 0 0; min-height: 1.5em; }

/* Sign-in cards (restaurant and admin) */
.sign-in { margin: 6vh auto 0; display: grid; gap: 14px; padding: 28px; }
.sign-in h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.sign-in > p { margin: 0; }
.sign-in .field { font-size: 13px; font-weight: 600; }
.sign-in .field input { font-size: 16px; padding: 11px 12px; }
.sign-in .code-input { letter-spacing: .08em; text-transform: uppercase; }
.sign-in .code-input::placeholder { text-transform: none; letter-spacing: normal; }
.sign-in .btn-primary { padding: 12px 20px; font-size: 16px; }
.sign-in .status { margin: 0; min-height: 0; }
.sign-in .status:empty { display: none; }
.sign-in .help { font-size: 13px; }
.sign-in .help a { color: var(--accent); }
.gate-card { display: grid; gap: 4px; }
.gate-card .brand { margin-bottom: 18px; }
.google-btn { display: flex; justify-content: center; align-items: center; min-height: 44px; margin: 10px 0 4px; color: var(--accent); }
.google-btn.is-busy { opacity: .5; pointer-events: none; }
.admin-user { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); max-width: 220px; }
.admin-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user img { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }

/* Restaurant pages: top bar */
.rest-topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.rest-topbar-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rest-topbar + .wrap { padding-top: 24px; }
.rest-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; }
.rest-brand img { height: 30px; width: auto; flex-shrink: 0; }
.rest-brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--accent); }
.rest-brand-tag {
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent);
}
.rest-actions { display: flex; align-items: center; gap: 8px; }
.rest-actions tm-language-picker { font-size: 14px; }
.top-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.top-btn::-webkit-details-marker { display: none; }
.top-btn:hover { border-color: var(--accent); color: var(--accent); }
.top-btn svg { flex-shrink: 0; }
.guide-menu { position: relative; }
.guide-menu > summary .guide-icon { color: var(--accent); display: inline-flex; }
.guide-menu[open] > summary { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.guide-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 300px; padding: 8px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: dialog-in .14s ease-out;
}
.guide-pop-title { margin: 4px 8px 8px; font-size: 13px; color: var(--muted); }
.guide-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--text); }
.guide-item:hover { background: var(--accent-soft); }
.guide-item:hover .guide-dl { color: var(--accent); }
.guide-flag { font-size: 22px; line-height: 1; }
.guide-item-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.guide-item-text strong { font-size: 14px; }
.guide-item-text small { font-size: 12px; color: var(--muted); }
.guide-dl { display: inline-flex; color: var(--muted); }

/* Restaurant dashboard tabs */
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; width: max-content; max-width: 100%; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tab { border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
body[data-tab="photos"] .savebar { display: none !important; }

/* Photo manager */
.photo-manager { padding: 20px; }
.photo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.photo-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.photo-head p { margin: 4px 0 0; font-size: 14px; }
.photo-count { flex-shrink: 0; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-variant-numeric: tabular-nums; }
.photo-count.is-full { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.photo-tile, .photo-add { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; }
.photo-tile { background: var(--surface-2); border: 1px solid var(--border); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile:first-child { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover-badge {
  position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .25);
}
.photo-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.photo-action {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px;
  border: 0; background: rgb(255 255 255 / .92); color: #1c1b19; box-shadow: 0 2px 8px rgb(0 0 0 / .2);
}
.photo-action:not(:disabled):hover { background: #fff; color: var(--accent); }
.photo-action.danger { color: #dc2626; }
.photo-action.danger:not(:disabled):hover { background: #fee2e2; color: #dc2626; }
.photo-tile figcaption {
  position: absolute; left: 0; right: 0; top: 0; padding: 8px 10px 18px; text-align: right;
  font-size: 11px; color: #fff; background: linear-gradient(rgb(0 0 0 / .45), transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-tile:first-child figcaption { padding-left: 90px; }
.photo-tile.is-uploading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.photo-tile.is-uploading .spinner { color: var(--accent); }
.photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--border-strong); background: transparent; color: var(--muted); font-weight: 600;
}
.photo-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.photo-empty { margin: 14px 0 0; font-size: 14px; }
.photo-manager > .status { margin-top: 12px; }
.photo-manager > .status:empty { display: none; }
.photo-manager > .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.photo-manager > .status.busy::before { content: ""; border-radius: 50%; background: none; }

/* ---------- Admin layout: sidebar + content ---------- */
body.admin { --sidebar-w: 260px; }
.admin-layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.admin-main { min-width: 0; }
.admin-main > .wrap { max-width: 1180px; padding: 32px 32px 120px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 16px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.sidebar-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--accent); }
.sidebar-brand img { height: 30px; width: auto; }
.admin-tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.sidebar-close { display: none; }
.sidebar-collapse { width: 32px; height: 32px; flex-shrink: 0; border-color: transparent; background: transparent; }
.sidebar-collapse:hover { border-color: var(--border); background: var(--surface-2); color: var(--text); }

/* Collapsed sidebar (desktop): a rail of icons; labels stay in the page for screen readers. */
@media (min-width: 901px) {
  body.admin.sidebar-collapsed { --sidebar-w: 76px; }
  .sidebar-collapsed .sidebar { padding: 18px 10px 14px; overflow: visible; z-index: 15; } /* lets the language menu open past the rail */
  .sidebar-collapsed .sidebar-top { flex-direction: column; gap: 12px; padding: 0; }
  .sidebar-collapsed .sidebar-brand > span { display: none; }
  .sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }
  .sidebar-collapsed .nav-item > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .sidebar-collapsed .nav-label, .sidebar-collapsed .soon-tag { display: none; }
  /* On the rail the count sits on the icon's corner. */
  .sidebar-collapsed .nav-item { position: relative; }
  .sidebar-collapsed .nav-count { position: absolute; top: 3px; right: 8px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  .sidebar-collapsed .sidebar-foot { justify-items: center; }
  .sidebar-collapsed .sidebar-foot tm-language-picker { padding: 0; }
  .sidebar-collapsed .sidebar-foot .nav-item { width: 100%; }
  .sidebar-collapsed .sidebar-user { flex-direction: column; gap: 8px; padding: 12px 0 2px; width: 100%; }
  .sidebar-collapsed .sidebar-user-text { display: none; }
}
.sidebar-nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.nav-item svg { flex-shrink: 0; }
a.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-active:hover { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-disabled { opacity: .55; cursor: default; }
.nav-count {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px; text-align: center;
  font-size: 11px; font-weight: 700; line-height: 18px; background: var(--danger); color: #fff;
}
.nav-count[hidden] { display: none; }
.nav-label { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .8; }
.soon-tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.sidebar-foot tm-language-picker { font-size: 14px; padding: 0 6px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--border); }
.avatar { --size: 36px; width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; font-weight: 800; font-size: calc(var(--size) * .42); background: var(--accent-soft); color: var(--accent); }
.sidebar-user-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-user-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-backdrop { display: none; }
.admin-topbar { display: none; }
body.admin .savebar { left: calc(var(--sidebar-w) + 24px); right: 24px; max-width: 1116px; }

/* Page headings */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; line-height: 1.2; }
.page-head p { margin: 6px 0 0; max-width: 640px; }
.overview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.quick-search input { width: 300px; max-width: 100%; padding: 10px 14px; border-radius: 12px; }

/* Overview: stat cards */
.inbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 18px; margin-bottom: 14px; border-left: 4px solid var(--danger); }
.inbox a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); text-decoration: none; }
.inbox a:hover { text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  --tone: var(--accent);
  display: grid; gap: 4px; align-content: start; padding: 18px 20px; text-decoration: none; position: relative;
  transition: border-color .15s, transform .15s;
}
a.stat:hover { border-color: var(--tone); transform: translateY(-1px); }
.stat-orange { --tone: #ea580c; }
.stat-teal { --tone: #0d9488; }
.stat-violet { --tone: #7c3aed; }
.stat-rose { --tone: #e11d48; }
.stat-blue { --tone: #2563eb; }
.stat-amber { --tone: #d97706; }
.stat-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent);
}
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 13px; color: var(--muted); }
.stat-bar { display: block; height: 6px; margin: 6px 0 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; position: relative; }
.stat-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--tone); border-radius: 999px; }

/* Overview: panels */
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.panel { padding: 6px 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px 8px; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.panel-list { list-style: none; margin: 0; padding: 0; }
.panel-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; text-decoration: none; border-top: 1px solid var(--border); }
.panel-row:hover { background: var(--surface-2); }
.row-main { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.row-main strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-meta svg { color: #e11d48; }
.rank { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.panel-empty { padding: 8px 18px 16px; margin: 0; font-size: 14px; }

/* Users */
tr.is-link { cursor: pointer; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-cell-text { display: grid; min-width: 0; line-height: 1.35; }
.user-cell-text a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.user-cell-text a:hover { text-decoration: underline; }
.user-cell-text .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users-table td.num svg { color: #e11d48; vertical-align: -2px; }
th.num, td.num { text-align: right; }
.user-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px 20px; padding: 24px; margin-bottom: 14px; }
.user-hero-text h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: 26px; letter-spacing: -.02em; }
.user-hero-text p { margin: 4px 0 0; overflow-wrap: anywhere; }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.fact { display: grid; gap: 2px; font-size: 13px; }
.fact strong { font-size: 16px; }
.user-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.user-side { display: grid; gap: 14px; }
.user-main { display: grid; gap: 14px; min-width: 0; }
/* Credits and invites on the admin's user page */
.credit-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 4px 18px 14px; }
.credit-block { padding: 12px 18px; border-top: 1px solid var(--border); }
.credit-block h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.credit-block .panel-list { margin: 0 -18px; }
.credit-hint { margin: -2px 0 10px; font-size: 13px; }
.credit-line { margin: 0 0 8px; font-size: 14px; }
.credit-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.credit-amount { width: 130px; }
.credit-actions { margin-top: 8px; }
.credit-note { flex: 1 1 200px; min-width: 0; }
.credit-change { display: grid; justify-items: end; gap: 2px; white-space: nowrap; font-size: 13px; }
.credit-change .plus { color: var(--ok); }
.credit-change .minus { color: var(--danger); }
.badge.is-on { background: var(--ok-soft, rgb(34 160 90 / .12)); color: var(--ok); }
.ad-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 4px 18px 12px; }
.ad-stat { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.ad-stat strong { font-size: 22px; letter-spacing: -.02em; }
.ad-stat .muted { font-size: 12px; font-weight: 600; }
.ad-lines { list-style: none; margin: 0; padding: 0 18px 10px; }
.ad-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.panel-head .muted { font-size: 13px; font-weight: 700; }
.device-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
li.panel-row:hover { background: none; }
.danger-zone { padding: 18px; }
.danger-zone h2 { margin: 0; font-size: 15px; }
.danger-zone p { margin: 6px 0 14px; font-size: 13px; }
.danger-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.danger-actions .btn-ghost { font-size: 14px; }

/* Notifications */
.notif-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; margin-bottom: 18px; }
.composer { display: grid; gap: 16px; padding: 22px; }
.composer .field { gap: 6px; font-size: 14px; }
.composer .label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.composer input, .composer textarea { width: 100%; font-size: 15px; padding: 10px 12px; }
.composer textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.counter { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 700; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); width: max-content; max-width: 100%; }
.seg { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-count { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.user-picker { display: grid; gap: 6px; }
.user-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.user-results:empty { display: none; }
.user-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; }
.user-result:not(:disabled):hover { background: var(--surface-2); border-color: var(--border); }
.user-result:disabled { opacity: .55; }
.no-results { padding: 8px 10px; font-size: 14px; }
.device-tag { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--ok); }
.device-tag.is-off { color: var(--muted); font-weight: 600; }
.picked { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); }
.composer-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.send-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; }
.composer-actions .status { margin: 0; }
.composer-actions .status:empty { display: none; }
.composer-actions .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.phone-preview { position: sticky; top: 24px; }
.phone {
  border-radius: 34px; padding: 26px 14px 120px; min-height: 360px;
  background: linear-gradient(160deg, #ffb15c 0%, #f26b00 45%, #13a09e 100%);
  border: 6px solid #1d1712; box-shadow: var(--shadow-lg);
}
.phone-time { text-align: center; color: #fff; font-size: 44px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 22px; text-shadow: 0 1px 8px rgb(0 0 0 / .15); }
.push { display: flex; gap: 10px; padding: 11px 12px; border-radius: 18px; background: rgb(255 255 255 / .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #1c1b19; }
.push-icon { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 4px; object-fit: contain; flex-shrink: 0; }
.push-text { min-width: 0; flex: 1; font-size: 13px; line-height: 1.35; }
.push-head { display: flex; justify-content: space-between; font-size: 11px; color: #6b6860; margin-bottom: 1px; }
.push-head span:first-child { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.push-text strong { display: block; overflow-wrap: anywhere; }
.push-text p { margin: 1px 0 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.push-text .placeholder { opacity: .45; }
.preview-note { font-size: 12px; text-align: center; margin: 10px 0 0; }

.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.notif-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.notif-row .row-main strong { white-space: normal; }
.notif-body { font-size: 13.5px; color: var(--text); opacity: .85; overflow-wrap: anywhere; }
.notif-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; }
.audience-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
a.audience-tag:hover { border-color: var(--accent); color: var(--accent); }
.delivery { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; padding-top: 6px; }
.delivery.has-failed { color: var(--danger); }
.notify-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; }

/* Where a restaurant's current menu came from, next to its name in the admin list */
.src-badge {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid currentColor;
}
.src-badge.is-menum { color: hsl(280 55% 45%); background: hsl(280 70% 55% / .08); }
.src-badge.is-website { color: hsl(200 70% 35%); background: hsl(200 80% 50% / .08); }
@media (prefers-color-scheme: dark) {
  .src-badge.is-menum { color: hsl(280 70% 76%); }
  .src-badge.is-website { color: hsl(200 80% 72%); }
}

/* Cuisine tag in the restaurant table (--h: the type's hue) */
.type-tag {
  display: inline-flex; align-items: center; gap: 6px; max-width: 190px; padding: 3px 10px 3px 8px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: hsl(var(--h) 85% 55% / .1); color: hsl(var(--h) 55% 32%);
  border: 1px solid hsl(var(--h) 70% 50% / .22);
}
.type-tag > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.type-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: hsl(var(--h) 70% 48%); }
@media (prefers-color-scheme: dark) {
  .type-tag { background: hsl(var(--h) 70% 60% / .12); color: hsl(var(--h) 75% 74%); border-color: hsl(var(--h) 70% 60% / .25); }
  .type-dot { background: hsl(var(--h) 75% 62%); }
}
.type-tag.is-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.type-tag.is-neutral .type-dot { background: var(--border-strong); }

/* Restaurant list: header + filter card */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.list-title { display: flex; align-items: center; gap: 10px; }
.list-title h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.count-badge { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.count-badge:empty { display: none; }
.list-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
a.toolbar-btn.btn-primary { color: #fff; }
.toolbar-btn .spinner { margin-right: 0; }
.filter-card { display: grid; gap: 10px; padding: 12px; margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.filter-row > select { flex: 1 1 150px; min-width: 0; max-width: 260px; height: 40px; }
.search-field, .select-field { position: relative; display: flex; align-items: center; min-width: 0; }
.search-field { flex: 2 1 280px; }
.select-field { flex: 1 1 170px; }
.search-field svg, .select-field svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-field input, .select-field select { width: 100%; height: 40px; padding-left: 36px; }
.filter-card select.is-set { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filter-card .segmented { flex: 0 0 auto; }
.filter-card .seg { padding: 7px 14px; font-size: 14px; }
.clear-filters { margin-left: auto; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.clear-filters:hover { text-decoration: underline; }

/* Restaurants: add, manage, delete */
.add-restaurant { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; padding: 8px 14px; }
header.top .add-restaurant + .export-btn { margin-left: 0; }
.notice { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 14px; background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice svg { color: var(--accent); flex-shrink: 0; }
.manage-card { padding: 18px 20px; margin-top: 18px; }
.manage-card h2 { margin: 0 0 6px; font-size: 17px; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.manage-row:first-of-type { border-top: 0; }
.manage-row p { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.manage-row .btn-ghost, .manage-row .btn-danger { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 14px; padding: 9px 14px; }
.manage-row.danger strong { color: var(--danger); }

.role-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.role-row select { height: 34px; }
.onboard-country { display: grid; gap: 6px; padding: 14px 16px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.onboard-country select { height: 42px; font-size: 16px; }
.onboard-country small { font-weight: 400; }
.onboard-search { display: flex; gap: 8px; padding: 10px; margin-bottom: 8px; }
.onboard-search input { flex: 1; min-width: 0; font-size: 16px; padding: 11px 14px; border: 0; background: transparent; }
.onboard-search input:focus-visible { outline: none; }
.onboard-search:focus-within { border-color: var(--accent); }
.onboard-hint { font-size: 13px; margin: 0 4px 16px; }
.place-list { list-style: none; margin: 0; padding: 4px 0; }
.place-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--border); }
.place-row:first-child { border-top: 0; }
.place-row .row-main strong { display: flex; align-items: center; gap: 8px; white-space: normal; }
.place-pin { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.place-rating { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.place-row .btn-primary, .place-existing { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 14px; padding: 8px 14px; text-decoration: none; }
.added-card { padding: 26px; display: grid; gap: 4px; }
.added-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 8px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.added-card h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.added-card > p { margin: 2px 0 10px; }
.added-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.added-actions a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 10px 16px; }

/* Menu health */
.health-counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.health-counter { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.health-counter:hover, .health-counter.is-active { border-color: var(--tone); }
.health-counter.is-active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone) 35%, transparent); }
.health-counter .stat-icon { width: 34px; height: 34px; margin-bottom: 6px; }
.health-counter .stat-value { font-size: 26px; }
.health-group { margin-bottom: 14px; }
.health-group .panel-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.health-group.tone-rose .panel-head svg { color: #e11d48; }
.health-group.tone-amber .panel-head svg { color: #d97706; }
.health-group.tone-blue .panel-head svg { color: #2563eb; }
.health-group.tone-violet .panel-head svg { color: #7c3aed; }
.health-group.tone-teal .panel-head svg { color: #0d9488; }
.health-group .panel-head .muted { font-size: 12.5px; font-weight: 500; text-align: right; }
.health-row { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); }
.health-row .row-main a { text-decoration: none; }
.health-row .row-main a:hover strong { text-decoration: underline; }
.health-row .row-main .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.small-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 6px 10px; max-width: 240px; overflow: hidden; white-space: nowrap; }
.show-all { display: block; width: calc(100% - 36px); margin: 4px 18px 10px; font-size: 13px; color: var(--accent); }

/* App versions page */
.version-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.version-card { padding: 4px 20px 6px; }
.version-card .version-form { border-top: 0; }

@media (max-width: 1180px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin-layout { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-close { display: inline-grid; }
  .sidebar-collapse { display: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .admin-topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .admin-topbar .sidebar-brand { font-size: 17px; }
  .admin-main > .wrap { padding: 20px 16px 120px; }
  body.admin .savebar { left: 8px; right: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .version-cards { grid-template-columns: 1fr; }
  .user-grid { grid-template-columns: 1fr; }
  .notif-layout { grid-template-columns: 1fr; }
  .phone-preview { position: static; max-width: 320px; }
  .phone { min-height: 0; padding-bottom: 36px; }
}
@media (max-width: 700px) {
  .panels { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-icon { width: 34px; height: 34px; margin-bottom: 6px; }
  .stat-value { font-size: 24px; }
  .quick-search, .quick-search input { width: 100%; }
  .page-head h1 { font-size: 24px; }
  .user-hero { padding: 18px; gap: 14px; }
  .user-hero .avatar { --size: 56px !important; }
  .user-hero-text h1 { font-size: 21px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .manage-row { flex-direction: column; align-items: stretch; }
  .place-row { flex-wrap: wrap; }
  .place-row .btn-primary, .place-existing { margin-left: 50px; }
  .health-row { flex-wrap: wrap; }
  .health-row .row-meta { display: none; }
  header.top { flex-wrap: wrap; }
  .list-actions { width: 100%; }
  .list-actions .toolbar-btn { flex: 1; justify-content: center; }
  .filter-card .segmented { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 100%; }
  td.actions .icon-btn:first-child { display: none; } /* the website link; it's on the restaurant's page too */
  .filter-card .seg { justify-content: center; white-space: nowrap; padding: 7px 10px; }
  .clear-filters { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .sidebar-backdrop, .admin-layout { transition: none; } }

/* ---------- Dialogs (dom.js confirmDialog / alertDialog) ---------- */
.dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px -12px rgb(0 0 0 / .45);
}
.dialog::backdrop { background: rgb(20 16 12 / .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in .18s ease-out; }
.dialog[open]::backdrop { animation: fade-in .18s ease-out; }
.dialog form { display: grid; justify-items: start; padding: 24px; }
.dialog-icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.dialog.is-danger .dialog-icon { background: var(--danger-soft); color: var(--danger); }
.dialog h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.dialog p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; width: 100%; margin-top: 22px; }
.dialog-actions button { padding: 10px 18px; font-weight: 600; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 600; white-space: nowrap; }
.btn-danger:not(:disabled):hover { background: #b91c1c; border-color: #b91c1c; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 480px) {
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .dialog[open], .dialog[open]::backdrop { animation: none; } }

/* ---------- Loading ---------- */
.spinner {
  --size: 20px;
  display: inline-block; flex-shrink: 0; width: var(--size); height: var(--size);
  border: 2.5px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary .spinner, .btn-ghost .spinner, button .spinner { vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 56px 16px; margin-bottom: 16px; color: var(--muted); font-size: 14px;
}
.loading-card .spinner { color: var(--accent); }
.gate-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gate-loading .spinner { color: var(--accent); }

/* Table: placeholder rows on first load, dimmed rows + progress bar while reloading */
.table-card { position: relative; overflow: hidden; }
.skeleton {
  display: block; height: 12px; border-radius: 6px; margin: 5px 0;
  background: linear-gradient(90deg, var(--border) 25%, var(--border-strong) 50%, var(--border) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; opacity: 0; transition: opacity .2s; z-index: 1; }
.progress::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%;
  background: var(--accent); border-radius: 3px; animation: indeterminate 1s ease-in-out infinite;
}
@keyframes indeterminate { from { left: -35%; } to { left: 100%; } }
.table-card.is-loading .progress { opacity: 1; }
.table-card.is-loading tbody tr:not(.skeleton-row) { opacity: .45; transition: opacity .2s; pointer-events: none; }

/* Status dot becomes a spinner while saving */
.status.busy::before {
  background: none; width: 10px; height: 10px;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.version-actions .status.busy::before { content: ""; border-radius: 50%; }

.export-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 7px 12px; }
.export-btn .spinner { margin-right: 0; }

@media (prefers-reduced-motion: reduce) {
  .spinner, .skeleton, .progress::before, .status.busy::before { animation-duration: 2.4s; }
}

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  th.hide-sm, td.hide-sm { display: none; }
  .code-chip.show-sm { display: block; width: max-content; margin-top: 6px; font-size: 12px; padding: 4px 6px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 23px; }
  .menu-card { flex-direction: column; align-items: stretch; }
  .menu-card-actions { justify-content: flex-start; }
  .item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
    grid-template-areas: "course label trash" "name name name" "price price price" "tags tags tags" "details details details";
  }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .combo-head { grid-template-columns: minmax(0, 1fr) 40px; }
  .combo-head .combo-name { grid-column: 1 / -1; }
  .slot { grid-template-columns: minmax(0, 1fr) 40px; }
  .slot > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .discount { grid-template-columns: minmax(0, 1fr) 90px 40px; }
  .discount > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .row-3 { grid-template-columns: minmax(0, 1fr) 120px 40px; }
  .translation-row { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr auto; }
  .details-grid { grid-template-columns: 1fr; }
  .copy-row > span { grid-column: 1 / -1; }
  .savebar { left: 8px; right: 8px; bottom: 8px; padding-left: 14px; }
  .savebar .status { font-size: 13px; line-height: 1.3; }
  .sign-in { margin-top: 2vh; padding: 22px; }
  .rest-topbar-inner { padding: 10px 14px; gap: 8px; }
  .rest-brand-tag, .top-btn-label { display: none; }
  .top-btn { width: 36px; padding: 0; justify-content: center; }
  .guide-pop { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; }
  .admin-user span { display: none; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .photo-manager { padding: 16px; }
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .photo-action { width: 32px; height: 32px; }
  .photo-tile figcaption { display: none; }
}

/* Admin overview: restaurant invitation emails */

/* Searchable select (public/assets/select.js): replaces every <select> on the admin and menu pages. */
.select-ui { position: relative; display: inline-flex; min-width: 0; vertical-align: middle; }
.select-ui-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.select-ui-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 40px;
  padding: 0 12px 0 14px; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.select-ui-trigger:not(:disabled):hover { border-color: var(--border-strong); }
.select-ui.is-open .select-ui-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-ui-trigger svg { flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.select-ui.is-open .select-ui-trigger svg { transform: rotate(180deg); }
.select-ui-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-ui-label.is-placeholder { color: var(--muted); }
.select-ui-trigger.is-set { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.select-ui-trigger.is-set svg { color: var(--accent); }
.select-ui-panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: min(440px, 92vw);
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); outline: none; animation: select-ui-in .12s ease-out;
}
.select-ui.opens-up .select-ui-panel { top: auto; bottom: calc(100% + 6px); }
@keyframes select-ui-in { from { opacity: 0; transform: translateY(-4px); } }
.select-ui-search { width: 100%; height: 38px; margin-bottom: 6px; padding: 0 12px; background: var(--surface-2); }
.select-ui-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.select-ui-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.select-ui-option.is-active { background: var(--surface-2); }
.select-ui-option.is-selected { color: var(--accent); font-weight: 600; }
.select-ui-option.is-disabled { opacity: .45; cursor: default; }
.select-ui-option svg { flex-shrink: 0; }
.select-ui-empty { padding: 10px; color: var(--muted); font-size: 14px; }

/* Where the old selects sat: the replacement takes their place and size. */
.filters .select-ui { flex: 1 1 160px; }
.filter-row > .select-ui { flex: 1 1 150px; min-width: 0; max-width: 260px; }
.select-field .select-ui { width: 100%; }
.select-field .select-ui-trigger { padding-left: 36px; }
.select-field > svg { z-index: 1; }
.form-grid .select-ui, .slot > .select-ui, .details-grid .field .select-ui, .field > .select-ui { width: 100%; }
.role-row .select-ui { min-width: 170px; }
.role-row .select-ui-trigger { height: 34px; }
.onboard-country .select-ui { width: 100%; }
.onboard-country .select-ui-trigger { height: 46px; font-size: 16px; font-weight: 600; }
/* The field's own icon sits on the left; icons inside the dropdown (chevron, check mark) stay in place. */
.select-field .select-ui svg { position: static; }
.select-ui-search:focus-visible { outline: none; border-color: var(--accent); }
.select-field .select-ui-option svg { color: inherit; }

/* Admin users list: where the user was last seen, under "last active". */
.user-place { display: block; font-size: 12px; }

/* Skeletons (dom.js): placeholders shaped like the content, while it loads */
.sk-card { padding: 20px; margin-bottom: 16px; }
.skeleton.sk-title { height: 18px; margin-bottom: 14px; }
.skeleton.sk-big { height: 28px; margin: 8px 0; }
.skeleton.sk-circle { height: 36px; border-radius: 50%; flex-shrink: 0; }
.skeleton.sk-avatar { height: 72px; }
.sk-stat { display: grid; gap: 4px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.sk-row .row-main { flex: 1; display: grid; gap: 2px; }
.sk-hero { display: flex; align-items: center; gap: 20px; }
.sk-hero .user-hero-text { flex: 1; }
/* Content fades in where a skeleton was, instead of popping. */
.sk-swap > * { animation: fade-in .25s ease-out; }

/* ---------- Offer editor (editor.js): daily menu, weekly menu, specials ---------- */
.check-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check-row .check { padding-bottom: 0; }
.offer-section { padding: 20px; margin-bottom: 14px; display: grid; gap: 12px; }
.offer-section h3 { margin: 0; font-size: 16px; }
.offer-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.offer-section .tabs { margin-bottom: 0; }
.offer-hint { margin: 0; font-size: 13px; }
.offer-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.offer-end .picker { flex: 1 1 180px; }
.offer-end .check { padding-bottom: 0; white-space: nowrap; }
.offer-end .check input { width: 18px; height: 18px; flex: none; }
.offer-dishes { display: grid; gap: 8px; }
.offer-section.is-empty .offer-dishes .muted { color: var(--danger); }
.dish-card { padding: 10px 12px; display: grid; gap: 8px; box-shadow: none; }
.dish-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 130px auto; align-items: center; gap: 8px; }
.dish-row select, .dish-row .dish-name { width: 100%; height: 38px; }
.dish-row .dish-price input { width: 100%; }
.dish-tools { display: flex; gap: 2px; }
.dish-summary { margin: 0; font-size: 13px; }
.dish-details { display: grid; gap: 12px; padding-top: 6px; border-top: 1px solid var(--border); }
.combo-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; align-items: center; gap: 8px; }
.combo-row .combo-name { width: 100%; height: 38px; }
.combo-row .dish-price input { width: 100%; }
.combo-picker { display: grid; gap: 8px; border-radius: 10px; outline: none; }
.combo-picker.invalid + .combo-value { color: var(--danger); } /* too few dishes: its hint turns red */
.combo-course { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: baseline; gap: 8px; }
.combo-course > .muted { font-size: 13px; }
.combo-value { margin: 0; font-size: 13px; }
.combo-need { margin: 0; color: var(--accent); }
.combo-extra-block { display: grid; gap: 6px; }
.combo-extra-block:empty { display: none; }
.combo-extra-label { font-size: 12px; font-weight: 600; }
.combo-extra { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; }
.combo-extra select { width: 100%; height: 38px; }
.combo-extra .dish-price input { width: 100%; }
.combo-add-extra { justify-self: start; }
.closed-days-field { display: grid; gap: 8px; }
.closed-days:empty { display: none; }
.closed-day { display: inline-flex; align-items: center; gap: 6px; padding-right: 4px; }
.closed-day-remove { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.closed-day-remove:hover { color: var(--danger); background: var(--danger-soft); }
.closed-day-add { max-width: 260px; }
@media (max-width: 700px) {
  .dish-row { grid-template-columns: 1fr 1fr; }
  .dish-row .dish-name { grid-column: 1 / -1; grid-row: 1; }
  .dish-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .combo-course { grid-template-columns: 1fr; gap: 4px; }
}

/* The empty menu list points first-timers to the menu guide. */
.card.empty p { margin: 0; }
.empty-guide { margin-top: 10px !important; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; color: var(--muted); }
.empty-guide a { color: var(--accent); font-weight: 600; }

/* Credits & invites page (admin-credits.js). Chart colors: validated categorical slots 1–2, own dark steps. */
:root { --cr-watched: #2a78d6; --cr-skipped: #eb6834; }
@media (prefers-color-scheme: dark) { :root { --cr-watched: #3987e5; --cr-skipped: #d95926; } }
.cr-section { padding: 18px; margin-bottom: 14px; }
.cr-section h2 { margin: 0 0 12px; font-size: 15px; }
.cr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cr-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.cr-tile strong { font-size: 24px; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.cr-tile-label { font-size: 13px; font-weight: 600; }
.cr-tile-hint { font-size: 12px; }
.cr-chart-head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.cr-chart-head h2 { margin-bottom: 2px; }
.cr-chart-head p { margin: 0; font-size: 13px; max-width: 520px; }
.cr-chart-figures { display: flex; gap: 10px; }
.cr-chart-figures .cr-tile strong { font-size: 18px; }
.cr-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin: 6px 0 4px; }
.cr-legend span, .cr-tip-row { display: inline-flex; align-items: center; gap: 6px; }
.cr-legend b { color: var(--text); font-weight: 700; }
.cr-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cr-key-watched, .cr-watched { background: var(--cr-watched); fill: var(--cr-watched); }
.cr-key-skipped, .cr-skipped { background: var(--cr-skipped); fill: var(--cr-skipped); }
.cr-plot { position: relative; }
.cr-chart { width: 100%; height: auto; display: block; }
.cr-grid { stroke: var(--border); stroke-width: 1; }
.cr-axis { stroke: var(--border-strong); stroke-width: 1; }
.cr-tick { fill: var(--muted); font-size: 11px; }
.cr-hit { fill: transparent; cursor: default; }
.cr-hit.is-hover { fill: var(--text); fill-opacity: .05; }
.cr-tip { position: absolute; top: 4px; transform: translateX(-50%); display: grid; gap: 3px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 12.5px; pointer-events: none; white-space: nowrap; color: var(--text); }
.cr-tip-row b { margin-left: auto; padding-left: 10px; }
.cr-table { margin-top: 8px; font-size: 13px; }
.cr-table summary { cursor: pointer; color: var(--muted); }
.cr-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cr-table th, .cr-table td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.cr-table th:first-child, .cr-table td:first-child { text-align: left; }
.cr-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

/* Settings (admin) */
.st-section { padding: 22px 24px 20px; margin-bottom: 18px; }
.st-section h2 { margin: 0 0 4px; font-size: 18px; }
.st-section h3 { margin: 22px 0 4px; font-size: 15px; }
.st-intro { margin: 0 0 18px; font-size: 14px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px 28px; }
.st-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.st-label { font-weight: 600; font-size: 14px; }
.st-input { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.st-input input { width: 104px; }
.st-hint { font-size: 12.5px; line-height: 1.45; max-width: 34ch; }
.st-meta { font-size: 12px; }
.st-section .version-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.st-rates { display: grid; gap: 12px; margin-bottom: 14px; }
.st-rate { display: grid; grid-template-columns: 80px auto 1fr auto; align-items: center; gap: 12px; }
.st-rate .st-hint { max-width: none; }
.st-add { margin: 4px 0 4px; }
.st-pkgs { margin: 0 0 14px; }
.st-pkg { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.st-pkg:first-child { border-top: 1px solid var(--border); }
.st-pkg .row-main { flex: 1; display: grid; gap: 2px; }
.st-pkg-edit { display: block; }
.st-onsale { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.st-pkg-form { padding: 6px 0; }
.st-pkg-form .version-actions { border-top: 0; padding-top: 0; margin-top: 12px; }
.st-pkg-new { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.st-pkg-new h4 { margin: 0 0 10px; font-size: 14px; }
@media (max-width: 640px) {
  .st-section { padding: 18px 16px; }
  .st-rate { grid-template-columns: 70px 1fr auto; }
  .st-rate .st-hint { grid-column: 1 / -1; }
  .st-pkg { flex-wrap: wrap; }
}
