/* v2.0 per-dish image card; stable actions and names remain separate rows. */
.dish-photo{margin:0 0 13px;min-width:0;max-width:100%;text-align:left;line-height:1.45}
.dish-photo-frame{position:relative;overflow:hidden;aspect-ratio:4/3;background:#eff1e8;border-radius:12px;min-width:0;width:100%;isolation:isolate}
.dish-photo-frame>img{display:block;width:100%;height:100%;object-fit:cover;position:absolute;inset:0}
.dish-photo-illustration{height:100%;display:flex;justify-content:center;align-items:center}.dish-photo-illustration svg{width:85%;height:90%;max-height:100%}
.dish-photo-badge{position:absolute;bottom:7px;left:7px;right:7px;width:max-content;max-width:calc(100% - 14px);padding:3px 7px;border-radius:5px;background:rgba(255,255,250,.94);color:#3c5548;font-size:10px;overflow-wrap:anywhere}
.dish-photo figcaption{display:flex;flex-wrap:wrap;gap:4px 9px;align-items:flex-start;justify-content:space-between;padding:7px 0 0;font-size:10px;color:#738171}
.dish-photo figcaption>span{flex:1 1 80px;min-width:0;overflow-wrap:anywhere}.dish-photo figcaption button{flex:0 0 auto;font-size:11px;min-height:28px}
.dish-photo-loading{display:flex;align-items:center;justify-content:center;text-align:center;height:100%;padding:18px;color:#657365;font-size:12px;position:absolute;inset:0}
.meal-components .meal-component>.dish-photo{margin:-2px -2px 12px;}.meal-components .meal-component{overflow:visible}
.menu-art .dish-photo{width:100%;height:auto;margin:0}.menu-art{height:auto;min-height:0;position:relative}.menu-art .dish-photo-frame{border-radius:0}.menu-art .dish-photo figcaption{padding:8px 12px}
.menu-art .menu-fav{z-index:2;top:10px;right:10px}.detail-art .dish-photo{max-width:520px;margin:auto}.detail-art{min-height:0!important;height:auto!important}.detail-art>.dish-photo .dish-photo-frame{aspect-ratio:16/10}
#resultArt.photo-hero-hidden{display:none}#resultCard.has-dish-photos .result-main{grid-template-columns:1fr}#resultCard.has-dish-photos .result-info{padding-left:0}#resultArt>.dish-photo{width:100%;max-width:360px;margin:auto}
.photo-dialog{width:min(680px,calc(100vw - 28px));max-height:90dvh;overflow:auto;padding:24px;border:1px solid #dbe1d2;border-radius:18px;box-sizing:border-box;background:#fffefa;color:#243e34}.photo-dialog::backdrop{background:rgba(28,45,34,.42)}
.photo-dialog .dialog-heading{display:flex;gap:15px;align-items:flex-start;justify-content:space-between}.photo-dialog h2{font-size:20px;min-width:0;overflow-wrap:anywhere;margin:0 0 16px}
.photo-preview{background:#f0f2eb;border:1px solid #dfe5d7;border-radius:12px;min-height:180px;max-height:45dvh;overflow:hidden;display:flex;align-items:center;justify-content:center;text-align:center}
.photo-preview img{display:block;max-width:100%;max-height:45dvh;width:auto;height:auto;object-fit:contain}.photo-preview svg{max-height:300px}
.photo-status{font-size:13px;min-height:40px;overflow-wrap:anywhere;line-height:1.7;margin:12px 0}.photo-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;align-items:center}
.photo-actions button{white-space:normal;min-height:40px}.photo-dialog .field-note{font-size:11px;line-height:1.8}.photo-dialog details{margin-top:14px;border-top:1px solid #dfe4d7;padding-top:12px}.photo-dialog details p{overflow-wrap:anywhere}
.photo-dialog input[hidden],.photo-settings input[hidden]{display:none}.photo-settings{border-top:1px solid #dce1d5;margin-top:22px;padding-top:12px}.photo-option{display:flex;align-items:center;gap:8px;font-size:13px}
.account-access-warning{padding:12px 14px;background:#fff3dd;border:1px solid #edd5a6;border-radius:9px;font-size:12px;line-height:1.7;color:#735025}
@media(max-width:680px){.photo-dialog{padding:17px}.meal-components .dish-photo-frame{aspect-ratio:16/10}.dish-photo figcaption{font-size:11px}.dish-photo figcaption button{font-size:12px}.photo-actions .primary-btn,.photo-actions .secondary-btn{flex:1 1 130px}.menu-art .dish-photo-frame{aspect-ratio:4/3}}
#resultCard.has-dish-photos .result-stage{grid-template-columns:1fr;min-height:0;padding-top:14px;padding-bottom:12px}#resultCard.has-dish-photos .result-copy{padding-left:0}#resultCard.has-dish-photos #resultTitle{font-size:30px}
/* v2.4 album controls: no auto-play; preserve the existing per-dish card layout. */
.photo-open-image{display:block;width:100%;height:100%;padding:0!important;border:0!important;background:transparent!important;cursor:zoom-in;border-radius:inherit;min-height:0!important}
.dish-photo-frame .photo-open-image img{width:100%;height:100%;object-fit:cover;display:block}
.photo-card-step,.photo-view-step{position:absolute;top:50%;transform:translateY(-50%);z-index:2;border:1px solid #ffffffa0!important;background:#fffef4e8!important;color:#254b3b!important;border-radius:50%;width:34px;min-height:34px!important;padding:0!important;font-size:25px!important;line-height:1!important;box-shadow:0 1px 5px #0002}
.photo-card-step.previous,.photo-view-step.previous{left:7px}.photo-card-step.next,.photo-view-step.next{right:7px}
.photo-viewer{position:relative;min-width:0}.photo-view-step{width:38px;min-height:38px!important}.photo-view-step:disabled{display:none}
.photo-dialog{width:min(760px,calc(100vw - 28px));max-height:92dvh;overflow-y:auto}.photo-preview{height:min(38dvh,340px);min-height:160px}.photo-preview img{max-height:100%;object-fit:contain}.photo-preview>svg{max-height:100%}
.photo-album-heading{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:14px 0 8px;font-size:12px;flex-wrap:wrap}.photo-album-heading>span{color:var(--muted,#697a6b)}
.photo-thumbs{display:flex;gap:8px;overflow-x:auto;max-width:100%;padding:3px 1px 8px;overscroll-behavior-x:contain}
.photo-thumb{flex:0 0 92px;width:92px;min-width:0;border:2px solid transparent;background:#f4f5ed;padding:3px;border-radius:9px;cursor:pointer;overflow:hidden}.photo-thumb.is-active{border-color:#345c49}.photo-thumb-image{display:flex;align-items:center;justify-content:center;height:60px;width:100%;background:#e6eade;border-radius:5px}.photo-thumb-image img{height:100%;width:100%;object-fit:cover;border-radius:inherit}.photo-thumb-label{display:block;white-space:nowrap;font-size:10px;line-height:1.7;text-align:center;color:#354d3d}
.photo-manage-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;border-top:1px solid #dfe4d7;padding:12px 0}.photo-manage-actions button{font-size:12px;white-space:normal;min-height:36px}
.photo-thumbs:empty{display:none}.photo-dialog .photo-status{max-height:100px;overflow-y:auto;min-height:24px}.photo-dialog .dialog-heading h2{line-height:1.4;margin:0 0 12px}
@media(max-width:480px){.photo-dialog{padding:15px;width:calc(100vw - 20px)}.photo-thumb{flex-basis:78px;width:78px}.photo-thumb-image{height:54px}.photo-dialog .photo-actions button{flex:1 1 115px}.photo-manage-actions button{flex:1 1 95px}.photo-preview{height:29dvh;min-height:145px}}

/* v2.4.1: layout-viewport vh is not enough for mobile zoom / browser chrome.
   A viewport-sized shell owns header + scroller + save. No inverse-scale hack. */
#photoDialog.photo-dialog{
 --photo-vv-width:100vw;--photo-vv-height:100vh;--photo-vv-left:0px;--photo-vv-top:0px;
 --photo-gap:12px;
 position:fixed;inset:auto;margin:0;transform:translateX(-50%);
 left:calc(var(--photo-vv-left) + var(--photo-vv-width) / 2);
 top:calc(var(--photo-vv-top) + var(--photo-gap) + env(safe-area-inset-top,0px));
 width:min(760px,calc(var(--photo-vv-width) - 2 * var(--photo-gap) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)));
 max-width:none;min-width:0;height:auto;
 max-height:calc(var(--photo-vv-height) - 2 * var(--photo-gap) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
 padding:0;overflow:hidden;box-sizing:border-box;
}
@supports(height:100dvh){#photoDialog.photo-dialog{--photo-vv-height:100dvh}}
#photoDialog[open]{display:flex;flex-direction:column}
#photoDialog>.dialog-heading{flex:0 0 auto;min-width:0;margin:0;padding:14px 16px;border-bottom:1px solid #dfe4d7;background:#fffefa;align-items:flex-start}
#photoDialog .dialog-heading h2{flex:1;min-width:0;margin:0;font-size:19px;line-height:1.4;overflow-wrap:anywhere}
#photoDialog #photoClose{flex:0 0 40px;min-height:40px;align-self:flex-start;font-size:24px;line-height:1}
#photoDialog .photo-dialog-body{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;padding:14px 16px;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
#photoDialog .photo-save-bar{flex:0 0 auto;padding:10px 16px;border-top:1px solid #dfe4d7;background:#fffefa}
#photoDialog #photoSaveBtn{width:100%;min-height:44px;padding:10px 14px;font-size:15px}
#photoDialog .photo-preview{height:clamp(110px,calc(var(--photo-vv-height) * .33),340px);min-height:0;max-height:none;position:relative;touch-action:auto}
#photoDialog .photo-preview img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
#photoDialog .photo-preview>svg{width:auto;height:100%;max-width:100%;max-height:100%}
#photoDialog .photo-status{min-height:0;max-height:none;overflow:visible;margin:10px 0;font-size:13px}
#photoDialog .photo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
#photoDialog .photo-actions button{min-width:0;min-height:44px;font-size:14px;padding:9px 8px}
#photoDialog .photo-manage-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0;align-items:stretch}
#photoDialog .photo-manage-actions button{min-width:0;min-height:42px;overflow-wrap:anywhere;padding:7px 4px}
#photoDialog .photo-view-step{min-height:40px!important;width:40px}
#photoDialog .photo-thumbs{touch-action:pan-x pan-y pinch-zoom}
#photoDialog .photo-thumb{flex:0 0 78px;width:78px;min-height:76px}
#photoDialog .photo-thumb-image{height:54px}
#photoDialog .photo-thumb-label{font-size:11px}
#photoDialog .photo-dialog-body>details{margin-top:10px}
#photoDialog.photo-compact{--photo-gap:8px;border-radius:16px}
#photoDialog.photo-compact .dialog-heading{padding:10px 12px}
#photoDialog.photo-compact .dialog-heading h2{font-size:17px}
#photoDialog.photo-compact .photo-dialog-body{padding:10px 12px;scrollbar-gutter:auto}
#photoDialog.photo-compact .photo-save-bar{padding:8px 12px}
#photoDialog.photo-compact .photo-album-heading{margin-top:10px;font-size:12px}
#photoDialog.photo-short .photo-preview{height:clamp(88px,calc(var(--photo-vv-height) * .3),180px)}
#photoDialog.photo-short .dialog-heading{padding-top:8px;padding-bottom:8px}
#photoDialog.photo-short .photo-save-bar{padding-top:6px;padding-bottom:6px}
/* Very long menu names must not consume the whole visual viewport while zoomed.
   The accessible label and title still contain the complete name. */
#photoDialog .dialog-heading h2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:2.8em;overflow:hidden}
