/* v5.0.1 — iPhone safe areas, non-overflowing planner inputs and recipe chooser. */
/* Keep this sheet after v5.css; don't hide horizontal overflow as a substitute for fixing widths. */
body.v5-ready .shell,body.v5-ready .shell *,body.v5-ready #v5-root *{box-sizing:border-box}
body.v5-ready .shell{width:100%;max-width:1020px}
#v5-root,#v5-root .v5-content,#v5-root .v5-card,#v5-root .v5-grid,#v5-root .v5-hero{min-width:0;max-width:100%}
#v5-root .v5-field,#v5-root .v5-dishline,#v5-root .v5-dishline>div{min-width:0}
#v5-root .v5-input{box-sizing:border-box;min-width:0;max-width:100%;width:100%}
#v5-root input[type=date],#v5-root input[type=time]{min-width:0;display:block;max-width:100%;font-size:16px}
#v5-root .v5-top{min-width:0}
#v5-root .v5-brand{flex:1;min-width:0}
#v5-root .v5-brand>div{min-width:0}
#v5-root .v5-title{overflow-wrap:anywhere}
#v5-root .v5-top>.v5-chip{flex:0 0 auto;max-width:116px;overflow-wrap:anywhere}
#v5-root .v5-recipe-name,#v5-root .v5-dishline strong{overflow-wrap:anywhere}
#v5-root .v5-dishline{flex-wrap:wrap}
#v5-root .v5-dishline select{width:auto;min-width:106px;max-width:100%;flex:0 1 132px}
#v5-root .v5-sticky-actions{max-width:100%}
/* The legacy back action is inside the scroll column, not fixed across inputs or the iPhone status bar. */
body.v5-ready #v5-back{position:sticky;top:max(10px,env(safe-area-inset-top,0px));right:auto;left:auto;z-index:390;display:none;width:max-content;max-width:calc(100% - 22px);padding:8px 12px;min-height:37px;border-radius:999px;font-size:13px;margin:5px 0 14px auto;box-shadow:0 4px 12px #0007}
body.v5-ready.v5-legacy #v5-back{display:inline-flex!important}
body.v5-ready.v5-legacy .intro,body.v5-ready.v5-legacy .shell>main{max-width:100%;min-width:0}
body.v5-ready.v5-legacy .v47-page,body.v5-ready.v5-legacy .v47-fold,body.v5-ready.v5-legacy .v47-fold>*,body.v5-ready.v5-legacy .layout-top,body.v5-ready.v5-legacy .setup,body.v5-ready.v5-legacy .section-header,body.v5-ready.v5-legacy .section-actions{min-width:0;max-width:100%}
body.v5-ready.v5-legacy :is(input:not([type=checkbox]):not([type=radio]),select,textarea){box-sizing:border-box;max-width:100%}
body.v5-ready.v5-legacy .section-header{flex-wrap:wrap}
body.v5-ready.v5-legacy #add-area{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:8px;width:100%}
body.v5-ready.v5-legacy #add-area>*{width:100%;min-width:0;max-width:100%!important}
body.v5-ready.v5-legacy #v47-planning .formgrid,
body.v5-ready.v5-legacy #v47-planning .setup-grid{min-width:0}
/* Recipe choices share existing recipe panels, so generator/approval/catalog behavior is unchanged. */
#v47-recipes [hidden]{display:none!important}
#v47-recipes .v501-recipe-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:4px 0 18px;min-width:0;width:100%}
#v47-recipes .v501-recipe-choice{min-width:0;width:100%;min-height:77px;padding:12px 7px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;font:750 13px/1.3 system-ui,-apple-system,sans-serif;white-space:normal;overflow-wrap:anywhere;color:#d8e6e4;background:#192d32;border:1px solid #496069;border-radius:13px;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#v47-recipes .v501-recipe-choice[aria-selected=true]{background:#385147;color:#f2ffe9;border-color:#92bcaa;box-shadow:inset 0 -3px 0 #9ee3be}
#v47-recipes .v501-recipe-choice:focus-visible{outline:3px solid #f2a561;outline-offset:2px}
#v47-recipes .v501-recipe-icon{font-size:24px;line-height:1}
#v47-recipes .v501-recipe-pane{min-width:0;max-width:100%}
#v47-recipes .v501-recipe-intro{font-size:13px;line-height:1.55;color:#b4cac7;margin:0 0 12px}
#v47-recipes #recipe-importer,#v47-recipes #library-panel,#v47-recipes #v48-catalog{max-width:100%;min-width:0}
@media(max-width:700px){
 body.v5-ready.v5-legacy .shell{padding-top:max(66px,calc(15px + env(safe-area-inset-top,0px)))}
 #v5-root .v5-card>.v5-grid{grid-template-columns:minmax(0,1fr)}
 #v5-root .v5-dishline{gap:9px}
 #v5-root .v5-dishline>div{flex:1 1 160px}
 body.v5-ready.v5-legacy #v47-planning .formgrid,
 body.v5-ready.v5-legacy #v47-planning .setup-grid{grid-template-columns:minmax(0,1fr)}
 body.v5-ready.v5-legacy #v47-planning .formgrid>.field:first-child{grid-column:auto}
}
@media(max-width:425px){
 #v5-root .v5-title{font-size:18px}
 #v5-root .v5-flame{font-size:25px}
 #v5-root .v5-top{gap:8px}
 #v5-root .v5-top>.v5-chip{max-width:110px;font-size:10px}
 body.v5-ready.v5-legacy #add-area{grid-template-columns:minmax(0,1fr)}
 body.v5-ready.v5-legacy #add-area>*{min-height:44px}
 #v47-recipes .v501-recipe-tabs{gap:6px}
 #v47-recipes .v501-recipe-choice{font-size:12px;padding:10px 4px}
}
