/* Soft pastel palette (ratios in TESTLOG.md round 13; every text pair >= 4.5:1, borders/focus >= 3:1)
   --text #4a3a44 charcoal-rose   --head #7a3d56 deep dusty rose (headings, timer)   --rose #9c4a68 links/results
   --muted #6b5662 notes   --pink #f8d7e3 primary buttons   --lav #ece4f7 secondary buttons   --mint #e9f6f0 tips
   --blush #fdf1f4 cautions   --peach #fdeee4 paused timer   --border #9a7486   --focus #a0526f (dusty rose, not purple) */
:root{--text:#4a3a44;--head:#7a3d56;--rose:#9c4a68;--muted:#6b5662;--pink:#f8d7e3;--pinkh:#f3c4d5;--lav:#ece4f7;--lavsoft:#f3eefa;--mint:#e9f6f0;--blush:#fdf1f4;--peach:#fdeee4;--line:#f1d9e3;--border:#9a7486;--focus:#a0526f;--hg1:#fbe3ec;--hg2:#ece4f7;--pill:#fdf3f7;--shadow:#9c4a6810;--err:#a3283f;--disbg:#f1edf0;--distext:#5e4f58;--disborder:#c9b9c2;--lavh:#e2d8f2;--adbg:#fbf8fa;--adtext:#5e4f58;--tipb:#5f9e86;--dangerbg:#fbe4ea;--dangerb:#9c4a68;--warnb:#c76b8f;--infob:#8f80ad}
*{box-sizing:border-box}
body{font-family:system-ui,sans-serif;margin:0;background:#fff;color:var(--text);line-height:1.45}
header{background:linear-gradient(90deg,var(--hg1),var(--hg2));color:var(--text);padding:1rem 1.5rem}header h1{color:var(--head)}header h1{margin:0}header p{margin:.25rem 0 0}
header nav{margin-top:.4rem;display:flex;flex-wrap:wrap;gap:0 .25rem;align-items:center}
header a{color:var(--text);font-weight:600;display:inline-flex;align-items:center;min-height:44px;padding:0 .35rem}header a[aria-current]{text-decoration:none;background:var(--pill);border-radius:6px}
a{color:var(--rose)}
h2,h3{color:var(--head)}
main{max-width:820px;margin:0 auto;padding:1rem}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:1rem 1.25rem;margin-bottom:1rem;box-shadow:0 2px 8px var(--shadow)}
.row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:.4rem 0}
label{font-size:.9rem}
input,select,textarea{font:inherit;color:var(--text);padding:.4rem .5rem;border:1px solid var(--border);border-radius:8px;background:#fff;min-height:44px}
input[type=text]{width:6rem}textarea{width:100%}
input[type=checkbox],input[type=radio]{width:24px;height:24px;min-height:0;margin:10px;accent-color:var(--rose);flex:none}
fieldset{border:1px solid var(--line);border-radius:10px;margin:.5rem 0}fieldset label{display:inline-flex;align-items:center;min-height:44px}
.out{font-weight:600;color:var(--rose)}.err{color:var(--err)}
.note,caption{font-size:.85rem;color:var(--muted)}caption{text-align:left}
summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--head);font-weight:600}
table{border-collapse:collapse;margin-top:.5rem}td,th{border-bottom:1px solid var(--line);padding:.25rem .6rem;text-align:left}
footer{text-align:center;font-size:.85rem;color:var(--muted);padding:1rem}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.skip{position:absolute;left:-999px}.skip:focus{left:1rem;top:1rem;background:#fff;color:var(--head);padding:.5rem;z-index:9}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
button{font:inherit;font-weight:600;min-height:44px;padding:.5rem 1rem;border:1px solid var(--border);border-radius:8px;background:var(--pink);color:var(--text);cursor:pointer}
@media (hover:hover){button:hover:not(:disabled){background:var(--pinkh)}}button:disabled{background:var(--disbg);color:var(--distext);border-color:var(--disborder);cursor:not-allowed}
button.secondary{background:var(--lav);color:var(--text);border:1px solid var(--border)}@media (hover:hover){button.secondary:hover:not(:disabled){background:var(--lavh)}}button.secondary:disabled{background:var(--disbg);color:var(--distext);border-color:var(--disborder)}
/* Ad placeholder: inline, not a pop-up. 320x50 mobile banner / 728x90 desktop leaderboard. */
.ad-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;max-width:728px;height:90px;margin:1.5rem auto;border:2px dashed var(--border);background:var(--adbg);color:var(--adtext);border-radius:8px;text-align:center}
.ad-slot .ad-size-mobile{display:none}
@media (max-width:767px){.ad-slot{max-width:320px;height:50px;margin:1.25rem auto}.ad-slot .ad-size-desktop{display:none}.ad-slot .ad-size-mobile{display:inline}.ad-slot span{font-size:.85rem}.ad-slot small{font-size:.7rem}}
.consent{align-items:flex-start;flex-wrap:nowrap}.consent label{flex:1 1 auto;min-width:0;padding-top:.6rem}
.tip{background:var(--mint);border-left:4px solid var(--tipb);color:var(--text);font-weight:400;padding:.45rem .65rem;border-radius:6px;font-size:.9rem}.tip.inline{display:block;margin:.15rem 0 .35rem}
#r-out .why{list-style:none;font-weight:400;font-size:.85rem;color:var(--muted);margin-top:.5rem}
.caution{background:var(--blush);border-left:4px solid var(--border);color:var(--text);font-weight:400;padding:.45rem .65rem;border-radius:6px;font-size:.9rem}
.caution.danger{background:var(--dangerbg);border-left-color:var(--dangerb)}.caution.warning{background:var(--blush);border-left-color:var(--warnb)}.caution.info{background:var(--lavsoft);border-left-color:var(--infob)}.caution.inline{display:block;margin:.15rem 0 .35rem}
.guide-table{width:100%;font-size:.92rem}.guide-table td:nth-child(n+3),.guide-table th:nth-child(n+3){text-align:right}.guide-table tbody th{font-weight:600;text-align:left}.table-wrap{overflow-x:auto;position:relative}
.guide-table tr.group td{background:var(--blush);color:var(--head);font-weight:700}ul.advice li{margin:.3rem 0}
.timer{display:flex;flex-direction:column;align-items:center;margin:.75rem 0;padding:.75rem;border-radius:12px;background:var(--blush)}
#tm-display{font-size:3rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--head)}
.timer.running{background:var(--lavsoft)}.timer.done{background:var(--dangerbg);animation:pulse 1s ease-in-out 3}.timer.paused{background:var(--peach)}
@keyframes pulse{50%{transform:scale(1.03)}}@media (prefers-reduced-motion:reduce){.timer.done{animation:none}}
.timer-buttons button{min-width:5.5rem}#p-notes{padding-left:1.2rem}
ol.schedule{padding-left:1.4rem}ol.schedule li{margin:.35rem 0}ol.schedule li.current{background:var(--lavsoft);border-radius:6px;padding:.2rem .4rem}ol.schedule .time{color:var(--rose);font-weight:600}
@media (max-width:480px){main{padding:.5rem}.card{padding:.75rem}select{max-width:100%}input[type=text]{width:5rem}#o-email{width:100%}#tm-display{font-size:2.5rem}}
@media (max-height:420px) and (orientation:landscape){header{padding:.5rem 1rem}header p:not(.ios-hint){display:none}#tm-display{font-size:2rem}.timer{padding:.4rem;margin:.4rem 0}}
.brand{display:inline-flex;align-items:center;gap:.5rem;min-height:44px;text-decoration:none;color:var(--head);padding:0}
.brand-name{font-family:Georgia,'Times New Roman',serif;font-size:1.35rem;font-weight:700;color:var(--head);letter-spacing:.01em}.brand .amp{color:var(--rose);font-style:italic}
header h1{font-size:1.6rem;margin-top:.15rem}.brand-foot{font-family:Georgia,serif;font-weight:700;color:var(--head)}
.theme-toggle{margin-left:auto;font-size:.85rem;padding:.35rem .75rem}
.theme-toggle .swatch{background:var(--pink);display:inline-block;width:14px;height:14px;border-radius:50%;margin-right:.35rem;vertical-align:-2px;border:1px solid var(--border)}
/* bulk / fold plan + guided fold timer (theme-aware: variables only) */
#gt-display{font-size:3rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--head)}.gt-step{font-weight:700;color:var(--rose);text-align:center}
.timer.alerting{background:var(--dangerbg);outline:3px solid var(--dangerb);animation:pulse 1s ease-in-out 3}@media (prefers-reduced-motion:reduce){.timer.alerting{animation:none}}
ol.gt-progress{display:flex;flex-wrap:wrap;gap:.35rem;list-style:none;padding:0;margin:.25rem 0 .5rem;justify-content:center}
ol.gt-progress li{font-size:.85rem;padding:.2rem .55rem;border-radius:999px;border:1px solid var(--border);background:#fff;color:var(--text)}
ol.gt-progress li.done{background:var(--mint);border-color:var(--tipb)}ol.gt-progress li.now{background:var(--pink);font-weight:700}
#gt-sets,#gt-int,#gt-rem,#tm-h,#tm-m{width:5.5rem}.fold-how{margin:.35rem 0}.fold-how strong{color:var(--head)}
@media (max-width:480px){#gt-display{font-size:2.5rem}}
/* starter manager */
.table-wrap{overflow-x:auto;max-width:100%;position:relative}#s-table{width:100%;font-size:.9rem}#s-table button{min-height:44px;padding:.3rem .7rem}
#s-count{font-size:2.4rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--head);text-align:center}
.filebtn{display:inline-flex;align-items:center;min-height:44px;padding:.5rem 1rem;border:1px solid var(--border);border-radius:8px;background:var(--lav);font-weight:600;cursor:pointer}
#s-import{position:absolute;opacity:0;width:1px;height:1px;overflow:hidden}.row:focus-within .filebtn{outline:3px solid var(--focus);outline-offset:2px}
#s-custom{width:7rem}#s-tips details{border-bottom:1px solid var(--line)}#s-tips p{margin:.2rem 0 .6rem}
@media (max-width:480px){#s-count{font-size:2rem}}
/* PWA: bottom nav only when installed (standalone); update banner; offline hint */
.pwa-update{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:center;margin:0;border-radius:0}
.offline header::after{content:"Offline: saved pages still work";display:block;font-size:.8rem;color:var(--text);margin-top:.25rem}
/* scaler: presets + pan pickers */
.btn-group{display:inline-flex;flex-wrap:wrap;gap:.35rem}.btn-group button{min-width:3.2rem;padding:.5rem .7rem}
.btn-group button[aria-pressed=true]{background:var(--pink);border-color:var(--rose);box-shadow:inset 0 0 0 2px var(--rose);color:var(--head)}
.indent{margin-left:2.6rem}.pan-pick{display:flex;flex-wrap:wrap;gap:.5rem 1.5rem}.pan-side{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}
.pan-custom input{width:4.5rem}[hidden]{display:none!important}
@media (max-width:480px){.indent{margin-left:0}}
/* scanner */
.scan{border:1px dashed var(--border);border-radius:10px;padding:.5rem .75rem;margin-bottom:.75rem;background:var(--pill)}
.scan-progress{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.scan-progress progress{flex:1;min-width:8rem;height:1rem;accent-color:var(--rose)}
#scan-table input{width:100%;min-width:4rem}#scan-table .sc-amt{width:5rem}#scan-table td{vertical-align:top}#scan-table tr.flagged td{background:var(--blush)}
#scan-table .flag{display:block;font-size:.8rem;color:var(--err);margin-top:.15rem}
@media (max-width:740px){#scan-table thead{display:none}#scan-table tr{display:grid;grid-template-columns:5.5rem 1fr;gap:.3rem;border-bottom:1px solid var(--line);padding:.4rem 0}#scan-table td{border:0;padding:0}#scan-table td:nth-child(3){grid-column:1/-1}#scan-table td:nth-child(4){grid-column:1/-1}}
/* guide tools */
.cmp-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.5rem;margin:.5rem 0}
.cmp{border:1px solid var(--line);border-radius:10px;padding:.5rem .7rem;background:#fff;display:flex;flex-direction:column;gap:.15rem}.cmp.same{background:var(--lavsoft);border-color:var(--border)}
.cmp-name{font-weight:600}.cmp-g{font-size:1.4rem;color:var(--head)}.cmp .bar{display:block;height:6px;border-radius:3px;background:var(--rose)}
.chips{display:flex;flex-wrap:wrap;gap:.35rem;margin:.35rem 0}.chip[aria-pressed=true]{background:var(--pink);border-color:var(--rose);box-shadow:inset 0 0 0 2px var(--rose);color:var(--head)}
#bs-packed[aria-pressed=true],#bs-loose[aria-pressed=true]{background:var(--pink);border-color:var(--rose);box-shadow:inset 0 0 0 2px var(--rose)}
.sub-cards{list-style:none;padding:0;margin:0;display:grid;gap:.5rem}.sub-card{border:1px solid var(--line);border-left:4px solid var(--border);border-radius:10px;background:#fff}
.sub-card.danger{border-left-color:var(--dangerb)}.sub-card.warning{border-left-color:var(--warnb)}.sub-card h3{margin:0}
.sub-toggle{width:100%;text-align:left;background:transparent;border:0;border-radius:10px;display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;padding:.6rem .8rem;color:var(--text)}
@media (hover:hover){.sub-toggle:hover:not(:disabled){background:var(--pill)}}.sub-title{color:var(--head);font-size:1rem}.sub-short{font-weight:400;font-size:.9rem}
.sub-toggle::after{content:"Show details ▾";font-size:.8rem;color:var(--rose);font-weight:600}.sub-toggle[aria-expanded=true]::after{content:"Hide details ▴"}
.sub-detail{padding:0 .8rem .7rem}.button-link{display:inline-flex;align-items:center;min-height:44px;padding:.4rem 1rem;border:1px solid var(--border);border-radius:8px;background:var(--pink);color:var(--text);font-weight:600;text-decoration:none}
/* proof step planner */
.slider-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin:.4rem 0}.slider-row input[type=range]{flex:1;min-width:12rem;min-height:44px;accent-color:var(--rose)}
.slider-row output{font-weight:700;color:var(--head);min-width:9rem}
ol.plan-steps{list-style:none;padding:0;margin:.5rem 0;display:grid;gap:.5rem;counter-reset:st}
.plan-step{border:1px solid var(--line);border-left:4px solid var(--border);border-radius:10px;background:#fff;counter-increment:st}
.plan-step[data-kind=bulk]{border-left-color:var(--rose)}.plan-step.is-done{background:var(--mint);border-left-color:var(--tipb)}.plan-step.is-done .plan-name{text-decoration:line-through}
.plan-head{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .5rem;padding:.25rem .5rem}
.plan-toggle{flex:1 1 14rem;text-align:left;background:transparent;border:0;display:flex;flex-direction:column;align-items:flex-start;padding:.4rem .3rem;color:var(--text)}
@media (hover:hover){.plan-toggle:hover:not(:disabled){background:var(--pill)}}.plan-name{color:var(--head)}.plan-name::before{content:counter(st) ". "}.plan-time{font-weight:400;font-size:.9rem}
.plan-toggle::after{content:"Tips ▾";font-size:.8rem;color:var(--rose)}.plan-toggle[aria-expanded=true]::after{content:"Hide tips ▴"}
.plan-done{display:flex;align-items:center}.done-label{min-height:44px;display:inline-flex;align-items:center;padding-right:.3rem}
.plan-tips{padding:0 .9rem .6rem}.plan-tips ul{margin:.2rem 0;padding-left:1.2rem}
.why-box summary{font-weight:600}
/* ---- Mobile hardening (iOS Safari / Android Chrome), see TESTLOG round 26 ---- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* iOS zooms into any focused field whose font is under 16px */
input,select,textarea{font-size:max(16px,1rem)}
/* tap: no grey flash box, no 300ms double-tap-zoom delay on controls */
a,button,input,select,textarea,label,summary{-webkit-tap-highlight-color:rgba(156,74,104,.15);touch-action:manipulation}
/* notch / home indicator (viewport-fit=cover): keep content out of the unsafe areas, incl. landscape side notches */
header{padding-left:max(1.5rem,env(safe-area-inset-left));padding-right:max(1.5rem,env(safe-area-inset-right));padding-top:max(1rem,env(safe-area-inset-top))}
main{padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right))}
footer{padding-bottom:max(1rem,env(safe-area-inset-bottom))}
@media (max-width:480px){main{padding-left:max(.5rem,env(safe-area-inset-left));padding-right:max(.5rem,env(safe-area-inset-right))}}
/* the on-screen keyboard pushes position:fixed bars up over the field being typed in: hide the bottom nav while typing */
.ios-hint{font-size:.9rem}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* 320px phones (iPhone SE 1st gen, Galaxy S9+ at default zoom): a 320×50 banner is wider than the padded column; centre it on the viewport */
@media (max-width:359px){.ad-slot{width:320px;max-width:none;margin-left:calc(50% - 160px);margin-right:0}}
/* 200% text on 320 px: fields and sliders shrink to the column instead of widening the page */
input,select,textarea{max-width:100%;min-width:0;box-sizing:border-box}
input[type=range]{width:100%}
.slider-row{flex-wrap:wrap}.slider-row input[type=range]{flex:1 1 10rem;min-width:0}
fieldset{min-width:0}
.cmp-grid{grid-template-columns:repeat(auto-fit,minmax(min(10rem,100%),1fr))}
.slider-row output{min-width:min(9rem,100%)}
.pan-pick,.pan-side{min-width:0;max-width:100%}.pan-side select{min-width:0;flex:1 1 auto}
@media (max-width:480px){.indent{margin-left:min(2.6rem,8%)}}
/* very large text on narrow screens: long words ("fermentation", "Measuring") wrap instead of widening the page */
h1,h2,h3,summary{overflow-wrap:anywhere;hyphens:auto}
p,li,td,th,label,legend,a,button,output,.note{overflow-wrap:break-word}
/* scan review on narrow screens / large text: rows become blocks that never exceed the column */
@media (max-width:740px){#scan-table,#scan-table tbody{display:block;width:100%}#scan-table tr{grid-template-columns:minmax(0,5.5rem) minmax(0,1fr)}#scan-table td{min-width:0}#scan-table input,#scan-table select{min-width:0;width:100%}}
@media (max-width:740px){#scan-table tr{grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr))}}
#scan-table button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media (max-width:480px){.pan-side{flex:1 1 100%}.pan-side select{width:100%}}
@media (max-width:480px){.pan-side{flex-direction:column;align-items:stretch}.pan-custom{min-width:0}.pan-custom input,.pan-custom select{flex:1 1 6rem}}
/* WebKit lays out the content of a closed <details> for scroll width: keep it out of layout, and keep scroll boxes inside their column */
details:not([open]) > :not(summary){display:none}
.table-wrap{max-width:100%;overflow-x:auto}
.note{overflow-wrap:anywhere}
/* WebKit sizes flex rows from the select's intrinsic width at large text: stack the pan pickers as plain blocks on phones */
@media (max-width:480px){.pan-pick,.pan-side{display:block}.pan-side>label{display:block}.pan-side>select{display:block;width:100%;margin:.25rem 0 .5rem}}
.frac-pick{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.35rem}.frac-btn{min-width:44px;min-height:44px;padding:.3rem .7rem;font-size:1rem}.frac-btn[aria-pressed=true]{background:var(--rose);color:#fff;border-color:var(--rose)}
.frac-btn[aria-pressed=true]::before{content:"✓ "}@media (hover:hover){button.frac-btn[aria-pressed=true]:hover{background:var(--head)}}
/* reserve the space script-filled results take, so the page doesn't jump when they appear (Lighthouse CLS) */
p.out:empty{min-height:1.5em}#g-cmp:empty{min-height:6.7rem}#g-cmp-note:empty{min-height:1.25rem}#r-out:empty{min-height:11.6rem}#s-caution:empty{min-height:6rem}
@media (max-width:380px){#g-cmp:empty{min-height:13.8rem}#g-cmp-note:empty{min-height:2.5rem}#s-caution:empty{min-height:11.3rem}}
#u-from,#u-to,#i-from,#i-to,#s-unit{width:9.5em}
/* script-filled selects: reserve their filled width so rows do not re-wrap (and shift) when options arrive */
#g-fam:empty{min-width:8.4em}#sl-from:empty,#i-ing:empty,#s-from:empty,#s-to:empty{min-width:15.7em}#p-bread:empty{min-width:13.1em}#p-stage:empty{min-width:12em}#p-yeast:empty{min-width:11.1em}#s-flour:empty{min-width:17.1em}#s-store:empty{min-width:15.9em}
select:empty{max-width:100%}
.unverified{color:var(--err);font-weight:600}.verified{color:var(--muted)}
#scan-table .flag.confirmed{color:var(--text)}
#r-out li{overflow-wrap:anywhere}
/* round 37: browser focus-scrolling keeps fields clear of the bottom nav, the home indicator and an open keyboard */
html{scroll-padding-bottom:calc(var(--kb-h,0px) + 1rem)}
#o-msg.pending{border:1px solid var(--border);border-left:4px solid var(--rose);background:#fff;padding:.6rem .75rem;border-radius:8px}#o-msg.pending strong{display:block;margin-bottom:.2rem}
.info-btn{min-height:44px;margin-left:.4rem;font-size:.9rem;padding:.3rem .7rem;background:#fff;color:var(--head);border:1px solid var(--border);border-radius:22px;font-weight:600}.ratio-help{background:var(--lavsoft);border:1px solid var(--border);border-radius:8px;padding:.5rem .8rem;margin:.4rem 0}.ratio-help ul{padding-left:1.2rem}.ratio-line{margin-top:.25rem}
.pl-when{border:1px solid var(--line);border-radius:8px;padding:.4rem .75rem;margin:.5rem 0}.pl-when .pl-opt{display:flex;align-items:center;gap:.4rem;min-height:44px;flex-wrap:wrap}.pl-when input[type=radio]{width:24px;height:24px;min-height:0;margin:0}
/* round 38: alarm panel (big Turn off, overdue count-up) and chime picker */
.alarm-panel{border:2px solid var(--rose);background:var(--blush);border-radius:12px;padding:.75rem 1rem;margin:.6rem 0;text-align:center}
.alarm-panel .overdue{font-size:1.35rem;font-weight:700;color:var(--head);margin:.2rem 0 .5rem;font-variant-numeric:tabular-nums}
.alarm-panel .alarm-buttons{justify-content:center}
.alarm-off{font-size:1.4rem;min-height:64px;min-width:12rem;padding:.6rem 1.5rem;background:var(--rose);color:#fff;border-color:var(--head);border-radius:12px}
.alarm-panel.ringing{animation:pm-pulse 1.2s ease-in-out infinite}
@keyframes pm-pulse{50%{box-shadow:0 0 0 6px var(--pink)}}
@media (prefers-reduced-motion:reduce){.alarm-panel.ringing{animation:none}}
.chime-row select{min-width:min(9rem,100%);max-width:100%}
/* round 38: collapsible sections */
html.pm-collapse main section.card[aria-labelledby]>:not(:first-child){display:none}
html.pm-collapse:not(.pm-sections-ready) main>section.card[aria-labelledby]:first-of-type>:not(:first-child){display:revert}
html.pm-collapse main section.card.is-open>*{display:revert}
html.pm-collapse main section.card.is-open>.sec-body{display:block}
html.pm-collapse main section.card[aria-labelledby]>:first-child:not(.sec-head){margin:0;font-size:1.25rem;min-height:48px;box-sizing:border-box;display:flex;align-items:center;padding:.35rem 3.25rem .35rem .25rem}
.sec-body[hidden]{display:none!important}
h2.sec-head{margin:0}
.sec-toggle{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;min-height:48px;padding:.35rem .25rem;cursor:pointer;font:inherit;color:var(--head);border-radius:8px}
.sec-toggle:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.sec-toggle .chev{flex:none;width:2.25rem;height:2.25rem;border:1px solid var(--border);border-radius:50%;background:var(--pink);position:relative}
.sec-toggle .chev::before{content:"";position:absolute;left:50%;top:45%;width:.55rem;height:.55rem;border-right:2.5px solid var(--head);border-bottom:2.5px solid var(--head);transform:translate(-50%,-50%) rotate(45deg)}
.sec-toggle[aria-expanded=true] .chev::before{top:58%;transform:translate(-50%,-50%) rotate(-135deg)}
section.card.is-open>h2.sec-head{margin-bottom:.4rem}
@media (hover:hover){.sec-toggle:hover .chev{background:var(--pinkh)}}

/* round 38: centred app header (icon, name below) + sticky top tab bar that replaces the bottom nav */
header.app-head{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:.35rem}
header.app-head .brand{flex-direction:column;gap:.15rem;padding:.1rem .5rem}
header.app-head .brand img{width:64px;height:64px;border-radius:14px}
header.app-head .brand-name{font-size:1.45rem}
.head-tools{position:absolute;top:max(.4rem,env(safe-area-inset-top));right:max(.5rem,env(safe-area-inset-right));display:flex;flex-direction:column;align-items:flex-end;gap:.3rem}
.head-tools button{min-height:44px;font-size:.85rem;padding:.3rem .6rem}
@media (max-width:520px){.head-tools .theme-toggle .label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.head-tools .theme-toggle{min-width:44px}}
header.app-head .ios-hint{max-width:32rem;margin:.3rem auto 0}
.tabbar{position:sticky;top:0;z-index:30;display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;background:var(--hg1);border-top:1px solid var(--line);border-bottom:1px solid var(--line);box-shadow:0 2px 6px var(--shadow);padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left)}
.tabbar a{flex:1 0 auto;min-width:min-content;display:flex;align-items:center;justify-content:center;min-height:48px;padding:.25rem .35rem;text-align:center;font-weight:600;font-size:.95rem;color:var(--text);text-decoration:none;overflow-wrap:normal;word-break:normal;hyphens:none;line-height:1.15;border-bottom:4px solid transparent}
.tabbar a[aria-current=page]{color:var(--head);background:var(--pink);border-bottom-color:var(--rose)}
@media (hover:hover){.tabbar a:not([aria-current]):hover{background:var(--lavsoft)}}
.tabbar a:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
html{scroll-padding-top:calc(var(--tab-h,50px) + .5rem)}
html.kb-vv .tabbar{position:static}
.page-intro{margin:.25rem 0 .9rem}.page-intro h1{color:var(--head);font-size:1.5rem;margin:.2rem 0}.page-intro p{margin:.2rem 0 0;color:var(--muted)}
@media (max-height:420px) and (orientation:landscape){header.app-head{flex-direction:row;justify-content:center;padding:.3rem 1rem}header.app-head .brand{flex-direction:row}header.app-head .brand img{width:40px;height:40px}.tabbar a{min-height:44px}}
main.swipe-next{animation:pm-swl .18s ease-in forwards}main.swipe-prev{animation:pm-swr .18s ease-in forwards}
@keyframes pm-swl{to{transform:translateX(-24px);opacity:.4}}@keyframes pm-swr{to{transform:translateX(24px);opacity:.4}}
@media (prefers-reduced-motion:reduce){main.swipe-next,main.swipe-prev{animation:none}}
.sec-title{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}h2.sec-head{font-size:1.25rem}

/* Round 39: longer tab names wrap onto two lines; narrow screens use smaller type; at large text sizes the bar scrolls sideways (current tab scrolled into view by nav.js) */
@media (max-width:420px){.tabbar a{font-size:.82rem;padding:.25rem .25rem}}
.brand-by{display:block;font-size:.85rem;font-weight:600;color:var(--muted);letter-spacing:.01em}
@media (max-height:420px) and (orientation:landscape){header.app-head .brand{flex-wrap:wrap;justify-content:center}.brand-by{flex-basis:100%;text-align:center}}
.yt-block{display:flex;flex-direction:column;align-items:center;gap:0;margin:1.5rem auto 1rem;padding:0 .5rem;text-align:center;position:relative;z-index:1}
/* Round 40: official YouTube Icon. Brand rules: no recolouring/effects/distortion (fixed 48x34, aspect of the official artwork, no filters,
   no shadow, no hover change); clear space ≥ icon height (34 px) on all sides = the link's padding; minimum height 20 dp (we use 34 px).
   The focus ring sits on the outer edge of the clear space, so it never touches the icon. */
.yt-btn{display:inline-block;line-height:0;padding:34px;border-radius:12px;text-decoration:none;background:transparent}
.yt-btn .yt-icon{display:block;width:48px;height:34px;filter:none;box-shadow:none;transform:none}
.yt-btn:focus-visible{outline:3px solid var(--focus);outline-offset:0}
.yt-name{margin:0 0 .25rem;font-weight:600;color:var(--head)}.yt-handle{display:block;font-weight:400;font-size:.9rem;color:var(--muted)}
.update-toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(.75rem,env(safe-area-inset-bottom)) + var(--kb-h,0px));z-index:60;max-width:min(30rem,calc(100% - 1.5rem));background:#fff;color:var(--text);border:2px solid var(--rose);border-radius:12px;padding:.5rem .75rem;box-shadow:0 4px 16px #0003}
.update-toast button{min-height:44px}
/* Round 41: flour blend editor */
fieldset.blend{border:1px solid var(--line);border-radius:10px;padding:.5rem .75rem .75rem;margin:.75rem 0}
fieldset.blend.invalid{border-color:var(--err)}
.blend-row{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .5rem;padding:.45rem 0;border-bottom:1px dashed var(--line)}
.blend-row select{max-width:100%}.blend-row .bl-val{width:6rem}.blend-row .bl-name{width:10rem;max-width:calc(100vw - 4rem);min-width:0;box-sizing:border-box}
.bl-name-wrap{display:inline-flex;flex-wrap:wrap;align-items:center;gap:.35rem;max-width:100%;min-width:0}
.blend-row .bl-err{flex-basis:100%;margin:.1rem 0 0}
.blend-total{font-weight:600}.blend-err{font-weight:600;margin:.3rem 0}
.blend-unit label{display:inline-flex;align-items:center;gap:.3rem;min-height:44px}
.blend-unit input[type=radio]{width:24px;height:24px}
