/* Shared shell for every portal screen. Page-specific grids live inside this frame. */
html{scrollbar-gutter:stable}
.portal-layout{--sidebar-width:280px;--header-height:64px;--page-width:1360px;--page-gutter:32px}
.portal-layout .portal-sidebar.sidebar{width:var(--sidebar-width);top:var(--header-height)}
.portal-layout .main,.portal-layout.account-layout .main{box-sizing:border-box;width:calc(100% - var(--sidebar-width));max-width:none;margin:0 0 0 var(--sidebar-width);padding:calc(var(--header-height) + 28px) var(--page-gutter) 60px;min-height:100dvh}
.page-frame{width:100%;max-width:var(--page-width,1360px);margin-inline:auto;min-width:0}
.page-frame>.page-head{margin:0 0 28px}.page-frame>.page-head h1{font-size:28px;line-height:1.25}.page-frame>.page-head p{margin:8px 0 0}
.page-frame>.stack,.page-frame>.grid,.page-frame>.two-columns,.page-frame>.stats,.page-frame>.live-inbox{width:100%;min-width:0}
.page-frame .reading-stack{max-width:none;margin:0}
.portal-layout .page-frame>.widget-layout{max-width:none;width:100%;margin-inline:0}
.portal-layout .feed-center,.portal-layout .profile-content{min-width:0;width:100%;max-width:none;margin:0}
.portal-layout .profile-content{grid-column:auto}
.portal-layout .profile-header{width:100%;min-width:0}
.portal-layout .account-columns{max-width:none;padding:0;margin:24px 0;gap:24px}
.portal-layout .widget-workspace{max-width:none;padding:0;margin:24px 0}
.portal-layout .account-hero{border-radius:10px;margin:0;width:100%}
.portal-layout .page-frame .card{border-radius:10px}
.portal-layout .grid{gap:24px}.portal-layout .stack{gap:24px}
.portal-layout .community-feed{display:grid;grid-template-columns:240px minmax(0,1fr) 260px;gap:24px}
.portal-layout .community-feed>.left-widgets{display:flex}
.portal-layout .community-feed>.widget-column{display:flex;flex-direction:column;min-width:0;gap:24px}
.portal-layout .commerce-main .toolbar{margin-top:0}
.portal-layout .shop-intro{flex-wrap:wrap;gap:16px}
.portal-layout .shop-intro>.row{flex-wrap:wrap;gap:8px;max-width:100%;min-width:0}
.portal-layout .page-frame>.between{flex-wrap:wrap;gap:16px}
.portal-layout .page-frame>.between>.row{flex-wrap:wrap;gap:8px;max-width:100%;min-width:0}
.portal-layout .product-detail{gap:32px}
.portal-layout .product-summary>.card.pad{padding:28px}
@media(max-width:760px){.portal-layout .product-summary>.card.pad{padding:20px}}
/* Detail artwork keeps its native ratio without letterboxing or cropping. */
.portal-layout .product-detail .listing-image{display:block;width:100%;height:auto;aspect-ratio:auto;max-height:none}
.portal-layout .portal-sidebar .nav-scroll{scrollbar-width:none}
.portal-layout .portal-sidebar .nav-scroll::-webkit-scrollbar{display:none}
.portal-layout .page-frame .toolbar,.portal-layout .page-frame .between{min-width:0}
.portal-layout .page-frame img,.portal-layout .page-frame video{max-width:100%}
.portal-layout .page-frame .table-wrap{max-width:100%;overflow-x:auto}
.portal-layout .page-frame .row.wrap{flex-wrap:wrap}
@media(max-width:1399px){.portal-layout{--sidebar-width:260px;--page-gutter:24px}.portal-layout .community-feed{grid-template-columns:minmax(0,1fr) 240px}.portal-layout .community-feed>.left-widgets{display:none}}
@media(max-width:1200px){.portal-layout .community-feed{grid-template-columns:minmax(0,1fr)}.portal-layout .community-feed>.widget-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));order:2}.portal-layout .profile-tabs{display:flex;flex-wrap:wrap;justify-content:center;margin:0;height:auto;padding:0 12px}.portal-layout .profile-tabs a{padding:18px 12px}.portal-layout .profile-header .profile-body{height:130px}.portal-layout .profile-heading{margin-top:45px;max-width:95%}}
@media(max-width:1050px){.portal-layout{--sidebar-width:0px}.portal-layout .portal-sidebar.sidebar{width:280px;max-width:calc(100vw - 40px)}.portal-layout.account-layout .portal-sidebar.sidebar{visibility:hidden;transform:translateX(-100%)}.portal-layout.account-layout .portal-sidebar.sidebar.open{visibility:visible;transform:none}}
@media(max-width:760px){.portal-layout{--header-height:60px;--page-gutter:16px}.portal-layout .main,.portal-layout.account-layout .main{padding-top:80px;padding-bottom:36px}.page-frame>.page-head{margin-bottom:20px}.page-frame>.page-head h1{font-size:24px}.portal-layout .stack,.portal-layout .grid{gap:18px}.portal-layout .account-columns{grid-template-columns:1fr;gap:18px;margin:20px 0}.portal-layout .widget-workspace{padding:0;margin:20px 0}.portal-layout .community-feed>.widget-column{grid-template-columns:1fr}.portal-layout .profile-tabs{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto}.portal-layout .profile-tabs a{padding:16px 12px}.portal-layout .profile-header .profile-body{height:165px}.portal-layout .profile-header:has(.profile-body[style]) .profile-body{height:145px}.portal-layout .profile-header:has(.profile-body[style]) .profile-heading{margin-top:5px}.portal-layout .commerce-main .two-columns{grid-template-columns:1fr}.portal-layout .market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-layout .account-navigation{position:static}.portal-layout .account-hero{border-radius:10px}}
@media(max-width:380px){.portal-layout{--page-gutter:12px}.portal-layout .market-grid{grid-template-columns:1fr}}

/* Preserve the previous page while the next view is prepared. */
.main[aria-busy="true"]::before{content:'';position:fixed;top:68px;left:0;right:0;height:2px;background:#ff5e3a;z-index:100;opacity:0;animation:route-progress .9s .15s ease-in-out infinite alternate;transform-origin:left}
@keyframes route-progress{from{opacity:.5;transform:scaleX(.15)}to{opacity:1;transform:scaleX(.85)}}
@media(prefers-reduced-motion:reduce){.main[aria-busy="true"]::before{animation:none;opacity:.6}}
