/* ============================================================
   GHARKHAKHANA — Main Stylesheet
   Design: Warm Indian food aesthetic
   Fonts: Fraunces (headings) + DM Sans (body)
   ============================================================ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@400;500;600&display=swap');

/* ── DESIGN TOKENS ── */
:root {
  --saffron:        #E8650A;
  --saffron-dark:   #B54D06;
  --saffron-light:  #FDF0E8;
  --turmeric:       #F5A623;
  --turmeric-light: #FEF6E4;
  --mint:           #0A8A6E;
  --mint-dark:      #087058;
  --mint-light:     #E8F6F3;
  --clay:           #3D1F0D;
  --clay-mid:       #7A4020;
  --cream:          #FDF8F3;
  --cream-dark:     #F5EDE0;
  --white:          #FFFFFF;
  --danger:         #E24B4A;
  --danger-light:   #FDECEC;
  --border:         rgba(61,31,13,0.12);
  --border-mid:     rgba(61,31,13,0.20);
  --border-strong:  rgba(61,31,13,0.28);
  --text-primary:   #1A0A00;
  --text-secondary: #7A4020;
  --text-muted:     #B07850;
  --shadow-sm:      0 2px 8px rgba(61,31,13,0.07);
  --shadow-md:      0 4px 20px rgba(61,31,13,0.11);
  --shadow-lg:      0 8px 32px rgba(61,31,13,0.16);
  --r-sm:           10px;
  --r-md:           14px;
  --r-lg:           20px;
  --r-xl:           28px;
  --nav-height:     64px;
  --topbar-height:  60px;
}

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: #E8E0D4;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* ── APP WRAPPER ── */
#app {
  width: 100%;
  max-width: 480px;
  background: var(--cream);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── STATUS BAR ── */
.status-bar {
  background: var(--white);
  padding: 12px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}
.status-icons { display: flex; gap: 5px; align-items: center; font-size: 13px; }

/* ── SYSTEM BANNERS ── */
.offline-banner {
  display: none;
  background: var(--danger);
  color: var(--white);
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}

.install-banner {
  display: none;
  background: var(--turmeric-light);
  border-bottom: 2px solid var(--turmeric);
  padding: 12px 16px;
  align-items: center;
  gap: 12px;
}
.install-banner-icon { font-size: 26px; flex-shrink: 0; }
.install-banner-text { flex: 1; }
.install-banner-title { font-size: 14px; font-weight: 600; color: var(--clay); }
.install-banner-sub { font-size: 12px; color: var(--text-muted); }
.install-banner-btn {
  background: var(--saffron); color: var(--white); border: none;
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; flex-shrink: 0;
}

.update-banner {
  display: none;
  background: var(--mint-light);
  border-bottom: 2px solid var(--mint);
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
}
.update-banner span { flex: 1; font-size: 13px; color: #0A5A46; }
.update-banner button {
  background: var(--mint); color: var(--white); border: none;
  padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

/* ── SCREENS ── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: var(--cream);
}
.screen.active { display: flex; }

/* Scrollable content area inside a screen */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ── SCREEN HEADER ── */
.screen-header {
  background: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}
.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cream); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: var(--clay);
  flex-shrink: 0; transition: background 0.15s;
}
.back-btn:active { background: var(--cream-dark); }
.header-info { flex: 1; min-width: 0; }
.header-title {
  font-family: 'Fraunces', serif;
  font-size: 20px; color: var(--clay); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.header-action {
  background: var(--saffron); color: var(--white);
  border: none; border-radius: var(--r-sm);
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  flex-shrink: 0; transition: background 0.15s;
}
.header-action:active { background: var(--saffron-dark); }
.header-action.outline {
  background: transparent; color: var(--saffron);
  border: 1.5px solid var(--saffron);
}

/* ── BOTTOM NAVIGATION ── */
.bottom-nav {
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 max(16px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px; cursor: pointer;
  padding: 4px 0; transition: transform 0.15s;
}
.nav-item:active { transform: scale(0.92); }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.nav-item.active .nav-label { color: var(--saffron); }
.nav-item.active .nav-icon { filter: saturate(1.5); }

/* ── FORMS ── */
.form-section { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.form-input {
  padding: 13px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  color: var(--text-primary); outline: none; transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus { border-color: var(--saffron); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { background: var(--cream); color: var(--text-muted); }
select.form-input { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23B07850' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.form-input { resize: none; min-height: 88px; line-height: 1.5; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── BUTTONS ── */
.btn-primary {
  width: 100%; padding: 16px; border-radius: var(--r-lg);
  background: var(--saffron); color: var(--white); border: none;
  font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn-primary:active { background: var(--saffron-dark); transform: scale(0.98); }
.btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; }

.btn-secondary {
  width: 100%; padding: 15px; border-radius: var(--r-lg);
  background: transparent; color: var(--saffron);
  border: 1.5px solid var(--saffron);
  font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-secondary:active { background: var(--saffron-light); }

.btn-mint {
  width: 100%; padding: 16px; border-radius: var(--r-lg);
  background: var(--mint); color: var(--white); border: none;
  font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-mint:active { background: var(--mint-dark); }

.btn-sm {
  padding: 7px 14px; border-radius: var(--r-sm); border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.btn-sm:active { transform: scale(0.95); }
.btn-sm-confirm { background: var(--mint); color: var(--white); }
.btn-sm-outline { background: transparent; color: var(--saffron); border: 1.5px solid var(--saffron); }
.btn-sm-danger  { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(226,75,74,0.3); }

/* ── OTP INPUTS ── */
.otp-row { display: flex; gap: 10px; justify-content: center; padding: 8px 0; }
.otp-input {
  width: 46px; height: 54px; border-radius: var(--r-sm);
  border: 2px solid var(--border); background: var(--white);
  font-size: 22px; font-weight: 600; text-align: center;
  color: var(--clay); font-family: 'DM Sans', sans-serif;
  outline: none; transition: border-color 0.2s;
}
.otp-input:focus { border-color: var(--saffron); }

/* ── ROLE TOGGLE ── */
.role-toggle {
  display: flex; margin: 16px 20px 0;
  background: var(--cream-dark); border-radius: var(--r-sm);
  padding: 4px; gap: 4px;
}
.role-tab {
  flex: 1; padding: 10px; border-radius: var(--r-sm);
  border: none; background: transparent; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  font-weight: 500; color: var(--text-muted); transition: all 0.2s;
}
.role-tab.active {
  background: var(--white); color: var(--saffron);
  box-shadow: var(--shadow-sm); font-weight: 600;
}

/* ── CARDS ── */
.card {
  background: var(--white); border-radius: var(--r-md);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 14px; }

/* ── BADGES ── */
.badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  display: inline-block;
}
.badge-pending   { background: var(--turmeric-light); color: #8B5E00; }
.badge-confirmed { background: var(--mint-light); color: #0A5A46; }
.badge-ready     { background: #EDE7FF; color: #4527A0; }
.badge-completed { background: #E8F5E9; color: #1B5E20; }
.badge-cancelled { background: var(--danger-light); color: #A32D2D; }

/* ── SECTION HEADING ── */
.section-head {
  display: flex; justify-content: space-between;
  align-items: baseline; padding: 16px 20px 8px;
}
.section-title { font-family: 'Fraunces', serif; font-size: 18px; color: var(--clay); }
.section-count { font-size: 12px; color: var(--text-muted); }
.section-divider { height: 8px; background: var(--cream-dark); margin: 4px 0; }

/* ── INFO BANNER ── */
.info-banner {
  margin: 0 20px 12px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--turmeric-light); border: 1px solid rgba(245,166,35,0.3);
  font-size: 13px; color: #7A5200; line-height: 1.5;
}
.info-banner strong { color: #5A3C00; }
.info-banner.mint {
  background: var(--mint-light); border-color: rgba(10,138,110,0.2);
  color: #0A5A46;
}
.info-banner.mint strong { color: #085040; }

/* ── STAT CARDS ── */
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 16px 20px; }
.stat-card {
  background: var(--white); border-radius: var(--r-md);
  padding: 14px 10px; text-align: center;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.stat-num { font-family: 'Fraunces', serif; font-size: 24px; color: var(--saffron); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── ORDER CARDS ── */
.order-card { margin: 0 20px 12px; }
.order-header {
  padding: 12px 14px; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid var(--border);
}
.order-id { font-size: 13px; font-weight: 600; color: var(--clay); }
.order-time { font-size: 11px; color: var(--text-muted); }
.order-body { padding: 12px 14px; }
.order-customer { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.order-items { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; }
.order-footer { display: flex; justify-content: space-between; align-items: center; }
.order-amount { font-size: 16px; font-weight: 600; color: var(--saffron); }
.order-actions { display: flex; gap: 8px; }

/* ── MENU ITEM CARD ── */
.menu-item-card {
  margin: 0 20px 12px;
  display: flex; align-items: stretch;
}
.menu-item-img {
  width: 88px; background: var(--cream-dark); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.menu-item-body { padding: 12px 14px; flex: 1; }
.menu-item-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.menu-item-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.menu-item-row { display: flex; justify-content: space-between; align-items: center; }
.menu-price { font-size: 17px; font-weight: 600; color: var(--saffron); }
.portions-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--mint-light); color: #0A5A46; font-weight: 600;
}
.portions-badge.low { background: #FFF3E0; color: #E65100; }
.portions-badge.out { background: var(--danger-light); color: var(--danger); }

/* ── FOOD CARD (customer view) ── */
.food-card {
  margin: 0 20px 12px; padding: 14px;
  display: flex; gap: 14px; align-items: flex-start;
}
.food-emoji {
  font-size: 38px; flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border-radius: var(--r-sm);
}
.food-info { flex: 1; min-width: 0; }
.food-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.food-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.food-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.food-price-wrap .food-price { font-size: 17px; font-weight: 600; color: var(--saffron); }
.food-price-wrap .food-serves { font-size: 11px; color: var(--text-muted); }

/* Quantity controls */
.add-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--saffron); color: var(--white); border: none;
  font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 300; transition: all 0.15s; line-height: 1;
}
.add-btn:active { background: var(--saffron-dark); transform: scale(0.92); }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cream-dark); border: 1px solid var(--border);
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--clay); transition: background 0.15s; line-height: 1;
}
.qty-btn:active { background: var(--cream); }
.qty-num { font-size: 15px; font-weight: 600; color: var(--clay); min-width: 20px; text-align: center; }

/* ── CART BAR ── */
#cart-bar {
  display: none;
  margin: 0 20px 16px;
}
.cart-bar-inner {
  background: var(--saffron); border-radius: var(--r-md);
  padding: 14px 16px; display: flex;
  justify-content: space-between; align-items: center;
  cursor: pointer; box-shadow: 0 4px 16px rgba(232,101,10,0.3);
  transition: background 0.15s;
}
.cart-bar-inner:active { background: var(--saffron-dark); }
.cart-info-count { font-size: 13px; color: rgba(255,255,255,0.8); }
.cart-info-total { font-size: 18px; font-weight: 600; color: var(--white); }
.cart-arrow { color: var(--white); font-size: 20px; }

/* ── NOTIFICATIONS ── */
.notif-card {
  margin: 0 20px 10px; padding: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.notif-card.unread { border-left: 3px solid var(--saffron); background: var(--saffron-light); border-radius: 0 var(--r-md) var(--r-md) 0; }
.notif-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--cream-dark); display: flex;
  align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.notif-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.notif-body { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── PROFILE ── */
.profile-hero {
  padding: 28px 20px 24px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  margin: 0 auto 12px; display: flex;
  align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 26px;
  color: var(--white); border: 3px solid var(--white);
  box-shadow: var(--shadow-md);
}
.profile-name { font-family: 'Fraunces', serif; font-size: 22px; color: var(--clay); margin-bottom: 3px; }
.profile-role { font-size: 13px; color: var(--text-muted); }
.profile-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.profile-item:active { background: var(--cream); }
.profile-item-icon { font-size: 20px; width: 28px; text-align: center; }
.profile-item-text { flex: 1; }
.profile-item-label { font-size: 15px; color: var(--text-primary); font-weight: 500; }
.profile-item-sub { font-size: 12px; color: var(--text-muted); }
.profile-arrow { color: var(--text-muted); font-size: 18px; }

/* ── RATING STARS ── */
.stars-row { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.star { font-size: 40px; cursor: pointer; transition: transform 0.2s; filter: grayscale(1) opacity(0.3); }
.star.active { filter: none; transform: scale(1.1); }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--r-sm);
  padding: 24px; text-align: center; background: var(--white);
  cursor: pointer; transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { background: var(--saffron-light); border-color: var(--saffron); }
.upload-zone-icon { font-size: 30px; margin-bottom: 8px; }
.upload-zone-text { font-size: 13px; color: var(--text-muted); }
.upload-zone-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.upload-preview { width: 100%; height: 140px; object-fit: cover; border-radius: var(--r-sm); display: none; }

/* ── MEAL TYPE CHIPS ── */
.meal-chips { display: flex; gap: 8px; padding: 12px 20px 4px; overflow-x: auto; }
.meal-chips::-webkit-scrollbar { display: none; }
.meal-chip {
  flex-shrink: 0; padding: 8px 16px; border-radius: 40px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--text-muted); transition: all 0.2s; white-space: nowrap;
}
.meal-chip.active { background: var(--saffron); color: var(--white); border-color: var(--saffron); }
.meal-chip.closed { opacity: 0.55; cursor: pointer; }  /* FIX 8: always clickable */
.meal-chip .chip-sub { font-size: 10px; display: block; font-weight: 400; margin-top: 1px; }

/* ── FILTER CHIPS ── */
.filter-row { display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 7px 16px; border-radius: 40px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--text-secondary); transition: all 0.2s;
}
.filter-chip.active { background: var(--saffron-light); color: var(--saffron); border-color: var(--saffron); }

/* ── RADIUS SLIDER ── */
.radius-wrap { padding: 12px 20px; background: var(--white); border-bottom: 1px solid var(--border); }
.radius-label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.radius-label span { font-size: 13px; color: var(--text-muted); }
.radius-label strong { font-size: 13px; color: var(--clay); }
.radius-slider { width: 100%; accent-color: var(--saffron); }
.radius-ticks { display: flex; justify-content: space-between; margin-top: 4px; }
.radius-ticks span { font-size: 10px; color: var(--text-muted); }

/* ── UPI BOX ── */
.upi-box {
  margin: 0 20px 12px; background: var(--white);
  border-radius: var(--r-md); border: 1px solid var(--border);
  padding: 20px; text-align: center;
}
.upi-qr-placeholder {
  width: 130px; height: 130px; margin: 0 auto 12px;
  background: repeating-conic-gradient(var(--clay) 0% 25%, transparent 0% 50%) 0 0 / 8px 8px;
  border-radius: 10px; border: 3px solid var(--cream-dark);
}
.upi-id { font-size: 15px; font-weight: 600; color: var(--clay); margin-bottom: 4px; }
.upi-note { font-size: 12px; color: var(--text-muted); }

/* ── SUMMARY ── */
.summary-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.summary-label { font-size: 14px; color: var(--text-secondary); }
.summary-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.summary-total { font-size: 19px; font-weight: 600; color: var(--saffron); }

/* ── SUCCESS SCREEN ── */
.success-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 28px; text-align: center; flex: 1;
}
.success-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--mint-light); border: 3px solid var(--mint);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; margin-bottom: 24px;
  animation: popIn 0.4s ease-out;
}
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-title { font-family: 'Fraunces', serif; font-size: 26px; color: var(--clay); margin-bottom: 10px; }
.success-sub { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 28px; }

/* ── MODALS ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: flex-end; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-sheet {
  background: var(--white); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 24px max(24px, env(safe-area-inset-bottom));
  width: 100%; max-width: 480px;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 36px; height: 4px; background: var(--border-mid);
  border-radius: 2px; margin: 0 auto 20px;
}
.modal-title { font-family: 'Fraunces', serif; font-size: 20px; color: var(--clay); margin-bottom: 16px; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 90px;
  left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--clay); color: #FFF8F0;
  padding: 12px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; z-index: 300;
  opacity: 0; transition: all 0.3s; pointer-events: none;
  white-space: nowrap; max-width: calc(100% - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LOADER ── */
#loader {
  display: none; position: fixed; inset: 0;
  background: rgba(253,248,243,0.85); z-index: 400;
  align-items: center; justify-content: center; flex-direction: column; gap: 14px;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--saffron);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.spinner-wrap { padding: 32px; display: flex; align-items: center; justify-content: center; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 52px; margin-bottom: 14px; display: block; }
.empty-title { font-family: 'Fraunces', serif; font-size: 20px; color: var(--clay); margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ── KITCHEN DETAIL CHIPS ── */
.detail-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-chip {
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: var(--cream); color: var(--text-secondary);
  border: 1px solid var(--border); display: flex; align-items: center; gap: 5px;
}

/* ── SAFE AREA PADDING ── */
.safe-bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* ── UTILITY ── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.text-link   { color: var(--saffron); font-weight: 600; cursor: pointer; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── KITCHEN STATUS DOT ── */
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #4CAF50; box-shadow: 0 0 6px #4CAF50;
  flex-shrink: 0;
}
.status-dot.closed { background: #E57373; box-shadow: 0 0 6px #E57373; }

/* ── KITCHEN CARD (customer) ── */
.kitchen-card {
  margin: 0 20px 14px; background: var(--white);
  border-radius: var(--r-lg); border: 1px solid var(--border);
  overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.kitchen-card:active { transform: scale(0.98); }
.kitchen-banner {
  height: 110px; display: flex; align-items: center;
  justify-content: center; font-size: 52px; position: relative;
}
.dist-pill {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.55); color: #FFF;
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}
.verified-pill {
  position: absolute; top: 10px; left: 10px;
  background: var(--mint); color: #FFF;
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.kitchen-body { padding: 12px 14px; }
.kitchen-name { font-family: 'Fraunces', serif; font-size: 16px; color: var(--clay); margin-bottom: 2px; }
.kitchen-chef { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.kitchen-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.kitchen-foot { display: flex; justify-content: space-between; align-items: center; }
.avg-spend { font-size: 12px; color: var(--text-muted); }

/* ── KITCHEN DETAIL ── */
.kitchen-detail-banner {
  height: 180px; display: flex; align-items: center;
  justify-content: center; font-size: 72px;
  background: linear-gradient(135deg, #F5EDE0, var(--cream-dark));
}
.kitchen-detail-info { padding: 16px 20px; background: var(--white); border-bottom: 1px solid var(--border); }
.kitchen-detail-name { font-family: 'Fraunces', serif; font-size: 22px; color: var(--clay); margin-bottom: 4px; }
.kitchen-detail-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.menu-section-title {
  font-family: 'Fraunces', serif; font-size: 16px; color: var(--clay);
  padding: 14px 20px 6px; border-top: 1px solid var(--border); margin-top: 4px;
}

/* Fix viewport for TWA/Android app */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Prevent overscroll bounce */
html, body {
  overscroll-behavior: none;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: fixed;
}

#app {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fix for TWA - ensure app fits screen exactly */
#app { height: 100dvh; min-height: unset; }
