/* phone.css: phone design pass (390/430 px). Presentation only. 8-pt spacing rhythm, 4-step type scale, 44 px targets,
   no horizontal scroll, wide tables as stacked rows, wrapping status chips, safe-area insets, light color scheme pinned. */
:root{color-scheme:light}
@media (max-width:480px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body{font-size:15px;line-height:1.5}
 /* type scale: 26 / 18 / 15 / 13 */
 section[id^="t-"] h1,section[id^="t-"] h2.h1{font-size:26px;line-height:1.2;letter-spacing:-.01em}
 section[id^="t-"] .card h3,section[id^="t-"] .card-h h3{font-size:16px;line-height:1.3}
 .small,.muted.small,.card .small,small{font-size:13px!important;line-height:1.45}
 .mono,code,.chip{font-size:12px}
 /* safe areas + rhythm */
 header.top{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-top:env(safe-area-inset-top)}
 main{padding-left:max(16px,env(safe-area-inset-left))!important;padding-right:max(16px,env(safe-area-inset-right))!important;max-width:100vw;box-sizing:border-box}
 section[id^="t-"]{padding-left:0!important;padding-right:0!important;max-width:100%;box-sizing:border-box}
 section[id^="t-"] .card{padding:16px!important;margin-bottom:16px!important;border-radius:8px;max-width:100%;box-sizing:border-box;min-width:0}
 section[id^="t-"] .card .card{padding:12px!important;margin-bottom:12px!important}
 section[id^="t-"] *{min-width:0}
 .card-h{gap:8px!important;margin-bottom:12px!important;align-items:flex-start!important}
 .card-h>h3,.card-h>h4{flex:1 1 60%}
 /* status chips: wrap instead of running off the card */
 .chip,.card-h .chip,.card-h>span{white-space:normal!important;max-width:100%;overflow-wrap:anywhere;text-align:left;line-height:1.35}
 /* 44 px touch targets */
 section[id^="t-"] button,section[id^="t-"] .btn,section[id^="t-"] summary,section[id^="t-"] [role=button],section[id^="t-"] a.btn,section[id^="t-"] select,
 .linkbtn,.link,button.tick,button.wp,#btab button{min-height:44px}
 button.tick,button.wp,.linkbtn{min-width:44px;display:inline-flex;align-items:center;justify-content:center}
 section[id^="t-"] summary{display:flex;align-items:center;gap:8px}
 section[id^="t-"] input:not([type=checkbox]):not([type=radio]),section[id^="t-"] select,section[id^="t-"] textarea,header.top select{font-size:16px!important;min-height:44px;box-sizing:border-box;max-width:100%}
 section[id^="t-"] input[type=checkbox],section[id^="t-"] input[type=radio]{width:22px;height:22px;margin:11px}
 section[id^="t-"] label:has(>input[type=checkbox]),section[id^="t-"] label:has(>input[type=radio]){min-height:44px;display:flex;align-items:center;gap:4px}
 section[id^="t-"] input[type=file]{min-height:44px;width:100%}
 section[id^="t-"] a.small.link,section[id^="t-"] a.link{display:inline-flex;align-items:center;min-height:44px}
 header.top select{max-width:52vw;text-overflow:ellipsis}
 button[disabled],.btn[disabled]{opacity:1!important;color:#6B6F69!important;background:#ECEDEA!important;border-color:#D7D9D4!important}
 /* tables: stacked label/value rows */
 table.ph-stack,table.ph-stack tbody,table.ph-stack tr,table.ph-stack td,table.ph-stack th{display:block;width:auto!important}
 table.ph-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 table.ph-stack tr{border:1px solid var(--rule,#DDD);border-radius:8px;padding:8px 12px;margin:0 0 8px;background:#fff}
 table.ph-stack tr:has(>th:only-child),table.ph-stack tfoot tr{background:#F6F6F3}
 table.ph-stack td,table.ph-stack tbody th{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:6px 0!important;border:0!important;text-align:right!important;white-space:normal!important;overflow-wrap:anywhere}
 table.ph-stack td+td,table.ph-stack th+td{border-top:1px solid #EFEFEC!important}
 table.ph-stack td::before,table.ph-stack tbody th::before{content:attr(data-label);flex:0 0 42%;text-align:left;color:var(--ink2,#555);font-size:12px;font-family:inherit;font-weight:500;letter-spacing:0}
 table.ph-stack td:not([data-label])::before,table.ph-stack td[data-label=""]::before{content:none}
 table.ph-stack td:first-child{font-weight:600;text-align:left!important;justify-content:flex-start}
 table.ph-stack td:first-child::before{content:none}
 table{max-width:100%}
 .tbl-scroll,[class*="scroll"]>table{max-width:100%}
 pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
 img,svg,canvas{max-width:100%;height:auto}
 /* sticky bottom bars respect the home indicator */
 #btab{padding-bottom:env(safe-area-inset-bottom)}
}
@media (max-width:480px){
 section[id^="t-"] .chip,section[id^="t-"] th,section[id^="t-"] td.mono,section[id^="t-"] button.tick,section[id^="t-"] .wp,section[id^="t-"] .step,section[id^="t-"] .t,
 section[id^="t-"] .ck-tag,section[id^="t-"] .ck-ex,section[id^="t-"] dd.h,section[id^="t-"] svg text,section[id^="t-"] .lbl{font-size:12px!important}
 section[id^="t-"] .kpi span,section[id^="t-"] .card-h span,section[id^="t-"] dt span,section[id^="t-"] li>span,section[id^="t-"] td span,section[id^="t-"] td b,section[id^="t-"] .card-h b{font-size:max(12px,1em)}
 section[id^="t-"] td input[type=checkbox],section[id^="t-"] .sn-pin{width:28px;height:28px;margin:8px}
}
@media (max-width:480px){
 table.ph-stack td,table.ph-stack tbody th{display:block!important;text-align:right!important}
 table.ph-stack td::before,table.ph-stack tbody th::before{float:left;width:42%;margin-right:8px}
 table.ph-stack td:first-child{text-align:left!important}
 table.ph-stack td::after{content:"";display:block;clear:both}
 table.ph-stack td:first-child:has(>input:only-child){float:right;padding:0!important}
}
@media (max-width:480px){
 section[id^="t-"] div:has(>.btn+.btn),section[id^="t-"] div:has(>button+button){flex-wrap:wrap;gap:8px}
 section[id^="t-"] div:has(>.btn+.btn)>.btn{flex:1 1 auto;white-space:normal}
}
@media (max-width:480px){
 #t-export .card .btn{width:100%;box-sizing:border-box}
 #t-export .card .card{padding:0!important;border:0!important;background:transparent!important}
}
