/* Extend the existing HF12 geometry; routes and controls keep their original order. */
.ticket-material,.ticket-weighing{display:contents}
@media screen and (min-width:521px) and (max-width:767px){
 body{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
 .device{width:100%;max-width:none;height:calc(100dvh - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)));padding:16px}
 .device>.brand{height:68px!important}.brand-context button{min-height:44px}.form-field{min-width:0}.form-field input,.form-field select{min-width:0;max-width:100%;font-size:16px}
 dialog{width:min(620px,calc(100% - 32px))}.hf12-access-footer button,.hf12-scan-link{min-height:44px}
}
@media screen and (min-width:768px){
 body{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));height:100dvh;min-height:0}
 .device{width:100%;max-width:1600px;height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)));padding:18px 22px 14px;border-radius:28px;margin:0 auto}
 .device>.brand{height:64px!important;gap:14px;margin-bottom:14px;padding:0 4px!important}
 .brand>a,.brand .hf12{width:52px;height:56px}.brand-context>b{font-size:22px}.brand-context button{min-height:44px;font-size:16px}.header-actions{gap:12px}.header-actions>button{width:50px;min-width:50px;height:50px;min-height:50px!important}
 #screen-content{padding:6px 8px 18px;scroll-padding:20px;scrollbar-gutter:stable}
 #yard-view{max-width:1120px;margin:0 auto;min-width:0}#yard-view>*{min-width:0}
 .page-heading{margin:8px 0 24px}.page-heading h1{font-size:36px;letter-spacing:-.8px}.page-heading p{font-size:18px;max-width:70ch}.eyebrow{font-size:12px}
 .route-card{padding:20px;min-height:88px}.route-card b{font-size:21px}.route-card small{font-size:16px}.route-card>span:last-child{flex-shrink:0}
 .action{min-height:58px}.action b{font-size:21px}.action span{font-size:16px}.note{font-size:14px}.notice{font-size:16px}.status-chip{font-size:14px}.summary{padding:20px}.summary>div{min-width:0;gap:20px;padding:10px 0}.summary strong{overflow-wrap:anywhere}.summary>div>span{min-width:0}
 .two-up,.stats-grid{gap:18px}.stat{padding:22px}.stat>span{font-size:16px}.stat strong{font-size:34px}.stat small{font-size:14px}
 .form-field{min-width:0;font-size:16px}.form-field input,.form-field select,.form-field textarea{min-width:0;max-width:100%;font-size:18px}.form-field input,.form-field select{min-height:58px}.form-field:has(textarea){grid-column:1/-1}
 .work-card{padding:22px}.filter-bar{gap:12px}.filter-bar b{font-size:16px}.filter-bar>a{min-width:100px}
 .main-nav{padding:10px 0 0;gap:16px}.main-nav a{min-height:58px;flex-direction:row;gap:12px;font-size:17px}.main-nav a>span{font-size:26px}.main-nav small{font-size:12px;margin-top:3px;letter-spacing:1.1px}
 .ticket-actions{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:14px;align-items:stretch;padding:12px 0}
 .ticket-actions>.action.go{margin:0;min-height:74px!important;padding:10px 16px}.ticket-actions>.action.go b{font-size:26px}.ticket-actions>.action.go span{font-size:16px}
 .ticket-secondary{gap:12px}.ticket-secondary>.action{height:100%;min-height:62px!important;padding:10px 14px}.ticket-secondary>.action b{font-size:16px}.detail-dock>.action.go b{font-size:23px}
 .message{max-width:640px;width:calc(100% - 48px);bottom:max(24px,env(safe-area-inset-bottom));font-size:17px}
 /* Lists use the same cards in reading order; section headings remain full width. */
 #yard-view[data-layout="cards"]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px;align-content:start}
 #yard-view[data-layout="cards"]>*{grid-column:1/-1;margin-top:0;margin-bottom:0}
 #yard-view[data-layout="cards"]>:is(.route-card,.task-card,.work-card,.stat){grid-column:auto;height:100%}
 #yard-view[data-layout="cards"]>.page-heading{margin:8px 0 12px}
 #yard-view[data-layout="cards"]>.next-work{margin-bottom:6px}
 .task-card{padding:22px}.task-card h2{font-size:23px}.task-card p{font-size:16px}.task-tabs>a{min-height:58px;font-size:17px}
 .reward-pots{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.pot{min-width:0}.pot strong{font-size:48px}.pot .action b{font-size:18px}
 /* Material selection and weighing share the screen, without altering ticket state. */
 #ticket{display:grid;grid-template-columns:minmax(240px,.85fr) minmax(320px,1.15fr);gap:16px 22px;align-items:start;max-width:1360px;margin:0 auto}
 #ticket>:is(h1,.modes,.guidance-card,.guidance-note,.party-summary,.ticket-tools,[data-action="supplier"]){grid-column:1/-1}
 #ticket>h1{position:absolute;width:1px;height:1px;clip-path:inset(50%)}#ticket .modes{margin:0;gap:18px}#ticket .mode{min-height:78px!important}.mode b{font-size:19px}
 .ticket-material,.ticket-weighing{display:block;min-width:0}.ticket-material{position:sticky;top:6px}.ticket-material .record{margin:0 0 16px;min-height:92px!important;padding:18px}.record b,.party-lines b{font-size:24px}.party-registration{font-size:20px}
 #ticket .photo{margin:0;aspect-ratio:2.92}.photo figcaption{font-size:14px;padding:6px 10px}
 #ticket .item-heading{margin:0 0 12px}#ticket .weight-entry-grid{margin:0 0 14px;gap:14px}.weight-entry{padding:16px;min-height:124px!important}.weight-copy>b{font-size:16px}.weight-copy>small,.weight-copy>em{font-size:14px}.weight-copy>strong{font-size:38px}
 .price-entry{margin-top:14px;min-height:80px!important;padding:16px}.price-entry>span{font-size:16px}.price-entry>strong{font-size:32px}.price-entry>small{font-size:14px}.net{padding:14px}.net.bridge strong{font-size:50px}.net.bridge strong.compact{font-size:36px}.net strong,.total strong{max-width:100%;white-space:normal;overflow-wrap:anywhere}.net span{font-size:15px}.total{padding:18px}.total label{font-size:17px}.total strong{font-size:44px}.total strong.compact{font-size:34px}.tax{margin-top:9px;font-size:15px}
 #ticket .ticket-tools{justify-content:flex-end;gap:28px;margin:0}#ticket .ticket-tools>button{font-size:16px}.scale-items{margin-top:18px}.item-row b{font-size:18px}.item-row small{font-size:15px}
 /* Long forms and documents get space, with natural reading and keyboard order. */
 #manual-purchase-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;align-items:start}
 #manual-purchase-form>*{grid-column:1/-1;margin-top:0;margin-bottom:0}#manual-purchase-form>.work-card:not(:first-child){grid-column:auto;height:100%}
 #manual-purchase-form>.work-card:first-child{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 20px;align-items:start}#manual-purchase-form>.work-card:first-child>.form-field{margin:0}#manual-evidence{grid-column:1/-1}
 #manual-purchase-form:not(:has(.manual-line ~ .manual-line))>.manual-line{grid-column:1/-1}
 #manual-purchase-form>h2{margin-top:12px}.manual-line .two-up{gap:16px}.manual-line h3{font-size:22px}.manual-actions{grid-template-columns:1fr 1fr;gap:18px}.manual-actions>.action{margin:0;min-height:66px}
 #archive-filter{display:grid;grid-template-columns:1fr 1fr;gap:12px 20px;align-items:end}#archive-filter>.form-field{margin:0}#archive-filter>.two-up{margin:0}#archive-filter .two-up>.form-field{margin:0}#archive-filter>.action{margin:0;min-height:58px}#archive-error{grid-column:1/-1}
 .document-paper{max-width:920px;margin:22px auto;padding:30px}.document-paper .summary strong{font-size:17px}.document-paper p{font-size:15px}.document-token .token-qr{width:160px}.document-token .token-value{font-size:13px}.token-qr{width:260px}.token-value{font-size:17px}
 .dwt-section[open]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;padding:20px}.dwt-section>summary,.dwt-section>:is(p,.notice,.note,[data-operations],[data-conditional],.action,h2,h3,.dwt-weight){grid-column:1/-1}.dwt-operation{min-width:0}.dwt-section>.form-field{margin:12px 0}
 .grading-load{max-width:1000px;margin:0 auto;padding:20px}.grading-media{max-width:800px;margin:0 auto}.grading-choice span{min-height:62px}.grading-net>strong{font-size:50px}.event-evidence-options{gap:18px}.evidence-item small{font-size:14px}.event-media-view img,.event-media-view video{max-height:65dvh}.clock-card,.clock-summary{min-width:0}
 /* Keep the exact entrance artwork, bounded by screen height in either orientation. */
 .hf12-access-shell{max-width:900px;margin:auto;min-height:100%;grid-template-rows:auto minmax(0,1fr) auto auto;gap:12px;align-content:center;padding:0 12px 14px}
 .hf12-access-shell>.hf12-access-top{grid-row:1}.hf12-access-shell>.hf12-emblem-stage{grid-row:2}.hf12-access-shell>:is(.hf12-access-decision,.hf12-landing-invitation){grid-row:3}.hf12-access-shell>.hf12-access-footer{grid-row:4}
 .hf12-access-bar{height:54px}.hf12-mini-brand{font-size:18px}.hf12-privacy-lines{font-size:24px;height:62px}.hf12-emblem-stage{width:min(100%,460px,calc(100dvh - 330px));min-width:160px;justify-self:center;align-self:center}
 .hf12-access-decision{max-width:680px;width:100%;justify-self:center}.hf12-landing-invitation p{font-size:20px}.hf12-entry-actions>a{min-height:66px;font-size:19px}.hf12-status{font-size:21px}.hf12-preview-label{font-size:14px}.hf12-access-footer>p{font-size:16px}.hf12-access-footer button,.hf12-scan-link{min-height:44px;font-size:14px}.ai-weigh-pilot{font-size:16px}
 .hf12-gold{max-width:480px}.hf12-pair-grid .hf12-emblem-stage{width:100%;min-width:0}.hf12-pair-grid{max-width:800px;margin:auto}.hf12-pair-grid p{font-size:16px}
 /* One scroll container in each dialog; all keyboard keys remain reachable. */
 dialog{width:min(760px,calc(100% - 48px));max-height:calc(100dvh - 48px);padding:26px;border-radius:24px;scroll-padding:20px;scrollbar-gutter:stable}dialog h2{font-size:30px}dialog p{font-size:17px}.subheading{font-size:14px}dialog .action{min-height:60px!important}
 .alpha-keypad{grid-template-columns:repeat(9,minmax(0,1fr));gap:9px}.alpha-keypad button{min-height:52px!important;font-size:25px}.alpha-keypad .wide-key{grid-column:span 4}.alpha-keypad .wide-key:last-child{grid-column:span 5}.search-results{max-height:240px}.search-input{font-size:24px}.dictate-button span{font-size:13px}
 #panel-content:has(>.keypad){display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,1fr);gap:10px 20px;align-items:start}
 #panel-content:has(>.keypad)>:is(.subheading,h2){grid-column:1/-1}#panel-content:has(>.keypad)>:is(.numeric-label,.numeric-display,.field-help,.error,.action){grid-column:1;margin:0}
 #panel-content:has(>.keypad)>.keypad{grid-column:2;grid-row:3/span 7;margin:0;gap:12px}.keypad button{min-height:76px}.numeric-label{font-size:17px}input.numeric-display{font-size:36px;min-height:80px}.field-help{font-size:15px!important}
}
@media screen and (min-width:1080px) and (orientation:landscape){
 .device{padding:18px 28px 12px}.device>.brand{margin-bottom:8px}#screen-content{padding:6px 12px 18px}#yard-view{max-width:1320px}
 #ticket{grid-template-columns:minmax(320px,.9fr) minmax(0,1.3fr);gap:16px 28px}#ticket .weight-entry-grid:has(>:nth-child(2)){grid-template-columns:repeat(2,minmax(0,1fr))}.weight-entry{gap:10px;padding:14px}.weight-step{width:30px;height:30px;font-size:18px}.weight-copy>strong{font-size:34px}.weight-copy{grid-template-columns:1fr}.weight-copy>small{grid-row:2}.weight-edit{font-size:22px}
 .stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.ticket-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:22px}.ticket-actions>.action.go{min-height:68px!important}.main-nav a{min-height:52px}
 #yard-view[data-page="invoice"],#yard-view[data-page="wtd"]{max-width:1000px}#yard-view[data-page="supplier-new"],#yard-view[data-page="settings"]{max-width:1000px}
 .hf12-access-shell{max-width:1120px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;column-gap:48px;padding:0 28px 12px}
 .hf12-access-shell>.hf12-access-top,.hf12-access-shell>.hf12-access-footer{grid-column:1/-1}.hf12-access-shell>.hf12-access-footer{grid-row:3}.hf12-access-shell>.hf12-emblem-stage{grid-column:1;grid-row:2;width:min(100%,460px,calc(100dvh - 270px));align-self:center}.hf12-access-shell>:is(.hf12-access-decision,.hf12-landing-invitation){grid-column:2;grid-row:2;align-self:center}.hf12-access-decision{gap:14px}.hf12-access-footer{padding-top:10px}
 dialog{width:min(900px,calc(100% - 64px))}.alpha-keypad{gap:10px}.alpha-keypad button{min-height:58px!important}.keypad button{min-height:82px}
}
@media screen and (min-width:768px) and (max-height:720px){
 .device{padding:10px 18px}.device>.brand{height:66px!important;margin-bottom:4px}.brand>a,.brand .hf12{height:44px}.brand-context>b{font-size:18px}.brand-context button{min-height:44px}.main-nav{padding-top:4px}.main-nav a{min-height:44px}.main-nav small{display:none}.ticket-actions{padding:6px 0}.ticket-actions>.action.go{min-height:58px!important}.ticket-secondary>.action{min-height:52px!important}.ticket-actions>.action.go b{font-size:22px}dialog{max-height:calc(100dvh - 24px);padding:18px}.keypad button{min-height:52px}.alpha-keypad button{min-height:44px!important}
}
