@font-face{font-family:Nunito;src:url(nunito.ttf)}*{box-sizing:border-box}body{margin:0;background:#fbf9f3;color:#101b35;font-family:Nunito,Arial,sans-serif}button,textarea,input,select{font:inherit}button{cursor:pointer}main{padding:18px;min-height:100dvh;display:flex;flex-direction:column}header{height:102px;position:relative;display:flex;align-items:center;justify-content:center}header img{width:75%;max-height:100%;object-fit:contain}button.icon{border:0;background:none;color:#2c64ae;padding:0}header button{position:absolute;right:0;top:5px}svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}h1{text-align:center;font-size:28px;line-height:1.2;margin:24px 0 14px;font-weight:850}.search{display:flex;align-items:center;border:1.6px solid #d5d9e2;border-radius:24px;background:#fff;padding:16px;gap:8px}textarea{border:0;resize:none;width:100%;height:90px;background:transparent;font-size:21px;line-height:1.45;color:#101b35;outline:none}textarea::placeholder,input::placeholder{color:#7c8699;opacity:1}.search button{border:0;background:#e8effc;color:#2c64ae;border-radius:11px;width:42px;height:42px;flex:none}#summary{font-size:18px;color:#5d6c84;line-height:1.42}#summary p{margin:23px 0 0}nav{margin-top:auto;border-top:1px solid #d5d9e2;padding:14px 0 10px;display:flex;justify-content:space-around}nav button{background:none;border:0;color:#2c64ae;font-weight:800;font-size:18px;display:flex;flex-direction:column;align-items:center;gap:5px;padding:0}dialog{width:calc(100% - 24px);max-width:440px;border:1.5px solid #d5d9e2;border-radius:29px;background:#fbf9f3;color:#101b35;padding:17px 21px;max-height:95dvh}dialog::backdrop{background:#101b3566}dialog h2{text-align:center;font-size:30px;margin:0 0 18px;font-weight:850}dialog .close{position:absolute;right:30px;top:24px;font-size:34px;line-height:1;border:0;background:none;color:#204783}.fields{display:grid;gap:8px;max-height:calc(95dvh - 130px);overflow:auto}.ingredients{border:1.6px solid #d5d9e2;border-radius:16px;background:white;padding:10px 14px}.ingredients input{width:100%;border:0;outline:none;font-size:20px;padding:6px 0;color:#101b35}.chips{display:flex;flex-wrap:wrap;gap:7px}.chips button{background:#e8eefb;color:#395aa0;border:0;border-radius:10px;padding:7px 10px;font-weight:800}select{width:100%;appearance:none;border:1.6px solid #d5d9e2;border-radius:15px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='m4 8 8 8 8-8' fill='none' stroke='%232c64ae' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right 14px center;padding:9px 38px 9px 15px;font-size:21px;color:#101b35;height:48px}.actions{display:flex;gap:13px;margin-top:22px}.actions button{border-radius:16px;padding:12px;font-weight:850;font-size:21px;border:1.5px solid #d5d9e2;background:white;color:#2c64ae}.actions .apply{flex:1;background:#3e5ec4;color:white;border-color:#3e5ec4;font-size:25px}.profile-options{display:flex;flex-wrap:wrap;gap:8px}.profile-options label{padding:8px;background:white;border:1px solid #d5d9e2;border-radius:10px} @media(min-width:600px){main{max-width:460px;margin:auto}}
#otherPage h1{margin:12px 0 32px}#otherPage p{font-size:21px;line-height:1.6;margin:0;color:#101b35}.emptyFaves{text-align:center;color:#5d6c84!important;font-size:23px!important;margin-top:44px!important}.editRow{text-align:right}.editRow button{border:0;background:none;color:#395aa0;font-size:21px;font-weight:850;padding:0}.prefTitle{margin:10px 0 16px!important}.prefHeading,#profileDialog h3{text-align:center;font-size:25px;font-weight:900;margin:12px 0}.prefGrid,.profile-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}.prefGrid span,.profile-options label{display:flex;align-items:center;justify-content:center;text-align:center;border-radius:16px;min-height:50px;padding:9px 5px;font-size:19px;font-weight:850}.prefGrid span{background:#e8eefb;color:#395aa0}.prefEmpty{text-align:center;color:#6c778b!important;font-size:19px!important;margin:14px 0!important}.continue{width:100%;border:0;border-radius:16px;background:#3e5ec4;color:white;font-size:25px;font-weight:850;padding:12px;margin-top:14px}.profile-options label{position:relative;border:1.6px solid #d5d9e2;background:white;color:#101b35;cursor:pointer}.profile-options label:has(input:checked){background:#e8eefb;color:#395aa0;border-color:#e8eefb}.profile-options input{position:absolute;opacity:0;width:1px;height:1px}.profile-options label:focus-within{outline:2px solid #395aa0}.nameRow{display:flex;align-items:center;gap:15px}.nameRow input{width:83%;min-width:0;border:1.6px solid #d5d9e2;border-radius:17px;padding:12px 15px;background:white;font-size:23px;color:#101b35}.nameRow .close{position:static;color:#657086}.nameRow{margin-bottom:14px}#profileDialog{width:calc(100% - 46px);padding:17px 19px}#profileDialog .actions{margin-top:17px}#profileDialog .apply{min-height:60px}#otherPage{overflow:auto}main{height:100dvh;min-height:0}header,nav{flex-shrink:0}#homePage{overflow:auto}nav{margin-top:auto}
 .resultGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.recipeCard{position:relative;display:block;padding:0;border:0;border-radius:16px;overflow:hidden;background:#eee;aspect-ratio:4/5;width:100%}.recipeCard img{width:100%;height:100%;object-fit:cover;display:block}.recipeCard span{position:absolute;bottom:10px;left:7px;right:7px;color:white;font-size:19px;font-weight:900;line-height:1.12;text-shadow:0 1px 5px #000,0 2px 9px #000,0 0 12px #000}.paging{display:flex;justify-content:space-between;align-items:center;margin:12px 0}.paging button{border:0;background:none;color:#2c64ae;font-weight:850}.detailPhoto{width:100%;max-height:300px;object-fit:cover;border-radius:16px}#otherPage{flex:1}  .infoList{display:grid;gap:22px;margin:20px 0;padding:0;list-style:none}.infoList li{display:flex;align-items:flex-start;gap:14px;font-size:20px;line-height:1.4}.infoList svg{flex:none;width:26px;height:26px}.favTile{position:relative;min-width:0}.removeFav{position:absolute;top:7px;right:7px;border:0;border-radius:50%;background:#fff;color:#f47765;width:36px;height:36px;font-size:25px;line-height:1}.detailActions{display:flex;gap:10px;margin:15px 0}.detailActions button{flex:1;border:1px solid #d5d9e2;border-radius:12px;background:white;color:#2c64ae;padding:10px;font-weight:800}.saveFields{display:grid;gap:10px}.saveFields textarea{border:1px solid #d5d9e2;border-radius:12px;padding:10px;background:white}.saveFields label{font-weight:800}
/* Shared mobile shell, reviewed against supplied screenshots. */
main{height:100dvh;min-height:0;padding:12px 16px 8px;max-width:460px;margin:auto;overflow:hidden}header{height:104px;align-items:flex-start;padding-top:7px}header img{width:80%;height:76px;max-height:none}header button{top:auto;bottom:3px;right:0;width:34px;height:34px}header button svg{width:26px;height:26px}nav{padding:10px 0 5px;gap:4px}nav button{font-size:15px;gap:4px;min-height:48px;flex:1}nav svg{width:24px;height:24px}#homePage,#otherPage{min-height:0;flex:1;overflow:auto}#homePage h1{font-size:clamp(19px,5.9vw,25px);line-height:1.16;text-wrap:balance;margin:9px 0 13px}.search{padding:12px 13px;border-radius:20px;gap:8px}.search textarea{font-size:17px;line-height:1.42;height:76px;padding:0;min-width:0}.search button{width:36px;height:36px}.search button svg{width:25px;height:25px}#summary{font-size:14px;line-height:1.38}#summary p{margin:12px 0 0}#otherPage h1{font-size:24px;margin:8px 0 14px;text-wrap:balance}.infoList{gap:16px;margin:12px 0}.infoList li{font-size:17px;line-height:1.35;gap:12px}.infoList svg{width:22px;height:22px}.editRow button{font-size:16px}.prefHeading,#profileDialog h3{font-size:19px;margin:9px 0}.prefGrid,.profile-options{gap:7px}.prefGrid span,.profile-options label{min-height:43px;font-size:clamp(13px,4vw,17px);padding:7px 3px;white-space:nowrap;border-radius:12px}.profile-options label:has(input:checked){border-color:#8da8e9}.profile-options label:has(input:checked)::after{content:'✓';position:absolute;right:4px;top:1px;font-size:13px;color:#2c64ae}.continue{font-size:19px;padding:9px;margin-top:10px}.prefEmpty{font-size:15px!important;margin:8px 0!important}dialog{padding:14px 17px;border-radius:23px;max-height:calc(100dvh - 24px);overflow:auto}dialog h2{font-size:24px;margin:0 0 12px}dialog .close{font-size:28px;right:17px;top:12px;outline:none;box-shadow:none;min-width:32px;min-height:32px}dialog .close:focus-visible{outline:none}#cravingDialog .close:focus:not(:focus-visible){outline:none}.fields{gap:7px;max-height:none;overflow:visible}#selects{display:grid;gap:7px}.ingredients{padding:6px 10px;border-radius:13px}.ingredients input{font-size:16px;padding:7px 0}.chips{gap:4px}.chips:empty{display:none}.chips button{font-size:14px;padding:4px 7px}select{font-size:17px;height:40px;padding:5px 32px 5px 12px;border-radius:12px;background-size:18px}.actions{margin-top:12px;gap:10px}.actions button,.actions .apply{font-size:18px;padding:9px 12px;border-radius:13px}#profileDialog{width:calc(100% - 30px);padding:15px 17px}#profileDialog .actions{margin-top:12px}#profileDialog .apply{min-height:44px}.nameRow{margin-bottom:8px;gap:10px}.nameRow input{font-size:19px;padding:9px 12px;border-radius:13px;flex:1}.nameRow .close{position:static}#suggestions{max-height:125px;overflow:auto;border-top:1px solid #d5d9e2}#suggestions[hidden]{display:none}#suggestions button{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #d5d9e2;background:white;color:#101b35;padding:8px 3px;font-size:16px}@media(max-height:650px){header{height:86px}header img{height:62px}#homePage h1{margin:5px 0 9px}.search textarea{font-size:16px;height:70px}#summary{font-size:13px}#summary p{margin:8px 0 0}.infoList{gap:10px}.infoList li{font-size:16px}.prefGrid span,.profile-options label{min-height:37px}.prefHeading,#profileDialog h3{margin:6px 0}}

header button{top:0;bottom:auto;right:0}nav button{font-size:13px;min-height:40px;gap:3px}nav svg{width:21px;height:21px}nav{padding:7px 0 3px}#summary{font-size:15.5px}#summary strong{font-weight:800}#summary p{margin-top:10px}.search textarea{flex:1;width:0}.search button{display:grid;place-items:center}#otherPage.gridPage{display:flex;flex-direction:column;overflow:hidden;gap:5px}#otherPage.gridPage .resultGrid{flex:1;min-height:0;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:center;justify-items:center}.gridPage .recipeCard{width:auto;max-width:100%;height:100%;max-height:100%;aspect-ratio:4/5}.gridPage .favTile{height:100%;min-height:0;max-width:100%;aspect-ratio:4/5}.gridPage .favTile .recipeCard{width:100%}.recipeCard span{font-size:clamp(11px,3.2vw,14px);bottom:6px;line-height:1.13;text-wrap:balance;overflow-wrap:anywhere;text-shadow:0 1px 4px #000,0 2px 7px #000}.paging{flex:none;margin:3px 0;font-size:14px}.gridPage h1{font-size:19px!important;margin:2px 0!important}dialog .close:focus{outline:none} @media(max-height:650px){#summary{font-size:14px}}

main{padding-top:2px;padding-bottom:0}header{height:90px;padding-top:4px}header button{top:0}nav{padding-bottom:0}nav button{font-size:12px;min-height:38px}nav svg{width:20px;height:20px}#otherPage.gridPage .resultGrid{gap:6px;column-gap:6px} .gridPage .recipeCard span{font-size:clamp(12px,3.9vw,17px);text-wrap:balance}.detailBack{border:0;background:none;color:#2c64ae;font-weight:800;padding:3px 0 7px}.recipeHead{display:grid;grid-template-columns:43% minmax(0,1fr);gap:9px;align-items:center}.detailTile{aspect-ratio:1;width:100%}.detailTile span{font-size:14px;text-wrap:balance}.recipeStats{font-size:14px;line-height:1.55;min-width:0}.recipeStats div{white-space:nowrap}.recipeControls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:12px 0}.recipeControls button,.recipeControls select{font-size:13px;font-weight:700;border:1px solid #d5d9e2;background:#fff;color:#2c64ae;border-radius:10px;height:40px;padding:4px;white-space:nowrap}.recipeControls select{text-align:center}.adaptFields{display:grid;gap:8px}.adaptIngredientSuggestions{max-height:125px;overflow:auto;border-top:1px solid #d5d9e2}.adaptIngredientSuggestions[hidden],.adaptFields select[hidden]{display:none}.adaptIngredientSuggestions button{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #d5d9e2;background:white;color:#101b35;padding:8px 3px;font-size:16px}.adaptIngredientSuggestions button:disabled{color:#999}.adaptFields input[type=search]{width:100%;min-width:0;font:inherit;padding:8px}.adaptFields label{display:flex;gap:8px;align-items:center;padding:8px}.adaptFields option:disabled{color:#aaa}.detailActions button:last-child{background:#d66452;color:white}#otherPage li{font-size:16px;line-height:1.5}#otherPage ul,#otherPage ol{padding-left:23px}#otherPage small{display:block;color:#5d6c84;margin:10px 0}#profileDialog .close{outline:none}

/* Task 8: compact mobile preferences and safe-area shell. */
main{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
header{height:82px;padding-top:2px}
header img{width:calc(100% - 88px);height:72px;max-width:80%}
header button#profile{top:0;right:-12px;width:44px;height:44px;display:grid;place-items:center}
nav{padding:4px 0 0;flex:none}nav button{min-height:44px}
#otherPage.profilePage{display:flex;flex-direction:column;gap:0;min-height:0;overflow:auto;padding-bottom:4px}
#otherPage.profilePage .prefTitle{font-size:clamp(19px,5.5vw,23px);margin:2px 0 8px!important;line-height:1.15}
.profilePage .prefHeading{font-size:18px;line-height:1.2;margin:7px 0}
.profilePage .prefGrid{gap:5px}
.profilePage .prefGrid span{min-height:38px;padding:5px 3px;font-size:clamp(13px,4vw,16px)}
.profilePage .continue{flex:none;min-height:44px;font-size:18px;margin:10px 0 0;padding:7px}
#profileDialog .profile-options{gap:5px}#profileDialog .profile-options label{min-height:44px;padding:5px 3px;font-size:clamp(13px,4vw,16px)}
#profileDialog h3{font-size:18px;margin:6px 0}
@media(max-height:650px){header{height:66px}header img{height:60px}.profilePage .prefGrid span{min-height:32px}.profilePage .prefHeading{margin:5px 0}.profilePage .continue{margin-top:7px}}
/* Keyboard focus must remain visible on controls with suppressed default outlines. */
button:focus-visible,textarea:focus-visible,input:focus-visible,select:focus-visible,dialog .close:focus-visible,#profileDialog .close:focus-visible{outline:2px solid #395aa0;outline-offset:2px}
/* Allow long profile labels and enlarged text to wrap without horizontal clipping. */
.profilePage .prefGrid span,#profileDialog .profile-options label{white-space:normal;overflow-wrap:anywhere;min-width:0}
#profileDialog .nameRow input{flex:1;min-width:0;width:auto}
.recipeControls>*{min-width:0}.recipeControls button{white-space:normal;overflow-wrap:anywhere;height:auto;min-height:40px}
