/* Phone dialogs have one vertical scroll area inside the visible viewport. */
@media(max-width:760px),(max-height:500px) and (pointer:coarse){
 html{scroll-padding-top:12px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body :is(.main,.panel,.grid,.top,.toolbar,.actions,.daily-unit-report,.compact-report,.report-review-main){min-width:0}
 body :is(h1,h2,h3,h4,h5,p,small,label,summary,dt,dd,.badge,.chip){overflow-wrap:anywhere}
 dialog[open]{position:fixed!important;inset:auto!important;top:calc(var(--het-vv-top,0px) + 8px + env(safe-area-inset-top,0px))!important;left:calc(var(--het-vv-left,0px) + 8px + env(safe-area-inset-left,0px))!important;margin:0!important;box-sizing:border-box!important;width:calc(var(--het-vv-width,100vw) - 16px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))!important;max-width:none!important;min-width:0!important;height:auto!important;min-height:0!important;max-height:calc(var(--het-vv-height,100dvh) - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;padding:16px!important;overflow:auto!important;overscroll-behavior:contain;scroll-padding:16px;scrollbar-gutter:stable;border-radius:12px!important}
 /* Status lives in a measured rail above the dialog, never on top of its text. */
 :root:has(.het-activity:not([hidden])){--het-notice-min:42px}
 :root:has(.het-activity[data-state=error]:not([hidden]),#toast.show,#runglo-toast.show){--het-notice-min:64px}
 dialog[open]{--het-notice-reserved:max(var(--het-mobile-notice,0px),var(--het-notice-min,0px));top:calc(var(--het-vv-top,0px) + var(--het-notice-reserved) + 8px + env(safe-area-inset-top,0px))!important;max-height:calc(var(--het-vv-height,100dvh) - var(--het-notice-reserved) - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important}
 :is(.het-activity,#toast,#runglo-toast,[data-het-toast-mirror]){position:fixed!important;inset:auto!important;top:calc(var(--het-vv-top,0px) + var(--het-notice-y,0px) + 8px + env(safe-area-inset-top,0px))!important;left:calc(var(--het-vv-left,0px) + 8px + env(safe-area-inset-left,0px))!important;margin:0!important;width:calc(var(--het-vv-width,100vw) - 16px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))!important;max-width:none!important;padding:5px 10px!important;font-size:12px!important;line-height:1.95!important;border-radius:8px;transform:none!important}
 .het-activity-icon{font-size:18px!important;line-height:1!important;flex-basis:20px}
 dialog[open] :is(.top,.create-job-head,.notification-dialog-head,.summary-detail-head,.ti-preview-actions,[data-het-mobile-sticky]){position:static!important;inset:auto!important;max-height:none!important}
 dialog[open].job-detail-dialog>.top:first-child{margin:0 0 16px!important;padding:0 0 12px!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important}
 dialog[open].job-detail-dialog>.top:first-child h2{font-size:17px!important;margin:4px 0!important}
 dialog[open] :is(.create-job-form,.summary-detail-shell,.summary-detail-scroll,.day-detail-list){max-height:none!important;overflow:visible!important}
 dialog[open] :is(form,article,section,fieldset,details,.grid,.top,.actions,.report-field-heading,.daily-file-toolbar)>*{min-width:0;max-width:100%}
 dialog[open] :is(.grid,.ti-preview-summary,.request-details-grid,.leave-review-grid){grid-template-columns:minmax(0,1fr)!important}
 dialog[open] :is(.top,.actions,.toolbar,.daily-unit-head,.daily-file-toolbar){flex-wrap:wrap;gap:8px;align-items:flex-start}
 dialog[open] :is(img,video,canvas){max-width:100%;object-fit:contain}
 dialog[open] :is(pre,.report-body,.compact-report-original){white-space:pre-wrap;overflow-wrap:anywhere}
 dialog[open] :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea){box-sizing:border-box;min-width:0;max-width:100%;width:100%;font-size:16px!important}
 textarea[data-het-autogrow]{max-height:none!important;overflow-y:hidden;resize:vertical}
 .het-selected-value{display:block;font-size:13px;color:#526676;white-space:normal;overflow-wrap:anywhere;margin-top:3px}
 .het-selected-value[hidden]{display:none!important}
 dialog[open] :is(.compact-report-fact,.event-fields>div){display:grid;grid-template-columns:minmax(0,1fr)!important;gap:2px;align-items:start;padding:10px 0;border-bottom:1px solid #e5ebf0}
 .compact-report-fact b{font-size:13px;color:#526676}
 .compact-report-fact>span{font-size:15px;display:block;min-width:0}
 .compact-report-preview{display:block!important;-webkit-line-clamp:unset!important;line-clamp:unset!important;max-height:none!important;overflow:visible!important;white-space:pre-wrap;overflow-wrap:anywhere}
 .compact-report-unit>summary{align-items:flex-start}
 .compact-report-expand{flex:0 0 auto}
 .compact-report-day>summary{white-space:normal}
 .compact-report-meta{white-space:normal;overflow-wrap:anywhere}
 .daily-report-heading{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:8px}
 .daily-report-heading h2{margin:0;font-size:20px}
 .daily-report-heading button{min-width:44px;min-height:44px;padding:5px 10px}
 .report-field-heading{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:start!important;margin-bottom:6px}
 .report-field-heading>span{min-width:0;overflow-wrap:anywhere}
 .report-field-heading .report-copy{align-self:start;white-space:nowrap;min-height:36px}
 .field-lift-name{display:inline-block;white-space:normal;overflow-wrap:anywhere}
 .daily-file-toolbar>b{flex:1 0 100%;font-size:15px}
 .daily-file-name{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}
 .daily-file-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .daily-unit-report{padding:12px!important}
 .daily-unit-head>div{flex:1 1 160px;min-width:0;overflow-wrap:anywhere}
 .daily-unit-head [data-unit-complete]{flex:0 1 auto}
 .daily-unit-files p{font-size:13px}
 .equipment-facts>span{max-width:100%;overflow-wrap:anywhere;flex-wrap:wrap}
 .report-review-card,.completion-review-card{grid-template-columns:minmax(0,1fr)!important}
 .report-review-actions{display:flex;flex-wrap:wrap}
 /* Seven narrow columns cannot hold full Thai job names on a phone. Keep the
    same days, assignments and drop targets, but lay days/cards out vertically. */
 :root body #main .week-grid.aligned-lanes{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;min-width:0!important}
 :root body #main .week-day.lane-layout{min-height:0!important;height:auto!important;padding:12px!important;overflow:visible!important}
 :root body #main .week-day.lane-layout>.planning-card[data-lane]{position:relative!important;inset:auto!important;height:auto!important;min-height:0!important;max-height:none!important;margin:10px 0!important;overflow:visible!important}
 :root body #main .planning-card :is(.planning-job-title,.planning-site,.planning-job-code,.planning-card-meta,.planning-card-meta span){display:block!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;white-space:normal!important;overflow-wrap:anywhere;-webkit-line-clamp:unset!important;line-clamp:unset!important}
 :root body #main .planning-card-head,:root body #main .planning-card-head>div{flex-wrap:wrap!important;overflow:visible!important;min-width:0!important}
 :root body #main .week-more{position:static!important;display:block;margin-top:10px}
 :root body #main .monthly-planner{grid-template-columns:minmax(0,1fr)!important}
 :root body #main .month-grid{grid-template-columns:minmax(0,1fr)!important}
 :root body #main .month-weekdays{display:none!important}
 :root body #main .month-title{display:block!important;-webkit-line-clamp:unset!important;overflow:visible!important;white-space:normal!important;max-height:none!important}
}

