:root {
    /* Summerlicious palette — refined terracotta + warm sand, teal accents */
    --primary: #b0532e;
    --primary-strong: #8c3f22;
    --accent: #d99b3e;
    --fresh: #0f766e; /* deep teal secondary accent */
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --ring: rgba(176, 83, 46, 0.18);
    --cta-glow: rgba(176, 83, 46, 0.22);
    --tint: #f5e6d8;
    --tint-text: #9a4623;
    --bg: #faf6f1;
    --surface: #ffffff;
    --surface-muted: #f4ede4;
    --text: #2a2420;
    --text-muted: #75695f;
    --text-faint: #a89c90;
    --border: #ebe1d5;
    --shadow: 0 6px 16px rgba(120, 60, 0, 0.08);
    --shadow-lg: 0 14px 30px rgba(120, 60, 0, 0.16);
    --radius: 12px;
    --radius-sm: 8px;
    --heart: #e74c3c;
    --success: #10b981;
    --warning: #f59e0b;
    --book: #d6354c; /* OpenTable red */
}

[data-theme="dark"] {
    --primary: #e0875c;
    --primary-strong: #d2734a;
    --accent: #d99b3e;
    --fresh: #2dd4bf;
    --ring: rgba(224, 135, 92, 0.24);
    --cta-glow: rgba(0, 0, 0, 0.45);
    --tint: rgba(224, 135, 92, 0.16);
    --tint-text: #e9a079;
    --bg: #18140f;
    --surface: #211a14;
    --surface-muted: #2b231b;
    --text: #f0e9e2;
    --text-muted: #b7a89a;
    --text-faint: #7d7064;
    --border: #382e24;
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.55;
    padding-bottom: 3rem;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

/* ---------- Header ---------- */
header {
    background: linear-gradient(135deg, #e0954e, #c25c3a 52%, #9b4a45);
    color: white;
    padding: 2.25rem 1rem 2.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
header::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(460px 460px at 88% -45%, rgba(255,228,170,0.32), transparent 62%),
                radial-gradient(900px 220px at 8% 0%, rgba(255,240,212,0.14), transparent 60%),
                radial-gradient(760px 240px at 96% 125%, rgba(45,212,191,0.12), transparent 60%);
    pointer-events: none;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: relative; z-index: 1;
}
.header-text h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 5vw, 3.35rem); line-height: 1.04; letter-spacing: -0.01em; font-weight: 700; }
.header-text p { opacity: 0.92; font-size: 1.05rem; margin-top: 0.3rem; }
.header-actions { display: flex; gap: 0.6rem; }
.header-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit; font-weight: 600; font-size: 0.92rem;
    transition: background 0.18s, transform 0.18s;
    backdrop-filter: blur(4px);
}
.header-btn:hover { background: rgba(255,255,255,0.22); }
.header-btn:active { transform: scale(0.97); }
.header-btn.icon-only { padding: 0.55rem 0.7rem; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 1rem; }

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

/* ---------- Stats banner ---------- */
.stats-banner {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
    align-items: center; justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.stat { display: inline-flex; align-items: center; gap: 0.35rem; }
.stat strong { color: var(--text); font-weight: 700; font-size: 1rem; }
.stat .stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.stat .stat-sep { color: var(--text-faint); }
.stat-clickable {
    cursor: pointer; border-radius: 999px; padding: 0.15rem 0.6rem; margin: -0.15rem 0;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.stat-clickable:hover { background: var(--surface-muted); transform: translateY(-1px); }
.stat-clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-clickable.active { background: var(--primary); }
.stat-clickable.active strong,
.stat-clickable.active .stat-label { color: #fff; }

/* ---------- Cuisine quick chips ---------- */
/* Cuisine picker (single trigger + popover) */
.cuisine-picker {
    position: relative;
    flex: 1 1 220px;
    min-width: 220px;
}
.cuisine-trigger {
    width: 100%;
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: 0.95rem; font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s;
    text-align: left;
}
.cuisine-trigger:hover { border-color: var(--primary); }
.cuisine-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}
.cuisine-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuisine-trigger-caret { color: var(--text-muted); flex: none; width: 13px; height: 13px; display: flex; }
.cuisine-trigger-caret svg { width: 100%; height: 100%; }

.cuisine-popover {
    position: absolute; top: calc(100% + 6px); left: 0;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.85rem;
    width: min(560px, calc(100vw - 2rem));
    max-height: 60vh; overflow-y: auto;
    z-index: 1500;
    display: none;
}
.cuisine-popover.open { display: block; }
.cuisine-popover-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 0.92rem;
    margin-bottom: 0.65rem;
}
.cuisine-popover-grid {
    display: grid; gap: 0.4rem;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.cuisine-popover-grid .cuisine-chip { justify-content: flex-start; width: 100%; }
.cuisine-popover-empty {
    color: var(--text-faint); text-align: center; padding: 0.8rem 0; font-size: 0.9rem;
}

@media (max-width: 720px) {
    .cuisine-popover { right: 0; width: calc(100vw - 2rem); }
}
.cuisine-chip {
    flex: 0 0 auto;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit; font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 0.3rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.cuisine-chip:hover { transform: translateY(-1px); }
.cuisine-chip.active {
    background: var(--primary); color: white; border-color: var(--primary);
}
.cuisine-chip .chip-count { font-size: 0.72rem; opacity: 0.7; font-weight: 500; }
.cuisine-chip.active .chip-count { opacity: 0.95; }

/* ---------- Near me ---------- */
.near-me-btn {
    background: var(--surface); color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: 0.92rem;
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.near-me-btn:hover { background: var(--primary); color: white; }
.near-me-btn.active { background: var(--primary); color: white; }

.badge.distance { background: #fef3c7; color: #92400e; border-color: transparent; }
[data-theme="dark"] .badge.distance { background: rgba(245,158,11,0.18); color: #ffd980; }

/* ---------- Controls ---------- */
.controls {
    display: flex; flex-wrap: wrap; gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    align-items: center;
    border: 1px solid var(--border);
}
.search-box { flex: 1 1 100%; position: relative; }
.filter-select select {
    width: 100%;
    padding: 0.7rem 2.3rem 0.7rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--text);
    font: inherit; font-size: 0.95rem;
    cursor: pointer;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2375695f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.filter-select select:hover { border-color: var(--text-faint); }
[data-theme="dark"] .filter-select select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b7a89a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.search-box input {
    width: 100%;
    padding: 0.8rem 0.95rem 0.8rem 2.85rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: 1.02rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-icon {
    position: absolute; left: 1rem; top: 50%;
    transform: translateY(-50%);
    width: 19px; height: 19px;
    color: var(--text-faint);
    pointer-events: none;
    display: flex;
    transition: color 0.18s, transform 0.18s;
    transform-origin: center;
    animation: search-nudge 1.5s ease-in-out 0.4s 2;
}
.search-icon svg { width: 100%; height: 100%; }
.search-box:focus-within .search-icon { color: var(--primary); transform: translateY(-50%) scale(1.12); animation: none; }
@keyframes search-nudge {
    0%, 100% { transform: translateY(-50%) scale(1) rotate(0); }
    30%      { transform: translateY(-50%) scale(1.22) rotate(-8deg); }
    60%      { transform: translateY(-50%) scale(1.22) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) { .search-icon { animation: none; } }
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus,
.filter-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}
.filter-select { flex: 1 1 160px; }

/* Custom dropdown (replaces native <select> option list) */
.select-dd { position: relative; width: 100%; }
.select-dd-trigger {
    width: 100%;
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: 0.95rem;
    cursor: pointer; text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.select-dd-trigger:hover { border-color: var(--text-faint); }
.select-dd.open .select-dd-trigger,
.select-dd-trigger:focus-visible {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
.select-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-dd-caret { flex: none; width: 13px; height: 13px; color: var(--text-muted); display: flex; transition: transform 0.18s, color 0.18s; }
.select-dd-caret svg { width: 100%; height: 100%; }
.select-dd.open .select-dd-caret { transform: rotate(180deg); color: var(--primary); }
.select-dd-popover {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.3rem;
    z-index: 50;
    display: none;
    max-height: 320px; overflow-y: auto;
}
.select-dd.open .select-dd-popover { display: block; }
.select-dd-option {
    display: block; width: 100%; text-align: left;
    padding: 0.5rem 0.7rem;
    border: none; background: transparent; color: var(--text);
    font: inherit; font-size: 0.92rem;
    border-radius: 6px; cursor: pointer;
}
.select-dd-option:hover { background: var(--surface-muted); }
.select-dd-option.active { background: var(--tint); color: var(--tint-text); font-weight: 600; }

.toggle-group {
    display: flex; align-items: center; gap: 0.4rem;
    background: var(--surface);
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    white-space: nowrap;
    color: var(--text);
}
.toggle-group input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }

.view-controls {
    display: flex; align-items: center; gap: 0.55rem;
    margin-left: auto;
}
.view-toggles {
    display: flex; border: 1px solid var(--primary); border-radius: var(--radius-sm); overflow: hidden;
    flex: none;
}
.view-btn {
    background: var(--surface); color: var(--primary);
    border: none; padding: 0.65rem 1.05rem; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.92rem;
    transition: background 0.2s, color 0.2s;
}
.view-btn.active { background: var(--primary); color: white; }
.view-btn:not(:last-child) { border-right: 1px solid var(--primary); }

.result-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    margin: 0 0 1rem; color: var(--text-muted); font-size: 0.92rem;
    flex-wrap: wrap;
}
.result-bar-left { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.vibe-filter-chips { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }
.vibe-active-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: rgba(124,58,237,0.10);
    color: #6b21a8;
    border: 1px solid rgba(124,58,237,0.18);
    border-radius: 999px;
    padding: 0.15rem 0.55rem 0.15rem 0.7rem;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer;
}
.vibe-active-chip:hover { background: rgba(124,58,237,0.16); }
.vibe-active-chip .x { font-size: 1.05rem; line-height: 1; opacity: 0.7; }
[data-theme="dark"] .vibe-active-chip {
    background: rgba(168,85,247,0.18);
    color: #d8b4fe;
    border-color: rgba(168,85,247,0.30);
}

.vibe-tag { cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.vibe-tag:hover { background: var(--tint); color: var(--tint-text); border-color: transparent; }
.vibe-tag.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
[data-theme="dark"] .vibe-tag.active { background: var(--primary); border-color: var(--primary); color: #2a1a10; }
.link-btn {
    background: none; border: none; color: var(--primary);
    cursor: pointer; font: inherit; font-weight: 600; font-size: 0.9rem;
    padding: 0.3rem 0.6rem; border-radius: 6px;
}
.link-btn:hover { background: var(--tint); }

/* ---------- Status / file picker ---------- */
#status-message {
    text-align: center; margin: 1rem 0; padding: 1rem; display: none;
    background-color: #e8f0fe; color: var(--primary); border-radius: var(--radius);
}
.error-message { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fecaca; }
#file-input-container {
    display: none; text-align: center; margin: 2rem auto; padding: 2rem;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    max-width: 600px;
}

/* ---------- Map ---------- */
#map-view {
    display: none; height: 620px; width: 100%;
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 1rem; z-index: 1; overflow: hidden;
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem; align-items: start;
}

/* ---------- Card ---------- */
.card {
    background: var(--surface);
    border-radius: 0 12px 12px 0;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex; flex-direction: column;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    position: relative;
    transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.card-head {
    display: flex; align-items: flex-start; gap: 0.7rem;
    padding: 1rem 1.1rem 0.5rem;
    cursor: pointer;
}
.card-emoji-tile {
    flex: none; width: 42px; height: 42px; border-radius: 10px;
    background: var(--tint);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; line-height: 1;
}
.card-head-text { flex: 1; min-width: 0; }
.card-head-text h3 {
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 600; line-height: 1.12; color: var(--text);
    overflow-wrap: anywhere;
}
.card-subtitle {
    font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem;
}

.fav-btn {
    flex: none;
    background: transparent; border: none;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.3rem; color: var(--text-faint);
    transition: transform 0.18s, color 0.18s;
    margin: -0.15rem -0.3rem 0 0;
}
.fav-btn:hover { transform: scale(1.1); color: var(--heart); }
.fav-btn.active { color: var(--heart); }

.card-body { padding: 0.9rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }

.badges-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.72rem; font-weight: 600;
    padding: 0.18rem 0.55rem; border-radius: 999px;
    background: var(--surface-muted); color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge.hood     { background: #f3e5f5; color: #7b1fa2; border-color: transparent; }
.badge.cuisine  { background: #e3f2fd; color: var(--primary); border-color: transparent; }
.badge.michelin { background: #fbf0d8; color: #9a7b1e; border-color: transparent; }
.badge.veg      { background: #e6f1ee; color: #2c7a6f; border-color: transparent; }
.badge.new-season { background: var(--tint); color: var(--tint-text); border-color: transparent; }

[data-theme="dark"] .badge.michelin { background: rgba(245,158,11,0.18); color: #ffd980; }
[data-theme="dark"] .badge.veg      { background: rgba(45,212,191,0.18); color: #9bf0d2; }

.description-text {
    font-size: 0.88rem; color: var(--text-muted); line-height: 1.45;
    border-bottom: 1px solid var(--border); padding-bottom: 0.7rem;
}
.read-more { color: var(--primary); cursor: pointer; font-weight: 600; }

.menus-summary {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.menu-chip {
    flex: 1 1 calc(50% - 0.5rem);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    min-width: 0;
}
.menu-chip-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.menu-chip-price { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.menu-chip-empty { color: var(--text-faint); font-weight: 500; font-size: 0.85rem; }

.card-booking {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.book-btn {
    flex: 1 1 calc(50% - 0.4rem);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.3rem;
    text-decoration: none;
    background: var(--book); color: white;
    padding: 0.5rem 0.6rem;
    border-radius: 999px;
    font-weight: 600; font-size: 0.85rem;
    transition: background 0.15s, transform 0.15s;
    text-align: center;
}
.book-btn:hover { background: #b82a40; transform: translateY(-1px); }

.card-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    margin-top: 0.25rem;
}
.card-actions-left { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.social-icon {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface-muted); color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.social-icon:hover { background: var(--primary); color: white; transform: translateY(-1px); }

.view-menu-btn {
    background: var(--primary); color: white; border: none;
    padding: 0.55rem 0.95rem; border-radius: 999px;
    font: inherit; font-weight: 600; font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--cta-glow);
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.view-menu-btn:hover { background: var(--primary-strong); transform: translateY(-1px); box-shadow: 0 8px 20px var(--cta-glow); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none; justify-content: center; align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    padding: 0.75rem;
}
.modal {
    background: var(--surface);
    width: 100%; max-width: 980px; height: min(95vh, 980px);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; overflow: hidden;
    animation: slideUp 0.25s ease-out;
    color: var(--text);
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-hero {
    position: relative;
    padding: 0.6rem 1.25rem 0.55rem;
    background: linear-gradient(135deg, var(--c-from, #a8533a), var(--c-to, #6e3120));
    color: white;
}
.modal-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(900px 240px at 100% 0%, rgba(255,255,255,0.18), transparent 60%);
    pointer-events: none;
}
.modal-hero-inner { position: relative; z-index: 1; }
.modal-hero-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.7rem;
    align-items: center;
    padding-right: 2.25rem; /* room for the close button */
}
.modal-hero-emoji {
    font-size: 1.5rem;
    grid-row: 1 / span 2;
    align-self: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.modal-hero h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.modal-subline { font-size: 0.82rem; opacity: 0.92; margin-top: 0.05rem; line-height: 1.3; }
.modal-address { display: none; } /* merged into subline */
.modal-hero .badges-row {
    grid-column: 1 / -1;
    margin-top: 0.35rem;
    overflow: hidden;
    max-height: 1.65rem;
}
.modal-hero .badge { font-size: 0.68rem; padding: 0.1rem 0.4rem; }
.close-btn { top: 0.45rem; right: 0.55rem; width: 28px; height: 28px; font-size: 1.25rem; }
.modal-hero .badge { background: rgba(255,255,255,0.18); color: white; border-color: rgba(255,255,255,0.30); }

.close-btn {
    position: absolute; top: 0.75rem; right: 0.85rem;
    background: rgba(255,255,255,0.22); color: white;
    border: none; border-radius: 50%;
    width: 34px; height: 34px;
    font-size: 1.5rem; line-height: 1; cursor: pointer;
    transition: background 0.15s;
    z-index: 2;
}
.close-btn:hover { background: rgba(255,255,255,0.4); }

.modal-action-bar {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
    padding: 0.55rem 1rem;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.action-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit; font-weight: 600; font-size: 0.82rem;
    cursor: pointer; text-decoration: none;
    transition: background 0.15s, transform 0.15s;
    line-height: 1.3;
}
.action-btn:hover { transform: translateY(-1px); }
.action-btn.book { background: var(--book); border-color: var(--book); color: white; }
.action-btn.book:hover { background: #b82a40; }
.action-btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.action-btn.primary:hover { background: var(--primary-strong); }

/* ---------- AI enrichment ---------- */
.one-liner { font-style: italic; color: var(--text); }

.standouts {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
    font-size: 0.82rem; color: var(--text-muted);
}
.standouts-label,
.ai-standouts-label {
    font-weight: 700; text-transform: uppercase; font-size: 0.7rem;
    letter-spacing: 0.06em; color: var(--text-faint);
    margin-right: 0.15rem;
}
.standout-chip {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text);
}

.vibe-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.vibe-tag {
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}
[data-theme="dark"] .vibe-tag {
    background: var(--surface-muted);
    color: var(--text-muted);
    border-color: var(--border);
}

.badge.vibe { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.30); }

.modal-ai-summary { display: none; }
.modal-oneliner { font-style: italic; }

.menu-tabs {
    display: flex; background: var(--surface-muted); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1;
}
.tab {
    flex: 1; padding: 0.6rem; text-align: center;
    cursor: pointer; font-weight: 600; color: var(--text-muted);
    border-bottom: 3px solid transparent; transition: all 0.18s;
    font-size: 0.95rem;
}
.tab.active { background: var(--surface); color: var(--primary); border-bottom-color: var(--primary); }

.modal-body { overflow-y: auto; flex: 1; background: var(--surface); }
.menu-content { padding: 1.1rem 1.5rem 1.5rem; display: none; }
.menu-content.active { display: block; }

.price-badge {
    background: var(--accent); color: #1f2937;
    padding: 0.25rem 0.7rem; border-radius: 999px;
    font-weight: 700; display: inline-block; margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.menu-section { margin-bottom: 1.25rem; }
.menu-section h3 {
    color: var(--text); border-bottom: 2px solid var(--border);
    padding-bottom: 0.3rem; margin-bottom: 0.6rem;
    text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.08em;
    font-weight: 700;
}
.menu-item { margin-bottom: 0.85rem; }
.item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.2rem; gap: 0.5rem; }
.menu-item .item-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.item-desc { color: var(--text-muted); font-size: 0.92rem; }
.dietary-tags { margin-top: 0.3rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.dietary {
    display: inline-block; font-size: 0.7rem; font-weight: 600;
    padding: 0.15rem 0.5rem; border-radius: 999px;
    background: var(--surface-muted); color: var(--text-muted);
    border: 1px solid var(--border);
}
.dietary.veg   { background: #e6fffa; color: #2c7a7b; border-color: transparent; }
.dietary.vegan { background: #f0fff4; color: #276749; border-color: transparent; }
.dietary.gf    { background: #fff5f5; color: #c53030; border-color: transparent; }
.dietary.local { background: #ebf8ff; color: #2b6cb0; border-color: transparent; }

[data-theme="dark"] .dietary.veg   { background: rgba(16,185,129,0.18); color: #9bf0d2; }
[data-theme="dark"] .dietary.vegan { background: rgba(16,185,129,0.18); color: #b6f4d4; }
[data-theme="dark"] .dietary.gf    { background: rgba(220,38,38,0.18); color: #ffb4b4; }
[data-theme="dark"] .dietary.local { background: rgba(106,169,255,0.18); color: #cfe1ff; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
    header { padding: 1.5rem 1rem 1.75rem; margin-bottom: 1rem; }
    .header-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .header-text h1 { font-size: 1.65rem; }
    .header-text p { font-size: 0.95rem; }
    .header-actions { width: 100%; justify-content: flex-start; }
    .controls { padding: 0.85rem; gap: 0.5rem; }
    .search-box { flex: 1 1 100%; }
    .filter-select, .cuisine-picker { flex: 1 1 100%; min-width: 0; }
    .toggle-group { flex: 0 1 auto; }
    .view-controls { flex: 1 1 100%; justify-content: flex-end; margin-left: 0; }
    .grid { grid-template-columns: 1fr; gap: 1rem; }
    .modal-overlay { padding: 0; }
    .modal { width: 100%; height: 100vh; max-width: none; border-radius: 0; }
    .modal-hero { padding: 1.25rem 1.25rem 1rem; }
    .modal-hero h2 { font-size: 1.35rem; }
    .menu-content { padding: 1.25rem; }
    #map-view { height: 480px; }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: var(--text); color: var(--surface);
    padding: 0.6rem 1.1rem; border-radius: 999px;
    font-size: 0.9rem; font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 3000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
