/* Kitchen display + order status — The Wandering Chile. Big type, high contrast, built for a busy pass. */
:root {
  --red: #b83a2d;
  --red-dark: #962e23;
  --cream: #fff2dc;
  --cream-2: #fbe7c4;
  --green: #496b45;
  --gold: #e9aa38;
  --char: #292620;
  --char-2: #3a362e;
  --muted: #6b6457;
  --line: #e6d3b1;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 16px/1.5 var(--sans); color: var(--char); background: var(--cream); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- kitchen ---------- */
.k-body { background: #f3e2c2; min-height: 100vh; }
.k-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: 10px 16px; background: var(--char); color: var(--cream); }
.k-badge { border-radius: 50%; }
.k-brand { font: 700 1.25rem/1 var(--serif); }
.k-title { font-weight: 700; color: #f2dcb7; display: inline-flex; align-items: center; gap: .5rem; }
.k-demo { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; background: var(--gold); color: var(--char); padding: .3rem .5rem; border-radius: 4px; }
.k-bar-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.k-live { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: #c9e3a8; font-size: .9375rem; }
.k-live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #8fc35f; }
.k-live.is-off { color: #f6c27a; }
.k-live.is-off::before { background: #e0a050; }
.k-select { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .9375rem; color: #f2dcb7; }
.k-select select { min-height: 44px; border-radius: 8px; border: 1px solid #6b6457; background: var(--char-2); color: var(--cream); padding: 0 .5rem; }
.k-btn { min-height: 44px; padding: 0 1rem; border-radius: 10px; border: 2px solid var(--char); background: #fff; color: var(--char); font-weight: 700; font-size: .9375rem; cursor: pointer; }
.k-btn[disabled] { opacity: .5; cursor: progress; }
.k-bar .k-btn { background: transparent; color: var(--cream); border-color: #6b6457; }
.k-bar .k-btn[aria-pressed="true"] { background: var(--cream); color: var(--char); }
.k-bar .k-toggle.is-paused { background: var(--gold); color: var(--char); border-color: var(--gold); }
.k-btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.k-btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.k-btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.k-btn-dark { background: var(--char); border-color: var(--char); color: var(--cream); }
.k-btn-ghost { background: transparent; border-color: #c9b48f; color: var(--muted); }
.k-btn-block { width: 100%; }
.k-btn-quote { min-width: 56px; padding: 0 .7rem; }

.k-gate { max-width: 380px; margin: 6vh auto; background: var(--cream); border: 3px solid var(--char); border-radius: 18px; padding: 28px; text-align: center; box-shadow: 6px 6px 0 var(--char); }
.k-gate h1 { font: 700 2rem/1.1 var(--serif); margin: .5rem 0; }
.k-gate label { display: block; text-align: left; font-weight: 700; margin: 1rem 0 .4rem; }
.k-gate input { width: 100%; min-height: 54px; border: 2px solid var(--char); border-radius: 10px; font-size: 1.5rem; letter-spacing: .4em; text-align: center; background: #fff; }
.k-gate .k-btn { margin-top: 1rem; }
.k-error { color: var(--red-dark); font-weight: 700; margin: .5rem 0 0; min-height: 1em; }
.k-fine { font-size: .875rem; color: var(--muted); }

.k-app { max-width: 1600px; margin: 0 auto; padding: 14px 16px 40px; }
.k-today { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 12px; }
.k-today div { background: var(--cream); border: 2px solid var(--char); border-radius: 12px; padding: 8px 12px; }
.k-today dt { font-size: .875rem; color: var(--muted); font-weight: 700; }
.k-today dd { margin: 0; font: 700 1.6rem/1.1 var(--serif); }
@media (min-width: 760px) { .k-today { grid-template-columns: repeat(4, 1fr); } }
.k-paused { background: var(--gold); color: var(--char); border: 2px solid var(--char); border-radius: 12px; padding: 10px 14px; font-weight: 700; margin-bottom: 12px; }

.k-board { display: grid; gap: 12px; }
@media (min-width: 900px) { .k-board { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.k-col { background: rgba(255, 242, 220, .6); border-radius: 14px; padding: 10px; min-height: 160px; }
.k-col h2 { font: 700 1.3rem/1.2 var(--serif); margin: 2px 4px 10px; display: flex; align-items: center; gap: .5rem; }
.k-col h2 .n { font: 700 .9375rem/1 var(--sans); min-width: 1.8em; padding: .3rem .45rem; border-radius: 999px; text-align: center; color: #fff; background: var(--char); }
.k-col-new h2 .n { background: var(--red); }
.k-col-cooking h2 .n { background: var(--gold); color: var(--char); }
.k-col-ready h2 .n { background: var(--green); }
.k-tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.k-empty { padding: 18px 8px; color: var(--muted); font-weight: 500; }
.k-ticket { background: #fff; border: 2px solid var(--char); border-radius: 14px; padding: 12px 14px; box-shadow: 4px 4px 0 var(--char); border-top-width: 8px; }
.k-ticket-new { border-top-color: var(--red); }
.k-ticket-cooking { border-top-color: var(--gold); }
.k-ticket-ready { border-top-color: var(--green); }
.k-ticket.is-late { box-shadow: 4px 4px 0 var(--red); background: #fff6f3; }
@media (prefers-reduced-motion: no-preference) { .k-ticket-new { animation: k-in .5s ease-out; } @keyframes k-in { from { transform: translateY(-6px); opacity: 0; } } }
.k-t-head { display: flex; align-items: baseline; gap: .6rem; }
.k-t-num { font: 700 1.7rem/1 var(--serif); }
.k-t-name { font-size: 1.25rem; font-weight: 700; }
.k-t-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.k-tag { font-size: .8125rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; background: var(--cream-2); }
.k-tag-gold { background: var(--gold); }
.k-t-when { margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .4rem; font-weight: 700; }
.k-due { color: var(--char); }
.k-in { color: var(--green); }
.k-late { color: #fff; background: var(--red); padding: 0 .4rem; border-radius: 6px; }
.k-placed { color: var(--muted); font-weight: 500; }
.k-items { list-style: none; margin: 0; padding: .5rem 0 0; border-top: 2px dashed var(--line); }
.k-items > li { display: grid; grid-template-columns: 2.6rem 1fr; padding: .3rem 0; }
.k-qty { font: 700 1.25rem/1.2 var(--serif); color: var(--red); }
.k-item { font-size: 1.125rem; font-weight: 700; }
.k-mods { grid-column: 2; list-style: none; margin: .1rem 0 0; padding: 0; color: var(--char-2); font-size: .9375rem; }
.k-mods li::before { content: "– "; color: var(--muted); }
.k-note { margin: .5rem 0 0; padding: .4rem .6rem; background: var(--cream-2); border-radius: 8px; font-weight: 700; }
.k-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: .75rem; }
.k-accept-label { font-weight: 700; font-size: .875rem; color: var(--muted); width: 100%; }
.k-done { margin-top: 14px; background: var(--cream); border: 2px solid var(--char); border-radius: 12px; padding: 0 14px; }
.k-done summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.k-done .n { background: var(--char); color: var(--cream); border-radius: 999px; padding: .15rem .5rem; font-size: .8125rem; }
.k-done-list { margin: 0 0 12px; padding-left: 1.2rem; }
.k-done-list li { padding: .2rem 0; }
.k-done-list .is-cancelled { color: var(--muted); text-decoration: line-through; }
.k-try { margin-top: 14px; background: var(--red); color: #fff; border-radius: 12px; padding: 12px 16px; }
.k-try p { margin: 0; }
.k-mono { font-family: ui-monospace, Consolas, monospace; background: rgba(255, 255, 255, .18); padding: .1rem .35rem; border-radius: 4px; overflow-wrap: anywhere; }
.k-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 32px)); }
.k-toast { background: var(--char); color: var(--cream); padding: 14px 16px; border-radius: 12px; border-left: 6px solid var(--gold); font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: opacity .5s, transform .5s; }
.k-toast.is-new { border-left-color: var(--red); }
.k-toast.is-bad { border-left-color: #e0a050; }
.k-toast.out { opacity: 0; transform: translateY(8px); }
@media (max-width: 640px) { .k-brand { display: none; } .k-bar-right { width: 100%; } }

/* ---------- order status ---------- */
.o-bar { background: var(--red); padding: 10px 16px; }
.o-home { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font: 700 1.2rem/1 var(--serif); }
.o-home img { border-radius: 50%; background: var(--cream); }
.o-main { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.o-loading { font-weight: 700; padding: 8px 0; }
.o-card { background: #fff; border: 3px solid var(--char); border-radius: 18px; padding: 22px; box-shadow: 6px 6px 0 var(--char); }
.o-num { margin: 0; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.o-card h1 { font: 700 2.2rem/1.1 var(--serif); margin: .3rem 0 .4rem; }
.o-line { font-size: 1.125rem; margin: 0 0 .5rem; }
.o-eta { display: inline-block; background: var(--gold); padding: .3rem .7rem; border-radius: 8px; font-weight: 700; margin: 0 0 1rem; }
.o-steps { list-style: none; padding: 0; margin: .5rem 0 1.25rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.o-steps li { counter-increment: s; text-align: center; font-size: .875rem; font-weight: 700; color: var(--muted); padding-top: 34px; position: relative; }
.o-steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c9b48f; display: grid; place-items: center; background: #fff; }
.o-steps li.is-done { color: var(--green); }
.o-steps li.is-done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.o-steps li.is-now { color: var(--char); }
.o-steps li.is-now::before { background: var(--red); border-color: var(--red); color: #fff; }
.o-items { list-style: none; padding: 0; margin: 0; border-top: 2px dashed var(--line); }
.o-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.o-total { margin: .75rem 0 0; font-weight: 700; }
.o-fine { font-size: .875rem; color: var(--muted); margin-top: 1rem; }

/* v5: undo, recall, 86 list, escalation, totals */
.k-overdue[hidden], .k-86[hidden] { display: none; }
.k-overdue { background: var(--red); color: #fff; border: 2px solid var(--char); border-radius: 12px; padding: 10px 14px; font-weight: 800; margin-bottom: 12px; }
.k-ticket.is-overdue { border-color: var(--red); box-shadow: 0 0 0 3px var(--red); }
@media (prefers-reduced-motion: no-preference) { .k-ticket.is-overdue { animation: k-pulse 1.4s ease-in-out infinite; } @keyframes k-pulse { 50% { box-shadow: 0 0 0 7px rgba(200, 50, 40, .35); } } }
.k-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-toast-undo { min-height: 40px; min-width: 64px; border: 0; border-radius: 8px; background: var(--cream, #fff6e6); color: var(--char); font-weight: 800; cursor: pointer; flex: none; }
.k-done-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.k-btn-small { min-height: 40px; padding: 0 .8rem; font-size: .875rem; }
.k-86 { background: var(--cream-2); border: 2px solid var(--char); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.k-86 h2 { margin: 0 0 8px; font-size: 1.125rem; }
.k-86 h2 small { font-weight: 500; font-size: .875rem; }
.k-86-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.k-86-group h3 { margin: 0 0 6px; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; }
.k-86-item { display: block; width: 100%; min-height: 44px; margin: 0 0 6px; padding: 0 .75rem; text-align: left; border: 2px solid var(--char); border-radius: 8px; background: #fff; font-weight: 700; cursor: pointer; }
.k-86-item.is-out { background: var(--char); color: #fff; text-decoration: line-through; }
.k-phone, .k-total { margin: 6px 0 0; font-size: .875rem; font-weight: 700; }
.k-total { color: #555; font-weight: 600; }
.k-gate small { font-weight: 500; }
