/* Jikoba Table Order v104 — customer tablet stylesheet
   One clean stylesheet for the customer page (index.html). It replaces the
   customer part of style.css + typography.css, which had grown to thousands of
   conflicting !important overrides. No transform:scale(), no fixed canvas:
   text is rendered at its real size so it stays sharp on the tablet. */

@font-face { font-family: "Jikoba Sans"; src: url("/static/fonts/NanumSquareR.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jikoba Sans"; src: url("/static/fonts/NanumSquareB.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --font: "Jikoba Sans", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --ink: #1f1a15;
  --ink-soft: #4a4036;
  --muted: #7a6f62;
  --line: #e6ddd0;
  --bg: #f4efe6;
  --paper: #ffffff;
  --header: #191613;
  --accent: #e6321d;
  --accent-2: #ff7419;
  --accent-grad: linear-gradient(135deg, #e6321d 0%, #ff7419 100%);
  --gold: #a56f32;
  --radius: 16px;
  --vh: var(--actual-vh, 100vh);

  /* type scale — tuned for an Android tablet in landscape (~1280–1340px wide) */
  --fs-base: 18px;
  --fs-small: 16px;
  --fs-header-brand: 24px;
  --fs-header-btn: 27px;   /* 1.5x of v104 first draft (18px) */
  --fs-category: 24px;     /* v104: larger category names on the tablet */
  --fs-section: 28px;
  --fs-menu-name: 24px;
  --fs-menu-price: 22px;
  --fs-cart-title: 24px;
  --fs-cart-item: 19px;
  --fs-total: 28px;
  --fs-button: 22px;
  --fs-sheet-title: 28px;

  --header-h: 100px;
  --nav-w: 190px;
  --cart-w: 330px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  overflow: hidden;            /* nothing may be wider than the screen (prevents WebView zoom-out) */
  background: var(--bg);
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.45;
  color: var(--ink);
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
img { display: block; max-width: 100%; }
.hide { display: none !important; }
.muted { color: var(--muted); }

/* ───────── Header ───────── */
.customer-header {
  height: var(--header-h);
  padding: 0 20px;
  background: var(--header);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; height: 100%; }
.brand-logo { height: calc(var(--header-h) - 18px); width: auto; flex: none; -webkit-user-drag: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand b { font-size: var(--fs-header-brand); font-weight: 700; line-height: 1.2; white-space: nowrap; }
.brand small { font-size: 14px; color: #d9b98a; letter-spacing: .5px; margin-top: 2px; white-space: nowrap; }
/* Spacing between header buttons uses margin, not `gap`: older phone WebViews
   (< Chrome 84, e.g. some Galaxy S9+) ignore `gap` in flex rows and the buttons touched. */
.header-actions { display: flex; align-items: center; flex-wrap: nowrap; --hbtn-space: 10px; }
.header-actions > * + * { margin-left: var(--hbtn-space); }
.history-open, .fixed-table-label {
  height: 78px; padding: 0 26px;            /* 1.5x of 52px / 18px */
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 16px;
  font-size: var(--fs-header-btn); font-weight: 700; white-space: nowrap;
}
.history-open { border: 0; background: #f4efe6; color: var(--ink); }
.history-open:active { transform: translateY(1px); background: #e8dfd1; }
.fixed-table-label { background: transparent; color: #ffd9a8; border: 2px solid #d9a35f; }

/* ───────── Main 3-column layout ───────── */
.tablet-layout {
  height: calc(var(--vh) - var(--header-h));
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--cart-w);
}

/* Category navigation */
.category-nav {
  background: var(--header);
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
}
.category-btn {
  flex: 1 1 0;              /* buttons share the full column height evenly, top to bottom */
  min-height: 64px; padding: 10px 8px;
  border: 0; border-radius: 12px;
  background: transparent; color: #e9e1d5;
  font-size: var(--fs-category); font-weight: 700; line-height: 1.25;
  word-break: keep-all; text-align: center;
}
.category-btn.active { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px rgba(230, 50, 29, .35); }
/* no tap flash, no press effect, no focus ring on category buttons */
.category-btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: none; outline: none; -webkit-user-select: none; user-select: none; }
.category-btn:focus, .category-btn:focus-visible, .category-btn:active { outline: none; transform: none; filter: none; }

/* Menu catalog */
.catalog { overflow-y: auto; overflow-x: hidden; padding: 16px 18px 40px; scroll-behavior: smooth; }
.menu-section { margin-bottom: 28px; scroll-margin-top: 8px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 4px 14px; }
.section-heading h2 { margin: 0; font-size: var(--fs-section); font-weight: 700; line-height: 1.25; }
.section-heading span { font-size: var(--fs-small); color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(40, 28, 15, .08);
  cursor: pointer;
}
.card:active { transform: scale(.985); }
/* Photo box with a fixed 4:3 shape. Not `aspect-ratio`: old Android WebViews
   (< Chrome 88) ignore it, and every photo then showed at its own file size.
   The padding-top trick works everywhere: height = 75% of the card width. */
.photo { position: relative; flex: none; height: 0; padding-top: 75%; background: #f1ece4; overflow: hidden; }
.photo > img, .photo > .noimg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; }
.photo > img { object-fit: cover; }
.photo > img.white-bg-image { object-fit: contain; background: #fff; }
/* Drinks: bottles stand on a common baseline at their real relative height
   (the img height % is set inline by customer.js, relative to the photo box) */
.bottle-photo { background: #fff; }
/* The supplier bottle photos are squashed (some only 2.5× taller than wide).
   Real PET bottles (500ml and 1.25L) are ≈3.25× taller than wide, so draw them at that shape. */
.photo > .bottle-img { top: auto; bottom: 3%; left: 50%; width: auto; max-width: 70%; transform: translateX(-50%); object-fit: fill; }
@supports (aspect-ratio: 1 / 1) { .photo > .bottle-img { aspect-ratio: 1 / 3.25; } }
.bottle-size {
  position: absolute; top: 10px; right: 10px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--ink); color: #fff;
  font-size: 18px; font-weight: 700;
}
.bottle-size.big { background: var(--accent); font-size: 20px; }
.noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: #c2b29b; }
.info { position: relative; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.info b {
  font-size: var(--fs-menu-name); font-weight: 700; line-height: 1.3;
  word-break: keep-all; overflow-wrap: break-word;
  padding-right: 4px;
}
.info span { font-size: var(--fs-menu-price); font-weight: 700; color: var(--ink-soft); margin-top: auto; padding-right: 56px; }
.add-menu {
  position: absolute; right: 14px; bottom: 12px;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 30px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.store-closed-message, .table-lock-error {
  margin: 60px auto; max-width: 560px; padding: 32px; text-align: center;
  background: var(--paper); border-radius: var(--radius);
  font-size: 22px; display: flex; flex-direction: column; gap: 10px;
}
.table-lock-error { grid-column: 1 / -1; }

/* ───────── Cart panel ───────── */
.cart-panel { background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-panel-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.cart-panel-head h2 { margin: 0; font-size: var(--fs-cart-title); font-weight: 700; }
#cartCount {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px;
  background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.cart-panel-items { flex: 1; overflow-y: auto; padding: 10px 16px; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 40px; font-size: var(--fs-cart-item); }
.cart-line { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.cart-line-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cart-line-top b { font-size: var(--fs-cart-item); font-weight: 700; line-height: 1.3; word-break: keep-all; }
.cart-line-top strong { font-size: var(--fs-cart-item); white-space: nowrap; }
.cart-options { margin-top: 6px; font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.45; }
.cart-line-controls { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-small); }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty-control button { width: 48px; height: 46px; border: 0; background: #f6f1e9; font-size: 24px; font-weight: 700; }
.qty-control b { min-width: 44px; text-align: center; font-size: 20px; }
.line-buttons { display: inline-flex; align-items: center; }
.line-buttons > * + * { margin-left: 8px; }   /* margin, not gap: old WebViews */
.edit-line { height: 46px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font-size: 17px; font-weight: 700; }
.remove-line { height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--accent); font-size: 17px; font-weight: 700; }

.cart-panel-bottom { padding: 14px 18px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cart-panel-bottom label { font-size: var(--fs-small); font-weight: 700; }
#note {
  width: 100%; height: 64px; resize: none; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbf8f3;
  font-size: 17px; line-height: 1.4;
}
/* v105: no 요청사항 box on the tablet either (phones already hid it). The textarea
   stays in the page (hidden) so the order code keeps working with an empty note. */
.cart-panel-bottom label[for="note"], #note { display: none; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.cart-total b { font-size: 20px; }
.cart-total strong { font-size: var(--fs-total); color: var(--accent); font-weight: 700; }
.hint { margin: 0; font-size: 15px; color: var(--muted); }

.primary {
  width: 100%; min-height: 64px; border: 0; border-radius: 14px;
  background: var(--accent-grad); color: #fff;
  font-size: var(--fs-button); font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(230, 50, 29, .28);
}
.primary:disabled { opacity: .55; box-shadow: none; }
.primary:active:not(:disabled) { transform: translateY(1px); }

/* ───────── Modals ───────── */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40;   /* not `inset`: old Android WebViews (< Chrome 87) ignore it and the popup lands off-screen */
  background: rgba(20, 14, 8, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.sheet {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(var(--vh) - 40px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px;
  padding: 28px 30px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.sheet h2 { margin: 0 56px 10px 0; font-size: var(--fs-sheet-title); font-weight: 700; line-height: 1.3; }
.sheet h3 { margin: 0 56px 6px 0; font-size: 28px; font-weight: 700; line-height: 1.3; }
.sheet p { font-size: var(--fs-base); line-height: 1.55; }
.x {
  position: absolute; top: 16px; right: 16px;
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: #f1ebe2; font-size: 30px; line-height: 1; color: var(--ink);
}

/* Option step modal */
#detail > .muted { margin: 0 0 14px; font-size: var(--fs-base); }
.option-step-progress { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: var(--fs-small); color: var(--muted); }
.option-step-progress span:first-child { background: var(--ink); color: #fff; padding: 4px 12px; border-radius: 20px; font-weight: 700; }
.optgroup strong { display: block; font-size: 22px; margin-bottom: 10px; }
.option-step-hint { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-small); }
.choice-row { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 0 12px 0 0; background: #fff; }
.choice-row:has(input:checked) { border-color: var(--accent); background: #fff6f2; }
.choice { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 8px 16px; cursor: pointer; font-size: 21px; }
.choice input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.choice span:first-of-type { flex: 1; font-weight: 700; word-break: keep-all; }
.opt-price { color: var(--accent); font-weight: 700; white-space: nowrap; font-size: 19px; }
.opt-qty { display: inline-flex; align-items: center; gap: 4px; }
.opt-qty[hidden] { display: none; }
.opt-qty button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: #f6f1e9; font-size: 24px; font-weight: 700; }
.opt-qty b { min-width: 34px; text-align: center; font-size: 20px; }
.option-step-actions { display: flex; gap: 12px; margin-top: 18px; }
.option-step-actions .primary { flex: 2; }
.option-prev { flex: 1; min-height: 64px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: var(--fs-button); font-weight: 700; }
.option-prev:disabled { opacity: .4; }

/* Order confirm modal */
.order-confirm-details { margin: 14px 0; border-top: 1px solid var(--line); }
.order-confirm-line { display: flex; justify-content: space-between; gap: 16px; padding: 14px 2px; border-bottom: 1px solid var(--line); font-size: 21px; }
.order-confirm-line span { font-weight: 700; word-break: keep-all; }
.order-confirm-line small { display: block; font-weight: 400; font-size: var(--fs-small); color: var(--ink-soft); margin-top: 4px; }
.order-confirm-line b { white-space: nowrap; }
.order-confirm-note { font-size: var(--fs-small); color: var(--ink-soft); }
.order-confirm-total { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 2px 18px; font-size: 22px; }
.order-confirm-total strong { font-size: 30px; color: var(--accent); }

/* Staff call modal */
.call-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.call-choice-card, .call-choice {
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  padding: 12px; text-align: center; font-size: 20px; font-weight: 700;
}
.call-choice { min-height: 72px; }
.call-choice-card { display: flex; flex-direction: column; align-items: center; }
.call-qty { display: flex; align-items: center; }
.call-qty > * + * { margin-left: 6px; }   /* margin, not gap: old phone WebViews (S9+) */
.call-choice-card > * + * { margin-top: 8px; }
.call-qty button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #f6f1e9; font-size: 22px; font-weight: 700; }
.call-qty strong { min-width: 30px; font-size: 20px; }
.call-send { width: 100%; height: 46px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 700; }
.call-added { border-color: var(--accent); background: #fff3ee; }
.call-hint { font-size: 15px; color: var(--muted); margin: 12px 0 0; }

/* History modal */
.history-sheet { width: min(820px, 100%); }
.history-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; font-size: var(--fs-base); }
.history-top { display: flex; justify-content: space-between; font-size: 19px; }
.history-status { margin: 6px 0 8px; color: var(--gold); font-weight: 700; }
.history-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.history-line small { display: block; color: var(--muted); font-size: 15px; }
.history-total { text-align: right; margin-top: 8px; font-size: 20px; }
.empty-history { text-align: center; color: var(--muted); padding: 30px 0; }

/* Table change modal */
.table-change-label { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; font-size: var(--fs-base); font-weight: 700; }
.table-change-label select, .table-change-label input {
  height: 58px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbf8f3; font-size: 20px;
}

/* Origin modal */
.origin-subtitle { margin: 0 0 14px; color: var(--muted); }
.origin-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 20px; }
.origin-row span { text-align: right; color: var(--ink-soft); }

.event-message { font-size: 22px; margin: 10px 0 20px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(720px, 90vw);
  background: rgba(25, 22, 19, .94); color: #fff;
  padding: 16px 26px; border-radius: 14px;
  font-size: 20px; text-align: center;
  transition: opacity .2s, transform .2s;
}
#toast.toastshow { opacity: 1; transform: translate(-50%, 0); }

/* Portrait notice (Android tablet held upright) */
.fixed-landscape-notice {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 40px;
  background: var(--header); color: #fff;
  font-family: var(--font); font-size: 26px; font-weight: 700; text-align: center; line-height: 1.5;
}

/* ───────── Size adjustments ───────── */
/* Large tablets / PC */
@media (min-width: 1500px) {
  :root { --nav-w: 190px; --cart-w: 380px; --fs-menu-name: 26px; --fs-menu-price: 24px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Smaller tablets (e.g. 1024–1180px wide) */
@media (max-width: 1180px) {
  :root { --nav-w: 160px; --cart-w: 300px; --fs-menu-name: 22px; --fs-menu-price: 20px; --fs-category: 21px; --fs-header-btn: 21px; --header-h: 86px; }
  .history-open, .fixed-table-label { padding: 0 14px; height: 64px; }
  .brand-text small { display: none; }
  .grid { gap: 12px; }
}
@media (max-width: 1040px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Short screens: keep header compact */
@media (max-height: 700px) {
  :root { --header-h: 80px; }
  .history-open, .fixed-table-label { height: 62px; }
  #note { height: 52px; }
  .primary { min-height: 58px; }
}
/* Phones held upright (browser testing only — the app is landscape-locked) */
@media (max-width: 760px) and (orientation: portrait) {
  html, body { overflow: auto; }
  :root { --fs-menu-name: 20px; --fs-menu-price: 18px; }
  .customer-header { height: auto; padding: 10px 12px; flex-wrap: wrap; }
  .header-actions { flex-wrap: wrap; }
  .tablet-layout { height: auto; grid-template-columns: 1fr; }
  .category-nav { flex-direction: row; overflow-x: auto; }
  .category-btn { min-width: 110px; }
  .catalog { overflow: visible; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═════════ Landscape phones (app on phones: ~740×360 … 915×412) ═════════
   Detected by a short landscape screen. Tablets (800px tall) never match.
   - compact header, narrow category column, 3-column menu grid
   - the cart column becomes a bottom bar + a drawer that slides in from the right
   - popups scroll inside, with their buttons always visible */
@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --header-h: 54px;
    --nav-w: 96px;
    --fs-base: 15px;
    --fs-small: 13px;
    --fs-header-brand: 15px;
    --fs-header-btn: 14px;
    --fs-category: 14px;
    --fs-section: 18px;
    --fs-menu-name: 15px;
    --fs-menu-price: 14px;
    --fs-cart-title: 18px;
    --fs-cart-item: 15px;
    --fs-total: 20px;
    --fs-button: 17px;
    --fs-sheet-title: 19px;
    --radius: 12px;
  }
  /* header */
  .customer-header { padding: 0 10px; gap: 8px; }
  .brand { gap: 6px; }
  .brand-logo { height: 40px; }
  .brand-text small { display: none; }
  .header-actions { --hbtn-space: 8px; }
  .history-open, .fixed-table-label { height: 40px; padding: 0 10px; border-radius: 10px; }
  .fixed-table-label { border-width: 1.5px; }

  /* layout: no cart column */
  .tablet-layout { grid-template-columns: var(--nav-w) minmax(0, 1fr); }

  /* categories fill the column evenly, smaller */
  .category-nav { padding: 6px; gap: 4px; }
  .category-btn { min-height: 38px; padding: 4px; border-radius: 9px; }

  /* menu grid */
  .catalog { padding: 8px 10px 76px; }
  .menu-section { margin-bottom: 16px; }
  .section-heading { margin: 2px 2px 8px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .photo { padding-top: 66.667%; }   /* 3:2 — shorter photos so a whole card fits the low screen */
  .info { padding: 8px 10px 10px; gap: 3px; }
  .info span { padding-right: 40px; }
  .add-menu { width: 34px; height: 34px; right: 8px; bottom: 8px; font-size: 22px; }
  .bottle-size { top: 6px; right: 6px; padding: 2px 8px; font-size: 13px; }
  .bottle-size.big { font-size: 14px; }

  /* cart → slide-in drawer */
  .cart-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 35;
    width: min(380px, 62vw);
    border-left: 0; box-shadow: -10px 0 30px rgba(0, 0, 0, .25);
    transform: translateX(105%); transition: transform .22s ease;
  }
  body.cart-open .cart-panel { transform: translateX(0); }
  .cart-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 34; background: rgba(20, 14, 8, .45); display: none; }
  body.cart-open .cart-backdrop { display: block; }
  .cart-panel-head { padding: 10px 12px 8px; }
  .cart-close { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1ebe2; font-size: 24px; line-height: 1; }
  .cart-panel-items { padding: 4px 12px; }
  .cart-line { padding: 8px 2px; }
  .qty-control button { width: 40px; height: 38px; font-size: 20px; }
  .qty-control b { min-width: 34px; font-size: 16px; }
  .remove-line, .edit-line { height: 38px; padding: 0 12px; font-size: 14px; }
  .line-buttons > * + * { margin-left: 6px; }
  .cart-panel-bottom { padding: 8px 12px 10px; gap: 5px; }
  #note { height: 40px; font-size: 14px; padding: 6px 10px; }
  .hint { font-size: 12px; }
  .primary { min-height: 48px; border-radius: 12px; }

  /* bottom cart bar */
  .phone-cart-bar {
    position: fixed; left: calc(var(--nav-w) + 10px); right: 10px; bottom: 8px; z-index: 30;
    display: flex; align-items: center; gap: 10px;
    height: 56px; padding: 0 8px 0 16px; border-radius: 14px;
    background: var(--header); color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    font-family: var(--font);
  }
  .phone-cart-bar .pcb-info { flex: 1; display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
  .phone-cart-bar .pcb-count { font-size: 15px; font-weight: 700; }
  .phone-cart-bar .pcb-total { font-size: 19px; font-weight: 700; color: #ffb27a; }
  .phone-cart-bar button { height: 42px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent-grad); color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap; }
  .phone-cart-bar.empty .pcb-total { color: #bdb3a6; }
  /* "added to cart" feedback: button pops + glows, count and total flash */
  .phone-cart-bar.cart-bump button { animation: pcb-pop .6s cubic-bezier(.3, 1.6, .5, 1) 1, pcb-glow 1.2s ease-out 1; }
  .phone-cart-bar.cart-bump .pcb-count,
  .phone-cart-bar.cart-bump .pcb-total { animation: pcb-flash 1.2s ease-out 1; }
  @keyframes pcb-pop { 0% { transform: scale(1); } 35% { transform: scale(1.16); } 65% { transform: scale(.96); } 100% { transform: scale(1); } }
  @keyframes pcb-glow { 0% { box-shadow: 0 0 0 0 rgba(255, 116, 25, .85); } 100% { box-shadow: 0 0 0 16px rgba(255, 116, 25, 0); } }
  @keyframes pcb-flash { 0%, 100% { color: inherit; } 20%, 60% { color: #ffd34d; } }

  /* popups: fit the short screen, content scrolls, buttons stay visible */
  .overlay { padding: 8px; }
  .sheet { max-height: calc(var(--vh) - 16px); padding: 14px 16px 12px; border-radius: 14px; display: flex; flex-direction: column; }
  .sheet h2 { margin: 0 46px 6px 0; }
  .sheet h3 { margin: 0 46px 4px 0; font-size: 19px; }
  .sheet p { font-size: var(--fs-base); margin: 4px 0; }
  .x { width: 40px; height: 40px; top: 10px; right: 10px; font-size: 24px; }
  #modal .sheet { overflow: hidden; }
  #detail { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  #detail > .muted { margin: 0 0 6px; }
  .option-step-progress { margin-bottom: 6px; }
  .optgroup strong { font-size: 16px; margin-bottom: 6px; }
  .choice-row { margin-bottom: 6px; border-radius: 10px; }
  .choice { min-height: 46px; padding: 4px 12px; font-size: 16px; gap: 10px; }
  .choice input { width: 22px; height: 22px; }
  .opt-price { font-size: 15px; }
  .opt-qty button { width: 38px; height: 38px; font-size: 20px; }
  .option-step-actions { flex: none; margin-top: 8px; }
  .option-prev { min-height: 48px; }
  #orderConfirmModal .sheet { overflow: hidden; }
  .order-confirm-details { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 6px 0; }
  .order-confirm-line { padding: 8px 2px; font-size: 16px; }
  .order-confirm-total { flex: none; margin: 6px 2px 8px; font-size: 17px; }
  .order-confirm-total strong { font-size: 22px; }
  .order-confirm-actions { flex: none; }
  #callModal .sheet, #historyModal .sheet, #originModal .sheet, #changeTableModal .sheet { overflow-y: auto; }
  .call-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .call-choice-card, .call-choice { padding: 6px; font-size: 15px; border-radius: 10px; }
  .call-choice { min-height: 52px; }
  .call-qty button { width: 34px; height: 34px; font-size: 18px; }
  .call-send { height: 36px; font-size: 14px; }
  .history-card { padding: 10px 12px; font-size: 15px; }
  .origin-row { padding: 8px 4px; font-size: 15px; }
  .table-change-label select, .table-change-label input { height: 44px; font-size: 16px; }
  #toast { bottom: 76px; font-size: 15px; padding: 10px 18px; }
  .fixed-landscape-notice { font-size: 18px; }
}
/* Landscape phones: compact option popup — ONE vertical list, narrow window.
   - line 1: menu name · price · step "2/5"
   - line 2: group name (필수/선택 · 1개만)
   - rows: [check] name ............ +2,000원 [− 1 +]  (prices line up left of the quantity)
   Up to 6 options fit without scrolling on a 360px-tall phone. */
@media (orientation: landscape) and (max-height: 500px) {
  #modal .sheet { width: min(540px, 100%); padding: 8px 12px 8px; }
  #modal .x { width: 34px; height: 34px; top: 6px; right: 6px; font-size: 20px; }
  #detail { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; align-content: flex-start; }
  #detail > h3 { margin: 0 !important; font-size: 17px; line-height: 1.25; }
  #detail > .muted { margin: 0 !important; font-size: 13px; }
  #detail > .option-step-progress { margin: 0 0 0 auto; padding-right: 38px; }
  #detail > .option-step-progress span:last-child { display: none; }
  #detail > .option-step-progress span:first-child { padding: 1px 9px; font-size: 12px; }
  #detail > .optgroup { flex: 1 1 100%; display: flex; flex-direction: column; gap: 3px; }
  .optgroup strong { display: block; margin: 0 0 2px !important; font-size: 14px; line-height: 1.3; }
  .option-step-hint { display: none; }   /* "선택사항" in the title already says it */
  #detail .choice-row { margin: 0; padding: 0 4px 0 0; min-height: 0; border-width: 1px; border-radius: 8px; gap: 6px; }
  #detail .choice-row:has(input:checked) { border-width: 1.5px; }
  #detail .choice { min-height: 34px; padding: 0 6px 0 8px; gap: 8px; font-size: 15px; flex-wrap: nowrap; }
  #detail .choice input { width: 18px; height: 18px; }
  #detail .choice span:first-of-type { flex: 1 1 auto; min-width: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #detail .opt-price { flex: none; width: 78px; text-align: right; padding: 0; font-size: 14px; line-height: 1.2; }
  #detail .opt-price:empty { width: 0; }
  #detail .opt-qty { gap: 2px; }
  #detail .opt-qty button { width: 30px; height: 28px; font-size: 17px; border-radius: 7px; }
  #detail .opt-qty b { min-width: 20px; font-size: 14px; }
  #modal .option-step-actions { margin-top: 6px; gap: 8px; }
  #modal .option-step-actions .primary, #modal .option-prev { min-height: 42px; font-size: 16px; border-radius: 10px; }

  /* option rows stay compact (34px, 3px apart); only the space ABOVE the first option
     and BELOW the last one is widened. With 6+ options the extra space shrinks so the
     window still fits a 360px-tall phone (data-count is set by customer.js). */
  #detail .optgroup strong { margin-bottom: min(9px, 2.2vh) !important; }
  #modal #detail ~ .option-step-actions { margin-top: min(14px, 3.4vh); }
  /* 6+ options: extra space grows with screen height (360px phone: original tight spacing) */
  #detail[data-count="6"] .optgroup strong, #detail[data-count="7"] .optgroup strong, #detail[data-count="8"] .optgroup strong { margin-bottom: clamp(2px, calc((100vh - 360px) / 8), 6px) !important; }
  #modal #detail[data-count="6"] ~ .option-step-actions,
  #modal #detail[data-count="7"] ~ .option-step-actions,
  #modal #detail[data-count="8"] ~ .option-step-actions { margin-top: clamp(6px, calc((100vh - 360px) / 5 + 6px), 10px); }

  /* staff-call popup: 3 compact columns, one line per item, no scrolling */
  #callModal .sheet { width: min(780px, 100%); padding: 10px 12px 12px; }
  #callModal .sheet > h2 { font-size: 18px; line-height: 34px; margin: 0 44px 8px 0; }
  #callModal .x { top: 10px; right: 10px; width: 34px; height: 34px; font-size: 20px; }  /* sits on the title line, above the items */
  #callModal .sheet > p { display: none; }               /* both helper sentences */
  #callModal .call-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 0; }
  #callModal .call-choice-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 0 6px 0 10px; min-height: min(46px, 11vh); border-width: 1px; border-radius: 10px; text-align: left; }
  #callModal .call-choice-card b { flex: 1 1 auto; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  #callModal .call-qty { flex: none; }
  #callModal .call-qty > * + * { margin-left: 6px; }
  #callModal .call-choice-card > * + * { margin-top: 0; margin-left: 8px; }
  #callModal .call-qty button { width: 30px; height: 32px; font-size: 17px; border-radius: 7px; }
  #callModal .call-qty strong { min-width: 18px; font-size: 15px; text-align: center; }
  #callModal .call-send { flex: none; width: auto; height: 32px; padding: 0 10px; font-size: 14px; border-radius: 8px; }
  #callModal .call-choice { min-height: min(46px, 11vh); padding: 4px; font-size: 15px; border-width: 1px; border-radius: 10px; }

  /* phone cart: no request-note box and no payment hint (space is tight) */
  .cart-panel-bottom label[for="note"], #note, .cart-panel-bottom .hint { display: none; }
}

/* wider landscape phones (S22/S26+/QHD ≈ 830–915px): four menu columns */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 880px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* narrowest landscape phones (≈740–780px): tighter header, logo only */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 780px) {
  .history-open, .fixed-table-label { padding: 0 8px; }
  .brand-text { display: none; }
}
/* the bottom bar and drawer extras exist only on phones */
@media not all and (orientation: landscape) and (max-height: 500px) {
  .phone-cart-bar, .cart-backdrop, .cart-close { display: none !important; }
}

/* ===== v106: 직원 호출 category + one-item call popup + 주문 내역 총액 ===== */
.call-photo { background: linear-gradient(135deg, #fff5ea 0%, #ffe9d6 100%); display: flex; align-items: center; justify-content: center; }
.call-photo .call-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; line-height: 1; }
.call-card .info span { color: var(--ink-soft); font-size: .85em; }
.call-category-btn { border: 2px dashed rgba(230, 50, 29, .45); }
.call-category-btn.active { border-style: solid; border-color: transparent; }
.call-item-sheet { text-align: center; max-width: 440px; }
.call-item-icon { font-size: 76px; line-height: 1; margin: 6px 0 4px; }
.call-item-sheet h2 { font-size: 30px; margin: 6px 0 4px; }
.call-item-sheet .muted { font-size: 18px; margin-bottom: 18px; }
.call-item-qty { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.call-item-qty[hidden] { display: none; }
.call-item-qty > * + * { margin-left: 18px; }
.call-item-qty button { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 16px; background: #f6f1e9; font-size: 32px; font-weight: 700; color: var(--ink); }
.call-item-qty strong { min-width: 56px; font-size: 40px; }
.call-item-send { width: 100%; height: 64px; font-size: 22px; border-radius: 14px; }
.history-grand { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; margin-bottom: 14px; border-radius: 14px; background: var(--ink); color: #fff; }
.history-grand span { font-size: 20px; font-weight: 700; display: flex; flex-direction: column; text-align: left; }
.history-grand small { font-size: 14px; font-weight: 400; opacity: .75; margin-top: 2px; }
.history-grand strong { font-size: 30px; }
@media (orientation: landscape) and (max-height: 500px) {
  .call-photo .call-emoji { font-size: 40px; }
  .call-item-sheet { max-width: 340px; padding-top: 10px; padding-bottom: 12px; }
  .call-item-icon { font-size: 44px; margin: 0; }
  .call-item-sheet h2 { font-size: 22px; margin: 2px 0; }
  .call-item-sheet .muted { font-size: 14px; margin-bottom: 10px; }
  .call-item-qty { margin-bottom: 10px; }
  .call-item-qty button { width: 46px; height: 46px; font-size: 24px; border-radius: 12px; }
  .call-item-qty strong { font-size: 28px; min-width: 40px; }
  .call-item-send { height: 48px; font-size: 18px; }
  .history-grand { padding: 10px 14px; margin-bottom: 8px; }
  .history-grand span { font-size: 16px; }
  .history-grand small { font-size: 12px; }
  .history-grand strong { font-size: 22px; }
}
/* v106: call cards are shorter than menu cards (no photo to show) */
.call-section .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.call-section .photo.call-photo { padding-top: 46%; }
.call-section .call-photo .call-emoji { font-size: 48px; }
@media (orientation: landscape) and (max-height: 500px) {
  .call-section .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .call-section .call-photo .call-emoji { font-size: 32px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .call-item-sheet { padding-top: 22px !important; overflow: visible; }
  .call-item-icon { font-size: 34px; line-height: 1.2; margin: 0 0 2px; }
  .call-item-sheet .muted { display: block !important; }
}

/* ===== v107: ad screen + screensaver (sizes approved in the preview) ===== */
.idle-screen { position: fixed; inset: 0; z-index: 900; }
.idle-screen.hide { display: none; }
.ad-screen { background: #fff; --band-shift: 0px; }
.ad-stage { position: absolute; left: 0; right: 0; top: 0; bottom: 160px; display: flex; align-items: center; justify-content: center; }
.ad-stage img { max-width: 94%; max-height: 94%; object-fit: contain; animation: adfade .8s ease; }
@keyframes adfade { from { opacity: 0; } to { opacity: 1; } }
.ad-dots { position: absolute; top: 18px; right: 24px; display: flex; }
.ad-dots i { width: 12px; height: 12px; border-radius: 50%; background: #ccc; margin-left: 8px; }
.ad-dots i.on { background: #d71920; }
.ad-band { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; background: #d71920; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 68px; font-weight: 800; letter-spacing: -1px; transform: translateX(var(--band-shift)); }
.ad-screen.band-top .ad-band { bottom: auto; top: 0; }
.ad-screen.band-top .ad-stage { top: 160px; bottom: 0; }
.ad-screen.band-top .ad-dots { top: auto; bottom: 18px; }
.ad-hand { display: inline-block; margin-right: 16px; animation: adtap 1.6s ease-in-out infinite; }
@keyframes adtap { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.saver-screen { background: #000; }
.saver-box { position: absolute; left: 50%; top: 50%; width: 92%; margin-left: -46%; text-align: center; transition: transform 1.2s ease; translate: 0 -50%; }
.saver-box img { width: 440px; max-width: 70%; display: block; margin: 0 auto 34px; }
.saver-box p { color: #f2f2f2; font-size: 56px; font-weight: 700; letter-spacing: -.5px; margin: 0; }
@media (orientation: landscape) and (max-height: 500px) {
  .ad-stage { bottom: 100px; }
  .ad-screen.band-top .ad-stage { top: 100px; }
  .ad-band { height: 100px; font-size: 40px; }
  .ad-dots { top: 10px; right: 14px; }
  .ad-dots i { width: 9px; height: 9px; }
  .saver-box img { width: 250px; margin-bottom: 18px; }
  .saver-box p { font-size: 36px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .ad-band { font-size: 26px; height: 90px; } .ad-stage { bottom: 90px; }
  .saver-box img { width: 220px; } .saver-box p { font-size: 26px; }
}
.app-update-bar{position:fixed;left:16px;bottom:16px;z-index:800;display:flex;align-items:center;gap:12px;padding:10px 12px 10px 16px;border-radius:14px;background:#201a15;color:#fff;font-size:15px;box-shadow:0 8px 24px rgba(0,0,0,.3)}.app-update-bar button{height:40px;padding:0 18px;border:0;border-radius:10px;background:#d71920;color:#fff;font-weight:800;font-size:16px}
/* v109: call icons grow with the card (≈ 1/4 of the card width), not a fixed size */
.call-section .card { container-type: inline-size; }
.call-section .call-photo .call-emoji { font-size: 48px; font-size: clamp(56px, 34cqw, 130px); }
.call-svg{display:inline-block;width:1.05em;height:1.05em;line-height:0;vertical-align:middle}.call-svg svg{width:100%;height:100%;display:block}
.call-svg{width:1.32em;height:1.32em}.call-svg svg [stroke]{stroke:#1f1f1f;stroke-width:3.4px}.call-svg svg path[stroke="#fff"],.call-svg svg path[stroke="#ffe36b"],.call-svg svg path[stroke="#cdeaf7"]{stroke-width:2.5px}.call-svg svg path[stroke="#fff"]{stroke:#fff}.call-svg svg path[stroke="#ffe36b"]{stroke:#ffe36b}.call-svg svg path[stroke="#cdeaf7"]{stroke:#cdeaf7}
