/* YT Cookbook — mobile-first styles. No build step, plain CSS. */

:root {
  --bg: #fffaf5;
  --surface: #ffffff;
  --surface-2: #fbf1e7;
  --surface-3: #f4e4d4;
  --border: #ead8c6;
  --text: #2b1d12;
  --muted: #7a6656;
  --primary: #c2410c;
  --primary-hover: #a8380a;
  --primary-ink: #ffffff;
  --primary-soft: #fde4d3;
  --focus: #f97316;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --link: #1d4ed8;
  --link-soft: #dbeafe;
  --mic: #7e22ce;
  --mic-soft: #f3e8ff;
  --none: #57534e;
  --none-soft: #ece7e2;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(60 30 10 / 6%), 0 6px 18px rgb(60 30 10 / 7%);
  --nav-h: 62px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110e;
    --surface: #1f1914;
    --surface-2: #29211b;
    --surface-3: #342a22;
    --border: #3d3128;
    --text: #f6ece2;
    --muted: #b6a493;
    --primary: #f97316;
    --primary-hover: #fb8a3c;
    --primary-ink: #1b0f05;
    --primary-soft: #43240f;
    --ok: #4ade80;
    --ok-soft: #12321f;
    --link: #93b4ff;
    --link-soft: #172648;
    --mic: #d8b4fe;
    --mic-soft: #2e1a45;
    --none: #c7beb6;
    --none-soft: #2f2924;
    --warn: #fcd34d;
    --warn-soft: #3b2c0b;
    --danger: #fca5a5;
    --danger-soft: #451616;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 18px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #15110e;
  --surface: #1f1914;
  --surface-2: #29211b;
  --surface-3: #342a22;
  --border: #3d3128;
  --text: #f6ece2;
  --muted: #b6a493;
  --primary: #f97316;
  --primary-hover: #fb8a3c;
  --primary-ink: #1b0f05;
  --primary-soft: #43240f;
  --ok: #4ade80;
  --ok-soft: #12321f;
  --link: #93b4ff;
  --link-soft: #172648;
  --mic: #d8b4fe;
  --mic-soft: #2e1a45;
  --none: #c7beb6;
  --none-soft: #2f2924;
  --warn: #fcd34d;
  --warn-soft: #3b2c0b;
  --danger: #fca5a5;
  --danger-soft: #451616;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 18px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.boot { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.spread { justify-content: space-between; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- App frame & navigation ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.view {
  outline: none;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
  max-width: 1180px;
  margin: 0 auto;
}
.nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.nav-brand { display: none; }
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: .72rem;
  font-weight: 600;
  position: relative;
}
.nav a svg, .icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 18px; height: 18px; }
.icon.fill { fill: currentColor; }
.nav a.active { color: var(--primary); }
.nav-count {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: .68rem;
  line-height: 18px;
  text-align: center;
}
.nav-job {
  position: fixed;
  right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 31;
  border: 0;
  border-radius: 999px;
  padding: .5rem .9rem;
  background: var(--text);
  color: var(--bg);
  font-size: .8rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
}

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 230px 1fr; }
  .nav {
    position: sticky;
    top: 0;
    inset: auto;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    padding: 1rem .75rem;
    gap: .25rem;
    border-top: 0;
    border-right: 1px solid var(--border);
  }
  .nav-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; padding: .25rem .6rem 1rem; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: .75rem; padding: .65rem .75rem; border-radius: 10px; font-size: .95rem; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.active { background: var(--primary-soft); color: var(--primary); }
  .nav-count { position: static; margin-left: auto; }
  .nav-job { position: static; margin-top: auto; text-align: left; border-radius: 10px; }
  .view { padding-bottom: 40px; width: 100%; }
}

/* ---------- Top bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  padding-top: calc(.6rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.bar h1 { font-size: 1.15rem; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 1rem; }
.section { margin: 1.25rem 0; }
.section > h2 { font-size: 1.05rem; margin-bottom: .6rem; }
.section-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.section-title h2 { font-size: 1.05rem; flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 42px;
  padding: .5rem .95rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  font-size: .93rem;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex: none;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { color: var(--primary); }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Chips & badges ---------- */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
@media (min-width: 700px) { .chips { flex-wrap: wrap; overflow: visible; } }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { opacity: .65; font-weight: 500; }
.tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 600; text-decoration: none; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .5rem;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--none-soft);
  color: var(--none);
}
.badge.found { background: var(--ok-soft); color: var(--ok); }
.badge.link { background: var(--link-soft); color: var(--link); }
.badge.transcript { background: var(--mic-soft); color: var(--mic); }
.badge.none { background: var(--none-soft); color: var(--none); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.error { background: var(--danger-soft); color: var(--danger); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.guess {
  display: inline-flex;
  align-items: center;
  padding: 0 .35rem;
  margin-left: .3rem;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
  cursor: help;
}

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: .9rem; }
.field > span, .label { display: block; font-size: .85rem; font-weight: 650; margin-bottom: .3rem; }
.hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.input, input[type="text"], input[type="url"], input[type="search"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: .55rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin: 0; }
.check { display: flex; align-items: flex-start; gap: .6rem; padding: .35rem 0; cursor: pointer; }
.check input { margin-top: 2px; }
.input-row { display: flex; gap: .5rem; align-items: stretch; }
.input-row > input, .input-row > select { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 420px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards & panels ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.panel + .panel { margin-top: .9rem; }
.panel h3 { font-size: 1rem; margin-bottom: .5rem; }
.notice { padding: .75rem .9rem; border-radius: 11px; background: var(--surface-2); font-size: .9rem; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 1.2rem; margin-bottom: .5rem; }
.empty .btn { margin-top: 1rem; }

/* ---------- Library grid ---------- */
.toolbar { display: flex; flex-direction: column; gap: .6rem; padding: .75rem 1rem 0; }
.search { position: relative; }
.search input { padding-left: 2.4rem; }
.search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; padding: 1rem; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; } }
.rcard { position: relative; display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; }
.rcard:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.rcard .body { padding: .6rem .7rem .7rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.rcard h3 { font-size: .95rem; font-weight: 700; }
.rcard .meta { font-size: .76rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.rcard .fav { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; background: rgb(0 0 0 / 45%); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.rcard .fav.on { color: #fbbf24; }
.rcard .sel { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; background: var(--surface); border-radius: 6px; padding: 3px; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; }
.thumb .dur { position: absolute; right: 5px; bottom: 5px; background: rgb(0 0 0 / 75%); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 5px; border-radius: 5px; }
.thumb .short { position: absolute; left: 5px; bottom: 5px; background: #ff0033; color: #fff; font-size: .66rem; font-weight: 800; padding: 1px 5px; border-radius: 5px; letter-spacing: .02em; }

/* ---------- Import: playlists & videos ---------- */
.plist { display: flex; flex-direction: column; gap: .7rem; }
.pl-item { display: flex; gap: .8rem; padding: .7rem; align-items: center; text-decoration: none; color: inherit; }
.pl-item .thumb { width: 120px; flex: none; border-radius: 9px; }
.vlist { display: flex; flex-direction: column; }
.vrow {
  display: grid;
  grid-template-columns: auto 128px 1fr;
  gap: .7rem;
  align-items: start;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.vrow.selected { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.vrow > label { padding-top: .35rem; cursor: pointer; }
.vrow .thumb { border-radius: 8px; }
.vrow h3 { font-size: .9rem; font-weight: 650; }
.vrow .info { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.vrow .status { font-size: .78rem; color: var(--muted); }
.vrow .status.err { color: var(--danger); }
.vrow .status.ok { color: var(--ok); }
@media (max-width: 480px) {
  .vrow { grid-template-columns: auto 96px 1fr; padding: .6rem .75rem; gap: .55rem; }
}
.filters { padding: .5rem 1rem; display: flex; flex-direction: column; gap: .5rem; border-bottom: 1px solid var(--border); }

.actionbar {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: .65rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgb(0 0 0 / 8%);
}
@media (min-width: 900px) { .actionbar { bottom: 0; } }
.actionbar .count { font-weight: 700; margin-right: auto; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s ease; }
.job { margin: 1rem; }
.job-log { max-height: 260px; overflow: auto; margin-top: .6rem; font-size: .82rem; border-top: 1px solid var(--border); }
.job-log div { padding: .3rem 0; border-bottom: 1px dashed var(--border); display: flex; gap: .5rem; }
.job-log .err { color: var(--danger); }

/* ---------- Recipe view ---------- */
.recipe { padding: 0 0 1rem; }
.hero { position: relative; display: block; }
.hero .thumb { aspect-ratio: 16 / 9; }
.hero .play { position: absolute; inset: 0; display: grid; place-items: center; }
.hero .play span { width: 64px; height: 64px; border-radius: 50%; background: rgb(0 0 0 / 60%); display: grid; place-items: center; color: #fff; }
@media (min-width: 900px) {
  .recipe-top { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 1.25rem; padding: 1rem; align-items: start; }
  .recipe-top .hero { border-radius: var(--radius); overflow: hidden; }
}
.recipe h1.title { font-size: 1.5rem; font-weight: 800; margin: .9rem 1rem .3rem; }
@media (min-width: 900px) { .recipe h1.title { margin: 0 0 .4rem; } }
.byline { margin: 0 1rem .6rem; color: var(--muted); font-size: .9rem; }
@media (min-width: 900px) { .byline { margin: 0 0 .6rem; } }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .6rem 1rem; }
@media (min-width: 900px) { .meta-grid { margin: .6rem 0; } }
.meta-grid div { background: var(--surface-2); border-radius: 11px; padding: .5rem .6rem; }
.meta-grid b { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.meta-grid span { font-weight: 700; font-size: .95rem; }
.recipe-body { padding: 0 1rem; }
@media (min-width: 900px) { .recipe-body { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 2rem; } }
.recipe-body h2 { font-size: 1.15rem; margin: 1.25rem 0 .6rem; }
.ing-list, .step-list, .tip-list { margin: 0; padding: 0; list-style: none; }
.ing-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.ing-list li.hdr, .step-list li.hdr { border: 0; font-weight: 800; padding-top: .9rem; color: var(--primary); list-style: none; }
.step-list { counter-reset: step; }
.step-list li:not(.hdr) { counter-increment: step; position: relative; padding: .2rem 0 .9rem 2.6rem; }
.step-list li:not(.hdr)::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .1rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: .9rem;
  display: grid;
  place-items: center;
}
.ts { font-size: .78rem; font-weight: 700; text-decoration: none; margin-left: .35rem; white-space: nowrap; }
.tip-list li { padding: .45rem 0 .45rem 1.5rem; position: relative; }
.tip-list li::before { content: "💡"; position: absolute; left: 0; }
.sources li { margin-bottom: .3rem; }

/* ---------- Editor ---------- */
.edit-list { display: flex; flex-direction: column; gap: .45rem; }
.edit-row { display: flex; gap: .35rem; align-items: flex-start; }
.edit-row .grow input, .edit-row .grow textarea { width: 100%; }
.edit-row textarea { min-height: 64px; }
.edit-row textarea.one { min-height: 44px; resize: none; overflow: hidden; }
@media (max-width: 480px) {
  .edit-row .ctrls .icon-btn { width: 28px; }
  .edit-row .ts-input { width: 64px; padding-left: .4rem; padding-right: .4rem; }
}
.edit-row.hdr input { font-weight: 800; color: var(--primary); }
.edit-row .ctrls { display: flex; gap: 2px; flex: none; }
.edit-row .ctrls .icon-btn { width: 34px; height: 44px; }
.edit-row .ts-input { width: 78px; flex: none; }
.edit-row .flag { align-self: center; }
.editor .panel { margin-bottom: .9rem; }
.editor-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; display: flex; gap: .5rem; flex-wrap: wrap; padding: .65rem 1rem; background: var(--surface); border-top: 1px solid var(--border); }
@media (min-width: 900px) { .editor-actions { bottom: 0; } }

/* ---------- Review ---------- */
.draft { display: grid; grid-template-columns: 112px 1fr; gap: .75rem; padding: .75rem; }
.draft .thumb { border-radius: 9px; }
.draft h3 { font-size: .95rem; }
.draft .acts { grid-column: 1 / -1; display: flex; gap: .4rem; flex-wrap: wrap; }
.source-box { max-height: 340px; overflow: auto; background: var(--surface-2); padding: .75rem; border-radius: 10px; font-size: .85rem; }
details.panel > summary { cursor: pointer; font-weight: 700; }
details.panel[open] > summary { margin-bottom: .6rem; }

/* ---------- Dialogs ---------- */
dialog {
  border: 0;
  padding: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
}
dialog::backdrop { background: rgb(20 10 5 / 55%); }
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; max-height: 88dvh; }
}
.dlg { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { padding: 1rem 1.1rem .4rem; display: flex; align-items: center; gap: .5rem; }
.dlg-head h2 { font-size: 1.1rem; flex: 1; }
.dlg-body { padding: .4rem 1.1rem 1rem; overflow: auto; }
.dlg-foot { padding: .75rem 1.1rem calc(.9rem + env(safe-area-inset-bottom)); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }
.opt-list { display: flex; flex-direction: column; gap: .4rem; }
.opt { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); text-align: left; width: 100%; }
.opt:hover { background: var(--surface-2); }
.opt b { display: block; }
.opt small { color: var(--muted); }
.est { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; font-size: .92rem; }
.est b { text-align: right; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(480px, calc(100vw - 24px));
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 20px; } }
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .9rem;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: .9rem;
  animation: toast-in .2s ease;
}
.toast.error { background: var(--danger); color: #fff; }
.toast button { margin-left: auto; background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: .25rem .6rem; font-weight: 700; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Print ---------- */
.print-page { padding: 1rem; max-width: 800px; margin: 0 auto; }
.print-recipe { break-after: page; margin-bottom: 2rem; }
.print-recipe:last-child { break-after: auto; }
.print-recipe h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.print-recipe h2 { font-size: 1.1rem; margin: 1rem 0 .4rem; border-bottom: 1px solid var(--border); padding-bottom: .2rem; }
.print-cols { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.5rem; }
@media (max-width: 600px) { .print-cols { grid-template-columns: 1fr; } }
.print-recipe ol, .print-recipe ul { padding-left: 1.3rem; margin: 0; }
.print-recipe li { margin-bottom: .3rem; }
.print-recipe .hdr { list-style: none; margin-left: -1.3rem; font-weight: 800; margin-top: .6rem; }

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --border: #ccc; --surface: #fff; --surface-2: #f3f3f3; --primary: #000; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .nav, .bar, .toasts, .nav-job, .no-print, .skip { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  .print-page { padding: 0; }
  a { color: #000; text-decoration: none; }
  .print-cols { grid-template-columns: 1fr 1.6fr; }
}
