:root {
  --bg-top: #1f56a3;
  --bg-bottom: #163f7c;
  --text: #ffffff;
  --muted: #d6e4ff;
  --card: #ffffff;
  --card-text: #12233d;
  --card-muted: #4f6380;
  --line: #e3e9f3;
  --accent: #ffb020;
  --accent-text: #12233d;
  --error: #ffd1d1;
}

* { box-sizing: border-box; }
html { background: var(--bg-bottom); }
body {
  margin: 0 auto;
  padding: 16px 16px 120px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom)) fixed;
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 640px;
}
h1 { font-size: 1.45rem; margin: 8px 0 4px; }
.logo { display: block; margin: 6px auto 0; width: 72px; height: 72px; border-radius: 16px; }
h2 { font-size: 1.1rem; margin: 0 0 4px; }
.muted { color: var(--muted); margin: 0 0 12px; }
.error { color: var(--error); min-height: 1.2em; margin: 8px 0 0; }

#cuisines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
/* Each cuisine sets its own --c color from app.js. */
.cuisine {
  --c: #6b7280;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px;
  background: var(--c); color: #ffffff;
  border: 3px solid transparent; border-radius: 14px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform .1s;
}
.cuisine:active { transform: scale(.96); }
.cuisine .icon { font-size: 1.6rem; text-shadow: none; }
/* Long cuisine names in some languages wrap inside the button instead of spilling out. */
.cuisine span:last-child { max-width: 100%; text-align: center; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.cuisine[aria-pressed="true"] { border-color: #ffffff; box-shadow: 0 0 0 3px var(--c), 0 4px 12px rgba(0, 0, 0, .3); }

#restaurants, #favorite-list:not(:empty) {
  background: var(--card); color: var(--card-text);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
#restaurants > .muted { color: var(--card-muted); padding: 12px 10px; margin: 0; }
.restaurant {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--card-text); text-decoration: none;
}
.restaurant:last-child { border-bottom: none; }
.restaurant .icon { font-size: 1.3rem; }
.restaurant .name { flex: 1; font-weight: 600; }
.restaurant .go { color: #1f56a3; font-weight: 600; font-size: .9rem; }
.restaurant.find { color: #1f56a3; font-weight: 600; background: #f1f5fd; }
#restaurants > .muted { color: var(--card-muted); }
.near-btn { display: block; width: calc(100% - 20px); margin: 10px; padding: 13px; font-size: 1.05rem; }
.near-btn:disabled { opacity: .6; }
.near-title { font-size: 1rem; margin: 6px 10px 2px; color: var(--card-text); }
.near-item { padding: 10px; border-bottom: 1px solid var(--line); color: var(--card-text); }
.near-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.near-head .dist { color: var(--card-muted); font-weight: 400; white-space: nowrap; }
.near-addr { color: var(--card-muted); font-size: .9rem; margin-top: 2px; }
.near-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { display: inline-block; padding: 7px 11px; border-radius: 999px; background: #e8effa; color: #1f56a3; font-weight: 600; font-size: .9rem; text-decoration: none; border: none; }
.pill.save { background: var(--accent); color: var(--accent-text); }
.pill.save:disabled { background: #dcfce7; color: #166534; }
.credit { display: block; padding: 6px 10px; font-size: .75rem; color: var(--card-muted); text-align: end; }
#search { margin-top: 8px; border-radius: 12px; padding: 11px 12px; }
.region { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); }
.region select, .language select { width: auto; padding: 6px 8px; }
.language { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: .85rem; }

#favorites { margin-top: 32px; padding-top: 16px; border-top: 2px solid rgba(255, 255, 255, .25); }
.fav-toggle { width: 100%; padding: 12px; margin-bottom: 12px; text-align: start; font-size: 1.1rem; }
#favorite-list { list-style: none; padding: 0; margin: 0 0 12px; }
#favorite-list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
#favorite-list li:last-child { border-bottom: none; }
#favorite-list .restaurant { flex: 1; border-bottom: none; }
.tip { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 176, 32, .18); border-inline-start: 4px solid var(--accent); }
.remove { background: none; color: var(--card-muted); border: none; font-size: .9rem; padding: 8px 12px; cursor: pointer; }

button {
  padding: 9px 14px; border-radius: 10px; border: none;
  background: var(--accent); color: var(--accent-text);
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
button.secondary { background: rgba(255, 255, 255, .2); color: var(--text); }
.plus { width: 100%; padding: 12px; }
.row { display: flex; gap: 8px; }

form {
  display: grid; gap: 8px; margin-top: 12px;
  background: rgba(255, 255, 255, .12); padding: 14px; border-radius: 14px;
}
label { display: grid; gap: 4px; font-size: .9rem; }
.door-help { font-size: .78rem; opacity: .8; }
input, select {
  padding: 9px; font-size: 16px; /* 16px stops iPhone Safari from zooming in when typing */
  border: 1px solid var(--line); border-radius: 8px;
  background: #ffffff; color: var(--card-text);
  width: 100%;
}

.banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px;
  background: var(--card); color: var(--card-text);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  max-width: 616px; margin-inline: auto;
}
.banner button.secondary { background: var(--line); color: var(--card-text); }
.banner[hidden] { display: none; }

/* ── Restaurant page inside the app + courier pickup bar ──
   The page area ends where the bar begins, so the bar never covers the site's own Checkout button. */
body.locked { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  background: #ffffff; color: var(--card-text);
}
.viewer[hidden], .sheet-back[hidden] { display: none; }
.viewer-top {
  display: flex; align-items: center; gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  background: var(--bg-bottom); color: var(--text);
}
.viewer-name { flex: 1; min-width: 0; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-btn { padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .18); color: var(--text); font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.viewer-page { position: relative; flex: 1; min-height: 0; overflow: auto; }
.viewer-page iframe { display: block; width: 100%; height: 100%; border: 0; }
.viewer-page iframe[hidden] { display: none; }
.viewer-note { padding: 24px 18px; text-align: center; color: var(--card-muted); }
.viewer-note[hidden] { display: none; }
.viewer-note p { margin: 0 0 14px; }
.viewer-open { display: inline-block; margin: 4px 0 16px; padding: 13px 18px; border-radius: 12px; background: #1f56a3; color: #ffffff; font-weight: 700; text-decoration: none; }
.small { font-size: .85rem; }
.pickup-bar {
  position: relative; z-index: 1001;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #4f86c6; color: #ffffff; font-weight: 600;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .18);
}
.pickup-bar[hidden], .pickup-blocked[hidden] { display: none; }
.pickup-blocked {
  margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #e2e8f0; color: var(--card-text); font-size: .9rem; font-weight: 600; text-align: center;
}
.pickup-btn {
  padding: 11px 14px; border-radius: 999px;
  background: #e8732a; color: #ffffff; font-size: .9rem; font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}
.pickup-btn:disabled { opacity: .7; }

.sheet-back {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .45);
}
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow: auto;
  margin: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #ffffff; color: var(--card-text);
  transform: translateY(100%); transition: transform .25s ease-out;
}
.sheet-back.open .sheet { transform: translateY(0); }
.sheet h2 { margin: 0 0 6px; }
.sheet-box { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: #f1f5fd; }
.sheet-strong { font-weight: 700; }
.sheet input:disabled { background: #f1f5f9; color: var(--card-muted); }
.sheet-fee { padding: 10px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; }
.sheet-fee[hidden], .sheet-done[hidden] { display: none; }
.fee-line { font-size: 1.1rem; }
.fee-rule { color: var(--card-muted); }
.fee-value { margin-top: 6px; font-weight: 700; color: #166534; }
.fee-total { margin-top: 4px; font-weight: 700; }
.food-notice { margin: 8px 0 0; color: var(--card-muted); }
.pay-note { margin: 8px 0 0; font-weight: 700; color: #9a3412; }
.sheet-error { color: #b91c1c; min-height: 1.2em; margin: 0; }
.sheet-done { padding: 10px; border-radius: 10px; background: #dcfce7; color: #166534; }
.sheet-done p { margin: 0 0 6px; }
.sheet-status { font-weight: 700; }
.sheet-done > .sheet-cancel { margin-top: 6px; }
.cancel-ask { margin-top: 8px; padding: 10px; border-radius: 10px; background: #fff7ed; color: #7c2d12; }
.cancel-ask p { margin: 0 0 8px; }
.sheet .row .pickup-btn { flex: 1; }
.return-box {
  width: 100%; max-width: 640px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #ffffff; color: var(--card-text);
}
.return-box h2 { margin: 0 0 6px; }
.return-box p { margin: 0 0 14px; color: var(--card-muted); }
.return-box .row button { flex: 1; padding: 13px 10px; }
.sheet-cancel { background: var(--line); color: var(--card-text); }

.pass-box { margin-top: 18px; color: var(--muted); }
.pass-box summary { cursor: pointer; padding: 8px 0; font-size: .9rem; }
.pass-box form { margin-top: 6px; }
.pass-box p { margin: 0; }
.pass-show { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.pass-show input { width: 20px; height: 20px; margin: 0; }
.restaurant-join { display: block; margin-top: 28px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .14); color: var(--text); font-weight: 700; text-align: center; text-decoration: none; border: 2px solid rgba(255, 255, 255, .35); }

/* ── Ordering from a partner restaurant's menu ── */
.restaurant.partner .go { color: #e8732a; }
.partner-head { font-size: .85rem; font-weight: 700; color: #e8732a; background: #fff7ed; padding: 8px 10px; margin: 0; }
.pill.order-here { background: #e8732a; color: #ffffff; cursor: pointer; }
.menu-spacer { visibility: hidden; }
/* The menu is a centered, phone-width column (easy to read on a laptop too), with larger text than the rest of the app. */
#menu-view .viewer-page { background: #eef2f7; }
#menu-view .viewer-name { font-size: 1.1rem; }
.menu-column { max-width: 640px; min-height: 100%; margin: 0 auto; background: #ffffff; font-size: 17px; }
.menu-address { margin: 0; padding: 12px 16px 0; color: var(--card-muted); font-size: .95em; }
.menu-error { padding: 0 16px; }
.menu-section { margin: 18px 16px 4px; font-size: 1.25em; }
.menu-item { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.menu-item img { width: 96px; height: 96px; flex: none; border-radius: 12px; object-fit: cover; background: var(--line); }
.menu-item .info { flex: 1; min-width: 0; }
.menu-item .name { font-weight: 700; font-size: 1.1em; }
.menu-item .desc { color: var(--card-muted); font-size: .9em; margin: 3px 0 6px; }
.menu-item .price { font-weight: 700; font-size: 1.05em; }
.menu-item .qty { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.menu-item .qty button { min-width: 48px; padding: 10px 14px; font-size: 1.1em; }
.menu-item .qty .count { font-weight: 700; font-size: 1.15em; min-width: 1.5em; text-align: center; }
/* The cart bar lines up with the centered menu and uses larger text. */
#cart-bar { padding-inline: max(14px, calc((100% - 640px) / 2 + 14px)); font-size: 1.1rem; }
#cart-bar .pickup-btn { font-size: 1.05rem; padding: 13px 22px; }
/* Checkout and order status: larger text too. */
#order-sheet { font-size: 17px; }
#order-sheet h2 { font-size: 1.3rem; }
#order-sheet .pickup-btn, #order-sheet .sheet-cancel { font-size: 1.05rem; padding: 14px; }
.order-line { display: flex; justify-content: space-between; gap: 8px; }
.order-line.total { font-weight: 700; border-top: 1px solid #c7d6ee; padding-top: 6px; margin-top: 4px; }
#order-form-part { display: grid; gap: 8px; }
#order-form-part[hidden], #order-status[hidden] { display: none; }
