/* The same bounded phone surface as APK127; desktop rules stay unchanged. */
@media(max-width:650px), (max-width:950px) and (max-height:480px) and (pointer:coarse){
 html.phone-ui{--phone-viewport:100dvh;color-scheme:light;overscroll-behavior:none}
 /* iOS standalone can under-report dynamic viewport height; use its full layout viewport. */
 html.phone-ui.phone-ios-pwa{--phone-viewport:100vh}
 html.phone-ui body:has(.shell){position:fixed;inset:0;width:100%;height:var(--phone-viewport);margin:0;overflow:hidden;overscroll-behavior:none}
 html.phone-ui #app:has(.shell){position:relative;height:100%;min-width:0}
 html.phone-ui body .shell{position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:54px minmax(0,1fr)!important;width:100%!important;max-width:none!important;height:calc(100% - 55px - max(3px,env(safe-area-inset-bottom)))!important;margin:0!important;padding:env(safe-area-inset-top) max(2px,env(safe-area-inset-right)) 0 max(2px,env(safe-area-inset-left))!important;gap:4px!important;box-sizing:border-box}
 html.phone-ui body .shell.phone-shell{height:calc(100% - 55px - max(3px,env(safe-area-inset-bottom)))!important;grid-template-rows:calc(54px + env(safe-area-inset-top)) minmax(0,1fr)!important;padding-top:0!important}
 html.phone-ui body .top{grid-area:1/1!important;display:grid!important;grid-template-columns:106px minmax(34px,1fr) auto!important;align-items:center!important;gap:4px!important;height:auto!important;min-height:50px!important;padding:env(safe-area-inset-top) 4px 0!important;background:#fff;border-bottom:1px solid #d2e1ec;box-sizing:border-box}
 html.phone-ui body .top .logo{width:106px!important;height:44px!important;background-size:525.57px 399.71px!important;background-position:-54.32px -103.35px!important}
 html.phone-ui body .hero{display:none!important}
 html.phone-ui body .quick-profile{position:static!important;grid-column:3;display:flex!important;gap:6px!important;align-items:center;max-width:142px;min-width:0;padding:5px 8px!important;border:1px solid #cbdbe7!important;border-radius:28px!important;background:#fff!important;overflow:hidden;min-height:40px!important}
 html.phone-ui body .quick-profile .avatar{width:30px!important;height:30px!important;flex:none}
 html.phone-ui body .quick-profile>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px!important}
 .phone-connection{grid-column:2;grid-row:1;justify-self:center;display:flex;flex-direction:column;align-items:center;gap:1px;color:#218447}
 .phone-connection svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8}
 .phone-connection small{font-size:9px;font-weight:600;line-height:1.1}
 .phone-connection.is-offline{color:#b64040}
 html.phone-ui body .workspace{grid-area:2/1!important;height:100%!important;min-height:0!important;min-width:0!important;width:100%!important;max-width:100%!important;overflow:hidden!important}
 html.phone-ui body .workspace[hidden]{display:none!important}
 html.phone-ui body .jobs-frame{width:100%!important;height:100%!important;min-height:0!important;border:1px solid #cbdbe7!important;border-radius:18px!important;background:#f6fbff;display:block}
 html.phone-ui body nav.nav{position:absolute!important;inset:auto max(3px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(3px,env(safe-area-inset-left))!important;width:auto!important;height:52px!important;max-height:52px!important;max-width:none!important;margin:0!important;display:flex!important;gap:0!important;padding:3px!important;box-sizing:border-box;border:1px solid #cbdbe7!important;border-radius:14px!important;background:#fff!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;touch-action:pan-x;scrollbar-width:none}
 html.phone-ui body nav.nav>button{flex:0 0 20%!important;width:auto!important;min-width:0!important;min-height:0!important;margin:0!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px!important;font-size:11px!important;line-height:1.1;padding:3px!important;border:0!important;border-radius:12px!important;box-shadow:none!important;outline-offset:-3px!important}
 html.phone-ui body nav.nav>button svg{width:22px!important;height:22px!important;flex:none}
 html.phone-ui body nav.nav>button span{position:static!important;width:auto!important;height:auto!important;clip-path:none!important;white-space:nowrap;overflow:visible!important}
 html.phone-ui body nav.nav>button.active{background:#fff2b2!important;color:#152f43!important;box-shadow:none!important}
 html.phone-ui body .nav>.workspace-short-nav{display:none!important}
 html.phone-ui body :is(input,select,textarea){font-size:16px}
 html.phone-ui body #toast{bottom:calc(72px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);box-sizing:border-box}
 html.phone-ui body .welcome-screen{min-height:100dvh;box-sizing:border-box;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}
 html.phone-ui body dialog{max-width:calc(100vw - 16px);max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);box-sizing:border-box;overscroll-behavior:contain}
 html.phone-ui .phone-install-entry{min-height:40px;width:100%;margin-top:8px}
 html.phone-ui .phone-install-steps{padding-left:24px;line-height:1.6}
 html.phone-ui .att3-today{grid-template-rows:32px 34px 78px 50px minmax(180px,1fr) 38px!important;gap:6px!important}
 html.phone-ui .att3-day-head button{height:32px!important;min-height:32px!important;padding:4px!important}
 html.phone-ui .att3-day-status .att-owner-button{height:34px!important;min-height:34px!important}
 html.phone-ui .att3-work-actions>button{height:50px!important;min-height:50px!important;padding:6px!important}
 html.phone-ui .att3-deck{padding:8px;gap:6px}
 html.phone-ui .att3-confirmations{display:grid!important;grid-template-rows:repeat(3,minmax(0,1fr));min-height:180px!important;gap:6px!important}
 html.phone-ui .att3-live>strong{font-size:clamp(32px,9.6vw,44px);line-height:1.1}
 html.phone-ui .att3-day-head h2{font-size:17px}
 html.phone-ui .att3-day-status .att-owner-button{max-width:none;font-size:15px}
 html.phone-ui .att3-day-status .att2-badge{font-size:12px}
 html.phone-ui .att3-confirm b{font-size:clamp(17px,4.8vw,21px);line-height:1.15}
 html.phone-ui .att3-confirm small{font-size:12px;line-height:1.2}
 html.phone-ui .att3-confirm .att3-time strong{font-size:28px;line-height:1.1}
 html.phone-ui .att3-confirm .att3-meal-time strong{font-size:18px}
 html.phone-ui .att3-confirm .att3-time small{font-size:11px;line-height:1.2}
 html.phone-ui .att3-confirm{grid-template-columns:minmax(0,1fr) minmax(95px,auto) 26px;padding:6px 9px}
 html.phone-ui .att3-today-tools,html.phone-ui .att3-today-tools button{height:38px;min-height:38px}
 html.phone-ui .att3-confirmations>.att3-confirm{flex:none!important;height:auto!important;min-height:0!important}
 html.phone-ui .att3-today-tools button{line-height:1.15!important;font-size:13px!important;white-space:normal!important}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] .photo-desktop-context{grid-template-columns:minmax(0,1fr) 94px 28px}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] #photo-capture .photo-desktop-context .photo-source-actions>button{width:44px!important;height:44px!important;min-height:44px!important;min-width:44px!important;padding:8px!important}
 html.phone-ui body .workspace>.photo-redesign{padding:8px!important;gap:6px!important}
 html.phone-ui .photo-search-header{gap:6px}
 html.phone-ui .photo-search-header #photo-find-job{min-height:52px;padding:8px;font-size:18px}
 html.phone-ui .photo-job-results .photo-job-result{padding:10px!important}
 html.phone-ui .photo-job-results .photo-job-result>span{font-size:16px}
 html.phone-ui .photo-job-results .photo-job-result>small{font-size:13px}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] .photo-desktop-context .photo-desktop-job h2{font-size:15px!important;line-height:1.25!important}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] #photo-capture{gap:6px!important}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] .photo-desktop-grid{gap:6px!important}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] .photo-desktop-meta{font-size:12px;padding:24px 7px 7px}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] .photo-desktop-meta strong{font-size:12px}
 html.phone-ui body .workspace>.photo-redesign[data-photo-desktop] .photo-desktop-meta>span{font-size:11px}

}
@media(max-height:740px) and (orientation:portrait){
 html.phone-ui .att3-today{grid-template-rows:32px 32px 52px 40px minmax(126px,1fr) 38px!important;gap:4px!important}
 html.phone-ui .att3-day-status .att-owner-button{height:32px!important;min-height:32px!important}
 html.phone-ui .att3-work-actions>button{height:40px!important;min-height:40px!important}
 html.phone-ui .att3-confirmations{min-height:126px!important;gap:4px!important}
 html.phone-ui .att3-confirm{padding:4px 7px}
 html.phone-ui .att3-confirmations>.att3-confirm{height:auto!important;min-height:0!important}
 html.phone-ui .att3-confirm b{font-size:16px}
 html.phone-ui .att3-confirm small{font-size:11px}
 html.phone-ui .att3-confirm .att3-time strong{font-size:23px}
 html.phone-ui .att3-confirm .att3-meal-time strong{font-size:16px}
 html.phone-ui .att3-confirm .att3-time small{font-size:10px}
 html.phone-ui .att3-today-tools,html.phone-ui .att3-today-tools button{height:38px!important;min-height:38px!important;font-size:12px!important}
}
@media(min-height:640px) and (orientation:portrait){
 html.phone-ui .att3-month-date,html.phone-ui .att3-month-outside{font-size:13px;line-height:15px}
 html.phone-ui .att3-month-weekdays{font-size:12px;line-height:15px}
 html.phone-ui .att3 .att3-month-day strong{font-size:clamp(14px,4.1vw,18px)}
 html.phone-ui .att3-year-name b,html.phone-ui .att3-year-meals b{font-size:12px;line-height:14px}
 html.phone-ui .att3 .att3-year-name small,html.phone-ui .att3 .att3-year-meals small{font-size:10px;line-height:12px}
 html.phone-ui .att3 .att3-year-row>strong{font-size:15px;line-height:17px}
 html.phone-ui .att3-content[data-kind=week] .att3-row-work small,html.phone-ui .att3-content[data-kind=week] .att3-row-meal b,html.phone-ui .att3-content[data-kind=week] .att3-row-meal small{font-size:12px;line-height:13px}
}
@media(max-height:520px) and (orientation:landscape){
 html.phone-ui .att3-today{grid-template-rows:32px 30px minmax(40px,1fr) 40px 32px!important;gap:4px 8px!important}
 html.phone-ui .att3-work-actions>button{height:40px!important;min-height:40px!important}
 html.phone-ui .att3-confirmations{min-height:129px!important;gap:4px!important}
 html.phone-ui .att3-confirmations>.att3-confirm{height:auto!important;min-height:0!important}
 html.phone-ui .att3-confirm b{font-size:16px}
 html.phone-ui .att3-confirm small{font-size:11px}
 html.phone-ui .att3-confirm .att3-time strong{font-size:23px}
 html.phone-ui .att3-confirm .att3-meal-time strong{font-size:16px}
 html.phone-ui .att3-confirm .att3-time small{font-size:10px}
 html.phone-ui .att3-today-tools,html.phone-ui .att3-today-tools button{height:32px!important;min-height:32px!important}
}

@media(max-width:650px), (max-width:950px) and (max-height:480px) and (pointer:coarse){
 html.phone-ui body nav.nav{box-shadow:none!important;isolation:isolate;backdrop-filter:none!important}
 html.phone-ui body nav.nav>button{overflow:hidden;position:relative;flex-shrink:0!important}
 html.phone-ui body .workspace>.photo-redesign:not([data-photo-desktop]){display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
 html.phone-ui .photo-menu{gap:6px}
 html.phone-ui .photo-menu button{min-height:38px!important;padding:6px!important}
 html.phone-ui .photo-job-heading h2{font-size:18px!important;line-height:1.2!important}
 html.phone-ui body .workspace>.photo-redesign:not([data-photo-desktop]) #folder-host,html.phone-ui body .workspace>.photo-redesign:not([data-photo-desktop]) [data-folders-root]{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important}
 html.phone-ui .photo-redesign .folder-cards[data-phone-folder-grid]{display:grid!important;grid-template-columns:repeat(var(--phone-folder-columns,1),minmax(0,1fr))!important;grid-template-rows:repeat(var(--phone-folder-rows,1),minmax(0,1fr))!important;flex:1 1 0!important;min-height:0!important;height:auto!important;margin:0!important;gap:6px!important;overflow:hidden}
 html.phone-ui .photo-redesign [data-phone-folder-grid]>.folder-tile-wrap{min-height:0!important;min-width:0!important;position:relative}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile{height:100%!important;min-height:0!important;max-height:100%!important;padding:8px!important;gap:4px;overflow:hidden!important}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile strong{font-size:var(--phone-folder-font,18px)!important;line-height:1.2!important}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile .folder-reference{max-height:40%;width:100%;object-fit:contain}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile:not(.photo-card-appearance):has(>.folder-reference){position:relative;isolation:isolate;justify-content:center;align-items:center;text-align:center;background:#fff!important}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile:not(.photo-card-appearance)>.folder-reference{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain;opacity:.65;z-index:-1;background:transparent}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile:not(.photo-card-appearance)>strong{max-width:100%;background:#ffffffb8;border-radius:7px;padding:3px}
 html.phone-ui .photo-redesign [data-phone-folder-grid] .folder-tile>svg{display:none}
 html.phone-ui .photo-redesign [data-phone-folder-grid]>.folder-tile-wrap>.folder-info{position:absolute;inset:4px 4px auto auto;width:28px!important;height:28px!important;min-height:28px!important;padding:2px!important;font-size:11px!important;z-index:2;background:#ffffffdf;border-radius:50%}
 html.phone-ui .phone-folder-pages{display:flex;align-items:center;justify-content:center;gap:14px;flex:none;min-height:34px;font-size:13px}
 html.phone-ui .phone-folder-pages button{min-height:32px!important;height:32px!important;width:40px;padding:2px!important;font:23px/1 system-ui;border:1px solid #cbdbe7;border-radius:10px;background:white;color:#254f72}
 html.phone-ui .phone-folder-pages[hidden],html.phone-ui [data-phone-folder-hidden]{display:none!important}
}
