/* Ninja Combi — shared styles. High contrast, big tap targets, no hover dependence. */
:root {
  --bg: #0e1116;
  --surface: #171c24;
  --surface-2: #212936;
  --line: #313c4e;
  --text: #f4f7fb;
  --muted: #a9b6c8;
  --accent: #ffb020;        /* Ninja amber */
  --accent-ink: #221600;
  --l1: #4bb3fd;            /* Level 1 (pan) */
  --l2: #ff7a59;           /* Level 2 (bake tray) */
  --good: #38c172;
  --warn: #ff5a5a;
  --steam: #6ec6ff;
  --cook: #ff9f43;
  --tap: 56px;             /* minimum tap target */
  --radius: 16px;
  --pad: 16px;
  font-size: 18px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef2f8; --line: #d4dbe6;
    --text: #131820; --muted: #56637a; --accent: #e08a00; --accent-ink: #fff;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4; padding-bottom: 90px; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* App header */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--pad); background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar h1 { font-size: 1.15rem; margin: 0; flex: 1; font-weight: 800; letter-spacing: .2px; }
.appbar .back {
  min-width: var(--tap); min-height: var(--tap);
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 1.4rem; font-weight: 700;
}
.appbar .home-link { font-size: 1.5rem; }

main { padding: var(--pad); max-width: 720px; margin: 0 auto; }

/* Cards & tiles */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad); margin-bottom: 14px;
}
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
  min-height: 130px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
/* An odd tile out would otherwise sit orphaned in a half-width slot. */
.tile.wide { grid-column: 1 / -1; min-height: 100px; }
.tile.wide .emoji { font-size: 1.8rem; }
.tile .emoji { font-size: 2.1rem; }
.tile .t-title { font-weight: 800; font-size: 1.15rem; }
.tile .t-sub { color: var(--muted); font-size: .82rem; }
.tile:active { background: var(--surface-2); }

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; font-size: 1.05rem; font-weight: 700;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); cursor: pointer; width: 100%;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--warn); color: var(--warn); }
.btn:disabled { opacity: .45; }
.btn:active { transform: translateY(1px); }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { width: auto; flex: 1; }

/* Option lists (choices with big targets) */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: var(--tap); padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 2px solid var(--line); color: var(--text);
  font-size: 1rem; cursor: pointer;
}
.opt .opt-main { flex: 1; }
.opt .opt-name { font-weight: 700; }
.opt .opt-meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.opt[aria-selected="true"] { border-color: var(--accent); background: var(--surface-2); }
.opt .check { font-size: 1.3rem; color: var(--accent); opacity: 0; }
.opt[aria-selected="true"] .check { opacity: 1; }
.opt:active { background: var(--surface-2); }

/* Pills / chips */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--line); }
.pill.l1 { color: var(--l1); border-color: var(--l1); }
.pill.l2 { color: var(--l2); border-color: var(--l2); }
.pill.crisp { color: var(--steam); border-color: var(--steam); }
.pill.airfry { color: var(--cook); border-color: var(--cook); }
.pill.veg { color: var(--good); border-color: var(--good); }

/* Inputs */
input[type="text"], input[type="search"], input[type="number"], textarea, select {
  width: 100%; min-height: var(--tap); padding: 12px 14px; font-size: 1.05rem;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: 14px; -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
textarea { min-height: 90px; resize: vertical; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
h2 { font-size: 1.1rem; margin: 6px 0 12px; }
.stepdots { display: flex; gap: 8px; margin-bottom: 14px; }
.stepdots .dot { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.stepdots .dot.on { background: var(--accent); }
.stepdots .dot.done { background: var(--good); }

/* Flags / notes */
.note { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin: 10px 0; }
.note.warn { border-color: var(--warn); }
.note.gap { border-color: var(--l1); }

/* Segmented control */
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; min-height: 48px; border: 0; background: var(--surface); color: var(--text); font-weight: 700; font-size: .95rem; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Review checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.checklist li:last-child { border-bottom: 0; }
.checklist .box {
  flex: none; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--muted); margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.checklist li.done .box { background: var(--good); border-color: var(--good); color: #fff; }
.checklist li.done .step-text { opacity: .55; text-decoration: line-through; }

/* Confetti celebration when a checklist is fully checked off */
.confetti-piece { position: fixed; top: -20px; width: 8px; height: 14px; border-radius: 2px; z-index: 9999; pointer-events: none; animation: confetti-fall linear forwards; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: .9; }
}
.big-num { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 800; text-align: right; }

/* Recipe ingredient list — one ingredient per line, name left / amount right */
.ingredient-list { display: flex; flex-direction: column; }
.ingredient-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ingredient-row:last-child { border-bottom: 0; }
.ingredient-name { flex: 1 1 45%; min-width: 0; }
/* Long amounts ("6 breasts, 170-230g each, 2.5cm thick") must wrap rather than
   overflow the card — nowrap here used to push them off the right edge. */
.ingredient-amt { font-weight: 700; text-align: right; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

/* Bottom nav */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; min-height: 60px; justify-content: center; color: var(--muted); font-size: .68rem; font-weight: 700;
}
.tabbar a .ic { font-size: 1.4rem; }
.tabbar a.active { color: var(--accent); }

/* Timer */
.timer-face { text-align: center; padding: 20px 0; }
.timer-face .phase { font-size: 1rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.timer-face .clock { font-size: 4.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; margin: 8px 0; }
.phase-steam { color: var(--steam); }
.phase-cook { color: var(--cook); }
.phase-done { color: var(--good); }
.progress { position: relative; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; display: flex; }
.progress .seg-steam { background: var(--steam); }
.progress .seg-cook { background: var(--cook); }
.progress .spent { position: absolute; left: 0; top: 0; bottom: 0; background: var(--line); transition: width .3s linear; }
.progress .divider { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); opacity: .7; }

/* Filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 2px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip:active { transform: translateY(1px); }

/* A–Z chart lookup */
.az-letter { font-size: 1.3rem; font-weight: 800; color: var(--accent); margin: 18px 2px 8px; border-bottom: 2px solid var(--line); padding-bottom: 3px; }
.az-name { font-weight: 800; margin: 12px 2px 4px; }

.hidden { display: none !important; }
