/* LEGEND: fit the page, preserve desktop layouts and native interactions. */
.mobile-account-nav312>summary{display:none}
@media(max-width:760px){
 html{scroll-padding-top:145px}
 html body.portal-v3{min-width:0;width:100%;overflow-x:clip}
 html body.portal-v3 *,html body.portal-v3 *::before,html body.portal-v3 *::after{box-sizing:border-box}
 html body.portal-v3 :is(main,.wrap,.page-content,.shop-main,.donate-main,.dashboard-layout,.dashboard-main,.dashboard-view,.legend-wiki,.wk-layout,.wk-body,#wk-content){min-width:0;max-width:100%}
 html body.portal-v3 :is(.wrap,.shop-main,.donate-main,.account-page,.download273){width:100%;padding-left:14px!important;padding-right:14px!important}
 html body.portal-v3 :is(h1,h2,h3,h4,p,li,label,summary){overflow-wrap:break-word}
 html body.portal-v3 :is(input,select,textarea){max-width:100%;min-width:0;font-size:16px!important}
 html body.portal-v3 :is(button,a,summary){touch-action:manipulation}
 html body.portal-v3 :is(button,select,input[type=submit],summary){min-height:42px}
 html body.portal-v3 main img{max-width:100%}
 html body.portal-v3 main iframe{max-width:100%;min-width:0}
 html body.portal-v3 :is(.portal-section-heading h2,.page-header h1,.shop-heading h1,.donate-hero h1,.download-hero273 h1){font-size:clamp(26px,7vw,36px)!important;line-height:1.18!important;text-wrap:balance}
 /* Header: each control keeps its own space, including signed-in accounts. */
 html body.portal-v3 header.portal-header>.shop-header-inner{padding:8px 12px!important;gap:8px!important;grid-template-columns:34px minmax(0,1fr) 40px 36px!important;grid-template-areas:'brand realm toggle discord' 'account account account account'!important;align-items:center}
 html body.portal-v3 header.portal-header .shop-brand{grid-area:brand;width:34px!important;min-width:0!important;margin:0!important}
 html body.portal-v3 header.portal-header .shop-brand img{width:34px!important;height:auto!important}
 html body.portal-v3 header.portal-header .portal-server-picker{grid-area:realm;width:100%!important;min-width:0!important;max-width:200px!important;margin:0!important}
 html body.portal-v3 header.portal-header .portal-realm{width:100%!important;min-width:0!important;min-height:60px!important;padding:7px 9px!important}
 html body.portal-v3 header.portal-header .portal-realm :is(strong,small){font-size:13px!important;line-height:1.3!important;white-space:normal!important;letter-spacing:0!important}
 html body.portal-v3 header.portal-header :is(.portal-server-panel,.legend-account-shortcuts){position:fixed!important;top:calc(var(--mobile-menu-top312,130px) + 6px)!important;left:12px!important;right:12px!important;width:auto!important;min-width:0!important;max-width:none!important;max-height:calc(100dvh - var(--mobile-menu-top312,130px) - 20px)!important;overflow-y:auto;overscroll-behavior:contain;transform:none!important;z-index:80}
 html body.portal-v3 header.portal-header .shop-menu-toggle{grid-area:toggle;width:40px!important;height:40px!important;min-width:40px!important;margin:0!important}
 html body.portal-v3 header.portal-header .portal-discord{grid-area:discord;width:36px!important;min-width:36px!important;height:38px!important;margin:0!important;padding:8px!important}
 html body.portal-v3 header.portal-header .legend-account-menu{grid-area:account;position:relative!important;justify-self:center!important;display:flex!important;align-items:center;justify-content:center;width:auto!important;max-width:100%!important;min-width:0!important;margin:0!important;gap:5px}
 html body.portal-v3 header.portal-header :is(.shop-login,.legend-account-menu>button,.legend-account-menu>a){min-height:34px!important;height:auto!important;padding:7px 18px!important;font-size:14px!important;line-height:1.25!important;max-width:100%}
 html body.portal-v3 header.portal-header .shop-start{display:none!important}
 html body.portal-v3 header.portal-header #portal-nav{grid-area:auto!important;position:absolute!important;top:100%!important;bottom:auto!important;height:auto!important;min-height:0!important;flex-direction:column!important;align-items:stretch!important;left:12px!important;right:12px!important;width:auto!important;max-height:calc(100dvh - 160px);overflow-y:auto;overscroll-behavior:contain;z-index:60;padding:12px!important;border-radius:0 0 14px 14px}
 html body.portal-v3 header.portal-header #portal-nav :is(a,summary){width:100%!important;max-width:100%!important;min-width:0!important;min-height:44px!important;white-space:normal!important;justify-content:flex-start;text-align:left}
 /* Wiki: compact navigation and a readable comparison without sideways swiping. */
 html body.portal-v3 .legend-wiki .wk-hero{min-height:0!important;padding:32px 0 24px!important}
 html body.portal-v3 .legend-wiki .wk-hero h1{font-size:clamp(29px,8vw,40px)!important;line-height:1.14!important}
 html body.portal-v3 .legend-wiki .wk-layout{grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
 html body.portal-v3 .legend-wiki .wk-sidebar{position:static!important;width:100%;max-height:none;overflow:visible;padding:0}
 html body.portal-v3 .legend-wiki .wk-sidebar details{padding:5px}
 html body.portal-v3 .legend-wiki .wk-sidebar summary{min-height:46px;padding:10px 12px!important;font-size:14px!important;line-height:1.4}
 html body.portal-v3 .legend-wiki .wk-sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px;max-height:50dvh;overflow-y:auto;overscroll-behavior:contain}
 html body.portal-v3 .legend-wiki #wk-nav a{min-width:0;min-height:48px;padding:10px!important;display:flex!important;align-items:center;justify-content:flex-start;text-align:left;border-radius:8px}
 html body.portal-v3 .legend-wiki #wk-nav a>span{display:none!important}
 html body.portal-v3 .legend-wiki #wk-nav a>b{font-size:14px!important;line-height:1.45!important;font-weight:600!important}
 html body.portal-v3 .legend-wiki .wk-panel-head{display:flex;flex-direction:column;align-items:stretch;gap:12px}
 html body.portal-v3 .legend-wiki .wk-body{padding:16px 12px!important;scroll-margin-top:145px}
 html body.portal-v3 .legend-wiki #wk-title{font-size:26px!important;line-height:1.25!important;text-wrap:balance}
 html body.portal-v3 .legend-wiki .wk-server-label{display:grid;gap:6px;width:100%;text-align:left}
 html body.portal-v3 .legend-wiki #wk-server{width:100%;min-height:44px}
 html body.portal-v3 .legend-wiki .wk-search-wrap{padding:16px!important;margin:20px 0!important}
 html body.portal-v3 .legend-wiki .wk-search-row{gap:6px;padding:6px 8px!important}
 html body.portal-v3 .legend-wiki .wk-search-row>span{display:none}
 html body.portal-v3 .legend-wiki .wk-search-row input{width:0;min-width:0;font-size:16px!important}
 html body.portal-v3 .legend-wiki .wk-search-row button{padding:9px 12px!important;min-width:68px;font-size:14px!important}
 html body.portal-v3 :is(.wk-filter,.wk-pagination){gap:8px!important;flex-wrap:wrap;max-width:100%}
 html body.portal-v3 .wk-filter input{flex:1 1 100%;width:100%;min-width:0!important;min-height:44px}
 html body.portal-v3 .wk-pagination .wk-action{min-width:0;padding:10px 12px!important;font-size:14px!important}
 html body.portal-v3 :is(.wk-action,.wk-back309){overflow-wrap:anywhere;white-space:normal!important;line-height:1.45}
 html body.portal-v3 :is(.wk-table,.wk-dialog .wk-table,.rank-table-scroll309 .rank-table,.legend-settings table){width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important}
 html body.portal-v3 :is(.wk-table th,.wk-table td,.legend-settings th,.legend-settings td){min-width:0!important;max-width:none!important;padding:10px 8px!important;font-size:14px!important;line-height:1.5!important;white-space:normal!important;overflow-wrap:anywhere!important;letter-spacing:0!important}
 html body.portal-v3 .wk-table th:first-child,html body.portal-v3 .wk-table td:first-child{width:52%}
 html body.portal-v3 .wk-table td .wk-action{width:100%;min-height:42px;padding:8px 6px!important;font-size:13px!important}
 html body.portal-v3 :is(.wk-table-wrap,.rank-table-scroll309){width:100%;max-width:100%;overflow-x:auto;margin:14px 0}
 html body.portal-v3 .wk-guide-row309{grid-template-columns:minmax(0,1fr)!important}
 html body.portal-v3 .wk-guide-row309>img{width:100%;height:170px!important;min-height:0;object-fit:cover}
 html body.portal-v3 .wk-guide-copy309{padding:16px!important}
 html body.portal-v3 .wk-guide-copy309 h3{font-size:22px!important;line-height:1.3!important}
 html body.portal-v3 .wk-guide-copy309 p{font-size:16px!important;line-height:1.65!important}
 html body.portal-v3 .wk-guide-figure309 img{height:180px!important}
 html body.portal-v3 .wk-steps309{padding-left:23px}
 html body.portal-v3 .wk-steps309 li{padding-left:2px;font-size:16px!important;line-height:1.7!important}
 html body.portal-v3 .wk-active-tabs310{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 html body.portal-v3 .wk-active-tabs310 .wk-action{min-width:0;padding:11px 5px!important;font-size:14px!important;text-align:center}
 html body.portal-v3 .wk-dialog{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;margin:auto!important;padding:0!important;border-radius:14px;overflow-y:auto;overscroll-behavior:contain}
 html body.portal-v3 .wk-dialog-content{padding:14px!important}
 /* Long tables become labelled records; three-column rate tables stay comparisons. */
 html body.portal-v3 table.mobile-stack312{display:block!important;table-layout:auto!important}
 html body.portal-v3 table.mobile-stack312 thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)}
 html body.portal-v3 table.mobile-stack312 tbody{display:grid!important;gap:12px;padding:8px}
 html body.portal-v3 table.mobile-stack312 tbody tr{display:block!important;border:1px solid #2b4a5d;border-radius:10px;overflow:hidden;background:#0b2536!important}
 html body.portal-v3 table.mobile-stack312 tbody td{display:grid!important;grid-template-columns:minmax(88px,38%) minmax(0,1fr);gap:10px;width:100%!important;max-width:none!important;min-width:0!important;padding:10px!important;white-space:normal!important;overflow-wrap:anywhere!important;font-size:14px!important;line-height:1.5!important;text-align:left!important}
 html body.portal-v3 table.mobile-stack312 tbody td::before{content:attr(data-mobile-label);font-size:12px;font-weight:700;color:#a8c0ce;line-height:1.5}
 /* Marketplace: fixed control rows, flexible categories and full-width item actions. */
 html body.portal-v3 .shop-heading{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding-top:22px}
 html body.portal-v3 .shop-control-panel{padding:14px!important}
 html body.portal-v3 .shop-control-top{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
 html body.portal-v3 .shop-search{width:100%!important;min-width:0!important;max-width:none!important}
 html body.portal-v3 .shop-categories{width:100%;min-width:0;display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:7px!important}
 html body.portal-v3 .shop-categories button{width:40px!important;height:42px!important;min-width:40px!important;padding:5px!important;margin:0!important;display:grid;place-items:center}
 html body.portal-v3 .shop-categories button img{width:28px;height:28px;object-fit:contain}
 html body.portal-v3 .shop-control-bottom{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;min-width:0}
 html body.portal-v3 .shop-class-filter218{width:100%;min-width:0;display:grid!important;grid-template-columns:minmax(0,1fr);gap:8px}
 html body.portal-v3 .shop-class-filter218 select{width:100%!important;min-width:0!important}
 html body.portal-v3 .shop-quality-filter{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px!important}
 html body.portal-v3 .shop-quality-filter button{width:100%;min-width:0;justify-content:center;padding:10px 6px!important;font-size:14px!important}
 html body.portal-v3 .shop-results-toolbar{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 html body.portal-v3 .shop-result-info{justify-content:center!important;min-width:0;width:100%}
 html body.portal-v3 .shop-results-actions{display:grid!important;grid-template-columns:minmax(0,1fr) auto 44px;gap:8px!important;width:100%;min-width:0;align-items:center}
 html body.portal-v3 .shop-sort-label{width:100%!important;min-width:0!important;padding:8px 10px!important}
 html body.portal-v3 .shop-sort-label select{width:100%;min-width:0!important;font-size:14px!important;padding-right:16px!important}
 html body.portal-v3 .shop-view-switch{gap:2px;padding:3px!important;min-width:0}
 html body.portal-v3 .shop-view-switch button{width:34px!important;height:40px!important;min-width:34px!important;padding:6px!important}
 html body.portal-v3 .shop-refresh{width:44px!important;min-width:44px!important;height:46px!important;margin:0!important}
 html body.portal-v3 .shop-explore-bar{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;text-align:center;min-width:0}
 html body.portal-v3 .shop-source{width:100%;min-width:0}
 html body.portal-v3 .shop-source select{width:100%;min-width:0!important}
 html body.portal-v3 .shop-item-grid{grid-template-columns:minmax(0,1fr)!important;gap:16px!important}
 html body.portal-v3 :is(.shop-item-card,.shop-item-grid article,.shop-item-info,.shop-item-footer){min-width:0;max-width:100%}
 html body.portal-v3 .shop-item-footer{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
 html body.portal-v3 .shop-item-footer :is(button,a){max-width:100%;min-width:0;white-space:normal}
 /* Forms, payments, account and downloads share the same mobile content edge. */
 html body.portal-v3 :is(.donate-hero,.donate-order-row,.donate-checkout,.download-options298,.download-steps273){grid-template-columns:minmax(0,1fr)!important;gap:16px!important;min-width:0}
 html body.portal-v3 .donate-pack-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 html body.portal-v3 .donate-provider-grid{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 html body.portal-v3 .donate-provider{min-width:0;max-width:100%;min-height:0;padding:18px!important;text-align:left}
 html body.portal-v3 .donate-provider-name{font-size:26px!important;line-height:1.25!important}
 html body.portal-v3 :is(.donate-continue,.donate-checkout button,.download-primary273,.download-full298){width:100%!important;max-width:100%!important;min-width:0!important;min-height:46px;white-space:normal!important;line-height:1.4!important;padding:12px 16px!important}
 html body.portal-v3 .donate-order-row{display:flex!important;flex-direction:column!important;align-items:stretch!important}
 html body.portal-v3 .download-choice298{min-width:0!important;padding:20px 16px!important}
 html body.portal-v3 .download-step273{min-width:0!important;max-width:100%;grid-template-columns:minmax(0,1fr)!important}
 html body.portal-v3 .dashboard-layout{grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
 html body.portal-v3 .dashboard-sidebar{position:static!important;width:100%;max-height:none}
 html body.portal-v3 .mobile-account-nav312{width:100%;border:1px solid #355366;border-radius:12px;background:#0b2333;overflow:hidden}
 html body.portal-v3 .mobile-account-nav312>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;list-style:none;color:#f2c66e;font-weight:700;font-size:16px;cursor:pointer}
 html body.portal-v3 .mobile-account-nav312>summary::after{content:'⌄';font-size:20px;line-height:1}
 html body.portal-v3 .mobile-account-nav312>summary::-webkit-details-marker{display:none}
 html body.portal-v3 .mobile-account-nav312:not([open])>.dashboard-nav{display:none!important}
 html body.portal-v3 .mobile-account-nav312>.dashboard-nav{max-height:55dvh;overflow:auto;overscroll-behavior:contain;display:grid!important;grid-template-columns:minmax(0,1fr)!important;padding:8px;gap:5px}
 html body.portal-v3 :is(.profile-hero,.profile-services,.stream-account-grid257,.stream-account-stats257){grid-template-columns:minmax(0,1fr)!important;min-width:0}
 html body.portal-v3 .profile-hero{padding:20px 14px!important;gap:16px!important}
 html body.portal-v3 .profile-services>a{min-height:64px!important}
 html body.portal-v3 :is(.panel,.profile-section,.stream-account257){min-width:0;max-width:100%}
 html body.portal-v3 .legend-settings{padding:24px 14px!important;max-width:100%;min-width:0}
 html body.portal-v3 .legend-settings-grid{grid-template-columns:minmax(0,1fr)!important;gap:20px!important}
 html body.portal-v3 .legend-settings-details{display:flex;flex-wrap:wrap;gap:8px!important}
 html body.portal-v3 .legend-settings-details>span{max-width:100%;white-space:normal!important;line-height:1.4!important}
 html body.portal-v3 .profile-market-metrics{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
 html body.portal-v3 .profile-market-metrics small{white-space:normal!important;overflow-wrap:anywhere!important}
 html body.portal-v3 :is(main fieldset,.portal-auth-dialog fieldset){min-width:0;max-width:100%}
 html body.portal-v3 .mu-purchase-dialog{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto;overscroll-behavior:contain}
 html body.portal-v3 .rank-class309{width:100%!important;min-width:0!important}
 html body.portal-v3 .rank-podium309{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
 html body.portal-v3 .rank-winner309{grid-column:auto!important;grid-row:auto!important;transform:none!important;min-height:220px}
 html body.portal-v3 .rank-winner309-1{order:-1}
 html body.portal-v3 .portal-auth-dialog{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto;overscroll-behavior:contain;padding:24px 18px!important;margin:auto!important}
}
@media(max-width:360px){
 html body.portal-v3 :is(.wrap,.shop-main,.donate-main,.account-page,.download273){padding-left:10px!important;padding-right:10px!important}
 html body.portal-v3 header.portal-header>.shop-header-inner{padding-inline:10px!important;gap:6px!important;grid-template-columns:30px minmax(0,1fr) 36px 34px!important}
 html body.portal-v3 header.portal-header .shop-brand,html body.portal-v3 header.portal-header .shop-brand img{width:30px!important}
 html body.portal-v3 .shop-results-actions{grid-template-columns:minmax(0,1fr) auto 40px;gap:6px!important}
 html body.portal-v3 .shop-view-switch button{width:30px!important;min-width:30px!important}
 html body.portal-v3 .shop-refresh{width:40px!important;min-width:40px!important}
 html body.portal-v3 .shop-categories{gap:6px!important}
 html body.portal-v3 .shop-categories button{width:38px!important;min-width:38px!important}
 html body.portal-v3 .wk-table :is(th,td){font-size:13px!important;padding:9px 6px!important}
}
