/* Shared responsive layout: member area, platform management and public pages. */
html{max-width:100%;scrollbar-gutter:stable}body{max-width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.app-shell .main{min-width:0;width:calc(100% - var(--sw));flex:1}body.app-shell .content{min-width:0}
body.app-shell :is(.card,.card-body,.stat-card,.filter-group,.tr-panel,.ao-panel,.cfg-grid>div){min-width:0}
body.app-shell :is(input,select,textarea){max-width:100%;box-sizing:border-box}body.app-shell :is(p,code,.page-url,.topbar-title){overflow-wrap:anywhere}
body.app-shell :is(.card-header,.topbar-actions){gap:10px;flex-wrap:wrap}.topbar-actions{display:flex;align-items:center}
body.app-shell .stats-grid{grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr))}
body.app-shell .modal{padding:16px;overflow:auto}body.app-shell .modal-box{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
body.app-shell .site-install{min-width:0!important;max-width:100%!important}
body.app-shell :is(.chart-container,.tr-chart,.ao-chart){min-width:0;max-width:100%}
.responsive-table{max-width:100%;width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.responsive-table table{width:100%;min-width:420px}.responsive-table[data-wide=true] table{min-width:660px}
.responsive-table:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.table-scroll-hint{display:none;color:#526680;font-size:12px;line-height:1.7;padding:8px 12px;background:#f3f7fc}
.responsive-table.is-overflowing+.table-scroll-hint{display:block}.responsive-table td,.responsive-table th{overflow-wrap:anywhere}
.menu-toggle,.nav-close,.nav-backdrop{display:none}.skip-link{position:fixed;top:-100px;left:12px;z-index:1200;background:white;padding:12px;border-radius:8px}.skip-link:focus{top:12px}
body.auth-page .auth-card{min-width:0;max-width:440px}body.auth-page :is(input,select,button){min-height:44px;font-size:16px}body.auth-page .auth-card p{line-height:1.7}
body.landing-page :is(.top-inner,.hero-cta){gap:12px;flex-wrap:wrap}body.landing-page .hero>div{min-width:0}body.landing-page .metric .v{overflow-wrap:anywhere}
body.app-shell :is(button,.btn,select,input,textarea):focus-visible{outline:2px solid #2563eb;outline-offset:2px}
@media(max-width:1024px){
 body.app-shell{display:block}body.app-shell .main{margin-left:0;width:100%}
 body.app-shell .content{padding:20px}body.app-shell .topbar{position:sticky;top:0;z-index:80;padding:12px 18px;gap:12px;flex-wrap:wrap}
 body.app-shell .topbar-title{flex:1;min-width:0;font-size:16px}body.app-shell .topbar-actions .btn{min-height:40px}
 body.app-shell .sidebar{position:relative;width:100%;height:auto;max-height:none}
 body.app-shell .sidebar :is(.sidebar-logo h1,.sidebar-logo span,.nav-section){display:block}
 body.app-shell .sidebar .nav-item span{display:inline}body.app-shell .sidebar .nav-item{justify-content:flex-start;gap:12px;padding:12px 16px;margin:2px 10px;font-size:15px;min-height:46px}
 body.app-shell .sidebar .nav-icon{display:inline!important;margin:0;flex:0 0 22px}
 html.ui-ready body.app-shell .sidebar{position:fixed;inset:0 auto 0 0;width:min(310px,86vw);height:100dvh;max-height:100dvh;z-index:1001;transform:translateX(-100%);visibility:hidden;transition:transform .18s ease,visibility .18s;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
 html.ui-ready body.app-shell.nav-open .sidebar{transform:translateX(0);visibility:visible}
 html.ui-ready .menu-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 12px;background:white;border:1px solid #cbd5e1;color:#173858;border-radius:9px;font:inherit;cursor:pointer}
 html.ui-ready .nav-close{display:flex;align-items:center;justify-content:space-between;min-height:48px;margin:12px 16px 0;padding:8px 12px;border:1px solid #475569;border-radius:8px;background:#1e293b;color:#f1f5f9;font:inherit;cursor:pointer}
 html.ui-ready .nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:1000;width:100%;height:100dvh;border:0;background:#0f172a80;cursor:pointer}
 body.app-shell.nav-open{overflow:hidden}body.app-shell :is(.btn,button,select,input:not([type=checkbox]):not([type=radio])){min-height:42px}
 body.app-shell :is(input,select,textarea){font-size:16px}body.app-shell .filter-bar{gap:12px}.filter-group{max-width:100%}
 body.app-shell :is(.filter-date-range,.filter-date-presets,.date-presets){flex-wrap:wrap;gap:6px}
 body.app-shell .tr-site{min-width:0;max-width:100%}body.app-shell .tr-site select{min-width:0;width:100%;max-width:100%}
 body.app-shell .cfg-grid,body.app-shell .modal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
 body.app-shell .content{padding:12px}body.app-shell .topbar{padding:10px 12px;gap:8px}
 body.app-shell .topbar-actions{width:100%;justify-content:flex-end;gap:8px}body.app-shell .topbar-actions .btn{font-size:12px}
 body.app-shell :is(.card-header,.card-body){padding:16px}body.app-shell .card-header{align-items:flex-start}
 body.app-shell .content [style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr)!important}
 body.app-shell :is(.cfg-grid,.modal-grid,.ao-grid,.ao-rankings){grid-template-columns:minmax(0,1fr)}body.app-shell .cfg-grid .full{grid-column:auto}
 body.app-shell .content [style*="display:flex"],body.app-shell .content [style*="display: flex"]{flex-wrap:wrap}
 body.app-shell .content form [style*="min-width"]{min-width:0!important;flex-basis:100%!important}
 body.app-shell :is(.stats-grid,.tr-metrics,.ao-metrics){gap:10px}body.app-shell .stat-value,body.app-shell .tr-stat-number{font-size:26px;overflow-wrap:anywhere}
 body.app-shell :is(.stat-desc,.form-hint,.hint,.tr-stat-compare){font-size:12px;line-height:1.6}
 body.app-shell .data-table :is(th,td){padding:12px 10px;font-size:13px}
 body.app-shell .filter-group{flex:1 1 100%;min-width:0}.filter-group :is(input,select){width:100%}
 body.app-shell .filter-date-range{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
 body.app-shell .filter-date-range input{min-width:0}.filter-date-presets button{flex:1}
 body.app-shell .tr-dates{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);width:100%;gap:7px}
 body.app-shell .tr-dates label{min-width:0}body.app-shell .tr-dates input{width:100%;min-width:0;font-size:14px;padding:10px 4px}
 body.app-shell .tr-dates button{grid-column:1/-1;width:100%}body.app-shell .tr-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%}
 body.app-shell :is(.tr-presets,.tr-tabs) button{font-size:13px;padding:9px 7px;min-height:44px}
 body.app-shell .tr-section-head{align-items:flex-start}.tr-chart{height:250px}body.app-shell .tr-chart-hint{height:auto;min-height:24px;line-height:1.6}
 body.app-shell .ao-command{flex-wrap:wrap}body.app-shell .ao-panel{padding:16px}body.app-shell .code-block{max-width:100%}
 body.auth-page{padding:16px;min-height:100svh}body.auth-page .auth-card{padding:26px 22px;border-radius:16px}body.auth-page .auth-brand{margin-bottom:24px}
 body.auth-page .auth-title{font-size:21px}body.auth-page .login-hint{font-size:13px}body.auth-page .toast{max-width:calc(100vw - 32px);width:max-content}
 body.landing-page .top-inner{padding:12px 16px}.landing-page .logo{font-size:16px;flex-wrap:wrap}.landing-page .top-actions{margin-left:auto}
 body.landing-page .hero{padding:32px 16px;gap:24px}.landing-page .hero h1{font-size:30px}.landing-page .hero-cta .btn{padding:12px!important;flex:1;text-align:center}
 body.landing-page .dash-body{grid-template-columns:1fr;padding:16px}.landing-page .metric{display:flex;align-items:center;justify-content:space-between;gap:12px}
 body.landing-page .features{padding:28px 16px}.landing-page .cta-band{padding:32px 16px}
}
@media(max-width:360px){body.auth-page .auth-card{padding:22px 18px}body.app-shell .stats-grid{grid-template-columns:minmax(0,1fr)}body.app-shell .tr-stat-number{font-size:24px}}
@media(max-height:680px){body.auth-page{align-items:flex-start;padding-top:20px;padding-bottom:20px}}
@media(prefers-reduced-motion:reduce){html.ui-ready body.app-shell .sidebar{transition:none}}

/* Keep small-screen account actions in the navigation, not a second header row. */
.nav-account{display:none}
@media(max-width:1024px){body.app-shell .topbar{flex-wrap:nowrap;min-height:60px;padding:8px 16px;gap:12px}body.app-shell .topbar-actions{display:none}body.app-shell .topbar-title{font-size:16px;font-weight:650}body.app-shell .nav-account{display:flex;flex-wrap:wrap;gap:8px;padding:4px 16px 20px;border-top:1px solid #334155}body.app-shell .nav-account .nav-section{width:100%;padding:12px 0 0;margin:0}body.app-shell .nav-account .btn{background:#1e293b;border:1px solid #475569;color:#e2e8f0;flex:1;text-align:center;min-height:44px;display:flex;align-items:center;justify-content:center}html.ui-ready body.app-shell .menu-toggle{border:0;background:#f1f5f9;padding:8px 11px;min-height:42px;font-size:14px}body.app-shell .content{padding:20px}}
@media(max-width:640px){body.app-shell .topbar{padding:8px 12px;min-height:58px}body.app-shell .content{padding:14px 12px}}
