:root {
  --bg: #f3efe6;
  --surface: #fffdf8;
  --ink: #28251f;
  --muted: #7a7165;
  --line: #d9d1c3;
  --accent: #c9462a;
  --paper: #fffef9;
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans Thai", system-ui, sans-serif;
  font-family: var(--body);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; }
button, input { font: inherit; }
button, .file { -webkit-tap-highlight-color: transparent; }
button:focus-visible, .file:focus-within, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* A very confident poster for a very unqualified chef. */
.welcome { min-height: 100svh; padding: 22px 36px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.welcome-top, .welcome-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.welcome-top { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.welcome-bottom { border-top: 1px solid var(--line); padding-top: 14px; }
.welcome-content { text-align: center; padding: 24px 0 22px; }
.eyebrow { font-size: 12px; letter-spacing: .1em; margin: 0 0 18px; }
.welcome h1 { font-family: var(--display); font-weight: 900; font-style: italic; font-size: clamp(64px, 10.5vw, 150px); line-height: .95; letter-spacing: -.075em; margin: 0 0 30px; }
.welcome h1 span, .brand span { color: var(--accent); }
.welcome-stage { position: relative; max-width: 1020px; margin: 0 auto; }
.welcome-chef { display: block; width: min(62vw, 620px); height: auto; margin: auto; transform: rotate(-2deg); animation: chef-enter .65s cubic-bezier(.2,.7,.2,1) both; }
.chef-credit { position: absolute; top: 28%; left: 3%; text-align: left; font-size: 15px; line-height: 1.3; transform: rotate(-9deg); }
.chef-credit strong { font: italic 900 40px var(--display); letter-spacing: -.07em; }
.chef-credit > span { display: block; font-size: 58px; margin: -10px 0 0 50px; }
.welcome-stamp { position: absolute; right: 4%; top: 12%; display: grid; align-content: center; width: 128px; height: 128px; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 11px; transform: rotate(12deg); background: var(--bg); }
.welcome-stamp strong { font-size: 24px; line-height: 1.6; }
.welcome-line { font-size: 17px; font-weight: 600; margin: 30px 0 15px; }
.primary { background: var(--accent); color: #fffdf8; border: 1px solid var(--accent); }
.enter-button { display: inline-flex; align-items: center; justify-content: center; gap: 44px; padding: 12px 26px; border-radius: 3px; font-weight: 600; font-size: 16px; transition: transform .2s, background .2s; }
.enter-button > span { font-size: 24px; line-height: 1; }
.enter-button:hover { background: #ad3821; transform: translateY(-3px) rotate(-1deg); }
.welcome-small { font-size: 11px; color: var(--muted); margin: 12px 0 0; }
.welcome.leaving { animation: leave .24s ease-in forwards; pointer-events: none; }
.welcome.returning { animation: arrive .35s ease-out both; }

.wrap { max-width: 1220px; margin: 0 auto; padding: 32px 28px 24px; }
.wrap.arriving { animation: arrive .4s ease-out both; }
.kitchen-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.brand { font-family: var(--display); font-size: clamp(32px, 4.5vw, 50px); font-weight: 900; font-style: italic; line-height: 1.15; letter-spacing: -.075em; padding: 0; border: 0; background: none; color: var(--ink); }
.tag { color: var(--ink); font-size: 13px; margin: 8px 0 0; }
.tag > span { color: var(--muted); margin-left: 8px; }
.stamp { border: 1px solid var(--accent); padding: 8px 14px; font-size: 9px; color: var(--accent); text-align: center; letter-spacing: .08em; transform: rotate(4deg); flex-shrink: 0; }
.stamp strong { font-size: 12px; letter-spacing: 0; }
.main { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 32px; align-items: start; }
.plate { min-width: 0; }
.plate-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.plate-heading > span:first-child { color: var(--ink); display: flex; gap: 7px; align-items: center; }
.status-dot { width: 6px; height: 6px; display: inline-block; background: var(--accent); border-radius: 50%; }
.drop { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.drop.over { border-color: var(--accent); box-shadow: 0 0 0 4px #c9462a22; }
.drop canvas { display: block; width: 100%; height: auto; }
.hint { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); font-size: 11px; background: #fffdf8eb; color: var(--ink); padding: 4px 10px; pointer-events: none; }
.drop-invitation { display: none; position: absolute; inset: 0; place-items: center; font-size: 18px; font-weight: 600; color: var(--accent); background: #fffdf8dc; pointer-events: none; }
.drop.over .drop-invitation { display: grid; }
.controls { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; margin-top: 24px; }
.ctl { min-width: 0; }
.ctl label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.ctl output { font-size: 15px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
input[type=range] { appearance: none; display: block; width: 100%; background: transparent; height: 32px; margin: 4px 0 0; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--line); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { appearance: none; height: 16px; width: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); outline: 1px solid var(--accent); margin-top: -6.5px; transition: transform .15s; }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]::-moz-range-track { height: 3px; background: var(--line); }
input[type=range]::-moz-range-thumb { height: 10px; width: 10px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); outline: 1px solid var(--accent); }
.range-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted); }
.preprocess { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; font-size: 10px; color: var(--muted); }
.preprocess progress { appearance: none; width: 100px; height: 3px; border: 0; background: var(--line); accent-color: var(--accent); }
.preprocess progress::-webkit-progress-bar { background: var(--line); }
.preprocess progress::-webkit-progress-value { background: var(--accent); }
.preprocess progress::-moz-progress-bar { background: var(--accent); }
.toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12px; margin: 20px 0; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.toggle > span { color: var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns button, .file { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 3px; padding: 10px 14px; min-height: 44px; font: 500 12px var(--body); border: 1px solid var(--line); background: transparent; color: var(--ink); transition: background .18s, transform .18s; }
.file { cursor: pointer; }
.btns .primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btns button:hover, .file:hover { background: #e6dfd2; transform: translateY(-2px); }
.btns .primary:hover { background: #ad3821; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.save-button > span { font-size: 18px; line-height: 1; }
.btns .handoff-button { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btns .handoff-button:hover:not(:disabled) { background: #f8e9dd; }
.handoff-button > span { font-size: 18px; line-height: 1; }
.btns button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.flash { color: var(--accent); min-height: 1.6em; font-size: 12px; margin-top: 10px; }
.chef-comment { display: flex; align-items: center; gap: 18px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.chef-comment img { width: 106px; height: 106px; object-fit: contain; transform: rotate(-4deg); }
.chef-comment p { margin: 0; font-size: 12px; }
.chef-comment strong { display: block; font-weight: 500; }
.chef-comment p > span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.side { display: grid; gap: 14px; }
.receipt { background: var(--paper); color: #28251f; font-size: 11px; padding: 24px 20px 30px; box-shadow: 0 5px 14px #28251f0b; transform: rotate(1deg); -webkit-mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0/12px 100% repeat-x; mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0/12px 100% repeat-x; }
.receipt h2 { font: italic 900 25px var(--display); letter-spacing: -.06em; text-align: center; margin: 0 0 5px; }
.receipt .sub { text-align: center; font-size: 9px; color: #7a7165; }
.receipt .receipt-label { text-align: center; font-size: 10px; letter-spacing: .13em; margin: 12px 0; }
.receipt hr { border: 0; border-top: 1px dashed #b9ad99; margin: 12px 0; }
.row { display: grid; grid-template-columns: 1.6em minmax(0,1fr) auto; gap: 5px; font-variant-numeric: tabular-nums; margin: 5px 0; }
.row .q { color: #7a7165; font-size: 10px; }
.tot { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 5px 0; }
.receipt .useless { color: var(--accent); margin-top: 10px; }
.foot { text-align: center; font-size: 10px; color: #7a7165; margin-top: 16px; }
.receipt-wait { text-align: center; color: var(--muted); }
.barcode { height: 22px; width: 120px; margin: 18px auto 0; background: repeating-linear-gradient(90deg, #28251f 0 2px, transparent 2px 4px, #28251f 4px 5px, transparent 5px 8px, #28251f 8px 12px, transparent 12px 14px); }
.note { font-size: 10px; color: var(--muted); margin: 0 6px; }
.rat-review { margin: 14px 0 0 18px; display: flex; align-items: center; gap: 15px; }
.rat-review img { width: 92px; height: 126px; object-fit: cover; transform: rotate(-7deg); transition: transform .25s; }
.rat-review:hover img { transform: rotate(0) translateY(-3px); }
.rat-review figcaption { font-size: 11px; }
.rat-review figcaption > span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.kitchen-footer { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.footer-aside { margin-left: 8px; }
.meme-credit { text-align: right; }
.meme-credit summary { cursor: pointer; }
.meme-credit p { margin: 8px 0 0; }

@keyframes chef-enter { from { opacity: 0; transform: translateY(20px) rotate(1deg); } to { opacity: 1; transform: translateY(0) rotate(-2deg); } }
@keyframes leave { to { opacity: 0; transform: translateY(-12px); } }
@keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 821px) { .side { position: sticky; top: 24px; } }
@media (min-width: 821px) and (max-height: 780px) {
  .welcome-content { padding: 12px 0; }
  .welcome h1 { font-size: 110px; margin-bottom: 20px; }
  .eyebrow { margin-bottom: 10px; }
  .welcome-chef { width: min(52vw, 500px); }
  .welcome-line { margin-top: 24px; }
}
@media (max-width: 820px) {
  .welcome { padding: 18px 24px; }
  .welcome-chef { width: 76vw; }
  .chef-credit { left: 0; top: 35%; z-index: 1; font-size: 11px; }
  .chef-credit strong { font-size: 30px; }
  .chef-credit > span { font-size: 40px; margin-left: 18px; }
  .welcome-stamp { right: 0; top: -12px; width: 100px; height: 100px; font-size: 9px; }
  .welcome-stamp strong { font-size: 20px; }
  .wrap { padding: 24px; }
  .main { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .receipt { grid-row: span 2; }
  .rat-review { margin: 0; }
}
@media (max-width: 520px) {
  .welcome { padding: 18px 18px; }
  .welcome-top, .welcome-bottom { font-size: 9px; letter-spacing: .02em; }
  .welcome-top > span:last-child { font-size: 8px; }
  .welcome-content { padding: 34px 0; }
  .eyebrow { font-size: 10px; margin-bottom: 20px; }
  .welcome h1 { font-size: clamp(48px, 12.6vw, 66px); margin-bottom: 40px; }
  .welcome-chef { width: 100%; }
  .chef-credit { display: none; }
  .welcome-stamp { right: -3px; top: -28px; width: 78px; height: 78px; font-size: 7px; }
  .welcome-stamp strong { font-size: 16px; }
  .welcome-line { font-size: 14px; margin-top: 44px; }
  .enter-button { font-size: 14px; padding: 12px 24px; }
  .welcome-small { font-size: 9px; }
  .wrap { padding: 20px 16px; }
  .kitchen-header { align-items: start; gap: 12px; margin-bottom: 20px; padding-bottom: 20px; }
  .brand { font-size: 33px; }
  .tag { font-size: 11px; }
  .tag > span { display: block; margin: 2px 0 0; }
  .stamp { font-size: 7px; padding: 6px 7px; margin-top: 5px; }
  .stamp strong { font-size: 9px; }
  .controls { grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
  .hint { font-size: 9px; left: 8px; bottom: 8px; }
  .btns { display: grid; grid-template-columns: 1fr 1fr; }
  .btns button, .file { font-size: 11px; padding: 10px 8px; }
  .btns .handoff-button { grid-column: 1 / -1; }
  .side { grid-template-columns: 1fr; gap: 16px; }
  .receipt { max-width: 320px; width: 100%; margin: auto; }
  .note { max-width: 320px; margin: auto; }
  .rat-review { justify-content: center; margin-top: 10px; }
  .kitchen-footer { font-size: 9px; }
  .footer-aside { display: block; margin-left: 0; }
}
@media (max-width: 520px) and (max-height: 680px) {
  .welcome-content { padding: 18px 0; }
  .welcome h1 { margin-bottom: 30px; }
  .welcome-line { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
