:root {
  --bg: var(--tg-theme-secondary-bg-color, #0d1016);
  --surface: var(--tg-theme-bg-color, #161b24);
  --surface-elevated: #1e2430;
  --surface-muted: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.085);
  --text: var(--tg-theme-text-color, #f4f6fb);
  --hint: var(--tg-theme-hint-color, #8e98ab);
  --accent: #f43f5e;
  --accent-soft: rgba(244, 63, 94, 0.16);
  --accent-text: #ffffff;
  --tg-btn: var(--tg-theme-button-color, #f43f5e);
  --tg-btn-text: var(--tg-theme-button-text-color, #ffffff);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.24);
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --slide-w: 132px;
  --slide-gap: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: var(--tg-theme-secondary-bg-color, #f2f3f7);
  --surface: var(--tg-theme-bg-color, #ffffff);
  --surface-elevated: #f8f9fc;
  --surface-muted: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.09);
  --text: var(--tg-theme-text-color, #111827);
  --hint: var(--tg-theme-hint-color, #6b7280);
  --shadow-sm: 0 4px 18px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

body.has-fallback-footer {
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

.hidden {
  display: none !important;
}

/* ==================== TOAST ==================== */
.toast {
  position: fixed;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 1200;
  max-width: calc(100vw - 28px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 24, 33, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(127, 29, 29, 0.95);
  border-color: rgba(248, 113, 113, 0.45);
}

.toast.success {
  background: rgba(20, 83, 45, 0.95);
  border-color: rgba(74, 222, 128, 0.4);
}

/* ==================== HEADER ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 16px 8px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.segmented-tabs {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.tab-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--hint);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.tab-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.32);
}

.tab-btn:active {
  transform: scale(0.98);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--surface-muted);
  color: var(--text);
}

.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* ==================== MAIN LAYOUT ==================== */
.app-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 6px 14px 20px;
}

.view {
  display: none;
}

.view.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==================== HERO CAROUSEL ==================== */
.hero-section {
  position: relative;
  padding: 10px 0 8px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, transparent) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.hero-ambient {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.22) 0%, rgba(244, 63, 94, 0.05) 45%, transparent 72%);
  pointer-events: none;
  transition: background 0.35s ease;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: 0.72;
  transition: opacity 0.16s ease, transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .carousel-nav {
    display: inline-flex;
  }
}

.carousel-nav:hover {
  opacity: 1;
}

.carousel-nav:active {
  transform: translateY(-50%) scale(0.92);
}

.carousel-nav.prev {
  left: 4px;
}

.carousel-nav.next {
  right: 4px;
}

.carousel-nav.disabled {
  opacity: 0.18;
  pointer-events: none;
}

.gift-carousel {
  display: flex;
  align-items: center;
  gap: var(--slide-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 0;
  cursor: grab;
  user-select: none;
}

.gift-carousel::-webkit-scrollbar {
  display: none;
}

.gift-carousel.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.carousel-spacer {
  flex: 0 0 calc(50% - (var(--slide-w) / 2) - var(--slide-gap));
  height: 1px;
  pointer-events: none;
}

.gift-slide {
  flex: 0 0 var(--slide-w);
  height: 136px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transform-origin: center center;
  will-change: transform, opacity;
}

.gift-visual {
  width: 118px;
  height: 118px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.gift-slide.is-active .gift-visual {
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.08), transparent 72%);
}

.gift-thumb {
  width: 102px;
  height: 102px;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gift-thumb.is-hidden {
  opacity: 0;
  position: absolute;
}

.gift-lottie {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gift-lottie svg {
  width: 100% !important;
  height: 100% !important;
}

.gift-emoji-fallback {
  font-size: 68px;
  line-height: 1;
}

.gift-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2px 16px 6px;
  gap: 5px;
}

.gift-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gift-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gift-unit-price {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hint);
}

.gift-total-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 4px;
}

.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.carousel-dot.active {
  width: 16px;
  background: var(--accent);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger-soft);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.card-sublabel {
  font-size: 12.5px;
  color: var(--hint);
}

/* ==================== QUANTITY STEPPER ==================== */
.qty-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.qty-hint {
  font-size: 12px;
  color: var(--hint);
}

.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.stepper-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: transform 0.1s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.stepper-btn:active:not(:disabled) {
  transform: scale(0.93);
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.qty-value-wrap {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.qty-input {
  width: 72px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  padding: 2px 4px;
  border-radius: 8px;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.qty-input:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.qty-unit-label {
  font-size: 14px;
  color: var(--hint);
  font-weight: 500;
}

.presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chip-btn {
  appearance: none;
  flex: 1 1 auto;
  min-width: 48px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.chip-btn.schedule-chip {
  font-family: var(--font-sans);
  font-size: 13px;
}

.chip-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.chip-btn:active {
  transform: scale(0.96);
}

/* ==================== COMMENTS ==================== */
.segmented-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--hint);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.mode-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.textarea-wrap {
  position: relative;
}

.comment-textarea {
  width: 100%;
  resize: none;
  min-height: 84px;
  max-height: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  padding: 11px 12px 28px;
  outline: none;
  transition: border-color 0.15s ease;
}

.comment-textarea:focus {
  border-color: var(--accent);
}

.comment-textarea.invalid {
  border-color: var(--danger);
}

.char-counter {
  position: absolute;
  right: 11px;
  bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--hint);
  pointer-events: none;
}

.char-counter.over {
  color: var(--danger);
  font-weight: 700;
}

.per-item-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.per-item-stats {
  font-size: 12.5px;
  color: var(--hint);
}

.per-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ghost-action-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ghost-action-btn:hover {
  border-color: var(--accent);
}

.per-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 292px;
  overflow-y: auto;
  padding-right: 2px;
}

.per-item-list.expanded {
  max-height: none;
}

.per-item-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.per-item-row.invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.per-item-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.per-item-num {
  font-weight: 700;
  color: var(--text);
}

.per-item-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--hint);
}

.per-item-count.over {
  color: var(--danger);
  font-weight: 700;
}

.per-item-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 2px 0;
  outline: none;
}

.per-item-input::placeholder {
  color: var(--hint);
  opacity: 0.75;
}

/* ==================== SETTINGS STACK ==================== */
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-chip-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 0 12px;
  transition: border-color 0.15s ease;
}

.input-box:focus-within {
  border-color: var(--accent);
}

.text-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 0;
  outline: none;
}

.clear-input-btn {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.field-status {
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-status.ok {
  color: var(--success);
}

.field-status.error {
  color: var(--danger);
}

.field-status.muted {
  color: var(--hint);
}

/* Toggle Switch */
.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(142, 152, 171, 0.32);
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: var(--accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* Date & Time */
.schedule-presets {
  margin-top: 0;
  margin-bottom: 10px;
}

.datetime-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 8px;
}

.dt-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dt-caption {
  font-size: 11.5px;
  color: var(--hint);
}

.dt-display-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.dt-display-value {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.dt-icon {
  color: var(--hint);
  flex-shrink: 0;
}

.dt-native-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.tz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tz-label {
  font-size: 12.5px;
  color: var(--hint);
  white-space: nowrap;
}

.tz-select-wrap {
  position: relative;
  flex: 1;
  max-width: 240px;
  display: flex;
  align-items: center;
}

.tz-select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 26px 7px 10px;
  border-radius: 9px;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
}

.tz-chevron {
  position: absolute;
  right: 8px;
  pointer-events: none;
  color: var(--hint);
}

/* ==================== FALLBACK MAIN BUTTON ==================== */
.fallback-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent 0%, var(--bg) 28%);
}

.fallback-main-btn {
  display: block;
  width: 100%;
  max-width: 452px;
  margin: 0 auto;
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  background: var(--tg-btn);
  color: var(--tg-btn-text);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.35);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.fallback-main-btn:active {
  transform: scale(0.985);
}

/* ==================== ORDERS VIEW ==================== */
.orders-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.orders-empty {
  text-align: center;
  padding: 46px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.orders-empty-icon {
  font-size: 52px;
  margin-bottom: 10px;
}

.orders-empty-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.orders-empty-desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--hint);
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.order-card.cancelled {
  opacity: 0.62;
}

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-gift-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-gift-emoji {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.order-gift-title {
  font-size: 15.5px;
  font-weight: 700;
}

.order-gift-sub {
  font-size: 12.5px;
  color: var(--hint);
}

.order-status-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  white-space: nowrap;
}

.order-status-pill.cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.order-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--surface-muted);
  font-size: 12.5px;
}

.order-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-meta-label {
  color: var(--hint);
  font-size: 11px;
}

.order-meta-val {
  font-weight: 600;
  word-break: break-word;
}

.order-comments-box {
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface-muted);
  border-radius: 10px;
  padding: 8px 10px;
}

.order-card-actions {
  display: flex;
  gap: 8px;
}

/* ==================== MODALS / BOTTOM SHEETS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 0 0;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  animation: sheetUp 0.2s ease-out;
}

@keyframes sheetUp {
  from {
    transform: translateY(36px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto 10px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-title {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
}

.modal-close-btn {
  appearance: none;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.modal-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--hint);
}

.bulk-textarea {
  width: 100%;
  min-height: 140px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}

.bulk-textarea:focus {
  border-color: var(--accent);
}

.bulk-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  cursor: pointer;
}

.bulk-preview-info {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-muted);
  font-size: 12.5px;
  color: var(--hint);
}

.bulk-preview-info.warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
  margin-top: 14px;
}

.btn-primary,
.btn-secondary {
  appearance: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.97);
}

/* Receipt */
.receipt-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-muted);
}

.receipt-hero-emoji {
  font-size: 38px;
}

.receipt-hero-title {
  font-size: 16.5px;
  font-weight: 700;
}

.receipt-hero-price {
  font-size: 13px;
  color: var(--hint);
}

.receipt-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.receipt-row-key {
  color: var(--hint);
}

.receipt-row-val {
  font-weight: 600;
  text-align: right;
}

.receipt-comments-preview {
  max-height: 130px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-muted);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
