:root {
    --primary: #806836;
    --primary-dark: #5c4a26;
    --accent: #e9078a;
    --confetti-yellow: #fcee1d;
    --confetti-pink: #e9078a;
    --confetti-blue: #29abe2;
    --confetti-green: #aed565;
    --confetti-coral: #f1635f;
    --bg: #f6f5f1;
    --card: #ffffff;
    --text: #2b2b2b;
    --muted: #767267;
    --border: #e2ded4;
    --error: #b3261e;
    --error-bg: #fdecea;
    --success: #3a7d44;
    --success-bg: #e7f2ee;
    --radius: 10px;
  }

  * { box-sizing: border-box; }

  body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px 16px 60px;
  }

  .wrap { max-width: 700px; margin: 0 auto; }
  .wrap.size-large { zoom: 1.15; }
  .wrap.size-xlarge { zoom: 1.3; }

  /* Tablet */
  @media (min-width: 700px) {
    body { padding: 32px 28px 60px; }
    .wrap { max-width: 880px; }
    .wrap.size-large { zoom: 1.25; }
    .wrap.size-xlarge { zoom: 1.5; }
  }

  /* Laptop / desktop - the layout actually widens here rather than just
     scaling the same narrow column up, so there's real breathing room. */
  @media (min-width: 1080px) {
    body { padding: 44px 40px 70px; }
    .wrap { max-width: 1180px; }
    .step:not(.step-wide) { max-width: 640px; margin-left: auto; margin-right: auto; }
  }

  .size-control { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .size-btn {
    padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: #fff; font-size: 13px; cursor: pointer; color: var(--muted);
  }
  .size-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

  .brand-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 4px;
  }
  .brand-logo { height: 56px; width: auto; display: block; flex-shrink: 0; }
  .brand-header-text { min-width: 0; }
  .brand-header-text h1 { margin: 0; }
  .confetti-stripe {
    height: 4px; border-radius: 2px; margin: 12px 0 20px;
    background: linear-gradient(90deg,
      var(--confetti-pink) 0%, var(--confetti-pink) 20%,
      var(--confetti-yellow) 20%, var(--confetti-yellow) 40%,
      var(--confetti-blue) 40%, var(--confetti-blue) 60%,
      var(--confetti-green) 60%, var(--confetti-green) 80%,
      var(--confetti-coral) 80%, var(--confetti-coral) 100%);
  }

  h1 { font-size: 22px; margin: 0 0 4px; color: var(--primary-dark); }
  h2 { font-size: 17px; margin: 0 0 12px; color: var(--primary-dark); }
  .subtitle { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(43,43,43,0.05);
  }

  @media (min-width: 700px) {
    .card { padding: 28px; border-radius: 14px; }
  }

  .steps { display: flex; gap: 6px; margin-bottom: 20px; }
  .step-dot {
    flex: 1; height: 4px; border-radius: 2px; background: var(--border);
  }
  .step-dot.active { background: var(--primary); }
  .step-dot.done { background: var(--accent); }

  label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
  label.inline { display: inline-block; margin: 0; }

  input[type=text], input[type=email], input[type=date], input[type=time],
  select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
  }
  textarea { resize: vertical; min-height: 44px; }

  .row { display: flex; gap: 12px; }
  .row > * { flex: 1; }

  .btn {
    display: inline-block; padding: 11px 20px; border-radius: 8px; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
  }
  .btn-primary { background: var(--primary); color: #fff; }
  .btn-primary:hover { background: var(--primary-dark); }
  .btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
  .btn-danger { background: #fff; color: var(--error); border: 1px solid var(--error); }
  .btn-link { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: 6px 0; }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .btn-row { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }

  .category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .cat-tab {
    padding: 6px 12px; border-radius: 20px; background: #fff; border: 1px solid var(--border);
    font-size: 13px; cursor: pointer; color: var(--muted);
  }
  .cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

  .menu-item {
    display: flex; flex-direction: column;
    border-bottom: 1px solid var(--border);
    padding: 0 0 14px;
  }
  .menu-item:last-child { border-bottom: none; }
  .menu-item-preview-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 14px; grid-column: 1 / -1;
  }
  .menu-item input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; }
  .qty-stepper { display: flex; align-items: center; gap: 8px; }
  .qty-btn {
    width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
    background: #fff; color: var(--primary); font-size: 17px; font-weight: 700;
    line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .qty-btn:hover { background: var(--bg); }
  .qty-btn:active { background: var(--border); }
  .qty-value { min-width: 20px; text-align: center; font-weight: 600; font-size: 14.5px; }
  .option-group-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
  .option-group-row input { flex: 1; }

  .menu-item-img-wrap {
    width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg);
    border-radius: 10px; margin-bottom: 10px;
  }
  .menu-item-img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .menu-item-body { padding: 0 2px; }
  .menu-item-name { font-weight: 600; font-size: 15px; }
  .menu-item-desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
  .menu-item-price { color: var(--accent); font-weight: 700; font-size: 14px; margin-top: 4px; }
  .menu-item-extra { margin-top: 10px; }
  .menu-item-extra input { margin-bottom: 6px; }
  .menu-item-footer { display: flex; justify-content: flex-end; padding: 8px 2px 0; }
  .unit-options-label { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
  .og-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
  .og-select {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px; background: #fff;
  }

  /* On tablet and up, the menu becomes a grid of proper item cards instead
     of a single narrow stacked list, so it actually uses the wider layout
     rather than just leaving empty space either side. */
  @media (min-width: 700px) {
    #menuList { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .menu-item {
      border: 1px solid var(--border); border-radius: 12px; padding: 14px;
    }
    .menu-item:last-child { border-bottom: 1px solid var(--border); }
    .menu-item-img-wrap { margin: -14px -14px 12px; width: calc(100% + 28px); border-radius: 12px 12px 0 0; }
    .menu-item-name { font-size: 16px; }
    .menu-item-desc { font-size: 14px; }
  }

  @media (min-width: 1080px) {
    #menuList { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  }

  .menu-type-options { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
  .menu-type-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 16px 18px; border-radius: 10px; border: 1px solid var(--border);
    background: #fff; cursor: pointer; text-align: left;
  }
  .menu-type-btn:hover { border-color: var(--primary); background: var(--bg); }
  .menu-type-title { font-weight: 700; font-size: 16px; color: var(--primary-dark); }
  .menu-type-desc { font-size: 13px; color: var(--muted); }

  @media (min-width: 700px) {
    .menu-type-options { flex-direction: row; flex-wrap: wrap; gap: 14px; }
    .menu-type-btn { flex: 1 1 220px; }
  }

  .badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  }
  .badge-active { background: var(--success-bg); color: var(--success); }
  .badge-cancelled { background: var(--error-bg); color: var(--error); }
  .badge-completed { background: var(--border); color: var(--muted); }

  .banner-error {
    background: var(--error-bg); color: var(--error); border-radius: 8px;
    padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px;
  }
  .banner-success {
    background: var(--success-bg); color: var(--success); border-radius: 8px;
    padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px;
  }

  .booking-summary-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; }
  .booking-summary-label { color: var(--muted); }
  .booking-summary-total {
    font-weight: 700; font-size: 15px; margin-top: 8px; padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
  th { color: var(--muted); font-weight: 600; }

  .tabbar { display: flex; gap: 6px; margin-bottom: 20px; }
  .tabbar button {
    flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted);
  }
  .tabbar button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

  .spinner { text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
  .muted { color: var(--muted); font-size: 13px; }
  .hidden { display: none !important; }

  .modal-overlay {
    position: fixed; inset: 0; background: rgba(43,43,43,0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 1000;
  }
  .modal-card {
    background: var(--card); border-radius: var(--radius);
    padding: 24px; max-width: 420px; width: 100%;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  }
  .modal-card h2 { margin-top: 0; }

  .calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center;
    font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px;
  }
  /* minmax(0, 1fr) rather than plain 1fr - without the explicit 0 floor, a
     CSS Grid track's minimum width defaults to its content's own minimum
     size, so a day cell holding two non-shrinking icon badges could force
     that whole column (and so the whole grid, and so the whole page on a
     narrow phone) wider than the screen instead of the badges wrapping or
     shrinking to fit. */
  .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .calendar-day {
    aspect-ratio: 1; border-radius: 8px; background: var(--bg);
    padding: 3px; min-width: 0; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    cursor: pointer;
  }
  .calendar-day:hover { background: var(--border); }
  .calendar-today { outline: 2px solid var(--primary); }
  .calendar-day-num { font-size: 12px; color: var(--text); }
  .calendar-day-dots { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; justify-content: center; }
  .cal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--dot-color, var(--muted)); }
  .cal-dot-cancelled { background: transparent; border: 1.5px solid var(--dot-color, var(--muted)); box-sizing: border-box; }
  .calendar-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
  .calendar-legend .cal-dot { margin-right: 4px; }

  /* Below ~420px (most phones in portrait), the menu-type icon badges
     (see Booking.html's menuTypeIconSvg_) are shrunk further so 2-3 of
     them still comfortably fit one calendar cell without needing the
     grid-width safety net above to kick in at all. */
  @media (max-width: 420px) {
    .calendar-day-num { font-size: 10px; }
    .calendar-day-dots svg { width: 13px !important; height: 13px !important; }
  }
