:root {
  --bg: #0f0f10;
  --card: #1c1c1e;
  --card2: #252528;
  --text: #f5f5f7;
  --muted: #9a9aa0;
  --accent: #3dd68c;
  --accent-dim: #2a9d66;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #0f0f10 url('/img/page_bg.jpg') center top / cover no-repeat fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
#app {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 12px 16px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  position: relative;
  background: transparent;
}
#app.home-mode {
  padding: 0;
  max-width: 100%;
  width: 100%;
}
#app.home-mode .top { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}
.logo { height: 44px; width: auto; border-radius: 10px; }
.icon-btn {
  background: var(--card);
  border: none;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
}
.dropdown {
  position: absolute;
  right: 16px;
  top: 64px;
  z-index: 40;
  background: var(--card);
  border: 1px solid #333;
  border-radius: 14px;
  min-width: 220px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
#app.home-mode .dropdown { top: max(64px, env(safe-area-inset-top) + 48px); right: 12px; }
.dropdown.hidden, .dropdown-backdrop.hidden, .view.hidden, .toast.hidden, .cookie-banner.hidden { display: none !important; }
.dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border: none; background: transparent;
  color: var(--text); font-size: .95rem; font-weight: 600; cursor: pointer;
}
.dropdown-item + .dropdown-item { border-top: 1px solid #2a2a2e; }
.dropdown-backdrop { position: fixed; inset: 0; z-index: 30; }

.view-home { margin: 0; padding: 0; width: 100%; }
.home-hero {
  position: relative;
  width: 100%;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
  background: #0a0a0a;
}
.home-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}
.btn-order-hit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 18%;
  min-height: 72px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 5;
}
.btn-menu-hit {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 8px;
  width: 72px;
  height: 72px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 120;
  -webkit-tap-highlight-color: transparent;
}

h2 { margin: 0 0 12px; font-size: 1.25rem; }
.muted { color: var(--muted); font-size: .92rem; margin: 0 0 14px; }
.back {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.4rem; padding: 0 8px 8px 0; cursor: pointer;
}
.calendar { display: flex; flex-direction: column; gap: 12px; }
.day-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid #2a2a2e; overflow: hidden; padding: 0;
  text-align: left; color: inherit; font: inherit; width: 100%; cursor: pointer;
}
.day-card img { width: 96px; height: 96px; object-fit: cover; display: block; background: var(--card2); }
.day-card .body { padding: 10px 12px 10px 0; display: flex; flex-direction: column; justify-content: center; }
.day-card .dtitle { font-size: 0.95rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.day-card .dmeta {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  color: #f5f5f7 !important;
  margin: 6px 0 !important;
}
.day-card .dprice { color: var(--accent); font-weight: 700; margin-top: 4px; }
.day-card .badge {
  display: inline-block; margin-top: 6px;
  background: rgba(61,214,140,.15); color: var(--accent);
  font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 8px;
}
.dish-photo {
  width: 100%; border-radius: var(--radius); aspect-ratio: 4/3;
  object-fit: cover; margin-bottom: 12px;
}
#dish-date {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  color: #f5f5f7 !important;
}
.price { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.field {
  display: flex; flex-direction: column; gap: 6px;
  margin: 14px 0; font-weight: 600; font-size: .95rem;
}
.field input, .field select, textarea {
  background: var(--card2); border: 1px solid #333; border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-size: 1rem; font-weight: 400;
  width: 100%; font-family: inherit;
}
.label { margin: 12px 0 8px; font-weight: 600; }
.slots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.slot {
  flex: 1; min-width: 90px; padding: 12px; border-radius: 12px;
  border: 1px solid #333; background: var(--card); color: var(--text);
  font-weight: 600; cursor: pointer;
}
.slot.active {
  border-color: var(--accent); background: rgba(61,214,140,.12); color: var(--accent);
}
.summary {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  margin-bottom: 12px; line-height: 1.5; border: 1px solid #2a2a2e;
}
.code { font-size: 1.5rem; font-weight: 800; text-align: center; margin: 8px 0 16px; }
.pay-box {
  background: var(--card2); border-radius: 12px; padding: 14px;
  white-space: pre-wrap; margin: 12px 0; border: 1px dashed #444;
  font-size: .95rem; line-height: 1.45;
}
.btn {
  display: block; width: 100%;
  padding: 14px 18px; border-radius: 14px;
  border: 1px solid #333; background: var(--card);
  color: var(--text); font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none; color: #0a1a12;
}
.btn.secondary { margin: 8px 0 14px; }
.btn:disabled { opacity: .4; }
.btn.danger {
  background: transparent; border-color: #664444; color: #ff8a8a;
  margin-top: 8px; padding: 10px; font-size: .9rem;
}
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-weight: 600; }
.check input { width: 20px; height: 20px; }
.order-row {
  background: var(--card); border-radius: 14px; padding: 14px;
  border: 1px solid #2a2a2e; margin-bottom: 10px;
}
.order-row .st { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* legal: full width of screen, NO dark panel */
#view-legal {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}
#view-legal h2 {
  width: 100%;
  margin: 0 0 12px;
}
#legal-body,
#legal-body.legal,
.legal {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  line-height: 1.6;
  color: #f0f0f0;
}

.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #1a1a1d; border-top: 1px solid #333;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.cookie-banner p { margin: 0 0 12px; font-size: .95rem; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #222; color: #fff; padding: 12px 18px; border-radius: 12px;
  z-index: 50; max-width: 90%;
}

.order-card {
  background: var(--card);
  border: 1px solid #2a2a2e;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
}
.order-card .oc-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.order-card .oc-body { padding: 12px 14px; }
.order-card .oc-code { font-size: 1.15rem; display: block; margin-bottom: 8px; }
.order-card .oc-date { font-size: 1.15rem; font-weight: 800; }
.order-card .oc-line { margin-bottom: 8px; line-height: 1.4; }
.order-card .oc-actions { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
#legal-body, .legal {
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  line-height: 1.65;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #3a3a3e;
  background: #252528;
  color: #f5f5f7;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.logo { cursor: pointer; }
#orders-empty.hidden { display: none !important; }

/* MENU-HOME-FIX */
#app.home-mode .dropdown {
  position: fixed !important;
  top: max(72px, calc(env(safe-area-inset-top) + 64px)) !important;
  right: 12px !important;
  z-index: 130 !important;
}
#app.home-mode .dropdown-backdrop {
  position: fixed !important;
  z-index: 125 !important;
}
.home-hero {
  z-index: 1;
  position: relative;
}
