@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --bg: #f2f3f1;
  --surface: #ffffff;
  --surface-2: #e8eae6;
  --ink: #141a17;
  --muted: #5b655f;
  --line: #d6dad5;
  --accent: #e2532c;
  --accent-deep: #c4431f;
  --on-accent: #fff8f3;
  --ok: #2f6b4f;
  --shadow: 0 10px 30px rgb(20 26 23 / 0.08);
  --radius: 18px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar: 160px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1b211e;
    --surface-2: #242b27;
    --ink: #eef0ec;
    --muted: #a3ada7;
    --line: #2f3733;
    --accent: #ee6a45;
    --accent-deep: #d95833;
    --on-accent: #1a0d08;
    --ok: #7fc9a4;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
input { font: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

#app { min-height: 100dvh; }
.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + var(--sat)) 16px calc(24px + var(--sab));
}
.screen.has-bar { padding-bottom: calc(var(--bar) + 24px + var(--sab)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-deep); }
.btn-block { width: 100%; }
.btn-lg { min-height: 68px; font-size: 20px; }
.btn-text {
  background: none;
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 16px;
}
.btn-text:active { color: var(--ink); }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 18px;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 9px; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; }
.brand .mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--on-accent); }

/* ---------- home ---------- */
.hero-title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.hero-sub { color: var(--muted); font-size: 17px; margin-top: 8px; max-width: 34ch; }
.section-title { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 28px 0 12px; }
.tiles { display: grid; gap: 12px; }
.tile {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.tile:active { transform: scale(0.99); }
.tile img { width: 96px; height: 96px; object-fit: cover; object-position: center 30%; border-radius: 12px; background: var(--surface-2); }
.tile .t { font-weight: 700; font-size: 18px; line-height: 1.2; }
.tile .s { color: var(--muted); font-size: 15px; margin-top: 2px; }
.tile .m { color: var(--muted); font-size: 14px; margin-top: 8px; }
.empty {
  padding: 28px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
}
.empty b { color: var(--ink); }
.note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

/* ---------- pin ---------- */
.pin-wrap { min-height: calc(100dvh - 80px); display: grid; place-content: center; text-align: center; gap: 18px; }
.pin-input {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
}
.pin-input:focus { outline: none; border-color: var(--accent); }
.err { color: var(--accent); font-weight: 600; min-height: 1.4em; }

/* ---------- scan ---------- */
.slots { display: grid; gap: 12px; margin: 18px 0; }
.slot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
}
.slot.filled { border-style: solid; border-color: var(--ok); color: var(--ok); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.slot .lab { position: relative; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.slot input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.progress { text-align: center; padding: 40px 0; }
.progress .big { font-size: 24px; font-weight: 700; margin-top: 18px; }
.progress .small { color: var(--muted); margin-top: 6px; }
.spinner {
  width: 64px; height: 64px; margin: 0 auto;
  border-radius: 50%;
  border: 6px solid var(--surface-2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- review ---------- */
.hero { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.hero img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 25%; }
.hero .body { padding: 16px 18px 18px; }
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hero .sub { color: var(--muted); margin-top: 4px; font-size: 16px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fact { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.fact.warn { background: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 15px; font-weight: 600; }
details.ing { margin-top: 12px; }
details.ing summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; }
details.ing summary::-webkit-details-marker { display: none; }
details.ing ul { margin: 10px 0 0; padding: 0; list-style: none; columns: 2; gap: 12px; font-size: 15px; }
details.ing li { break-inside: avoid; padding: 3px 0; }
details.ing li b { font-weight: 700; }

.timeline { display: grid; gap: 8px; }
.phase { margin: 22px 0 8px; font-weight: 800; font-size: 18px; }
.phase:first-child { margin-top: 14px; }
.step-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 14px 14px 14px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.step-row .n { font-weight: 800; font-size: 18px; color: var(--muted); padding-top: 1px; }
.step-row .h { font-weight: 700; font-size: 17px; line-height: 1.25; }
.step-row .d { color: var(--muted); font-size: 15px; margin-top: 4px; }
.step-row .card-ref { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.step-row .card-ref b { color: var(--ink); }
.badge { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); }
.badge.timer { background: var(--accent); color: var(--on-accent); }
.badge.mean { background: var(--surface-2); }
.badge.wait { background: var(--ink); color: var(--bg); }
.voice-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 15px; }
.voice-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.voice-line .dot.warm { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + var(--sab));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.bottom-bar .inner { max-width: 560px; margin: 0 auto; display: grid; gap: 10px; }

/* ---------- cook ---------- */
.cook {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(10px + var(--sat)) 16px calc(var(--bar) + 16px + var(--sab));
}
.progress-track { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 8px 0 12px; }
.progress-track i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.cook-top .where { color: var(--muted); font-size: 15px; font-weight: 600; }
.timers { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; min-height: 14px; }
.timers::-webkit-scrollbar { display: none; }
.tchip {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  min-width: 118px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.tchip .l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tchip .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tchip.soon { border-color: var(--accent); }
.tchip.done { background: var(--accent); color: var(--on-accent); }
.tchip.done .l { color: var(--on-accent); opacity: 0.85; }

.step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 12px 0 20px;
}
.step .num {
  position: absolute; right: -6px; top: -12px;
  font-size: 140px; font-weight: 800; line-height: 1;
  color: var(--surface-2);
  z-index: -1;
  user-select: none;
}
.step .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.step h1 { font-size: clamp(30px, 8.5vw, 40px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; text-wrap: balance; }
.step .detail { font-size: 20px; line-height: 1.4; }
.step .tip { padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 16px; }
.step .tip b { color: var(--accent); }
.step .wait {
  display: grid; gap: 4px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); text-align: center;
}
.step .wait .big { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.step .wait .l { color: var(--muted); font-weight: 600; }
.step .wait.over { background: var(--accent); color: var(--on-accent); }
.step .wait.over .l { color: var(--on-accent); }
.step-enter { animation: rise 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.cook-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 10px 16px calc(10px + var(--sab));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.cook-bar .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.cook-bar .row2 { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.btn-next { min-height: 72px; display: grid; gap: 0; text-align: left; justify-content: start; padding: 0 22px; }
.btn-next .k { font-size: 21px; font-weight: 800; letter-spacing: 0.02em; }
.btn-next .p { font-size: 14px; font-weight: 500; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
.btn-back { min-height: 72px; padding: 0; font-size: 15px; }
.btn-timer { min-height: 64px; font-size: 19px; }

/* ---------- finish ---------- */
.finish { min-height: calc(100dvh - 40px); display: grid; align-content: center; text-align: center; gap: 16px; position: relative; overflow: hidden; }
.finish h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.finish .stat { font-size: 20px; color: var(--muted); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 10px; height: 16px; border-radius: 3px;
  background: var(--accent);
  animation: fall 2.6s ease-in forwards;
}
.confetti i:nth-child(3n) { background: var(--ok); }
.confetti i:nth-child(4n) { background: var(--ink); width: 7px; height: 12px; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; } }

/* ---------- misc ---------- */
.stack { display: grid; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.photo-view img { width: 100%; border-radius: var(--radius); margin-bottom: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar) + 20px + var(--sab));
  transform: translateX(-50%);
  padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow); z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- big kitchen touchscreen (27in Omarchy) and desktop ---------- */
.side { display: none; }
@media (min-width: 900px) {
  :root { --bar: 120px; font-size: 18px; }
  .screen { max-width: 900px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  .cook { max-width: none; padding-left: 40px; padding-right: 40px; }
  .cook .main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 48px; align-items: start; }
  .cook .step { padding-top: 24px; }
  .cook .step h1 { font-size: clamp(48px, 5.5vw, 84px); }
  .cook .step .detail { font-size: 30px; line-height: 1.35; }
  .cook .step .tip { font-size: 20px; padding: 18px 22px; }
  .cook .step .wait .big { font-size: 96px; }
  .cook .step .num { font-size: 320px; top: -40px; right: 0; }
  .timers { padding-bottom: 16px; }
  .tchip { min-width: 180px; padding: 14px 20px; }
  .tchip .v { font-size: 36px; }
  .side { display: block; position: sticky; top: 24px; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-top: 24px; }
  .side-title { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
  .up { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 19px; color: var(--muted); }
  .up:first-of-type { border-top: 0; }
  .up.next { color: var(--ink); font-weight: 700; }
  .up .n { font-weight: 800; color: var(--muted); }
  .cook-bar { padding: 14px 40px calc(14px + var(--sab)); }
  .cook-bar .inner { max-width: none; grid-template-columns: 160px 1fr auto; align-items: stretch; }
  .cook-bar .row2 { grid-column: auto; flex-direction: column; justify-content: center; gap: 6px; padding-left: 12px; }
  .btn-next { min-height: 92px; }
  .btn-next .k { font-size: 30px; }
  .btn-next .p { font-size: 18px; max-width: 60vw; }
  .btn-back { font-size: 20px; }
  .btn-text { font-size: 18px; min-height: 52px; }
  .bottom-bar .inner { max-width: 900px; }
  .hero { display: grid; grid-template-columns: 340px 1fr; }
  .hero img { height: 100%; aspect-ratio: auto; }
}
/* Fingers, not mice: everything tappable gets a generous hit area on touch screens. */
@media (pointer: coarse) and (min-width: 900px) {
  .btn-text { min-height: 60px; padding: 0 16px; }
  .step-row { padding: 20px 18px; }
}

/* ---------- cooks and tally ---------- */
.chip.pick { border: 2px solid transparent; cursor: pointer; min-height: 48px; }
.chip.pick.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chip.pick.add { background: var(--surface-2); box-shadow: none; color: var(--muted); }
.whocooks { display: grid; gap: 8px; }
.tally { padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.tally .chip b { margin-left: 4px; }
.tally .chip.lead { background: var(--accent); color: var(--on-accent); }
.finish .tally { text-align: left; }
.finish .section-title { text-align: left; }
.live { color: var(--accent); font-weight: 700; }
.live-note { padding: 0 4px 2px; color: var(--muted); font-size: 15px; font-weight: 600; text-align: center; }
.btn.danger { background: var(--accent); color: var(--on-accent); }
.cook-top .where .muted { font-weight: 500; }
