:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #1f2523;
  --muted: #69726d;
  --line: #deded7;
  --accent: #b72f2a;
  --accent-dark: #8f231f;
  --gold: #c9993a;
  --warm: #fff8ef;
  --warm-line: #ecd6b7;
  --green: #28785b;
  --shadow: 0 10px 30px rgba(31, 37, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

body.customer-active {
  padding-bottom: 158px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar > div {
  min-width: 0;
}

.top-call-button {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
  white-space: nowrap;
  box-shadow: none;
}

body.customer-active .view-switch {
  display: none;
}

body.staff-active .top-call-button,
body.staff-route .top-call-button,
body.import-mode .top-call-button,
body.owner-admin-mode .top-call-button {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.view-switch,
.category-tabs,
.category-edit-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav-button,
.category-button,
.secondary-button,
.primary-button,
.danger-button,
.small-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.nav-button,
.category-button {
  padding: 0 14px;
  white-space: nowrap;
}

.nav-button.active,
.category-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.bill-nav {
  border-color: var(--gold);
  color: #7b550e;
  font-weight: 800;
}

.staff-nav {
  color: var(--muted);
}

#language-toggle {
  min-width: 74px;
  border-color: var(--line);
  color: var(--ink);
}

main {
  padding: 18px;
}

body.staff-active main,
body.staff-route main {
  padding: 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.table-panel,
.cart-panel {
  position: sticky;
  top: 88px;
  padding: 16px;
}

body.customer-active .table-panel,
body.customer-active .cart-panel {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.hint {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #bcd6ca;
  border-radius: 999px;
  background: #f5fbf8;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-status.saving {
  border-color: #d8c27a;
  background: #fff9df;
  color: #8a6500;
}

.sync-status.ok {
  border-color: #bcd6ca;
  background: #f5fbf8;
  color: var(--green);
}

.sync-status.error {
  border-color: #f0b4aa;
  background: #fff0ee;
  color: #b33122;
}

.section-heading input {
  max-width: 260px;
}

.menu-area {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.menu-area .category-tabs {
  position: sticky;
  top: 86px;
  align-self: start;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 176px);
  margin-bottom: 0;
  padding: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fff;
}

.menu-area .section-heading {
  grid-column: 1 / -1;
  margin-bottom: 10px;
  flex-direction: row;
  align-items: center;
}

.menu-area .section-heading .eyebrow {
  display: none;
}

.menu-area .section-heading > div {
  flex: 1;
  min-width: 0;
}

.menu-area .section-heading input {
  width: 46px;
  min-width: 46px;
  height: 46px;
  max-width: none;
  padding: 0;
  border-radius: 999px;
  text-align: center;
  font-size: 22px;
  transition: width 0.18s ease;
}

.menu-area .section-heading input:focus {
  width: min(220px, 48vw);
  padding: 0 14px;
  text-align: left;
  font-size: 16px;
}

.menu-area .category-button {
  justify-content: flex-start;
  min-height: 58px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  white-space: normal;
}

.menu-area .category-button.active {
  border-color: var(--gold);
  background: #fff3df;
  color: var(--ink);
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.menu-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  min-height: 132px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.menu-card:hover {
  border-color: var(--warm-line);
  background: linear-gradient(180deg, #fff 0%, var(--warm) 100%);
}

.menu-card:active {
  transform: scale(0.992);
}

.menu-card.just-added {
  border-color: #dc7625;
  box-shadow: 0 12px 28px rgba(220, 118, 37, 0.22);
}

.item-main {
  display: grid;
  gap: 8px;
  align-content: center;
}

.item-photo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 20%, #fff7df, #efe7d8 70%);
  color: #9b6410;
  font-weight: 800;
}

.item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-placeholder {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(201, 153, 58, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent);
  font-size: 26px;
  font-weight: 900;
}

.menu-card.soldout {
  opacity: 0.55;
}

.item-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.item-title h3 {
  margin: 0;
  font-size: 17px;
}

.item-main h3 {
  margin: 0;
  font-size: 18px;
}

.zh-name {
  color: var(--muted);
  font-size: 13px;
}

.price {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.tags {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button {
  width: 100%;
  padding: 0 14px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.add-cart-button {
  min-height: 44px;
  border-color: rgba(183, 47, 42, 0.32);
  background: #fff;
  color: var(--accent);
  box-shadow: none;
}

.add-cart-button:hover {
  border-color: var(--accent);
  background: #fff7f6;
  color: var(--accent-dark);
}

.danger-button {
  padding: 0 14px;
  border-color: rgba(194, 47, 42, 0.22);
  background: #fff7f6;
  color: var(--accent);
  font-weight: 800;
}

.cancelled-label {
  color: var(--muted);
  font-weight: 800;
}

.secondary-button,
.small-button {
  padding: 0 12px;
}

.small-button {
  min-height: 34px;
  font-size: 13px;
}

.cart-header,
.total-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.cart-header {
  margin-bottom: 12px;
}

.cart-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.cart-list.empty {
  color: var(--muted);
  font-size: 14px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cart-line.recent {
  margin: -4px;
  padding: 8px 4px 10px;
  border-radius: 8px;
  background: #fff8ef;
}

.qty-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-tools button {
  width: 30px;
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.total-row {
  margin: 14px 0;
  font-size: 18px;
}

.orders-list,
.admin-list,
.checkout-list {
  display: grid;
  gap: 12px;
}

.business-day-panel,
.table-status-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.business-day-panel {
  grid-template-columns: minmax(160px, auto) minmax(0, 1fr) auto;
  align-items: center;
}

.business-day-panel h3,
.table-status-panel h3 {
  margin: 0;
  font-size: 18px;
}

.business-day-metrics,
.table-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.business-day-metrics span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf8f3;
  color: var(--ink);
  font-weight: 800;
}

.business-day-metrics .warn {
  border-color: #e7b85d;
  background: #fff4d9;
  color: #8a5a00;
}

.table-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.table-status-card {
  display: grid;
  gap: 4px;
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f3;
}

.table-status-card strong {
  font-size: 18px;
}

.table-status-card span,
.table-status-card small {
  color: var(--muted);
  font-weight: 800;
}

.table-status-card.occupied {
  border-color: #bcd6ca;
  background: #f1faf6;
}

.table-status-card.requested {
  border-color: #e7b85d;
  background: #fff4d9;
}

body.staff-active .orders-list,
body.staff-route .orders-list {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: start;
}

body.staff-active .checkout-list,
body.staff-route .checkout-list,
body.staff-active .admin-list,
body.staff-route .admin-list {
  align-items: start;
}

body.staff-active .checkout-list,
body.staff-route .checkout-list {
  grid-template-columns: 1fr;
}

.order-card,
.admin-row,
.checkout-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.order-card {
  display: grid;
  gap: 10px;
}

.checkout-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.checkout-table-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.checkout-table-button {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f3;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.checkout-table-button strong {
  font-size: 17px;
  line-height: 1.1;
}

.checkout-table-button span,
.checkout-table-button small {
  color: var(--muted);
  font-weight: 800;
}

.checkout-table-button.occupied {
  border-color: #bcd6ca;
  background: #f1faf6;
}

.checkout-table-button.requested {
  border-color: #e7b85d;
  background: #fff4d9;
}

.checkout-table-button.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192, 47, 44, 0.12);
}

.checkout-detail-panel {
  display: grid;
  gap: 12px;
  min-height: 300px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.checkout-detail-panel.requested {
  border-color: #e7b85d;
  background: #fffaf0;
}

.checkout-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.checkout-detail-head h3 {
  margin: 0;
  font-size: 26px;
}

.checkout-move-inline {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.checkout-empty-detail {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 150px;
  color: var(--muted);
  text-align: center;
}

.checkout-empty-detail strong {
  color: var(--ink);
  font-size: 22px;
}

body.staff-active .order-card,
body.staff-route .order-card,
body.staff-active .checkout-card,
body.staff-route .checkout-card,
body.staff-active .admin-row,
body.staff-route .admin-row {
  padding: 12px;
}

@media (max-width: 760px) {
  .checkout-move-inline {
    grid-template-columns: 1fr;
  }

  .checkout-table-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkout-detail-head {
    display: grid;
  }
}

.order-card.done {
  border-color: #bcd6ca;
  background: #f5fbf8;
  padding: 12px 14px;
}

.order-card.done .order-items,
.order-card.done .order-detail-drawer,
.order-card.done .order-no {
  display: none;
}

.order-card.done .total-row {
  margin: 6px 0 0;
}

.order-card.checkout-request {
  border-color: #e7b85d;
  background: #fff8e9;
}

.order-card.checkout-request h3 {
  color: #9b6410;
  font-size: 22px;
}

.order-card.urgent {
  border-color: #dc7625;
  background: #fff8ef;
  box-shadow: 0 12px 30px rgba(220, 118, 37, 0.18);
}

.order-top,
.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-top {
  align-items: flex-start;
}

.order-title-group {
  display: grid;
  gap: 4px;
}

.order-title-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}

.order-table {
  color: var(--accent);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.order-meta-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
  align-content: start;
}

.order-age {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-age.urgent {
  color: #b65313;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 0;
}

.order-count {
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f6efe2;
  color: var(--ink);
  text-align: center;
  font-size: 15px;
}

.printer-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 150px 92px auto;
  align-items: end;
}

.printer-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.printer-row input,
.printer-row select {
  width: 100%;
}

.inline-check {
  align-items: center;
  grid-template-columns: auto 1fr;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.form-actions .primary-button,
.form-actions .secondary-button {
  width: auto;
}

.owner-admin-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 32px 72px;
}

.owner-login-card {
  box-sizing: border-box;
  min-width: 0;
  display: grid;
  gap: 20px;
  padding: 24px;
}

.owner-login-card h1 {
  margin: 0;
  font-size: 28px;
}

.owner-login-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.owner-login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f3;
}

.owner-login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.owner-login-form .hint {
  grid-column: 1 / -1;
  margin: 0;
}

.owner-area {
  min-width: 0;
  display: none;
  gap: 14px;
}

.owner-area.open {
  display: grid;
}

.owner-store-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f1ed;
}

.owner-store-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.owner-store-tab span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  background: #e2e1dc;
  font-size: 12px;
}

.owner-store-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 37, 35, 0.1);
}

.owner-store-tab.active span {
  color: #fff;
  background: var(--accent);
}

.owner-store-pane {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.owner-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.owner-new-store {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f3;
}

.owner-new-store label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.owner-store-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 10px;
}

.owner-store-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.owner-store-card:has(.owner-enabled:not(:checked)) {
  border-color: #e2a7a2;
  background: #fff7f6;
}

.owner-store-card.is-archived {
  border-color: #b9b3aa;
  background: #f5f2ee;
}

.owner-store-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.owner-store-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.owner-store-toggle {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.owner-store-toggle::before {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease, top 160ms ease;
}

.owner-store-toggle[aria-expanded="true"]::before {
  top: 16px;
  transform: rotate(225deg);
}

.owner-store-toggle:hover {
  border-color: var(--accent);
  background: #fff8f7;
}

.owner-title-line,
.owner-status-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.owner-status-pill,
.owner-plan-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.owner-status-pill.active {
  color: #08745e;
  background: #dff6ee;
}

.owner-status-pill.stopped {
  color: #b3261e;
  background: #ffe5e2;
}

.owner-status-pill.archived {
  color: #6b6259;
  background: #e7e0d8;
}

.owner-plan-pill {
  color: #8a5a00;
  background: #fff1d6;
}

.owner-store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.owner-store-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.owner-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-usage span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf8f3;
  color: var(--ink);
  font-size: 13px;
}

.owner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.owner-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  text-decoration: none;
}

.owner-backups {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f3;
}

.owner-backup-list {
  display: grid;
  gap: 6px;
}

.owner-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.owner-backup-row span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 800;
}

.owner-save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid var(--warm-line);
  border-radius: 8px;
  background: rgba(255, 248, 239, 0.96);
  box-shadow: 0 10px 24px rgba(31, 37, 35, 0.12);
}

.owner-save-bar .primary-button {
  width: min(260px, 100%);
}

.owner-result:empty {
  display: none;
}

.store-disabled #customer-view,
.store-disabled #bill-view,
.store-disabled .bottom-cart-bar {
  display: none;
}

.store-disabled-panel {
  max-width: 760px;
  margin: 24px auto;
  text-align: center;
}

.store-disabled-panel h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.order-items {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.35;
}

.order-items li {
  padding: 8px 0;
}

.order-items li:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.order-items li,
.history-line {
  transition: background 0.18s ease, opacity 0.18s ease;
}

.order-items li:has(.order-line-actions) {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.order-line-main {
  display: grid;
  gap: 3px;
}

.order-line-main strong {
  font-size: 17px;
}

.order-line-main small {
  color: var(--muted);
  font-weight: 700;
}

.order-items-preview {
  padding: 2px 0;
}

.order-items-detail {
  max-height: 220px;
  overflow: auto;
}

.order-more-line {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.order-detail-drawer {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.order-detail-drawer summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
}

.order-detail-drawer summary::-webkit-details-marker {
  display: none;
}

.order-detail-drawer[open] summary {
  margin-bottom: 6px;
  border-color: rgba(194, 47, 42, 0.25);
  color: var(--accent);
}

.order-line-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.danger-mini {
  border-color: #f0b6b0;
  color: #b72c23;
  background: #fff7f5;
}

.cancelled-line {
  opacity: 0.58;
  background: #fff7f5;
}

.cancelled-line-note {
  color: #b72c23;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff2df;
  color: #8a5d10;
  font-size: 13px;
  font-weight: 800;
}

.checkout-request .status-pill {
  background: #ffd98c;
  color: #6f4708;
}

.done .status-pill {
  background: #dff3eb;
  color: var(--green);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.form-section-title h3,
.set-builder-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.media-grid {
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 1fr) auto;
  align-items: center;
}

.form-submit-bar {
  position: sticky;
  bottom: 10px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid var(--warm-line);
  border-radius: 8px;
  background: rgba(255, 248, 239, 0.96);
  box-shadow: 0 10px 24px rgba(31, 37, 35, 0.12);
}

.form-submit-bar .primary-button {
  width: min(220px, 100%);
}

.category-manager {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.category-form {
  display: grid;
  grid-template-columns: minmax(180px, 320px) 160px;
  gap: 10px;
}

.category-form .primary-button {
  width: auto;
}

.category-edit-list {
  padding-bottom: 4px;
}

.category-edit-row {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.category-edit-row strong {
  white-space: nowrap;
}

.admin-tabs {
  position: static;
  flex-flow: row wrap;
  gap: 8px;
  max-height: none;
  margin-bottom: 12px;
  overflow: visible;
  border-right: 0;
  background: transparent;
}

.admin-tabs .category-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
}

.options-builder {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf8;
}

.set-builder {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.set-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.set-builder-head h3 {
  margin: 0;
}

.set-groups-editor {
  display: grid;
  gap: 10px;
}

.set-editor-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.set-editor-head {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 120px auto;
  gap: 8px;
  align-items: end;
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.options-editor {
  display: grid;
  gap: 10px;
}

.option-editor-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.option-editor-head,
.option-choice-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 150px auto;
  gap: 8px;
  align-items: center;
}

.option-editor-head {
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 150px auto;
}

.option-choice-list {
  display: grid;
  gap: 8px;
}

.option-choice-price {
  min-width: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.admin-actions .action-button,
.checkout-actions .action-button,
.login-actions .primary-button,
.login-actions .danger-button,
.login-actions .secondary-button {
  width: auto;
}

.soldout-label {
  color: var(--gold);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.bill-locked-message {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(194, 47, 42, 0.18);
  border-radius: 8px;
  background: #fff7f0;
}

.bill-locked-message strong {
  color: var(--accent);
}

.bill-locked-message span,
.bill-locked-message small {
  color: var(--muted);
}

.login-dialog {
  width: min(360px, calc(100% - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

.login-dialog::backdrop {
  background: rgba(31, 37, 35, 0.42);
}

.login-box {
  display: grid;
  gap: 14px;
  padding: 18px;
}

#options-dialog {
  width: min(680px, calc(100% - 28px));
}

#confirm-dialog {
  width: min(560px, calc(100% - 28px));
}

#options-dialog .login-box {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 28px);
}

#confirm-dialog .login-box {
  max-height: calc(100dvh - 28px);
}

#options-dialog .login-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -18px -18px;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-confirm-message {
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.image-preview {
  min-height: 80px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafaf7;
  overflow: hidden;
}

.image-preview img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
}

.admin-item {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.admin-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f0eee8;
  object-fit: cover;
}

.checkout-card.empty-table {
  display: grid;
  gap: 4px;
  padding: 10px;
  box-shadow: none;
  opacity: 0.72;
}

.checkout-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.checkout-total {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}

.checkout-total-box {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.checkout-lines {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.checkout-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.staff-tabs {
  position: sticky;
  top: 73px;
  z-index: 16;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 0;
  background: var(--bg);
}

.staff-tab {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.staff-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.staff-panel {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.staff-panel.open {
  display: block;
}

.order-card.cancelled {
  border-color: #d7d2ca;
  background: #f2f0ec;
  opacity: 0.78;
}

.order-no {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card .total-row {
  margin: 4px 0 0;
}

.order-card .total-row > span {
  font-size: 18px;
  font-weight: 850;
}

.order-card .admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.report-order-list {
  display: grid;
  gap: 12px;
}

.monthly-report {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.monthly-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.monthly-report-head h3 {
  margin: 0;
  font-size: 18px;
}

.monthly-report-table {
  width: 100%;
  border-collapse: collapse;
}

.monthly-report-table th,
.monthly-report-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.monthly-report-table th:nth-child(2),
.monthly-report-table td:nth-child(2),
.monthly-report-table th:nth-child(3),
.monthly-report-table td:nth-child(3) {
  text-align: right;
}

.monthly-report-table thead th,
.monthly-report-table tfoot th {
  background: var(--soft);
  font-weight: 850;
}

.monthly-report-table tfoot th {
  border-bottom: 0;
}

.monthly-report-table .empty-cell {
  color: var(--muted);
  text-align: center;
}

.daily-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.report-section-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.report-section-head span,
.metric-card small {
  color: var(--muted);
  font-weight: 700;
}

.report-rank-list,
.report-record-stack,
.report-table-list {
  display: grid;
  gap: 8px;
}

.report-rank-row,
.report-table-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  text-align: left;
}

.report-rank-row b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--red);
}

.report-rank-row strong,
.report-table-row strong,
.report-table-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-table-row {
  cursor: pointer;
}

.report-table-row.occupied,
.report-table-row.requested {
  background: #f1fbf7;
  border-color: #c7eadf;
}

.report-table-row.requested {
  background: #fff8ec;
  border-color: #f3d59e;
}

.report-table-list.compact .report-table-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.report-order-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.report-order-head h3 {
  margin: 0;
}

.metric-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card.report-primary {
  border-color: #c7eadf;
  background: #f1fbf7;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.qr-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.qr-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.qr-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.qr-card h3 {
  margin: 0;
}

.qr-card img {
  width: 160px;
  height: 160px;
}

.qr-card p {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.print-only {
  display: none;
}

.customer-bill-panel {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 152px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#bill-view .section-heading {
  justify-content: center;
  text-align: center;
}

#bill-view #bill-eyebrow,
#bill-view .sync-status,
.customer-bill-panel > .total-row {
  display: none;
}

.bill-hero {
  display: grid;
  gap: 4px;
  padding: 6px 12px 8px;
  text-align: center;
}

.bill-hero p {
  color: var(--muted);
  font-size: 15px;
}

.bill-hero strong {
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1;
}

.bill-summary-box {
  display: grid;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 12px 14px;
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bill-summary-box div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  font-size: 15px;
}

.bill-detail-table {
  display: grid;
  gap: 0;
  margin: 0 -16px;
}

.bill-table-head,
.bill-table-row {
  display: grid;
  grid-template-columns: 1fr 56px 104px;
  gap: 10px;
  align-items: start;
}

.bill-table-head {
  padding: 10px 16px;
  background: #eeeeeb;
  font-size: 15px;
}

.bill-table-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
}

.customer-bill-panel #request-checkout {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 84px;
  z-index: 31;
  width: min(560px, calc(100% - 36px));
  min-height: 52px;
  margin: 0 auto;
  border-color: #dc7625;
  border-radius: 999px;
  background: #dc7625;
  font-size: 17px;
  box-shadow: 0 12px 26px rgba(126, 72, 16, 0.24);
}

.customer-bill-panel #request-checkout:disabled {
  border-color: #d7d2ca;
  background: #d7d2ca;
  color: #716b63;
  box-shadow: none;
}

.bill-empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 0 -16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.admin-import-page {
  display: none;
  min-height: 100vh;
  padding: 24px;
}

body.import-mode .topbar,
body.import-mode main,
body.import-mode .bottom-cart,
body.import-mode .customer-bottom-nav,
body.staff-active .bottom-cart,
body.staff-active .customer-bottom-nav,
body.staff-route .bottom-cart,
body.staff-route .customer-bottom-nav,
body.owner-admin-mode .customer-bottom-nav {
  display: none;
}

body.import-mode .admin-import-page {
  display: grid;
  place-items: start center;
}

.admin-import-card {
  display: grid;
  gap: 14px;
  width: min(780px, 100%);
  padding: 18px;
}

.admin-import-topbar {
  display: flex;
  justify-content: flex-start;
}

.admin-import-back {
  display: inline-flex;
  width: auto;
  min-height: 40px;
  align-items: center;
  text-decoration: none;
}

.import-login {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
}

.import-area {
  display: none;
  gap: 12px;
}

.import-area.open {
  display: grid;
}

.bottom-cart {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 84px;
  z-index: 30;
  display: none;
  pointer-events: none;
}

.bottom-cart.has-items {
  display: block;
}

body:not(.customer-active) .bottom-cart.has-items {
  display: none;
}

.bottom-order-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(560px, 100%);
  min-height: 52px;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  background: #dc7625;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(126, 72, 16, 0.24);
  pointer-events: auto;
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.bottom-order-cta:hover {
  background: #e07b2a;
  box-shadow: 0 14px 30px rgba(126, 72, 16, 0.28);
}

.bottom-order-cta:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 8px 18px rgba(126, 72, 16, 0.2);
}

.bottom-order-cta:disabled {
  display: none;
}

.bottom-order-cta strong {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: #dc7625;
}

.cart-icon {
  font-size: 13px;
  font-weight: 900;
}

.bottom-cart-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

#bottom-cart-jump,
#bottom-submit-order {
  display: none !important;
}

.customer-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 29;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 22px rgba(31, 37, 35, 0.12);
  backdrop-filter: blur(14px);
}

.bottom-nav-button {
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 0 4px;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.bottom-nav-button.active {
  border-color: #dc7625;
  background: #fff8ef;
  color: #9b541a;
}

.bottom-nav-button:hover {
  background: #fff8ef;
  color: #9b541a;
}

.bottom-nav-button:active {
  transform: translateY(1px);
}

.language-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.28);
}

.language-sheet[hidden] {
  display: none;
}

.language-card {
  display: grid;
  gap: 10px;
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-page-title {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -18px -18px 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.96);
  text-align: center;
}

.customer-history-list {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.customer-history-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.history-card-head,
.history-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.debug-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 82px;
  z-index: 30;
  display: none;
  padding: 9px 12px;
  border: 1px solid #f2c078;
  border-radius: 8px;
  background: #fff8e8;
  color: #795000;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(31, 37, 35, 0.14);
}

.debug-panel.show {
  display: block;
}

.option-fields,
.confirm-list {
  display: grid;
  gap: 10px;
}

#options-dialog .option-fields {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

#confirm-dialog .confirm-list {
  max-height: min(54dvh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}

.confirm-line {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.confirm-line-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.confirm-line-main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.confirm-line-main strong {
  white-space: nowrap;
}

.confirm-line-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-delete-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(194, 47, 42, 0.28);
  border-radius: 8px;
  background: #fff4ef;
  color: var(--accent);
  font-weight: 800;
}

.option-group {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.option-group legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.choice-grid.is-multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-card-body {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.choice-card input:checked + .choice-card-body {
  border-color: var(--accent);
  background: #fff4ef;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 4px 12px rgba(194, 47, 42, 0.12);
}

.choice-card input:focus-visible + .choice-card-body {
  outline: 2px solid rgba(194, 47, 42, 0.28);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .choice-grid,
  .choice-grid.is-multi {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 420px) {
  .confirm-line-main {
    grid-template-columns: 1fr;
  }

  .confirm-line-tools {
    justify-content: space-between;
  }
}

small {
  color: var(--muted);
}

@media (max-width: 980px) {
  body {
    padding-bottom: 158px;
  }

  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-report-grid {
    grid-template-columns: 1fr;
  }

  body.customer-active .bottom-cart.has-items {
    display: block;
  }

  .customer-layout {
    grid-template-columns: 1fr;
  }

  .menu-area {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
  }

  .table-panel,
  .cart-panel {
    display: none;
  }

  .cart-panel {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .set-editor-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 12px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .view-switch {
    gap: 6px;
  }

  .nav-button {
    min-height: 38px;
    padding: 0 12px;
  }

  .owner-admin-page {
    padding: 18px 14px 48px;
  }

  .owner-login-card {
    gap: 16px;
    padding: 16px;
  }

  .owner-login-form {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .business-day-panel,
  .owner-backup-row {
    grid-template-columns: 1fr;
  }

  .checkout-table-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-login-form .hint {
    grid-column: auto;
  }

  main {
    padding: 10px;
  }

  .table-panel {
    display: none;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    align-items: center;
    padding: 10px;
  }

  .table-panel label {
    grid-column: 1 / -1;
  }

  .table-panel select {
    min-height: 40px;
    padding: 8px 10px;
  }

  .table-panel .hint {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 12px;
  }

  .table-panel .secondary-button {
    min-height: 40px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-area .section-heading {
    align-items: center;
    flex-direction: row;
  }

  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading input {
    max-width: none;
  }

  .menu-grid,
  .form-grid,
  .form-section-grid,
  .category-form,
  .staff-tabs,
  .report-summary,
  .owner-new-store,
  .owner-store-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .form-section {
    padding: 12px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .form-submit-bar {
    bottom: 78px;
    justify-content: stretch;
  }

  .form-submit-bar .primary-button {
    width: 100%;
  }

  .customer-bill-panel #request-checkout {
    left: 14px;
    right: 14px;
    bottom: 82px;
    width: calc(100% - 28px);
  }

  .option-editor-head,
  .option-choice-row {
    grid-template-columns: 1fr;
  }

  .menu-grid {
    gap: 8px;
  }

  .menu-card {
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    gap: 8px 10px;
    min-height: 0;
    padding: 10px;
    box-shadow: none;
  }

  .item-photo {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    font-size: 12px;
  }

  .item-main h3 {
    font-size: 16px;
    line-height: 1.25;
  }

  .zh-name {
    margin: 2px 0 0;
  }

  .price {
    font-size: 16px;
  }

  .tags {
    min-height: 0;
    margin: 0;
    font-size: 12px;
  }

  .menu-card .primary-button {
    min-height: 38px;
    font-size: 14px;
  }

  .order-top,
  .admin-row,
  .printer-row,
  .checkout-top,
  .report-order-head {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .order-meta-stack {
    justify-items: start;
  }

  .order-table {
    font-size: 26px;
  }

  .order-summary-row,
  .admin-actions,
  .checkout-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions .action-button,
  .checkout-actions .action-button {
    width: 100%;
  }

  .admin-item {
    align-items: flex-start;
  }

  .owner-store-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
