:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --surface-strong: #e5edf3;
  --ink: #14202b;
  --muted: #667482;
  --line: #d9e2e8;
  --green: #198754;
  --green-soft: #e9f7ef;
  --blue: #0d6efd;
  --blue-soft: #eaf2ff;
  --amber: #b86b00;
  --amber-soft: #fff3dc;
  --red: #c03a2b;
  --red-soft: #fdeceb;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-width: 0;
  padding: 12px 13px;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.app-shell {
  margin: 0 auto;
  max-width: 920px;
  min-height: 100vh;
  padding: 18px 14px 124px;
}

.hero {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.hero-copy,
.hero-actions {
  min-width: 0;
}

.hero-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 {
  font-size: 31px;
  line-height: 1.08;
  margin: 0;
}

.hero-note {
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.cart-pill,
.primary-button,
.secondary-button,
.ghost-button,
.context-button,
.payment-button,
.qty-button,
.radio-option,
.checkbox-option {
  border-radius: 8px;
}

.cart-pill,
.primary-button,
.secondary-button,
.ghost-button,
.context-button,
.payment-button,
.qty-button {
  align-items: center;
  border: 1px solid transparent;
  display: inline-flex;
  gap: 10px;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: 10px 14px;
  text-align: center;
}

.cart-pill {
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.banner {
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  margin: 16px 0 0;
  padding: 12px 14px;
  white-space: normal;
  word-break: break-word;
}

.banner--info {
  background: var(--blue-soft);
  border-color: #cddcff;
  color: #174a9c;
}

.banner--error {
  background: var(--red-soft);
  border-color: #f4c8c4;
  color: #8d2319;
}

.banner--success {
  background: var(--green-soft);
  border-color: #cbead8;
  color: #125c38;
}

.is-hidden {
  display: none !important;
}

.summary-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}

.summary-chip span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.summary-chip strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.menu-sections {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.section-block {
  display: grid;
  gap: 12px;
}

.section-header {
  display: grid;
  gap: 6px;
}

.section-header h2 {
  font-size: 23px;
  line-height: 1.12;
  margin: 0;
}

.section-header p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.item-grid {
  display: grid;
  gap: 12px;
}

.menu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 15px;
}

.menu-card.is-sold-out {
  opacity: 0.72;
}

.menu-card-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.menu-card-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.menu-card-copy h3 {
  font-size: 18px;
  line-height: 1.18;
  margin: 0;
  overflow-wrap: anywhere;
}

.menu-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-description {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}

.price-badge {
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 6px 10px;
}

.meta-pill.is-sold-out {
  background: var(--red-soft);
  color: var(--red);
}

.menu-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.menu-actions .secondary-button,
.menu-actions .primary-button {
  flex: 1 1 auto;
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px 18px;
  text-align: center;
}

.cart-bar {
  align-items: center;
  background: rgba(20, 32, 43, 0.96);
  bottom: 0;
  color: #ffffff;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  left: 0;
  padding: 14px;
  position: fixed;
  right: 0;
  z-index: 30;
}

.cart-bar-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-bar-copy strong,
.cart-bar-copy span {
  overflow-wrap: anywhere;
}

.cart-bar-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.overlay-backdrop {
  background: rgba(17, 24, 39, 0.44);
  inset: 0;
  position: fixed;
  z-index: 40;
}

.sheet {
  background: var(--surface);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  bottom: 0;
  box-shadow: var(--shadow);
  inset-inline: 0;
  margin: 0 auto;
  max-height: min(86vh, 860px);
  max-width: 920px;
  overflow: auto;
  padding: 18px 14px 22px;
  position: fixed;
  z-index: 50;
}

.sheet--wide {
  max-width: 980px;
}

.sheet-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet-header-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sheet-header-copy h2 {
  font-size: 24px;
  line-height: 1.14;
  margin: 0;
}

.sheet-header-copy p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}

.sheet-body {
  display: grid;
  gap: 16px;
}

.cart-items,
.option-groups,
.checkout-layout,
.live-stack {
  display: grid;
  gap: 14px;
}

.cart-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.cart-item-top {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.cart-item-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cart-item-copy strong,
.cart-item-copy span,
.cart-item-copy p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.cart-item-copy p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.cart-item-price {
  font-weight: 800;
  white-space: nowrap;
}

.cart-item-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.qty-stepper {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.qty-stepper span {
  font-weight: 700;
  min-width: 30px;
  text-align: center;
}

.qty-button {
  background: var(--surface);
  border-color: var(--line);
  font-weight: 800;
  padding-inline: 12px;
}

.cart-summary,
.checkout-summary,
.live-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.summary-row {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.summary-row span,
.summary-row strong {
  overflow-wrap: anywhere;
}

.summary-row.is-total {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

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

.option-group-header {
  display: grid;
  gap: 4px;
}

.option-group-header strong,
.option-group-header span {
  overflow-wrap: anywhere;
}

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

.radio-option,
.checkbox-option {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.radio-option input,
.checkbox-option input {
  flex-shrink: 0;
  margin-top: 2px;
  width: auto;
}

.choice-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.choice-copy strong,
.choice-copy span {
  overflow-wrap: anywhere;
}

.choice-copy span {
  color: var(--muted);
  font-size: 13px;
}

.option-tools {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.context-switch,
.payment-switch {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.context-button,
.payment-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
  min-height: 48px;
  width: 100%;
}

.context-button.is-active,
.payment-button.is-active {
  background: var(--blue-soft);
  border-color: #b9ccfb;
  color: #12429c;
}

.checkout-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.checkout-main,
.checkout-side,
.field-stack,
.field-grid,
.live-card,
.status-panel {
  display: grid;
  gap: 14px;
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.field.is-full {
  grid-column: 1 / -1;
}

.checkout-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  overflow-wrap: anywhere;
}

.live-view {
  background: var(--bg);
  inset: 0;
  overflow: auto;
  padding: 18px 14px 42px;
  position: fixed;
  z-index: 60;
}

.live-shell {
  margin: 0 auto;
  max-width: 760px;
}

.live-topbar {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.live-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.live-title h2 {
  font-size: 30px;
  line-height: 1.08;
  margin: 0;
}

.status-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  width: fit-content;
}

.status-badge.is-pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-badge.is-accepted {
  background: var(--blue-soft);
  color: #12429c;
}

.status-badge.is-ready,
.status-badge.is-completed {
  background: var(--green-soft);
  color: #125c38;
}

.status-badge.is-rejected,
.status-badge.is-cancelled {
  background: var(--red-soft);
  color: #8d2319;
}

.status-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.status-panel h3,
.live-card h3 {
  font-size: 18px;
  margin: 0;
}

.status-panel p,
.live-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-pill {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.loader {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}

@media (max-width: 820px) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .app-shell,
  .live-view {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero,
  .cart-bar,
  .menu-card-top,
  .cart-item-top,
  .live-topbar {
    flex-direction: column;
  }

  .hero-actions,
  .cart-bar-actions {
    align-items: stretch;
    width: 100%;
  }

  .hero-actions > *,
  .cart-bar-actions > *,
  .menu-actions > * {
    width: 100%;
  }

  .summary-strip,
  .context-switch,
  .payment-switch,
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .menu-actions {
    flex-direction: column;
  }

  .sheet {
    padding-left: 12px;
    padding-right: 12px;
  }

  .live-title h2,
  h1 {
    font-size: 28px;
  }
}
