/* ===== DESIGN SYSTEM ===== */
:root {
  --red: #E8192C;
  --red-dark: #C21024;
  --blue: #1A9FD8;
  --blue-dark: #168CBE;
  --pink: #FF3399;
  --white: #FFFFFF;
  --cream: #FAFAF8;          /* warm app background */
  --light-gray: #F2F2F0;     /* surfaces, chips */
  --hairline: #ECECE9;       /* separators */
  --mid-gray: #8A8A86;       /* secondary text */
  --dark: #1D1D1B;           /* primary text */
  --font: 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;

  --shadow-card: 0 2px 6px rgba(29,29,27,0.05), 0 10px 28px rgba(29,29,27,0.07);
  --shadow-cta: 0 8px 20px rgba(232,25,44,0.32);
  --shadow-bar: 0 -8px 28px rgba(29,29,27,0.08);
  --radius-card: 20px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 1080px;
  height: 100%;
  overflow: hidden;
  background: #eee;
  font-family: var(--font);
  color: var(--dark);
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: var(--font); }

/* ===== SCREEN SYSTEM ===== */
.screen {
  display: none;
  position: absolute;
  top: 0; left: 0;
  width: 1080px;
  height: 100vh;
  height: 100dvh;
  background: var(--cream);
  flex-direction: column;
  overflow: hidden;
}
.screen.active {
  display: flex;
}
.screen.slide-in {
  animation: slideIn 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.screen.slide-out {
  animation: slideOut 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.screen.zoom-in {
  animation: zoomIn 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.screen.zoom-out {
  animation: zoomOut 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.screen.back-in {
  animation: backIn 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes slideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(-30%); }
}
@keyframes backIn {
  from { transform: translateX(-30%); }
  to   { transform: translateX(0); }
}
@keyframes zoomIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes zoomOut {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(0.85); opacity: 0; }
}

/* ===== TOP NAV ===== */
.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 32px;
  min-height: 92px;
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.back-btn {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  font-size: 34px;
  color: var(--dark);
  background: var(--light-gray);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
  transition: background 0.15s, transform 0.1s;
}
.back-btn:active { background: var(--hairline); transform: scale(0.94); }
.top-nav-title {
  flex: 1;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.top-nav-subtitle {
  font-size: 17px;
  color: var(--mid-gray);
  font-weight: 400;
  margin-top: 2px;
}

/* ===== BOTTOM BAR ===== */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 0 32px;
  height: 112px;
  background: var(--white);
  box-shadow: var(--shadow-bar);
  flex-shrink: 0;
  z-index: 10;
}
.total-label {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
/* Back sits bottom-left; the price follows it, the CTA is pushed to the right. */
.bottom-bar .total-label { margin-right: auto; }
.cta-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 20px 48px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  box-shadow: var(--shadow-cta);
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
}
.cta-btn:disabled {
  background: var(--mid-gray);
  box-shadow: none;
  cursor: default;
}
.cta-btn:active { background: var(--red-dark); transform: scale(0.97); }

/* ===== SCROLLABLE CONTENT ===== */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ===== CATEGORY GRID (Screen 3) ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 20px;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.category-card:active { transform: scale(0.96); }
.cat-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}
.cat-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.2px;
  text-align: center;
}

/* ===== CATEGORY TAB BAR ===== */
/* .cat-tab-grid-btn (the ⊞ pill) is gone — plan 17 WP-4 retired the control;
 * the labelled ‹ in the title row (css/browse.css .nav-back) is its heir. */
.cat-tab-bar {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 16px;
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
  scrollbar-width: none;
  gap: 8px;
}
.cat-tab-bar::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  background: var(--light-gray);
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 26px;
  font-size: 18px;
  font-weight: 600;
  color: #55554F;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.cat-tab:active { transform: scale(0.96); }
.cat-tab.active {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(232,25,44,0.28);
}

/* ===== MENU ITEM ROW ===== */
.menu-list {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 24px;
  gap: 12px;
}
.menu-item-row {
  display: flex;
  align-items: center;
  min-height: 124px;
  cursor: pointer;
  position: relative;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: background 0.15s, transform 0.1s;
}
.menu-item-row:active { transform: scale(0.985); }
.menu-item-row.selected {
  background: var(--blue) !important;
  color: var(--white);
  box-shadow: 0 6px 18px rgba(26,159,216,0.32);
}
.menu-item-row.selected .item-desc { color: rgba(255,255,255,0.85); }
.item-photo {
  width: 168px;
  height: 124px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  position: relative;
  background: var(--light-gray);
}
.price-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255,255,255,0.95);
  color: var(--dark);
  font-size: 15px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(29,29,27,0.18);
}
.item-info {
  flex: 1;
  padding: 18px 24px 18px 20px;
}
.item-name {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.item-desc {
  font-size: 14.5px;
  color: var(--mid-gray);
  line-height: 1.45;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 24px;
}
.qty-btn {
  background: rgba(255,255,255,0.16);
  border: 2px solid rgba(255,255,255,0.65);
  font-size: 30px;
  color: var(--white);
  cursor: pointer;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, transform 0.1s;
}
.qty-btn:active { background: rgba(255,255,255,0.35); transform: scale(0.92); }
.qty-count {
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  min-width: 32px;
  text-align: center;
}
.qty-price-badge {
  background: rgba(255,255,255,0.25);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ===== TEXT-ONLY EXTRA ROW ===== */
.text-extra-row {
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: 0 32px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: background 0.15s, transform 0.1s;
}
.text-extra-row:active { transform: scale(0.985); }
.text-extra-row.selected {
  background: var(--blue) !important;
  color: var(--white);
  box-shadow: 0 6px 18px rgba(26,159,216,0.32);
}
.text-extra-row .check-icon {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ===== STEP PROGRESS BAR ===== */
.step-bar {
  display: flex;
  align-items: center;
  padding: 24px 32px 20px;
  gap: 0;
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
}
.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
}
.step-node::after {
  content: '';
  position: absolute;
  top: 21px;
  left: 50%;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--hairline);
  z-index: 0;
}
.step-node:last-child::after { display: none; }
.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--mid-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  z-index: 1;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.step-node.active .step-circle {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(232,25,44,0.35);
}
.step-node.done .step-circle {
  background: var(--red);
  color: var(--white);
}
.step-node.done::after { background: var(--red); }
.step-label {
  font-size: 14px;
  color: var(--mid-gray);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.step-node.active .step-label { color: var(--red); font-weight: 700; }

/* ===== EXTRAS COUNTER ===== */
.extras-header {
  padding: 20px 32px 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--mid-gray);
  flex-shrink: 0;
}
.extras-header span { color: var(--red); font-weight: 800; }

/* ===== SPECIAL REQUESTS ===== */
.special-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 32px;
}
.special-card {
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: outline 0.1s, transform 0.12s;
}
.special-card:active { transform: scale(0.97); }
.special-card.selected { outline: 4px solid var(--blue); }
.special-card .card-bg {
  position: absolute;
  inset: 0;
  font-size: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.special-card .card-label {
  position: relative;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  padding: 0 12px;
}
.special-card .price-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255,255,255,0.95);
  color: var(--dark);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* ===== ORDER CONFIRMATION ===== */
.confirm-section-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--mid-gray);
  padding: 28px 32px 14px;
}
.confirm-item-card {
  display: flex;
  margin: 0 32px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.confirm-item-photo {
  width: 240px;
  height: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background: var(--light-gray);
}
.confirm-item-info {
  flex: 1;
  padding: 28px;
}
.confirm-item-name {
  font-size: 27px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 18px;
}
.confirm-extras-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.confirm-extras-list li {
  font-size: 17px;
  color: #5E5E5A;
}
.confirm-extras-list li::before { content: '• '; color: var(--red); }

/* ===== CART ===== */
.cart-item-card {
  margin: 16px 32px;
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.cart-item-card:first-child { margin-top: 24px; }
.cart-item-top {
  display: flex;
  min-height: 140px;
}
.cart-item-photo {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  position: relative;
  background: var(--light-gray);
}
.cart-qty-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(26,159,216,0.35);
  white-space: nowrap;
}
.cart-item-info {
  flex: 1;
  padding: 22px 26px;
}
.cart-item-name {
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.cart-item-extras {
  font-size: 15px;
  color: var(--mid-gray);
  line-height: 1.8;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--cream);
  border-top: 1px solid var(--hairline);
}
.cart-action-btn {
  background: var(--white);
  color: var(--dark);
  border: 2px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.cart-action-btn:active { background: var(--light-gray); transform: scale(0.97); }
.cart-delete-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.15s;
}
.cart-delete-btn:active { background: rgba(232,25,44,0.08); }

/* ===== TOMBSTONE (soft delete) ===== */
.tombstone-row {
  margin: 16px 32px;
  border-radius: var(--radius-card);
  background: transparent;
  border: 2px dashed var(--hairline);
  display: flex;
  align-items: center;
  padding: 20px 24px;
  gap: 20px;
}
.tombstone-text { flex: 1; }
.tombstone-name { font-size: 20px; font-style: italic; color: var(--mid-gray); }
.tombstone-deleted { font-size: 15px; color: var(--mid-gray); }
.undo-btn {
  background: var(--white);
  border: 2px solid var(--dark);
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s;
}
.undo-btn:active { background: var(--light-gray); transform: scale(0.97); }

/* ===== CART BOTTOM BAR ===== */
.cart-summary-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-tray-badge {
  font-size: 26px;
}
.cart-count-badge {
  background: var(--red);
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== SPLASH SCREEN ===== */
#screen-splash {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(160deg, #FF3399 0%, #E0177F 55%, #C00563 100%);
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.splash-lang-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
}
/* ===== LANGUAGE TOGGLE (plan 17 WP-7) =====
 * HU | EN as a segmented pill. On the splash it sits in .splash-lang-bar (top
 * right, light-on-pink); on the welcome screen it is absolutely positioned top
 * right on the cream background. Filled by app.js renderLangToggles(); hidden
 * (the `hidden` attribute) until the menu lists two languages the chrome knows.
 * Replaces the dead .splash-lang-tab / .splash-flag-hint rules. */
.lang-toggle {
  display: inline-flex;
  margin-left: auto;
  padding: 4px;
  gap: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
}
.lang-toggle[hidden] { display: none; }
.lang-btn {
  min-width: 72px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.lang-btn:active { transform: scale(0.96); }
.lang-btn.active {
  background: var(--white);
  color: #C00563;
}
.lang-toggle-welcome {
  position: absolute;
  top: 28px;
  right: 32px;
  background: var(--light-gray);
  border-color: var(--hairline);
  backdrop-filter: none;
}
.lang-toggle-welcome .lang-btn { color: var(--mid-gray); }
.lang-toggle-welcome .lang-btn.active {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(232,25,44,0.28);
}
.splash-tagline {
  color: rgba(255,255,255,0.92);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 36px;
}
.splash-headline {
  color: var(--white);
  font-size: 68px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.08;
  letter-spacing: -0.5px;
  max-width: 860px;
  margin-bottom: 22px;
}
.splash-sub {
  color: rgba(255,255,255,0.95);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 6px;
  margin-bottom: 72px;
}
.splash-logo {
  font-size: 48px;
  font-weight: 900;
  color: var(--red);
  background: var(--white);
  padding: 18px 56px;
  border-radius: 16px;
  letter-spacing: 2px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
}
.splash-tap-hint {
  position: absolute;
  bottom: 84px;
  color: var(--white);
  font-size: 20px;
  font-weight: 600;
  padding: 14px 34px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(4px);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:0.6} 50%{opacity:1} }

/* ===== WELCOME SCREEN ===== */
#screen-welcome {
  background: var(--white);
  align-items: center;
  justify-content: center;
}
.welcome-logo {
  font-size: 60px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 2px;
  margin-bottom: 88px;
}
.welcome-btn {
  width: 680px;
  padding: 50px;
  margin: 14px 0;
  border: none;
  border-radius: 28px;
  background: linear-gradient(180deg, #F12338 0%, var(--red) 100%);
  color: var(--white);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: transform 0.12s, box-shadow 0.15s;
}
.welcome-btn:active { transform: scale(0.97); box-shadow: 0 4px 12px rgba(232,25,44,0.3); }
.welcome-note {
  font-size: 16px;
  color: var(--mid-gray);
  margin-top: 28px;
  text-align: center;
  max-width: 680px;
  line-height: 1.5;
}
.vat-box {
  margin-top: 40px;
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px 32px;
  font-size: 15px;
  color: var(--mid-gray);
  max-width: 680px;
  text-align: center;
  line-height: 1.5;
}

/* ===== PAYMENT SCREEN ===== */
#screen-payment {
  background: var(--white);
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* Payment screen is centered with no bars — pin the (retry-only) back button bottom-left. */
#screen-payment .back-btn {
  position: absolute;
  left: 32px;
  bottom: 32px;
  z-index: 5;
}
.payment-icon { font-size: 150px; margin-bottom: 44px; animation: pulse 1.5s infinite; }
.payment-title { font-size: 46px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 14px; max-width: 800px; }
.payment-sub { font-size: 24px; color: var(--mid-gray); margin-bottom: 64px; }
.payment-amount { font-size: 64px; font-weight: 900; color: var(--red); letter-spacing: -1px; margin-bottom: 84px; }
.payment-done-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 28px 80px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: transform 0.12s, background 0.15s;
}
.payment-done-btn:active { background: var(--red-dark); transform: scale(0.97); }

/* ===== CONFIRMATION DIALOG ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,20,18,0.5);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.overlay.active { display: flex; }
.dialog {
  background: var(--white);
  border-radius: 28px;
  padding: 52px 48px 44px;
  width: 640px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.3);
  animation: dialogIn 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes dialogIn {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.dialog-title { font-size: 30px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 14px; }
.dialog-body { font-size: 20px; color: var(--mid-gray); line-height: 1.5; margin-bottom: 40px; }
.dialog-actions { display: flex; gap: 16px; }
.dialog-btn {
  flex: 1;
  padding: 22px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.dialog-btn:active { transform: scale(0.97); }
.dialog-btn.cancel { background: var(--light-gray); color: var(--dark); }
.dialog-btn.confirm { background: var(--red); color: var(--white); box-shadow: var(--shadow-cta); }

/* ===== TIP SCREEN ===== */
#screen-tip { background: var(--white); }
.tip-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 80px;
}
.tip-emoji { font-size: 110px; margin-bottom: 32px; }
.tip-title { font-size: 44px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 14px; max-width: 800px; }
.tip-sub { font-size: 22px; color: var(--mid-gray); margin-bottom: 56px; }
.tip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  width: 720px;
  margin-bottom: 48px;
}
.tip-btn {
  border: 2px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--cream);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.tip-btn:active {
  transform: scale(0.96);
  border-color: var(--red);
  background: #FFF4F5;
}
.tip-btn-heart { font-size: 40px; }
.tip-btn-amount { font-size: 32px; font-weight: 800; color: var(--dark); }
.tip-skip-btn {
  background: none;
  border: 2px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 22px 56px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--mid-gray);
  cursor: pointer;
  transition: transform 0.1s, color 0.15s, border-color 0.15s;
}
.tip-skip-btn:active { transform: scale(0.97); color: var(--dark); border-color: var(--mid-gray); }

/* ===== PAGER SCAN ===== */
.pager-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 80px;
}
.pager-emoji { font-size: 84px; margin-bottom: 18px; }
.pager-title { font-size: 40px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; max-width: 800px; }
.pager-sub { font-size: 21px; color: var(--mid-gray); margin-bottom: 26px; }
.pager-display {
  min-width: 300px;
  min-height: 92px;
  line-height: 92px;
  margin-bottom: 26px;
  padding: 0 28px;
  border: 3px dashed var(--hairline);
  border-radius: var(--radius-card);
  background: var(--cream);
  font-size: 60px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--dark);
}
.pager-display.empty { font-size: 24px; font-weight: 600; letter-spacing: normal; color: var(--mid-gray); }
.pager-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 520px;
  margin-bottom: 30px;
}
.pager-key {
  font-size: 40px;
  font-weight: 700;
  color: var(--dark);
  padding: 24px 0;
  border: 2px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--cream);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.1s, background 0.15s;
}
.pager-key:active { transform: scale(0.95); background: #FFF4F5; }
.pager-key-fn { font-size: 32px; color: var(--mid-gray); }
.pager-confirm-btn {
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 24px 64px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: transform 0.1s, opacity 0.15s;
}
.pager-confirm-btn:active { transform: scale(0.97); }
.pager-confirm-btn:disabled { opacity: 0.4; box-shadow: none; }

/* ===== PAYMENT STAGES ===== */
.payment-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.payment-tip-line { font-size: 22px; color: var(--pink); font-weight: 700; margin: -60px 0 60px; }
.payment-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid var(--light-gray);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: payment-spin 0.9s linear infinite;
}
@keyframes payment-spin { to { transform: rotate(360deg); } }
.payment-result-icon {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 84px;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 44px;
}
.payment-result-icon.success { background: #2EAD5B; box-shadow: 0 12px 32px rgba(46,173,91,0.35); }
.payment-result-icon.warn    { background: #F0A422; box-shadow: 0 12px 32px rgba(240,164,34,0.35); }
.payment-result-icon.error   { background: var(--red); box-shadow: var(--shadow-cta); }
.payment-card-info { font-size: 24px; font-weight: 700; color: var(--dark); margin: 0 0 20px; }
.payment-txid { font-size: 16px; color: var(--mid-gray); margin-bottom: 56px; }
.payment-recovered-note {
  max-width: 720px;
  background: #FFF7E8;
  border: 1px solid #F0A422;
  border-radius: 14px;
  padding: 18px 28px;
  font-size: 19px;
  color: #8A5B00;
  line-height: 1.5;
  margin: -28px 0 36px;
}
.payment-error-detail {
  font-size: 17px;
  color: var(--mid-gray);
  max-width: 720px;
  margin-bottom: 56px;
  word-break: break-word;
}
.payment-actions { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.payment-secondary-btn {
  background: none;
  border: 2px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 24px 64px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--dark);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}
.payment-secondary-btn:active { transform: scale(0.97); border-color: var(--mid-gray); }

/* ===== PAGER NUMBER CARD ===== */
.pager-card {
  background: var(--cream);
  border: 2px dashed var(--red);
  border-radius: var(--radius-card);
  padding: 28px 72px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-card);
}
.pager-label {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 6px;
}
.pager-number {
  font-size: 96px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--red);
  line-height: 1.1;
}
.pager-hint {
  font-size: 17px;
  color: var(--mid-gray);
  max-width: 440px;
  margin-top: 10px;
  line-height: 1.4;
}

/* ===== SERVICE LOCK (printer fault / fiscal day not open) ===== */
.service-lock { z-index: 200; background: rgba(20,20,18,0.82); }
.service-lock-icon { font-size: 72px; margin-bottom: 18px; }
.service-lock-hint { font-size: 16px; color: var(--mid-gray); min-height: 20px; }
