/* Phone layout: keep each surface within its own available width. */
@media(max-width:767px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 .shell{display:block}.main,.content,#page{width:100%;min-width:0}
 .sidebar{position:static;width:auto;padding:0;border:0}.sidebar>a,.sidebar .navlabel,.sidebar-bottom{display:none}
 .sidebar .nav{position:fixed;inset:auto 0 0;z-index:50;display:flex;flex-direction:row;justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;gap:4px;padding:7px 10px calc(7px + env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--line);scrollbar-width:none}
 .sidebar .nav::-webkit-scrollbar{display:none}.sidebar .nav a,.sidebar .nav a:nth-child(n){display:flex;flex:0 0 auto;flex-direction:column;gap:5px;min-width:76px;max-width:112px;padding:8px;font-size:11px;text-align:center;line-height:1.3;white-space:normal}
 .sidebar .nav a.active{background:color-mix(in srgb,var(--blue) 12%,var(--bg))}
 .topbar{height:auto;min-height:70px;padding:12px 16px;flex-wrap:wrap;gap:8px}.mobile-logo{display:block;font-size:28px}.crumb{display:none}.topbar .tools{gap:8px;flex-wrap:wrap;max-width:100%;min-width:0}.topbar .tools .theme-toggle span{display:none}.topbar .mode-switch{font-size:11px;padding:7px}.topbar .avatar{display:none}
 .content{padding:24px 16px calc(110px + env(safe-area-inset-bottom));container-type:inline-size}
 .heading,.panel-head,.pay-heading{flex-wrap:wrap;gap:12px}.heading{align-items:flex-start}.heading h1{font-size:27px}.heading .row-actions{width:100%}.row-actions,.tabs,.performance-tabs,.legend,.market-tabs{flex-wrap:wrap;max-width:100%}
 .grid,.form-grid,.cards,.finance-stats,.portfolio-stats,.portfolio-chart-grid,.market-selection-layout,.pay-layout,.plastic-cards,.balance-account-grid{grid-template-columns:minmax(0,1fr)!important;gap:16px}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat{padding:16px;min-height:0}.stat-value{font-size:clamp(23px,6vw,29px);overflow-wrap:anywhere}.panel{padding:18px}.panel-head{margin-bottom:18px}
 .grid>*,.form-grid>*,.heading>*,.panel-head>*,.market-selection-layout>*,.pay-layout>*,.home-v2 main>*,.hx-body>*{min-width:0}
 .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-wrap table{min-width:540px}.table-wrap th,.table-wrap td{padding:12px 10px}
 .chart{max-width:100%;height:210px}.asset-account-split{gap:10px}.asset-account-split b{overflow-wrap:anywhere}.asset-account-split>div+div{padding-left:10px}.account{flex-wrap:wrap}.account .mono,.secret{overflow-wrap:anywhere}.footer{flex-wrap:wrap}
 input:not([type=range]):not([type=checkbox]),select,textarea{font-size:16px!important;min-width:0;max-width:100%}input[type=range]{min-width:0;max-width:100%;touch-action:pan-y}.field{min-width:0}button,.btn{min-height:40px}.btn{white-space:normal;line-height:1.4}
 dialog{width:calc(100% - 24px);max-width:490px;max-height:calc(100dvh - 32px);padding:22px;overflow-y:auto;overscroll-behavior:contain}dialog form{min-width:0}dialog .close{min-width:40px;min-height:40px}.setting{flex-wrap:wrap}.setting>div{min-width:0}.detail{gap:12px;flex-wrap:wrap}
 .market-top,.market-controls{flex-wrap:wrap}.market-capital{max-width:none;text-align:left}.compact-toolbar .catalog-filters,.catalog-filters:has(.category-filter-buttons){width:100%;max-width:none;display:flex;flex-direction:column;align-items:stretch}
 .risk-filter-buttons,.category-filter-buttons{display:flex;flex-wrap:wrap;gap:7px;width:100%}.risk-filter-buttons button,.category-filter-buttons button{flex:0 1 auto;font-size:13px;white-space:normal;padding:9px 11px;line-height:1.3}
 .compact-catalog-grid{grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:auto;gap:14px}.marketplace-view .compact-catalog-card{min-height:0;padding:18px}.marketplace-view .compact-catalog-card h2{min-height:0}.compact-card-top{flex-wrap:wrap}.compact-catalog-card p{min-height:0}.strategy-budget{width:100%;max-width:none}.budget-heading,.budget-top,.budget-bottom{flex-wrap:wrap}.budget-amount{min-width:0;flex:1 1 150px}.catalog-pagination{flex-wrap:wrap;gap:10px}
 .pay-wallet,.pay-fields,.pay-transfer-routes{grid-template-columns:minmax(0,1fr);gap:14px}.pay-cards{display:block}.pay-composer,.pay-recent,.pay-balance{padding:18px}.pay-operation-tabs{gap:3px}.pay-operation-tabs button{font-size:13px;padding:10px 4px;min-width:0}.pay-direction{flex-wrap:wrap}.pay-quick{flex-wrap:wrap}.pay-transaction{flex-wrap:wrap}.pay-transaction-amount{margin-left:auto}.pay-balance-value{font-size:30px;white-space:normal}.pay-cards .pay-caption{display:block}.loan-guide-facts{grid-template-columns:1fr}.loan-flow-cards>div{padding:12px;gap:8px}.plastic-card{padding:20px;min-width:0}.plastic-card-number{font-size:clamp(16px,5vw,23px);letter-spacing:1px}.plastic-card-details{overflow-wrap:anywhere}
 .home-v2 .home-nav,.home-v2 main,.home-v2 .home-footer{width:calc(100% - 32px);max-width:100%}.hj-home .home-nav{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px;padding:18px 0;min-height:0}.hj-home .home-nav .logo{font-size:32px}.hj-home .home-nav .logo small{font-size:9px;letter-spacing:1.5px}.hj-home .home-nav nav{display:none}.hj-home .home-nav-actions{width:100%;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}.hj-home .home-nav-actions .theme-toggle span{display:none}.hj-home .home-nav-actions .home-button-primary{padding:10px 16px;min-height:44px;font-size:14px}
 .hj-home .hj-hero{padding:32px 0}.hj-home .hj-hero-heading{flex-direction:column-reverse;gap:14px;text-align:center;margin-top:14px}.hj-home .hj-hero-heading h1{font-size:clamp(30px,7.6vw,46px);line-height:1.13;letter-spacing:-.04em;max-width:100%}.hj-hero-cube{width:120px}.hj-home .hj-hero>p{font-size:16px;line-height:1.65;margin:22px auto}.home-actions{display:flex;flex-wrap:wrap;gap:12px}.hj-home .home-actions .home-button{width:100%;min-height:48px}.hj-tags{gap:7px}.hj-tags span{padding:8px;font-size:12px}
 .hj-benefits,.hx-body,.hj-home .hj-start-designed{grid-template-columns:minmax(0,1fr)}.hj-home .hj-benefits article{padding:22px}.home-v2 .home-section-heading h2{font-size:clamp(27px,7vw,34px);letter-spacing:-.035em;line-height:1.18}.hx-explore{padding:22px 16px;border-radius:20px}.hx-topline{flex-wrap:wrap;gap:10px}.hx-tabs{width:100%;padding:4px;gap:3px;border-radius:12px;margin-bottom:26px}.hx-tabs button{flex:1;min-width:0;padding:10px 5px;font-size:12px;white-space:normal;border-radius:8px}.hx-body{gap:26px;min-height:0}.hx-body .hj-return{padding:19px;transform:none;min-width:0}.hj-return>div{gap:10px;flex-wrap:wrap}.hj-return>div b{white-space:normal}.hx-loan-result strong{font-size:28px}.hx-body .home-button{width:100%}.hj-home .hj-start-designed{padding:26px 20px;gap:24px}.hj-start-intro h2{font-size:32px}.hj-access-path li{grid-template-columns:42px minmax(0,1fr);gap:12px}.hj-path-number{width:42px;height:42px;border-radius:12px}.hj-access-path:before{left:20px}.hj-path-copy h3{font-size:19px}.hj-path-tag{line-height:1.5}.hj-start-designed .hj-start-action .home-button{width:100%;padding:14px}.hj-home .hj-end{flex-direction:column;align-items:stretch;gap:20px;padding:24px}.hj-end h2{font-size:30px}.home-footer{flex-wrap:wrap;padding-bottom:28px}.home-footer p{min-width:0;max-width:100%}
 #toast{bottom:calc(95px + env(safe-area-inset-bottom));width:max-content;max-width:calc(100vw - 32px)}
}
@media(max-width:360px){.stats{grid-template-columns:minmax(0,1fr)}.topbar{padding:12px}.content{padding-left:12px;padding-right:12px}.topbar .tools{gap:5px}.panel{padding:15px}.asset-account-split{grid-template-columns:1fr}.asset-account-split>div+div{border-left:0;border-top:1px solid var(--line);padding:12px 0 0}}
@media(max-width:767px){
 .plastic-card{aspect-ratio:auto;min-height:205px}.plastic-card>strong{font-size:clamp(15px,4.6vw,23px);letter-spacing:1px;white-space:normal}.plastic-card footer{gap:12px;flex-wrap:wrap}.plastic-card footer>b{max-width:110px;overflow-wrap:anywhere}.card-chip{margin-top:18px}
 .budget-bottom>span{white-space:normal;overflow-wrap:anywhere}.strategy-filters-panel{padding:16px}.market-selection-layout .strategy-budget{padding:16px}.budget-heading{flex-wrap:wrap}.pay-amount input{font-size:30px!important}.loan-term-ticks button{min-width:0;flex:1;font-size:11px}.home-v2 .home-footer{display:flex;flex-direction:column;align-items:flex-start;gap:20px}.home-v2 .home-footer p{width:100%}
}
/* Compact mobile masthead: brand left, controls grouped right. */
@media(max-width:767px){
 .hj-home .home-nav{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:16px 0}
 .hj-home .home-nav .hj-brand{min-width:0;align-self:center}
 .hj-home .home-nav .logo{font-size:34px;letter-spacing:-2px}
 .hj-home .home-nav .logo small{font-size:8px;letter-spacing:1px;line-height:1.5;margin-top:7px;white-space:normal;max-width:112px}
 .hj-home .home-nav-actions{display:grid;grid-template-columns:auto auto;width:auto;gap:7px 10px;align-items:center;justify-content:end}
 .hj-home .home-nav-actions .language-picker{grid-column:1;grid-row:1;justify-self:end}
 .hj-home .home-nav-actions .theme-toggle{grid-column:2;grid-row:1;justify-self:end;width:40px;min-height:40px;padding:8px}
 .hj-home .home-nav-actions .language-picker summary{min-height:40px;padding:7px;gap:4px;font-size:12px}
 .hj-home .home-nav-actions .language-picker .icon{width:17px;height:17px}
 .hj-home .home-nav-actions>.hj-login{grid-column:1;grid-row:2;font-size:14px;min-height:40px;padding:7px 2px}
 .hj-home .home-nav-actions>.home-button-primary{grid-column:2;grid-row:2;min-height:40px;padding:9px 13px;font-size:13px;border-radius:24px}
}
@media(max-width:360px){
 .hj-home .home-nav{gap:8px}.hj-home .home-nav .logo{font-size:30px}.hj-home .home-nav .logo small{font-size:7px;letter-spacing:.6px;max-width:88px}
 .hj-home .home-nav-actions{gap:6px}.hj-home .home-nav-actions>.home-button-primary{font-size:12px;padding:9px 10px}
}
.home-menu-toggle{display:none}.home-menu-panel{display:contents}
@media(max-width:767px){
 .hj-home .home-nav{display:flex;flex-wrap:nowrap;justify-content:space-between;position:relative;gap:16px;padding:18px 0}
 .hj-home .home-nav-actions{display:flex;align-items:center;gap:14px;width:auto}
 .hj-home .home-nav-actions>.hj-login{font-size:15px;padding:10px 4px;min-height:44px}
 .home-menu-toggle{display:grid;place-items:center;min-width:44px;width:44px;height:44px;padding:10px;border:1px solid var(--home-line);border-radius:12px;background:var(--home-surface);color:var(--home-fg)}
 .home-menu-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
 .hj-home .home-menu-panel{display:none;position:absolute;right:0;top:calc(100% - 4px);z-index:100;width:min(290px,100%);padding:16px;background:var(--home-surface);border:1px solid var(--home-line);border-radius:16px;box-shadow:0 16px 48px #0003}
 .hj-home .menu-open .home-menu-panel{display:grid;grid-template-columns:1fr auto;gap:14px}
 .hj-home .home-menu-panel .language-picker{grid-row:1;grid-column:1;justify-self:stretch}
 .hj-home .home-menu-panel .language-picker summary{justify-content:flex-start;min-height:44px;font-size:14px;padding:10px}
 .hj-home .home-menu-panel .language-options{left:0;right:auto;min-width:180px}
 .hj-home .home-menu-panel .theme-toggle{grid-row:1;grid-column:2;min-height:44px;width:44px}
 .hj-home .home-menu-panel>.home-button-primary{grid-column:1/-1;width:100%;min-height:46px;font-size:15px;padding:12px 20px}
 .home-menu-toggle[aria-expanded=true]{color:var(--home-blue);border-color:var(--home-blue)}
}
