:root {
  color-scheme: light;
  --bg: #f8efe7;
  --card: #fffaf5;
  --ink: #2c1a12;
  --muted: #695446;
  --brand: #8b4a2f;
  --brand-dark: #4a2a1e;
  --cream: #f3d8b8;
  --gold: #d79a43;
  --success: #25643e;
  --danger: #b33a2f;
  --shadow: 0 18px 60px rgba(71, 37, 20, 0.15);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(215, 154, 67, 0.28), transparent 30rem),
    linear-gradient(160deg, #fff8ef 0%, var(--bg) 55%, #ead0bb 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 18px;
}

.hero,
.card,
.drink-card {
  border: 1px solid rgba(74, 42, 30, 0.08);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 190px;
  padding: 28px;
  border-radius: 34px;
  overflow: hidden;
}

.event-ads {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.event-ads[hidden] { display: none; }
.event-ads::-webkit-scrollbar { display: none; }

.event-ad {
  position: relative;
  flex: 0 0 min(86vw, 620px);
  min-height: 128px;
  overflow: hidden;
  border: 1px solid rgba(74, 42, 30, 0.12);
  border-radius: 24px;
  background: var(--brand-dark);
  color: #fff;
  scroll-snap-align: start;
  box-shadow: var(--shadow);
}

.event-ad img {
  width: 100%;
  height: 170px;
  display: block;
  object-fit: cover;
}

.event-ad.has-photo .event-copy {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 18px 16px;
  background: linear-gradient(transparent, rgba(32, 16, 10, 0.92));
}

.event-ad.text-only .event-copy { padding: 22px; }
.event-copy strong { display: block; font-size: 1.25rem; }
.event-copy p { margin: 4px 0 0; color: #fff; white-space: pre-line; }
.event-discount { display: inline-block; margin-bottom: 7px; padding: 4px 8px; border-radius: 999px; background: #f3dec2; color: var(--brand-dark); font-size: .72rem; font-weight: 900; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 13vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 8px;
}

.hero-copy {
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.55;
}

.cup {
  position: relative;
  flex: 0 0 118px;
  width: 118px;
  height: 118px;
  border-radius: 28px 28px 46px 46px;
  background: linear-gradient(160deg, var(--brand), var(--brand-dark));
  box-shadow: inset 0 -18px 32px rgba(0, 0, 0, 0.18);
}

.cup::before {
  content: "";
  position: absolute;
  top: 30px;
  right: -34px;
  width: 48px;
  height: 54px;
  border: 12px solid var(--brand-dark);
  border-left: 0;
  border-radius: 0 34px 34px 0;
}

.cup span {
  position: absolute;
  inset: 12px 14px auto;
  height: 20px;
  border-radius: 999px;
  background: var(--cream);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.68);
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--brand-dark);
}

.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 16px;
}

.card {
  padding: 22px;
  border-radius: 28px;
}

.member-header,
.section-title,
.drink-top,
.drink-bottom,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--brand-dark);
  background: #f3dec2;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.muted-pill {
  color: var(--muted);
  background: #eee1d7;
}

.points-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0;
}

.points-row > div {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
}

.points-row strong {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
}

.points-row span,
.muted {
  color: var(--muted);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ead8ca;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--brand));
  transition: width 240ms ease;
}

.reward-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  background: #fff3e2;
  border: 1px solid #e3c8a8;
}

.reward-action div { display: grid; gap: 3px; }
.reward-action .primary-btn { flex-shrink: 0; }

.barcode-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px dashed rgba(74, 42, 30, 0.2);
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.qr-code {
  width: 224px;
  height: auto;
  max-width: 100%;
  margin-bottom: 12px;
  border-radius: 16px;
}

.drink-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 12px;
}

.drink-points { margin-left: auto; }

.menu-prices { display: grid; gap: 2px; }
.original-price { color: var(--muted); font-size: .78rem; }
.discount-pill { margin-left: auto; border-radius: 999px; padding: 6px 9px; background: #25643e; color: white; font-size: .72rem; font-weight: 900; }

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.category-button {
  border: 1px solid #d9c4b3;
  border-radius: 24px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  min-height: 44px;
}

.category-button.active {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}

.category-empty { grid-column: 1 / -1; padding: 20px 0; }
.menu-category { display: block; margin-bottom: 8px; }

.order-photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}

.barcode svg {
  width: min(100%, 360px);
  height: auto;
}

.member-code {
  margin: 8px 0 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.small {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.drink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.order-item {
  display: grid;
  gap: 8px;
  min-height: 118px;
  border: 1px solid rgba(74, 42, 30, 0.12);
  border-radius: 18px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.order-item.active {
  border-color: rgba(139, 74, 47, 0.45);
  background: #fff3e2;
}

.order-item span {
  font-size: 1.45rem;
}

.order-item strong {
  display: block;
}

.order-item small {
  color: var(--muted);
  font-weight: 800;
}

.order-adjustment-note { color: var(--brand) !important; }
.service-field { max-width: 280px; margin-bottom: 0; }
.configured-lines { display: grid; gap: 8px; }
.configured-order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
}
.configured-order-line small { display: block; margin-top: 2px; }
.configured-order-line .line-note-input { grid-column: 1 / -1; }
.line-note-input { min-height: 38px; border-radius: 10px; font-size: .82rem; }
.special-request { color: #914814 !important; }
.qty-controls.compact { grid-template-columns: 32px 24px 32px; margin: 0; gap: 3px; }
.qty-controls.compact button { width: 32px; height: 32px; }
.menu-options { min-height: 0 !important; margin-top: -8px; font-size: 0.84rem; }
.adjust-item-btn {
  min-height: 36px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  color: var(--brand-dark);
  background: #fff;
  font-weight: 800;
}

.order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
}
.staff-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.order-summary strong {
  display: block;
  margin-top: 4px;
}

.reward-preview {
  margin-bottom: 14px;
  padding: 16px;
  border: 2px solid var(--success);
  border-radius: 18px;
  color: #17482c;
  background: #e6f5ec;
}

.reward-preview strong { display: block; margin-bottom: 4px; }
.reward-preview .reward-balance { margin: 8px 0 0; }
.reward-preview button { margin-top: 12px; }
.reward-confirm { background: var(--success); }

.qty-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.qty-controls button {
  width: 42px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--brand-dark);
  font-size: 1.25rem;
  font-weight: 900;
}

.qty-controls b {
  text-align: center;
  font-size: 1.1rem;
}

.drink-card {
  padding: 18px;
  border-radius: 24px;
}

.drink-card p {
  min-height: 48px;
  color: var(--muted);
  line-height: 1.45;
}

.primary-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  font-weight: 850;
}

.primary-btn {
  border: 0;
  color: #fff;
  background: var(--brand-dark);
}

.ghost-btn {
  border: 1px solid rgba(74, 42, 30, 0.14);
  color: var(--brand-dark);
  background: #fff7ed;
}

.activity-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
}

.activity-list strong {
  color: var(--ink);
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: var(--brand-dark);
  font-weight: 850;
}

select,
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(74, 42, 30, 0.14);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

.scanner {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border-radius: 24px;
  background: #20150f;
}

.scanner video {
  display: block;
  width: 100%;
  min-height: 240px;
  object-fit: cover;
}

#scanSuccess,
#rewardDialog,
#orderAdjustmentDialog,
#orderOptionsDialog {
  width: min(90vw, 420px);
  border: 0;
  border-radius: 24px;
  padding: 28px;
  color: var(--ink);
  background: var(--card);
}

#scanSuccess::backdrop,
#rewardDialog::backdrop,
#orderAdjustmentDialog::backdrop,
#orderOptionsDialog::backdrop {
  background: rgba(32, 21, 15, 0.6);
}

#orderAdjustmentDialog,
#orderOptionsDialog { text-align: left; }
#orderAdjustmentDialog .field,
#orderOptionsDialog .field { margin: 14px 0; }
.option-total { padding: 12px; border-radius: 14px; color: var(--brand-dark); background: #f7e8d6; font-weight: 900; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.dialog-actions .primary-btn { grid-column: 1 / -1; }

#rewardDialog { text-align: center; }
#rewardDialog .qr-code { display: block; margin: 18px auto 8px; }
#rewardDialog .ghost-btn { width: 100%; }
.reward-countdown { color: var(--brand-dark); font-weight: 850; }
.reward-catalog { display: grid; gap: 10px; margin: 18px 0; max-height: 52vh; overflow: auto; text-align: left; }
.reward-option { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid #ddc8b4; border-radius: 14px; color: var(--ink); background: #fff7ed; text-align: left; }
.reward-option.text-only { grid-template-columns: minmax(0, 1fr) auto; }
.reward-option img { width: 52px; height: 52px; border-radius: 11px; object-fit: cover; }
.reward-option span { display: grid; gap: 2px; }
.reward-option b { white-space: nowrap; color: var(--brand-dark); }
.reward-option:disabled { background: #f0ece7; }

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

.scanner-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
}

.admin-actions,
.manual-entry {
  margin-top: 14px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.manual-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.manual-entry .field { margin: 0; }

.admin-actions > button,
.manual-entry > button {
  width: 100%;
}

.assistance-card h3 { margin-bottom: 4px; }
.assistance-lookup { align-items: end; }
.member-result {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid rgba(74, 42, 30, 0.12);
  border-radius: 18px;
  background: #fff;
}
.member-result strong { display: block; font-size: 1.12rem; }
.member-result span { color: var(--muted); }
.assistance-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(74, 42, 30, 0.12);
}
.assistance-section .field { margin: 12px 0; }
.assistance-section > button { width: 100%; }
.adjustment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notice {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 16px;
  color: var(--brand-dark);
  background: #f7e8d6;
}

.notice:empty { display: none; }

.notice.success {
  color: var(--success);
  background: #e6f5ec;
}

.notice.error {
  color: var(--danger);
  background: #fde9e6;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px;
  }

  .hero {
    align-items: flex-start;
    padding: 22px;
  }

  .cup {
    flex-basis: 82px;
    width: 82px;
    height: 82px;
    border-radius: 22px 22px 34px 34px;
  }

  .cup::before {
    right: -24px;
    width: 34px;
    height: 38px;
    border-width: 9px;
  }

  .reward-action { align-items: stretch; flex-direction: column; }
  .manual-entry,
  .adjustment-grid { grid-template-columns: 1fr; }
}

/* Compact 2026 interface */
:root {
  --bg: #f3f6f3;
  --card: #ffffff;
  --ink: #1f2d27;
  --muted: #64736b;
  --brand: #b45a35;
  --brand-dark: #285846;
  --cream: #f4e4d8;
  --gold: #d68b36;
  --success: #24704f;
  --danger: #b4473b;
  --shadow: 0 8px 28px rgba(32, 54, 44, .08);
}
body { background: linear-gradient(180deg, #f8faf8 0%, var(--bg) 100%); }
.app-shell { width: min(100%, 720px); padding: 10px 12px 24px; }
.utility-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 8px; }
.telegram-fullscreen { min-height: 34px; border: 1px solid #d9e2dc; border-radius: 10px; padding: 6px 10px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
html.telegram-fullscreen-active body { padding: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px)) max(env(safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px)) max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px)) max(env(safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px)); }
.language-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.language-control select { width: auto; min-width: 108px; min-height: 34px; padding: 0 30px 0 10px; border-radius: 10px; background-color: #fff; }
.hero { min-height: 112px; padding: 17px 20px; border-radius: 20px; }
.hero h1 { margin-bottom: 5px; font-size: clamp(2rem, 9vw, 3.2rem); letter-spacing: -.055em; }
.hero-copy { margin-bottom: 0; max-width: 42ch; font-size: .86rem; line-height: 1.4; }
.cup { flex-basis: 68px; width: 68px; height: 68px; border-radius: 18px 18px 28px 28px; }
.cup::before { top: 20px; right: -21px; width: 29px; height: 32px; border-width: 8px; }
.cup span { inset: 8px 10px auto; height: 12px; }
.event-ads { margin: 10px 0; gap: 8px; }
.event-ad { min-height: 96px; border-radius: 16px; box-shadow: var(--shadow); }
.event-ad img { height: 132px; }
.event-ad.has-photo .event-copy { padding: 28px 14px 12px; }
.event-ad.text-only .event-copy { padding: 15px; }
.tabs { position: sticky; z-index: 8; top: 0; margin: 10px 0; padding: 4px; border: 1px solid #dfe7e1; border-radius: 14px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); }
.tab { min-height: 39px; padding: 8px; border-radius: 10px; font-size: .86rem; }
.tab.active { background: var(--brand-dark); }
.view.active { gap: 10px; }
.card { padding: 15px; border-radius: 18px; }
.hero, .card, .drink-card { border-color: #e2e8e3; box-shadow: var(--shadow); }
.eyebrow { margin-bottom: 4px; font-size: .65rem; }
h2 { font-size: clamp(1.18rem, 4.5vw, 1.55rem); }
.pill { padding: 5px 8px; color: #744025; background: #f8e7da; font-size: .7rem; }
.points-row { gap: 8px; margin: 13px 0; }
.points-row > div { padding: 12px; border: 1px solid #edf0ed; border-radius: 13px; }
.points-row strong { font-size: 1.8rem; }
.progress-track { height: 8px; }
.reward-action { margin-top: 11px; padding: 11px; border-color: #ead8ca; border-radius: 13px; background: #fff8f2; }
.barcode-panel { margin-top: 12px; padding: 12px; border-radius: 14px; }
.qr-code { width: 190px; margin-bottom: 7px; border-radius: 10px; }
.activity-list { gap: 7px; margin-top: 10px; }
.activity-list li { padding: 9px 10px; border: 1px solid #edf0ed; border-radius: 11px; font-size: .84rem; }
.category-filters { flex-wrap: nowrap; gap: 6px; margin: 10px -2px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.category-filters::-webkit-scrollbar { display: none; }
.category-button { flex: 0 0 auto; min-height: 38px; padding: 7px 12px; border-color: #d9e1dc; border-radius: 10px; background: #fff; font-size: .82rem; }
.category-button.active { border-color: var(--brand-dark); background: var(--brand-dark); }
.drink-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.drink-card { padding: 12px; border-radius: 15px; }
.drink-photo { height: 110px; margin-bottom: 8px; border-radius: 11px; }
.drink-card h3 { margin-bottom: 3px; font-size: .98rem; }
.drink-card p { min-height: 0; margin-bottom: 10px; font-size: .8rem; }
.drink-bottom { align-items: flex-end; }
.drink-bottom > .muted { display: none; }
.order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 11px 0; }
.order-item { min-height: 0; gap: 6px; padding: 10px; border-color: #dfe6e1; border-radius: 13px; }
.order-item.active { border-color: #d39a78; background: #fff8f3; }
.order-photo { width: 48px; height: 48px; border-radius: 9px; }
.qty-controls { grid-template-columns: 36px 1fr 36px; gap: 5px; }
.qty-controls button { width: 36px; height: 34px; border-radius: 9px; background: var(--brand-dark); }
.configured-order-line { grid-column: 1 / -1; padding: 7px; border: 1px solid #e9eeea; border-radius: 9px; }
.line-note-input { min-height: 36px; border-radius: 9px; }
.adjust-item-btn { min-height: 34px; border-color: #b7c9bf; border-radius: 9px; color: var(--brand-dark); }
.order-summary { margin-bottom: 9px; padding: 11px; border: 1px solid #e5ebe7; border-radius: 13px; }
.primary-btn, .ghost-btn { min-height: 40px; border-radius: 10px; padding: 0 12px; }
.primary-btn { background: var(--brand-dark); }
.ghost-btn { border-color: #d9e2dc; color: var(--brand-dark); background: #fff; }
.field { gap: 5px; margin: 12px 0; }
select, input { min-height: 42px; border-color: #d8e1db; border-radius: 10px; padding: 0 11px; }
.scanner, .scanner video { min-height: 210px; border-radius: 15px; }
.member-result, .reward-preview { padding: 12px; border-radius: 12px; }
#scanSuccess, #rewardDialog, #orderAdjustmentDialog, #orderOptionsDialog { width: min(94vw, 420px); max-height: 90vh; padding: 20px; border-radius: 17px; }

@media (max-width: 420px) {
  .app-shell { padding-inline: 9px; }
  .hero { padding: 14px 15px; }
  .cup { display: none; }
  .card { padding: 12px; }
  .drink-grid, .order-grid { gap: 7px; }
  .drink-card, .order-item { padding: 9px; }
  .drink-photo { height: 92px; }
  .admin-actions { grid-template-columns: 1fr; gap: 7px; }
  .manual-entry, .adjustment-grid { grid-template-columns: 1fr; }
  .staff-links { width: 100%; justify-content: stretch; }
  .staff-links button { flex: 1; }
}

/* Monochrome mobile staff UI */
:root {
  --bg: #f3f3f1;
  --card: #ffffff;
  --ink: #111111;
  --muted: #666a67;
  --brand: #111111;
  --brand-dark: #111111;
  --cream: #eeeeeb;
  --gold: #16754a;
  --success: #16754a;
  --danger: #c5322d;
  --shadow: 0 6px 24px rgba(0, 0, 0, .07);
}

html,
body { max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { background: #f3f3f1; }
.app-shell { max-width: 720px; }
@media (min-width: 900px) {
  html.telegram-fullscreen-active .app-shell { width: min(100%, 960px); max-width: 960px; padding-inline: 22px; }
  html.telegram-fullscreen-active .drink-grid,
  html.telegram-fullscreen-active .order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.telegram-fullscreen-active .drink-card { padding: 16px; }
  html.telegram-fullscreen-active .drink-card h3 { font-size: 1.05rem; }
  html.telegram-fullscreen-active .drink-card p { font-size: .9rem; line-height: 1.5; }
}
.view.active { grid-template-columns: minmax(0, 1fr); }
.card { width: 100%; min-width: 0; }
.hero,
.card,
.drink-card { border-color: #dededb; }
.hero { background: #fff; }
.cup { background: linear-gradient(155deg, #2b2b2b, #050505); }
.cup::before { border-color: #050505; }
.cup span { background: #fff; }
.shop-logo { width: 82px; height: 82px; flex: 0 0 82px; border: 1px solid #dededb; border-radius: 18px; padding: 5px; object-fit: contain; background: #fff; }
.eyebrow { color: #555; }
.tabs { border-color: #dededb; }
.tab.active,
.category-button.active,
.primary-btn { border-color: #111; color: #fff; background: #111; }
.ghost-btn { border-color: #d3d3d0; color: #111; background: #fff; }
.pill { color: #111; background: #ededeb; }
.muted-pill { color: #606360; background: #ededeb; }
.discount-pill,
.event-discount { color: #fff; background: var(--success); }
.progress-track { background: #dededb; }
.progress-track span { background: var(--success); }
.reward-action { border-color: #cae1d4; background: #f1f8f4; }
.category-button { border-color: #d5d5d2; }
.order-item.active { border-color: var(--success); background: #f0f8f3; box-shadow: inset 3px 0 0 var(--success); }
.qty-controls button { background: #111; }
.adjust-item-btn { border-color: #bbb; color: #111; }
.order-adjustment-note,
.special-request { color: #a72925 !important; }
.notice.success { color: #0d603a; background: #e9f6ef; }
.notice.error { color: #9f231f; background: #fbeceb; }
.section-title > *,
.hero > *,
.drink-top > *,
.drink-bottom > *,
.order-item > *,
.configured-order-line > * { min-width: 0; }
.hero-copy,
.drink-card h3,
.drink-card p,
.barcode-panel .small,
.reward-action span { overflow-wrap: anywhere; word-break: normal; white-space: normal; }
.drink-card,
.barcode-panel { min-width: 0; overflow: hidden; }

.language-control { display: flex; align-items: center; gap: 8px; }
.language-switcher { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #d4d4d1; border-radius: 11px; background: #e9e9e6; }
.language-switcher button { min-height: 30px; border: 0; border-radius: 8px; padding: 4px 9px; color: #555; background: transparent; font-size: 11px; font-weight: 850; white-space: nowrap; }
.language-switcher button.active { color: #fff; background: #111; box-shadow: 0 1px 5px rgba(0, 0, 0, .2); }

.choice-trigger { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #cececb; border-radius: 11px; padding: 0 13px; color: #111; background: #fff; font-weight: 800; text-align: left; }
.choice-trigger > span:last-child { font-size: 18px; }
.choice-dialog { width: min(94vw, 430px); max-height: min(82vh, 640px); border: 0; border-radius: 18px; padding: 18px; color: #111; background: #fff; }
.choice-dialog::backdrop { background: rgba(0, 0, 0, .58); backdrop-filter: blur(2px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.icon-button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid #d5d5d2; border-radius: 50%; color: #111; background: #fff; font-size: 24px; line-height: 1; }
.table-picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; padding: 1px; }
.table-choice { min-height: 52px; border: 1px solid #d5d5d2; border-radius: 11px; color: #111; background: #f8f8f7; font-weight: 800; }
.table-choice:first-child { grid-column: 1 / -1; }
.table-choice.selected { border-color: #111; color: #fff; background: #111; }

.option-field { margin: 15px 0; border: 0; padding: 0; }
.option-field legend { margin-bottom: 8px; color: #111; font-size: .82rem; font-weight: 850; }
.option-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.option-choice { display: grid; min-height: 52px; align-content: center; gap: 2px; border: 1px solid #d5d5d2; border-radius: 11px; padding: 8px 10px; color: #111; background: #f8f8f7; text-align: left; }
.option-choice strong { overflow-wrap: anywhere; }
.option-choice small { color: #6b6b68; font-size: .7rem; }
.option-choice.selected { border-color: #111; color: #fff; background: #111; }
.option-choice.selected small { color: #d8d8d5; }
#tablePickerDialog::backdrop { background: rgba(0, 0, 0, .58); }
.reward-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.reward-dialog-actions button { width: 100%; }

@media (max-width: 600px) {
  html.telegram-fullscreen-active body {
    padding-top: max(64px, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  }
  html.telegram-fullscreen-active .tabs {
    top: max(64px, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  }
  .app-shell { padding-inline: 12px; }
  .utility-bar { justify-content: stretch; flex-wrap: wrap; }
  .telegram-fullscreen { flex: 0 0 auto; }
  .language-control { width: 100%; justify-content: space-between; }
  .language-switcher { margin-left: auto; }
  .hero { min-height: 108px; padding: 16px; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.75rem); line-height: 1; }
  .hero-copy { max-width: 100%; font-size: .84rem; }
  .cup { display: none; }
  .drink-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .drink-card { padding: 14px; }
  .drink-card h3 { font-size: 1rem; }
  .drink-card p { margin-bottom: 8px; font-size: .86rem; line-height: 1.45; }
  .barcode-panel { padding-inline: 10px; }
  .barcode-panel .small { max-width: 100%; line-height: 1.45; }
  #adminView > .section-title { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  #adminView > .section-title > h2 { font-size: 1.4rem; }
  .staff-links { display: grid; grid-template-columns: 1fr; width: 100%; }
  .staff-links button { width: 100%; }
  .admin-card > .section-title { align-items: flex-start; }
  .service-field { max-width: none; }
  .order-grid { grid-template-columns: 1fr; gap: 8px; }
  .order-item { grid-template-columns: 52px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 10px; }
  .order-item > .order-photo,
  .order-item > span:first-child { grid-column: 1; grid-row: 1 / span 2; }
  .order-item > strong { grid-column: 2; grid-row: 1; align-self: end; overflow-wrap: anywhere; }
  .order-item > small { grid-column: 2; grid-row: 2; align-self: start; overflow-wrap: anywhere; }
  .order-item > .qty-controls { grid-column: 1 / -1; grid-row: auto; width: 100%; margin: 2px 0 0; }
  .order-item > .qty-controls button { width: 100%; }
  .order-item > .configured-lines,
  .order-item > .line-note-input,
  .order-item > .order-adjustment-note,
  .order-item > .adjust-item-btn { grid-column: 1 / -1; }
  .order-item.text-only { grid-template-columns: minmax(0, 1fr); }
  .order-item.text-only > strong,
  .order-item.text-only > small { grid-column: 1; }
  .configured-order-line { grid-template-columns: minmax(0, 1fr) auto; }
  .order-summary { position: sticky; z-index: 5; bottom: 8px; box-shadow: 0 8px 25px rgba(0, 0, 0, .14); }
  .admin-actions { grid-template-columns: 1fr 1fr; }
  .admin-actions > button { min-width: 0; padding-inline: 8px; white-space: normal; }
  .shop-logo { width: 68px; height: 68px; flex-basis: 68px; }
}

@media (max-width: 370px) {
  .language-control > span { display: none; }
  .language-switcher { width: 100%; }
  .language-switcher button { flex: 1; }
  .order-item { grid-template-columns: 44px minmax(0, 1fr); }
  .order-item.text-only { grid-template-columns: minmax(0, 1fr); }
  .order-photo { width: 44px; height: 44px; }
  .order-item > .qty-controls { grid-column: 1 / -1; grid-row: auto; width: 100%; }
}

.low-data-device *, .low-data-device *::before, .low-data-device *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
  backdrop-filter: none !important;
}
.low-data-device .card,
.low-data-device .order-summary { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.membership-paused .drink-points { display: none; }
