:root {
  color-scheme: light;
  --ink: #2b211a;
  --muted: #74685f;
  --paper: #fffdf9;
  --canvas: #f4eee6;
  --line: #ded3c8;
  --accent: #a84f29;
  --accent-dark: #7f351b;
  --accent-soft: #f4ded0;
  --gold: #d89126;
  --green: #2f7652;
  --green-soft: #dceee4;
  --blue: #246a84;
  --blue-soft: #dcecf2;
  --danger: #a83832;
  --shadow: 0 14px 34px rgba(66, 44, 29, 0.10);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

button, input { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(36, 106, 132, 0.35);
  outline-offset: 2px;
}

.hidden { display: none !important; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 12px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(125, 94, 72, 0.18);
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: opacity .12s ease;
}

.brand.branding-pending { opacity: 0; }

.brand > span:last-child { min-width: 0; }

.brand-mark, .modal-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--accent);
  color: white;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(168, 79, 41, 0.25);
}

.brand-mark.has-custom-icon, .modal-icon.has-custom-icon { padding: 4px; background: white; }
.brand-mark img, .modal-icon img { width: 100%; height: 100%; border-radius: 10px; object-fit: contain; }

.brand strong, .brand small { max-width: clamp(120px, 24vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { display: block; font-size: 17px; letter-spacing: -0.01em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }

.desktop-nav {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 15px;
  background: #ece4db;
}

.nav-button {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #67584e;
  font-weight: 700;
  cursor: pointer;
}

.nav-button:hover { background: rgba(255,255,255,0.55); }
.nav-button.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(52, 35, 25, 0.09); }

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 12px;
}

.device-button {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  max-width: 220px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  cursor: pointer;
  overflow: hidden;
}

.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; }
.event-button, .logout-button, .account-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  cursor: pointer;
}
.event-button { display: flex; align-items: center; gap: 8px; max-width: 210px; padding: 9px 13px; }
.event-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.event-button.active .event-dot { background: var(--green); }
.logout-button { width: 42px; padding: 0; color: var(--muted); font-size: 20px; }
.account-button { display: none; width: 42px; flex: 0 0 42px; padding: 0; color: var(--muted); }
.account-device-name { overflow-wrap: anywhere; font-weight: 750; }
.account-menu-actions { display: grid; gap: 10px; margin-top: 22px; }
.account-logout { color: var(--danger); }

.device-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 44px) 46px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-head h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.05; letter-spacing: -0.035em; }
.page-head p { margin: 7px 0 0; color: var(--muted); }
.eyebrow { display: block; margin-bottom: 7px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 13px;
}

.table-card {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.table-card:hover { transform: translateY(-2px); border-color: #c59d83; box-shadow: var(--shadow); }
.table-card.open { border: 2px solid var(--accent); background: #fff8f2; }
.table-card strong { font-size: 19px; }
.table-card .table-meta { color: var(--muted); font-size: 13px; }
.table-card .table-total { font-size: 18px; font-weight: 850; }
.table-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent-dark); font-weight: 750; }
.table-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 22px;
  align-items: start;
}

.article-panel, .cart-panel, .station-card, .history-panel, .stat-card {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 8px 26px rgba(66, 44, 29, 0.06);
}

.article-panel { padding: 20px; border-radius: var(--radius); }
.cart-panel { position: sticky; top: 98px; border-radius: var(--radius); overflow: hidden; }

.order-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.back-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); cursor: pointer; font-size: 22px; }
.order-toolbar h1 { margin: 0; font-size: 27px; line-height: 1.1; }
.order-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.filter-row { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-weight: 750; cursor: pointer; }
.filter-button.active { border-color: var(--ink); background: var(--ink); color: white; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 11px; }
.article-button { position: relative; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fffdfa; cursor: pointer; text-align: left; }
.article-button:hover { border-color: var(--accent); background: #fff8f3; }
.article-button:active { transform: scale(0.985); }
.article-button.selected { border-color: var(--accent); background: #fff8f3; box-shadow: inset 0 0 0 1px rgba(168, 79, 41, .12); }
.article-button strong { font-size: 16px; line-height: 1.25; }
.article-button span { font-weight: 850; color: var(--accent-dark); }
.article-button span.article-quantity-badge { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: white; font-size: 13px; font-weight: 900; box-shadow: 0 5px 12px rgba(168, 79, 41, .25); }
.station-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px !important; color: var(--muted) !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: 0.06em; }
.station-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.station-label.kitchen::before { background: var(--blue); }

.cart-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 21px 21px 15px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 22px; }
.cart-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.discard-button { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 13px; font-weight: 750; }
.cart-items { max-height: calc(100vh - 365px); min-height: 180px; overflow: auto; padding: 8px 20px; }
.empty-cart { min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.cart-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #eee5dd; }
.cart-item:last-child { border-bottom: 0; }
.cart-item strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.cart-price { margin-top: 2px; color: var(--muted); font-size: 13px; }
.paid-note { display: inline-flex; margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.quantity-control { display: flex; align-items: center; gap: 7px; }
.quantity-control button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: #f8f2ec; cursor: pointer; font-size: 20px; }
.quantity-control button:disabled, .split-quantity button:disabled { opacity: .35; cursor: not-allowed; }
.quantity-control span { min-width: 24px; text-align: center; font-weight: 850; }
.cart-footer { padding: 18px 20px 20px; border-top: 1px solid var(--line); background: #f8f2ec; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 15px; }
.total-row span { color: var(--muted); font-weight: 700; }
.total-row strong { font-size: 28px; letter-spacing: -0.03em; }
.total-details { display: flex; justify-content: space-between; margin: -8px 0 14px; color: var(--muted); font-size: 13px; }

.primary-button, .secondary-button, .danger-button {
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 13px;
  font-weight: 850;
  cursor: pointer;
}
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { border: 1px solid var(--line); background: var(--paper); }
.danger-button { border: 1px solid #e3b7b4; background: #fff0ef; color: var(--danger); }
.wide { width: 100%; }

.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.station-card { border-radius: var(--radius); overflow: hidden; }
.station-card.buffet { border-top: 5px solid var(--gold); }
.station-card.kitchen { border-top: 5px solid var(--blue); }
.station-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 18px 19px 14px; border-bottom: 1px solid var(--line); }
.station-head h2 { margin: 0; font-size: 25px; }
.station-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.age-badge { padding: 5px 9px; border-radius: 999px; background: #f1e9e1; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.age-badge.late { background: #f8deda; color: var(--danger); }
.station-items { padding: 7px 18px; }
.station-item { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eee5dd; }
.station-item:last-child { border-bottom: 0; }
.item-quantity { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: white; font-size: 18px; font-weight: 900; }
.done-item { width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 13px; background: var(--green-soft); color: var(--green); font-size: 20px; font-weight: 900; cursor: pointer; }
.station-footer { padding: 14px 18px 18px; }
.all-done-button { width: 100%; min-height: 47px; border: 1px solid var(--green); border-radius: 13px; background: var(--green); color: white; font-weight: 850; cursor: pointer; }

.empty-state { min-height: 360px; display: grid; place-items: center; text-align: center; padding: 30px; border: 1px dashed #cdbdad; border-radius: var(--radius); background: rgba(255,255,255,0.45); }
.empty-state .empty-mark { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 15px; border-radius: 22px; background: var(--green-soft); color: var(--green); font-size: 30px; font-weight: 900; }
.empty-state h2 { margin: 0 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.stat-card { padding: 17px; border-radius: 16px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 5px; font-size: 25px; }
.history-panel { border-radius: var(--radius); overflow: hidden; }
.history-event-select { min-height: 46px; max-width: 320px; padding: 9px 38px 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 750; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { padding: 13px 16px; background: #eee6dd; color: var(--muted); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.history-table td { padding: 14px 16px; border-top: 1px solid var(--line); }
.history-table tbody tr:hover { background: #fff9f4; }
.history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.history-pagination span { color: var(--muted); font-size: 13px; font-weight: 750; text-align: center; }
.history-pagination button:disabled { cursor: default; opacity: .45; }
.payment-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.payment-pill.CASH { background: var(--green-soft); color: var(--green); }
.payment-pill.TWINT { background: var(--blue-soft); color: var(--blue); }
.icon-button { min-width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); cursor: pointer; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(33, 24, 18, 0.58); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 30px; border-radius: 24px; background: var(--paper); box-shadow: 0 28px 80px rgba(27, 18, 12, .28); }
.compact-card { width: min(440px, 100%); }
.modal-card h1, .modal-card h2 { margin: 7px 0 9px; line-height: 1.12; letter-spacing: -.025em; }
.modal-card p { color: var(--muted); }
.modal-card label { display: block; margin: 22px 0 7px; font-weight: 800; }
.modal-card input { width: 100%; min-height: 52px; margin-bottom: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: white; font-size: 17px; }
.form-error { margin: 0 0 14px !important; padding: 10px 12px; border-radius: 11px; background: #fff0ef; color: var(--danger) !important; font-weight: 700; }
.login-mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 20px 0 16px; padding: 5px; border-radius: 14px; background: #eee6dd; }
.login-mode { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.login-mode.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(52, 35, 25, 0.09); }
.pairing-login-button { margin-top: 10px; }
.pair-code-input { text-align: center; font-size: 28px !important; font-weight: 900; letter-spacing: .18em; }
.event-card { width: min(680px, 100%); }
.event-list { display: grid; gap: 9px; margin: 22px 0; }
.event-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.event-row.active { border-color: var(--green); background: #f4fbf7; }
.event-row strong, .event-row small { display: block; }
.event-row small { margin-top: 3px; color: var(--muted); }
.event-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.event-actions button { min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; font-size: 13px; font-weight: 750; }
.event-actions .close-event { color: var(--danger); }
.event-form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.event-form h3 { margin: 0 0 5px; }
.event-account-actions { display: flex; gap: 8px; margin-top: 18px; }
.event-account-actions .logout-link { color: var(--danger); }
.pairing-result { display: grid; grid-template-columns: minmax(0,1fr) 150px; align-items: center; gap: 18px; margin-top: 20px; padding: 18px; border: 1px solid var(--green); border-radius: 16px; background: #f4fbf7; }
.pairing-result span, .pairing-result small { display: block; color: var(--muted); }
.pairing-result strong { display: block; margin: 4px 0; font-size: 38px; letter-spacing: .12em; }
.pairing-result img { width: 150px; height: 150px; border-radius: 10px; background: white; }
.empty-list { padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.event-button:disabled { cursor: default; opacity: .8; }
.modal-icon { margin-bottom: 20px; }
.close-button { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #eee6dd; cursor: pointer; font-size: 25px; }
.text-button { min-height: 42px; width: 100%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.modal-context { margin: 0; }
.payment-mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 22px 0 17px; padding: 5px; border-radius: 14px; background: #eee6dd; }
.payment-mode { min-height: 43px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.payment-mode.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(52, 35, 25, 0.09); }
.split-selection { max-height: min(310px, 38vh); overflow: auto; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 15px; }
.split-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.split-item:last-child { border-bottom: 0; }
.split-item strong { display: block; }
.split-item small { display: block; margin-top: 2px; color: var(--muted); }
.split-quantity { display: flex; align-items: center; gap: 8px; }
.split-quantity button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: #f8f2ec; cursor: pointer; font-size: 20px; }
.split-quantity span { min-width: 26px; text-align: center; font-weight: 900; }
.payment-total-caption { display: block; color: var(--muted); font-size: 13px; font-weight: 750; }
.payment-total { margin: 2px 0 22px; font-size: clamp(38px, 8vw, 58px); font-weight: 950; letter-spacing: -.05em; }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.payment-option { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px solid var(--line); border-radius: 18px; background: white; cursor: pointer; font-size: 19px; }
.payment-option:hover { border-color: var(--accent); }
.payment-symbol { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--green-soft); color: var(--green); font-weight: 950; }
.twint-option .payment-symbol { background: var(--blue-soft); color: var(--blue); font-size: 28px; }
.hint { margin: 17px 0 0; font-size: 13px; }
.twint-card { text-align: center; }
.twint-total { margin: 15px 0 18px; font-size: clamp(36px, 8vw, 54px); font-weight: 950; letter-spacing: -.05em; }
.twint-qr { display: block; width: min(320px, 100%); max-height: 42vh; margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 18px; object-fit: contain; background: white; }
.twint-code-text { margin: 14px 0; padding: 14px; border: 1px dashed var(--blue); border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 21px; font-weight: 900; letter-spacing: .04em; overflow-wrap: anywhere; }
.terminal-button { width: 100%; min-height: 58px; margin: 5px 0 10px; padding: 13px 18px; border: 1px solid var(--blue); border-radius: 14px; background: var(--blue); color: white; font-weight: 850; cursor: pointer; }
.terminal-button:hover { background: #19546a; }
.terminal-hint { margin: 6px 0 18px !important; font-size: 13px; }
.receipt-confirmation { text-align: center; }
.success-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: var(--green); color: white; font-size: 38px; font-weight: 900; }
.button-row { display: flex; gap: 10px; margin-top: 24px; }
.button-row > * { flex: 1; }

.toast { position: fixed; right: 22px; bottom: 24px; z-index: 200; max-width: min(420px, calc(100vw - 36px)); padding: 13px 16px; border-radius: 13px; background: var(--ink); color: white; box-shadow: var(--shadow); font-weight: 700; }
.toast.error { background: var(--danger); }
.loading-card { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 13px; color: var(--muted); }
.spinner { width: 38px; height: 38px; border: 4px solid #dfd2c7; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mobile-nav { display: none; }
#print-area { display: none; }

@media (max-width: 900px) {
  .app-header { grid-template-columns: minmax(0, 1fr) auto; min-height: 68px; gap: 12px; padding: 10px 16px; }
  .desktop-nav { display: none; }
  .brand small { display: none; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto; }
  .brand strong { max-width: 100%; }
  .event-button { max-width: clamp(70px, 26vw, 150px); }
  .device-button { display: none; }
  .logout-button { display: none; }
  .account-button { display: inline-flex; align-items: center; justify-content: center; }
  .app-shell { padding: 20px 14px 96px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(4,1fr); padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,253,249,.97); backdrop-filter: blur(14px); }
  .mobile-nav-button { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
  .mobile-nav-button span { font-size: 21px; line-height: 1; }
  .mobile-nav-button.active { background: var(--accent-soft); color: var(--accent-dark); }
  .order-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; order: -1; }
  .cart-items { max-height: none; }
  .article-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .table-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .stats-row { grid-template-columns: 1fr; }
  .history-panel { overflow-x: auto; }
  .history-table { min-width: 730px; }
}

@media (max-width: 560px) {
  .brand strong { font-size: 15px; }
  .event-button { max-width: 135px; padding: 8px 10px; font-size: 13px; }
  .event-row { grid-template-columns: 1fr; }
  .event-actions { justify-content: flex-start; }
  .pairing-result { grid-template-columns: 1fr; text-align: center; }
  .pairing-result img { margin: 0 auto; }
  .page-head { align-items: start; flex-direction: column; gap: 12px; }
  .table-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .table-card { min-height: 126px; padding: 14px; }
  .article-panel { padding: 14px; }
  .article-grid { gap: 8px; }
  .article-button { min-height: 105px; padding: 12px; }
  .payment-options { grid-template-columns: 1fr; }
  .payment-option { min-height: 100px; flex-direction: row; }
  .payment-symbol { width: 50px; height: 50px; }
  .modal-card { padding: 24px 20px; }
  .button-row { flex-direction: column-reverse; }
  .station-grid { grid-template-columns: 1fr; }
}

@media print {
  @page { size: 80mm auto; margin: 5mm; }
  body { background: white; color: black; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; width: 70mm; margin: 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11pt; }
  .receipt-header { text-align: center; margin-bottom: 6mm; }
  .receipt-header h1 { margin: 0 0 2mm; font-size: 17pt; }
  .receipt-meta { margin: 4mm 0; padding: 3mm 0; border-top: 1px dashed #000; border-bottom: 1px dashed #000; }
  .receipt-line { display: grid; grid-template-columns: 7mm 1fr auto; gap: 2mm; margin: 2mm 0; }
  .receipt-total { display: flex; justify-content: space-between; margin-top: 4mm; padding-top: 3mm; border-top: 2px solid #000; font-size: 14pt; font-weight: 900; }
  .receipt-footer { margin-top: 7mm; text-align: center; font-size: 9pt; }
}

.clipboard-fallback { position: fixed; opacity: 0; }
