/* Design tokens lifted from the "POS order screen" mock. */
/* Self-hosted: no internet round-trip, works offline. */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Baloo2-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Baloo2-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Baloo2-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Baloo2-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/Baloo2-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/Baloo2-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #FFF6EC;
  --surface: #FFFFFF;
  --ink: #2A1A12;
  --muted: #6B5444;
  --line: #F3DFCB;
  --line-soft: #F1DCC8;
  --chip: #FFF0E2;
  --accent: #D9381E;
  --accent-dark: #A52A14;
  --amber: #F2B33D;
  --amber-soft: #FFE3B3;
  --nav: #2A1A12;
  --nav-active: #D9381E;
  --nav-fg: #F1DCC8;
  --veg: #2E7D32;
  --nonveg: #C62828;
  --ok-bg: #DDEFCF;
  --ok-fg: #2E7D32;
  --warn-bg: #FFE3B3;
  --warn-fg: #8B5A2B;
  --info-bg: #CDEBF2;
  --display: 'Baloo 2', system-ui, sans-serif;
  --shadow: 0 2px 0 rgba(42,26,18,.06);
  --lift: 0 14px 28px rgba(90,40,10,.16);
}

/* Tab switches swap the page body in place; keep the nav rock-steady and fade
   only the content, so it reads as one continuous screen. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
.app.swapping main { opacity: .55; transition: opacity .12s ease; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* A line that travels around a card's border. Used in place of entrance
   animations on lists that refresh, so nothing blinks. */
@property --runangle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.runline { position: relative; }
.runline::after {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--runangle),
    transparent 0 62%, var(--accent) 78%, #fff 84%, var(--accent) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: runline 1.8s linear infinite;
  pointer-events: none; z-index: 2;
}
@keyframes runline { to { --runangle: 360deg; } }
/* Browsers without @property still get a clean static ring rather than nothing. */
@supports not (background: conic-gradient(from var(--runangle), red, blue)) {
  .runline::after { background: none; border: 2px solid var(--accent); animation: none; }
}

/* Motion vocabulary from the design — used across every screen. */
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg) scale(1.06); } 60% { transform: rotate(4deg) scale(1.06); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(217,56,30,.45); } 70% { box-shadow: 0 0 0 14px rgba(217,56,30,0); } 100% { box-shadow: 0 0 0 0 rgba(217,56,30,0); } }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Author `display` rules outrank the UA sheet, so [hidden] needs to shout. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.4 Inter, system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 800; letter-spacing: 0; line-height: 1.12; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ app shell */
.app { display: flex; min-height: 100dvh; }

.nav {
  flex: 0 0 88px; background: var(--nav); display: flex; flex-direction: column;
  align-items: center; gap: 8px; padding: 20px 12px; position: sticky; top: 0; height: 100dvh;
}
.nav .logo {
  width: 52px; height: 52px; border-radius: 16px; background: #fff; overflow: hidden;
  display: grid; place-items: center; margin-bottom: 16px; flex: none;
  animation: bob 3.2s ease-in-out infinite;
}
.nav .logo img { width: 44px; height: 44px; object-fit: contain; }
.nav a {
  width: 64px; height: 58px; border-radius: 16px; color: var(--nav-fg); display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-size: 11px; font-weight: 500; flex: none;
}
.nav a[aria-current] { background: var(--nav-active); color: #fff; font-weight: 700; }

.main { flex: 1 1 auto; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.head h1 { font-size: 30px; }
.sub { font-size: 14px; color: var(--muted); }
.brand { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }

.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 2px solid var(--line); border-radius: 999px; padding: 0 18px; height: 52px;
  flex: 0 1 340px; min-width: 200px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }

/* -------------------------------------------------------------- pieces */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab {
  height: 50px; padding: 0 10px 0 20px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.tab:hover { transform: translateY(-2px); }
.tab .n {
  min-width: 30px; height: 30px; padding: 0 8px; font-size: 12px; font-weight: 700;
  border-radius: 999px; background: var(--chip); display: grid; place-items: center;
}
.tab[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab[aria-selected="true"] .n { background: rgba(255,255,255,.22); color: #fff; }

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

/* --------------------------------------------------------- dish art */
.art { border-radius: 14px; display: grid; place-items: center; flex: none; position: relative; overflow: hidden; }
.art svg { display: block; }
.art .steam { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); }
.steam .s1, .steam .s2, .steam .s3 { animation: steam 2.4s ease-in infinite; transform-origin: center; }
.steam .s2 { animation-delay: .8s; } .steam .s3 { animation-delay: 1.6s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px) scaleX(1); } 30% { opacity: .85; }
  100% { opacity: 0; transform: translateY(-22px) scaleX(1.3); } }
.row:hover .art { animation: wobble .6s ease; }
.flame { transform-origin: 50% 80%; }
.kot.aging .flame, .page-mark .flame { animation: wobble 1.4s ease-in-out infinite; }

/* Illustrated badge next to a page title, as on the design boards. */
.page-mark { width: 58px; height: 58px; border-radius: 18px; background: var(--chip); border: 2px solid var(--line);
  display: grid; place-items: center; flex: none; }
.head-with-mark { display: flex; align-items: center; gap: 14px; }
.gear { animation: spin 18s linear infinite; }

/* ------------------------------------------------------ specials ticker */
.ticker-bar { position: relative; overflow: hidden; border-radius: 20px; background: var(--ink); color: var(--bg); height: 56px; display: flex; align-items: center; }
.ticker-bar .label {
  flex: none; height: 100%; padding: 0 18px; background: var(--accent); color: #fff; display: flex;
  align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 17px; z-index: 1;
}
.ticker-bar .track { flex: 1; overflow: hidden; }
.ticker-bar .run { display: flex; width: max-content; gap: 40px; font-size: 15px; font-weight: 600; white-space: nowrap; padding-left: 24px; animation: marquee 38s linear infinite; }
.ticker-bar .dot-sep { color: var(--amber); }
.ticker-bar:hover .run { animation-play-state: paused; }
@media (max-width: 700px) { .ticker-bar .label { font-size: 15px; padding: 0 12px; } }

/* ----------------------------------------------------------- item rows */
.rows { display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
/* A row is a div, not a button: it holds the −/+ stepper, and buttons cannot nest. */
.row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 0 12px 0 0; background: var(--surface); border: 0; border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--chip); }
.row.on { background: #FFF0E2; box-shadow: inset 3px 0 0 var(--accent); }
.row-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 0 12px 16px; background: none; border: 0; color: inherit;
}
.row-qty { display: flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 999px; padding: 3px; flex: none; }
.row-qty button { width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--surface); display: grid; place-items: center; color: var(--ink); }
.row-qty .q { min-width: 22px; text-align: center; font-size: 16px; font-weight: 700; }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .nm { font-size: 16px; font-weight: 600; }
.row .ds { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .code { font-size: 12px; color: var(--muted); font-weight: 500; min-width: 44px; }
.row .pr { font-family: var(--display); font-size: 18px; font-weight: 700; min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.add-btn { width: 40px; height: 40px; border-radius: 999px; background: var(--chip); display: grid; place-items: center;
  flex: none; font-weight: 700; transition: transform .25s ease, background .25s ease, color .25s ease; }
.row:hover .add-btn { transform: rotate(90deg); background: var(--accent); color: #fff; }
.row.on .add-btn { background: var(--accent); color: #fff; }
/* `hidden` must win: an inline display would silently override it. */
.picker { display: flex; flex-direction: column; gap: 14px; }
.picker[hidden] { display: none; }
.rows-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--chip); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------ order list rows */
/* Two order cards per row on a desktop till, one on a phone. */
#orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 12px; align-items: start; }
details.order { background: var(--surface); border: 2px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); }
details.order[open] { border-color: var(--accent); }

details.order > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
details.order > summary::-webkit-details-marker { display: none; }
details.order > summary:hover { background: var(--chip); }
.order-id { font-family: var(--display); font-size: 18px; font-weight: 700; min-width: 64px; }
.order-sum { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.order-amt { font-family: var(--display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 2px solid var(--line-soft); background: var(--chip); }
.chev { flex: none; color: var(--muted); transition: transform .15s ease; }
details[open] .chev { transform: rotate(180deg); }
.badge { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--chip);
  color: var(--muted); white-space: nowrap; }
.badge.new { background: var(--amber-soft); color: var(--warn-fg); }
.badge.sent { background: var(--ok-bg); color: var(--ok-fg); }
.badge.ready { background: var(--info-bg); color: #0E4D5C; }

/* Sticky summary + actions for the order being built. */
.actionbar {
  position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; background: var(--surface); border: 2px solid var(--line); border-radius: 20px;
  padding: 12px 14px; box-shadow: 0 8px 28px rgba(27,26,23,.12);
}
.actionbar .amt { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

.card {
  position: relative; text-align: left; background: var(--surface); border: 2px solid var(--surface);
  border-radius: 18px; padding: 16px; min-height: 148px; display: flex; flex-direction: column;
  justify-content: space-between; gap: 12px;
}
.card.on { border-color: var(--accent); }
.card.off { opacity: .45; }
.card .nm { font-size: 17px; font-weight: 600; line-height: 1.25; }
.card .ds { font-size: 13px; color: var(--muted); line-height: 1.35; }
.card .pr { font-family: var(--display); font-size: 20px; font-weight: 700; }
.card .code { font-size: 12px; color: var(--muted); font-weight: 500; }
.card .plus { width: 32px; height: 32px; border-radius: 999px; background: var(--chip); display: grid; place-items: center; }
.card .qty {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center;
}

.dot { width: 18px; height: 18px; background: #fff; border: 2px solid var(--veg); border-radius: 5px; display: grid; place-items: center; flex: none; }
.dot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--veg); }
.dot.nonveg { border-color: var(--nonveg); }
.dot.nonveg::after { background: var(--nonveg); }
.dot.sm { width: 14px; height: 14px; }
.dot.sm::after { width: 6px; height: 6px; }

/* ---------------------------------------------------------------- cart */
.cart {
  flex: 0 0 380px; background: var(--surface); border-left: 1px solid var(--line);
  padding: 24px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  scrollbar-gutter: stable; /* otherwise the cart's own scrollbar clips Clear + amounts */
}
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--chip); padding: 6px; border-radius: 14px; }
.seg button { height: 44px; border-radius: 10px; border: 0; background: transparent; font-size: 14px; font-weight: 500; }
.seg button[aria-checked="true"] { background: var(--surface); font-weight: 700; box-shadow: 0 1px 3px rgba(27,26,23,.15); }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--chip); font-size: 14px; font-weight: 600;
  border: 0; max-width: 100%;
}
.chip input, .chip select { border: 0; background: transparent; outline: 0; font-size: 14px; font-weight: 600; max-width: 96px; }

.lines { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 180px; }
.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.line .nm { font-size: 15px; font-weight: 600; }
.line .ea { font-size: 13px; color: var(--muted); }
.line .amt { min-width: 64px; text-align: right; font-size: 15px; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 999px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--surface); display: grid; place-items: center; }
.stepper .q { min-width: 24px; text-align: center; font-size: 16px; font-weight: 700; }
.sent-tag { font-size: 11px; font-weight: 700; color: var(--ok-fg); background: var(--ok-bg); padding: 2px 8px; border-radius: 999px; }

.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); text-align: center; padding: 32px;
  border: 2px dashed var(--line); border-radius: 16px;
}
.totals { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--chip); border-radius: 18px; }
.totals .r { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); }
.totals .r b { color: var(--ink); font-weight: 600; }
.totals .hr { height: 1px; background: var(--line); }
.totals .big { display: flex; justify-content: space-between; align-items: baseline; }
.totals .big span:first-child { font-size: 16px; font-weight: 600; color: var(--ink); }
.totals .big .v { font-family: var(--display); font-size: 30px; font-weight: 700; }

/* flex-wrap matters: inline <b>/<a> inside prose become flex items otherwise. */
.status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-fg); font-size: 14px; font-weight: 600; line-height: 1.45; }
.status > span { flex: 1 1 200px; min-width: 0; }
.status.warn { background: var(--warn-bg); color: var(--warn-fg); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* anchors styled as buttons must not inherit the link underline */
.btn, .btn:hover { text-decoration: none; }
.btn { height: 58px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; white-space: nowrap; }
.btn:disabled { opacity: .4; }
.btn.ghost { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); }
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn { transition: transform .15s ease, background .2s ease; }
.btn.sm { height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; }
.btn.sm.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { background: var(--surface); border: 1px solid var(--line); color: var(--nonveg); }

/* --------------------------------------------------------------- panels */
.panel { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.panel h2 { font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 48px; padding: 0 16px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface); outline: 0;
}
.field textarea { height: auto; padding: 12px 14px; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.t input, table.t select { height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: var(--surface); font-size: 14px; }
.scroll-x { overflow-x: auto; }

/* ---------------------------------------------------------------- modal */
/* margin:auto is what centres a <dialog> — the * reset above wipes it out. */
dialog { border: 0; padding: 0; background: transparent; margin: auto; max-width: 100%; max-height: 100dvh; }
dialog::backdrop { background: rgba(27,26,23,.55); }
.sheet {
  background: var(--surface); border-radius: 20px; padding: 24px; width: min(460px, 94vw);
  display: flex; flex-direction: column; gap: 16px;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sheet h2 { font-size: 22px; }

/* ------------------------------------------------------------- UPI block */
.qrbox { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; background: var(--chip); border-radius: 16px; }
.qrbox img { width: min(64vw, 240px); height: auto; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; }
.qrbox .vpa { font-size: 13px; color: var(--muted); text-align: center; }
.qrbox .vpa b { font-variant-numeric: tabular-nums; }
.upi-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 54px; border-radius: 14px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 700; text-decoration: none; flex: none;
}
.upi-btn:hover { color: #fff; background: #000; }
.copy-vpa { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

/* -------------------------------------------------------------- kitchen */
.kot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kot { background: var(--surface); border: 2px solid var(--line); border-left: 8px solid var(--accent); border-radius: 20px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
  animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.kot.aging { border-left-color: var(--nonveg); }
.kot .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kot .tkt { font-family: var(--display); font-size: 22px; font-weight: 700; }
.kot .age { font-size: 13px; font-weight: 600; color: var(--muted); }
.kot ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.kot li { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.kot li .q { font-family: var(--display); font-weight: 700; min-width: 28px; }
.kot li.new { font-weight: 600; }
.kot li .note { font-size: 13px; color: var(--accent-dark); font-weight: 600; }
.kot li button { margin-left: auto; height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--chip); font-size: 13px; font-weight: 700; }

/* -------------------------------------------------------------- receipt */
.receipt { width: 302px; background: #fff; padding: 14px; font: 12px/1.45 ui-monospace, 'SFMono-Regular', Menlo, monospace; color: #000; }
.receipt .c { text-align: center; }
.receipt .b { font-weight: 700; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt .r { text-align: right; }
.receipt h3 { font-family: inherit; font-size: 14px; letter-spacing: 0; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .nav {
    flex: none; flex-direction: row; height: 64px; width: 100%; position: fixed;
    bottom: 0; top: auto; z-index: 60; padding: 6px 10px; gap: 4px;
    justify-content: space-around; overflow-x: auto;
  }
  .nav .logo { display: none; }
  .nav a { width: auto; flex: 1; height: 52px; font-size: 10px; }
  .main { padding: 16px 16px 190px; }
  .head h1 { font-size: 24px; }
  .actionbar { bottom: 76px; }
  .sheet { padding: 18px; border-radius: 18px; gap: 14px; }
  .sheet h2 { font-size: 20px; }
  .row { padding: 0 10px 0 0; gap: 8px; }
  .row .art { width: 44px !important; height: 44px !important; border-radius: 12px; }
  .row .art svg:not(.steam) { width: 38px; height: 25px; }
  .row-main { padding: 12px 0 12px 12px; gap: 10px; }
  .row .code { display: none; }
  .row .pr { font-size: 17px; min-width: 58px; }
  .row-qty button { width: 34px; height: 34px; }
  /* One scrolling row of pills beats ten stacked rows on a phone. */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; height: 44px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card { min-height: 128px; padding: 12px; border-radius: 14px; }
  .card .nm { font-size: 15px; }
  .cart {
    position: fixed; left: 0; right: 0; bottom: 64px; top: auto; height: auto;
    max-height: calc(88dvh - 64px); flex: none; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(27,26,23,.18);
    z-index: 50; padding: 14px 16px 16px;
    gap: 12px; transform: translateY(calc(100% - 76px)); transition: transform .22s ease;
  }
  .cart.open { transform: none; overflow: auto; }
  .cart .handle {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 48px; background: var(--ink); color: #fff; border: 0; border-radius: 12px;
    padding: 0 16px; font-size: 15px; font-weight: 700; width: 100%;
  }
  .cart > :not(.handle) { display: none; }
  .cart.open > * { display: flex; }
  .cart.open > .lines { display: flex; }
  .cart.open > .seg { display: grid; }
  .cart.open > .row2 { display: grid; }
  .cart.open > .row3 { display: grid; }
}
@media (min-width: 901px) { .cart .handle { display: none; } }

@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; }
  .receipt { width: auto; padding: 0; }
}
#print { display: none; }

/* ===================================================================
   Components reproduced from the design boards
   =================================================================== */

/* --- dish cards (order screen) ------------------------------------ */
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.dish {
  position: relative; text-align: left; background: #FFF; border: 2px solid var(--line);
  border-radius: 22px; padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 10px;
  color: var(--ink); animation: rise .5s cubic-bezier(.2,.8,.2,1) both;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.dish.on { border-color: var(--accent); }
.dish.off { opacity: .5; }
.dish:hover { transform: translateY(-6px); box-shadow: var(--lift); }
.dish:hover .art { animation: wobble .6s ease; }
.dish:hover .plus { transform: rotate(90deg); background: var(--accent); color: #fff; }
.dish-pic { position: relative; height: 118px; border-radius: 16px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.dish-pic .veg { position: absolute; top: 10px; left: 10px; width: 18px; height: 18px; background: #fff; border-radius: 4px; display: grid; place-items: center; box-sizing: border-box; }
.dish-pic .veg i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.dish-pic .code { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.75); padding: 3px 8px; border-radius: 999px; }
.dish-pic .art { background: none !important; width: 120px; height: 80px; margin-bottom: 4px; border-radius: 0; }
.dish-txt { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.dish-txt .nm { font-size: 16px; font-weight: 700; line-height: 1.25; }
.dish-txt .ds { font-size: 13px; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; gap: 8px; }
.dish-foot .pr { font-family: var(--display); font-size: 22px; font-weight: 800; }
.plus { width: 36px; height: 36px; border-radius: 999px; background: #FFE9D6; color: var(--ink); display: grid; place-items: center; transition: transform .25s ease, background .25s ease, color .25s ease; }
.qty-pill { display: flex; align-items: center; gap: 2px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 2px; }
.qty-pill button { width: 32px; height: 32px; border-radius: 999px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink); }
.qty-pill button.add { background: var(--accent); color: #fff; }
.qty-pill .q { min-width: 20px; text-align: center; font-size: 15px; font-weight: 800; }

/* Last tile in the grid: a dish that is not on the menu yet. Dashed, so it
   reads as an action and not as something you can order by mistake. */
.newdish { align-items: center; justify-content: center; text-align: center; gap: 6px;
  min-height: 190px; background: #FFFCF7; border-style: dashed; border-color: var(--amber); }
.newdish .plus-ring { width: 54px; height: 54px; border-radius: 999px; background: #FFE9D6;
  display: grid; place-items: center; transition: transform .25s ease, background .25s ease; }
.newdish:hover .plus-ring { transform: rotate(90deg); background: var(--amber); }
.newdish .nm { font-size: 16px; font-weight: 700; }
.newdish .ds { font-size: 13px; color: var(--muted); }

/* --- cart panel --------------------------------------------------- */
.cart-panel { flex: 1 1 380px; max-width: 100%; background: #fff; border-left: 2px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.seg-pill { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--chip); padding: 6px; border-radius: 999px; }
.seg-pill button { height: 44px; border-radius: 999px; border: 0; background: transparent; font-size: 14px; font-weight: 700; transition: background .25s ease, color .25s ease; }
.seg-pill button[aria-checked="true"] { background: var(--ink); color: #fff; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: #FFF9F3; }
.cart-line .swatch { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; }
.cart-line .swatch i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); display: block; }
.totals-dark { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--ink); color: var(--nav-fg); border-radius: 22px; }
.totals-dark .r { display: flex; justify-content: space-between; font-size: 15px; }
.totals-dark .r b { color: #fff; font-weight: 700; }
.totals-dark .hr { height: 1px; background: #4A3426; }
.totals-dark .big { display: flex; justify-content: space-between; align-items: baseline; color: #fff; }
.totals-dark .big .v { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1; }
.empty-plate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; padding: 32px; border: 2px dashed var(--line); border-radius: 20px; }
.empty-plate b { font-family: var(--display); font-size: 18px; color: var(--ink); }
.toast-ok { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 999px; background: var(--ok-bg); color: #1F4D12; font-size: 14px; font-weight: 700; }
.big-btn { height: 62px; border-radius: 18px; border: 0; font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; }
.big-btn.ghost { border: 2px solid var(--ink); background: #fff; color: var(--ink); font-size: 16px; }
.big-btn:disabled { opacity: .45; }

/* --- kitchen board ------------------------------------------------ */
.kboard { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.kcol { flex: 1 1 300px; min-width: 0; border-radius: 26px; padding: 14px; display: flex; flex-direction: column; gap: 14px; min-height: 420px; box-sizing: border-box; }
.kcol > .hd { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; }
.kcol > .hd h2 { font-size: 22px; }
.kcol > .hd .n { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; display: grid; place-items: center; }
.kcol .tickets { display: flex; flex-direction: column; gap: 14px; }
.kboard.single { display: block; }
.kcol.wide { flex: 1 1 100%; }
.kcol.wide .tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.kcol.wide .ticket .where { font-size: 19px; }
.kcol.wide .ticket .clock { font-size: 20px; }
.kcol .clear { padding: 28px 16px; border: 2px dashed rgba(42,26,18,.2); border-radius: 20px; text-align: center; font-size: 14px; color: var(--muted); font-weight: 700; }
.ticket { background: #fff; border-radius: 20px; display: flex; flex-direction: column; }
.ticket .top { border-radius: 18px 18px 0 0; color: #fff; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket .top .where { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.1; }
.ticket .top .meta { font-size: 12px; font-weight: 600; opacity: .9; }
.ticket .top .clock { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 24px; font-weight: 800; }
.ticket.late .top { animation: ring 2s ease-out infinite; }
.ticket ul { list-style: none; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ticket li button { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 6px; border: 0; border-radius: 12px; background: transparent; text-align: left; color: var(--ink); }
.ticket li button:hover { background: var(--chip); }
.ticket .chk { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--ink); background: #fff; color: #fff; display: grid; place-items: center; box-sizing: border-box; }
.ticket .chk.done { background: var(--veg); }
.ticket .qn { font-family: var(--display); font-size: 20px; font-weight: 800; min-width: 28px; }
.ticket .nm { font-size: 16px; font-weight: 700; }
.ticket .note { font-size: 13px; font-weight: 700; color: var(--accent-dark); }
.ticket .adv { margin: 0 12px 12px; height: 50px; border-radius: 14px; border: 0; font-size: 15px; font-weight: 800; }

/* --- settings cards ---------------------------------------------- */
/* Masonry-style columns: grid rows all stretch to the tallest card, which left
   ragged gaps between settings cards of different heights. Columns pack them
   one under another with no holes. */
.set-grid { display: block; width: 100%; column-width: 400px; column-gap: 18px; }
.set-grid > .set-card { break-inside: avoid; margin: 0 0 18px; width: 100%; }
.set-grid > .set-card.wide { column-span: all; }
.set-grid.one-up { column-width: auto; columns: 1; }
.set-card { background: #fff; border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 14px; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.set-card > .hd { display: flex; align-items: center; gap: 12px; }
.set-card > .hd .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--amber-soft); display: grid; place-items: center; flex: none; }
.set-card > .hd h2 { font-size: 22px; }
.set-card label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #4A3426; }
.set-card label.f input, .set-card label.f select {
  height: 48px; border-radius: 14px; border: 2px solid var(--line); padding: 0 14px;
  font-size: 15px; color: var(--ink); background: #FFF9F3; min-width: 0;
}
.set-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row .lbl { font-size: 14px; font-weight: 700; }
.switch-row .sub2 { font-size: 12px; color: var(--muted); font-weight: 500; }
.switch { width: 54px; height: 32px; border-radius: 999px; background: var(--line); border: 0; position: relative; flex: none; transition: background .2s ease; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--veg); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }

/* --- reports ------------------------------------------------------ */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi-card { border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.kpi-card .l { font-size: 14px; font-weight: 700; color: #4A3426; }
.kpi-card .v { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.kpi-card .d { font-size: 13px; font-weight: 700; color: #1F4D12; }
.chart-card { flex: 999 1 520px; min-width: 0; background: #fff; border-radius: 26px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
.chart { position: relative; height: 280px; display: flex; flex-direction: column; }
.chart .grid { position: absolute; inset: 0 0 28px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.chart .grid > div { position: relative; border-top: 1px solid #F3E7DA; height: 0; }
.chart .grid span { position: absolute; left: -48px; top: -8px; width: 42px; text-align: right; font-size: 11px; color: var(--muted); font-weight: 600; }
.chart .plot { position: relative; flex: 1; margin-left: 48px; display: flex; align-items: flex-end; gap: 6px; }
.chart .plot > div { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.chart .bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--accent); position: relative; animation: grow .5s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.chart .bar:hover .tip, .chart .bar:focus .tip { opacity: 1; transform: translate(-50%, -8px); }
.chart .tip { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 0); background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; opacity: 0; transition: opacity .15s ease, transform .15s ease; pointer-events: none; }
.chart .axis { margin-left: 48px; height: 28px; display: flex; gap: 6px; border-top: 2px solid var(--ink); }
.chart .axis span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding-top: 6px; white-space: nowrap; overflow: hidden; }
.rank { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.rank li { display: flex; flex-direction: column; gap: 6px; }
.rank .row1 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.rank .track { background: var(--chip); border-radius: 99px; height: 12px; overflow: hidden; }
.rank .fill { height: 100%; border-radius: 99px; }

/* --- service alerts ---------------------------------------------- */
/* Top-right of every staff screen: service bell + sign out. Sticky, so the bell
   stays in sight when the order list is scrolled down. */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center;
  justify-content: flex-end; gap: 10px; padding: 8px 0 6px; background: var(--bg); }
.topbar .nav-bell { width: 48px; height: 44px; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); }
.topbar #signout { display: inline-flex; align-items: center; gap: 7px; }
.nav-bell { position: relative; width: 64px; height: 48px; border: 0; background: none; font-size: 20px; color: var(--nav-fg); border-radius: 14px; }
.nav-bell.ringing { animation: wobble 1.2s ease-in-out infinite; }
.nav-bell .n { position: absolute; top: 2px; right: 10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.alert-dock { position: fixed; top: 16px; right: 16px; z-index: 900; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, 92vw); }
.toast-alert {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--ink); color: #fff; border: 0; border-radius: 18px; padding: 12px 14px;
  box-shadow: 0 16px 34px rgba(42,26,18,.28); animation: slidein .35s ease both;
}
.toast-alert.out { animation: slidein .35s ease reverse both; }
.toast-alert .ic { font-size: 22px; }
.toast-alert .txt { flex: 1; font-size: 14px; font-weight: 600; }
.toast-alert .go { font-size: 12px; font-weight: 800; background: var(--accent); padding: 5px 10px; border-radius: 999px; }
@media (max-width: 900px) {
  .alert-dock { top: auto; bottom: 150px; left: 12px; right: 12px; max-width: none; }
  .nav-bell { width: auto; flex: 1; height: 52px; }
  .kcol { min-height: 0; }
  .set-grid { grid-template-columns: 1fr; }
}

/* --- tables floor (design board) ---------------------------------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.tcard {
  text-align: left; border-radius: 24px; padding: 14px; min-height: 172px; display: flex;
  flex-direction: column; justify-content: space-between; gap: 8px; color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tcard:hover { transform: translateY(-4px); box-shadow: var(--lift); }
.tcard[aria-current="true"] { box-shadow: 0 0 0 4px rgba(42,26,18,.14); }
.tcard .no { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; }
.tcard .st { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tcard .st i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.tcard .st i.pulse { animation: ring 1.8s ease-out infinite; }
.tcard .seats { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }
.tcard .seats span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); box-sizing: border-box; }
.tcard .foot { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); font-weight: 600; }
.tcard .foot b { font-size: 16px; color: var(--ink); font-weight: 800; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; }
.legend > div { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-size: 14px; font-weight: 600; }
.legend i { width: 14px; height: 14px; border-radius: 50%; }
.legend b { font-family: var(--display); font-size: 18px; font-weight: 800; }
.detail { flex: 1 1 360px; max-width: 100%; background: #fff; padding: 24px; display: flex; flex-direction: column; gap: 18px; border-left: 2px solid var(--line); }
.detail .big-no { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-family: var(--display); font-size: 30px; font-weight: 800; }
@media (max-width: 900px) {
  /* main reserves 190px for the fixed nav; on the floor screen the detail panel
     follows it, so that reservation reads as a hole in the middle of the page. */
  .app:has(.detail) .main { padding-bottom: 16px; }
  .detail { border-left: 0; border-top: 2px solid var(--line); padding-bottom: 96px; }
  .tgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .tcard { min-height: 150px; border-radius: 20px; }
}

.chart .plot > div { max-width: 90px; }

/* --- phones ------------------------------------------------------- */
/* Everything below is for a waiter holding the phone one-handed between
   tables. Declared last so it wins over the desktop rules above. */
@media (max-width: 600px) {
  /* An order line is four things fighting for 390px. Give the ticket number,
     badge, amount and chevron the top row, and let the "Table T7 · 2 items"
     line have the width it needs underneath instead of wrapping word by word. */
  details.order > summary {
    display: grid; grid-template-columns: auto 1fr auto auto;
    align-items: center; gap: 4px 8px; padding: 12px 14px;
  }
  .order-id   { grid-area: 1 / 1; min-width: 0; font-size: 17px; }
  .order-sum  { grid-area: 2 / 1 / auto / -1; font-size: 13px;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  details.order > summary > .badge { grid-area: 1 / 2; justify-self: start; max-width: 100%; }
  .order-amt  { grid-area: 1 / 3; }
  .order > summary .chev { grid-area: 1 / 4; }

  /* Section heading and its view switch: heading first, pills on their own row. */
  .list-head { flex-wrap: wrap; row-gap: 8px; }
  .list-head > h2 { flex: 1 1 100%; }

  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-card { padding: 14px; border-radius: 18px; }
  .kpi-card .v { font-size: 28px; }

  /* A 50-row menu made the settings page 7,000px long. Scroll it in place. */
  #menuTable { font-size: 13px; }
  #menu .scroll-x { max-height: 60vh; overflow: auto; }

  .newdish { min-height: 150px; }
  .newdish .plus-ring { width: 44px; height: 44px; }

  /* Six nav items on a 390px bar: let the labels shrink rather than scroll. */
  .nav a { font-size: 9px; padding: 0 2px; }
  .nav-bell { flex: 0 0 44px; width: 44px; }
  #signout { flex: 0 0 56px; font-size: 11px; }
}

/* Phones: two dish cards per row. Declared last so it wins over the base grid. */
@media (max-width: 700px) {
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dish { padding: 8px 8px 12px; border-radius: 18px; gap: 8px; }
  .dish-pic { height: 92px; border-radius: 14px; }
  .dish-pic .art { width: 92px; height: 62px; }
  .dish-pic .art svg { width: 88px; height: 58px; }
  .dish-txt .nm { font-size: 14px; }
  .dish-txt .ds { -webkit-line-clamp: 2; font-size: 12px; }
  .dish-foot .pr { font-size: 18px; }
  .dish-foot .plus { width: 32px; height: 32px; }
  .qty-pill button { width: 28px; height: 28px; }
}
