/* Responsive presentation layer, loaded last by both public shells.
   Keep data, permissions and desktop layouts unchanged. */
.hz-scenario-arrow{vertical-align:middle;flex:none}
@media(max-width:768px){
 :root{--mobile-nav-height:calc(64px + env(safe-area-inset-bottom,0px))}
 body[data-ui-edition] #mobile-nav{height:var(--mobile-nav-height);padding:0 6px env(safe-area-inset-bottom,0px);align-items:stretch;box-shadow:0 -1px 8px #17171706}
 body[data-ui-edition] #mobile-nav :is(a,button){min-height:56px;min-width:0;gap:4px;padding:6px 2px;font-size:12px;line-height:18px}
 body[data-ui-edition] #mobile-nav svg{width:21px;height:21px;flex:none}
 body[data-ui-edition] #mobile-nav button{font-size:23px}
 body[data-ui-edition] #mobile-nav button span{font-size:12px}
 body[data-ui-edition] #mobile-nav .active{border-radius:10px;background:#fff8c2}
 body[data-ui-edition] .quick-fab{bottom:calc(var(--mobile-nav-height) + 12px);right:12px}
 body[data-ui-edition] #quick-toggle{width:44px;height:44px;box-shadow:0 2px 8px #17171720}
 /* Home content stays unobscured; secondary help follows the page like other catalogues. */
 body[data-ui-edition]:has(.home-reference) .quick-fab{position:relative;inset:auto;margin:16px 20px calc(var(--mobile-nav-height) + 20px);z-index:auto}
 body[data-ui-edition]:has(.home-reference) #quick-toggle{width:auto;min-width:44px;padding:0 16px;display:flex;align-items:center;gap:8px}
 body[data-ui-edition]:has(.home-reference) #quick-toggle::after{content:"快捷服务";font-size:14px}
 body[data-ui-edition] #toast{bottom:calc(var(--mobile-nav-height) + 64px);max-width:calc(100vw - 32px)}
 body[data-ui-edition]:has(#mobile-nav) footer{padding-bottom:calc(var(--mobile-nav-height) + 28px)}
 body[data-ui-edition] :is(.m-search,.tools-search,.home-search,.search-box){height:auto;min-height:56px;padding:5px 5px 5px 10px}
 body[data-ui-edition] :is(input,select,textarea){font-size:16px}
 body[data-ui-edition] .m-result-top{flex-wrap:wrap;gap:8px}
 body[data-ui-edition] .m-result-top>#module-total{white-space:nowrap;flex:1 1 auto}
 body[data-ui-edition] #module-stage{width:auto;min-width:0;max-width:100%;flex:0 1 160px}
 body[data-ui-edition] .m-detail-footer{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
 /* Keep the login form and its actions in one scroll container on phones. */
 body[data-ui-edition] #dialog.auth-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:0 16px;inset:0}
 body[data-ui-edition] #dialog.auth-dialog .auth-actions{position:static;width:100%;padding:16px 0 calc(16px + env(safe-area-inset-bottom,0px));background:transparent;border:0}
 body[data-ui-edition] #dialog.auth-dialog .auth-panel{padding-bottom:24px}
}
@media(max-width:767px){
 /* One card owns both media and copy: no desktop padding on the mobile grid. */
 body[data-ui-edition] #app .home-reference .section.hz-scenarios{padding:28px 16px 32px}
 body[data-ui-edition] .hz-scenarios-heading{padding:20px 0}
 body[data-ui-edition] .hz-scenarios-heading h2{font-size:25px;line-height:1.35;margin:10px 0}
 body[data-ui-edition] .hz-scenarios-heading p{font-size:14px;line-height:1.65}
 body[data-ui-edition] .hz-scenario-grid{grid-template-columns:minmax(0,1fr);gap:12px}
 body[data-ui-edition] .hz-scenario-grid>a{display:grid;grid-template-columns:clamp(80px,24vw,108px) minmax(0,1fr);align-items:stretch;gap:14px;padding:14px;border:1px solid #e4e3db;border-top:2px solid #ffe600;border-radius:8px;background:#f7f7f2;min-height:0}
 body[data-ui-edition] .hz-scenario-grid>a>div{padding:0;min-width:0;align-self:center}
 body[data-ui-edition] .hz-scenario-grid .hz-scenario-image{width:100%;height:100%;min-height:112px;aspect-ratio:auto;object-fit:cover;border-radius:5px;align-self:stretch}
 body[data-ui-edition] .hz-scenario-grid>a>div>span{font-size:10px;line-height:1.5}
 body[data-ui-edition] .hz-scenario-grid h3{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:17px;line-height:1.5;margin:7px 0}
 body[data-ui-edition] .hz-scenario-grid p{font-size:13px;line-height:1.7;color:#5e5d57}
 /* A phone is a reading list, not a squeezed desktop catalogue. */
 body.tools-page[data-ui-edition] .tool-grid{grid-template-columns:minmax(0,1fr);gap:12px}
 body.tools-page[data-ui-edition] .tool-card>.tool-tile{display:flex;flex-direction:row;align-items:flex-start;gap:14px;min-height:0;padding:16px}
 body.tools-page[data-ui-edition] .tool-tile-copy :is(h3,p){display:block;overflow:visible;-webkit-line-clamp:unset;white-space:normal}
 body.tools-page[data-ui-edition] .tool-tile-copy h3{font-size:16px;line-height:1.5}
 body.tools-page[data-ui-edition] .tool-tile-copy p{font-size:13px;line-height:1.65}
 body.tools-page[data-ui-edition] .tool-card>.tool-info{margin-top:0;min-height:44px}
 /* Remove inherited desktop minimum heights from the home guide. */
 body[data-ui-edition] .home-reference .home-guide{padding-top:32px;padding-bottom:32px}
 body[data-ui-edition] .home-reference .home-guide .section-title{margin-bottom:24px}
 body[data-ui-edition] .home-reference :is(.home-conditions,.home-rights){gap:12px}
 body[data-ui-edition] .home-reference :is(.home-conditions,.home-rights,.home-process)>article{height:auto;min-height:0;padding:18px 16px}
 body[data-ui-edition] .home-reference .home-process>article>b{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:15px}
 body[data-ui-edition] .home-reference .home-process>article{border-bottom:1px solid #e4e3db}
 body[data-ui-edition] .home-reference .home-guide-group{margin-top:24px}
}
@media(max-width:480px){
 body[data-ui-edition]>header:not(#top){padding-inline:12px;gap:8px;height:64px}
 body[data-ui-edition] .header-actions{gap:4px}
 body[data-ui-edition] .header-actions .console-link{width:44px;min-width:44px;min-height:44px}
 body[data-ui-edition] .header-actions #city{width:80px!important;min-width:80px;max-width:80px;flex:0 0 80px;padding:8px 26px 8px 10px;appearance:none;-webkit-appearance:none;line-height:normal;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2354544e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:12px 8px}
 body[data-ui-edition] .header-actions #user-button{min-width:80px;max-width:96px;padding-inline:8px;font-size:14px}
 body[data-ui-edition] .brand img{width:88px;max-width:88px}
}
@media(max-width:359px){
 body[data-ui-edition]>header:not(#top){padding-inline:8px;gap:4px}
 body[data-ui-edition] .brand img{width:80px;max-width:80px}
 body[data-ui-edition] .header-actions #user-button{width:88px;min-width:88px;max-width:88px;padding-inline:6px}
 body[data-ui-edition] .hz-scenario-grid h3{font-size:15px;gap:4px}
 body[data-ui-edition] .hz-scenario-grid>a{gap:12px;padding:12px}
}

/* Home reading order: introduction, next-step scenarios, service directory, guide.
   Keep both sections on one content axis with a measured transition. */
body[data-ui-edition] #app .home-reference>.hero+.hz-scenarios{padding-top:24px;padding-bottom:32px}
body[data-ui-edition] #app .home-reference>.hz-scenarios+.home-services{padding-top:32px!important;padding-bottom:48px}
@media(max-width:767px){
 body[data-ui-edition] #app .home-reference>.hero+.hz-scenarios{padding:20px 20px 24px}
 body[data-ui-edition] #app .home-reference>.hz-scenarios+.home-services{padding-top:24px!important;padding-bottom:32px}
}

/* Compact the service directory without changing type scale, content or columns. */
body[data-ui-edition] #app .home-reference #services .home-service-card{min-height:200px;padding:20px}
body[data-ui-edition] #app .home-reference #services .home-service-top{margin-bottom:12px}
body[data-ui-edition] #app .home-reference #services .home-service-copy{margin-bottom:16px}
body[data-ui-edition] #app .home-reference #services .home-service-footer{padding-top:10px}
@media(max-width:768px){
 body[data-ui-edition] #app .home-reference #services .home-service-card{min-height:0;padding:16px}
 body[data-ui-edition] #app .home-reference #services .home-service-top{margin-bottom:0}
 body[data-ui-edition] #app .home-reference #services .home-service-copy{margin-bottom:0}
 body[data-ui-edition] #app .home-reference #services .home-service-footer{padding-top:0}
}
@media(max-width:768px){
 /* The visible mobile auth topbar owns closing; do not leave an obscured duplicate in Tab order. */
 body[data-ui-edition] #dialog.auth-dialog>.close{display:none}
}
