/* Phone-only composition; shared desktop components keep their layout. */
.portal-menu-button,.portal-current-section,.mobile-filter-toggle{display:none}
#portal-navigation{background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-border);padding:18px;max-width:380px;width:calc(100% - 24px);max-height:calc(100dvh - 24px)}
#portal-navigation header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
#portal-navigation h2{font-size:20px;margin:0}
#portal-navigation header button{width:44px;height:44px;font-size:24px}
#portal-navigation nav{display:grid;gap:4px}
#portal-navigation nav a{display:flex;align-items:center;gap:12px;padding:12px;min-height:46px;border-radius:9px;color:var(--ui-text);font-size:14px}
#portal-navigation nav a[aria-current=page]{background:var(--ui-tint);color:var(--ui-accent);font-weight:700}
#portal-navigation nav svg,#portal-navigation nav img{width:22px;height:22px}
html.portal-menu-open{overflow:hidden}
.loan-collateral-controls input[type=range]{width:100%;height:40px;margin:0;accent-color:var(--ui-accent)}
.loan-collateral-limits{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:var(--ui-muted)}
.loan-collateral-presets{display:flex;gap:6px;margin-top:10px}
.shell .loan-collateral-presets .btn{flex:1;padding:8px;min-height:40px}
@media(max-width:767px){
 .shell .sidebar,.shell .mobile-section-nav{display:none!important}
 .shell .topbar{position:sticky;top:0;z-index:60;display:flex;flex-wrap:wrap;padding:8px 14px;gap:6px;min-height:64px}
 .shell .portal-menu-button{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--ui-border);background:var(--ui-surface);color:var(--ui-text);border-radius:10px;padding:10px}
 .portal-menu-button svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round}
 .shell .mobile-logo{font-size:25px;margin-right:auto}
 .shell .topbar .tools{gap:4px;flex-wrap:nowrap}
 .shell .topbar .tools>button{min-width:36px;width:36px;padding:7px}
 .shell .topbar .language-native{width:64px;padding:5px}
 .shell .portal-current-section{display:block;width:100%;font-size:13px;font-weight:600;line-height:20px;padding:0 0 3px;color:var(--ui-muted)}
 .shell .content{padding:18px 14px calc(24px + env(safe-area-inset-bottom))}
 .shell .heading{gap:12px}.shell .heading .row-actions{display:flex;flex-direction:row;gap:8px}.shell .heading .row-actions .btn{flex:1;width:auto;min-width:0;padding:10px;font-size:12px}
 .shell .banner{padding:10px 12px;margin-bottom:14px;font-size:11px}
 .shell .market-selection-layout{gap:10px;margin-bottom:12px}
 .shell .strategy-filters-panel{padding:10px 12px}
 .shell .mobile-filter-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;border:0;background:transparent;color:var(--ui-text);font:inherit;font-weight:600;text-align:left;padding:6px}
 .shell .strategy-filters-panel:not(.mobile-filters-open) #mobile-filter-content{display:none}
 .shell #mobile-filter-content .filter-panel-heading{display:none}
 .shell #mobile-filter-content .catalog-filters{gap:8px;margin-top:10px}
 .shell #mobile-filter-content .risk-filter-buttons,.shell #mobile-filter-content .category-filter-buttons{gap:5px}
 .shell #mobile-filter-content button{font-size:12px;padding:8px;min-height:40px}
 .shell .market-capital{display:none}
 .shell .ux-funds{padding:12px 14px}.shell .ux-funds strong{font-size:22px}.shell .ux-funds p{font-size:12px;margin:6px 0 0}
 .shell .compact-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px;grid-auto-rows:auto}
 .shell .compact-catalog-card{padding:12px;min-width:0;height:100%;gap:0}
 .shell .compact-card-top{gap:8px;align-items:flex-start;flex-direction:column;min-height:56px;margin-bottom:0}
 .shell .compact-card-top .strategy-icon{width:28px;height:28px}
 .shell .compact-card-top .pill{font-size:10px;padding:4px 6px;white-space:normal;line-height:1.3}
 .shell .compact-catalog-card h2{font-size:14px;line-height:18px;min-height:36px;margin:8px 0 4px;overflow-wrap:anywhere;align-items:flex-start}
 .shell .compact-catalog-card .compact-asset{font-size:10px;min-height:32px;flex-wrap:wrap}
 .shell .compact-catalog-card .compact-asset>*{max-width:100%;flex-wrap:wrap}
 .shell .compact-catalog-card .demo-target-return{padding:8px 0;display:flex;flex-wrap:wrap;gap:3px}
 .shell .compact-catalog-card .demo-target-return strong{font-size:24px;line-height:1.2}
 .shell .compact-catalog-card .demo-target-return :is(small,span){font-size:10px;line-height:1.4}
 .shell .compact-catalog-card .capital-access{padding-top:8px;margin-bottom:8px}
 .shell .compact-catalog-card .strategy-status{flex-wrap:wrap;gap:3px;font-size:10px}
 .shell .compact-catalog-card .catalog-actions{display:flex;flex-direction:column-reverse;gap:2px;align-items:stretch}
 .shell .compact-catalog-card .catalog-actions :is(.btn,.text-btn){width:100%;min-height:44px;padding:8px 3px;font-size:12px;text-align:center;justify-content:center}
 .shell .compact-catalog-card .futures-usage{font-size:10px}
 #toast{bottom:calc(16px + env(safe-area-inset-bottom))}
 #modal.mobile-review[open]{display:flex;flex-direction:column;overflow:hidden;padding:0;width:calc(100% - 20px);height:min(720px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);background:var(--ui-surface);color:var(--ui-text)}
 .mobile-review-head{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:8px;padding:14px 16px;border-bottom:1px solid var(--ui-border)}
 .mobile-review-head h2{font-size:20px;line-height:1.25;margin:0}
 #modal.mobile-review .close{position:static;flex:0 0 44px;width:44px;height:44px;margin:0}
 .mobile-review-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:6px 16px 16px;flex:1}
 .mobile-review-body .detail{display:grid;grid-template-columns:1fr;gap:4px;padding:10px 0;font-size:13px}
 .mobile-review-body p{font-size:12px;line-height:1.5}
 .mobile-review-footer{flex:0 0 auto;padding:12px 16px max(14px,env(safe-area-inset-bottom));border-top:1px solid var(--ui-border);background:var(--ui-surface)}
 .mobile-review-footer>label{font-size:13px;line-height:1.4;min-height:36px}
 .mobile-review-footer #workflow-error:empty{display:none}
 .mobile-review-footer #workflow-error{font-size:12px;max-height:54px;overflow:auto;margin:6px 0}
 .mobile-review-footer .row-actions{display:grid;grid-template-columns:1fr 1.5fr;gap:8px;margin-top:10px}
 .mobile-review-footer .btn{width:100%;min-height:46px;padding:10px 8px;font-size:13px}
}

/* Equal mobile balance tiles and a single row of overview actions. */
@media(max-width:767px){
 .shell .ux-balance-split{grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;gap:10px}
 .shell .ux-balance-split>div{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(30px,auto) auto;align-content:center;justify-content:stretch;gap:4px;padding:12px 16px;min-height:88px}
 .shell .ux-balance-split span{margin:0;font-size:12px;line-height:15px}
 .shell .ux-balance-split b{font-size:clamp(18px,5.4vw,22px);line-height:1.25;white-space:nowrap;font-variant-numeric:tabular-nums}
 .shell .heading .overview-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;max-width:none}
 .shell .heading .overview-actions .btn{width:100%;min-width:0;min-height:48px;align-self:stretch;justify-content:center;padding:8px;font-size:12px;line-height:1.35;gap:7px}
 .shell .heading .overview-actions .icon{flex:0 0 18px;width:18px;height:18px}
}
