/* ---------- tokens ---------- */
:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #f0ede7;
  --ink: #1d1b18;
  --ink-2: #4a463f;
  --muted: #7a746a;
  --line: #e3ded4;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fdebe1;
  --focus: #2563eb;
  --veg: #15803d;
  --nonveg: #b91c1c;
  --s-new: #2563eb;       --s-new-soft: #e6eefc;
  --s-prep: #b45309;      --s-prep-soft: #fdf1dc;
  --s-ready: #15803d;     --s-ready-soft: #e2f4e8;
  --s-served: #6b7280;    --s-served-soft: #eef0f2;
  --danger: #b91c1c;      --danger-soft: #fde8e8;
  --bar: #2a78d6;
  --chart-surface: #fcfcfb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 25, 15, .06), 0 4px 16px rgba(30, 25, 15, .06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1d1c19; --surface-2: #26241f; --ink: #f2efe9; --ink-2: #cfc9bd;
    --muted: #9a9387; --line: #34312b; --accent: #f97316; --accent-ink: #1a0d03; --accent-soft: #3a2415;
    --veg: #22c55e; --nonveg: #f87171;
    --s-new: #60a5fa; --s-new-soft: #1c2a40; --s-prep: #fbbf24; --s-prep-soft: #3a2c10;
    --s-ready: #4ade80; --s-ready-soft: #15311f; --s-served: #9ca3af; --s-served-soft: #2a2c30;
    --danger: #f87171; --danger-soft: #3d1b1b; --bar: #3987e5; --chart-surface: #1a1a19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1d1c19; --surface-2: #26241f; --ink: #f2efe9; --ink-2: #cfc9bd;
  --muted: #9a9387; --line: #34312b; --accent: #f97316; --accent-ink: #1a0d03; --accent-soft: #3a2415;
  --veg: #22c55e; --nonveg: #f87171;
  --s-new: #60a5fa; --s-new-soft: #1c2a40; --s-prep: #fbbf24; --s-prep-soft: #3a2c10;
  --s-ready: #4ade80; --s-ready-soft: #15311f; --s-served: #9ca3af; --s-served-soft: #2a2c30;
  --danger: #f87171; --danger-soft: #3d1b1b; --bar: #3987e5; --chart-surface: #1a1a19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
a { color: inherit; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: .9rem; border-radius: 8px; }
.btn.block { width: 100%; }

input[type=text], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
label.field { display: grid; gap: 4px; font-size: .88rem; color: var(--ink-2); font-weight: 600; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 17px;
}
.topbar .spacer { flex: 1; }
.sync { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.sync::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: 1px; }
.sync[data-state="live"] { color: var(--s-ready); background: var(--s-ready-soft); }
.sync[data-state="live"]::before { background: var(--s-ready); animation: pulse 2s infinite; }
.sync[data-state="polling"] { color: var(--s-prep); background: var(--s-prep-soft); }
.sync[data-state="polling"]::before { background: var(--s-prep); }
@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 560px) {
  .topbar { gap: 8px; }
  .brand > span:last-child, .legend-late { display: none; }
  .sync { font-size: 0; padding: 6px; }
  .sync::before { margin: 0; }
}

.theme-btn { gap: 6px; }
.theme-label { font-size: .85rem; }
@media (max-width: 560px) { .theme-label { display: none; } }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.pin-top .pin-back { margin-bottom: 0; }

/* ---------- landing ---------- */
.landing { max-width: 960px; margin: 0 auto; padding: 48px 16px; }
.landing h1 { font-size: 2rem; margin-bottom: 6px; }
.screens { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 28px; }
.screen-card {
  display: grid; gap: 8px; padding: 22px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; transition: transform .12s;
}
.screen-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.screen-card .icon { font-size: 30px; }
.screen-card .tag { justify-self: start; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

/* ---------- status pills & veg mark ---------- */
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; letter-spacing: .02em; }
.pill.New { color: var(--s-new); background: var(--s-new-soft); }
.pill.Preparing { color: var(--s-prep); background: var(--s-prep-soft); }
.pill.Ready { color: var(--s-ready); background: var(--s-ready-soft); }
.pill.Served { color: var(--s-served); background: var(--s-served-soft); }
.veg-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid var(--veg); border-radius: 3px; flex: none; vertical-align: -2px; }
.veg-mark::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--veg); }
.veg-mark.nv { border-color: var(--nonveg); }
.veg-mark.nv::after { background: none; width: 0; height: 0; border-radius: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid var(--nonveg); }

/* ---------- customer ---------- */
.table-picker { max-width: 880px; margin: 0 auto; padding: 32px 16px; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 20px; }
.table-btn {
  aspect-ratio: 1.2; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  display: grid; place-content: center; gap: 2px; text-align: center; cursor: pointer; box-shadow: var(--shadow);
}
.table-btn strong { font-size: 1.8rem; }
.table-btn:hover { border-color: var(--accent); }
.table-btn.busy small:last-child { color: var(--accent); font-weight: 600; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 16px; align-items: start; }
.menu-bar { position: sticky; top: 57px; z-index: 10; background: var(--bg); padding-top: 10px; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 10px; scrollbar-width: none; }
.diet-filter { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.diet-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); font-weight: 700; cursor: pointer;
}
.diet-btn:hover { color: var(--ink); }
.diet-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.diet-count { font-size: .75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.cat-tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.menu-section { scroll-margin-top: 170px; margin: 14px 0 22px; }
.menu-section > h2 { margin-bottom: 10px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.menu-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); align-items: center;
}
.menu-card > .dish-pic { grid-column: 1; grid-row: 1 / span 2; }
.menu-card .name { grid-column: 2; display: flex; gap: 8px; align-items: baseline; font-weight: 700; align-self: end; }
.menu-card .meta { grid-column: 2; color: var(--muted); font-size: .85rem; align-self: start; }
.menu-card .price { font-weight: 700; }
.menu-card .add { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.menu-card.off { opacity: .55; }
.menu-card.off .name { text-decoration: line-through; text-decoration-color: var(--muted); }
.in-cart { font-size: .75rem; font-weight: 700; color: var(--accent); }

.side { position: sticky; top: 73px; display: grid; gap: 16px; max-height: calc(100vh - 90px); overflow: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .note { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); font-style: italic; }
.line.bad { color: var(--danger); }
.line .warn { grid-column: 1 / -1; font-size: .8rem; color: var(--danger); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 34px; height: 32px; border: 0; background: var(--surface-2); cursor: pointer; font-weight: 700; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; }
.totals { display: grid; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.1rem; font-weight: 800; }
.order-block { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.order-block header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .88rem; }
.lock-note { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.empty { text-align: center; color: var(--muted); padding: 18px 0; }
.cart-fab, .cart-close { display: none !important; }
@media (max-width: 900px) { .cart-fab:not(.hidden), .cart-close { display: flex !important; } }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 8, 5, .45); }
.dialog-body { padding: 20px; display: grid; gap: 14px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

@media (max-width: 900px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 90px; }
  .side { position: fixed; inset: auto 0 0 0; top: auto; max-height: 85vh; z-index: 30; padding: 0 12px 12px; transform: translateY(105%); transition: transform .2s; }
  .side.open { transform: none; }
  .cart-fab { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 25; justify-content: space-between; min-height: 52px; font-size: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 29; }
}

/* ---------- kitchen ---------- */
body.kds { --kds-late: #ef4444; }
.kds-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px; min-height: calc(100vh - 57px); }
.kds-col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kds-col > header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; }
.kds-col > header .count { font-weight: 800; font-size: 1.2rem; }
.kds-col[data-status="New"] > header h2 { color: var(--s-new); }
.kds-col[data-status="Preparing"] > header h2 { color: var(--s-prep); }
.kds-col[data-status="Ready"] > header h2 { color: var(--s-ready); }
.kds-cards { display: grid; gap: 10px; align-content: start; }
.ticket {
  text-align: left; width: 100%; border: 2px solid transparent; border-left-width: 6px; border-radius: 12px; padding: 12px;
  background: var(--surface); cursor: pointer; box-shadow: var(--shadow); display: grid; gap: 8px; transition: transform .08s;
}
.ticket:active { transform: scale(.985); }
.ticket[data-status="New"] { border-left-color: var(--s-new); }
.ticket[data-status="Preparing"] { border-left-color: var(--s-prep); }
.ticket[data-status="Ready"] { border-left-color: var(--s-ready); }
.ticket.late { border-color: var(--kds-late); background: color-mix(in srgb, var(--kds-late) 14%, var(--surface)); }
.ticket.late .elapsed { background: var(--kds-late); color: #fff; }
.ticket.fresh { animation: arrive 1.2s ease-out; }
@keyframes arrive { 0% { box-shadow: 0 0 0 4px var(--s-new); } 100% { box-shadow: var(--shadow); } }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket-head .tbl { font-size: 1.35rem; font-weight: 800; }
.elapsed { font-weight: 800; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 8px; background: var(--surface-2); }
.ticket-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.ticket ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ticket li { display: grid; grid-template-columns: 34px 1fr; }
.ticket li .q { font-weight: 800; }
.ticket li .n { font-weight: 600; }
.ticket li .note { grid-column: 2; font-size: .85rem; color: var(--s-prep); font-weight: 600; }
.ticket li .added { font-size: .7rem; font-weight: 800; color: var(--s-new); margin-left: 6px; }
.ticket-action { font-size: .82rem; font-weight: 700; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.kds-empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: .9rem; }
.legend-late { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.legend-late i { width: 12px; height: 12px; border-radius: 3px; background: #ef4444; display: inline-block; }
@media (max-width: 820px) { .kds-board { grid-template-columns: 1fr; } }

/* ---------- manager ---------- */
.mgr { max-width: 1200px; margin: 0 auto; padding: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { padding: 10px 16px; border: 0; background: none; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=date] { width: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.9rem; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .82rem; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.chart-wrap { position: relative; background: var(--chart-surface); border-radius: 10px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap .grid { stroke: var(--line); stroke-width: 1; }
.chart-wrap .axis-label { fill: var(--muted); font-size: 11px; }
.chart-wrap .bar { fill: var(--bar); }
.chart-wrap .hit { fill: transparent; cursor: default; }
.chart-wrap .hit:hover + .bar, .chart-wrap .bar.hover { filter: brightness(1.15); }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .8rem;
  padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); z-index: 2;
}
.chart-tip b { display: block; }
details.table-view { margin-top: 10px; font-size: .88rem; }
details.table-view summary { cursor: pointer; color: var(--muted); font-weight: 600; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data td.r, table.data th.r { text-align: right; }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.top-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: center; }
.top-list .rank { font-weight: 800; color: var(--muted); }
.top-list .meter { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.top-list .meter i { display: block; height: 100%; background: var(--bar); border-radius: 3px; }
.live-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tcard { text-align: left; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); cursor: pointer; display: grid; gap: 4px; }
.tcard.open { border-color: var(--accent); background: var(--accent-soft); }
.tcard.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.tcard strong { font-size: 1.25rem; }
.bill-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.bill-paper { font-variant-numeric: tabular-nums; }
.bill-paper .line { grid-template-columns: 1fr auto auto; }

.menu-admin { display: grid; gap: 16px; }
.cat-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat-block > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--surface-2); }
.cat-block > header h3 { flex: 1; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 80px 150px auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.item-row .nm { display: flex; gap: 8px; align-items: center; font-weight: 600; min-width: 0; }
.item-row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .85rem; font-weight: 600; user-select: none; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--s-ready); }
.switch input:checked::after { transform: translateX(16px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--bg); }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .bill-layout { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: minmax(0, 1fr) auto; }
  .item-row .price-col, .item-row .prep-col { display: none; }
}

/* ---------- PIN overlay ---------- */
.pin-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.pin-card { width: min(320px, 100%); display: grid; gap: 10px; text-align: center; }
.pin-back { justify-self: start; font-size: .85rem; color: var(--muted); text-decoration: none; margin-bottom: 20px; }
.pin-input { text-align: center; font-size: 1.8rem !important; letter-spacing: .5em; min-height: 56px !important; }
.pin-error { color: var(--danger); min-height: 1.3em; margin: 0; font-weight: 600; font-size: .9rem; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 60px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.keypad button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .3s, transform .3s; }
.toast-error { background: var(--danger); color: #fff; }
.toast-good { background: var(--s-ready); color: #06220f; }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* ---------- dish pictures ---------- */
.dish-pic {
  --a: #ffe2c7; --b: #ffc59a;
  flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.7), transparent 55%), linear-gradient(135deg, var(--a), var(--b));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.06); overflow: hidden;
}
.dish-pic > span { font-size: 34px; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.18)); transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.dish-pic.sm { width: 36px; height: 36px; border-radius: 10px; }
.dish-pic.sm > span { font-size: 19px; }
.dish-pic.lg { width: 84px; height: 84px; border-radius: 22px; }
.dish-pic.lg > span { font-size: 46px; }
.dish-pic[data-tone="0"] { --a: #e3f1ff; --b: #b9dafc; }
.dish-pic[data-tone="1"] { --a: #ffe6cf; --b: #ffc79c; }
.dish-pic[data-tone="2"] { --a: #fdf1c9; --b: #f8d982; }
.dish-pic[data-tone="3"] { --a: #fde2ec; --b: #f7b8cf; }
.dish-pic[data-tone="4"] { --a: #dcf5e6; --b: #a9e3c1; }
:root[data-theme="dark"] .dish-pic { filter: saturate(.8) brightness(.78); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dish-pic { filter: saturate(.8) brightness(.78); } }
.dish-pic.has-photo { position: relative; }
.dish-pic.has-photo > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.dish-pic.has-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); pointer-events: none; }
:root[data-theme="dark"] .dish-pic.has-photo { filter: brightness(.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dish-pic.has-photo { filter: brightness(.92); } }
.menu-card:hover .dish-pic.has-photo > img { transform: scale(1.1); }
.menu-card.off .dish-pic { filter: grayscale(1) opacity(.6); }
.line-item { display: flex; gap: 10px; align-items: center; min-width: 0; }
.add-head { display: flex; gap: 14px; align-items: center; }
.top-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pic-picker { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: center; }
.pic-choices { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; max-height: 128px; overflow: auto; padding: 2px; }
.pic-choice { height: 38px; border-radius: 9px; border: 1px solid transparent; background: var(--surface-2); font-size: 20px; cursor: pointer; transition: transform .15s, border-color .15s; }
.pic-choice:hover { transform: scale(1.12); }
.pic-choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.fly-pic { position: fixed; z-index: 300; pointer-events: none; will-change: transform; }

/* ---------- hover effects ---------- */
.btn { transition: background-color .15s, border-color .15s, transform .12s, box-shadow .15s, filter .15s; }
.btn:not(:disabled):active { transform: scale(.96); }
.btn.primary:not(:disabled):hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); transform: translateY(-1px); }
.menu-card, .table-btn, .tcard, .kpi, .screen-card, .panel, .cat-block, .ticket {
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s, background-color .2s;
}
.menu-card:not(.off):hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 10px 24px rgba(30,25,15,.12); }
.menu-card:not(.off):hover .dish-pic > span { transform: scale(1.16) rotate(-8deg); }
.menu-card:not(.off):hover .add { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.table-btn:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 26px rgba(30,25,15,.14); }
.tcard:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(30,25,15,.12); }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(30,25,15,.1); border-color: color-mix(in srgb, var(--bar) 40%, var(--line)); }
.screen-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(30,25,15,.16); }
.screen-card .icon { display: inline-block; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.screen-card:hover .icon { transform: scale(1.25) rotate(-10deg); }
.ticket:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.cat-tab, .diet-btn, .tab { transition: background-color .15s, color .15s, transform .12s, box-shadow .15s; }
.cat-tab:hover:not(.active) { background: var(--surface-2); transform: translateY(-1px); }
.tab:hover:not(.active) { color: var(--ink-2); }
.item-row { transition: background-color .15s; }
.item-row:hover { background: var(--surface-2); }
.item-row:hover .dish-pic > span, .top-list li:hover .dish-pic > span, .line:hover .dish-pic > span { transform: scale(1.15) rotate(-6deg); }
.top-list li { border-radius: 10px; transition: background-color .15s; }
.stepper button { transition: background-color .15s; }
.stepper button:hover:not(:disabled) { background: var(--line); }
.brand-mark { transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.08); }
.chart-wrap .bar { transition: filter .15s; }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bump { 0%, 100% { transform: none; } 30% { transform: scale(1.04); } 60% { transform: scale(.98); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.menu-card.enter { animation: rise .45s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.bump { animation: bump .45s ease; }
.pop { display: inline-block; animation: pop .5s cubic-bezier(.34,1.56,.64,1); }
dialog[open] { animation: dialog-in .28s cubic-bezier(.2,.8,.2,1); }
dialog[open]::backdrop { animation: fade .25s ease; }
.toast { animation: rise .3s cubic-bezier(.2,.8,.2,1); }
.table-grid.enter .table-btn { animation: rise .4s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--n, 0) * 30ms); }
.screen-card { animation: rise .5s cubic-bezier(.2,.8,.2,1) backwards; }
.screen-card:nth-child(2) { animation-delay: .08s; }
.screen-card:nth-child(3) { animation-delay: .16s; }
.landing h1, .landing > p { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.landing .brand-mark { animation: float 3.2s ease-in-out infinite; }
.pin-card { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.ticket.moved { animation: slide-in .4s cubic-bezier(.2,.8,.2,1); }
.ticket.fresh { animation: slide-in .4s cubic-bezier(.2,.8,.2,1), arrive 1.4s ease-out; }
.kpis.enter .kpi { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.kpis.enter .kpi:nth-child(2) { animation-delay: .06s; }
.kpis.enter .kpi:nth-child(3) { animation-delay: .12s; }
.kpis.enter .kpi:nth-child(4) { animation-delay: .18s; }
.chart-wrap svg.grow .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow-y .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 35ms); }
.top-list.grow li { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms); }
.top-list.grow .meter i { transform-origin: left; animation: grow-x .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.15s + var(--i, 0) * 60ms); }
#tab-dash, #tab-tables, #tab-menu { animation: fade .25s ease; }
.sync[data-state="live"]::before { box-shadow: 0 0 0 0 var(--s-ready); animation: pulse 2s infinite, ring 2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-ready) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- home background (decorative, CSS only) ---------- */
.home { --glow-1: #fb923c; --glow-2: #22c55e; --glow-3: #f59e0b; --glow-alpha: .30; --floater-alpha: .22; --dot: rgba(60, 45, 25, .10); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home { --glow-1: #f97316; --glow-2: #16a34a; --glow-3: #eab308; --glow-alpha: .24; --floater-alpha: .30; --dot: rgba(255, 240, 220, .06); }
}
:root[data-theme="dark"] .home { --glow-1: #f97316; --glow-2: #16a34a; --glow-3: #eab308; --glow-alpha: .24; --floater-alpha: .30; --dot: rgba(255, 240, 220, .06); }

.home { min-height: 100vh; min-height: 100dvh; }
.home-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.home .landing { position: relative; z-index: 1; }

.home-bg .glow {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(70px); opacity: var(--glow-alpha); will-change: transform;
}
.home-bg .g1 { background: var(--glow-1); top: -18vmax; left: -12vmax; animation: drift-1 26s ease-in-out infinite alternate; }
.home-bg .g2 { background: var(--glow-2); bottom: -22vmax; right: -14vmax; animation: drift-2 32s ease-in-out infinite alternate; }
.home-bg .g3 { background: var(--glow-3); top: 30%; left: 45%; width: 30vmax; height: 30vmax; animation: drift-3 22s ease-in-out infinite alternate; }

.home-bg .dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}

.home-bg .floater {
  position: absolute; left: var(--x); bottom: -60px; font-size: var(--s); line-height: 1;
  opacity: 0; animation: float-up var(--d) linear var(--w) infinite; will-change: transform, opacity;
}

@keyframes drift-1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-12vw, -12vh) scale(1.1); } }
@keyframes drift-3 { 0% { transform: translate(-20%, -10%) scale(.9); } 100% { transform: translate(10%, 15%) scale(1.2); } }
@keyframes float-up {
  0%   { transform: translateY(0) rotate(-12deg); opacity: 0; }
  12%  { opacity: var(--floater-alpha); }
  50%  { transform: translateY(-55vh) translateX(18px) rotate(10deg); }
  88%  { opacity: var(--floater-alpha); }
  100% { transform: translateY(-115vh) translateX(-10px) rotate(-8deg); opacity: 0; }
}

/* Frosted-glass cards so the background shows through. */
.home .screen-card {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
}
.home .landing h1 {
  background: linear-gradient(90deg, var(--ink) 0%, var(--accent) 55%, var(--ink) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both, shimmer 9s ease-in-out 1s infinite;
}
@keyframes shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* Less motion requested: keep the look, stop the movement, show the food still. */
@media (prefers-reduced-motion: reduce) {
  .home-bg .glow, .home .landing h1 { animation: none !important; }
  .home .landing h1 { background-position: 50% 0; }
  .home-bg .floater { animation: none !important; bottom: auto; top: var(--y); opacity: var(--floater-alpha); }
}

/* ---------- photo credits ---------- */
.credits { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 10px; }
.credit { display: flex; gap: 14px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.credit img { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.credit div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.credit .muted { font-size: .85rem; }
.credits-page a:not(.btn):not(.brand) { color: var(--accent); }
.photo-credit { display: block; text-align: center; margin: 18px 0 8px; font-size: .8rem; color: var(--muted); }
.photo-credit a { color: inherit; }

/* ---------- kitchen sound alerts ---------- */
#soundBtn.attention { animation: pulse-btn 1.4s ease-in-out infinite; }
@keyframes pulse-btn { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }
.ticket.nudge { animation: nudge .6s ease-in-out 2; }
@keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { #soundBtn.attention, .ticket.nudge { animation: none; } }

/* ---------- split bill ---------- */
.close-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
dialog.wide-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog.wide-dialog .dialog-body { max-height: calc(100dvh - 32px); overflow: auto; }
.payer-dot {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: .78rem; font-weight: 800; color: #fff; background: var(--pc, var(--accent));
}
[data-p="0"] { --pc: #c2410c; } [data-p="1"] { --pc: #2563eb; } [data-p="2"] { --pc: #15803d; }
[data-p="3"] { --pc: #9333ea; } [data-p="4"] { --pc: #b45309; } [data-p="5"] { --pc: #0e7490; }
.split-payers { display: grid; gap: 10px; }
.payer-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.payer-name { display: flex; align-items: center; gap: 8px; }
.payer-name input { min-width: 0; flex: 1; }
.payer-count { display: flex; align-items: center; gap: 10px; }
.split-units { display: grid; gap: 2px; max-height: 42vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; }
.split-unit { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.split-unit:last-child { border-bottom: 0; }
.payer-pick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.pick {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--pc); background: transparent;
  color: var(--pc); font-weight: 800; cursor: pointer; transition: transform .12s, background .12s;
}
.pick:hover { transform: scale(1.08); }
.pick.on { background: var(--pc); color: #fff; }
.split-summary { display: grid; gap: 6px; }
.payer-total { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.payer-total.empty { outline: 2px dashed var(--danger); outline-offset: -2px; }
.payer-total.grand { background: transparent; border-top: 1px dashed var(--line); border-radius: 0; font-weight: 700; }
.receipts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.receipt { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; font-variant-numeric: tabular-nums; }
.receipt header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.receipt-line { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: .9rem; }
.receipt-line.grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-weight: 800; font-size: 1rem; }
@media print {
  body > *:not(#receiptDialog) { display: none !important; }
  #receiptDialog { position: static; box-shadow: none; width: auto; max-height: none; }
  #receiptDialog .dialog-actions { display: none; }
  .receipt { break-inside: avoid; }
}

/* ---------- 3D (CSS only) ---------- */
/* Tilt: App.tilt() sets --rx / --ry (lean) and --gx / --gy (glare spot) while the pointer is over a card. */
.tilt { position: relative; transform-style: preserve-3d; }
.menu-card.tilt.tilting, .table-btn.tilt.tilting, .screen-card.tilt.tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
  transition: transform .08s linear, box-shadow .25s, border-color .2s;
  box-shadow: 0 24px 44px rgba(30, 25, 15, .2);
}
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .38), transparent 55%);
}
.tilt.tilting::after { opacity: 1; }
:root[data-theme="dark"] .tilt::after { background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .12), transparent 55%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tilt::after { background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .12), transparent 55%); } }
/* Depth: the dish photo, price button and card icon float above the tilted card. */
.menu-card.tilt .dish-pic, .menu-card.tilt .add, .table-btn.tilt strong, .screen-card.tilt .icon { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.menu-card.tilt.tilting .dish-pic { transform: translateZ(36px) scale(1.04); box-shadow: 0 14px 22px rgba(30, 25, 15, .25); }
.menu-card.tilt.tilting .add { transform: translateZ(22px); }
.table-btn.tilt.tilting strong { transform: translateZ(30px); }
.screen-card.tilt.tilting .icon { transform: translateZ(26px) scale(1.12) rotate(-6deg); }
/* Frosted glass flattens 3D, so a home card loses its blur while it is being tilted. */
.home .screen-card.tilt.tilting { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--surface) 92%, transparent); }

/* Home: eight dish photos on a slowly turning ring. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: center; margin-top: 12px; }
.hero p { animation: rise .5s cubic-bezier(.2,.8,.2,1) .06s both; }
.plate-stage { --size: 110px; --r: 150px; position: relative; height: 300px; display: grid; place-items: center; perspective: 1000px; }
.plate-ring { position: relative; width: var(--size); height: var(--size); transform-style: preserve-3d; animation: spin3d 30s linear infinite; }
.plate-stage:hover .plate-ring { animation-play-state: paused; }
.plate {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden; backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 45deg)) translateZ(var(--r));
  box-shadow: 0 14px 30px rgba(30, 25, 15, .28); border: 3px solid var(--surface);
}
.plate img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate-shadow {
  position: absolute; bottom: 34px; width: 340px; height: 46px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(30, 25, 15, .22), transparent 70%);
}
@keyframes spin3d { from { transform: rotateX(-14deg) rotateY(0deg); } to { transform: rotateX(-14deg) rotateY(-360deg); } }
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .plate-stage { --size: 84px; --r: 116px; height: 220px; }
  .plate-shadow { width: 260px; bottom: 22px; }
}

/* Customer: the add dialog's photo swings in. */
dialog[open] #addPic .dish-pic { animation: pic-swing .65s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pic-swing { from { opacity: 0; transform: perspective(600px) rotateY(-80deg) translateZ(-40px) scale(.8); } to { opacity: 1; transform: perspective(600px) rotateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .plate-ring { animation: none !important; transform: rotateX(-14deg) rotateY(-20deg); }
  dialog[open] #addPic .dish-pic { animation: none !important; }
}

/* Customer table picker: a round dining table in CSS 3D, slowly turning.
   The scene is a point on a tilted "floor"; everything is placed from that centre.
   Heights above the floor (translateZ): chair seats 26px, tabletop 46px. */
.picker-head { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: 8px; }
.dine-stage { --k: 1; height: 270px; display: grid; place-items: center; perspective: 900px; }
.dine-scene { position: relative; width: 0; height: 0; transform-style: preserve-3d; animation: dine-spin 28s linear infinite; }
.dine-stage:hover .dine-scene { animation-play-state: paused; }
@keyframes dine-spin {
  from { transform: rotateX(58deg) scale(var(--k)) rotateZ(0deg); }
  to   { transform: rotateX(58deg) scale(var(--k)) rotateZ(360deg); }
}
.dine-scene > *, .dine-top > * { position: absolute; display: block; transform-style: preserve-3d; }
.dine-shadow { left: -190px; top: -190px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(30, 25, 15, .32), transparent 65%); }
/* The pedestal: two crossed upright panels, so it looks solid from every side. */
.dine-leg { left: -14px; top: -46px; width: 28px; height: 46px; transform-origin: 50% 100%; transform: rotateX(-90deg); background: linear-gradient(90deg, #4a2d18, #7a4b2a 50%, #4a2d18); border-radius: 4px; }
.dine-leg.cross { transform: rotateZ(90deg) rotateX(-90deg); }
/* Chairs: a seat, and a backrest standing up on its outer edge. */
.chair {
  left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 12px;
  transform: rotateZ(var(--a)) translateY(-152px) translateZ(26px);
  background: linear-gradient(135deg, #b8732f, #8c5424); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .12);
}
.chair i {
  position: absolute; left: 0; top: -40px; width: 52px; height: 40px; border-radius: 12px 12px 4px 4px;
  transform-origin: 50% 100%; transform: rotateX(-90deg);
  background: linear-gradient(180deg, #c98443, #94592a);
}
/* Tabletop and its edge (a darker disc just below, which reads as the table's thickness). */
.dine-edge { left: -116px; top: -116px; width: 232px; height: 232px; border-radius: 50%; transform: translateZ(40px); background: #5a3820; }
.dine-top {
  left: -116px; top: -116px; width: 232px; height: 232px; border-radius: 50%; transform: translateZ(46px);
  background: radial-gradient(circle at 38% 32%, #d9a06a, #a8683a 60%, #8a5430); border: 6px solid #6d4426;
  box-sizing: border-box;
}
.dine-plate {
  left: 87px; top: 87px; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #fbf6ee;
  border: 4px solid #fbf6ee; box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transform: rotateZ(var(--a)) translateY(-70px) translateZ(1px);
}
.dine-plate img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dine-center { left: 96px; top: 96px; width: 28px; height: 28px; border-radius: 50%; transform: translateZ(1px); background: radial-gradient(circle at 35% 35%, #f6d27a, #c58f2a); box-shadow: 0 0 0 4px rgba(246, 210, 122, .35); }
@media (max-width: 760px) {
  .picker-head { grid-template-columns: minmax(0, 1fr); }
  .dine-stage { --k: .72; height: 200px; order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .dine-scene { animation: none !important; transform: rotateX(58deg) scale(var(--k)) rotateZ(20deg); }
}
