/* Restaurant Diary - design tokens from UI UX Pro Max "Restaurant Diary" system.
   Palette: appetizing red + warm gold. Type: Playfair Display SC / Karla. */

:root {
  --color-primary: #DC2626;
  --color-on-primary: #FFFFFF;
  --color-primary-soft: #FEE9E7;
  --color-secondary: #F87171;
  --color-accent: #A16207;
  --color-on-accent: #FFFFFF;
  --color-accent-soft: #FBF0DC;
  --color-background: #FDF8F4;
  --color-foreground: #450A0A;
  --color-card: #FFFFFF;
  --color-muted: #F5EDE6;
  --color-muted-foreground: #6B5750;
  --color-border: #EFE0D6;
  --color-border-strong: #E2CDBE;
  --color-destructive: #DC2626;
  --color-ring: #DC2626;
  --color-success: #15803D;
  --color-success-soft: #E7F5EC;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(69, 10, 10, .06);
  --shadow: 0 2px 8px rgba(69, 10, 10, .07), 0 1px 2px rgba(69, 10, 10, .04);
  --shadow-lg: 0 18px 45px rgba(69, 10, 10, .16);

  --font-display: "Playfair Display SC", Georgia, "Times New Roman", serif;
  --font-body: Karla, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* One motion for the whole diary: a strong ease-out, quick. Sheets use the
     iOS drawer curve. Nothing in the interface runs past 300ms. */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --t-fast: 120ms;
  --t: 180ms;
  --t-slow: 240ms;

  /* Colours with a job of their own; dark mode gives each its own value. */
  --color-primary-hover: #B91C1C;
  --c-toast-bg: #450A0A;
  --c-toast-fg: #FFF8F4;
  --c-danger-text: #B91C1C;
  --c-danger-strong: #991B1B;
  --c-success-text: #14532D;
  --c-warm-text: #713F12;
  --c-warm-label: #8A5A0B;
  --c-warm-border: #E9C98B;
  --c-warm-line: #EDD7AE;
  --c-warm-field: #E6D2B5;
  --c-warm-track: #F1E4CF;
  --c-warm-glow: #FFFAF1;
  --c-fav-1: #FFF1CF;
  --c-fav-2: #FFF8E8;
  --c-fav-3: #FFFDF8;
  --c-fav-border: #E8C678;
  --c-fav-ring: #F3DFAE;
  --c-fav-border-hover: #DDB25A;
  --c-fav-ring-hover: #EBCF8E;
  --c-fav-mark-bg: #F7DC9E;
  --c-fav-mark-shine: #FCEFC7;
  --c-fav-mark-fg: #7A4B00;
  --c-fav-review: rgba(255, 255, 255, .7);
  --c-fav-line: #F0DDB0;
  --c-star-idle: #A38B7E;
  --c-star-hover: #B7791F;
  --c-star-glow: rgba(217, 119, 6, .08);
  --c-row-hover: rgba(161, 98, 7, .06);
  --c-dot-shut: #D6C3B6;
  --c-overlay: rgba(69, 10, 10, .38);
  --c-header-glass: rgba(253, 248, 244, .92);
  --c-share-hover: #F7E4BD;
  --c-placeholder: #B9A79D;
  --c-stripes: #EFE3D9;
  --c-bottom-glass: rgba(255, 255, 255, .94);
  --c-picked: #FFFBFA;
  --c-usage-high: #C2410C;
}

*, *::before, *::after { box-sizing: border-box; }

/* Must outrank the display rules on .modal-backdrop / .modal-foot below. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Scrolling stays with the open dialog, not the page behind it. */
body.has-sheet { overflow: hidden; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: .01em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-3); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--c-header-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding-top: var(--space-3); padding-bottom: var(--space-3);
}

.brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }

.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--color-primary); color: var(--color-on-primary);
  box-shadow: var(--shadow);
}
.brand-mark .icon { width: 22px; height: 22px; }

.site-header h1 { font-size: 22px; line-height: 1.2; }

.brand-sub {
  margin: 2px 0 0; font-size: 13px; color: var(--color-muted-foreground);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4);
  font-family: inherit; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease),
              border-color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled:active { transform: none; }

.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--color-primary-hover); }
}

.btn-ghost {
  background: transparent; color: var(--color-muted-foreground);
  border-color: var(--color-border-strong);
}
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { background: var(--color-muted); color: var(--color-foreground); }
}

.btn-sm { min-height: 38px; padding: 0 var(--space-3); font-size: 14px; }

.btn-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  background: transparent; border: 0; border-radius: 50%;
  color: var(--color-muted-foreground); cursor: pointer;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn-icon:hover { background: var(--color-muted); color: var(--color-foreground); }
}
@media (hover: hover) and (pointer: fine) {
  .btn-icon.danger:hover { background: var(--color-primary-soft); color: var(--color-destructive); }
}
/* The one destructive button in a dialog's footer: set apart, on the other side. */
.btn-remove { margin-right: auto; border-color: transparent; color: var(--c-danger-text); padding: 0 12px; }
@media (hover: hover) and (pointer: fine) {
  .btn-remove:hover { background: var(--color-primary-soft); color: var(--c-danger-strong); }
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Toolbar & tabs ---------- */

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin: var(--space-4) 0;
}

.tabs {
  display: inline-flex; gap: var(--space-1); padding: var(--space-1);
  background: var(--color-muted); border-radius: 999px;
}

.tab {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4);
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: var(--color-muted-foreground);
  background: transparent; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--color-foreground); }
}
.tab.is-active {
  background: var(--color-card); color: var(--color-foreground);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  min-width: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--color-border); color: var(--color-foreground);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.tab.is-active .tab-count { background: var(--color-primary); color: var(--color-on-primary); }

.toolbar-controls { display: flex; gap: var(--space-2); flex: 1 1 320px; justify-content: flex-end; }

.field-icon { position: relative; display: flex; align-items: center; flex: 1 1 auto; max-width: 320px; }
.field-icon .icon {
  position: absolute; left: 14px; color: var(--color-muted-foreground); pointer-events: none;
}
.field-icon input {
  width: 100%; min-height: 44px; padding: 0 var(--space-3) 0 42px;
  font-family: inherit; font-size: 15px; color: var(--color-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: 999px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.field-icon input:focus { border-color: var(--color-primary); }
.field-icon input::placeholder { color: var(--color-muted-foreground); }

select {
  min-height: 44px; padding: 0 var(--space-3);
  font-family: inherit; font-size: 15px; color: var(--color-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: 999px; cursor: pointer;
}

.header-actions { display: flex; align-items: center; gap: var(--space-2); }

.view-toggle {
  display: inline-flex; gap: var(--space-1); padding: var(--space-1);
  background: var(--color-muted); border-radius: 999px;
}
.view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 var(--space-3);
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--color-muted-foreground);
  background: transparent; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .view-btn:hover { color: var(--color-foreground); }
}
.view-btn.is-active {
  background: var(--color-card); color: var(--color-foreground); box-shadow: var(--shadow-sm);
}

/* ---------- Filter bar ----------
   Wide screens: one line, search | filters | sort.
   Narrower: search, then a Filters button + sort, with the filters folding
   into a panel - forcing every chip into one clipped row would hide options. */

.filter-bar {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.filter-search { flex: 1 1 200px; min-width: 150px; max-width: 320px; }
.filter-panel { display: flex; align-items: center; gap: var(--space-2); flex: 1; }
.sort-chip { margin-left: auto; }
.chip.filters-toggle { display: none; }

.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 44px; padding: 0 var(--space-3);
  font-family: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
  color: var(--color-foreground); background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease),
              color var(--t) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover { border-color: var(--color-accent); }
}
.chip .icon { width: 16px; height: 16px; color: var(--color-muted-foreground); }
.chip.is-on {
  background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--c-danger-text);
}
.chip.is-on .icon { color: var(--c-danger-text); }

.chip-pair { display: inline-flex; align-items: center; gap: 4px; }

/* The <select> fills the pill so the whole chip opens it, keeping the native,
   accessible picker (and the phone's own wheel on mobile). */
.chip-select { padding: 0 32px 0 var(--space-3); }
.chip-select select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 16px;
}
.chip-select .chip-value { pointer-events: none; }
.chip-chevron { position: absolute; right: 12px; pointer-events: none; }
.chip-select:focus-within { outline: 2px solid var(--color-ring); outline-offset: 2px; }

.chip-count {
  min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--color-primary); color: var(--color-on-primary);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.chip-clear { color: var(--color-muted-foreground); border-style: dashed; }

/* ---------- Price ---------- */

.price-static {
  display: inline-flex; gap: 1px; font-size: 13px; font-weight: 700; line-height: 1;
}
.price-static .on { color: var(--color-accent); }
.price-static .off { color: var(--color-border-strong); }

.shekels { display: flex; gap: var(--space-1); }
.shekel-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  font-family: inherit; font-size: 20px; font-weight: 700;
  color: var(--color-border-strong);
  background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .shekel-btn:hover { transform: scale(1.08); }
}
.shekel-btn.on { color: var(--color-accent); }
.shekels.is-readonly .shekel-btn { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .shekels.is-readonly .shekel-btn:hover { transform: none; }
}

/* ---------- Near me ---------- */

.list-note {
  margin: calc(var(--space-2) * -1) 0 var(--space-3);
  font-size: 14px; color: var(--color-muted-foreground);
}

.hours-next { font-weight: 600; color: var(--color-foreground); }
.hours-span { color: var(--color-muted-foreground); }

/* ---------- Duplicates ---------- */

.dup-warning {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin-bottom: var(--space-3); padding: var(--space-3);
  background: var(--color-accent-soft); border: 1px solid var(--c-warm-border); border-radius: var(--radius);
  color: var(--c-warm-text);
}
.dup-warning > .icon { margin-top: 2px; color: var(--color-accent); }
.dup-body p { margin: 0 0 var(--space-2); font-size: 14px; line-height: 1.5; }
.dup-body .btn { background: var(--color-card); }
.tag-mini.tag-saved { background: var(--color-primary-soft); color: var(--c-danger-text); text-transform: none; }

.grid.calm .card.flash, .grid .card.flash { animation: flash 2s var(--ease); }
@keyframes flash {
  0%, 60% { box-shadow: 0 0 0 3px var(--color-accent), var(--shadow); }
  100% { box-shadow: var(--shadow-sm); }
}

/* ---------- Photos ---------- */

.card-photos {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin: 0 var(--space-4) var(--space-3);
}
.card-photo {
  position: relative; display: block; padding: 0; overflow: hidden;
  aspect-ratio: 1 / 1; border: 0; border-radius: var(--radius-sm);
  background: var(--color-muted); cursor: zoom-in;
}
.card-photo img, .photo-tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--t-slow) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .card-photo:hover img { transform: scale(1.05); }
}
.card-photo-more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(69, 10, 10, .55); color: #FFFFFF; font-weight: 700; font-size: 16px;
}

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.photo-grid:empty { display: none; }
.photo-tile {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--color-muted);
}
.photo-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in; }
.photo-remove {
  position: absolute; top: 4px; right: 4px;
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(69, 10, 10, .72); color: #FFFFFF;
}
.photo-remove .icon { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .photo-remove:hover { background: var(--color-destructive); }
}

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--space-5) var(--space-3);
  background: rgba(20, 6, 6, .92);
  animation: fade var(--t) var(--ease) both;
}
.lightbox-figure {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  max-width: min(1100px, 100%); min-width: 0;
}
.lightbox-figure img {
  max-width: 100%; max-height: calc(100vh - 140px);
  border-radius: var(--radius); object-fit: contain; box-shadow: var(--shadow-lg);
}
.lightbox-figure figcaption { color: #F5E9E0; font-size: 14px; text-align: center; }
.lightbox-btn {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #FFFFFF;
  transition: background-color var(--t) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .lightbox-btn:hover { background: rgba(255, 255, 255, .26); }
}
.lightbox-btn .icon { width: 22px; height: 22px; }
.lightbox-close { position: absolute; top: var(--space-3); right: var(--space-3); }
.lightbox :focus-visible { outline-color: #FFFFFF; }

/* ---------- Menu ---------- */

.link-btn {
  padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--color-muted-foreground);
  text-decoration: underline; text-underline-offset: 2px; text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .link-btn:hover { color: var(--color-primary); }
}

.menu-message { margin: 0 0 var(--space-3); color: var(--color-muted-foreground); }
.menu-error {
  margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); background: var(--color-primary-soft); color: var(--c-danger-strong);
}
.menu-status {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-3); color: var(--color-muted-foreground);
}
.spinner-inline {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--color-border-strong); border-top-color: var(--color-primary);
  animation: spin .7s linear infinite;
}
.menu-open { margin-bottom: var(--space-3); text-decoration: none; }
.menu-items {
  list-style: none; margin: 0 0 var(--space-3); padding: 0;
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius);
}
.menu-items li {
  display: flex; align-items: baseline; gap: var(--space-3);
  padding: 10px var(--space-3); border-bottom: 1px solid var(--color-border);
}
.menu-items li:last-child { border-bottom: 0; }
.menu-dish { flex: 1; min-width: 0; overflow-wrap: anywhere; unicode-bidi: plaintext; font-weight: 600; }
.menu-desc {
  display: block; margin-top: 2px; font-size: 13px; font-weight: 400; line-height: 1.45;
  color: var(--color-muted-foreground); unicode-bidi: plaintext;
}
.menu-price {
  flex: none; font-weight: 700; color: var(--color-accent); white-space: nowrap;
  unicode-bidi: plaintext;
}
.menu-other-label { margin-top: var(--space-3); }
.menu-links { margin: 0 0 var(--space-3); padding-left: 18px; }
.menu-links a { color: var(--color-foreground); overflow-wrap: anywhere; }
.menu-paste {
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border);
}
.menu-paste-row { display: flex; gap: var(--space-2); }
.menu-paste-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 var(--space-3);
  font: inherit; color: var(--color-foreground); background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
}
.menu-paste-row input:focus { border-color: var(--color-primary); }

/* ---------- Google usage ---------- */

.usage {
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.usage-head { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
.usage-head h2 {
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--color-muted-foreground);
}
.usage-reset { font-size: 13px; color: var(--color-muted-foreground); }

.google-state {
  display: flex; gap: var(--space-2); align-items: flex-start;
  margin-bottom: var(--space-4); padding: var(--space-3);
  border-radius: var(--radius); background: var(--color-success-soft);
  color: var(--c-success-text); font-size: 14px; line-height: 1.5;
}
.google-state > .icon { margin-top: 2px; color: var(--color-success); }

.usage-rows { display: grid; gap: 6px; }
.usage-row {
  display: grid; align-items: center; gap: var(--space-3);
  grid-template-columns: 150px 1fr 48px 96px;
  font-size: 14px;
}
.usage-label { font-weight: 600; }
.usage-track {
  position: relative; height: 8px; overflow: hidden;
  border-radius: 999px; background: var(--color-muted);
}
.usage-fill {
  position: absolute; inset: 0;
  background: var(--color-accent);
  transform: scaleX(var(--fill, 0)); transform-origin: left center;
  transition: transform var(--t-slow) var(--ease);
}
.usage-row.high .usage-fill { background: var(--c-usage-high); }
.usage-row.full .usage-fill { background: var(--color-destructive); }
.usage-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.usage-row.full .usage-value { color: var(--c-danger-text); }
.usage-count {
  color: var(--color-muted-foreground); text-align: right; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.usage-note { margin: var(--space-2) 0 0; font-size: 13px; color: var(--color-muted-foreground); }

.usage-off { display: flex; align-items: center; gap: var(--space-3); }
.usage-off > .icon { color: var(--color-accent); }
.usage-off p { flex: 1; margin: 0; font-size: 14px; color: var(--color-muted-foreground); }
.usage-off strong { color: var(--color-foreground); }

.search-notice {
  margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); background: var(--color-accent-soft);
  font-size: 13.5px; color: var(--c-warm-text);
}
.search-credit {
  margin: var(--space-2) 0 0; font-size: 12px; text-align: right;
  color: var(--color-muted-foreground);
}
.result.is-loading { opacity: .6; cursor: progress; }

/* ---------- A tick-box with an explanation ---------- */

.check-option {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin-bottom: var(--space-3); padding: var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  background: var(--color-card); cursor: pointer;
}
.check-option input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--color-primary); }
.check-text { min-width: 0; }
.check-text .field-help { margin-top: 2px; }

/* ---------- Recommend one ---------- */

/* The other way into the dialog, so it gets a card of its own rather than a
   link under the search box. The choices are on show, not folded away. */
/* Second to the search: a quiet one-line card until it's opened, then the
   warm panel with the choices. */
.recommend {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  margin-top: var(--space-4);
  background: var(--color-card);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.recommend.is-open {
  background: linear-gradient(180deg, var(--color-accent-soft), var(--c-warm-glow) 70%);
  border-color: var(--c-warm-line); border-radius: var(--radius-lg);
}
.recommend-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 0; background: none; border-radius: inherit;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.recommend-head:focus-visible { outline: 2px solid var(--color-ring); outline-offset: -2px; }
.recommend-mark {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent);
}
.recommend.is-open .recommend-mark { background: var(--color-card); box-shadow: 0 0 0 1px var(--c-warm-line); }
.recommend-mark .icon { width: 16px; height: 16px; }
.recommend-text { flex: 1; min-width: 0; display: grid; }
.recommend-text strong { font-size: 15px; line-height: 1.3; }
.recommend-text span { font-size: 13px; color: var(--color-muted-foreground); }
.recommend-chevron {
  flex: none; width: 18px; height: 18px; color: var(--color-muted-foreground);
  transition: transform var(--t) var(--ease);
}
.recommend.is-open .recommend-chevron { transform: rotate(180deg); }
.recommend-body { padding: 4px var(--space-3) var(--space-3); }
@media (hover: hover) and (pointer: fine) {
  .recommend:not(.is-open):hover { border-color: var(--c-warm-border); }
}

.rec-field { margin-bottom: 12px; }
.rec-label {
  display: block; margin-bottom: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-warm-label);
}

/* A whole-width select that looks like the switches below it. */
.rec-select {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 40px 0 14px;
  background: var(--color-card); border: 1px solid var(--c-warm-field); border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: border-color 150ms ease;
}
.rec-select select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 16px;
}
.rec-select .icon { width: 16px; height: 16px; color: var(--color-accent); }
.rec-select .chip-value { pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-chevron { position: absolute; right: 14px; pointer-events: none; color: var(--color-muted-foreground) !important; }
.rec-select:focus-within { outline: 2px solid var(--color-ring); outline-offset: 2px; }

/* A switch: one highlight that slides to the choice, so the eye follows the
   change instead of watching one pill go dark and another light up. */
.segmented {
  position: relative; display: grid; grid-template-columns: repeat(var(--count), 1fr);
  padding: 3px; background: var(--c-warm-track); border-radius: 12px;
}
.segmented-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--count));
  background: var(--color-card); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(69, 10, 10, .10), 0 1px 1px rgba(69, 10, 10, .04);
  transform: translateX(calc(var(--index) * 100%));
  transition: transform 240ms var(--ease-out);
}
.segmented button {
  position: relative; z-index: 1; min-height: 38px; padding: 0 4px;
  font-family: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
  color: var(--color-muted-foreground); background: none; border: 0; border-radius: 9px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color 180ms ease, transform 120ms ease-out;
}
.segmented button[aria-checked="true"] { color: var(--color-foreground); }
.segmented button:active { transform: scale(0.96); }
.segmented button:focus-visible { outline: 2px solid var(--color-ring); outline-offset: -2px; }
.segmented-tight button { font-size: 13px; }

@media (hover: hover) and (pointer: fine) {
  .rec-select:hover { border-color: var(--color-accent); }
  .segmented button:hover { color: var(--color-foreground); }
}

/* The address and the map arrive with the choice that asked for them. */
.rec-area {
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style {
  .rec-area { opacity: 0; transform: translateY(-4px); }
}
/* Beats the phone rule that stacks paste rows: an address and "Find" fit side by side. */
.rec-area .menu-paste-row { flex-direction: row; margin-bottom: var(--space-2); }
.rec-area .menu-paste-row input { background: var(--color-card); border-color: var(--c-warm-field); border-radius: 12px; }
.rec-area .menu-paste-row .btn { flex: none; min-height: 44px; border-radius: 12px; background: var(--color-card); }
.rec-spot { margin: 0 0 12px; font-size: 13px; color: var(--color-muted-foreground); }
.rec-spot:empty { display: none; }
.spot-map {
  height: 200px; margin-bottom: var(--space-2);
  border: 1px solid var(--c-warm-field); border-radius: 12px;
  overflow: hidden; position: relative; isolation: isolate;
}

.recommend-go {
  width: 100%; min-height: 50px; margin-top: 4px; padding: 10px 14px;
  white-space: normal; text-align: center; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(153, 27, 27, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.recommend-go:active { transform: scale(0.97); }
.recommend-go[aria-busy="true"] { opacity: .75; cursor: progress; }
.recommend-go .icon { flex: none; }

.suggestion {
  margin-top: 12px; padding: var(--space-3) var(--space-3) 14px;
  background: var(--color-card); border: 1px solid var(--c-warm-field);
  border-radius: 14px; box-shadow: var(--shadow);
  transition: opacity 240ms cubic-bezier(0.23, 1, 0.32, 1), transform 240ms cubic-bezier(0.23, 1, 0.32, 1);
}
@starting-style {
  .suggestion { opacity: 0; transform: translateY(6px); }
}
.suggestion h3 { font-size: 20px; margin-top: var(--space-1); overflow-wrap: anywhere; }
.suggestion-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-accent);
}
.suggestion-where {
  margin: var(--space-1) 0 0; font-size: 14px; color: var(--color-muted-foreground);
}
.suggestion-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
/* Two equal buttons side by side; they only stack when the card is too narrow. */
.suggestion-actions .btn { flex: 1 1 auto; padding: 0 12px; }
.suggestion-actions .btn:active { transform: scale(0.97); }
/* The same facts as a search result, lined up under the name rather than indented. */
.suggestion .card-meta { padding: 0; margin-top: 12px; }
.suggestion .menu-message, .suggestion .menu-status, .suggestion .menu-error { margin: 0; }

/* The three suggestions: a line of facts, one of status, one of place, and an
   Add button each. They arrive one after another. */
.picks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pick {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 12px;
  border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-background);
  animation: rise var(--t-slow) var(--ease) both; animation-delay: calc(var(--n, 0) * 50ms);
}
.pick h4 { margin: 0; min-width: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.pick p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13px; color: var(--color-muted-foreground); }
.pick-facts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pick-facts .price-static { font-size: 12px; }
.pick-rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--color-foreground); }
.pick-rating .icon { width: 13px; height: 13px; color: var(--color-accent); fill: var(--color-accent); }
.pick-where { overflow-wrap: anywhere; }
.pick-where a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pick-add { padding: 0 12px; min-height: 34px; }

.share-source {
  display: flex; gap: var(--space-2); align-items: flex-start;
  margin-bottom: var(--space-3); padding: var(--space-3);
  background: var(--color-accent-soft); border: 1px solid var(--c-warm-border); border-radius: var(--radius);
  color: var(--c-warm-text); font-size: 14px; line-height: 1.5;
}
.share-source > .icon { margin-top: 2px; color: var(--color-accent); }
.share-source p { margin: 4px 0 0; }
.share-source .menu-status { margin: 4px 0 0; color: inherit; }
.share-caption { font-style: italic; opacity: .9; }
.share-picks { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.share-picks .chip { min-height: 38px; font-size: 13.5px; }

.search-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.search-row .field-icon { flex: 1 1 260px; }
.country-chip { min-height: 52px; }
.country-chip .chip-value {
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.results-empty-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.results-empty-actions .btn { margin-top: 0; }
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; }
.hint code, .field-help code {
  font-size: 12px; padding: 1px 4px; border-radius: 4px; background: var(--color-muted);
}

.you-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--color-primary); border: 3px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transform: translateY(50%);
}

/* ---------- Map ---------- */

#map {
  /* keeps the map's own layers (z-index 400+) from drawing over sheets and toasts */
  position: relative; isolation: isolate;
  height: min(70vh, 620px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-7);
  background: var(--color-muted);
}
#map-canvas { width: 100%; height: 100%; }
.map-fallback {
  display: grid; place-items: center; height: 100%; padding: var(--space-5);
  text-align: center; color: var(--color-muted-foreground);
  max-width: 60ch; margin: 0 auto;
}
.gm-style .gm-style-iw { font-family: var(--font-body); font-size: 14px; line-height: 1.5; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content { font-size: 14px; line-height: 1.5; }

/* ---------- Cards ---------- */

.grid {
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding-bottom: var(--space-7);
}

.card {
  display: flex; flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t-slow) var(--ease), transform var(--t-slow) var(--ease),
              border-color var(--t-slow) var(--ease);
  animation: rise var(--t-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
/* Lifts only under a mouse: on a touch screen a lift sticks after the tap. */
@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow); transform: translateY(-2px);
    border-color: var(--color-border-strong);
  }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.grid.calm .card, .card.no-enter { animation: none; }

/* ---------- Favorites ----------
   A gradient can't be transitioned directly, so the warm tint lives on a
   layer behind the content and fades in with opacity. */

.card { position: relative; }
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, var(--c-fav-1) 0%, var(--c-fav-2) 42%, var(--c-fav-3) 100%);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.card > * { position: relative; }
.card.is-favorite { border-color: var(--c-fav-border); box-shadow: 0 0 0 1px var(--c-fav-ring), var(--shadow-sm); }
@media (hover: hover) {
  .card.is-favorite:hover { border-color: var(--c-fav-border-hover); box-shadow: 0 0 0 1px var(--c-fav-ring-hover), var(--shadow); }
}
.card.is-favorite::before { opacity: 1; }
.card-mark, .card-actions, .card-review {
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease),
              border-color var(--t-slow) var(--ease);
}
.card.is-favorite .card-mark {
  background: linear-gradient(135deg, var(--c-fav-mark-bg) 0%, var(--c-fav-mark-shine) 45%, var(--c-fav-mark-bg) 100%);
  color: var(--c-fav-mark-fg);
  position: relative; overflow: hidden;
}
.card.is-favorite .card-review { background: var(--c-fav-review); }
.card.is-favorite .card-actions { border-top-color: var(--c-fav-line); }

/* A slow, occasional glint across the favorite badge and star — gold catching
   the light, not a loop running for its own sake. */
.card.is-favorite .card-mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .85) 50%, transparent 65%);
  transform: translateX(-140%);
  animation: fav-shine 5.5s ease-in-out infinite;
  animation-delay: 1.2s;
}

.fav-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; margin: -6px -8px 0 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--c-star-idle);
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease),
              transform var(--t-fast) var(--ease);
}
.fav-btn .icon { width: 22px; height: 22px; transition: fill var(--t) var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .fav-btn:hover { color: var(--c-star-hover); background: var(--c-star-glow); }
}
.fav-btn:active { transform: scale(.9); }
.fav-btn[aria-pressed="true"] { color: #D97706; position: relative; overflow: hidden; }
.fav-btn[aria-pressed="true"] .icon { fill: #F59E0B; }
.fav-btn[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 244, 214, .9) 50%, transparent 65%);
  transform: translateX(-140%);
  animation: fav-shine 5.5s ease-in-out infinite;
  animation-delay: 1.2s;
  pointer-events: none;
}
.fav-btn.pop .icon { animation: fav-pop 260ms var(--ease); }
@keyframes fav-pop { 0% { transform: scale(.8); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes fav-shine {
  0%, 55% { transform: translateX(-140%); }
  85%, 100% { transform: translateX(140%); }
}

.card-top {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.card-mark {
  display: grid; place-items: center;
  width: 46px; height: 46px; flex: none;
  border-radius: 12px;
  background: var(--color-accent-soft); color: var(--color-accent);
  font-family: var(--font-display); font-size: 18px;
}

.card-title-group { min-width: 0; flex: 1; }

.card h3 {
  font-size: 19px; line-height: 1.25;
  overflow-wrap: anywhere; text-wrap: balance;
}

.card-local {
  margin-top: 2px; font-size: 14px; color: var(--color-muted-foreground);
  overflow-wrap: anywhere;
}

.card-tagline {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2);
  margin-top: 4px;
}

.card-cuisine {
  font-size: 13px; font-weight: 500;
  color: var(--color-accent); text-transform: capitalize;
}

.result-local { font-weight: 400; color: var(--color-muted-foreground); }

.card-meta {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
  font-size: 14px; color: var(--color-muted-foreground);
}
.meta-row { display: flex; align-items: flex-start; gap: var(--space-2); }
.meta-row .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--color-border-strong); }
.meta-row span { min-width: 0; overflow-wrap: anywhere; }
.meta-row a { color: var(--color-muted-foreground); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .meta-row a:hover { color: var(--color-primary); }
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.badge-open { background: var(--color-success-soft); color: var(--color-success); }
.badge-closed { background: var(--color-muted); color: var(--color-muted-foreground); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.hours-today { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

.card-review {
  margin: 0 var(--space-4) var(--space-3);
  padding: var(--space-3);
  background: var(--color-muted);
  border-radius: var(--radius);
}

.stars-static { display: inline-flex; gap: 2px; }
.stars-static .icon { width: 17px; height: 17px; color: var(--color-border-strong); }
.stars-static .icon.on { color: var(--color-accent); fill: var(--color-accent); }

.review-text {
  margin: var(--space-2) 0 0; font-size: 14px; line-height: 1.55;
  color: var(--color-foreground); overflow-wrap: anywhere;
}

.dishes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.dish-chip {
  padding: 3px 10px; border-radius: 999px;
  background: var(--color-card); border: 1px solid var(--color-border-strong);
  font-size: 12.5px; font-weight: 600; color: var(--color-foreground);
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: auto; padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
}
.card-actions .spacer { flex: 1; }

/* ---------- Simple list ----------
   One line per restaurant, opening to the same details a card shows. */

.rows { display: block; padding-bottom: var(--space-7); }

.rows-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}

.row { position: relative; border-bottom: 1px solid var(--color-border); }
.row:last-child { border-bottom: 0; }
.row::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, var(--c-fav-1) 0%, var(--c-fav-2) 42%, var(--c-fav-3) 100%);
  opacity: 0; transition: opacity var(--t-slow) var(--ease);
}
.row.is-favorite::before { opacity: 1; }
.row > * { position: relative; }

.row-line { display: flex; align-items: center; gap: var(--space-1); padding-right: var(--space-2); }

.row-main {
  display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0;
  min-height: 56px; padding: 10px var(--space-2) 10px var(--space-3);
  font: inherit; text-align: left; color: inherit;
  background: transparent; border: 0; cursor: pointer;
  transition: background-color var(--t) var(--ease);
}
@media (hover: hover) {
  .row-main:hover { background: var(--c-row-hover); }
}

.row-dot {
  width: 9px; height: 9px; flex: none; border-radius: 50%;
  background: var(--color-border-strong);
}
.row-dot.is-open-now { background: var(--color-success); }
.row-dot.is-shut { background: var(--c-dot-shut); }

.row-body { min-width: 0; flex: 1; }
.row-name {
  display: block; font-weight: 700; font-size: 15.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-local { font-weight: 400; color: var(--color-muted-foreground); }
.row-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 3px; font-size: 13px; color: var(--color-muted-foreground);
}
.row-meta .price-static { font-size: 12px; }
.row-rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.row-rating .icon { width: 13px; height: 13px; color: var(--color-accent); fill: var(--color-accent); }
.row-cuisine { text-transform: capitalize; }
.row-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--color-border-strong); }
.row-open { font-weight: 700; color: var(--color-success); }
.row-open.is-shut { font-weight: 600; color: var(--color-muted-foreground); }

.row-chevron {
  flex: none; color: var(--color-muted-foreground);
  transition: transform var(--t) var(--ease);
}
.row.is-open .row-chevron { transform: rotate(180deg); }
.row .fav-btn { margin: 0; width: 40px; height: 40px; }
.row .fav-btn .icon { width: 19px; height: 19px; }

.row-details { padding-bottom: var(--space-2); }
@keyframes row-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.row-details .card-meta { padding: 0 var(--space-3) var(--space-3) 40px; }
.row-details .card-photos, .row-details .card-review { margin: 0 var(--space-3) var(--space-3) 40px; }
.row-details .card-actions { padding: var(--space-2) var(--space-3); border-top: 1px dashed var(--color-border); }
.row.is-favorite .card-review { background: var(--c-fav-review); }

/* ---------- Empty state ---------- */

.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-3); padding: var(--space-7) var(--space-4);
  background: var(--color-card); border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
}
.empty-mark {
  display: grid; place-items: center; width: 64px; height: 64px;
  border-radius: 50%; background: var(--color-muted); color: var(--color-accent);
}
.empty-mark .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 20px; }
.welcome .welcome-join { width: 100%; max-width: 380px; }
.welcome .welcome-error { margin: 0; }
.welcome-start { margin-top: var(--space-2); }
.welcome-code {
  display: grid; justify-items: center; gap: var(--space-2); width: 100%; max-width: 380px;
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border);
}
.welcome-or { font-size: 14px; }
.empty p { margin: 0; max-width: 40ch; color: var(--color-muted-foreground); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-3);
  background: var(--c-overlay);
  backdrop-filter: blur(3px);
  animation: fade var(--t) var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  display: flex; flex-direction: column;
  width: 100%; max-width: 620px; max-height: min(88vh, 780px);
  background: var(--color-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop var(--t-slow) var(--ease) both;
}
.modal-sm { max-width: 480px; }
.calendar-links { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.calendar-links .btn { justify-content: center; text-decoration: none; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
/* Leaving is quicker than arriving. */
.modal-backdrop.is-closing { animation: fade-out 180ms var(--ease) both; pointer-events: none; }
.modal-backdrop.is-closing .modal { animation: pop-out 180ms var(--ease) both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-3) var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.modal-head h2 { font-size: 21px; }

.modal-body { padding: var(--space-4) var(--space-5); overflow-y: auto; }

.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.hint { margin: 0 0 var(--space-3); font-size: 14px; color: var(--color-muted-foreground); }

.field-icon.field-lg { max-width: none; }
.field-lg input { min-height: 52px; font-size: 16px; }

.spinner {
  position: absolute; right: 16px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--color-border-strong); border-top-color: var(--color-primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Autocomplete results ---------- */

.results { list-style: none; margin: var(--space-3) 0 0; padding: 0; }

.result {
  display: flex; align-items: flex-start; gap: var(--space-3);
  width: 100%; padding: var(--space-3);
  text-align: left; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; font-family: inherit; color: inherit;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.result.is-active { background: var(--color-muted); border-color: var(--color-border); }
@media (hover: hover) and (pointer: fine) {
  .result:hover { background: var(--color-muted); border-color: var(--color-border); }
}

.result-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 10px; background: var(--color-primary-soft); color: var(--color-primary);
}
.result-mark .icon { width: 18px; height: 18px; }
.result-body { display: block; min-width: 0; flex: 1; }
.result-name { display: block; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.result-addr {
  display: block; font-size: 13px; color: var(--color-muted-foreground); margin-top: 2px;
  line-height: 1.45; overflow-wrap: anywhere;
}
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-mini {
  padding: 2px 8px; border-radius: 999px; background: var(--color-accent-soft);
  color: var(--color-accent); font-size: 11.5px; font-weight: 700;
  text-transform: capitalize; letter-spacing: .02em;
}

.results-empty {
  margin-top: var(--space-3); padding: var(--space-4);
  background: var(--color-muted); border-radius: var(--radius);
  font-size: 14px; color: var(--color-muted-foreground);
}
.results-empty strong { color: var(--color-foreground); }
.results-empty .btn { margin-top: var(--space-3); }

/* ---------- Preview & form ---------- */

.preview {
  padding: var(--space-4); margin-bottom: var(--space-4);
  background: var(--color-muted); border-radius: var(--radius);
}
.preview h3 { font-size: 20px; overflow-wrap: anywhere; }
.preview .card-meta { padding: var(--space-3) 0 0; }
.preview-note {
  display: flex; gap: var(--space-2); margin-top: var(--space-3);
  font-size: 13px; color: var(--color-muted-foreground);
}

.choice { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.choice legend {
  padding: 0; margin-bottom: var(--space-2);
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-muted-foreground);
}
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.choice-card { cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice-inner {
  display: flex; flex-direction: column; gap: 3px;
  height: 100%; padding: var(--space-3);
  border: 1.5px solid var(--color-border-strong); border-radius: var(--radius);
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.choice-inner .icon { color: var(--color-muted-foreground); }
@media (hover: hover) and (pointer: fine) {
  .choice-card:hover .choice-inner { border-color: var(--color-accent); }
}
.choice-card input:checked + .choice-inner {
  border-color: var(--color-primary); background: var(--color-primary-soft);
}
.choice-card input:checked + .choice-inner .icon { color: var(--color-primary); }
.choice-card input:focus-visible + .choice-inner { outline: 2px solid var(--color-ring); outline-offset: 2px; }
.choice-label { font-weight: 700; font-size: 15px; }
.choice-sub { font-size: 12.5px; color: var(--color-muted-foreground); }

.field { margin-bottom: var(--space-4); }
.field-label {
  display: block; margin-bottom: var(--space-2);
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-muted-foreground);
}
.field input[type="text"], .field textarea {
  width: 100%; padding: 12px var(--space-3);
  font-family: inherit; font-size: 15px; color: var(--color-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  transition: border-color var(--t) var(--ease);
}
.field input[type="text"] { min-height: 46px; }
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: var(--color-primary); }
.field-help { display: block; margin-top: 6px; font-size: 12.5px; color: var(--color-muted-foreground); }
.field-help.is-good { color: var(--color-success); }
.field-help.is-bad { color: var(--c-danger-text); }

.review-for {
  margin: 0 0 var(--space-4); font-size: 15px; color: var(--color-muted-foreground);
}
.review-for strong { color: var(--color-foreground); font-family: var(--font-display); }

/* ---------- Star input ---------- */

.stars { display: flex; gap: var(--space-1); }
.star-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--color-border-strong); cursor: pointer;
  transition: color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.star-btn .icon { width: 26px; height: 26px; }
@media (hover: hover) and (pointer: fine) {
  .star-btn:hover { transform: scale(1.08); }
}
.star-btn.on { color: var(--color-accent); }
.star-btn.on .icon { fill: var(--color-accent); }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 80; max-width: calc(100vw - 32px);
  padding: 13px var(--space-4);
  background: var(--c-toast-bg); color: var(--c-toast-fg);
  border-radius: 999px; box-shadow: var(--shadow-lg);
  font-size: 14.5px; font-weight: 600;
  animation: toast-in var(--t-slow) var(--ease) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.is-leaving { animation: toast-out 150ms var(--ease) both; }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- Share button & sync ---------- */

.share-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-3) 0 14px;
  font-family: inherit; font-size: 14px; font-weight: 700; white-space: nowrap;
  color: var(--color-foreground); background: var(--color-accent-soft);
  border: 1px solid var(--c-warm-border); border-radius: 999px; cursor: pointer;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.share-btn .icon { color: var(--color-accent); }
@media (hover: hover) and (pointer: fine) {
  .share-btn:hover { background: var(--c-share-hover); border-color: var(--c-fav-border-hover); }
}
.share-btn:active { transform: scale(0.97); }
.share-label-short { display: none; }

.sync-dot {
  width: 9px; height: 9px; flex: none; border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 2px var(--color-accent-soft);
}
.sync-dot[data-status="syncing"], .sync-dot[data-status="connecting"],
.sync-dot[data-status="offline"] { background: #D97706; }
.sync-dot[data-status="error"] { background: var(--color-destructive); }

.sync-status {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-muted);
}
.sync-status > .icon { color: var(--color-success); }
.sync-status[data-status="offline"] > .icon, .sync-status[data-status="syncing"] > .icon,
.sync-status[data-status="connecting"] > .icon { color: #B45309; }
.sync-status[data-status="error"] > .icon { color: var(--color-destructive); }
.sync-text { flex: 1; min-width: 0; }
.sync-text strong { display: block; font-size: 14.5px; }
.sync-text small { display: block; font-size: 13px; color: var(--color-muted-foreground); }

.share-card {
  margin-bottom: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-card);
}
.share-card h3 { font-size: 17px; }
.share-card p { margin: var(--space-1) 0 var(--space-3); font-size: 14px; color: var(--color-muted-foreground); }
.share-join { display: flex; gap: var(--space-2); }
.code-input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 var(--space-3);
  font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--color-foreground); background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
}
.code-input::placeholder { font-weight: 400; color: var(--c-placeholder); }
.code-input:focus { border-color: var(--color-primary); }
.code-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.code-box {
  flex: 1; min-width: 0; padding: 10px var(--space-3);
  font-family: inherit; font-size: 22px; font-weight: 700; letter-spacing: .22em;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius); background: var(--color-muted);
}
.share-invite { margin: var(--space-1) 0 var(--space-4); }
.share-leave { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-size: 14px; }
.share-leave.is-armed { color: var(--color-destructive); font-weight: 700; }

/* ---------- Settings ---------- */

.settings-section + .settings-section {
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border);
}
.settings-heading {
  margin-bottom: var(--space-2);
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted-foreground);
}
.settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.settings-actions-start { justify-content: flex-start; }
.google-form { margin-bottom: var(--space-3); }
.google-form .field { margin-bottom: var(--space-3); }
.usage-sheet { margin: 0 0 var(--space-4); box-shadow: none; background: var(--color-muted); border-color: transparent; }
.usage-sheet .usage-row { grid-template-columns: 1fr auto; row-gap: 2px; column-gap: var(--space-2); }
.usage-sheet .usage-track { grid-column: 1 / -1; order: 4; background: var(--color-card); }
.usage-sheet .usage-count { display: none; }

/* ---------- Map pins (free map) ---------- */

.map-pin span {
  display: block; width: 26px; height: 26px; margin: 2px 0 0;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--color-primary); border: 3px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(69, 10, 10, .35);
}
.map-pin.is-favorite span { background: #F59E0B; }

/* Photos still on their way from the other device */
.card-photo.is-missing, .photo-tile.is-missing {
  background: repeating-linear-gradient(135deg, var(--color-muted) 0 8px, var(--c-stripes) 8px 16px);
}

/* ---------- Bottom bar (phones) ---------- */

.bottom-nav { display: none; }
.view-toggle-compact { display: none; }
.filter-row { display: contents; }

/* ---------- Responsive ---------- */

/* Tabs and the List/Map switch share a line down to phone width. */
@media (max-width: 1099px) {
  .filter-bar { flex-wrap: wrap; }
  .filter-search { flex: 1 1 100%; max-width: none; }
  .chip.filters-toggle { display: inline-flex; }
  .filter-panel {
    display: none; order: 3; flex: 1 1 100%; flex-wrap: wrap;
    padding: var(--space-3); border: 1px solid var(--color-border);
    border-radius: var(--radius); background: var(--color-card);
  }
  .filter-bar.is-open .filter-panel { display: flex; }
  .filter-bar.is-open .filters-toggle { border-color: var(--color-accent); }
}

/* Phones: the lists and Add move to a bar under the thumb, dialogs become
   sheets from the bottom, and the filters scroll sideways in one row. */
@media (max-width: 720px) {
  .wrap { padding: 0 var(--space-3); }
  main.wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  .site-header { position: static; backdrop-filter: none; background: var(--color-background); }
  .header-inner {
    padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: 12px; gap: var(--space-2);
  }
  /* the name stays whole; the round mark gives way on phone widths */
  .brand-mark { display: none; }
  .brand > div { min-width: 0; }
  .site-header h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-sub { display: none; }
  .header-actions { gap: var(--space-1); }
  .header-add { display: none; }
  .share-btn { padding: 0 14px 0 12px; }
  .share-label { display: none; }
  .share-label-short { display: inline; }
  /* once sharing, the icon and its live dot say enough, and the name keeps its room */
  .share-btn.is-sharing { padding: 0 14px; }
  .share-btn.is-sharing .share-label-short { display: none; }

  .usage-page { display: none; }

  .toolbar { display: none; }

  .filter-bar { flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
  .filter-search { flex: 1 1 0; min-width: 0; max-width: none; }
  .view-toggle-compact { display: inline-flex; flex: none; }
  .view-toggle-compact .view-btn { min-height: 38px; width: 40px; justify-content: center; padding: 0; }
  .rows-list { border-radius: var(--radius); }
  .row-main { padding-left: var(--space-2); gap: var(--space-2); }
  .row-details .card-meta, .row-details .card-photos, .row-details .card-review {
    margin-left: 0; padding-left: var(--space-3);
  }
  .row-details .card-meta { padding-right: var(--space-3); }
  /* "Open now", "Near me" and a Filters chip fit one line; nothing is cut off
     at the edge. Type, city and sort open in a panel under them. */
  .filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); flex: 1 1 100%; }
  .filter-row > .chip, .chip-pair > .chip:not(.chip-select) { padding: 0 13px; }
  .filter-panel { padding: var(--space-3) 12px; }
  .sort-chip { margin-left: 0; }

  .field-icon input, .field input[type="text"], .field textarea,
  .menu-paste-row input, .code-input { font-size: 16px; } /* smaller text makes iPhones zoom in */

  .grid { grid-template-columns: 1fr; gap: var(--space-2); }
  .card-top { padding: var(--space-3) var(--space-3) var(--space-2); }
  .card-meta { padding: 0 var(--space-3) var(--space-3); }
  .card-photos { margin: 0 var(--space-3) var(--space-3); }
  .card-review { margin: 0 var(--space-3) var(--space-3); }
  .card-actions { padding: var(--space-2) var(--space-3); }
  .card h3 { font-size: 18px; }
  .empty { padding: var(--space-6) var(--space-3); }

  #map {
    height: calc(100dvh - 300px - env(safe-area-inset-bottom)); min-height: 340px;
    margin-bottom: 0; border-radius: var(--radius);
  }

  .bottom-nav {
    position: fixed; z-index: 45; left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: var(--space-1); padding: 6px;
    background: var(--c-bottom-glass); backdrop-filter: blur(14px);
    border: 1px solid var(--color-border); border-radius: 24px;
    box-shadow: 0 10px 30px rgba(69, 10, 10, .14), 0 2px 6px rgba(69, 10, 10, .06);
  }
  .bottom-tab {
    position: relative; flex: 1; min-width: 0; min-height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-family: inherit; font-size: 12px; font-weight: 700; color: var(--color-muted-foreground);
    background: transparent; border: 0; border-radius: 18px; cursor: pointer;
    transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
  }
  .bottom-tab .icon { width: 21px; height: 21px; }
  .bottom-tab.is-active { background: var(--color-primary-soft); color: var(--c-danger-text); }
  .bottom-count {
    position: absolute; top: 5px; left: calc(50% + 8px);
    min-width: 19px; padding: 0 5px; border-radius: 999px;
    background: var(--color-border); color: var(--color-foreground);
    font-size: 11px; line-height: 17px; text-align: center;
  }
  .bottom-tab.is-active .bottom-count { background: var(--color-primary); color: var(--color-on-primary); }
  .bottom-add {
    display: grid; place-items: center; flex: none;
    width: 56px; height: 56px; margin: 0 var(--space-1);
    background: var(--color-primary); color: var(--color-on-primary);
    border: 0; border-radius: 18px; cursor: pointer;
    box-shadow: 0 6px 16px rgba(220, 38, 38, .35);
    transition: transform var(--t-fast) var(--ease), background-color var(--t) var(--ease);
  }
  .bottom-add .icon { width: 26px; height: 26px; stroke-width: 2.2; }
  .bottom-add:active { transform: scale(.94); background: var(--color-primary-hover); }

  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); border-radius: var(--radius); text-align: center; }

  /* dialogs become sheets from the bottom */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal-sm {
    max-width: none; max-height: calc(100dvh - 16px - env(safe-area-inset-top));
    border-radius: 24px 24px 0 0;
    animation: sheet-up 300ms var(--ease-drawer) both;
  }
  .modal-tall { height: calc(100dvh - 16px - env(safe-area-inset-top)); }
  .modal-head {
    padding: calc(var(--space-3) + 6px) var(--space-2) var(--space-3) var(--space-3);
    touch-action: none; /* the top of a sheet is its handle */
  }
  /* the grab handle: says "this can be pulled down" */
  .modal { position: relative; }
  .modal::before {
    content: ""; position: absolute; top: 7px; left: 50%; z-index: 1;
    width: 36px; height: 5px; margin-left: -18px; border-radius: 3px;
    background: var(--color-border-strong);
  }
  .modal-backdrop.is-closing .modal { animation: sheet-down 190ms var(--ease) both; }
  .modal-head h2 { font-size: 19px; }
  .modal-body, .modal-foot { padding-left: var(--space-3); padding-right: var(--space-3); }
  .modal-body { padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
  .modal-foot {
    flex-direction: column-reverse;
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }
  .modal-body:has(+ .modal-foot:not([hidden])) { padding-bottom: var(--space-4); }
  .modal-foot .btn { width: 100%; }
  /* On a sheet, the ×, Back and a pull down already cancel; one button is enough. */
  #cancel-review, #cancel-details { display: none; }
  .choice-row { grid-template-columns: 1fr 1fr; }
  .choice-sub { display: none; }
  .menu-items { max-height: none; }
  .menu-paste-row { flex-direction: column; }
  .settings-actions { justify-content: flex-start; }
  .share-join .btn { flex: none; }

  .usage-head { flex-wrap: wrap; row-gap: 2px; }
  .usage-row { grid-template-columns: 1fr auto auto; row-gap: 2px; column-gap: var(--space-2); }
  .usage-track { grid-column: 1 / -1; order: 4; }
  .usage-count { font-size: 12.5px; }
  .usage-off { flex-wrap: wrap; }

  .lightbox {
    gap: var(--space-1);
    padding: calc(var(--space-6) + env(safe-area-inset-top)) var(--space-1) calc(var(--space-7) + env(safe-area-inset-bottom));
    touch-action: pan-y;
  }
  .lightbox-figure img { max-height: calc(100dvh - 200px); }
  .lightbox-close { top: calc(var(--space-3) + env(safe-area-inset-top)); }
  .lightbox-prev, .lightbox-next { position: absolute; bottom: calc(var(--space-3) + env(safe-area-inset-bottom)); }
  .lightbox-prev { left: calc(50% - 60px); }
  .lightbox-next { right: calc(50% - 60px); }
}

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }

/* Very narrow phones: the brand gives way before the buttons do. */
@media (max-width: 360px) {
  .site-header h1 { font-size: 15px; }
}

/* Opened from the home screen: no browser bar, so the top needs the notch's room. */
@media (display-mode: standalone) {
  .site-header { padding-top: env(safe-area-inset-top); }
  .header-inner { padding-top: 12px; }
}

/* Reduced motion means fewer and gentler, not none: nothing slides, grows or
   bounces, but things still fade in and out, and colours still change softly. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-property: opacity, color, background-color, border-color, box-shadow, fill !important;
    scroll-behavior: auto !important;
  }
  .modal, .modal-backdrop, .toast, .card, .suggestion, .send-ready, .rec-area, .pick {
    animation-name: fade !important; animation-duration: 160ms !important; animation-delay: 0s !important;
  }
  .modal-backdrop.is-closing, .modal-backdrop.is-closing .modal, .toast.is-leaving {
    animation-name: fade-out !important;
  }
  .fav-btn.pop .icon { animation: none !important; }
  .fav-btn[aria-pressed="true"]::after, .card.is-favorite .card-mark::after { animation: none !important; }
}

/* ---------- Sending a copy ---------- */

.share-copy h3 { display: flex; align-items: center; gap: 8px; }
.share-copy h3 .icon { width: 18px; height: 18px; color: var(--color-accent); }

.send-place {
  display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-3);
  padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-card);
}
.send-place strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.send-place span { font-size: 13.5px; color: var(--color-muted-foreground); }
.send-place .card-mark { flex: none; }

.send-options { margin: 0 0 var(--space-3); padding: 0; border: 0; }
.send-options .rec-label { padding: 0; }
.send-option {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--color-border-strong); border-radius: 12px; background: var(--color-card);
  font-weight: 600; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease;
}
.send-option + .send-option { margin-top: 8px; }
.send-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.send-option:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); }
.send-count {
  margin-left: auto; min-width: 28px; padding: 0 8px; border-radius: 999px;
  background: var(--color-muted); font-size: 13px; line-height: 24px; text-align: center;
}
.send-take { margin-top: 0; }
.send-go { width: 100%; margin-top: var(--space-2); }
.send-go:active, .send-option:active { transform: scale(0.98); }
.send-note { margin: var(--space-2) 0 0; text-align: center; font-size: 13px; }

.send-ready {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: var(--space-3);
  padding: 14px; border-radius: var(--radius); background: var(--color-success-soft); color: var(--color-success);
}
.send-ready > .icon { flex: none; margin-top: 2px; }
.send-ready strong { color: var(--color-foreground); }
.send-ready p { margin: 2px 0 0; font-size: 14px; color: var(--color-muted-foreground); }
.send-ready {
  transition: opacity 220ms cubic-bezier(0.23, 1, 0.32, 1), transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
@starting-style { .send-ready { opacity: 0; transform: translateY(4px); } }
.send-link-row { display: flex; gap: var(--space-2); }
.send-link {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--color-foreground);
  background: var(--color-muted); border: 1px solid var(--color-border-strong); border-radius: 12px;
}

/* ---------- A copy someone sent ---------- */

.import-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.import-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--color-border-strong); border-radius: 12px; background: var(--color-card);
  cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease;
}
.import-row:has(input:checked) { border-color: var(--color-primary); background: var(--c-picked); }
.import-row input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--color-primary); }
.import-row.is-saved { cursor: default; background: var(--color-muted); border-style: dashed; }
.import-text { min-width: 0; display: grid; gap: 2px; }
.import-text strong { font-size: 15.5px; overflow-wrap: anywhere; }
.import-meta { font-size: 13px; color: var(--color-muted-foreground); }
.import-take { font-size: 13.5px; color: var(--c-warm-text); }
.import-take q { font-style: italic; }
.import-take .stars-static { vertical-align: -3px; margin-right: 4px; }
.import-saved { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--color-success); }
.import-saved .icon { width: 14px; height: 14px; }
.import-details { padding: 10px 2px 0; }
.import-elsewhere { margin: -4px 0 var(--space-3); }
@media (hover: hover) and (pointer: fine) {
  .send-option:hover, .import-row:not(.is-saved):hover { border-color: var(--color-accent); }
}

/* ---------- Press feedback ----------
   Everything that can be pressed gives slightly under the finger, the same way. */

.chip, .btn-icon, .view-btn, .tab, .bottom-tab, .shekel-btn, .star-btn {
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease),
              color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.chip:active, .btn-icon:active, .view-btn:active, .tab:active, .bottom-tab:active,
.shekel-btn:active, .pop-item:active { transform: scale(0.97); }
.star-btn:active { transform: scale(0.9); }

/* ---------- The compact card ---------- */

.card-status {
  display: flex; align-items: center; gap: var(--space-2); width: 100%;
  min-height: 40px; margin: -4px 0 var(--space-2); padding: 6px var(--space-4);
  font: inherit; font-size: 14px; text-align: left; color: var(--color-muted-foreground);
  background: none; border: 0; cursor: pointer;
}
.card-status-text {
  flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
}
.status-open, .status-shut { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.status-open { color: var(--color-success); }
.status-shut { color: var(--color-muted-foreground); }
.status-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--color-border-strong); }
.card-status-more {
  flex: none; display: inline-flex; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 600; color: var(--color-accent);
}
.card-status-more .icon { width: 16px; height: 16px; transition: transform var(--t) var(--ease); }
.card-status[aria-expanded="true"] .card-status-more .icon { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .card-status:hover .card-status-more { color: var(--color-primary); }
}
.card-status:focus-visible { outline: 2px solid var(--color-ring); outline-offset: -2px; border-radius: 8px; }

.card-more-empty { margin: 0; font-size: 14px; }

/* ---------- The "more" menu ---------- */

.pop-menu {
  position: fixed; z-index: 75; min-width: 220px; padding: 6px;
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}
@starting-style { .pop-menu { opacity: 0; transform: scale(0.96); } }
.pop-menu.is-closing { opacity: 0; transform: scale(0.96); transition-duration: 120ms; pointer-events: none; }
.pop-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--color-foreground); text-align: left;
  text-decoration: none; background: none; border: 0; border-radius: 10px; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pop-item .icon { width: 18px; height: 18px; color: var(--color-muted-foreground); }
.pop-item:focus-visible, .pop-item:focus { outline: none; background: var(--color-muted); }
@media (hover: hover) and (pointer: fine) {
  .pop-item:hover { background: var(--color-muted); }
}
.pop-item.is-danger, .pop-item.is-danger .icon { color: var(--c-danger-text); }
.pop-sep { height: 1px; margin: 4px 6px; background: var(--color-border); }

/* ---------- Dark ----------
   For evenings in dim restaurants: the same warm palette, at night. Maps and
   their pop-ups keep their daylight colours, which is how map apps do it. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Dark by choice (Settings > Appearance), or by the phone's own setting when
   the choice is Automatic. Both use the same values. */
:root[data-theme="dark"] {
  --color-primary: #E03A3A;
  --color-on-primary: #FFFFFF;
  --color-primary-soft: #3A1716;
  --color-secondary: #F87171;
  --color-accent: #E0A84A;
  --color-on-accent: #1A1208;
  --color-accent-soft: #2C2112;
  --color-background: #151010;
  --color-foreground: #F6EAE4;
  --color-card: #201817;
  --color-muted: #2A201E;
  --color-muted-foreground: #B9A69E;
  --color-border: #332724;
  --color-border-strong: #4A3A35;
  --color-destructive: #F05252;
  --color-ring: #F05252;
  --color-success: #4ADE80;
  --color-success-soft: #12301E;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, .55);
  --color-primary-hover: #C92A2A;
  --c-toast-bg: #F6EAE4;
  --c-toast-fg: #1D1413;
  --c-danger-text: #F87171;
  --c-danger-strong: #FCA5A5;
  --c-success-text: #86EFAC;
  --c-warm-text: #F0CB8C;
  --c-warm-label: #E3B566;
  --c-warm-border: #5C4520;
  --c-warm-line: #4A3920;
  --c-warm-field: #4A3A2A;
  --c-warm-track: #2E241A;
  --c-warm-glow: #1C1612;
  --c-fav-1: #3A2A12;
  --c-fav-2: #2A2014;
  --c-fav-3: #221A16;
  --c-fav-border: #6B5220;
  --c-fav-ring: #4A3A1A;
  --c-fav-border-hover: #8A6A2A;
  --c-fav-ring-hover: #5C4822;
  --c-fav-mark-bg: #4A3714;
  --c-fav-mark-shine: #6B5220;
  --c-fav-mark-fg: #F7D48A;
  --c-fav-review: rgba(255, 255, 255, .05);
  --c-fav-line: #4A3A1A;
  --c-star-idle: #8C7A72;
  --c-star-hover: #E3A94B;
  --c-star-glow: rgba(245, 158, 11, .12);
  --c-row-hover: rgba(227, 169, 75, .08);
  --c-dot-shut: #5A4A44;
  --c-overlay: rgba(0, 0, 0, .6);
  --c-header-glass: rgba(21, 16, 16, .9);
  --c-share-hover: #3A2C14;
  --c-placeholder: #7A6862;
  --c-stripes: #2A201E;
  --c-bottom-glass: rgba(32, 24, 23, .94);
  --c-picked: #2A1A18;
  --c-usage-high: #FB923C;
}
:root[data-theme="dark"] :is(.leaflet-popup, .gm-style .gm-style-iw-c) {
  color-scheme: light;
  --color-foreground: #450A0A; --color-muted-foreground: #6B5750; --color-card: #FFFFFF;
  --color-muted: #F5EDE6; --color-border: #EFE0D6; --color-border-strong: #E2CDBE;
  --color-accent: #A16207; --color-success: #15803D; --color-success-soft: #E7F5EC;
  color: var(--color-foreground);
}
:root[data-theme="dark"] img { opacity: .94; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #E03A3A;
    --color-on-primary: #FFFFFF;
    --color-primary-soft: #3A1716;
    --color-secondary: #F87171;
    --color-accent: #E0A84A;
    --color-on-accent: #1A1208;
    --color-accent-soft: #2C2112;
    --color-background: #151010;
    --color-foreground: #F6EAE4;
    --color-card: #201817;
    --color-muted: #2A201E;
    --color-muted-foreground: #B9A69E;
    --color-border: #332724;
    --color-border-strong: #4A3A35;
    --color-destructive: #F05252;
    --color-ring: #F05252;
    --color-success: #4ADE80;
    --color-success-soft: #12301E;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 18px 45px rgba(0, 0, 0, .55);
    --color-primary-hover: #C92A2A;
    --c-toast-bg: #F6EAE4;
    --c-toast-fg: #1D1413;
    --c-danger-text: #F87171;
    --c-danger-strong: #FCA5A5;
    --c-success-text: #86EFAC;
    --c-warm-text: #F0CB8C;
    --c-warm-label: #E3B566;
    --c-warm-border: #5C4520;
    --c-warm-line: #4A3920;
    --c-warm-field: #4A3A2A;
    --c-warm-track: #2E241A;
    --c-warm-glow: #1C1612;
    --c-fav-1: #3A2A12;
    --c-fav-2: #2A2014;
    --c-fav-3: #221A16;
    --c-fav-border: #6B5220;
    --c-fav-ring: #4A3A1A;
    --c-fav-border-hover: #8A6A2A;
    --c-fav-ring-hover: #5C4822;
    --c-fav-mark-bg: #4A3714;
    --c-fav-mark-shine: #6B5220;
    --c-fav-mark-fg: #F7D48A;
    --c-fav-review: rgba(255, 255, 255, .05);
    --c-fav-line: #4A3A1A;
    --c-star-idle: #8C7A72;
    --c-star-hover: #E3A94B;
    --c-star-glow: rgba(245, 158, 11, .12);
    --c-row-hover: rgba(227, 169, 75, .08);
    --c-dot-shut: #5A4A44;
    --c-overlay: rgba(0, 0, 0, .6);
    --c-header-glass: rgba(21, 16, 16, .9);
    --c-share-hover: #3A2C14;
    --c-placeholder: #7A6862;
    --c-stripes: #2A201E;
    --c-bottom-glass: rgba(32, 24, 23, .94);
    --c-picked: #2A1A18;
    --c-usage-high: #FB923C;
  }
  :root:not([data-theme="light"]) :is(.leaflet-popup, .gm-style .gm-style-iw-c) {
    color-scheme: light;
    --color-foreground: #450A0A; --color-muted-foreground: #6B5750; --color-card: #FFFFFF;
    --color-muted: #F5EDE6; --color-border: #EFE0D6; --color-border-strong: #E2CDBE;
    --color-accent: #A16207; --color-success: #15803D; --color-success-soft: #E7F5EC;
    color: var(--color-foreground);
  }
  :root:not([data-theme="light"]) img { opacity: .94; }
}

/* While the theme changes, nothing runs its own colour transition. */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }

.theme-seg { margin-bottom: var(--space-2); }
.theme-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.theme-seg .icon { width: 16px; height: 16px; flex: none; }
.theme-hint { margin: 0; }

/* ---------- Google Maps: the offer and the guide ---------- */

.google-offer {
  margin-bottom: var(--space-3); padding: 14px;
  border: 1px solid var(--c-warm-border); border-radius: var(--radius); background: var(--color-accent-soft);
}
.google-offer p { margin: 0 0 12px; font-size: 14px; color: var(--c-warm-text); }
.google-offer strong { color: var(--color-foreground); }
.usage-off .btn-icon { width: 36px; height: 36px; flex: none; }

.guide-steps { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-4); }
.guide-steps > li { display: flex; gap: 12px; align-items: flex-start; }
.guide-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px;
  border-radius: 50%; background: var(--color-accent-soft); color: var(--c-warm-label);
  font-weight: 700; font-size: 14px; box-shadow: 0 0 0 1px var(--c-warm-border);
}
.guide-steps > li > div { min-width: 0; flex: 1; }
.guide-steps strong { display: block; font-size: 15.5px; }
.guide-steps p { margin: 3px 0 10px; font-size: 14px; color: var(--color-muted-foreground); }
.guide-steps b { color: var(--color-foreground); font-weight: 600; }
.guide-steps .btn .icon { width: 14px; height: 14px; }
.guide-steps a.btn { text-decoration: none; }
.guide-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.guide-site-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.guide-site {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; background: var(--color-muted);
  font-size: 13px; white-space: normal; word-break: break-all;
}
.guide-form { display: flex; gap: var(--space-2); }
.guide-form input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; font: inherit; font-size: 16px;
  color: var(--color-foreground); background: var(--color-card);
  border: 1px solid var(--color-border-strong); border-radius: 12px;
}
.guide-result {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: var(--space-3); padding: 12px;
  border-radius: 12px; font-size: 14px; line-height: 1.5;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
@starting-style { .guide-result { opacity: 0; transform: translateY(4px); } }
.guide-result > .icon { flex: none; margin-top: 2px; }
.guide-result > div { flex: 1; min-width: 0; }
.guide-result .btn { margin-left: 26px; }
.guide-result.is-good { background: var(--color-success-soft); color: var(--c-success-text); }
.guide-result.is-bad { background: var(--color-primary-soft); color: var(--c-danger-strong); }

/* A menu's own sections, as the restaurant groups it. */
.menu-items .menu-section {
  display: block; position: sticky; top: 0; z-index: 1;
  padding: 7px var(--space-3); background: var(--color-muted);
  font-size: 12.5px; font-weight: 700; letter-spacing: .03em; color: var(--c-warm-label);
  unicode-bidi: plaintext; text-align: start;
}
