/* Tischzeit 0.4: a working kitchen, with the task before the tools.
   The existing green / copper identity and local typefaces stay unchanged. */
:root{--nav-height:78px;--dock-height:72px;--touch-size:44px}
html{scroll-padding-bottom:180px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:280px;overflow-wrap:break-word}
button{touch-action:manipulation}
button:focus-visible,a:focus-visible{outline-offset:3px}
input,select,textarea{font-size:1rem;min-width:0}
input[type=date],input[type=time],input[type=datetime-local]{min-width:0;max-width:100%}
.topbar{padding-top:calc(20px + env(safe-area-inset-top));padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right))}
.top-actions{min-width:0}.brand{flex-shrink:0}.brand-wordmark{letter-spacing:-.03em}
#main{padding-bottom:calc(110px + env(safe-area-inset-bottom));padding-left:max(28px,env(safe-area-inset-left));padding-right:max(28px,env(safe-area-inset-right))}
.has-timers #main{padding-bottom:calc(190px + env(safe-area-inset-bottom))}
.bottom-nav{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));min-height:var(--nav-height)}
.nav-item{min-height:54px}.text-button{min-height:var(--touch-size)}
.page-title h1{font-size:clamp(2.35rem,4.8vw,3.5rem)}
.browse-page .page-title{margin-bottom:22px}.browse-page .page-title p{font-size:.95rem;margin-top:10px}
.browse-tools{margin-bottom:14px}.browse-tools .search input{border-radius:14px}
.category-line{display:flex;align-items:center;gap:10px;min-width:0;border-bottom:1px solid var(--line);margin-bottom:14px}
.category-line .chips{flex:1;min-width:0;margin:0;padding:4px 0 12px;scroll-padding-inline:14px}
.category-line>.text-button{flex-shrink:0;font-size:.78rem;padding:8px 0 12px}
.category-picker{display:flex;flex-wrap:wrap;gap:10px}.category-picker .chip{min-height:44px}
.browse-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;font-size:.8rem;color:var(--muted);flex-wrap:wrap}
.browse-summary .text-button{font-size:.8rem}.sort-field{margin-left:auto;max-width:175px}.sort-field select{min-height:40px;padding:8px 12px;font-size:.8rem;border-radius:10px}
.community-shelf{border-block:1px solid var(--line);margin:0 0 22px;padding:0;background:var(--surface);border-radius:12px;overflow:hidden}
.community-shelf>summary{padding:14px 18px;cursor:pointer;font-weight:750;font-size:.9rem;min-height:48px}
.community-shelf>summary>span{font-size:.75rem;color:var(--muted);font-weight:500;margin-left:10px}
.community-shelf .community-section{margin:0;border:0;border-radius:0}
.recipe-copy h2{line-height:1.12}.recipe-copy{padding:20px}.recipe-image{aspect-ratio:1.5}
.recipe-open:hover img{transform:scale(1.015)}
.detail-hero{gap:28px}.detail-hero h1{line-height:1.06}.detail-hero .facts{font-size:.9rem;gap:12px 20px}
.detail-top{gap:16px}.detail-top .text-button{display:inline-flex;align-items:center;gap:6px;text-align:left}
.shared-status{display:flex;align-items:center;justify-content:space-between;gap:15px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:12px;padding:8px 14px;background:var(--surface);font-size:.8rem;line-height:1.6;margin:0 0 22px}
.shared-status .text-button{font-size:.8rem;flex-shrink:0}.shared-status.pending{border-left-color:var(--gold)}.shared-status.error,.shared-status.conflict{border-left-color:#b84e39}
.personal-status{padding-inline:4px;font-size:.8rem}.week-controls{gap:10px}
.day-heading button{width:44px;height:44px;min-width:44px}.day.today{border-top-width:3px}
.meal .actions .text-button{padding-inline:5px}
.meal-recipe-field{margin:20px 0}.meal-recipe-field>span{font-size:.9rem;font-weight:650}.meal-recipe-field small{font-weight:400;color:var(--muted)}
.meal-recipe-field .actions{margin:10px 0}.meal-recipe-field .button{text-align:left;justify-content:flex-start;line-height:1.5;max-width:100%;overflow-wrap:anywhere}
.recipe-picker-results{display:grid;gap:8px}.picker-count{font-size:.8rem;color:var(--muted);margin:12px 0}
.recipe-picker-choice{display:flex;align-items:center;gap:14px;justify-content:space-between;text-align:left;width:100%;min-height:68px;padding:16px;background:var(--paper);border:1px solid var(--line);border-radius:12px}
.recipe-picker-choice strong{display:block;line-height:1.45}.recipe-picker-choice small{display:block;color:var(--muted);font-size:.75rem;margin-top:5px}.recipe-picker-choice>span:last-child{font-size:1.5rem;color:var(--accent)}
.picker-footer,.form-submit-footer{position:sticky;bottom:-26px;background:var(--surface);border-top:1px solid var(--line);padding:16px 0 6px;margin-top:20px;z-index:2}
.picker-footer .button,.form-submit-footer .button{width:100%}
.cook-grid{gap:30px;align-items:start}.cook-task{min-width:0}.cook-task h1{font-size:clamp(2.2rem,4.2vw,3.7rem);line-height:1.08;margin:12px 0 18px}
.cook-instruction{font-size:1.15rem;line-height:1.75;max-width:65ch;margin-bottom:22px}
.cook-task .progress{margin-bottom:20px;height:5px}.step-caption{margin-bottom:10px}
.cook-ingredients{margin-top:24px;padding:20px}.cook-ingredients-head{justify-content:flex-end}
.cook-ingredients-head .field{min-width:0;width:100%;max-width:100%;margin:0;flex-direction:row;align-items:center;justify-content:space-between;gap:12px}.cook-ingredients-head .field>span{font-size:.8rem}.cook-ingredients-head select{width:170px;max-width:52%}
.cook-step-ingredients{margin-top:16px}.cook-step-ingredients h2{font-size:1.65rem}.cook-step-ingredients-list{font-size:1.02rem;line-height:1.7}
.cook-step-ingredients .cook-ingredient-note{font-size:.8rem}.cook-all-ingredients summary{min-height:44px;display:flex;align-items:center;font-weight:700;cursor:pointer}
.timer-panel{padding:22px}.timer-panel .big-clock{font-size:clamp(3rem,5vw,4.2rem);margin:18px 0}.timer-panel .actions{margin:16px 0}
.timer-panel>p:not(.timer-limitation){font-size:.85rem;color:var(--muted)}
.timer-limitation{font-size:.75rem;line-height:1.6;color:var(--muted);margin:14px 0}
.timer-panel .wide{width:100%;margin-top:6px}.timer-panel>.text-button{display:block;margin:5px auto 0;font-size:.8rem}
.timer-dock{position:fixed;bottom:calc(var(--nav-height) + env(safe-area-inset-bottom) + 8px);left:50%;transform:translateX(-50%);display:flex;gap:6px;width:calc(100% - 24px);max-width:520px;z-index:11;padding:5px;background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 6px 24px #102d2820}
.timer-dock .timer-mini{min-width:0;width:auto;flex:1;gap:10px;padding:11px 12px;border-radius:11px;box-shadow:none}
.timer-copy{min-width:0;flex:1;text-align:left}.timer-copy b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8rem;line-height:1.5}.timer-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.65rem;line-height:1.5}
.timer-mini strong{flex-shrink:0;white-space:nowrap;font-family:JetBrains;font-size:.9rem}.timer-mini .timer-dot{width:7px;height:7px;background:currentColor;border-radius:50%;flex:0 0 7px;opacity:.65}
.timer-mini .timer-copy b,.timer-mini .timer-copy small{max-width:none}
.timer-overview-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;flex:0 0 70px;background:var(--soft);border-radius:11px;color:var(--ink);min-height:52px}
.timer-overview-button b{font-family:JetBrains;font-size:1.1rem}.timer-overview-button span{font-size:.65rem;font-weight:700}
.timer-dock-control{display:grid;place-items:center;flex:0 0 44px;min-height:48px;background:var(--soft);color:var(--accent);border-radius:11px;font-size:1.25rem}.timer-dock-control svg{width:25px;height:25px}
.timer-board{display:grid;gap:12px;margin:20px 0}.timer-board-card{display:flex;gap:14px;align-items:center;padding:18px;background:var(--soft);border:1px solid var(--line);border-radius:14px;text-align:left;min-height:84px}
.timer-board-card .timer-copy b,.timer-board-card .timer-copy small{white-space:normal;overflow-wrap:anywhere}.timer-board-card .timer-copy b{font-size:1rem}.timer-board-card .timer-copy small{font-size:.8rem}.timer-board-card>strong{font-family:JetBrains;font-size:1.3rem;white-space:nowrap}
.timer-board-card.timer-due,.timer-mini.timer-due{border-color:#b84e39;background:#71382e;color:#fff}.timer-board-card.timer-due small{color:#fff1e6}
body[data-page=portal] .timer-dock{bottom:calc(18px + env(safe-area-inset-bottom))}
.preview-nav{gap:10px}.preview-nav .chip{min-height:44px;white-space:normal;text-align:left;line-height:1.5}
.ingredient-editor-row{margin:16px 0;padding:18px;border:1px solid var(--line);border-radius:14px;min-width:0;background:var(--paper)}
.ingredient-editor-row legend{font-size:.8rem;font-weight:750;padding:0 7px;color:var(--accent)}
.ingredient-editor-fields{display:grid;grid-template-columns:minmax(65px,.75fr) minmax(70px,1fr) minmax(100px,2.5fr);gap:12px}
.ingredient-editor-fields label{display:flex;flex-direction:column;gap:7px;font-size:.8rem;font-weight:650;min-width:0}.ingredient-editor-fields input{padding:12px;min-height:48px}
.ingredient-note{grid-column:1/-1}.ingredient-note small{font-weight:400;color:var(--muted)}.ingredient-remove{display:block;margin:10px 0 0 auto;font-size:.8rem;color:#923f30}.ingredient-add{width:100%}
.ingredient-editor-status{margin:8px 0 20px;min-height:1.5em}.ingredient-editor .subtle{font-size:.8rem}
.shopping-summary{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;font-size:.85rem;margin:20px 0 8px}.shopping-summary .text-button{font-size:.8rem}
.shopping-list{gap:24px;margin-top:16px}.shopping-category-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;border-bottom:2px solid var(--line);padding:12px 0;margin-bottom:14px}
.shopping-category-head h2{font-size:1.65rem;margin:0}.shopping-category-head>span{font-size:.75rem;color:var(--muted)}
.shopping-category-items{display:grid;gap:10px}.shopping-group-row{display:block;padding:16px;border:1px solid var(--line)}
.shopping-row-main{display:flex;align-items:center;gap:14px;min-width:0}.shopping-check{display:grid;place-items:center;width:48px;height:48px;flex:0 0 48px;background:var(--paper);border:1px solid var(--line);border-radius:12px}
.shopping-check>span{width:24px;height:24px;border:2px solid var(--accent);border-radius:6px;display:grid;place-items:center;font-weight:900;color:var(--accent)}.shopping-check[aria-checked=true]>span{background:var(--accent);color:var(--surface)}
.shopping-name{min-width:0}.shopping-name strong{font-size:1rem}.shopping-name .shopping-amount{font-size:1rem;color:var(--accent);font-weight:750;margin-top:3px}
.shopping-name .shopping-source,.shopping-name .shopping-manual{font-size:.72rem;line-height:1.6;margin-top:4px}.shopping-name .shopping-manual{color:var(--accent)}
.shopping-item-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.shopping-edit{font-size:.75rem;padding:8px}.shopping-remove{width:44px;height:44px;font-size:1.45rem;background:transparent}
.shopping-contribution-count{font-size:.85rem;color:var(--muted);font-family:JetBrains}
.shopping-contributions{border-top:1px solid var(--line);margin:12px 0 0;padding-top:8px;font-size:.8rem}.shopping-contributions summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--accent);font-weight:650}
.shopping-contributions ul{list-style:none;margin:0;padding:0}.shopping-contributions li{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 0;border-top:1px solid var(--line)}
.shopping-contributions li>div:first-child{min-width:0}.shopping-contributions li span,.shopping-contributions li small{display:block;line-height:1.6;color:var(--muted);margin-top:3px}
.shopping-done{padding:16px;background:var(--soft);border-radius:14px}.shopping-done>summary{font-weight:750;min-height:44px;cursor:pointer;padding:8px 0}.shopping-all-done{padding:22px;border:1px solid var(--accent);border-radius:14px;font-weight:700;background:var(--soft)}
.shopping-explainer{font-size:.75rem}.shopping-group-row.checked{opacity:.8}
dialog{width:min(640px,calc(100vw - 28px));max-height:calc(var(--viewport-height,100dvh) - 32px - env(safe-area-inset-top));scroll-padding-block:20px;overscroll-behavior:contain}
dialog .dialog-head{position:sticky;top:-26px;z-index:3;background:var(--surface);padding:16px 0;border-bottom:1px solid var(--line)}
dialog .dialog-head h2{font-size:1.8rem;line-height:1.15}.dialog-head .icon-button{flex-shrink:0}
form[aria-busy=true]{cursor:progress}form[aria-busy=true] [type=submit]{opacity:.8}
.keyboard-open .bottom-nav,.keyboard-open .timer-dock{display:none}
.keyboard-open #main{padding-bottom:32px}.keyboard-open dialog{max-height:calc(var(--viewport-height,100dvh) - 20px)}
@media(max-width:850px){
  .cook-grid{grid-template-columns:1fr;gap:20px}.cook-grid .timer-panel{grid-row:auto;position:static}
  .cook-task h1{font-size:2.45rem}.cook-task .progress{margin-bottom:16px}
  .cook-instruction{font-size:1.08rem;line-height:1.75}.timer-panel .big-clock{font-size:3rem}
  .timer-panel{display:block}.timer-panel>.eyebrow{margin-bottom:8px}.timer-panel .big-clock{margin:8px 0 12px}
}
@media(max-width:580px){
  .topbar{padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));gap:12px}
  .brand{gap:8px}.brand .tischzeit-mark{width:38px;height:38px}.brand .brand-wordmark{font-size:1.45rem}.brand-wordmark b{font-size:.5rem}
  .top-actions{gap:8px}.top-actions .icon-button{width:44px;height:44px}.switch{font-size:.73rem;min-height:44px;line-height:1.35;max-width:85px}
  #main{padding:24px max(18px,env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
  .has-timers #main{padding-bottom:calc(190px + env(safe-area-inset-bottom))}
  .browse-page .page-title{margin-bottom:18px}.browse-page .page-title .eyebrow{font-size:.7rem;margin-bottom:8px}.browse-page .page-title h1{font-size:2.35rem}.browse-page .page-title p{font-size:.85rem;margin-top:8px}
  .browse-tools{gap:10px}.browse-tools .search{flex-basis:100%}.browse-tools .button{width:100%;min-height:44px;background:var(--soft);color:var(--accent)}
  .category-line{gap:8px}.category-line .chip{font-size:.8rem;min-height:44px;padding:9px 14px}.category-line>.text-button{font-size:.73rem}
  .browse-summary{gap:8px;margin-bottom:16px}.sort-field{max-width:156px}.sort-field select{font-size:.75rem}
  .community-shelf>summary{padding:12px 14px;font-size:.85rem}.community-shelf>summary>span{font-size:.72rem;margin-left:6px}
  .recipe-image{aspect-ratio:1.8}
  .recipe-copy h2{font-size:1.9rem}.recipe-copy{padding:20px}.recipe-grid{gap:18px}
  .detail-hero .actions .button{min-height:50px}.detail-hero>img{aspect-ratio:1.65}.detail-hero{gap:20px}.detail-hero h1{font-size:2.5rem}.detail-hero .eyebrow{font-size:.7rem}
  .cook-task h1{font-size:2.3rem}.cook-task .eyebrow{font-size:.7rem}.cook-instruction{font-size:1.04rem}
  .cook-ingredients{padding:16px;margin-top:20px}.cook-ingredients-head .field{width:100%}.cook-step-ingredients{padding:16px;margin-top:16px}.cook-step-ingredients h2{font-size:1.5rem}
  .timer-panel{padding:20px}.timer-panel .actions .button{flex:1}.timer-panel .big-clock{font-size:2.8rem}
  .timer-dock{bottom:calc(var(--nav-height) + env(safe-area-inset-bottom) + 5px);width:calc(100% - 20px)}.timer-dock .timer-mini{padding:10px;gap:8px}
  .timer-overview-button{flex-basis:64px}.timer-copy b{font-size:.75rem}.timer-copy small{font-size:.63rem}.timer-mini strong{font-size:.85rem}.timer-dot{display:none}
  .timer-board-card{padding:16px;gap:12px}.timer-board-card .timer-copy b{font-size:.93rem}.timer-board-card>strong{font-size:1.1rem}
  .ingredient-editor-row{padding:14px}.ingredient-editor-fields{grid-template-columns:1fr 1fr;gap:10px}.ingredient-name,.ingredient-note{grid-column:1/-1}
  .shopping-group-row{padding:14px}.shopping-row-main{gap:12px;flex-wrap:wrap}.shopping-name{flex:1;min-width:120px}.shopping-item-actions{margin-left:auto}
  .shopping-row-main>.shopping-item-actions{padding-left:60px;width:100%;justify-content:flex-end;margin-top:-6px}
  .shopping-source{max-width:100%}.shopping-category-head h2{font-size:1.5rem}
  .shared-status{font-size:.75rem;padding:8px 12px;gap:12px}.shared-status .text-button{font-size:.75rem}
  .week-controls h2{font-size:1.35rem}.week-controls .icon-button{width:44px;height:44px;flex-shrink:0}
  .week-grid{gap:24px}.meal{padding:18px}.day-heading h3{font-size:1.5rem}
  .form-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.form-row input,.form-row select{font-size:1rem}
  dialog{padding:20px;max-height:calc(var(--viewport-height,100dvh) - 24px - env(safe-area-inset-top))}.dialog-head h2{font-size:1.7rem}dialog .dialog-head{top:-20px;padding:10px 0}
  .picker-footer,.form-submit-footer{bottom:-20px;padding-bottom:2px}.recipe-picker-choice{padding:14px}
  .bottom-nav{padding-inline:max(8px,env(safe-area-inset-left));gap:0}.nav-item{min-width:0;width:25%;padding:8px 4px;font-size:.7rem}
}
@media(max-width:360px){
  .topbar{gap:8px}.brand .brand-wordmark{font-size:1.3rem}.brand .tischzeit-mark{width:32px;height:34px}.top-actions{gap:5px}.top-actions .icon-button{width:40px;height:44px}.switch{max-width:58px;font-size:.68rem}
  .browse-page .page-title h1{font-size:2.15rem}.browse-summary .sort-field{max-width:142px}.cook-task h1{font-size:2.1rem}
  .timer-mini strong{font-size:.78rem}.timer-overview-button{flex-basis:59px}.timer-copy b{font-size:.71rem}
  .shopping-contributions li{align-items:flex-start;flex-direction:column}.shopping-contributions .shopping-item-actions{align-self:flex-end}
}
@media(orientation:landscape) and (max-height:550px){
  .topbar{padding-block:8px}.bottom-nav{min-height:60px}.nav-item{padding-block:5px}.nav-item svg{width:20px;height:20px}:root{--nav-height:62px}
  .timer-dock{max-width:440px}.timer-dock .timer-mini{padding-block:7px}.timer-overview-button{min-height:44px}dialog{max-height:calc(var(--viewport-height,100dvh) - 16px)}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}
}
