/* Viewport layout: persistent navigation with an independently scrolling workspace. */
:root{--sidebar-width:236px;--page-gap:clamp(14px,1.45vw,28px);--page-pad:clamp(16px,2vw,36px);--topbar-height:64px}
html,body{width:100%;height:100%;overflow:hidden}
body{height:100dvh}
.shell{margin-left:var(--sidebar-width);height:100%;min-height:0;min-width:0}
.topbar{height:var(--topbar-height);min-height:var(--topbar-height);padding:0 var(--page-pad);flex-shrink:0}
.workspace-scroll{flex:1;min-height:0;min-width:0;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;display:flex;flex-direction:column}
main{flex:1 0 auto;max-width:none;min-width:0;margin:0;width:100%;padding:var(--page-pad);container:workspace / inline-size}
.app-footer{padding:8px var(--page-pad) 16px;flex-shrink:0;flex-wrap:wrap}
.sidebar{width:var(--sidebar-width);height:100%;height:100dvh;overflow-y:auto;overscroll-behavior:contain;padding:22px 16px 0;scrollbar-width:thin}
.sidebar>*{flex-shrink:0}.sidebar-bottom{padding-top:20px}.workspace-switch{margin:22px 0}
.nav-close,.nav-backdrop{display:none}
.skip{left:calc(var(--sidebar-width) + 12px)}
*{scrollbar-width:thin;scrollbar-color:#3c4b57 #10151c}
:where(.page-heading,.panel-heading,.table-tools,.form-actions,.module-info-strip,.chart-caption,.table-foot,.chart-summary){flex-wrap:wrap}
:where(.panel-heading,.table-tools,.form-actions,.module-info-strip,.data-pair,.champion-top,.event-row)>*{min-width:0}
.page-heading{gap:16px;margin-bottom:20px}.heading-actions{flex-wrap:wrap;max-width:100%}
h1{font-size:clamp(26px,2.2vw,36px)}
.heading-copy p{max-width:76ch}.metric-number{font-size:clamp(25px,2.1vw,34px)}
.metric-grid{gap:var(--page-gap);margin-bottom:var(--page-gap)}
.metric{min-height:124px;padding:16px 18px}.metric-note{flex-wrap:wrap}.metric-top{gap:6px}
.overview-layout{grid-template-columns:minmax(0,1fr) clamp(270px,22vw,360px);gap:var(--page-gap);margin-bottom:var(--page-gap)}
.overview-bottom,.two-columns{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--page-gap);margin-bottom:var(--page-gap)}
.module-layout,.module-layout.large-side{grid-template-columns:minmax(0,1fr) clamp(285px,25vw,370px);gap:var(--page-gap);margin-bottom:var(--page-gap)}
.three-columns{grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--page-gap)}
.section-space{margin-bottom:var(--page-gap)}
.flow-row{grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr)}
.flow-module-top{flex-wrap:wrap}.flow-module p{overflow-wrap:break-word}.node-meta{flex-wrap:wrap}
.flow-system-label{gap:10px;flex-wrap:wrap}.flow-footer{flex-wrap:wrap}
.mascot-card{min-height:0}.mascot-image{flex:1;min-height:160px;height:clamp(170px,26dvh,280px);max-height:300px}
.mascot-caption{padding-bottom:16px}.mascot-state{gap:8px;flex-wrap:wrap}
.histogram{height:clamp(105px,18dvh,210px);gap:clamp(3px,.5vw,9px)}
.equity-wrap{height:clamp(145px,23dvh,270px)}
.equity-svg{max-width:100%}.replay-chart svg{height:clamp(125px,20dvh,210px)}
.table-wrap{position:relative;width:100%;max-height:clamp(210px,44dvh,580px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.table-wrap:focus-visible{outline:2px solid var(--accent,var(--mint));outline-offset:-2px}
thead{position:sticky;top:0;z-index:2}th{box-shadow:0 1px var(--border)}
.event-list{max-height:clamp(210px,38dvh,460px);overflow-y:auto;overscroll-behavior:contain}
.event-text{min-width:0;overflow-wrap:break-word}.event-glyph{flex-shrink:0}
.event-row{flex-wrap:wrap}.event-row .event-text{flex:1 1 130px}.event-row>.status-pill{margin-left:auto}
.champion-list{max-height:clamp(270px,48dvh,560px);overflow-y:auto;overscroll-behavior:contain}
.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-field>span{flex-wrap:wrap}.form-field{min-width:0}
.form-actions small{max-width:none;flex:1 1 180px}.form-actions .btn{flex:0 1 auto}
.filter-row{flex:1 1 300px;flex-wrap:wrap}.search-input{flex:1 1 170px;max-width:300px}
.data-pair strong{overflow-wrap:anywhere}.data-pair>span{flex-shrink:0;max-width:55%}
.lab-stepper{flex-wrap:wrap;row-gap:8px}.lab-stepper span{white-space:nowrap}
.btn{max-width:100%}.chart-summary{row-gap:3px}
dialog{max-height:calc(100dvh - 24px);overscroll-behavior:contain}
.modal-header{position:sticky;top:-23px;padding:10px 0;background:#151d22;z-index:2}
.toast{bottom:max(16px,env(safe-area-inset-bottom));right:16px}

/* Panels react to the space left after navigation, including resized desktop windows. */
@container workspace (max-width:1000px){
 .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .overview-layout{grid-template-columns:minmax(0,1fr)}
 .mascot-card{display:grid;grid-template-columns:150px minmax(0,1fr) minmax(190px,.6fr);align-items:center;padding:12px 20px;gap:16px}
 .mascot-top{display:none}.mascot-image{height:145px;min-height:0;max-height:none;grid-row:auto;margin:0}
 .mascot-caption{text-align:left;padding:0}.mascot-caption h2{font-size:24px}.mascot-state{margin:0}
 .module-layout,.module-layout.large-side{grid-template-columns:minmax(0,1fr)}
 .module-layout>aside .panel-pad{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
 .module-layout>aside .panel-pad>.btn,.target-gauge,.radar-chart{grid-column:1/-1}
 .target-gauge,.radar-chart{width:100%}
 .two-columns{grid-template-columns:minmax(0,1fr)}
}
@container workspace (max-width:740px){
 .overview-bottom{grid-template-columns:minmax(0,1fr)}
 .mascot-card{grid-template-columns:125px minmax(0,1fr);gap:0 12px}
 .mascot-image{height:160px;grid-row:1/3}.mascot-caption{align-self:end;padding:8px 0 12px}
 .mascot-caption h2{font-size:22px}.mascot-state{align-self:start;justify-content:flex-start;gap:8px 14px;margin-bottom:12px}
 .page-heading{align-items:flex-start}.heading-copy{flex:1 1 220px}
 .page-heading>.heading-actions{margin:0;flex:1 0 100%;justify-content:flex-start}
 .panel-heading{gap:9px 16px;padding:16px}.panel-pad,.flow-body{padding:16px}
 .module-layout>aside .panel-pad{grid-template-columns:minmax(0,1fr)}
 .form-actions .btn{flex:1 0 100%}.three-columns{grid-template-columns:minmax(0,1fr)}
 .flow-module{padding:13px}.flow-module .node-meta{font-size:11px}.flow-module p{font-size:12px}
 .view-emblem{width:48px;height:48px}.view-emblem .icon{width:26px;height:26px}
 .heading-copy:has(h1){min-width:0}.chart-caption{gap:5px 12px}
}
@container workspace (max-width:420px){
 .metric{padding:13px;min-height:130px}.metric-number{font-size:26px}.metric-top{font-size:12px;align-items:flex-start}
 .metric-top>.icon{display:none}.metric-note{font-size:11px}.metric-number .unit{font-size:12px}
 .heading-copy{flex:1 1 0}.heading-copy p{font-size:13px}.eyebrow{font-size:10px;letter-spacing:1px}
 .page-heading>.heading-actions{gap:8px}.heading-actions .btn{flex:1 1 auto;padding:10px;font-size:12px}
 .heading-actions>.status-pill{flex:0 0 auto}.page-heading h1{font-size:27px}
 .flow-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.flow-join,.flow-row>span:empty{display:none}
 .flow-module{padding:11px}.flow-module-top{gap:7px}.flow-module-top h3{font-size:14px}.module-icon{width:25px;height:25px}
 .node-arrow,.node-meta .node-version{display:none}.node-meta .icon{flex-shrink:0}
 .flow-system-label{font-size:10px;letter-spacing:.5px}.flow-system-label span:last-child{font-size:10px}
 .flow-deployments{grid-template-columns:1fr 10px 1fr}.flow-deployments>span{font-size:10px;gap:3px}
 .flow-footer{font-size:11px}.flow-footer>span{min-width:0;display:block}.flow-footer>span:last-child{display:none}
 .mascot-card{grid-template-columns:96px minmax(0,1fr);padding:10px;gap:0 10px}.mascot-image{height:150px}
 .mascot-caption h2{font-size:20px}.mascot-caption p{font-size:12px}.mascot-state{padding:8px;font-size:11px}
 .mascot-state strong{font-size:11px}.mascot-state strong .icon{display:none}
 .histogram{padding:0 16px;gap:4px}.chart-summary{margin:12px 16px 0}.chart-summary strong{font-size:25px}
 .chart-summary>span:last-child{margin-left:0}.chart-axis{margin-left:16px;margin-right:16px}
 .chart-caption{padding:10px 16px}.panel-title h2{font-size:16px}
 .form-grid{grid-template-columns:minmax(0,1fr)}.form-field{font-size:13px}
 .module-info-strip{gap:8px;padding:12px}.module-info-strip>span:nth-child(2){flex:1 1 190px}
 .module-info-strip>button{width:100%;min-height:36px}.lab-stepper{padding:14px;gap:8px;font-size:11px}
 .lab-stepper>.icon{display:none}.table-tools{padding:12px 16px}.table-tools>.btn{width:100%}
 .search-input{flex-basis:100%;max-width:none}.filter-row{gap:8px}
 .event-list{padding:2px 16px}.event-row{gap:8px}.event-row>time{width:50px}
 .event-row>.status-pill{margin-left:84px}.table-foot{padding:12px 16px}
}

/* Compact navigation rail leaves tablet and smaller desktop windows more room. */
@media(min-width:761px) and (max-width:1250px){
 :root{--sidebar-width:78px}.sidebar{padding:18px 10px 0}
 .brand{padding:0;justify-content:center;gap:0}.brand>span,.workspace-switch,.nav-group-label,.nav-item>span,.simulation-card,.sidebar-account,.sidebar-bottom>.nav-item>.tiny{display:none}
 .sidebar nav{margin-top:26px}.sidebar .nav-item{padding:14px;min-height:48px;justify-content:center;gap:0;margin-bottom:9px}
 .sidebar .nav-item>.icon{width:21px;height:21px}.sidebar-bottom{padding-bottom:16px}
 .sol-quote,.vertical-rule{display:none}.header-right{gap:12px}
}
@media(max-width:760px){
 :root{--sidebar-width:0px;--page-pad:16px;--page-gap:16px;--topbar-height:60px}
 .sidebar{width:min(286px,calc(100vw - 40px));visibility:hidden;transform:translateX(-100%);transition:none;z-index:50;padding:24px 16px 0;box-shadow:20px 0 60px #0008}
 .sidebar.open{visibility:visible;transform:translateX(0);transition:transform .2s}
 .sidebar .brand{padding-right:28px}.sidebar nav{margin-top:0}.sidebar .workspace-switch{margin:20px 0}
 .nav-close{display:flex;position:absolute;right:12px;top:12px;width:36px;height:36px}
 .nav-backdrop{display:block;position:fixed;inset:0;z-index:40;background:#03080bc2;backdrop-filter:blur(3px)}
 .menu-button{display:flex;width:40px;height:40px;flex-shrink:0}.topbar{gap:8px;padding:0 12px}
 .breadcrumb{margin-right:auto;gap:0;min-width:0}.breadcrumb>span{display:none}.breadcrumb strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .header-right{gap:8px;flex-shrink:0}.sol-quote,.vertical-rule{display:none}.demo-pill{font-size:10px}
 .wallet-button{width:40px;height:40px;padding:10px;justify-content:center}.wallet-button>span,.wallet-button>.tiny{display:none}
 .app-footer{gap:8px;font-size:10px}.app-footer>span:nth-child(2){order:3;flex-basis:100%}.footer-version{margin-left:auto}
 .skip{left:12px}.icon-button{min-height:36px}.pill-filter,.segmented button,.row-link{min-height:36px}.row-link{padding:8px 0}
 input:not([type=checkbox]),select{font-size:16px;min-height:44px}.search-input>input{font-size:16px}.search-input>.icon{top:14px}
 .input-unit>span{top:13px}.table-wrap{max-height:55dvh;min-height:0}.event-list{max-height:45dvh}
 dialog{padding:18px;width:calc(100% - 24px)}.modal-header{top:-18px}.dialog-flow{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:359px){
 :root{--page-pad:12px;--page-gap:12px}.demo-pill{display:none}
 .view-emblem{width:40px;height:40px}.view-emblem .icon{width:23px;height:23px}
}
/* Short landscape/laptop windows keep every navigation item reachable. */
@media(max-height:700px){
 .sidebar{padding-top:14px}.sidebar .workspace-switch{margin:14px 0}.nav-group-label{margin-top:15px}
 .sidebar-bottom{padding-top:12px}.simulation-card{padding:10px;margin-bottom:10px}.sidebar-account{padding:12px 2px;margin-top:10px}
 .metric{min-height:112px}.metric-number{margin-top:7px}.metric-note{margin-top:7px}
}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none}}
