/* Recipe Box — mobile-first, warm "kitchen notebook" styling. */

:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-2: #f3ece1;
  --ink: #2a211b;
  --ink-2: #6b5e53;
  --line: #e4d9ca;
  --accent: #b8492f;
  --accent-hover: #a03e27;
  --accent-ink: #ffffff;
  --accent-soft: #f7e3dc;
  --grid-line: #4f8a5b;
  --grid-prep: #eef5ee;
  --grid-select: #fde7c9;
  --star: #e0a526;
  --warn-bg: #fff4d6;
  --warn-ink: #6e5200;
  --warn-line: #f0dc9c;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgba(42, 33, 27, 0.06), 0 6px 18px rgba(42, 33, 27, 0.07);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1714;
    --surface: #25201b;
    --surface-2: #2f2922;
    --ink: #f1e9df;
    --ink-2: #b9ab9b;
    --line: #3b332b;
    --accent: #e27d5f;
    --accent-hover: #ec8f73;
    --accent-ink: #1b1714;
    --accent-soft: #3b2721;
    --grid-line: #7fb08a;
    --grid-prep: #24302a;
    --grid-select: #4a3a22;
    --star: #f0bd4a;
    --warn-bg: #3a3018;
    --warn-ink: #f2d98f;
    --warn-line: #5a4a22;
    --danger: #f28b82;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; }

.boot { padding: 40vh 1rem 0; text-align: center; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.inline { width: 1em; height: 1em; vertical-align: -0.15em; }

/* ---------- layout ---------- */
.screen {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem calc(6rem + var(--safe-bottom));
  min-height: 100vh;
}
.content { display: flex; flex-direction: column; gap: 1rem; padding-top: 0.5rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin: 0 -1rem;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar-title { font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 0.25rem; justify-content: flex-end; min-width: 2.75rem; }
.topbar-spacer { width: 2.75rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.icon-btn.small { width: 2.25rem; height: 2.25rem; }
.icon-btn.danger { color: var(--danger); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.small { min-height: 2.25rem; padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.btn.big { min-height: 3.25rem; padding: 0.7rem 1.4rem; font-size: 1.05rem; }
.btn.wide { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { color: var(--danger); }

.input, .select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
}
textarea.input { resize: vertical; line-height: 1.45; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { width: auto; padding-right: 2rem; }
.input.paste { min-height: 14rem; }

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

.toggle {
  min-height: 2.25rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
}
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.segmented {
  display: flex;
  padding: 0.25rem;
  gap: 0.25rem;
  border-radius: 999px;
  background: var(--surface-2);
}
.seg {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
}
.seg[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.chips { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.15rem 1rem 0.35rem; margin: 0 -1rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none;
  min-height: 2rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.taken { color: var(--ink-2); border-style: dashed; }
.chip-note { opacity: 0.8; }
.more-chip { border-style: dashed; color: var(--accent); background: transparent; }

.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.78rem;
}

.panel { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 0.75rem; }
.section-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

.warn { padding: 0.75rem 1rem; border: 1px solid var(--warn-line); border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); }
.warn ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.warn.small { font-size: 0.875rem; }

.status { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0; color: var(--ink-2); }
.status.error { color: var(--danger); }
.spinner {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 3rem 1rem; text-align: center; color: var(--ink-2); }
.empty h2 { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.empty p { max-width: 24rem; margin: 0; }
.empty-icon { width: 3rem; height: 3rem; color: var(--accent); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + var(--safe-bottom));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-action { border: 0; background: none; color: var(--accent-soft); font-weight: 700; cursor: pointer; padding: 0.25rem; }

/* ---------- home ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; padding: calc(1rem + env(safe-area-inset-top, 0px)) 0 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand h1 { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-icon { width: 1.8rem; height: 1.8rem; color: var(--accent); }

.search-wrap { position: relative; margin-bottom: 0.6rem; }
.search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 1rem 0.6rem 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  outline: none;
  font-size: 1rem;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.toolbar { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.9rem; }
.toolbar .select { min-height: 2.25rem; padding: 0.3rem 0.6rem; font-size: 0.9rem; border-radius: 999px; }
.toolbar .count { margin-left: auto; }

.recipe-list { display: flex; flex-direction: column; gap: 0.65rem; }
.recipe-card {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(42, 33, 27, 0.03);
}
a.recipe-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.recipe-card.static { align-items: center; }
.recipe-card-main { min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.recipe-card-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.recipe-card-meta { color: var(--ink-2); font-size: 0.875rem; }
.recipe-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.recipe-card-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.made { font-size: 0.78rem; color: var(--ink-2); white-space: nowrap; }
.made.new { color: var(--accent); }

.stars { display: inline-flex; gap: 0.05rem; color: var(--line); }
.stars .star { width: 0.9rem; height: 0.9rem; }
.stars .star.on { color: var(--star); }
.stars .star.on svg { fill: currentColor; }
.stars.interactive .star { width: 1.5rem; height: 1.5rem; }
.star-btn { border: 0; background: none; padding: 0.2rem; cursor: pointer; color: inherit; display: inline-grid; }

.fab {
  position: fixed;
  right: max(1rem, calc(50vw - 21rem));
  bottom: calc(1.25rem + var(--safe-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 3.25rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------- recipe ---------- */
.recipe-head { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.25rem 0 1rem; }
.recipe-title { font-family: var(--serif); font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.recipe-desc { margin: 0; color: var(--ink-2); font-size: 1.02rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; }
.meta-item dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.meta-item dd { margin: 0; font-weight: 600; }
.recipe-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

.view-switch { position: sticky; top: calc(3.75rem + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; gap: 0.5rem; align-items: center; padding: 0.4rem 0; background: var(--bg); }
.view-switch .segmented { flex: 1; }
.cook-btn { flex: none; }
.view-host { padding-top: 0.5rem; }

.card-view { display: flex; flex-direction: column; gap: 1.5rem; }
.card-section { display: flex; flex-direction: column; gap: 0.6rem; }
.group-title { font-family: var(--serif); font-size: 1.05rem; margin-top: 0.25rem; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.prep-list li { padding: 0.45rem 0.75rem; margin-bottom: 0.35rem; border-left: 3px solid var(--grid-line); background: var(--grid-prep); border-radius: 0 8px 8px 0; }
.ing-list li + li, .step-list li + li { border-top: 1px solid var(--line); }

.tick { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0.1rem; cursor: pointer; border-radius: 8px; }
.tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tick-box {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.1rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.tick.done .tick-box { background: var(--grid-line); border-color: var(--grid-line); box-shadow: inset 0 0 0 3px var(--surface); }
.tick.done .tick-text { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-2) 60%, transparent); }
.step-tick .tick-box { display: none; }
.step-tick .tick-text { display: flex; gap: 0.75rem; }
.step-tick.done .tick-text { text-decoration: none; opacity: 0.5; }
.step-no {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.notes { margin: 0; white-space: pre-wrap; }
.source { padding-top: 0.75rem; border-top: 1px solid var(--line); }
.original summary { cursor: pointer; color: var(--ink-2); font-size: 0.875rem; margin-top: 0.4rem; }
.raw { white-space: pre-wrap; word-break: break-word; font: 0.8rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); padding: 0.75rem; border-radius: 10px; max-height: 24rem; overflow: auto; }

.danger-zone { display: flex; justify-content: center; padding-top: 2rem; }

/* ---------- grid view ---------- */
.grid-view { display: flex; flex-direction: column; gap: 0.6rem; }
.grid-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tgrid-scroll { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem 0.25rem; -webkit-overflow-scrolling: touch; }
.tgrid {
  display: grid;
  gap: 1.5px;
  width: max-content;
  min-width: 100%;
  background: var(--grid-line);
  border: 2px solid var(--grid-line);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.3;
}
.tgrid.fit { width: 100%; min-width: 0; font-size: 0.74rem; }
.tcell { background: var(--surface); padding: 0.45rem 0.55rem; min-width: 0; overflow-wrap: break-word; }
.tgrid.fit .tcell { padding: 0.3rem 0.3rem; }
.tcell.prep { background: var(--grid-prep); font-weight: 500; }
.tgrid.fit .tcell.prep { text-align: center; }
.tcell.ingredient { cursor: pointer; }
/* While scrolling sideways, keep ingredient names (and setup lines) in view. */
.tgrid:not(.fit) .tcell.ingredient { position: sticky; left: 0; z-index: 1; box-shadow: 1.5px 0 0 var(--grid-line); }
.tgrid:not(.fit) .tcell.prep > span { display: inline-block; position: sticky; left: 0.55rem; }
.tcell.ingredient.done { color: var(--ink-2); text-decoration: line-through; }
.tcell.step { display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 600; cursor: pointer; }
.tcell.step:hover { background: color-mix(in srgb, var(--grid-select) 50%, var(--surface)); }
.tcell.step.selected { background: var(--grid-select); }
.tcell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid-detail { min-height: 2.5rem; }
.grid-detail-body { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem 0.85rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- cook mode ---------- */
.cook {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--bg);
  padding: env(safe-area-inset-top, 0px) 0 var(--safe-bottom);
}
.cook-head { display: grid; grid-template-columns: 2.75rem 1fr auto; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; }
.cook-title { min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.cook-title > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wake-note { font-size: 0.72rem; font-weight: 500; color: var(--grid-line); }
.cook-counter { font-weight: 700; color: var(--ink-2); padding-right: 0.25rem; }
.cook-progress { height: 4px; background: var(--surface-2); position: relative; }
.cook-progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent); transition: width 0.25s ease; }
.cook-body { overflow-y: auto; padding: 1.5rem 1.25rem; max-width: 44rem; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.cook-kicker { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.cook-short { padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--accent-soft); letter-spacing: 0; text-transform: none; font-weight: 600; }
.cook-text { margin: 0; font-family: var(--serif); font-size: clamp(1.45rem, 5.5vw, 2rem); line-height: 1.35; }
.cook-prep { margin: 0; padding-left: 1.2rem; font-family: var(--serif); font-size: clamp(1.25rem, 5vw, 1.6rem); line-height: 1.4; }
.cook-prep li + li { margin-top: 0.6rem; }
.cook-uses { display: flex; flex-direction: column; gap: 0.5rem; }
.use { padding: 0.65rem 0.85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 1.1rem; }
.use + .use { margin-top: 0.4rem; }
.use.ingredient { cursor: pointer; }
.use.ingredient.done { color: var(--ink-2); text-decoration: line-through; }
.use.from-step { background: var(--grid-prep); border-color: transparent; font-style: italic; }
.cook-foot { display: grid; grid-template-columns: 1fr 1.6fr; gap: 0.75rem; padding: 0.75rem 1rem 1rem; max-width: 44rem; width: 100%; margin: 0 auto; }

/* ---------- add & review ---------- */
.panel-body { display: flex; flex-direction: column; gap: 0.6rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.6rem; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove { position: absolute; top: 0.3rem; right: 0.3rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; }
.add-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; color: var(--accent); border-style: dashed; cursor: pointer; font-size: 0.85rem; font-weight: 600; text-align: center; padding: 0.5rem; }
.add-photo .icon { width: 1.75rem; height: 1.75rem; }

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem max(1rem, calc(50vw - 21rem)) calc(0.75rem + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottom-bar .btn-ghost:first-child { margin-right: auto; }


/* ---------- editor ---------- */
.edit-list { display: flex; flex-direction: column; gap: 0.6rem; }
.edit-row { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border-radius: 12px; background: var(--surface-2); }
.ing-grid { display: grid; grid-template-columns: 4.5rem 5.5rem minmax(0, 1fr); gap: 0.4rem; }
.ing-grid .metric, .ing-grid .note, .ing-grid .group { grid-column: span 1; }
.ing-grid .note { grid-column: 2 / span 2; }
.ing-grid .metric { grid-column: 1 / span 1; }
.ing-grid .group { grid-column: 1 / -1; }
.ing-grid .input { min-height: 2.4rem; padding: 0.45rem 0.55rem; font-size: 0.95rem; }
.row-actions { display: flex; justify-content: flex-end; gap: 0.15rem; }
.step-row-head { display: flex; align-items: center; gap: 0.5rem; }
.step-row-head .input.short { flex: 1; min-height: 2.4rem; }
.step-row-head .row-actions { flex: none; }
.uses { display: flex; flex-direction: column; gap: 0.35rem; }
.use-chip { font-size: 0.82rem; min-height: 1.9rem; }
.preview-host { display: flex; flex-direction: column; gap: 0.6rem; }

@media (min-width: 40rem) {
  .ing-grid { grid-template-columns: 4.5rem 6rem minmax(0, 1fr) 7rem; }
  .ing-grid .metric { grid-column: 4; }
  .ing-grid .note { grid-column: 1 / span 3; }
  .ing-grid .group { grid-column: 4; }
  .field-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recipe-title { font-size: 2.4rem; }
}

/* ---------- unlock ---------- */
.unlock { display: grid; place-items: center; }
.unlock-card { width: 100%; max-width: 24rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; padding-top: 18vh; }
.unlock-card h1 { font-family: var(--serif); font-size: 2rem; }
.unlock-icon { width: 3.25rem; height: 3.25rem; color: var(--accent); }
.unlock-form { width: 100%; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }

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

/* ---------- Claude copy-paste hand-off ---------- */
.handoff { gap: 0; padding: 0; overflow: hidden; }
.handoff-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.handoff-toggle > .icon:first-child { color: var(--accent); }
.handoff-toggle .chevron { margin-left: auto; color: var(--ink-2); }
.handoff-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 1rem 1rem; }
.handoff-body > p { margin: 0; }
.handoff-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.handoff-steps > li { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.6rem; align-items: start; }
.handoff-steps > li > div { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; min-width: 0; }
.handoff-steps p { margin: 0; }
.handoff-num {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}
.handoff-answer { width: 100%; }
.handoff-answer .input, .prompt-fallback { width: 100%; font-size: 0.9rem; }
.add .panel-body > .btn-primary { margin-top: 0.1rem; }
.draft .handoff, .draft .warn { margin-top: 1rem; }
