/* Inherit browser preferences, and opt into iOS Dynamic Type where available.
   Keep this stylesheet last: legacy root and form pixel sizes must not win. */
html:root { font-size:100%; }
@supports (font: -apple-system-body) {
  html:root { font:-apple-system-body; }
}
body { line-height:1.5; }
#app,#login,.sheet,.recipe-dialog,.setup-page { overflow-wrap:anywhere; }
input,textarea,select { max-width:100%; }
.library-tools input,.library-tools select,.organise-form select,
.category-create-row input,.editor-field input,.editor-field textarea,
.field input,.field textarea { font-size:max(1rem,16px); }
.control.control { font-size:.94rem; max-width:100%; white-space:normal; }
.control-label { overflow-wrap:anywhere; }
.control.control--icon { font-size:1rem; }
.library-topbar { min-height:104px; }
.library-topbar h1 { flex:0 0 auto; min-width:0; max-width:100%; }
.collection-head,.reader-toolbar,.reader-edit-row,.editor-toolbar { flex-wrap:wrap; }
.collection-head { gap:8px; }
.collection-actions,.reader-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
#week-filter[aria-pressed="true"],[data-week][aria-pressed="true"] { color:var(--green); font-weight:750; }
.shopping-sheet { padding:20px; width:min(560px,calc(100% - 24px)); max-height:min(88dvh,760px); overflow:auto; }
.shopping-sheet .dialog-head { padding:0 0 14px; }
.shopping-items { border-top:1px solid var(--line); }
.shopping-item { display:grid; grid-template-columns:26px minmax(0,1fr); gap:12px; align-items:start; padding:14px 2px; border-bottom:1px solid var(--line); cursor:pointer; }
.shopping-item input { width:22px; height:22px; margin:1px 0 0; accent-color:var(--green); }
.shopping-item span,.shopping-item strong,.shopping-item small { display:block; min-width:0; }
.shopping-item strong { font-size:1rem; }
.shopping-item small { margin-top:3px; color:var(--muted); font-size:.82rem; line-height:1.35; }
.shopping-item.is-checked span { opacity:.48; text-decoration:line-through; }
.shopping-actions { display:flex; justify-content:space-between; gap:10px; padding-top:16px; }
@media(max-width:760px) { .shopping-sheet { width:100%; max-width:none; max-height:92dvh; margin:auto 0 0; border-radius:24px 24px 0 0; padding:16px 20px calc(20px + env(safe-area-inset-bottom)); } }
.reader-toolbar .toolbar-label { overflow-wrap:anywhere; min-width:0; }
.reader-toolbar .reader-watch { max-width:100%; }
.reader-heading h2,.reader-player h2,.login-card h1,.dialog-head h2,.setup-page h1 { overflow-wrap:anywhere; }
.reader-nav .control,.reader-byline,.reader-hint,.reader-footer,
.card-source,.card-meta,.library-tools label>span,.category-hint,
.category-choices label,.category-create label,.editor-field,
.editor-intro,.editor-hint,.ingredient-evidence summary,.ingredient-name small { font-size:.88rem; }
.reader-organise>summary { font-size:.88rem; }
.organise-form { min-width:0; overflow-wrap:anywhere; }
.ingredient-check { grid-template-columns:22px minmax(0,1fr) minmax(0,7rem); }
.ingredient-amount { max-width:100%; }
.ingredient-amount.is-missing { white-space:normal; }
.reader-steps { min-width:0; }
.reader-steps>li { grid-template-columns:1.8rem minmax(0,1fr); }
.reader-steps>li:before { width:1.6rem; height:1.6rem; }
.category-choices { grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr)); max-height:min(50dvh,22rem); }
.category-create-row { flex-wrap:wrap; }
.category-create-row input { flex:1 1 10rem; }
.editor-ingredient-fields { grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr)); }
.editor-row-actions { gap:4px; }
.editor-toolbar { gap:8px; }
.editor-toolbar h2 { overflow-wrap:anywhere; }
.editor-toolbar .control { flex-shrink:0; }
.reader-body { container-type:inline-size; container-name:recipe-body; }
@container recipe-body (max-width:275px) {
  .ingredient-check { grid-template-columns:22px minmax(0,1fr); }
  .ingredient-amount { grid-column:2; text-align:left; }
}
.recipe-grid { container-type:inline-size; container-name:recipe-list; }
@container recipe-list (max-width:13rem) {
  .recipe-card { grid-template-columns:minmax(0,1fr); }
}
.card-source,.card-meta,.card-placeholder,.reader-meta,.reader-footer { overflow-wrap:anywhere; }
.upload { flex-wrap:wrap; }
.upload>span:last-child { min-width:0; overflow-wrap:anywhere; }
.dialog-head>div { min-width:0; }
.setup-page code { overflow-wrap:anywhere; white-space:pre-wrap; }
/* System text enlargement is not browser zoom: leave pinch/page zoom enabled. */
.dish-group { grid-column:1/-1; min-width:0; border-bottom:1px solid var(--line); }
.dish-group>summary { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:center; gap:14px; padding:18px 0; cursor:pointer; min-height:64px; list-style:none; }
.dish-group>summary.has-cover { grid-template-columns:64px minmax(0,1fr) 44px; }
.dish-group>summary::-webkit-details-marker { display:none; }
.dish-group>summary::after { content:'+'; color:var(--green); font-size:1.4rem; width:44px; min-height:44px; display:grid; place-items:center; }
.dish-group[open]>summary::after { content:'−'; }
.dish-group>summary img { width:64px; height:64px; object-fit:contain; border-radius:12px; background:#eeeee7; }
.dish-group>summary strong { min-width:0; font-size:1.1rem; overflow-wrap:normal; word-break:normal; hyphens:auto; }
@media(max-width:360px) { .dish-group>summary { gap:10px; } .dish-group>summary.has-cover { grid-template-columns:56px minmax(0,1fr) 44px; } .dish-group>summary img { width:56px; height:56px; } }
.dish-group-versions { padding-left:16px; border-left:2px solid var(--line); }
.dish-group-versions .recipe-card,.dish-group-versions .recipe-swipe { width:100%; }
.group-actions { display:flex; gap:10px; flex-wrap:wrap; }
