/* Recipe reader: content first, optional evidence, persistent navigation. */
.reader-organise { margin:0 20px 16px; padding:0 12px; font-size:.85rem; color:var(--green); }
.reader-organise summary { cursor:pointer; padding:12px 0; }
.organise-form { display:grid; gap:14px; padding:8px 0 14px; }
.organise-form select { display:block; width:100%; margin-top:7px; min-height:44px; padding:8px; font:inherit; font-size:16px; }
.organise-form button { justify-self:start; border:0; border-radius:8px; background:var(--green); color:white; padding:12px 18px; min-height:44px; font:inherit; }
.category-hint { margin:4px 0 0; color:var(--muted); font-size:.8rem; line-height:1.5; }
.category-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; border:0; padding:0; margin:0; max-height:290px; overflow:auto; overscroll-behavior:contain; }
.category-choices legend { grid-column:1/-1; padding:0 0 8px; font-weight:600; }
.category-choices label { display:flex; align-items:center; gap:9px; min-height:46px; padding:9px 10px; border:1px solid #e3e6df; border-radius:12px; font-size:.8rem; cursor:pointer; overflow-wrap:anywhere; }
.category-choices label:has(input:checked) { background:#edf3eb; border-color:#6d876c; }
.category-choices input { flex:0 0 18px; width:18px; height:18px; margin:0; accent-color:var(--green); }
.category-create label { display:block; font-size:.8rem; margin-bottom:7px; }
.category-create-row { display:flex; align-items:center; gap:8px; }
.category-create-row input { min-width:0; width:100%; min-height:46px; border:1px solid #d9ded5; border-radius:12px; padding:10px; font:inherit; font-size:16px; }
.category-create-row .control { flex-shrink:0; }
.reader-organise>summary { max-width:100%; overflow-wrap:anywhere; }
.reader-organise>summary::after { flex-shrink:0; }
body.recipe-open { overflow: hidden; }
.recipe-dialog { max-width: 940px; overscroll-behavior: contain; }
.reader-content[hidden], .reader-player[hidden] { display: none !important; }
.reader-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.reader-toolbar button { min-height: 44px; border: 0; cursor: pointer; font-size: .9rem; font-weight: 650; }
.reader-back { color: var(--green); background: transparent; padding: 8px 0; }
.reader-watch { color: white; background: var(--green); border-radius: 99px; padding: 10px 17px; }
.reader-photo { display: block; width: 100%; height: 320px; object-fit: cover; }
.reader-photo.reader-photo--full { height:auto; max-height:65svh; object-fit:contain; object-position:center!important; background:#eeeee7; }
.reader-heading { padding: 28px 32px 24px; }
.reader-byline { font-size: .78rem; color: var(--green); margin: 0 0 10px; text-transform: capitalize; line-height: 1.5; }
.reader-heading h2 { margin: 0; font-size: clamp(1.9rem,4vw,3rem); font-weight: 720; letter-spacing: -.035em; line-height: 1.1; overflow-wrap: anywhere; }
.reader-meta { font-size: .88rem; line-height: 1.5; margin: 14px 0 0; color: var(--muted); }
.reader-nav { display: flex; gap: 24px; flex-wrap: wrap; padding: 0 32px 20px; border-bottom: 1px solid var(--line); }
.reader-nav a, .reader-footer a, .player-original { color: var(--green); font-size: .85rem; text-decoration: none; font-weight: 650; }
.reader-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.reader-body { padding: 28px 32px 40px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 36px; }
.reader-body section { scroll-margin-top: 84px; min-width: 0; }
.reader-body h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.025em; margin: 0 0 14px; }
.reader-hint { color: var(--muted); font-size: .78rem; margin: -5px 0 14px; }
.reader-ingredient { border-bottom: 1px solid var(--line); }
.ingredient-check { position: relative; display: grid; grid-template-columns: 22px minmax(0,1fr) minmax(48px,auto); gap: 10px; align-items: start; padding: 11px 0; cursor: pointer; font-size: .94rem; line-height: 1.35; }
.ingredient-check input { position: absolute; left: 0; top: 14px; width: 24px; height: 24px; opacity: 0; margin: 0; }
.check-mark { width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid #aaaFA5; margin-top: 1px; display: grid; place-items: center; }
.ingredient-check input:checked + .check-mark { background: var(--green); border-color: var(--green); }
.ingredient-check input:checked + .check-mark:after { content: '✓'; color: white; font-size: 13px; }
.ingredient-check input:checked ~ .ingredient-name { text-decoration: line-through; color: var(--muted); }
.ingredient-check input:focus-visible + .check-mark { outline: 3px solid var(--green); outline-offset: 3px; }
.ingredient-name { font-weight: 550; overflow-wrap: anywhere; }
.ingredient-name small { display: block; margin-top:2px; font-size: .78rem; line-height:1.3; color: var(--muted); font-weight: 400; }
.ingredient-amount { text-align: right; font-size: .88rem; font-weight: 650; max-width: 115px; overflow-wrap: anywhere; }
.ingredient-amount small { display: block; font-size: .7rem; font-weight: 500; color: #8a5a19; }
.ingredient-amount.is-missing { color: #946020; font-size: .78rem; font-weight: 550; white-space: nowrap; }
.ingredient-evidence { margin: -3px 0 6px 32px; }
.ingredient-evidence summary { color: #946020; font-size: .75rem; cursor: pointer; padding: 7px 0; min-height: 36px; }
.ingredient-evidence p { color: var(--muted); font-size: .82rem; line-height: 1.55; margin: 0 0 12px; overflow-wrap: anywhere; }
.reader-steps { list-style: none; counter-reset: steps; padding: 0; margin: 0; }
.reader-steps>li { counter-increment: steps; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 12px; padding: 4px 0 24px; }
.reader-steps>li:before { content: counter(steps); display: grid; place-items: center; border-radius: 50%; background: #eef2eb; color: var(--green); width: 28px; height: 28px; font-size: .82rem; font-weight: 650; }
.reader-steps p { margin: 0; font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.step-copy { min-width:0; }
.step-ingredients { list-style:none; display:flex; flex-wrap:wrap; gap:6px 12px; margin:9px 0 0; padding:0; color:var(--green); }
.step-ingredients li { counter-increment:none; display:inline-flex; grid-template-columns:none; gap:5px; align-items:baseline; padding:0; font-size:.76rem; line-height:1.35; }
.step-ingredients li:before { content:none; }
.step-ingredients strong { font-weight:750; }
.step-ingredients span { color:var(--muted); }
.reader-notes, .reader-warnings, .reader-footer { grid-column: 1 / -1; }
.reader-notes ul, .reader-warnings ul { padding-left: 20px; margin: 12px 0 0; }
.reader-notes li, .reader-warnings li { font-size: .9rem; line-height: 1.6; margin-bottom: 9px; }
.reader-warnings { padding: 17px 18px; background: #f7f3e9; border-radius: 12px; }
.reader-warnings summary { cursor: pointer; color: #795727; font-size: .9rem; min-height: 28px; }
.reader-warnings summary span { margin-left: 8px; font-size: .8rem; }
.reader-footer { color: var(--muted); font-size: .78rem; margin: 0; line-height: 1.6; }
.reader-player { min-height: 100%; background: #141714; color: #fff; padding-bottom: 28px; }
.reader-player .reader-toolbar { background: #141714; border-color: #333; }
.reader-player .reader-back { color: white; }
.reader-player h2 { font-size: 1.15rem; line-height: 1.4; margin: 16px 24px; }
.reader-player video { display: block; width: 100%; height: min(65dvh,720px); object-fit: contain; background: black; }
.player-message { margin: 18px 24px; font-size: .85rem; line-height: 1.5; color: #ccc; }
.player-original { display: inline-block; margin: 0 24px; padding: 12px 0; color: var(--lime); }
@media(max-width:760px) {
  .recipe-dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .reader-toolbar { padding: calc(6px + env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) 6px max(18px,env(safe-area-inset-left)); }
  .reader-photo { height: 260px; }
  .reader-heading { padding: 24px 20px 14px; }
  .reader-nav { padding: 0 20px 10px; gap: 20px; }
  .reader-body { display: flex; flex-direction: column; gap: 32px; padding: 25px 20px calc(36px + env(safe-area-inset-bottom)); }
  .reader-body section { scroll-margin-top: calc(80px + env(safe-area-inset-top)); }
  .reader-player { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
