/* Bambino Tilaukset – staff dashboard.
   Palette from bambino.fi (tomaatti, basilika, kultainen, kerma), on a dark,
   calm board so cream cards read from 1–2 m away on a counter tablet. */
:root {
  --bg: #15120F; --bar: #1D1915; --col: #221D18; --col-line: #3A322B;
  --paper: #FBF6EC; --crema: #F5EDDF; --crema2: #ECE0CB;
  --ink: #211C18; --ink2: #3A322B; --muted: #6F655A; --muted-d: #B8AD9E;
  --red: #D33A2C; --red-d: #A9261B; --red-soft: #FBE3DF;
  --green: #2E6A3E; --green-d: #1F4D2C; --green-l: #47A764; --green-soft: #DDEFE1;
  --gold: #E8B04B; --gold-soft: #FBEBC8;
  --note: #FFE27A;
  --r: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--crema); font: 400 1rem/1.4 var(--sans); -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted-d); }
.small { font-size: .85rem; }
.mt { margin-top: .4rem; }
.row { display: flex; flex-wrap: wrap; }
.gap { gap: .6rem; }
.grow { flex: 1; }
.wide { width: 100%; }
.center-y { align-items: center; }

/* ---------- logo ---------- */
.logo-plate { width: 84px; height: 84px; border-radius: 50%; background: var(--red); display: grid; place-items: center;
  box-shadow: 0 0 0 6px rgba(211,58,44,.25); flex: none; }
.logo-plate span { font: italic 700 3rem/1 var(--serif); color: var(--paper); margin-top: -4px; }
.logo-plate.sm { width: 40px; height: 40px; box-shadow: none; }
.logo-plate.sm span { font-size: 1.5rem; margin-top: -2px; }

/* ---------- screens ---------- */
.screen.center { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 1rem; padding: 24px; text-align: center; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(13,11,9,.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.shift-btn { display: grid; justify-items: center; gap: .6rem; width: min(92vw, 560px); padding: 2.4rem 2rem; border: 0; border-radius: 28px;
  background: var(--green); color: #fff; box-shadow: 0 10px 0 var(--green-d), 0 30px 80px rgba(0,0,0,.5); transition: transform .1s; }
.shift-btn:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--green-d); }
.shift-title { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; }
.shift-sub { font-size: 1.05rem; opacity: .9; max-width: 26em; }
.shift-icon { animation: ring 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }

.login-card { width: min(92vw, 420px); display: grid; gap: 1rem; justify-items: center; padding: 2rem; border-radius: 20px; background: var(--bar);
  border: 1px solid var(--col-line); }
.login-card h1 { font: 700 1.7rem/1.1 var(--sans); }
.login-card label { width: 100%; display: grid; gap: .35rem; text-align: left; font-weight: 600; }
.input, .login-card input { width: 100%; min-height: 54px; padding: .7rem .9rem; border-radius: 10px; border: 2px solid var(--col-line);
  background: var(--bg); color: var(--paper); font: inherit; font-size: 1.1rem; }
.input:focus, .login-card input:focus { border-color: var(--gold); outline: none; }
.form-error { color: #FF9A8E; font-weight: 600; margin: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 52px; padding: .6rem 1.1rem; border-radius: 12px;
  border: 2px solid transparent; font-weight: 700; font-size: 1rem; text-decoration: none; line-height: 1.1; touch-action: manipulation;
  transition: transform .08s, filter .15s; user-select: none; -webkit-user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-sm { min-height: 40px; padding: .35rem .8rem; font-size: .9rem; }
.btn-lg { min-height: 60px; font-size: 1.1rem; padding: .7rem 1.3rem; }
.btn-xl { min-height: 72px; font-size: 1.35rem; padding: .8rem 1.4rem; border-radius: 14px; }
.btn-go { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); }
.btn-done { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 #000; }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn-warn { background: var(--gold); color: var(--ink); }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--crema2); }
.btn-ghost { background: transparent; border-color: currentColor; opacity: .85; }
.btn-top { min-height: 46px; background: #2B251F; border-color: var(--col-line); color: var(--paper); }
.btn-chip { background: transparent; border-color: var(--crema2); color: var(--ink); min-height: 48px; }
.btn-chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- top bar ---------- */
#app { height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .8rem; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bar); border-bottom: 1px solid var(--col-line); flex: none; }
.brand { display: flex; align-items: center; gap: .55rem; }
.brand b { display: block; font: italic 700 1.25rem/1 var(--serif); }
.brand small { display: block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-d); }
.spacer { flex: 1; }
.clock { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.conn { display: inline-flex; align-items: center; gap: .45rem; min-height: 46px; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--col-line);
  background: #2B251F; font-weight: 700; }
.conn .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); flex: none; }
.conn[data-state="live"] .dot { background: var(--green-l); box-shadow: 0 0 0 4px rgba(71,167,100,.25); }
.conn[data-state="down"] { background: var(--red); border-color: var(--red); color: #fff; }
.conn[data-state="down"] .dot { background: #fff; }
.conn-time { font-weight: 500; color: var(--muted-d); font-size: .78rem; font-variant-numeric: tabular-nums; }
.conn[data-state="down"] .conn-time { color: #fff; opacity: .85; }
.pill { min-height: 46px; padding: .3rem 1rem; border-radius: 999px; border: 2px solid transparent; font-weight: 800; }
.pill-open { background: rgba(71,167,100,.16); border-color: var(--green-l); color: #9BE0AF; }
.pill-closed { background: #2B251F; border-color: var(--col-line); color: var(--muted-d); }
.pill-paused { background: var(--gold); color: var(--ink); border-color: var(--gold); animation: pulse-gold 2s ease-in-out infinite; }
@keyframes pulse-gold { 50% { box-shadow: 0 0 0 6px rgba(232,176,75,.35); } }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- banners ---------- */
.alarm-bar { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: .55rem 1rem; background: var(--red); color: #fff;
  font-weight: 900; font-size: 1.3rem; letter-spacing: .06em; animation: flash 1s steps(2) infinite; flex: none; }
@keyframes flash { 50% { background: var(--red-d); } }
.net-banner { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem 1rem; background: #B3180B; color: #fff; font-size: 1.05rem; flex: none; }
.net-banner b { font-size: 1.2rem; letter-spacing: .04em; }
.net-banner span { flex: 1; min-width: 14em; }
.demo-banner, .hint-banner { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .4rem 1rem; background: #3B3020; color: var(--gold-soft);
  font-size: .9rem; flex: none; }
.demo-banner span, .hint-banner { flex: 1; }
.hint-banner { background: #20303B; color: #D6ECFA; }

/* ---------- board ---------- */
.tabs { display: none; }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.col { display: flex; flex-direction: column; min-height: 0; background: var(--col); border-radius: 16px; border: 1px solid var(--col-line); overflow: hidden; }
.col h2 { display: flex; align-items: center; justify-content: space-between; padding: .6rem .9rem; font-size: 1.15rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; border-top: 6px solid var(--muted); }
.col-new h2 { border-top-color: var(--red); }
.col-accepted h2 { border-top-color: var(--gold); }
.col-ready h2 { border-top-color: var(--green-l); }
.count { display: inline-grid; place-items: center; min-width: 2em; height: 2em; padding: 0 .5em; border-radius: 999px; background: #3A322B; font-size: .95rem; }
.has-new .col-new { background: #3A1B16; border-color: var(--red); }
.has-new .col-new h2 .count { background: var(--red); color: #fff; }
.col-list { flex: 1; overflow-y: auto; padding: 0 10px 12px; display: grid; align-content: start; gap: 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.empty { text-align: center; color: var(--muted-d); padding: 2.5rem 1rem; margin: 0; font-size: 1.05rem; }

/* ---------- cards ---------- */
.card { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: .85rem .95rem .9rem; border-left: 10px solid var(--muted);
  box-shadow: 0 2px 0 rgba(0,0,0,.35); cursor: pointer; position: relative; }
.card-new { border-left-color: var(--red); animation: urgent 1.4s ease-in-out infinite; }
.card-new.is-late { animation-duration: .7s; }
@keyframes urgent { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(211,58,44,0), 0 2px 0 rgba(0,0,0,.35); background: var(--paper); }
  50% { box-shadow: inset 0 0 0 5px var(--red), 0 2px 0 rgba(0,0,0,.35); background: #FFF1EC; } }
.card-accepted { border-left-color: var(--gold); }
.card-ready { border-left-color: var(--green-l); }
.card.is-pending { opacity: .6; pointer-events: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.code { font-size: 1.75rem; font-weight: 900; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pickup { font-weight: 900; border-radius: 8px; padding: .2rem .6rem; font-size: 1.05rem; white-space: nowrap; }
.pickup.asap { background: var(--ink); color: var(--paper); }
.pickup.at { background: var(--gold); color: var(--ink); }
.timer { margin: .3rem 0 .25rem; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--ink2); }
.timer.t-new { color: var(--red-d); }
.timer.t-late { color: #fff; background: var(--red); border-radius: 6px; padding: .15rem .5rem; display: inline-block; }
.timer.t-soon { color: #9A5B00; }
.timer.t-ready { color: var(--green-d); }
.cust { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; font-size: 1.1rem; margin: .1rem 0 .35rem; }
.cust .phone { font-weight: 700; color: var(--green-d); text-decoration: none; border-bottom: 2px solid currentColor; padding: .25rem 0; font-variant-numeric: tabular-nums; }
.items { list-style: none; margin: 0; padding: .45rem 0 .35rem; border-top: 2px solid var(--crema2); display: grid; gap: .45rem; }
.items li { display: flex; gap: .55rem; align-items: baseline; }
.qty { font-weight: 900; font-size: 1.25rem; min-width: 2.1em; font-variant-numeric: tabular-nums; }
.iline { flex: 1; min-width: 0; }
.iname { font-weight: 700; font-size: 1.2rem; }
.ino { display: inline-block; min-width: 1.6em; margin-right: .35em; padding: 0 .3em; border-radius: 5px; background: var(--crema2); color: var(--ink2);
  font-size: .8em; text-align: center; font-weight: 700; }
.size { display: inline-block; font-weight: 800; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .45rem; border-radius: 6px;
  background: var(--ink); color: var(--paper); vertical-align: 2px; }
.opts { font-size: 1rem; color: var(--ink2); }
.inote, .onote { margin-top: .2rem; background: var(--note); color: #000; font-weight: 800; border-radius: 6px; padding: .2rem .5rem; display: inline-block; }
.inote::before { content: "! "; }
.onote { display: block; margin: .35rem 0; padding: .4rem .6rem; border: 2px dashed #8A6A00; }
.lprice { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-top: 2px solid var(--crema2); padding-top: .45rem; }
.paid { color: var(--green); font-weight: 800; }
.paid small { font-weight: 600; color: var(--muted); font-size: .85rem; }
.total { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.elapsed { font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.actions { margin-top: .65rem; display: grid; gap: .5rem; }
.actions .btn-ghost { color: var(--ink); min-height: 48px; }
.actions .sub { justify-content: space-between; }
.actions .sub .btn { flex: 1; }
.btn-cancel { color: var(--red-d) !important; }
.accept-label { font-weight: 800; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink2); }
.accept-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: .4rem; }
.btn-accept { flex-direction: column; gap: 0; min-height: 64px; padding: .35rem .2rem; background: var(--green); color: #fff; font-size: 1.45rem; font-weight: 900;
  box-shadow: 0 4px 0 var(--green-d); }
.btn-accept small { font-size: .7rem; font-weight: 700; opacity: .9; }
.btn-accept.is-default { background: var(--green-d); outline: 4px solid var(--gold); outline-offset: -4px; }
.btn-accept.sched { flex-direction: row; font-size: 1.1rem; min-height: 56px; background: var(--ink); box-shadow: 0 4px 0 #000; }
.accept-row.big .btn-accept { min-height: 76px; font-size: 1.7rem; }

/* ---------- dialogs ---------- */
dialog.sheet { color-scheme: light; width: min(96vw, 860px); max-height: 94dvh; padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 90px rgba(0,0,0,.6); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet > form { display: flex; flex-direction: column; min-height: 0; }
dialog::backdrop { background: rgba(10,8,6,.72); }
.sheet-sm { width: min(96vw, 560px) !important; }
.sheet-wide { width: min(97vw, 1180px) !important; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 2px solid var(--crema2); flex: none; }
.sheet-head h2 { font-size: 1.5rem; font-weight: 900; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sheet-head .btn-ghost { color: var(--ink); min-height: 46px; white-space: nowrap; flex: none; }
.sheet-body { padding: 1rem 1.1rem 1.3rem; overflow-y: auto; min-height: 0; }
.sheet .muted { color: var(--muted); }
.sheet .input { background: #fff; color: var(--ink); border-color: var(--crema2); }
.status-chip { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: .25rem .6rem; border-radius: 999px; background: var(--crema2); color: var(--ink); white-space: nowrap; }
.s-new { background: var(--red); color: #fff; }
.s-accepted { background: var(--gold); }
.s-ready { background: var(--green-l); color: #062; }
.s-collected { background: var(--green-soft); color: var(--green-d); }
.s-cancelled { background: var(--red-soft); color: var(--red-d); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.3rem; }
.detail-grid .actions { margin-top: 1rem; }
.detail-block { display: grid; gap: .45rem; justify-items: start; margin-bottom: .6rem; }
.pickup-big { font-size: 1.25rem; font-weight: 900; background: var(--ink); color: var(--paper); padding: .35rem .7rem; border-radius: 8px; }
.cust.big { font-size: 1.4rem; }
.total-row { display: flex; justify-content: space-between; font-size: 1.4rem; border-top: 2px solid var(--ink); padding-top: .5rem; margin-top: .4rem; }
.paid.big { font-size: 1.15rem; margin-top: .3rem; }
.cancel-info { margin-top: .8rem; background: var(--red-soft); color: var(--red-d); padding: .6rem .8rem; border-radius: 10px; }
.times { width: 100%; border-collapse: collapse; margin-bottom: .8rem; font-size: 1.05rem; }
.times th { text-align: left; font-weight: 600; color: var(--muted); padding: .3rem 0; }
.times td { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.times tr + tr { border-top: 1px solid var(--crema2); }

.reasons { display: grid; gap: .4rem; margin: .6rem 0 1rem; }
.radio { display: flex; align-items: center; gap: .7rem; min-height: 52px; padding: .3rem .8rem; border-radius: 10px; border: 2px solid var(--crema2); font-weight: 600; font-size: 1.05rem; }
.radio:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.radio input { width: 24px; height: 24px; accent-color: var(--red); }
.refund-fail { display: grid; gap: .3rem; background: var(--red); color: #fff; border-radius: 12px; padding: .8rem 1rem; margin-bottom: .8rem;
  font-size: 1.02rem; box-shadow: 0 0 0 4px var(--red-soft); }
.refund-fail b { font-size: 1.15rem; }
.refund-note { display: grid; gap: .2rem; background: var(--gold-soft); border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; }

/* controls */
.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; }
.panel h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.1rem 0 .5rem; }
.panel h3:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips .btn-ghost { color: var(--ink); }
.pause-state .state { padding: .8rem 1rem; border-radius: 12px; font-weight: 900; font-size: 1.25rem; margin-bottom: .6rem; }
.pause-state small { font-weight: 600; font-size: .9rem; }
.state-open { background: var(--green-soft); color: var(--green-d); }
.state-paused { background: var(--gold); color: var(--ink); }
#resume-btn { margin-top: .6rem; }
.range { accent-color: var(--green); height: 40px; }
.soldout-list { margin-top: .6rem; display: grid; gap: .3rem; max-height: 62dvh; overflow-y: auto; padding-right: .2rem; }
.so-head { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .7rem 0 .1rem; }
.so-head.out { color: var(--red-d); }
.so-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; min-height: 52px; padding: .3rem .8rem; border-radius: 10px;
  border: 2px solid var(--crema2); background: #fff; color: var(--ink); text-align: left; font-weight: 600; font-size: 1.02rem; }
.so-state { font-size: .8rem; font-weight: 800; text-transform: uppercase; padding: .3rem .6rem; border-radius: 999px; background: var(--green-soft); color: var(--green-d); white-space: nowrap; }
.so-row.is-out { border-color: var(--red); background: var(--red-soft); }
.so-row.is-out .so-state { background: var(--red); color: #fff; }

/* summary */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.stat { background: var(--crema); border-radius: 12px; padding: .8rem .9rem; display: grid; gap: .15rem; }
.stat span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat b { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.stat-muted b { color: var(--red-d); }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.4rem; }
.summary-grid h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.top { margin: 0; padding: 0; list-style: none; counter-reset: t; display: grid; gap: .3rem; }
.top li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .6rem; border-radius: 8px; background: var(--crema); font-weight: 600; }
.top li::before { counter-increment: t; content: counter(t) "."; color: var(--muted); margin-right: .4rem; }
.top li span { flex: 1; }
.history { display: grid; gap: .35rem; }
.hrow { display: grid; grid-template-columns: 3.4em 4.6em minmax(0, 1fr) auto 5.5em; gap: .6rem; align-items: center; min-height: 56px; padding: .35rem .7rem;
  border: 2px solid var(--crema2); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; }
.htime, .htotal { font-variant-numeric: tabular-nums; font-weight: 700; }
.htotal { text-align: right; }
.hcode { font-weight: 900; }
.hname { font-weight: 600; overflow: hidden; }
.hname small { display: block; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* toast */
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; max-width: min(92vw, 640px);
  padding: .9rem 1.2rem; border-radius: 12px; font-weight: 700; font-size: 1.05rem; box-shadow: 0 12px 40px rgba(0,0,0,.5); background: var(--ink); color: var(--paper); border: 2px solid var(--col-line); }
.toast.t-ok { background: var(--green-d); border-color: var(--green-l); }
.toast.t-error { background: var(--red); border-color: #fff; }
.toast.t-warn { background: var(--gold); color: var(--ink); }

.print-root { display: none; }

/* ---------- phone / narrow ---------- */
@media (max-width: 860px) {
  html { font-size: 16px; }
  .topbar { flex-wrap: wrap; gap: .45rem; padding: 8px 10px; }
  .brand div:last-child { display: none; }
  .clock { font-size: 1.3rem; order: 2; }
  .spacer { display: none; }
  .conn { order: 1; flex: 1; justify-content: flex-start; min-height: 42px; padding: .2rem .7rem; }
  .conn-time { margin-left: auto; }
  .conn-time .lbl { display: none; }
  .pill { order: 3; flex: 1 0 auto; min-width: 50%; min-height: 42px; padding: .2rem .6rem; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #btn-summary, #btn-controls { order: 4; min-height: 42px; padding: .3rem .7rem; }
  #btn-controls { order: 5; }
  .demo-banner { font-size: .8rem; padding: .3rem 10px; }
  .demo-banner .btn { min-height: 36px; font-size: .82rem; }
  .alarm-bar { font-size: 1.05rem; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 10px 0; flex: none; }
  .tab { min-height: 54px; border: 2px solid var(--col-line); border-radius: 12px; background: var(--col); font-weight: 800; display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .95rem; }
  .tab .count { height: 1.8em; min-width: 1.8em; }
  .tab.is-on { background: var(--paper); color: var(--ink); border-color: var(--paper); }
  .tab.is-on .count { background: var(--ink); color: var(--paper); }
  .has-new .tab-new .count { background: var(--red); color: #fff; animation: blink 1s steps(2) infinite; }
  .board { grid-template-columns: 1fr; padding: 8px 10px; }
  .col { display: none; background: transparent; border: 0; }
  .board[data-active="new"] .col-new, .board[data-active="accepted"] .col-accepted, .board[data-active="ready"] .col-ready { display: flex; }
  .has-new .col-new { background: transparent; }
  .col h2 { display: none; }
  .col-list { padding: 4px 0 16px; }
  .code { font-size: 1.5rem; }
  .detail-grid, .controls, .summary-grid { grid-template-columns: 1fr; }
  .sheet-head h2 { font-size: 1.2rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 1.35rem; }
  .hrow { grid-template-columns: 3em minmax(0, 1fr) auto; }
  .hrow .hcode, .hrow .status-chip { display: none; }
  dialog.sheet { width: 100vw !important; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .soldout-list { max-height: none; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .accept-row { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .shift-icon { animation: none; }
  .card-new { animation-duration: 2.4s; }
}

/* ---------- print: 80 mm kitchen ticket ---------- */
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  html, body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  body > *:not(#print-root) { display: none !important; }
  .print-root { display: block !important; }
  .ticket { width: 72mm; font: 11pt/1.3 "Courier New", ui-monospace, monospace; color: #000; }
  .ticket hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
  .tk-c { text-align: center; }
  .tk-code { text-align: center; font-size: 26pt; font-weight: 900; line-height: 1.1; margin: 1mm 0; }
  .tk-pickup { text-align: center; font-size: 15pt; font-weight: 900; border: 2px solid #000; padding: 1mm; margin: 1mm 0; }
  .tk-item { margin-bottom: 2mm; }
  .tk-line { font-size: 13pt; }
  .tk-size { border: 1px solid #000; padding: 0 1mm; font-weight: 700; }
  .tk-opt { padding-left: 6mm; }
  .tk-note { padding-left: 2mm; font-weight: 900; text-transform: uppercase; }
  .tk-total { display: flex; justify-content: space-between; font-size: 14pt; font-weight: 900; }
  .tk-small { font-size: 9pt; margin-top: 1mm; }
}

/* ilmoitusäänen mykistys */
.btn-mute{white-space:nowrap}
.btn-mute.is-muted{background:#D33A2C;color:#fff;border-color:#D33A2C}
.mute-row{margin:.2rem 0 .8rem;font-weight:600;cursor:pointer}
.mute-row input{width:1.4rem;height:1.4rem;accent-color:#D33A2C}
.alarm-bar .muted-tag{margin-left:.8em;padding:.15em .6em;border-radius:99px;background:rgba(0,0,0,.35);font-size:.75em}

/* ---------- scheduled pickups waiting for their start time (Ajastetut) ---------- */
.sched-wrap { flex: none; max-height: 42%; display: flex; flex-direction: column; border-top: 2px dashed var(--col-line); margin-top: 6px; }
.sched-wrap h3 { margin: .7rem 14px .1rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: .5rem; }
.sched-wrap .count { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 0 .5rem; font-size: .75rem; }
.sched-hint { margin: 0 14px .5rem; font-size: .78rem; color: var(--muted-d); }
.sched-wrap .col-list { padding-top: 2px; }
.card-sched { border-left-color: var(--gold); opacity: .92; }
.card-sched .accept-label { color: var(--muted); }
.timer.t-sched { color: #8A5A00; background: var(--gold-soft); border-radius: 6px; padding: .15rem .5rem; display: inline-block; }
@media (max-width: 760px) { .sched-wrap { max-height: none; } }
