/* ==========================================================================
   order.css — Place Order / Billing page
   - Premium POS layout (menu + cart)
   - Light/Dark supported via common.css variables
   ========================================================================== */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.is-hidden {
  display: none !important;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-bottom-color: rgba(2, 6, 23, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
}

body.dark kbd {
  background: rgba(2, 6, 23, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.12);
  color: rgba(15, 23, 42, 0.88);
  font-weight: 800;
  letter-spacing: 0.02em;
}

body.dark .status-pill { color: rgba(226, 232, 240, 0.92); }

.status-pill.is-new {
  border-color: rgba(6, 182, 212, 0.28);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(99, 102, 241, 0.12));
}
.status-pill.is-running {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(236, 72, 153, 0.10));
}
.status-pill.is-kot {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(6, 182, 212, 0.10));
}
.status-pill.is-billed {
  border-color: rgba(99, 102, 241, 0.28);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.10));
}
.status-pill.is-held {
  border-color: rgba(249, 115, 22, 0.28);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(245, 158, 11, 0.12));
}

.order-page {
  display: grid;
  gap: 14px;
  --pos-accent-1: #6d28d9; /* violet */
  --pos-accent-2: #06b6d4; /* cyan */
  --pos-accent-3: #f97316; /* orange */
  --pos-glow: 0 22px 70px rgba(109, 40, 217, 0.12);
}

.order-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
  /* Allow premium select dropdowns to overflow without pushing/jumping layout */
  overflow: visible;
  /* Ensure header dropdowns layer above Menu/Cart panels (which use transforms) */
  z-index: 5;
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.order-top::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(900px 280px at 10% 0%, rgba(109, 40, 217, 0.14), transparent 60%),
    radial-gradient(900px 260px at 90% 10%, rgba(6, 182, 212, 0.10), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02));
  opacity: 0.0;
  pointer-events: none;
  transition: opacity 180ms ease, filter 180ms ease;
}
body.dark .order-top::before {
  background:
    radial-gradient(900px 280px at 10% 0%, rgba(109, 40, 217, 0.18), transparent 60%),
    radial-gradient(900px 260px at 90% 10%, rgba(6, 182, 212, 0.14), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}
.order-top > * { position: relative; z-index: 1; }
/* Keep left panel (filters/dropdowns) above the right meta panel when dropdowns open */
.order-top__left { z-index: 2; }
.order-top__left:focus-within { z-index: 6; }
.order-top:focus-within { z-index: 20; }
.order-top__right { z-index: 1; }

.order-top:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 70px rgba(2, 6, 23, 0.12), var(--shadow-md);
  filter: brightness(1.01);
}
.order-top:hover::before { opacity: 1; filter: saturate(1.15); }
.order-top:active { transform: translateY(0); }
/* Prevent "jump" while interacting with dropdowns/inputs inside the order header */
.order-top:focus-within { transform: translateY(0); }
.order-top:focus-within:hover { transform: translateY(0); }

.order-top__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.order-top .field input,
.order-top .field select {
  height: 42px;
}

/* Keep header filters visually stable when opening enhanced dropdowns */
.order-top .trisha-trigger:hover,
.order-top .trisha-trigger:active {
  transform: translateY(0);
}

.order-top__right {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.06));
  transform: translateZ(0);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, filter 160ms ease;
}

body.dark .order-top__right {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(236, 72, 153, 0.08));
}

.order-top__right:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 55px rgba(2, 6, 23, 0.10);
  border-color: rgba(99, 102, 241, 0.22);
}
.order-top__right:focus-within {
  border-color: rgba(109, 40, 217, 0.28);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.10), 0 22px 70px rgba(6, 182, 212, 0.10);
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateZ(0);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, filter 140ms ease;
}

.meta--span {
  grid-column: 1 / -1;
}

body.dark .meta {
  background: rgba(2, 6, 23, 0.36);
}

.meta:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
  box-shadow: 0 18px 55px rgba(2, 6, 23, 0.10);
  border-color: rgba(99, 102, 241, 0.20);
}
.meta:active { transform: translateY(0); }
.meta:focus-within {
  border-color: rgba(109, 40, 217, 0.28);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.10), 0 22px 70px rgba(6, 182, 212, 0.10);
}

.meta__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.meta__value {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.order-top__note {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.pos-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 14px;
  align-items: start;
}

.pos-layout.pos-layout--single {
  grid-template-columns: 1fr;
}

.panel {
  padding: 14px;
}

.menu-panel {
  position: relative;
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow: var(--pos-glow);
  overflow: visible; /* allow premium select dropdown to overflow */
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.menu-panel:hover {
  transform: translateY(-2px);
  filter: brightness(1.01);
  box-shadow: 0 26px 90px rgba(109, 40, 217, 0.14), var(--pos-glow);
}
.menu-panel:active { transform: translateY(0); }
.menu-panel:focus-within {
  border-color: rgba(109, 40, 217, 0.28);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.10), 0 26px 90px rgba(6, 182, 212, 0.12);
  /* Ensure native <select> dropdowns (e.g., Item type) don't render behind Order Console */
  z-index: 30;
}

.menu-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(800px 320px at 10% 0%, rgba(109, 40, 217, 0.18), transparent 60%),
    radial-gradient(760px 280px at 80% 10%, rgba(6, 182, 212, 0.14), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.35));
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 180ms ease, filter 180ms ease;
}

.menu-panel:hover::before,
.menu-panel:focus-within::before { filter: saturate(1.15); opacity: 1; }

body.dark .menu-panel::before {
  background:
    radial-gradient(820px 340px at 10% 0%, rgba(109, 40, 217, 0.22), transparent 60%),
    radial-gradient(760px 280px at 80% 10%, rgba(6, 182, 212, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.35), rgba(2, 6, 23, 0.1));
}

.menu-panel > * {
  position: relative;
  z-index: 1;
}

.cart-panel {
  position: relative;
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow: 0 18px 70px rgba(6, 182, 212, 0.10);
  overflow: visible;
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.cart-panel:hover {
  transform: translateY(-2px);
  filter: brightness(1.01);
  box-shadow: 0 26px 90px rgba(6, 182, 212, 0.12), 0 18px 70px rgba(6, 182, 212, 0.10);
}
.cart-panel:active { transform: translateY(0); }
.cart-panel:focus-within {
  border-color: rgba(6, 182, 212, 0.28);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.10), 0 26px 90px rgba(109, 40, 217, 0.12);
}

.cart-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(820px 340px at 0% 0%, rgba(6, 182, 212, 0.16), transparent 60%),
    radial-gradient(760px 320px at 95% 15%, rgba(109, 40, 217, 0.14), transparent 60%),
    radial-gradient(520px 260px at 70% 95%, rgba(249, 115, 22, 0.10), transparent 55%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.34));
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 180ms ease, filter 180ms ease;
}

.cart-panel:hover::before,
.cart-panel:focus-within::before { filter: saturate(1.15); opacity: 1; }

body.dark .cart-panel::before {
  background:
    radial-gradient(820px 340px at 0% 0%, rgba(6, 182, 212, 0.18), transparent 60%),
    radial-gradient(760px 320px at 95% 15%, rgba(109, 40, 217, 0.18), transparent 60%),
    radial-gradient(520px 260px at 70% 95%, rgba(249, 115, 22, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.30), rgba(2, 6, 23, 0.10));
}

.cart-panel > * {
  position: relative;
  z-index: 1;
}

.cart-panel .panel__head {
  padding: 6px 2px 2px;
}

.cart-panel #cartCountPill {
  border-color: rgba(99, 102, 241, 0.20);
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(6, 182, 212, 0.06));
}

.cart-head__right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-order-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 18px 50px rgba(109, 40, 217, 0.12);
}
.voice-order-main span:first-child { font-size: 16px; line-height: 1; }

/* ================= Voice Order (Ultra Premium) ================= */
.voice-order {
  --vo-accent: 109, 40, 217;
  --vo-accent2: 6, 182, 212;
  --vo-accent3: 249, 115, 22;
  display: grid;
  gap: 14px;
  animation: voFadeIn 180ms ease-out;
}

@keyframes voFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.voice-order__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: linear-gradient(135deg, rgba(var(--vo-accent), 0.10), rgba(var(--vo-accent2), 0.08));
  box-shadow: 0 22px 70px rgba(2, 6, 23, 0.10);
}

.voice-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent), 0.16);
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.dark .voice-lang { background: rgba(2, 6, 23, 0.28); }
.voice-lang .btn {
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
}
.voice-lang .btn:hover { transform: translateY(-1px); filter: brightness(1.02); }

.voice-status {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.50);
}
body.dark .voice-status { background: rgba(2, 6, 23, 0.22); }

.voice-help {
  margin-top: -6px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px dashed rgba(var(--vo-accent2), 0.22);
  background: rgba(99, 102, 241, 0.06);
  color: var(--muted);
  font-size: 12px;
}
body.dark .voice-help { background: rgba(2, 6, 23, 0.18); }

.voice-micdiag {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(var(--vo-accent2), 0.16);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  gap: 8px;
}
body.dark .voice-micdiag { background: rgba(2, 6, 23, 0.22); }

.voice-micdiag__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.voice-micstate {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  color: var(--muted);
}
body.dark .voice-micstate { background: rgba(2, 6, 23, 0.28); color: rgba(226, 232, 240, 0.78); }
.voice-micstate.is-good { border-color: rgba(34, 197, 94, 0.35); color: rgba(34, 197, 94, 0.92); }
.voice-micstate.is-warn { border-color: rgba(245, 158, 11, 0.35); color: rgba(245, 158, 11, 0.92); }
.voice-micstate.is-bad { border-color: rgba(239, 68, 68, 0.35); color: rgba(239, 68, 68, 0.92); }

.voice-meter {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent2), 0.16);
  background:
    linear-gradient(90deg, rgba(34, 197, 94, 0.20), rgba(245, 158, 11, 0.18), rgba(239, 68, 68, 0.18)),
    rgba(255, 255, 255, 0.42);
  overflow: hidden;
  position: relative;
}
body.dark .voice-meter { background: linear-gradient(90deg, rgba(34, 197, 94, 0.16), rgba(245, 158, 11, 0.14), rgba(239, 68, 68, 0.14)), rgba(2, 6, 23, 0.22); }
.voice-meter__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.85), rgba(6, 182, 212, 0.85));
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.0);
  transition: width 80ms linear;
}
.voice-order.is-listening .voice-meter__fill {
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.06);
}
.voice-micnote { font-size: 12px; }

.voice-statusbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 16px 50px rgba(2, 6, 23, 0.10);
}
body.dark .voice-statusbar { background: rgba(2, 6, 23, 0.26); }

.voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.75);
  box-shadow: 0 0 0 0 rgba(var(--vo-accent3), 0.0);
}
.voice-order.is-listening .voice-dot {
  background: rgba(34, 197, 94, 0.95);
  animation: voPulse 1.1s ease-out infinite;
}
.voice-order.is-paused .voice-dot { background: rgba(245, 158, 11, 0.95); }
.voice-order.is-stopped .voice-dot { background: rgba(100, 116, 139, 0.75); }
.voice-order.is-error .voice-dot { background: rgba(239, 68, 68, 0.95); }
.voice-order.is-submitting .voice-dot { background: rgba(99, 102, 241, 0.95); animation: voPulse 1.1s ease-out infinite; }

@keyframes voPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.0); transform: scale(1); }
  30% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.12); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 18px rgba(34, 197, 94, 0.0); transform: scale(1); }
}

.voice-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(15, 23, 42, 0.72);
}
body.dark .voice-timer { color: rgba(226, 232, 240, 0.78); }

.voice-transcript {
  width: 100%;
  min-height: 200px;
  max-height: 380px;
  resize: vertical;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(var(--vo-accent), 0.18);
  background:
    radial-gradient(900px 240px at 10% 0%, rgba(var(--vo-accent), 0.14), transparent 60%),
    radial-gradient(820px 240px at 90% 10%, rgba(var(--vo-accent2), 0.12), transparent 55%),
    rgba(255, 255, 255, 0.62);
  color: var(--text);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.10);
  line-height: 1.45;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease, filter 160ms ease;
}
body.dark .voice-transcript {
  background:
    radial-gradient(900px 240px at 10% 0%, rgba(var(--vo-accent), 0.18), transparent 60%),
    radial-gradient(820px 240px at 90% 10%, rgba(var(--vo-accent2), 0.16), transparent 55%),
    rgba(2, 6, 23, 0.22);
  color: rgba(226, 232, 240, 0.92);
}
.voice-transcript:focus {
  outline: none;
  border-color: rgba(var(--vo-accent2), 0.45);
  box-shadow: 0 0 0 4px rgba(var(--vo-accent), 0.12), 0 24px 80px rgba(var(--vo-accent2), 0.12);
}

.voice-interim {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px dashed rgba(var(--vo-accent2), 0.22);
  background: rgba(99, 102, 241, 0.05);
  min-height: 18px;
}
body.dark .voice-interim { background: rgba(2, 6, 23, 0.18); }
.voice-interim.is-empty { opacity: 0.65; }

.voice-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 10px 10px;
  border-radius: 18px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.10);
}
body.dark .voice-actions { background: rgba(2, 6, 23, 0.35); }

.voice-btn-start { min-width: 110px; }
.voice-btn-end { min-width: 110px; }

.voice-results {
  display: grid;
  gap: 10px;
  max-height: 48vh;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 2px; /* scrollbar space */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.voice-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

/* Split into 2 panes when draft exists */
.voice-order.has-draft .voice-split {
  grid-template-columns: 1.15fr 0.85fr;
}

.voice-order.has-draft .voice-results {
  max-height: 62vh;
}

.voice-order.has-draft .voice-draft__list {
  max-height: 62vh;
}

.voice-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.voice-results * { min-width: 0; }

.voice-pick-price {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 92px;
  text-align: right;
}
body.dark .voice-pick-price { background: rgba(2, 6, 23, 0.22); color: rgba(226, 232, 240, 0.78); }

.voice-pick-qty {
  width: 110px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(var(--vo-accent), 0.18);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.06);
  text-align: right;
  padding: 0 12px;
}
body.dark .voice-pick-qty { background: rgba(2, 6, 23, 0.28); color: rgba(226, 232, 240, 0.92); }

.voice-pick-add { min-width: 110px; }

.voice-hit {
  border: 1px solid rgba(var(--vo-accent), 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  padding: 12px 12px;
  box-shadow: 0 18px 60px rgba(109, 40, 217, 0.10);
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body.dark .voice-hit { background: rgba(30, 41, 59, 0.26); }
.voice-hit:hover { transform: translateY(-1px); border-color: rgba(var(--vo-accent2), 0.28); filter: brightness(1.01); }

.voice-unmatched {
  border: 1px dashed rgba(var(--vo-accent2), 0.26);
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.05);
  padding: 12px 12px;
}
body.dark .voice-unmatched { background: rgba(2, 6, 23, 0.18); }
.voice-unmatched__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.voice-unmatched__pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
body.dark .voice-unmatched__pill { background: rgba(2, 6, 23, 0.22); color: rgba(226, 232, 240, 0.78); }

.voice-hit__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.voice-hit__head strong {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(15, 23, 42, 0.74);
}
body.dark .voice-hit__head strong { color: rgba(226, 232, 240, 0.82); }

.voice-hit select,
.voice-draft select {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(var(--vo-accent), 0.18);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.06);
}
body.dark .voice-hit select,
body.dark .voice-draft select {
  background: rgba(2, 6, 23, 0.28);
  color: rgba(226, 232, 240, 0.92);
}

.voice-draft {
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--vo-accent2), 0.06), rgba(var(--vo-accent), 0.08));
  padding: 12px 12px;
  box-shadow: 0 22px 80px rgba(6, 182, 212, 0.10);
}
body.dark .voice-draft { background: rgba(2, 6, 23, 0.24); }

.voice-draft__list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  max-height: 42vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.voice-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid rgba(var(--vo-accent), 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.08);
  transition: transform 140ms ease, border-color 140ms ease;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body.dark .voice-line { background: rgba(2, 6, 23, 0.22); }
.voice-line:hover { transform: translateY(-1px); border-color: rgba(var(--vo-accent2), 0.26); }

.voice-line__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.voice-line__name {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(15, 23, 42, 0.74);
}
body.dark .voice-line__name { color: rgba(226, 232, 240, 0.82); }

.voice-line__price {
  flex: 0 0 auto;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--vo-accent2), 0.18);
  background: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
body.dark .voice-line__price { background: rgba(2, 6, 23, 0.22); color: rgba(226, 232, 240, 0.78); }

.voice-line__foot {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-line__controls {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.voice-line__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.voice-line__label {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.voice-line__total {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.voice-qty {
  width: 84px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(var(--vo-accent), 0.18);
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
  padding: 0 10px;
}
body.dark .voice-qty { background: rgba(2, 6, 23, 0.28); color: rgba(226, 232, 240, 0.92); }

.voice-desc-select {
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(var(--vo-accent), 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  min-width: 130px;
  width: auto;
}
body.dark .voice-desc-select { background: rgba(2, 6, 23, 0.28); color: rgba(226, 232, 240, 0.92); }

@media (max-width: 720px) {
  /* Voice modal: full-screen friendly (mobile/POS) */
  .modal.modal--voice .modal__panel.modal__panel--voice {
    width: min(720px, calc(100vw - 18px));
    max-height: 92vh !important;
    border-radius: 20px;
  }
  .modal.modal--voice .modal__body.modal__body--voice {
    padding: 12px 12px;
    max-height: calc(92vh - 140px) !important;
  }

  .voice-order__top { gap: 8px; }
  .voice-transcript { min-height: 150px; max-height: 260px; }
  .voice-results { max-height: none; }
  .voice-line { grid-template-columns: 1fr; }
  .voice-actions { justify-content: stretch; }
  .voice-actions .btn { flex: 1 1 auto; }
  .voice-actions { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .voice-pick-row { flex-wrap: wrap; }
  .voice-pick-price { width: 100%; text-align: left; }
  .voice-pick-qty { width: 100%; }
  .voice-pick-add { width: 100%; }
  .voice-order.has-draft .voice-split { grid-template-columns: 1fr; }
  .voice-line__actions { justify-content: flex-start; }
}

/* Voice item picker: use Login-style role dropdown (bigger) */
.voice-order .role-dropdown { position: relative; width: 100%; }
.voice-order .role-dropdown {
  --role-accent: #06b6d4;
  --role-accent-rgb: 6, 182, 212;
  --role-accent2: #6366f1;
  --role-accent2-rgb: 99, 102, 241;
}
.voice-order .role-dropdown[data-role="captain"] { --role-accent: #06b6d4; --role-accent-rgb: 6, 182, 212; --role-accent2: #6366f1; --role-accent2-rgb: 99, 102, 241; }

.voice-order .role-dropdown select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.voice-order .role-trigger {
  width: 100%;
  padding: 16px 16px;
  border-radius: 16px;
  border: 2px solid transparent;
  outline: none;
  background: rgba(255, 255, 255, 0.70);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.10);
  transition: transform 140ms ease, filter 140ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
body.dark .voice-order .role-trigger { background: rgba(2, 6, 23, 0.28); color: rgba(226, 232, 240, 0.92); }

.voice-order .role-trigger::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: auto;
  flex: 0 0 10px;
  border-right: 2px solid var(--role-accent);
  border-bottom: 2px solid var(--role-accent);
  transform: rotate(45deg);
  opacity: 0.95;
  transition: transform 0.2s ease;
}

.voice-order .role-trigger:hover { transform: translateY(-1px); filter: brightness(1.02); border-color: var(--role-accent2); }
.voice-order .role-dropdown.is-open .role-trigger {
  border-color: var(--role-accent);
  background-color: rgba(var(--role-accent-rgb), 0.10);
  box-shadow: 0 0 0 4px rgba(var(--role-accent-rgb), 0.14), 0 22px 70px rgba(var(--role-accent-rgb), 0.18);
}
.voice-order .role-dropdown.is-open .role-trigger::after { transform: rotate(-135deg); }

.voice-order .role-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  margin: 0;
  padding: 10px;
  list-style: none;
  border-radius: 18px;
  z-index: 60;
  max-height: 420px;
  overflow: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body.dark .voice-order .role-list {
  background: rgba(2, 6, 23, 0.82);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.voice-order .role-option {
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: background 0.15s ease, transform 0.15s ease;
}
body:not(.dark) .voice-order .role-option { color: #0f172a; }
.voice-order .role-option:hover { background: rgba(var(--role-accent-rgb), 0.14); }
.voice-order .role-option:active { transform: scale(0.99); }
.voice-order .role-option.is-selected {
  background: linear-gradient(135deg, rgba(var(--role-accent-rgb), 0.22), rgba(var(--role-accent2-rgb), 0.18));
  border: 1px solid rgba(var(--role-accent-rgb), 0.25);
}

/* Result picker: compact variant (smaller control) */
.voice-results .role-trigger {
  padding: 12px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.74);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
}
body.dark .voice-results .role-trigger { color: rgba(226, 232, 240, 0.82); }
.voice-results .role-list {
  top: calc(100% + 8px);
  padding: 8px;
  border-radius: 16px;
  max-height: 260px;
}
.voice-results .role-option {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.74);
}
body.dark .voice-results .role-option { color: rgba(226, 232, 240, 0.82); }

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-panel .panel__head {
  padding: 6px 2px 2px;
}

.menu-panel .panel__head,
.menu-panel .panel__tools {
  position: relative;
  z-index: 20; /* keep dropdown above menu cards, below sticky topbar */
}

.menu-panel .trisha-select.is-open {
  z-index: 24; /* lift above other filter controls while open */
}

.menu-panel .trisha-list {
  z-index: 25; /* above sibling tools, below topbar */
}

.menu-list {
  position: relative;
  z-index: 1;
}

.panel__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool {
  min-width: 180px;
}

.tool--search {
  min-width: 260px;
}
.tool--id,
.tool--uid { min-width: 160px; }
.tool--date { min-width: 170px; }

.tool input,
.tool select {
  height: 42px;
}

.tool input,
.tool select {
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.06);
}

.tool input:focus,
.tool select:focus {
  outline: none;
  border-color: rgba(109, 40, 217, 0.35);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12), 0 18px 44px rgba(109, 40, 217, 0.12);
}

.menu-list {
  display: grid;
  grid-template-columns: 1fr; /* premium list view */
  gap: 10px;
  padding: 8px 0 6px;
  min-height: 0;
  align-content: start;
}

.menu-list:empty {
  min-height: 0;
}

.menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.menu-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  display: grid;
}

body.dark .menu-card {
  background: rgba(30, 41, 59, 0.58);
}

.menu-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.16), rgba(6, 182, 212, 0.08), rgba(249, 115, 22, 0.06));
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.menu-card:hover::before,
.menu-card:focus-within::before {
  opacity: 1;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.25);
}

.menu-card:focus-within {
  outline: none;
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12), var(--shadow-md);
  border-color: rgba(109, 40, 217, 0.28);
}

.menu-card__name {
  font-weight: 800;
  letter-spacing: 0.1px;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.menu-card__name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Indian food indicator (square with circle) */
.food-mark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid rgba(100, 116, 139, 0.55);
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}
body.dark .food-mark { background: rgba(2, 6, 23, 0.26); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35); }
.food-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.75);
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.10);
}

.food-mark--veg { border-color: rgba(34, 197, 94, 0.95); }
.food-mark--veg::after { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.10); }

.food-mark--nonveg { border-color: rgba(239, 68, 68, 0.95); }
.food-mark--nonveg::after { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10); }

.food-mark--egg { border-color: rgba(245, 158, 11, 0.95); }
.food-mark--egg::after { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.10); }

.menu-card__cat {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark .menu-card__cat {
  background: rgba(2, 6, 23, 0.36);
}

.menu-card__price {
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.08);
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Premium list-row layout */
.menu-card--row {
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 12px;
  gap: 12px;
}

.menu-thumb {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
}
body.dark .menu-thumb { background: rgba(2, 6, 23, 0.26); }
.menu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-thumb__skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.10), rgba(236, 72, 153, 0.10), rgba(99, 102, 241, 0.10));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.menu-thumb__spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(99, 102, 241, 0.22);
  border-top-color: rgba(99, 102, 241, 0.75);
  animation: spin 0.9s linear infinite;
}
.menu-thumb.is-loaded .menu-thumb__spinner,
.menu-thumb.is-loaded .menu-thumb__skeleton { display: none; }
.menu-thumb.is-error .menu-thumb__spinner,
.menu-thumb.is-error .menu-thumb__skeleton { display: none; }
.menu-thumb.is-error::before { content: "🖼️"; font-size: 18px; opacity: 0.85; }

@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fav-toggle {
  height: 42px;
  width: 44px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.06);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease, background 140ms ease;
  color: rgba(15, 23, 42, 0.88);
}
body.dark .fav-toggle { background: rgba(2, 6, 23, 0.35); color: rgba(226, 232, 240, 0.92); }
.fav-toggle:hover { transform: translateY(-1px); filter: brightness(1.02); border-color: rgba(99, 102, 241, 0.28); }
.fav-toggle:active { transform: translateY(0); }
.fav-toggle[aria-pressed="true"] {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(236, 72, 153, 0.10));
}
.fav-toggle__icon { font-size: 18px; line-height: 1; }
.menu-row__left {
  min-width: 0;
}

.menu-row__line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.menu-row__name {
  flex: 1 1 260px; /* keep name + chips on one line when space allows */
}

.menu-row__chips {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-row__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.menu-card__price--side {
  font-size: 13px;
  padding: 6px 10px;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.22px;
  white-space: nowrap;
  color: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(6, 182, 212, 0.06));
  padding: 4px 9px;
  border-radius: 999px;
  flex: 0 0 auto; /* prevent taking extra space */
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.08);
}

.availability::before {
  content: "●";
  color: #22c55e;
}

body.dark .availability {
  color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.availability.is-out {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08));
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.08);
}

.availability.is-out::before {
  color: #ef4444;
}

.btn-add {
  min-width: 98px;
}

.menu-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.dark .menu-qty {
  background: rgba(2, 6, 23, 0.26);
}

.menu-qty__value {
  min-width: 22px;
  text-align: center;
  font-weight: 900;
}

.menu-qty button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

body.dark .menu-qty button {
  background: rgba(2, 6, 23, 0.5);
}

.menu-qty button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .menu-card,
  .toast,
  .order-top,
  .order-top::before,
  .order-top__right,
  .menu-panel,
  .menu-panel::before,
  .cart-panel,
  .cart-panel::before,
  .meta {
    transition: none !important;
  }
  .menu-card:hover {
    transform: none;
  }
  .order-top:hover,
  .order-top__right:hover,
  .menu-panel:hover,
  .cart-panel:hover,
  .meta:hover {
    transform: none !important;
    filter: none !important;
  }
}

.btn[disabled],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 800;
}

body.dark .pill {
  background: rgba(2, 6, 23, 0.36);
}

.cart-body {
  /* Keep cart area stable; list itself will scroll */
  min-height: 0;
}

.cart-empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
}

.empty-state__icon {
  font-size: 34px;
  line-height: 1;
}

.cart-list {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px 2px 6px;
  max-height: clamp(440px, 70vh, 860px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  cursor: grab;
}
.cart-list.is-dragging { cursor: grabbing; }

.cart-item {
  position: relative;
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62));
  box-shadow: 0 18px 70px rgba(2, 6, 23, 0.12);
  overflow: hidden;
  color: var(--text);
}

body.dark .cart-item {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.52), rgba(30, 41, 59, 0.38));
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.42);
  color: #e2e8f0; /* light text only in dark theme */
}

.cart-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(109, 40, 217, 0.10), rgba(249, 115, 22, 0.06));
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.cart-item:hover::before,
.cart-item:focus-within::before {
  opacity: 1;
}

.cart-item:hover {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: var(--shadow-md);
}

.cart-item__row {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.cart-item__left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.cart-item__text {
  min-width: 0;
}

.cart-item__nameRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.cart-item__amountTop {
  display: none;
  font-weight: 950;
  color: var(--text);
  white-space: nowrap;
  margin-left: 6px;
}

body.dark .cart-item__amountTop {
  color: rgba(226, 232, 240, 0.92);
}

.cart-item__name {
  font-weight: 600;
  line-height: 1.15;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item__nameText {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item__portionInline {
  flex: 0 0 auto;
  max-width: 140px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: rgba(15, 23, 42, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.dark .cart-item__portionInline {
  color: rgba(226, 232, 240, 0.88);
  border-color: rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.12);
}

.cart-item__unit {
  opacity: 0.95;
}

.cart-thumb {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  flex: 0 0 44px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(109, 40, 217, 0.10), rgba(249, 115, 22, 0.06));
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.10);
}

body.dark .cart-thumb {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.30), rgba(30, 41, 59, 0.18));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

.cart-thumb__fallback {
  font-weight: 900;
  letter-spacing: 0.4px;
  font-size: 14px;
  color: rgba(15, 23, 42, 0.88);
  text-transform: uppercase;
}

body.dark .cart-thumb__fallback {
  color: rgba(226, 232, 240, 0.92);
}

.cart-thumb__mark {
  position: absolute;
  top: 6px;
  right: 6px;
  transform: scale(0.9);
}

.cart-item__sub {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.dark .cart-item__sub {
  color: rgba(226, 232, 240, 0.78);
}

.cart-item__controls {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.dark .qty {
  background: rgba(2, 6, 23, 0.28);
}

.qty button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

body.dark .qty button {
  background: rgba(2, 6, 23, 0.22);
}

.qty button:hover {
  background: rgba(109, 40, 217, 0.18);
  transform: translateY(-1px);
}

.qty .qty__value {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

.cart-item__amount {
  font-weight: 900;
  color: var(--text);
  text-align: right;
  letter-spacing: 0.2px;
}

body.dark .cart-item__amount {
  color: rgba(226, 232, 240, 0.92);
}

.cart-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.cart-item__iconActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-item .icon-btn {
  color: inherit;
  border-color: rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.55);
}

.cart-item .icon-btn:hover {
  background: rgba(109, 40, 217, 0.16);
}

.cart-item .menu-card__cat {
  border-color: rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.dark .cart-item .icon-btn {
  background: rgba(2, 6, 23, 0.12);
}

.dark .cart-item .menu-card__cat {
  background: rgba(2, 6, 23, 0.18);
  color: rgba(226, 232, 240, 0.72);
}

.note-box {
  border-top: 1px solid rgba(99, 102, 241, 0.16);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.45);
}

body.dark .note-box {
  background: rgba(2, 6, 23, 0.24);
}

.note-box textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(99, 102, 241, 0.18);
}

body.dark .note-box textarea {
  color: rgba(226, 232, 240, 0.92);
  background: rgba(2, 6, 23, 0.22);
}

.bill-box {
  margin-top: 10px;
  border: 1px solid rgba(99, 102, 241, 0.20);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 18px 70px rgba(109, 40, 217, 0.10);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.dark .bill-box {
  background: rgba(2, 6, 23, 0.30);
  color: rgba(226, 232, 240, 0.72);
}

.bill-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.16);
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(6, 182, 212, 0.08));
  color: var(--muted);
}

.bill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px 12px;
}

.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
}

body.dark .bill-row {
  background: rgba(30, 41, 59, 0.26);
  color: rgba(226, 232, 240, 0.72);
}

.bill-row--input {
  justify-content: space-between;
  gap: 10px;
}

.bill-row--input label {
  font-size: 12px;
}

.bill-row--input input {
  width: 110px;
  height: 38px;
  text-align: right;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.bill-row--total {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.18), rgba(6, 182, 212, 0.12), rgba(249, 115, 22, 0.10));
  border-color: rgba(109, 40, 217, 0.26);
}

body.dark .bill-row--total {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.22), rgba(6, 182, 212, 0.14), rgba(249, 115, 22, 0.12));
  color: rgba(226, 232, 240, 0.82);
}

.action-bar {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cart-panel .action-bar .btn--primary {
  background: linear-gradient(135deg, var(--pos-accent-1), var(--pos-accent-2));
  border-color: rgba(109, 40, 217, 0.28);
}

.cart-panel .action-bar .btn--danger {
  background: linear-gradient(135deg, #ef4444, var(--pos-accent-3));
}

.action-hints {
  margin-top: 10px;
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background:
    radial-gradient(140% 160% at 12% 10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(160% 170% at 90% 18%, rgba(6, 182, 212, 0.16), transparent 58%),
    radial-gradient(140% 190% at 50% 120%, rgba(236, 72, 153, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.72);
  color: var(--text);
  box-shadow:
    0 28px 90px rgba(2, 6, 23, 0.18),
    0 16px 44px rgba(99, 102, 241, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.45) inset;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(8px) translateX(10px);
  transition: opacity 180ms ease, transform 200ms ease;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

body.dark .toast {
  background:
    radial-gradient(140% 160% at 12% 10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(160% 170% at 90% 18%, rgba(6, 182, 212, 0.16), transparent 58%),
    radial-gradient(140% 190% at 50% 120%, rgba(236, 72, 153, 0.12), transparent 62%),
    rgba(2, 6, 23, 0.62);
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.62),
    0 18px 60px rgba(99, 102, 241, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.toast.is-in {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

.toast::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(6, 182, 212, 0.10), rgba(236, 72, 153, 0.10));
  opacity: 0.22;
  filter: blur(18px);
  pointer-events: none;
}

.toast__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  border: 1px solid rgba(99, 102, 241, 0.20);
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.18), rgba(6, 182, 212, 0.10));
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.10);
}

.toast__body { min-width: 0; display: grid; gap: 2px; padding-top: 1px; }
.toast__title {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: rgba(15, 23, 42, 0.72);
}
.toast__sub { font-size: 12px; color: var(--muted); line-height: 1.25; }
body.dark .toast__title { color: rgba(226, 232, 240, 0.78); }

.toast__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.85;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}
.toast__close:hover { transform: translateY(-1px); filter: brightness(1.04); opacity: 1; }
.toast__close:active { transform: translateY(0); }

.toast__bar {
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(109, 40, 217, 0.78), rgba(6, 182, 212, 0.76), rgba(34, 197, 94, 0.72), rgba(249, 115, 22, 0.70));
  transform-origin: left center;
  transform: scaleX(1);
  animation: toastbar var(--toast-ms, 2200ms) linear forwards;
  opacity: 0.8;
}

.toast:hover .toast__bar {
  animation-play-state: paused;
}

.toast--success .toast__icon {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(6, 182, 212, 0.08));
}

.toast--info .toast__icon {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(6, 182, 212, 0.08));
}

.toast--warning .toast__icon {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(249, 115, 22, 0.10));
}

.toast--success {
  border-color: rgba(34, 197, 94, 0.30);
}

.toast--info {
  border-color: rgba(99, 102, 241, 0.35);
}

.toast--warning {
  border-color: rgba(245, 158, 11, 0.35);
}

@keyframes toastbar {
  to { transform: scaleX(0); }
}

@media (max-width: 640px) {
  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
  .toast { border-radius: 20px; }
}
.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.is-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  transform: translateY(-50%);
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .menu-list { grid-template-columns: 1fr; }
  .order-top__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout { grid-template-columns: 1fr; }
  .action-bar { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 720px) {
  .tool--search { min-width: 100%; }
  .tool { min-width: 160px; }

  /* Menu list: keep item info next to image on mobile */
  .menu-card--row {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    gap: 12px;
  }

  .menu-card--row .menu-thumb {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .menu-card--row .menu-row__left { grid-column: 2; grid-row: 1; }
  .menu-card--row .menu-row__right {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .menu-row__chips { gap: 8px; }
  .menu-card__price--side { padding: 6px 9px; }

  .order-top { grid-template-columns: 1fr; overflow: visible; }
  .meta-row { grid-template-columns: 1fr; }
  .bill-grid { grid-template-columns: 1fr; }
  .action-bar { grid-template-columns: 1fr 1fr; }

  /* Cart: mobile-friendly layout */
  .cart-list {
    max-height: clamp(260px, 42dvh, 420px);
    padding: 10px 0 6px;
  }

  .cart-item__row {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .cart-item {
    border-radius: 22px;
    box-shadow: 0 26px 90px rgba(2, 6, 23, 0.14);
  }

  .cart-item__name {
    font-size: 15px;
    font-weight: 800;
  }

  .cart-item__amountTop {
    display: block;
    font-size: 14px;
    justify-self: end;
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.20);
    background: rgba(99, 102, 241, 0.10);
  }

  /* On mobile, don't show unit price inline with item meta; keep price separate on the right. */
  .cart-item__unit { display: none; }

  .cart-item__nameRow {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    column-gap: 12px;
    width: 100%;
  }

  .cart-item__name {
    white-space: normal;
    align-items: flex-start;
  }

  .cart-item__nameText {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .cart-item__portionInline { max-width: 120px; }

  .cart-thumb {
    display: none;
  }

  .cart-item__left { gap: 0; }
  .cart-item__left { width: 100%; }
  .cart-item__text { flex: 1 1 auto; width: 100%; }

  .cart-item__controls {
    justify-items: start;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cart-item__amount {
    display: none;
  }

  .cart-item__actions {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }

  .qty {
    padding: 7px 10px;
    gap: 10px;
    width: auto;
    justify-content: flex-start;
  }

  .qty button {
    width: 30px;
    height: 30px;
  }

  .qty .qty__value {
    min-width: 18px;
    font-size: 12px;
  }

  .cart-item__iconActions {
    justify-content: flex-end;
    gap: 8px;
    justify-self: end;
  }

  .cart-item .icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .cart-item .icon-btn {
    font-size: 14px;
    line-height: 1;
  }
}
