@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=DM+Mono:wght@400;500&display=swap');

/* ── Reset & Root ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

:root {
  --pizza: #B5472E;
  --pizza-dark: #8C3420;
  --pizza-light: #F2DFD8;
  --pizza-pale: #FBF4F1;
  --ink: #1A1208;
  --ink-70: rgba(26, 18, 8, 0.72);
  /* Enhanced contrast for body/meta text (exceeds WCAG 4.5:1) */
  --ink-60: rgba(26, 18, 8, 0.72);
  /* Updated for improved readability */
  --ink-30: rgba(26, 18, 8, 0.45);
  /* Enhanced contrast for placeholders/legends */
  --ink-10: rgba(26, 18, 8, 0.1);
  --cream: #FBF6EF;
  --card-bg: #FFFFFF;
  --teal: #286A5F;
  --teal-light: #E5EFEA;
  --amber: #8A5C14;
  --amber-light: #F7EAD0;
  --border: rgba(26, 18, 8, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(26, 18, 8, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 18, 8, 0.14);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --transition: 0.18s ease;
  --sidebar-w: 260px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: #FFFFFF;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}


/* ════════════════════════════════════════════
   MOBILE  (default, < 768px)
   Single column, sticky top header + tab bar
════════════════════════════════════════════ */

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
}

/* wrapper needed for tablet/desktop; invisible on mobile */
.app-main {
  display: contents;
}

/* ── Header / Sidebar ── */
body.is-landing .app-header {
  display: none !important;
}

body.is-landing .bottom-nav {
  display: none !important;
}

.app-header {
  background: rgba(26, 18, 8, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--cream);
  padding: 18px 20px 0;
  position: sticky;
  top: 0;
  z-index: 1100;
  /* Set above Leaflet map panes and controls (max 1000) so they scroll underneath */
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 8px;
}

.app-wordmark {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  font-style: normal;
  flex-shrink: 0;
}

.week-switcher-select {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--cream);
  cursor: pointer;
  padding: 4px 22px 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: var(--ink);
  letter-spacing: 0.04em;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FBF6EF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  max-width: 55%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.week-switcher-select:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.05);
}

.week-switcher-select:focus {
  border-color: var(--pizza);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.week-switcher-select option {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
}

.header-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 6px;
}

.header-title em {
  color: var(--pizza);
  font-style: italic;
}

.header-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.header-meta span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 300;
}

.header-meta .pill {
  background: var(--pizza);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

/* sidebar footer — hidden on mobile */
.sidebar-footer {
  display: none;
}

/* view footer — visible on mobile/tablet, hidden on desktop */
.view-footer {
  display: block;
  margin: 48px 16px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: rgba(26, 18, 8, 0.68);
  /* Muted for hierarchy, compliant contrast (6.30:1) */
  line-height: 1.7;
  text-align: center;
  letter-spacing: 0.015em;
}

/* Footer links styling */
.sidebar-footer a,
.view-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(26, 18, 8, 0.25);
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.view-footer a:hover {
  color: var(--pizza-dark);
  /* Compliant hover contrast (6.75:1) on cream background */
  text-decoration-color: var(--pizza-dark);
}

.sidebar-footer a {
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.sidebar-footer a:hover {
  color: var(--pizza-light);
  /* Compliant hover contrast (16.1:1) on dark sidebar background */
  text-decoration-color: var(--pizza-light);
}

/* ── Nav Tabs ── */
.nav-tabs {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0 -20px;
  padding: 0 4px;
}

.nav-tab {
  flex: 1;
  padding: 13px 4px 11px;
  font-size: 14px;
  /* Increased from 12px */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  /* Increased contrast from 0.45 */
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.04em;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-tab.has-items::after,
.compact-menu-item.has-items::after {
  content: attr(data-count);
  position: relative;
  display: inline-block;
  top: -2px;
  margin-left: 6px;
  background: var(--pizza-light);
  color: var(--pizza);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 12px;
  min-width: 14px;
  text-align: center;
  border: none;
  box-shadow: none;
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 6px;
  height: 6px;
  background-color: var(--pizza);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.badge-dot.show {
  opacity: 1;
}

.new-listings-banner {
  margin: 0 16px 10px;
  padding: 10px 14px;
  background: var(--pizza-light);
  border: 1px solid rgba(201, 75, 44, 0.25);
  border-radius: 12px;
  color: var(--pizza-dark);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition);
}

.new-listings-banner .banner-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.new-listings-banner .banner-text {
  flex: 1;
}

.new-listings-banner .banner-close {
  background: none;
  border: none;
  color: var(--pizza-dark);
  cursor: pointer;
  padding: 0 4px;
  line-height: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-listings-banner .banner-close:hover {
  opacity: 1;
}


.nav-tab.active {
  color: #fff;
  border-bottom-color: var(--pizza);
}

.nav-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Views ── */
.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 32px;
}

.view.active {
  display: block;
}

/* ── Search & Filters ── */
.browse-header,
.saved-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 246, 239, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--border);
  transition: border-color var(--transition);
  padding-top: 10px;
}

.search-bar {
  padding: 4px 16px 0;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-bar input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  /* Spaced right padding to make room for clear button */
  padding: 10px 38px 10px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition);
}

.search-bar input:focus {
  border-color: var(--pizza);
}

.search-bar input::placeholder {
  color: var(--ink-30);
}

/* Clear Search button */
.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--ink-60);
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 0 1px 0;
  /* slight bottom offset to perfectly center standard multiplication character */
  transition: background var(--transition), color var(--transition);
}

.search-clear-btn:hover {
  background: rgba(201, 75, 44, 0.15);
  color: var(--pizza);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.4;
  pointer-events: none;
}

.filter-row {
  padding: 10px 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-section {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 8px;
  align-items: start;
  padding: 10px 16px;
}

.filter-label {
  font-size: 12px;
  color: var(--ink-60);
  font-weight: 500;
  padding-top: 7px;
}

.filter-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-section {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 8px;
  align-items: center;
  padding: 10px 16px;
}

.sort-main-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  font-size: 12px;
  color: var(--ink-60);
  font-weight: 500;
  margin-right: 2px;
}

.sort-label-empty {
  display: inline-block;
}

.sort-distance-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-chip {
  font-family: inherit;
  flex-shrink: 0;
  font-size: 13.5px;
  /* Increased from 12px */
  font-weight: 500;
  padding: 6px 14px;
  /* Adjusted padding for size */
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--ink-60);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.filter-chip:hover {
  border-color: var(--pizza);
  color: var(--pizza);
}

.filter-chip.active {
  background: var(--pizza);
  border-color: var(--pizza);
  color: #fff;
}

/* ── Cards ── */
.cards-list {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dish-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 24px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: background-color var(--transition);
  position: relative;
}

.dish-card:hover {
  background: var(--cream);
}

.dish-card.bookmarked {
  border-color: var(--pizza);
  background: var(--pizza-pale);
}

.card-emoji {
  font-size: 30px;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pizza-light);
  border-radius: var(--radius-sm);
  line-height: 1;
  align-self: flex-start;
}

.dish-card.bookmarked .card-emoji {
  background: #F0D5CB;
}

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

.card-dish {
  font-family: var(--font-display);
  font-size: 18px;
  /* Increased from 16px */
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 3px;
  padding-right: 64px;
}

.new-badge {
  display: inline-block;
  background: var(--pizza);
  color: #fff;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

.card-restaurant {
  font-size: 12px;
  color: var(--pizza-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  padding-right: 64px;
}

.card-neighborhood {
  font-size: 13px;
  /* Increased from 11px */
  color: var(--ink-60);
  margin-bottom: 7px;
  font-weight: 300;
}

/* Description — always visible, no line-clamp */
.card-desc {
  font-size: 14.5px;
  /* Increased from 12.5px */
  color: var(--ink-60);
  line-height: 1.6;
  margin-bottom: 9px;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  /* Increased from 10px */
  font-weight: 500;
  padding: 3px 8px;
  /* Adjusted padding */
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-meat {
  background: #FAE8E0;
  color: #8B3015;
}

.tag-veg {
  background: #E3EFDB;
  color: #2F6316;
}

.tag-vegan {
  background: #D8EDE9;
  color: #0F5C4E;
}

.tag-gf {
  background: #EDE8F5;
  color: #4A3A8A;
}

.tag-pie {
  background: var(--amber-light);
  color: var(--amber);
}

.tag-slice {
  background: #E3EEF8;
  color: #185FA5;
}

.bookmark-btn {
  position: absolute;
  top: 24px;
  right: 16px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.bookmark-btn .save-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill var(--transition), stroke var(--transition), transform var(--transition);
}

.bookmark-btn .save-text {
  display: none;
  /* Hidden on mobile */
}

.bookmark-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.bookmark-btn.saved {
  background: var(--pizza);
  color: #fff;
}

.bookmark-btn.saved .save-icon {
  fill: currentColor;
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-30);
}

.no-results .nr-emoji {
  font-size: 40px;
  margin-bottom: 12px;
}

.no-results p {
  font-size: 14px;
}

/* ── Saved View ── */
.stats-bar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
}

.stat-box {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 800;
  color: var(--pizza);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--ink-60);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  font-weight: 500;
}

.section-header {
  padding: 8px 16px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Friends / Share ── */
.share-panel {
  margin: 14px 16px 0;
  background: var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  color: #fff;
}

.share-panel h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.share-panel p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin-bottom: 14px;
  font-weight: 300;
}

.code-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--pizza);
  word-break: break-all;
  margin-bottom: 10px;
  min-height: 40px;
  display: flex;
  align-items: center;
  letter-spacing: 0.03em;
}

.code-placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
  font-family: var(--font-body);
}

.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--pizza);
  color: #fff;
  width: 100%;
  margin-bottom: 12px;
}

.btn-primary:hover {
  background: var(--pizza-dark);
}

.btn.copied {
  background: var(--teal);
}

.paste-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 500;
}

.paste-row {
  display: flex;
  gap: 8px;
}

.paste-row input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.paste-row input:focus {
  border-color: var(--pizza);
}

.paste-row input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.paste-row .btn {
  flex-shrink: 0;
  background: var(--pizza);
  color: #fff;
  padding: 9px 14px;
}

.paste-row .btn:hover {
  background: var(--pizza-dark);
}

.share-panel-columns {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.share-column {
  flex: 1;
}

.share-column .btn {
  margin-bottom: 0;
}

.friends-list {
  padding: 14px 16px 0;
}

.friend-item {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pizza-light);
  color: var(--pizza-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.friend-info {
  flex: 1;
}

.friend-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.friend-count {
  font-size: 11px;
  color: var(--ink-60);
}

.friend-remove {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--ink-60);
  font-family: var(--font-body);
  transition: all var(--transition);
}

.friend-remove:hover {
  border-color: var(--pizza);
  color: var(--pizza);
}

.overlap-section {
  padding: 14px 16px 0;
}

.overlap-header {
  background: var(--teal);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #fff;
  margin-bottom: 10px;
}

.overlap-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.overlap-header p {
  font-size: 12px;
  opacity: 0.7;
  font-weight: 300;
}

.overlap-card {
  border-color: var(--teal) !important;
  background: var(--teal-light) !important;
}

.overlap-card .card-restaurant {
  color: var(--teal) !important;
}

/* ── Map ── */
.map-container {
  position: relative;
  background: #F0EBE1;
  margin: 14px 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
}

#map-canvas {
  width: 100%;
  height: 360px;
  display: block;
}

.map-legend {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-60);
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.saved {
  background: var(--pizza);
}

.legend-dot.unsaved {
  background: #888;
}

.map-selected {
  padding: 14px 16px 0;
}

/* Leaflet pin overrides — replace the default blue marker with a colored
   circle that matches the legend. */
.pdx-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #888;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pdx-pin.saved {
  background: var(--pizza);
  width: 22px;
  height: 22px;
}

.pdx-pin.selected {
  outline: 3px solid var(--pizza);
  outline-offset: 1px;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  min-width: 160px;
}

.leaflet-popup-content .popup-dish {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.leaflet-popup-content .popup-restaurant {
  color: var(--ink-60);
  font-size: 12px;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
}

/* ── Detail Sheet ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 8, 0.5);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.detail-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.lightbox-nav.prev {
  left: 16px;
}

.lightbox-nav.next {
  right: 16px;
}

.lightbox-nav.close-desktop {
  top: 32px;
  right: 32px;
  transform: none;
}

.lightbox-nav.close-desktop:hover:not(:disabled) {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .lightbox-nav.close-desktop {
    display: none;
  }
}

/* ── Landing Page ── */
.landing-header {
  padding: 40px 20px 20px;
  text-align: center;
}

.landing-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
}

.landing-subtitle {
  font-size: 16px;
  color: var(--ink-60);
  max-width: 400px;
  margin: 0 auto;
}

.landing-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.landing-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid transparent;
}

.landing-card:hover {
  transform: translateY(-4px) scale(1.025);
  box-shadow: 0 16px 36px rgba(26, 18, 8, 0.12);
}

.landing-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.landing-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}

.landing-card p {
  font-size: 14px;
  color: var(--ink-60);
  margin-bottom: 16px;
}

.landing-btn {
  background: var(--ink);
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  pointer-events: none;
}

.badge-upcoming {
  position: absolute;
  top: 16px;
  right: -24px;
  background: #C94B2C;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 32px;
  transform: rotate(45deg);
  letter-spacing: 1px;
  text-align: center;
  width: 100px;
}

@media (max-width: 768px) {
  .lightbox-nav {
    display: none;
  }
}

@media (min-width: 769px) {
  .sheet-nav {
    display: none !important;
  }

  /* on desktop, let's bring them a bit closer to the card instead of extreme edges if the screen is huge */
  .lightbox-nav.prev {
    left: calc(50% - 320px);
  }

  .lightbox-nav.next {
    right: calc(50% - 320px);
  }

  .sheet-close {
    display: none !important;
  }
}

.detail-sheet {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding: 0 20px 40px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.detail-overlay.open .detail-sheet {
  transform: translateY(0);
}

.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.sheet-close:hover {
  border-color: var(--pizza);
  color: var(--pizza);
  transform: scale(1.05);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 20px;
}

.sheet-emoji-hero {
  font-size: 68px;
  text-align: center;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.sheet-dish {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
  margin-bottom: 6px;
}

.sheet-restaurant {
  font-size: 14px;
  color: var(--pizza-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 4px;
}

.sheet-address {
  font-size: 14px;
  color: var(--ink-60);
  text-align: center;
  margin-bottom: 16px;
}

.sheet-address a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.venue-link {
  color: inherit !important;
  text-decoration: none !important;
  transition: opacity 0.2s ease;
}

.sheet-link-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.sheet-link-grid .link-text {
  grid-column: 2;
  text-align: center;
}

.sheet-link-grid .link-icon {
  grid-column: 3;
  justify-self: start;
  padding-left: 6px;
  color: var(--ink-30);
  display: flex;
  align-items: center;
}

.venue-link:hover {
  opacity: 0.7;
}

.mobile-arrow {
  display: none;
}

@media (max-width: 768px) {
  .mobile-arrow {
    display: inline;
  }
}

.sheet-desc {
  font-size: 16px;
  color: var(--ink-60);
  line-height: 1.6;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  font-weight: 300;
}

.sheet-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.sheet-actions .btn {
  flex: 1;
  text-align: center;
}

.btn-save {
  background: transparent;
  color: var(--pizza-dark);
  border: 1.5px solid var(--pizza-dark);
}

.btn-save:hover {
  background: var(--pizza-pale);
  border-color: var(--pizza-dark);
  color: var(--pizza-dark);
}

.btn-save.saved {
  background: var(--pizza);
  color: #fff;
  border-color: var(--pizza);
}

.btn-save.saved:hover {
  background: var(--pizza-dark);
  border-color: var(--pizza-dark);
}

.btn-link {
  background: var(--cream);
  color: var(--ink);
  border: 1.5px solid var(--border);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-link:hover {
  border-color: var(--ink-30);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 3000;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Scrollbars ── */
.view::-webkit-scrollbar {
  width: 4px;
}

.view::-webkit-scrollbar-track {
  background: transparent;
}

.view::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}


/* ── Swipe view ────────────────────────────────────────────── */

#view-swipe {
  display: none;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  overflow: hidden;
}

#view-swipe.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}

.swipe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.swipe-counter {
  font-size: 13px;
  color: var(--ink-60);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.swipe-reset {
  font: inherit;
  font-size: 12px;
  color: var(--ink-60);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.swipe-reset:hover {
  color: var(--pizza);
  border-color: var(--pizza);
}

.swipe-deck {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 340px;
  margin-bottom: 14px;
  touch-action: none;
}

.swipe-card {
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform, opacity;
}

.swipe-card:active {
  cursor: grabbing;
}

.swipe-card.swipe-card-bg {
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

/* Hide browser-default search clear button */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* Centered fanned card deck on tablet and desktop */
@media (min-width: 768px) {
  .swipe-deck {
    width: 100%;
    max-width: 440px;
    height: 560px;
    margin: 20px auto 32px;
    flex: none;
  }

  .swipe-deck .swipe-card {
    width: 350px;
    height: 560px;
    left: 0;
    top: 0;
    right: auto;
    bottom: auto;
  }
}

.swipe-card-image {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: 380px;
  background: var(--pizza-pale);
  position: relative;
  overflow: hidden;
}

.swipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.swipe-card-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
}

.swipe-card-body {
  padding: 14px 16px 16px;
  background: var(--card-bg);
  flex: 0 1 auto;
  overflow-y: auto;
}

.swipe-card-dish {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 3px;
}

.swipe-card-restaurant {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-60);
  margin-bottom: 4px;
}

.swipe-card-neighborhood {
  font-size: 12px;
  color: var(--ink-30);
  margin-bottom: 8px;
}

.swipe-card-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 10px;
}

.swipe-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.swipe-stamp {
  position: absolute;
  top: 24px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border: 4px solid;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s linear;
  text-transform: uppercase;
}

.swipe-stamp-like {
  right: 22px;
  color: var(--teal);
  border-color: var(--teal);
  transform: rotate(15deg);
}

.swipe-stamp-pass {
  left: 22px;
  color: var(--pizza-dark);
  border-color: var(--pizza-dark);
  transform: rotate(-15deg);
}

.swipe-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  gap: 8px;
}

.swipe-empty .nr-emoji {
  font-size: 72px;
  line-height: 1;
}

.fun-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--pizza);
  font-weight: 700;
  margin: 8px 0 4px;
}

.swipe-empty p {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-60);
  margin: 0 0 12px 0;
}

@keyframes funBounce {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-15px) scale(1.1) rotate(5deg);
  }
}

.fun-bounce {
  animation: funBounce 1.5s infinite ease-in-out;
}

.swipe-controls {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  padding: 4px 0 0;
  flex-shrink: 0;
}

.swipe-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.swipe-btn-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-60);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.swipe-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, box-shadow var(--transition), color var(--transition), border-color var(--transition);
}

.swipe-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.swipe-btn:active {
  transform: translateY(0);
}

.swipe-pass {
  color: var(--pizza-dark);
  border-color: var(--pizza-dark);
}

.swipe-like {
  color: var(--teal);
  border-color: var(--teal);
}

.swipe-info {
  width: 44px;
  height: 44px;
  font-size: 18px;
  color: var(--ink-60);
  align-self: center;
}

.swipe-undo {
  width: 44px;
  height: 44px;
  font-size: 18px;
  color: var(--pizza-dark);
  border-color: var(--pizza-dark);
  align-self: center;
}

.swipe-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Detail sheet hero image */
.sheet-hero-image {
  width: calc(100% + 40px);
  margin: 0 -20px 16px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--pizza-pale);
  border-radius: 0;
}

.sheet-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Small card thumbnail reuses the .card-emoji square */
.card-emoji.card-thumb {
  padding: 0;
  overflow: hidden;
  background: var(--pizza-pale);
  border-radius: 0;
}

.card-emoji.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ════════════════════════════════════════════
   TABLET  (768px – 1099px)
   Two-column card grid, horizontal tabs
════════════════════════════════════════════ */

@media (min-width: 768px) {

  body {
    display: block;
  }

  .view-footer {
    margin-left: 24px;
    margin-right: 24px;
  }

  #app {
    max-width: 100%;
    min-height: 100vh;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
  }

  .app-main {
    display: block;
    flex: 1;
    overflow: hidden;
  }

  /* Header full-width */
  .week-switcher-select {
    font-size: 12.5px;
    padding: 6px 26px 6px 12px;
    background-size: 11px;
    background-position: right 8px center;
    max-width: 60%;
  }

  .app-header {
    position: sticky;
    top: 0;
    padding: 20px 28px 0;
  }

  .header-title {
    font-size: 30px;
  }

  .nav-tabs {
    margin: 0 -28px;
    padding: 0 12px;
  }

  .nav-tab {
    flex: none;
    padding: 13px 22px 11px;
    font-size: 15px;
    /* Increased from 13px */
  }

  /* Scrollable content */
  .view {
    height: calc(100vh - 170px);
    overflow-y: auto;
    padding-bottom: 48px;
  }

  /* Two-column grid */
  .cards-list {
    padding: 14px 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    flex-direction: unset;
  }

  .landing-grid {
    padding: 20px 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 900px;
    margin: 0 auto;
  }

  /* Stack card contents vertically in grid */
  .dish-card {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    align-items: flex-start;
  }

  .card-body {
    padding-right: 0;
  }

  .card-emoji {
    width: 100%;
    height: 180px;
    /* Substantially larger photo height for easier visual scanning */
    font-size: 48px;
    /* Larger emoji fallback */
    align-self: stretch;
  }

  .card-dish {
    font-size: 19px;
    padding-right: 48px;
  }

  /* Increased from 36px to clear larger 44px absolute bookmark button */
  .card-desc {
    font-size: 15.5px;
  }

  /* Increased from 13px */

  /* Bookmark floats top-right on top of the larger card image */
  .bookmark-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    margin-top: 0;
    align-self: auto;
    z-index: 10;
    padding: 0 16px 0 12px;
  }

  .bookmark-btn .save-text {
    display: inline;
  }

  .search-bar {
    padding: 18px 24px 0;
  }

  .filter-row {
    padding: 10px 24px;
  }

  .filter-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
  }

  .filter-label {
    padding-top: 0;
  }

  .filter-chips-wrapper {
    flex-wrap: wrap;
  }

  .sort-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
  }

  .sort-label-empty {
    display: none;
  }

  .stats-bar {
    padding: 16px 24px;
    gap: 14px;
  }

  .section-header {
    padding: 10px 24px 4px;
  }

  .share-panel {
    margin: 16px 24px 0;
  }

  .friends-list {
    padding: 16px 24px 0;
  }

  .overlap-section {
    padding: 16px 24px 0;
  }

  .map-container {
    margin: 16px 24px 0;
  }

  #map-canvas {
    height: 440px;
  }

  .map-selected {
    padding: 14px 24px 0;
  }

  .map-selected .cards-list {
    grid-template-columns: 1fr;
  }

  /* Modal-style detail sheet on tablet */
  .detail-overlay {
    align-items: center;
  }

  .detail-sheet {
    border-radius: 20px;
    max-height: 80vh;
    max-width: 520px;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
  }

  .detail-overlay.open .detail-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .sheet-handle {
    display: none;
  }
}


/* ════════════════════════════════════════════
   DESKTOP  (≥ 1100px)
   Fixed sidebar + scrollable main content
════════════════════════════════════════════ */

@media (min-width: 1100px) {

  .view-footer {
    display: none;
  }

  body.is-landing .view-footer {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
  }

  body {
    display: flex;
    align-items: stretch;
  }

  #app {
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    background: transparent;
  }

  /* ── Sidebar ── */
  .app-header {
    width: var(--sidebar-w);
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 32px 22px;
    overflow-y: auto;
    background: var(--ink);
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 16px;
  }

  .app-wordmark {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .week-switcher-select {
    font-size: 13.5px;
    padding: 10px 32px 10px 14px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    background-size: 12px;
    background-position: right 12px center;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
  }

  .header-title {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .header-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 24px;
  }

  /* Vertical nav */
  .nav-tabs {
    flex-direction: column;
    border-top: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    flex: 1;
  }

  .nav-tab {
    flex: none;
    text-align: left;
    padding: 12px 12px;
    font-size: 15.5px;
    /* Increased from 14px */
    font-weight: 400;
    border-bottom: none;
    border-left: 3px solid transparent;
    border-radius: 2px;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.65);
  }

  .nav-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
  }

  .nav-tab.active {
    background: rgba(201, 75, 44, 0.15);
    border-left-color: var(--pizza);
    color: #fff;
    font-weight: 500;
    border-radius: 2px;
  }

  .nav-tab .badge-dot {
    top: 50%;
    right: 10px;
    left: auto;
    transform: translateY(-50%);
  }

  /* Sidebar footer */
  .sidebar-footer {
    display: block;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    /* Muted contrast (7.64:1) on dark background */
    line-height: 1.7;
    letter-spacing: 0.01em;
  }

  /* ── Main content ── */
  .app-main {
    flex: 1;
    min-width: 0;
    display: block;
    background: #FFFFFF;
    min-height: 100vh;
  }

  .view {
    height: 100vh;
    overflow-y: auto;
    padding-bottom: 60px;
  }

  /* Three-column grid */
  .cards-list {
    padding: 20px 32px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .card-emoji {
    font-size: 48px;
  }

  /* Keep larger fallback size on desktop */
  .card-dish {
    font-size: 20px;
  }

  /* Increased from 18px */

  .search-bar {
    padding: 24px 32px 0;
  }

  .filter-row {
    padding: 12px 32px;
  }

  .filter-section {
    padding: 12px 32px;
  }

  .sort-section {
    padding: 12px 32px;
  }

  .stats-bar {
    padding: 20px 32px;
    gap: 16px;
  }

  .stat-num {
    font-size: 32px;
  }

  .section-header {
    padding: 12px 32px 6px;
    font-size: 13px;
  }

  .share-panel {
    margin: 20px auto 0;
    max-width: 800px;
  }

  .share-panel-columns {
    flex-direction: row;
  }

  .friends-list {
    padding: 20px 32px 0;
    max-width: 800px;
    margin: 0 auto;
  }

  .overlap-section {
    padding: 20px 32px 0;
    max-width: 800px;
    margin: 0 auto;
  }

  #overlap-container {
    padding: 0;
  }

  #overlap-container.cards-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-container {
    margin: 20px 32px 0;
  }

  #map-canvas {
    height: 520px;
  }

  .map-selected {
    padding: 16px 32px 0;
  }

  .map-selected .cards-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Desktop Detail Split Panel (Master-Detail) */
  .lightbox-nav {
    display: none !important;
  }

  .detail-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 420px;
    height: 100vh;
    background: transparent;
    pointer-events: none;
    z-index: 1000;
    padding: 0;
    align-items: stretch;
    opacity: 1;
  }

  .detail-sheet {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border-left: 1.5px solid var(--border);
    transform: translateX(100%);
    opacity: 1;
    pointer-events: all;
    box-shadow: -8px 0 32px rgba(26, 18, 8, 0.08);
    transition: transform 0.35s cubic-bezier(0.15, 0.85, 0.35, 1);
    padding: 24px 20px 48px;
  }

  .detail-overlay.open .detail-sheet {
    transform: translateX(0);
  }

  /* Show the close button inside the sheet on desktop sidebar */
  .detail-sheet .sheet-close {
    display: inline-flex !important;
  }

  /* Animate content width change when details panel opens */
  .app-main {
    transition: margin-right 0.35s cubic-bezier(0.15, 0.85, 0.35, 1);
  }

  #app.detail-open .app-main {
    margin-right: 420px;
  }

  /* Squeeze grid to 2 columns to prevent narrow card scanning issues */
  #app.detail-open .cards-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ════════════════════════════════════════════
   WIDE DESKTOP  (≥ 1400px)
   Four-column cards
════════════════════════════════════════════ */

@media (min-width: 1400px) {
  :root {
    --sidebar-w: 280px;
  }

  .cards-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #app.detail-open .cards-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #overlap-container.cards-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1200px;
  }
}

/* ════════════════════════════════════════════
   ULTRAWIDE DESKTOP  (≥ 1800px)
   Five/six-column cards for maximum viewport usage
   ════════════════════════════════════════════ */
@media (min-width: 1800px) {
  .cards-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #app.detail-open .cards-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #overlap-container.cards-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 2200px) {
  .cards-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #app.detail-open .cards-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #overlap-container.cards-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ════════════════════════════════════════════
   ACCESSIBILITY: FOCUS INDICATORS & MOTION
   ════════════════════════════════════════════ */
:focus-visible {
  outline: 3px solid var(--pizza);
  outline-offset: 3px;
}

input:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--pizza) !important;
  box-shadow: 0 0 0 3px rgba(201, 75, 44, 0.25) !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }

  .detail-sheet {
    transform: none !important;
    transition: none !important;
  }

  .swipe-card {
    transition: none !important;
  }
}

/* ════════════════════════════════════════════
   MOBILE UX UPGRADES: COMPACT HEADER & FAB DRAWER
   ════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Scroll-to-Hide Transitions */
  .header-top,
  .header-title,
  .header-meta,
  .nav-tabs {
    transition: max-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.2s ease,
      margin-bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      padding 0.3s ease;
    max-height: 120px;
    opacity: 1;
    overflow: hidden;
  }

  .compact-header .header-top {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0 !important;
    padding: 0 !important;
    pointer-events: none;
  }

  .compact-header .header-title {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0 !important;
    padding: 0 !important;
    pointer-events: none;
  }

  .compact-header .header-meta {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0 !important;
    padding: 0 !important;
    pointer-events: none;
  }

  .compact-header .nav-tabs {
    max-height: 0;
    opacity: 0;
    padding: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
    border: none;
  }

  .compact-header .app-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .compact-header .compact-app-bar {
    display: flex !important;
  }

  /* Make browse search and filter bar scroll away naturally instead of sticking, preventing layout shifts */
  .compact-header .browse-header,
  .compact-header .saved-header {
    position: relative !important;
    border-bottom-color: transparent;
  }

  #view-browse,
  #view-saved {
    padding-bottom: 96px !important;
  }

  /* Compact App Bar Styling */
  .compact-app-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    background: transparent;
    border-bottom: none;
  }

  .compact-brand {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cream);
    cursor: pointer;
  }

  .compact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: -8px;
  }

  .compact-icon-btn {
    background: transparent;
    border: none;
    color: var(--cream);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: background-color 0.2s;
  }

  .compact-icon-btn:hover,
  .compact-icon-btn:active {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Dropdowns */
  .compact-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26, 18, 8, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transform-origin: top;
    animation: slideDownFade 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  }

  .compact-dropdown .search-input-wrapper {
    margin-bottom: 0;
  }

  .compact-dropdown .search-input-wrapper input {
    width: 100%;
    padding: 12px 38px 12px 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 16px;
  }

  .compact-dropdown .search-input-wrapper input:focus {
    outline: none;
    border-color: var(--pizza);
  }

  .compact-dropdown .search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .compact-dropdown .search-input-wrapper .search-icon {
    color: rgba(255, 255, 255, 0.5);
  }

  .compact-dropdown .search-clear-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--cream);
    border-radius: 50%;
  }

  @keyframes slideDownFade {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .compact-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .compact-menu-item {
    position: relative;
    background: transparent;
    border: none;
    text-align: right;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    color: var(--cream);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
  }

  .compact-menu-item.active {
    color: var(--pizza);
    background: transparent;
  }

  .compact-menu-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--pizza);
  }

  .compact-menu-item:active {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ── Mobile Filter FAB ── */
.mobile-filter-fab {
  position: fixed;
  bottom: 32px;
  /* Float above screen bottom */
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(26, 18, 8, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(26, 18, 8, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.3s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.mobile-filter-fab.show-fab {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.mobile-filter-fab:active {
  transform: translateX(-50%) scale(0.95);
  background: var(--ink);
}

.mobile-filter-fab .fab-icon {
  width: 16px;
  height: 16px;
  stroke: var(--cream);
  color: var(--cream);
  stroke-width: 2.5;
  transition: transform 0.3s ease;
}

.mobile-filter-fab:active .fab-icon {
  transform: scale(0.9);
}

@media (min-width: 769px) {
  .mobile-filter-fab {
    display: none !important;
  }
}

/* ── Mobile Filter Drawer Overlay ── */
.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 8, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.filter-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Mobile Filter Drawer Bottom Sheet ── */
.filter-drawer {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  max-height: 80vh;
  box-shadow: 0 -8px 32px rgba(26, 18, 8, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.15, 0.85, 0.35, 1);
}

.filter-drawer-overlay.open .filter-drawer {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 18, 8, 0.05);
  border: none;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.drawer-close:hover {
  background: rgba(26, 18, 8, 0.1);
}

#filter-drawer-body {
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 24px;
}

/* Inline overrides when search/filters/sort reside inside drawer body */
#filter-drawer-body .search-bar {
  padding: 0 0 16px 0;
}

#filter-drawer-body .filter-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  grid-template-columns: 1fr;
  row-gap: 8px;
}

#filter-drawer-body .filter-label {
  padding-top: 0;
}

#filter-drawer-body .sort-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  grid-template-columns: 1fr;
  row-gap: 8px;
}

#filter-drawer-body .sort-label {
  margin-right: 0;
}

/* Removed margin-top on distance group to prevent vertical misalignment with other sort chips */

.drawer-footer {
  flex-shrink: 0;
}

.drawer-footer .btn-apply {
  background: var(--pizza);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.drawer-footer .btn-apply:hover {
  background: var(--pizza-dark);
}

/* ── Skeleton Shimmer Loading ── */
.shimmer-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  pointer-events: none;
  overflow: hidden;
  position: relative;
}

.shimmer-emoji {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(26, 18, 8, 0.06);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.shimmer-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shimmer-line {
  height: 12px;
  background: rgba(26, 18, 8, 0.06);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.shimmer-line.title {
  height: 18px;
  width: 65%;
  border-radius: 6px;
}

.shimmer-line.sub {
  width: 40%;
  height: 12px;
}

.shimmer-line.desc {
  width: 90%;
  height: 10px;
}

.shimmer-line.desc2 {
  width: 80%;
  height: 10px;
}

/* Shimmer Animation Sweep */
.shimmer-emoji::after,
.shimmer-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.6) 40%,
      rgba(255, 255, 255, 0.6) 60%,
      rgba(255, 255, 255, 0) 100%);
  animation: shimmerAnim 1.4s infinite linear;
}

@keyframes shimmerAnim {
  100% {
    transform: translateX(100%);
  }
}

/* ── Content Fade-in animation ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ── Custom Reordering (Drag and Drop / Mobile arrows) ── */
.dish-card.dragging {
  opacity: 0.5;
  border-style: dashed;
}

/* Drop Target Visual Indicators using pseudo-elements to avoid layout shifting */
.dish-card.drag-over-top::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--pizza);
  border-radius: 2px;
  z-index: 10;
}

.dish-card.drag-over-bottom::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--pizza);
  border-radius: 2px;
  z-index: 10;
}

.drag-handle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-right: 6px;
  margin-right: -4px;
  cursor: grab;
  align-self: stretch;
  user-select: none;
}

.drag-handle-container:active {
  cursor: grabbing;
}

.drag-grip {
  color: var(--ink-30);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.dish-card:hover .drag-grip {
  color: var(--ink-60);
}

.reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reorder-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  color: var(--ink-60);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reorder-btn:hover:not(:disabled) {
  border-color: var(--pizza);
  color: var(--pizza);
  background: var(--pizza-light);
  transform: scale(1.05);
}

.reorder-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.reorder-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--ink-30);
}

.reorder-btn:focus-visible {
  outline: 2px solid var(--pizza);
  outline-offset: 1px;
}

/* Hide original search and filter elements on mobile to rely entirely on the FAB */
@media (max-width: 768px) {

  #view-browse>.browse-header,
  #view-browse>.sort-section,
  #view-saved>.saved-header,
  #view-saved>.sort-section {
    display: none;
  }
}

/* Make map take full height */
#view-map.active {
  display: flex !important;
  flex-direction: column;
  height: 100%;
}

.map-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 20px;
}

#map-canvas {
  flex: 1;
  height: auto !important;
  min-height: 200px;
}