:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d9dde5;
  --accent: #111827;
  --accent-2: #f59e0b;
  --success: #16794f;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(17,24,39,.14);
  --radius: 18px;
  --nav-h: 66px;
  --top-h: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button, input, select, textarea { min-height: 44px; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.eyebrow { color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-bottom: 14px; }
h2 { font-size: 1.25rem; }
.topbar { position: sticky; top: 0; z-index: 1000; height: var(--top-h); padding: 8px 14px; display:flex; align-items:center; justify-content:space-between; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { text-decoration:none; font-weight:900; letter-spacing:-.03em; font-size:1.25rem; }
.topbar-actions { display:flex; align-items:center; gap:8px; }
.user-chip { width:40px; height:40px; border-radius:50%; background:var(--ink); color:#fff; display:grid; place-items:center; text-decoration:none; font-size:.8rem; font-weight:900; }
.status-pill { display:inline-flex; align-items:center; min-height:30px; padding:5px 9px; border:1px solid var(--line); border-radius:999px; font-size:.75rem; font-weight:800; background:#fff; }
.status-pill[data-state="live"] { border-color:#8bd7b7; background:#ecfdf3; color:#05603a; }
.status-pill[data-state="warn"] { background:#fff7e6; color:#925f00; }
.status-pill[data-state="error"] { background:#fff1f0; color:var(--danger); }
.page-shell { min-height: calc(100vh - var(--top-h) - var(--nav-h)); }
.bottom-nav { position: fixed; z-index: 1200; left:0; right:0; bottom:0; height:calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); background:#fff; border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(4,1fr); }
.bottom-nav a { min-height: var(--nav-h); display:grid; place-items:center; text-decoration:none; font-size:.86rem; font-weight:800; color:var(--muted); }
.bottom-nav a.active { color:var(--ink); box-shadow: inset 0 3px 0 var(--ink); }
.button { appearance:none; border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:12px; padding:10px 14px; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:6px; font-weight:800; }
.button:hover { border-color:#aab1bf; }
.button.primary { background:var(--ink); color:#fff; border-color:var(--ink); }
.button.danger { background:#fff3f2; border-color:#f2b8b5; color:var(--danger); }
.button.small { min-height:38px; padding:7px 10px; font-size:.82rem; }
.button.wide { width:100%; }
.button-row, .card-actions { display:flex; gap:10px; flex-wrap:wrap; }
.notice { margin: 8px 10px; padding: 10px 12px; border-radius:14px; background:#fff; border:1px solid var(--line); display:flex; gap:10px; align-items:center; justify-content:space-between; font-size:.86rem; }
.notice.warning { background:#fff7e6; border-color:#f3cc7a; }
.next-banner { margin: 8px 10px 0; min-height:42px; padding:10px 12px; border-radius:14px; background:#111827; color:#fff; font-size:.88rem; font-weight:900; display:flex; align-items:center; }
.next-banner[data-state="tie"] { background:#7a4b00; }
.next-banner[data-state="consensus"] { background:#08603d; }
.map-page { position:relative; height:calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-bottom)); min-height:520px; overflow:hidden; }
.map-canvas { position:absolute; inset:148px 0 0; z-index:1; background:#e7e9ed; }
.map-filter-row { position:absolute; z-index:500; left:0; right:0; top:112px; display:flex; gap:6px; padding:8px 10px; overflow-x:auto; scrollbar-width:none; pointer-events:none; }
.map-filter-row > * { pointer-events:auto; }
.chip { flex:0 0 auto; min-height:36px; border-radius:999px; border:1px solid var(--line); background:#fff; padding:6px 11px; font-weight:800; box-shadow:0 4px 12px rgba(17,24,39,.08); }
.chip.active { background:var(--ink); border-color:var(--ink); color:#fff; }
.map-round-button { position:absolute; z-index:600; right:14px; bottom:74px; width:50px; height:50px; border:0; border-radius:50%; background:#fff; box-shadow:var(--shadow); font-size:1.7rem; font-weight:900; }
.consensus-button { position:absolute; z-index:600; left:50%; transform:translateX(-50%); bottom:14px; min-height:48px; border:0; border-radius:999px; background:var(--ink); color:#fff; padding:0 20px; box-shadow:var(--shadow); font-weight:900; letter-spacing:.03em; }
.location-edit-bar { position:absolute; z-index:900; left:10px; right:10px; bottom:10px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 11px; border:2px solid #b42318; border-radius:14px; background:rgba(255,255,255,.97); box-shadow:0 10px 30px rgba(17,24,39,.24); }
.location-edit-bar.hidden { display:none; }
.location-edit-copy { min-width:0; display:grid; gap:2px; }
.location-edit-copy strong { font-size:.92rem; }
.location-edit-copy span { color:var(--muted); font-size:.72rem; line-height:1.3; overflow-wrap:anywhere; }
.location-edit-actions { flex:0 0 auto; display:flex; gap:7px; }
.location-edit-button { border-color:#d0a09b; color:#8a1c14; }
.location-maintenance-section { margin:16px 0 0; padding:12px 14px; border:1px solid #e0b7b2; border-radius:14px; background:#fff8f7; }
.location-maintenance-section h3 { margin:2px 0 5px; }
.restaurant-marker-wrap, .user-marker-wrap { background:transparent; border:0; }
.user-alex { --user-color:#2563eb; }
.user-andrei { --user-color:#f97316; }
.user-diana { --user-color:#db2777; }
.user-simona { --user-color:#16a34a; }
.restaurant-marker { min-width:50px; min-height:32px; border-radius:12px; background:#fff; border:2px solid #111827; box-shadow:0 4px 10px rgba(17,24,39,.18); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:4px 5px; }
.restaurant-marker.visited { border-style:dashed; opacity:.78; }
.restaurant-marker.voted { outline:3px solid #f2bd4c; }
.restaurant-marker.editing { min-width:60px; min-height:44px; border:3px solid #b42318; outline:4px solid rgba(180,35,24,.22); cursor:grab; animation:location-edit-pulse 1.15s ease-in-out infinite alternate; }
.restaurant-marker.editing:active { cursor:grabbing; }
.marker-edit-handle { position:absolute; right:-9px; top:-11px; width:23px; height:23px; border-radius:50%; display:grid; place-items:center; background:#b42318; color:#fff; border:2px solid #fff; font-size:.75rem; font-weight:950; box-shadow:0 2px 7px rgba(17,24,39,.2); }
@keyframes location-edit-pulse { from { box-shadow:0 4px 10px rgba(17,24,39,.18); } to { box-shadow:0 0 0 7px rgba(180,35,24,.14),0 4px 10px rgba(17,24,39,.18); } }
@media (prefers-reduced-motion:reduce) { .restaurant-marker.editing { animation:none; } }
.restaurant-pref-dots { display:grid; grid-template-columns:repeat(4,10px); gap:2px; align-items:center; justify-content:center; }
.restaurant-pref-dot { width:10px; height:10px; border-radius:50%; border:2px solid #d0d5dd; background:#e4e7ec; display:block; }
.restaurant-pref-dot.is-da { border-color:var(--user-color,#111827); background:var(--user-color,#111827); }
.restaurant-pref-dot.is-poate { border-color:var(--user-color,#667085); background:#fff; }
.restaurant-pref-dot.is-nu { border-color:#d0d5dd; background:#d0d5dd; opacity:.65; }
.restaurant-pref-dot.is-unknown { border-color:#d0d5dd; background:#fff; opacity:.45; }
.restaurant-marker-status { min-height:12px; display:flex; align-items:center; justify-content:center; gap:4px; line-height:1; font-size:.65rem; font-weight:950; }
.marker-vote { color:#8a5700; }
.marker-visited { color:#087443; }
.user-marker { width:48px; height:48px; border-radius:50%; background:var(--user-color,#111827); color:#fff; display:grid; place-items:center; border:3px solid #fff; padding:2px; box-shadow:0 0 0 3px var(--user-color,#111827), 0 6px 16px rgba(17,24,39,.28); font-weight:900; font-size:.75rem; overflow:visible; }
.user-marker-media { width:100%; height:100%; min-width:0; min-height:0; overflow:hidden; border-radius:50%; display:grid; place-items:center; background:var(--user-color,#111827); }
.user-marker-media img { width:100%; height:100%; min-width:100%; min-height:100%; object-fit:cover; object-position:center center; border-radius:50%; display:block; image-orientation:from-image; background:#fff; }
.user-marker-initials { color:#fff; line-height:1; }
.user-marker.stale { opacity:.5; filter:saturate(.55); }
.map-user-legend { position:absolute; z-index:600; left:10px; top:158px; max-width:calc(100% - 80px); background:rgba(255,255,255,.94); border:1px solid var(--line); border-radius:12px; padding:6px 8px; box-shadow:0 4px 12px rgba(17,24,39,.1); font-size:.66rem; font-weight:850; pointer-events:none; }
.map-legend-people, .map-legend-states { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.map-legend-states { margin-top:4px; color:var(--muted); }
.map-legend-person, .map-legend-states > span { display:inline-flex; align-items:center; gap:3px; }
.map-legend-user { width:9px; height:9px; border-radius:50%; background:var(--user-color,#111827); display:inline-block; }
.pref-demo { width:9px; height:9px; border-radius:50%; display:inline-block; border:2px solid #667085; }
.pref-demo.da { background:#344054; border-color:#344054; }
.pref-demo.poate { background:#fff; }
.pref-demo.nu { background:#d0d5dd; border-color:#d0d5dd; opacity:.7; }
.sheet-backdrop { position:fixed; inset:0; z-index:1490; background:rgba(17,24,39,.3); }
.bottom-sheet { position:fixed; z-index:1500; left:0; right:0; bottom:0; max-height:88dvh; overflow:auto; padding:24px 18px calc(20px + env(safe-area-inset-bottom)); background:#fff; border-radius:24px 24px 0 0; box-shadow:0 -20px 50px rgba(17,24,39,.2); transform:translateY(105%); transition:transform .2s ease; }
.bottom-sheet.open { transform:translateY(0); }
.sheet-close { position:absolute; right:12px; top:12px; width:40px; height:40px; min-height:40px; border:0; border-radius:50%; background:#f2f4f7; font-size:1.5rem; }
.sheet-title-row, .section-heading, .location-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.sheet-title-row h2 { margin-bottom:4px; font-size:1.5rem; padding-right:36px; }
.badge { display:inline-flex; min-height:30px; align-items:center; border-radius:999px; padding:4px 9px; background:#f2f4f7; font-size:.76rem; font-weight:900; }
.badge.success { background:#e9f8ef; color:#08603d; }
.location-media { margin:12px 0 14px; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#f2f4f7; }
.location-media-sheet { display:grid; grid-template-rows:minmax(0,1fr) auto; max-height:250px; }
.location-image { width:100%; height:min(31dvh,210px); object-fit:contain; object-position:center; display:block; background:#eef0f3; }
.location-media figcaption, .location-detail-media figcaption { padding:6px 9px; background:#fff; color:var(--muted); font-size:.7rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 0; }
.detail-grid > div { background:#f7f8fa; border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:3px; }
.detail-grid .wide { grid-column:1 / -1; }
.detail-grid span { color:var(--muted); font-size:.72rem; text-transform:uppercase; font-weight:800; }
.summary-strip { display:flex; flex-wrap:wrap; gap:7px; margin:12px 0; }
.summary-strip > * { background:#f2f4f7; border-radius:999px; padding:6px 9px; font-size:.78rem; }
.person-prefs { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin:10px 0; }
.pref-person { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:58px; padding:6px; border:1px solid var(--line); border-radius:10px; font-size:.78rem; position:relative; }
.pref-person-color { width:9px; height:9px; border-radius:50%; background:var(--user-color,#475569); display:block; margin-bottom:2px; box-shadow:0 0 0 2px #fff, 0 0 0 3px var(--user-color,#475569); }
.segmented { display:grid; grid-template-columns:repeat(3,1fr); overflow:hidden; border:1px solid var(--line); border-radius:12px; margin:10px 0; }
.segmented button { min-height:44px; border:0; border-right:1px solid var(--line); background:#fff; font-weight:900; }
.segmented button:last-child { border-right:0; }
.segmented.compact { min-width:210px; margin:0; }
.segmented.compact button { min-height:38px; }
.preference-editor { margin:14px 0; padding:14px; border:1px solid #a9bce8; border-radius:14px; background:#f5f8ff; }
.preference-editor-head, .feedback-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.preference-editor h3, .feedback-section h3, .tour-actions-section h3 { margin:2px 0 6px; }
.preference-current { background:#e7edff; color:#26448a; }
.preference-segmented { margin-bottom:0; border-color:#b9c6e8; }
.preference-segmented button { min-height:58px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:#344054; }
.preference-segmented button small { font-size:.67rem; font-weight:750; color:var(--muted); }
.preference-segmented button.selected[data-pref="Da"] { background:#eaf8ef; color:#08603d; box-shadow:inset 0 -4px 0 #087443; }
.preference-segmented button.selected[data-pref="Poate"] { background:#fff6e5; color:#8a5700; box-shadow:inset 0 -4px 0 #c47a00; }
.preference-segmented button.selected[data-pref="Nu"] { background:#fff0ef; color:#912018; box-shadow:inset 0 -4px 0 #b42318; }
.preference-segmented button.selected small { color:inherit; opacity:.82; }
.tour-actions-section { margin:16px 0; padding-top:14px; border-top:1px dashed #c9ced8; }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 0 0; }
.feedback-section { border:1px solid #acd8bf; border-radius:14px; margin-top:18px; padding:14px; background:#f3fbf6; }
.feedback-label { flex:0 0 auto; display:inline-flex; align-items:center; min-height:28px; border-radius:999px; padding:4px 8px; background:#dcf4e5; color:#08603d; font-size:.7rem; font-weight:900; }
.feedback-section label, .login-card label { display:flex; flex-direction:column; gap:6px; font-weight:800; margin:10px 0; }
.feedback-section select, .feedback-section textarea, .login-card select, .login-card input, .toolbar-grid input, .toolbar-grid select { width:100%; border:1px solid var(--line); border-radius:12px; background:#fff; padding:10px 12px; color:var(--ink); }
.feedback-section select:invalid { color:#7b8493; }
.button.feedback-save { background:#087443; border-color:#087443; color:#fff; }
.button.feedback-save:hover { background:#06633a; border-color:#06633a; }
.rating-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.distance-list > div, .rank-row, .stat-row { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid #eceef2; }
.distance-list > div:last-child, .rank-row:last-child, .stat-row:last-child { border-bottom:0; }
.consensus-location { width:100%; min-height:44px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:9px 11px; margin:5px 0; display:flex; justify-content:space-between; align-items:center; text-align:left; font-weight:800; }
.content-page { width:min(1180px,100%); margin:0 auto; padding:20px 14px 34px; }
.content-page.narrow { width:min(680px,100%); }
.toolbar-grid { display:grid; grid-template-columns:1fr; gap:8px; margin:14px 0; }
.card-list { display:grid; gap:10px; }
.location-card, .panel, .hero-card, .kpi { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:16px; box-shadow:0 4px 14px rgba(17,24,39,.04); }
.location-card h2 { margin:2px 0 8px; font-size:1.2rem; }
.location-card h2 a { text-decoration:none; }
.location-card p { margin-bottom:10px; }
.empty-state { background:#fff; border:1px dashed #bdc3cf; border-radius:var(--radius); padding:22px; text-align:center; color:var(--muted); }
.hero-card { margin:12px 0 24px; }
.timeline { display:grid; gap:0; }
.timeline-item { display:grid; grid-template-columns:70px 1fr; gap:12px; padding:14px 0; border-bottom:1px solid var(--line); }
.timeline-item time { font-weight:900; }
.timeline-item p { margin:3px 0 0; color:var(--muted); }
.timeline-item.muted-event { opacity:.58; }
.kpi-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:14px; }
.kpi { display:flex; flex-direction:column; gap:3px; }
.kpi span { color:var(--muted); font-weight:800; }
.kpi strong { font-size:1.75rem; }
.analytics-grid { display:grid; gap:12px; margin-bottom:12px; }
.panel { margin-bottom:12px; }
.table-wrap { overflow:auto; }
table { border-collapse:collapse; width:100%; min-width:1050px; font-size:.83rem; }
th, td { padding:9px 10px; text-align:left; border-bottom:1px solid var(--line); vertical-align:top; }
th { position:sticky; top:0; background:#f7f8fa; z-index:1; }
.link-stack { display:grid; gap:8px; }
.toast-region { position:fixed; z-index:2000; right:12px; bottom:calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); width:min(360px, calc(100% - 24px)); display:grid; gap:8px; pointer-events:none; }
.toast { background:#111827; color:#fff; padding:11px 13px; border-radius:12px; box-shadow:var(--shadow); font-size:.86rem; }
.toast.error { background:#8e1f18; }
.toast.success { background:#08603d; }
.login-body { min-height:100dvh; display:grid; place-items:center; padding:18px; background:linear-gradient(145deg,#eef0f3,#fff); }
.login-card { width:min(420px,100%); background:#fff; border:1px solid var(--line); border-radius:24px; padding:24px; box-shadow:var(--shadow); }
.form-error { min-height:22px; color:var(--danger); font-weight:800; }
.setup-error { width:min(720px,calc(100% - 28px)); margin:10vh auto; background:#fff; border:1px solid var(--line); border-radius:20px; padding:24px; box-shadow:var(--shadow); }
details { margin:12px 0; }
summary { cursor:pointer; font-weight:900; }
.mini-feedback { font-size:.85rem; padding:5px 0; }
.visually-hidden { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.profile-avatar-row { display:flex; gap:16px; align-items:center; margin:14px 0; }
.profile-avatar { width:96px; height:96px; flex:0 0 96px; border-radius:50%; background:var(--user-color,#111827); color:#fff; display:grid; place-items:center; overflow:visible; border:4px solid #fff; padding:3px; box-shadow:0 0 0 3px var(--user-color,#111827), 0 5px 16px rgba(17,24,39,.16); font-size:1.2rem; font-weight:950; }
.profile-avatar-media { width:100%; height:100%; border-radius:50%; overflow:hidden; display:grid; place-items:center; background:var(--user-color,#111827); }
.profile-avatar img { width:100%; height:100%; min-width:100%; min-height:100%; object-fit:cover; object-position:center center; border-radius:50%; display:block; image-orientation:from-image; background:#fff; }
.profile-avatar-initials { color:#fff; }
.profile-avatar-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.profile-color-block { margin-top:18px; padding-top:14px; border-top:1px solid var(--line); }
.profile-color-heading { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.profile-color-heading p { margin:4px 0 0; }
.profile-color-current { --swatch-color:#475569; flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; min-height:28px; padding:4px 8px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--muted); font-size:.72rem; font-weight:850; }
.profile-color-current::before { content:""; width:11px; height:11px; border-radius:50%; background:var(--swatch-color); }
.profile-color-palette { display:flex; gap:9px; flex-wrap:wrap; margin-top:12px; }
.profile-color-swatch { --swatch-color:#475569; width:42px; height:42px; min-height:42px; border-radius:50%; border:3px solid #fff; background:var(--swatch-color); box-shadow:0 0 0 1px #bcc2cd; padding:0; }
.profile-color-swatch.selected { box-shadow:0 0 0 3px #111827; transform:scale(1.05); }
.profile-color-swatch.used { opacity:.28; cursor:not-allowed; filter:grayscale(.3); }
.profile-color-swatch:not(:disabled):hover { transform:scale(1.08); }
.profile-form { display:grid; gap:10px; }
.profile-form label { display:flex; flex-direction:column; gap:6px; font-weight:800; }
.profile-form input { width:100%; border:1px solid var(--line); border-radius:12px; background:#fff; padding:10px 12px; color:var(--ink); }
#map-filters [data-filter="my-da"].active,
#map-filters [data-filter="2da"].active,
#map-filters [data-filter="3da"].active,
#map-filters [data-filter="4da"].active { background:#087443; border-color:#087443; color:#fff; }
#map-filters [data-filter="my-poate"].active,
#map-filters [data-filter="1poate"].active,
#map-filters [data-filter="2poate"].active,
#map-filters [data-filter="3poate"].active,
#map-filters [data-filter="4poate"].active { background:#a15c00; border-color:#a15c00; color:#fff; }
#map-filters [data-filter="my-nu"].active { background:#a32921; border-color:#a32921; color:#fff; }
#map-filters .chip[aria-pressed="true"] { box-shadow:0 0 0 2px rgba(255,255,255,.78), 0 4px 12px rgba(17,24,39,.16); }

/* Current-user state on Locations cards. */
.location-statuses { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.badge.my-pref { border:1px solid transparent; }
.badge.my-pref.da { background:#eaf8ef; color:#08603d; border-color:#b7dfc7; }
.badge.my-pref.poate { background:#fff6e5; color:#8a5700; border-color:#f1d39a; }
.badge.my-pref.nu { background:#fff0ef; color:#912018; border-color:#efc0bc; }
.badge.my-next { background:#fff8df; color:#795600; border:1px solid #ead07d; }
.location-card.my-next-location { box-shadow:0 0 0 2px #e4c65d, 0 4px 14px rgba(17,24,39,.04); }
.segmented.compact button.selected[data-pref="Da"] { background:#eaf8ef; color:#08603d; box-shadow:inset 0 -3px 0 #087443; }
.segmented.compact button.selected[data-pref="Poate"] { background:#fff6e5; color:#8a5700; box-shadow:inset 0 -3px 0 #c47a00; }
.segmented.compact button.selected[data-pref="Nu"] { background:#fff0ef; color:#912018; box-shadow:inset 0 -3px 0 #b42318; }
.location-detail-header h1 { margin:3px 0 4px; font-size:clamp(1.55rem,7vw,2.25rem); line-height:1.08; }
.location-detail-header p { margin-bottom:10px; }
.location-detail-overview { display:grid; gap:12px; margin:10px 0 14px; align-items:start; }
.location-detail-overview.has-image { grid-template-columns:minmax(104px,34vw) minmax(0,1fr); }
.location-detail-media { margin:0; min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:#f2f4f7; }
.location-detail-image { width:100%; aspect-ratio:1 / 1; height:auto; object-fit:contain; object-position:center; display:block; background:#eef0f3; }
.location-detail-facts { margin:0; grid-template-columns:1fr; gap:7px; }
.location-detail-facts > div { padding:9px; }
.location-detail-facts strong { overflow-wrap:anywhere; }
.location-source-link { margin:10px 0 18px; }
.location-source-link .button { width:100%; }
.location-card-overview { display:grid; grid-template-columns:86px minmax(0,1fr); gap:12px; align-items:start; }
.location-card-thumb { width:86px; aspect-ratio:1 / 1; display:block; overflow:hidden; border-radius:13px; border:1px solid var(--line); background:#eef0f3; }
.location-card-thumb img { width:100%; height:100%; object-fit:cover; object-position:center; display:block; }
.location-card-copy { min-width:0; }
.location-card-copy h2 { overflow-wrap:anywhere; }
.location-card-copy p { margin-bottom:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.location-card .location-statuses { justify-content:flex-start; margin-top:10px; }
.location-card-summary { margin:9px 0; }
.location-card .card-actions { align-items:stretch; }
.location-card .card-actions .segmented.compact { flex:1 1 220px; min-width:0; }
.location-card .card-actions > .button { flex:0 1 auto; }

.consensus-signal-block { margin:14px 0 18px; padding:12px; border:1px solid #b7dfc7; border-radius:14px; background:#f4fbf7; }
.consensus-signal-block.poate { border-color:#f0d39c; background:#fffaf0; }
.consensus-signal-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:4px; }
.consensus-signal-heading > div { display:flex; align-items:center; gap:8px; }
.consensus-signal-label { display:inline-flex; align-items:center; min-height:25px; padding:3px 8px; border-radius:999px; font-size:.72rem; font-weight:950; }
.consensus-signal-label.da { background:#dff4e8; color:#08603d; }
.consensus-signal-label.poate { background:#fff0c7; color:#805100; }
.consensus-maybe-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin:10px 0; }
.consensus-maybe-summary span { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:48px; padding:5px; border:1px solid #efd39a; border-radius:10px; background:#fff; color:#805100; font-size:.72rem; font-weight:850; }
.consensus-maybe-summary b { color:var(--ink); font-size:1rem; }
.consensus-group { margin:7px 0; border:1px solid #ead9b7; border-radius:11px; background:#fff; overflow:hidden; }
.consensus-group summary { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; list-style:none; }
.consensus-group summary::-webkit-details-marker { display:none; }
.consensus-group summary::before { content:'›'; flex:0 0 auto; font-size:1.15rem; transform:rotate(0deg); transition:transform .15s ease; }
.consensus-group[open] summary::before { transform:rotate(90deg); }
.consensus-group summary span { flex:1; }
.consensus-group summary strong { font-size:.76rem; color:#805100; }
.consensus-group-list { padding:0 8px 8px; }

@media (max-width:520px) { .location-statuses { justify-content:flex-start; } }

@media (max-width: 520px) {
  .bottom-sheet { padding-left:12px; padding-right:12px; }
  .location-media-sheet { margin-left:-2px; margin-right:-2px; max-height:220px; }
  .location-image { height:min(27dvh,180px); }
  .detail-grid { grid-template-columns:1fr; }
  .detail-grid .wide { grid-column:auto; }
  .location-card { padding:12px; }
  .location-card-overview { grid-template-columns:74px minmax(0,1fr); gap:10px; }
  .location-card-thumb { width:74px; border-radius:11px; }
  .location-card h2 { font-size:1.05rem; margin-bottom:5px; }
  .location-card p { font-size:.87rem; }
  .location-card .summary-strip > * { padding:5px 7px; font-size:.72rem; }
  .location-card .card-actions { display:grid; grid-template-columns:1fr; gap:7px; }
  .location-card .card-actions > .button { width:100%; }
  .location-card .segmented.compact { width:100%; min-width:0; }
  .location-detail-overview.has-image { grid-template-columns:112px minmax(0,1fr); gap:10px; }
  .location-detail-media figcaption { padding:5px 7px; font-size:.62rem; }
  .location-detail-facts > div { border-radius:10px; padding:8px; }
  .location-detail-facts span { font-size:.66rem; }
  .location-detail-facts strong { font-size:.9rem; }
  .consensus-signal-block { padding:10px; }
  .consensus-signal-heading { align-items:flex-start; }
  .consensus-maybe-summary { gap:4px; }
  .consensus-maybe-summary span { padding:4px 2px; font-size:.66rem; }
}

@media (min-width: 720px) {
  .location-detail-overview.has-image { grid-template-columns:240px minmax(0,1fr); gap:18px; }
  .location-detail-facts { grid-template-columns:1fr 1fr; }
  .location-detail-facts .wide { grid-column:1 / -1; }
  .location-source-link .button { width:auto; }
  .toolbar-grid { grid-template-columns:2fr 1fr 1fr 1fr; }
  .analytics-grid { grid-template-columns:1fr 1fr; }
  .kpi-grid { grid-template-columns:repeat(4,1fr); }
  .card-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bottom-sheet { left:50%; right:auto; width:min(680px,calc(100% - 24px)); transform:translate(-50%,105%); border-radius:24px 24px 0 0; }
  .bottom-sheet.open { transform:translate(-50%,0); }
}
@media (min-width: 1000px) {
  .bottom-nav { position:sticky; top:var(--top-h); bottom:auto; height:48px; padding:0; grid-template-columns:repeat(4,120px); justify-content:center; }
  .bottom-nav a { min-height:48px; }
  body { padding-bottom:0; }
  .map-page { height:calc(100vh - var(--top-h) - 48px); }
  .analytics-grid { grid-template-columns:repeat(3,1fr); }
  .card-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

.select-chip { appearance:auto; width:auto; max-width:170px; }

/* Persistent navigation on long browse/history pages, including desktop. */
@media (min-width: 1000px) {
  body[data-page="locations"],
  body[data-page="route"],
  body[data-page="help"],
  body[data-page="me"],
  body[data-page="analytics"] {
    padding-bottom: 58px;
  }
  body[data-page="locations"] .bottom-nav,
  body[data-page="route"] .bottom-nav,
  body[data-page="help"] .bottom-nav,
  body[data-page="me"] .bottom-nav,
  body[data-page="analytics"] .bottom-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    height: 52px;
    padding: 0;
    grid-template-columns: repeat(4, 120px);
    justify-content: center;
    box-shadow: 0 -8px 24px rgba(17,24,39,.06);
  }
  body[data-page="locations"] .bottom-nav a,
  body[data-page="route"] .bottom-nav a,
  body[data-page="help"] .bottom-nav a,
  body[data-page="me"] .bottom-nav a,
  body[data-page="analytics"] .bottom-nav a {
    min-height: 52px;
  }
}

/* Help entry point. */
.help-chip { width:34px; height:34px; flex:0 0 34px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--ink); display:grid; place-items:center; text-decoration:none; font-weight:950; font-size:1rem; }
.help-chip:hover { border-color:#aab1bf; background:#f7f8fa; }

/* Help / onboarding page. */
.help-page { max-width: 980px; }
.help-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:14px; }
.help-lead { max-width:720px; color:var(--muted); font-size:1.02rem; line-height:1.55; }
.help-jump { position:sticky; top:calc(var(--top-h) + 8px); z-index:20; display:flex; gap:7px; overflow-x:auto; scrollbar-width:none; margin:0 0 14px; padding:8px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.95); box-shadow:0 6px 18px rgba(17,24,39,.06); backdrop-filter:blur(12px); }
.help-jump a { flex:0 0 auto; padding:7px 10px; border-radius:999px; background:#f2f4f7; text-decoration:none; font-size:.8rem; font-weight:850; }
.help-section { display:grid; grid-template-columns:42px 1fr; gap:14px; scroll-margin-top:120px; }
.help-section-number { width:38px; height:38px; border-radius:50%; background:var(--ink); color:#fff; display:grid; place-items:center; font-weight:950; }
.help-section h2 { margin:4px 0 10px; }
.help-section h3 { margin:18px 0 8px; font-size:1rem; }
.help-section p, .help-section li { line-height:1.55; }
.help-steps, .help-bullets { padding-left:22px; margin:0; }
.help-steps li, .help-bullets li { margin:8px 0; }
.help-callout { margin-top:14px; padding:12px 14px; border-radius:12px; border:1px solid #b7d7c8; background:#edf9f3; line-height:1.5; }
.help-callout.warning { border-color:#f3cc7a; background:#fff7e6; }
.help-legend-grid { display:grid; grid-template-columns:1fr; gap:8px; margin:12px 0; }
.help-legend-card { display:flex; flex-direction:column; gap:5px; min-height:104px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#f9fafb; }
.help-legend-card > span:last-child { color:var(--muted); font-size:.87rem; }
.help-marker-row { display:flex; gap:5px; align-items:center; min-height:18px; }
.help-marker-row .restaurant-pref-dot { width:14px; height:14px; }
.help-people { display:flex; flex-wrap:wrap; gap:7px; margin:10px 0 14px; }
.help-person { --user-color:#111827; display:inline-flex; align-items:center; gap:6px; padding:7px 9px; border:1px solid var(--line); border-radius:999px; background:#fff; font-size:.78rem; font-weight:850; }
.help-person i { width:10px; height:10px; border-radius:50%; background:var(--user-color); }
.help-facts { display:grid; gap:8px; margin:12px 0; }
.help-facts > div, .help-action-grid > div, .help-compare > div { padding:12px; border:1px solid var(--line); border-radius:12px; background:#f9fafb; }
.help-facts strong, .help-facts span, .help-action-grid strong, .help-action-grid span { display:block; }
.help-facts span, .help-action-grid span { margin-top:4px; color:var(--muted); font-size:.88rem; line-height:1.45; }
.help-chip-list { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.help-chip-list span { padding:6px 9px; border:1px solid var(--line); border-radius:999px; background:#fff; font-size:.78rem; font-weight:800; }
.help-compare, .help-action-grid { display:grid; gap:8px; margin:10px 0; }
.help-compare p { margin:6px 0 0; color:var(--muted); }
.help-section details { padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#f9fafb; }
.help-section details p { margin:8px 0 0; color:var(--muted); }
.help-finish { margin:18px 0 12px; padding:20px; border-radius:var(--radius); background:#111827; color:#fff; }
.help-finish p { color:#d0d5dd; }
.help-finish .button:not(.primary) { background:#fff; }

@media (min-width: 720px) {
  .help-legend-grid { grid-template-columns:repeat(3,1fr); }
  .help-facts { grid-template-columns:repeat(3,1fr); }
  .help-compare { grid-template-columns:repeat(2,1fr); }
  .help-action-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 520px) {
  .help-hero { display:block; }
  .help-hero > .button { width:100%; margin-top:4px; }
  .help-section { grid-template-columns:1fr; gap:4px; }
  .help-section-number { width:32px; height:32px; font-size:.82rem; }
  .topbar-actions { gap:6px; }
  .status-pill { padding-left:7px; padding-right:7px; }
}

@media (max-width:560px) {
  .location-edit-bar { align-items:stretch; flex-direction:column; gap:8px; bottom:8px; }
  .location-edit-actions { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .location-edit-actions .button { width:100%; min-height:42px; }
}

/* Developer Access: per-user maintenance opt-in */
.developer-access-panel { border-color:#e7d7a6; background:#fffdf7; }
.developer-access-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.developer-access-heading h2 { margin-bottom:0; }
.developer-access-switch { display:flex; align-items:center; gap:9px; min-height:44px; cursor:pointer; user-select:none; }
.developer-access-switch input { position:absolute; opacity:0; pointer-events:none; }
.developer-access-slider { position:relative; width:50px; height:28px; flex:0 0 50px; border-radius:999px; background:#c7ccd4; border:1px solid #aeb5c0; transition:background .16s ease,border-color .16s ease; }
.developer-access-slider::after { content:""; position:absolute; width:22px; height:22px; left:2px; top:2px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(17,24,39,.25); transition:transform .16s ease; }
.developer-access-switch input:checked + .developer-access-slider { background:#b45309; border-color:#92400e; }
.developer-access-switch input:checked + .developer-access-slider::after { transform:translateX(22px); }
.developer-access-switch input:focus-visible + .developer-access-slider { outline:3px solid rgba(37,99,235,.3); outline-offset:2px; }
.developer-access-switch input:disabled + .developer-access-slider { opacity:.55; }
.developer-access-status { min-width:26px; font-size:.78rem; font-weight:900; color:var(--muted); }
.developer-access-status[data-enabled="true"] { color:#92400e; }
.developer-access-warning { margin-top:12px; }
@media (max-width:520px) {
  .developer-access-heading { align-items:center; }
  .developer-access-heading .eyebrow { margin-bottom:2px; }
}
