/* Extra styles on top of ui.css for the working prototype. */
html, body { margin: 0; }
body { background: #E9E9E9; min-height: 100vh; }
body.t-kadak { background: #F1E7D8; }
button { font: inherit; }
button.btn, button.opt, button.chip, button.nav { cursor: pointer; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .opt:focus-visible, .chip:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button.chip { border: none; }

/* Button labels always stay on one line. Rows of buttons wrap as whole buttons instead. */
.btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.btn-sm { font-size: 13px; padding: 0 12px; }
.btn-row { flex-wrap: wrap; }
.btn-row > * { flex: 1 1 auto; }
.foot .btn { font-size: 15px; }
.chip { white-space: nowrap; }

/* Diner app: a phone-shaped column on a laptop, full screen on a real phone. */
.phone { width: 100%; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; background: var(--bg); position: relative; box-shadow: 0 0 0 1px var(--border); }
.body.scroll { overflow-y: auto; }
.body > * { flex-shrink: 0; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.item .pic .btn { min-width: 84px; }
.step button { background: none; border: none; width: 28px; height: 28px; font-size: 18px; font-weight: 700; color: var(--primary); cursor: pointer; }
.otp input { width: 46px; height: 56px; border: 1.5px solid var(--primary); border-radius: 10px; text-align: center; font-size: 22px; font-weight: 700; background: var(--surface); color: var(--text); }
.star-btn { background: none; border: none; font-size: 26px; line-height: 1; color: var(--border); cursor: pointer; padding: 2px; }
.star-btn.on { color: var(--accent); }
.demo { background: #FFF6D6; color: #5A4300; border: 1px dashed #C9A227; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
textarea.input { resize: vertical; min-height: 64px; }
.sheet-wrap { position: absolute; inset: 0; z-index: 20; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #111; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; z-index: 99; max-width: 90vw; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Animated icons ---- */
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 35%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes sweep { 0% { transform: translateX(-120%) skewX(-20deg); } 60%, 100% { transform: translateX(220%) skewX(-20deg); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 4px var(--primary-soft); } 50% { box-shadow: 0 0 0 9px var(--primary-soft); } }

/* Success tick: circle pops in, tick draws itself. */
.okdot { animation: pop .5s ease-out both; }
.okdot .draw { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .3s ease-out forwards; }

/* Waiting for payment: clock hands turn inside a pulsing ring. */
.wait-ico { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--warn-soft); color: var(--warn); animation: ring 1.6s ease-out infinite; position: relative; }
.wait-ico::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--warn); animation: spin 1.2s linear infinite; }
.wait-ico .hand-m, .wait-ico .hand-h { transform-box: view-box; transform-origin: 24px 24px; }
.wait-ico .hand-m { animation: spin 2s linear infinite; }
.wait-ico .hand-h { animation: spin 12s linear infinite; }

/* Progress steps on the waiting screen. */
.steps { list-style: none; margin: 4px 0 0; padding: 0; align-self: stretch; text-align: left; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.steps li.done, .steps li.now { color: var(--text); }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface); }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done .dot svg { width: 16px; height: 16px; }
.steps li.done .draw { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .4s .2s ease-out forwards; }
.steps li.now .dot { border-color: var(--warn); border-top-color: transparent; animation: spin 1s linear infinite; }

/* Live status chip (Received / Cooking) gets a blinking dot. */
.chip.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.2s ease-in-out infinite; }

/* Voucher: a light sweep across the card. */
.voucher.shine { position: relative; overflow: hidden; animation: pop .5s ease-out both; }
.voucher.shine::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: sweep 2.8s 0.6s ease-in-out infinite; }

/* Counter: a new-order table gently glows until someone opens it. */
.tcard.hot { animation: glow 1.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .okdot .draw, .steps li.done .draw { stroke-dashoffset: 0; }
}

/* Counter + owner */
.app { min-height: 100vh; }
.tcard { cursor: pointer; border: 1px solid var(--border); font: inherit; text-align: left; }
.tcard.sel { box-shadow: 0 0 0 3px var(--primary); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.kot { margin: 0 auto; }
.alert-row { display: flex; gap: 10px; flex-wrap: wrap; }
.side .nav { width: 100%; background: none; border: none; text-align: left; }

/* Owner: sidebar on laptop, bottom tabs on phone */
.tabs { display: none; }
@media (max-width: 899px) {
  .owner .side { display: none; }
  .owner .main { padding: 16px 16px 96px; }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px 14px; z-index: 30; }
  .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; font-size: 11px; font-weight: 500; color: var(--muted); background: none; border: none; cursor: pointer; }
  .tabs button.on { color: var(--primary); font-weight: 700; }
  .owner .grid3, .owner .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner .kpi .v { font-size: 22px; }
}
@media (max-width: 760px) {
  .counter .side { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px; }
  .counter .side .brand { padding: 0 8px 0 0; }
  .counter .side .spacer { display: none; }
}

/* Loyalty stamp card (diner receipt and voucher). */
.stamps { background: var(--surface); border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, transparent); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.st-row { display: flex; gap: 8px; justify-content: space-between; }
.st { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.st svg { width: 20px; height: 20px; }
.st.gift { border-style: solid; border-color: var(--accent); color: var(--accent); }
.st.on { background: var(--primary); border: 2px solid var(--primary); color: #fff; animation: pop .5s ease-out both; animation-delay: calc(var(--i) * 90ms); }

/* Veg / Non-veg switch on the diner menu, using the Indian veg and non-veg symbols. */
.diet { display: flex; gap: 6px; background: var(--subtle); padding: 4px; border-radius: 12px; }
.diet-btn { flex: 1; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1.5px solid transparent; border-radius: 9px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text2); cursor: pointer; white-space: nowrap; }
.diet-btn.on { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.diet-btn.d-veg.on { border-color: var(--veg); color: var(--veg); }
.diet-btn.d-nonveg.on { border-color: var(--nonveg); color: var(--nonveg); }

/* ---- testing build additions ---- */
/* Kitchen ticket printing: only the ticket goes to the printer (58/80 mm thermal or any printer). */
@media print {
  body.print-kot * { visibility: hidden !important; }
  body.print-kot #kot, body.print-kot #kot * { visibility: visible !important; }
  body.print-kot #kot { position: fixed; left: 0; top: 0; width: 72mm; border: none; box-shadow: none; padding: 0; }
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.ok-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--ok); }
.warn-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--warn); }
select.input { appearance: auto; }
.qr-link { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }

/* Counter on a phone or small tablet: sections move to the bottom tabs, the top bar keeps who's signed in. */
@media (max-width: 899px) {
  .counter .side .nav.sec { display: none; }
  .counter .main { padding-bottom: 96px; }
}

/* Small "Demo" badge on anything still simulated (OTP by SMS, demo UPI, printer, Google, WhatsApp). */
.demo-badge { display: inline-flex; align-items: center; vertical-align: middle; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1; padding: 3px 6px; border-radius: 999px; background: #FFC94A; color: #1F1A17; border: 1.5px solid #1F1A17; }

/* Phones with a notch or home bar: keep bars and buttons clear of the screen edges (iPhone Safari, Android Chrome). */
.phone .top, .phone .hdr { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.phone .foot { padding-bottom: max(24px, calc(12px + env(safe-area-inset-bottom))); }
.phone .sheet { padding-bottom: max(28px, calc(16px + env(safe-area-inset-bottom))); }
.phone [style*="position:absolute;left:0;right:0;bottom:0"] { padding-bottom: max(20px, calc(10px + env(safe-area-inset-bottom))) !important; }
@media (max-width: 899px) {
  .tabs { padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .owner .main, .counter .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
#toast { margin-bottom: env(safe-area-inset-bottom); }
/* Inputs stay at 16px so iPhone Safari doesn't zoom in when one is tapped. */
.ui input, .ui select, .ui textarea { font-size: max(16px, 1em); }
