:root {
  --bg: #0b0b0f;
  --fg: #f4f4f7;
  --muted: #8a8a9a;
  --accent: #f5a623;
  --accent-deep: #c97f0a;
  --card: #16161d;
  --card-hover: #1f1f29;
  --border: #2a2a36;
  --done: #4ade80;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

#app {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 1rem env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

/* shared header/back/dots/icon-btn */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
}
.back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  padding: 0.5rem;
  margin-left: -0.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.back:active { color: var(--fg); }
.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  padding: 0.5rem;
  margin-right: -0.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { color: var(--fg); }
.dots {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.dot.active { background: var(--accent); }
.dot.done { background: var(--done); }

/* picker */
.picker {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
}
.picker h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.picker .sub { color: var(--muted); margin-bottom: 1.5rem; }
.recipe-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
}
.recipe-card:active { background: var(--card-hover); }
.recipe-card .title { font-size: 1.25rem; font-weight: 600; }
.recipe-card .meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.recipe-card .count { color: var(--accent); font-size: 0.85rem; margin-top: 0.5rem; }

/* mise en place */
.mise {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mise:active { background: rgba(255, 255, 255, 0.02); }
.mise .no-advance { cursor: default; }
.mise h1 {
  font-size: 1.65rem;
  margin: 1.25rem 0 0.25rem;
  letter-spacing: -0.02em;
}
.mise .sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.section-head {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 1.25rem 0 0.5rem;
  font-weight: 500;
}
.section-head:first-child { margin-top: 0; }
.ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ingredient-list:last-of-type { margin-bottom: 1.5rem; }
.ingredient {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.ingredient.checked { opacity: 0.4; }
.ingredient.checked .name { text-decoration: line-through; }
.ingredient .check {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--done);
  align-self: center;
}
.ingredient.checked .check {
  background: var(--done);
  border-color: var(--done);
  color: #082014;
}
.ingredient .qty {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 500;
  min-width: 4rem;
}
.ingredient .name { flex: 1; }

/* runner / step view */
.runner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.runner:active { background: rgba(255, 255, 255, 0.02); }
.runner .no-advance { cursor: default; }

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.step .index {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.step-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 22rem;
  margin-bottom: 1.5rem;
}
.step-ingredients .pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.step-ingredients .pill .qty {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 0.35em;
}
.step .name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 1rem;
}
.step .note {
  color: var(--fg);
  font-size: 1.05rem;
  max-width: 22rem;
  line-height: 1.45;
  opacity: 0.85;
}

.timer {
  font-size: 4.5rem;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: -0.04em;
  margin: 0.75rem 0;
}
.timer.done { color: var(--done); }
.timer-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.timer-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
}

/* bottom */
.bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
}
.next-peek {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.5em;
}
.next-peek .label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 0.5em;
  opacity: 0.7;
}
.advance {
  background: var(--accent);
  color: #1a1308;
  border: none;
  border-radius: 14px;
  padding: 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
}
.advance:active { background: var(--accent-deep); }
.advance.done { background: var(--done); color: #082014; }

/* complete */
.complete {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}
.complete .check { font-size: 4rem; color: var(--done); }
.complete h2 { font-size: 1.75rem; margin: 0; letter-spacing: -0.02em; }
.complete p { color: var(--muted); margin: 0; }
.complete .advance { margin-top: 2rem; width: 100%; max-width: 22rem; }
