/* Customer shell: one viewport, scroll belongs to the nav and individual content regions. */
:root{--bg:#111;--surface:#202020;--ink:#eee;--muted:#aaa;--line:#444;--border:#444;--green:#ddd;--lime:#ddd;--eva-purple:#ddd;--eva-purple-text:#ddd;--eva-green:#ddd;--eva-bg:#111;--eva-panel:#202020;--eva-raised:#303030;--eva-input:#171717;--eva-selected:#333;--eva-line:#444;--eva-text:#eee;--eva-muted:#aaa;--eva-quiet:#999;--radius:8px;--client-nav:224px;--client-top:54px;--client-pad:12px;--client-gap:10px;--client-control:32px;color-scheme:dark}
html,body,#app{width:100%;height:100%;min-width:0;margin:0;overflow:hidden;background:#111;color:#eee}
body .app-shell,body.music-studio-page .app-shell{display:grid;grid-template-columns:var(--client-nav) minmax(0,1fr);grid-template-rows:var(--client-top) minmax(0,1fr);width:100%;height:100dvh;min-height:0;padding:0;background:#111}
body .sidebar,body.music-studio-page .sidebar{position:static;inset:auto;grid-column:1;grid-row:1/-1;display:flex;flex-direction:column;width:auto;height:auto;min-height:0;padding:0 12px;background:#171717;border-right:1px solid #333;transform:none}
body .brand,body.music-studio-page .brand{display:flex;flex:none;align-items:center;gap:10px;height:var(--client-top);padding:8px;color:#eee}
body .brand-mark{width:30px;height:30px;border-radius:7px;background:#333;border-color:#444;color:#ddd}
body .brand-name,body.music-studio-page .brand-name{font-size:17px;letter-spacing:0;color:#eee}
body .brand-name span{margin-left:5px;color:#aaa;font-size:12px}
body .nav,body.music-studio-page .nav{flex:1;min-height:0;margin:0;padding:6px 0 14px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
body .nav-group{margin:0 0 10px}
body .nav-heading,body.music-studio-page .nav-heading{margin:0;padding:9px 10px 5px;line-height:18px;font-size:11px;font-weight:500;letter-spacing:0;color:#888}
body .nav-item,body.music-studio-page .nav-item{display:flex;align-items:center;width:100%;min-height:32px;gap:10px;padding:6px 10px;margin:2px 0;border-radius:7px;border:0;background:transparent;color:#bbb;font-size:13px;line-height:20px;text-align:left}
body .nav-item svg{flex:none;width:17px;height:17px}body .nav-item>span:first-of-type{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .nav-item:hover{background:#292929;color:#eee}body .nav-item.active,body.music-studio-page .nav-item.active{background:#333;color:#fff}
body .nav-item.active:before{display:none}body .nav-count{margin-left:auto;flex:none;background:#444;color:#ddd}
body .sidebar-bottom{margin:0;padding:8px 0;border-top:1px solid #333;flex:none}
body .topbar,body.music-studio-page .topbar{position:static;grid-column:2;grid-row:1;min-height:0;height:var(--client-top);padding:0 18px;gap:12px;min-width:0;background:#171717;border-bottom:1px solid #333}
.breadcrumbs{min-width:0;white-space:nowrap}.breadcrumbs strong{overflow:hidden;text-overflow:ellipsis;color:#eee}.topbar-actions{min-width:0;gap:8px}.global-search{width:180px;max-width:22vw}.topbar-separator{display:none}
body .main,body.music-studio-page .main{grid-column:2;grid-row:2;display:flex;flex-direction:column;width:100%;height:auto;max-width:none;min-width:0;min-height:0;margin:0;padding:var(--client-pad);overflow:hidden;outline:none}
.client-content{container:client / size;flex:1 1 0;display:flex;flex-direction:column;gap:var(--client-gap);min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.client-content>*{min-width:0;flex-shrink:0}.client-content>.page-heading{margin:0;min-height:0;justify-content:flex-end;flex-wrap:wrap}.heading-actions{flex-wrap:wrap}.page-footer{display:none}
.live-connection{flex:none;margin:0 0 8px;padding:8px 12px;border-radius:6px;overflow-wrap:anywhere}.live-connection.offline{background:#30251b;color:#f3c27a;border:1px solid #624a2c}
body :is(.button,.icon-button),body.music-studio-page .topbar .button{background:#292929;color:#ddd;border-color:#444;border-radius:6px}
body .button:hover:not(:disabled){background:#393939}body .button.primary,body.music-studio-page .topbar .button.primary{color:#171717;background:#ddd;border-color:#ddd}body .button.primary:hover:not(:disabled){background:#f1f1f1}
body .button.danger{color:#ffaaa4;background:#392020;border-color:#65403e}body :is(input,select,textarea){accent-color:#ddd}
body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){max-width:100%;background:#171717;color:#eee;border-color:#444}
body :is(.panel,.modal-dialog,.drawer,.platform-account-dialog){background:#202020;border-color:#444;color:#eee;box-shadow:none}
body .badge.neutral{color:#bbb;background:#333}body .bell-button:after{display:none}body .keycap{background:#303030;color:#aaa;border-color:#444}
body .modal-backdrop{padding:16px;background:#0009}.modal-dialog{max-height:calc(100dvh - 32px);max-width:calc(100vw - 32px);display:flex;flex-direction:column;min-height:0}.modal-content{min-height:0;overflow:auto;overscroll-behavior:contain}.modal-header,.modal-footer{flex:none;flex-wrap:wrap;gap:8px}.drawer{height:100dvh;max-width:100vw}.drawer-body{min-height:0;overflow:auto}
dialog{max-height:calc(100dvh - 32px);max-width:calc(100vw - 32px);background:#202020;color:#eee;border-color:#444}dialog::backdrop{background:#0009}
:focus-visible{outline:2px solid #ddd;outline-offset:2px}*{scrollbar-width:thin;scrollbar-color:#555 #202020}::selection{background:#555;color:#fff}
.client-surface{flex:1;min-height:0;padding:18px;overflow:auto}.client-surface>div>.product-grid{margin-top:12px}.client-surface :is(form,fieldset,label){min-width:0}.client-surface fieldset{border-color:#444}.client-surface>details>summary{font-size:14px;font-weight:600}
.client-create-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.client-create-card{display:grid;grid-template-columns:32px minmax(0,1fr) 20px;grid-template-rows:auto auto;align-items:center;gap:8px;padding:20px;text-align:left;color:#eee;background:#202020;border:1px solid #444}.client-create-card>svg:first-child{grid-row:1/3}.client-create-card>strong{font-size:16px;font-weight:600}.client-create-card>span{grid-column:2;color:#aaa;font-size:12px}.client-create-card>svg:last-child{grid-column:3;grid-row:1/3}.client-create-card:hover{background:#2b2b2b;border-color:#888}
.client-home{flex:1;display:grid;grid-template-rows:auto auto minmax(0,1fr);min-height:0;gap:12px}.client-home .stats-grid{margin:0;gap:12px}.client-home .stat-card{padding:14px 18px;color:#eee}.client-home .stat-value{font-size:28px;margin:8px 0 0}.client-recent{min-height:0;display:flex;flex-direction:column}.client-recent .panel-header{padding:14px 18px}.client-recent-list{min-height:0;overflow:auto}.client-recent-row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,30%) 20px;gap:12px;align-items:center;padding:12px 18px;border:0;border-top:1px solid #333;background:none;color:#ccc;text-align:left}.client-recent-row:hover{background:#292929}.client-recent-row strong,.client-recent-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.client-recent-row small{color:#999;margin-top:4px}.client-recent-row>span{min-width:0;overflow-wrap:anywhere}
/* Lists reserve remaining height for records; filters and actions remain in view. */
.main[data-page=tasks] .client-content,.main[data-page=videos] .client-content,.main[data-page=templates] .client-content{overflow:hidden}
.main[data-page=tasks] :is(.production-list,.task-schedules),.main[data-page=videos] :is(.video-library-grid,.library-grid),.main[data-page=templates] :is(.tpl-grid,.template-grid){flex:1;min-height:0;overflow:auto}
.main[data-page=tasks] .flow-grid,.main[data-page=videos] .media-card-grid{flex:1;min-height:0;overflow:auto;align-content:start}
.main:is([data-page=tasks],[data-page=videos],[data-page=templates]) .client-content>.empty-state{flex:1;min-height:0;overflow:auto}
.main[data-page=tasks] .video-filter-panel{margin:0}.main[data-page=tasks] .studio-limit{margin:0;font-size:11px}.main[data-page=tasks] .sp-task-tabs{flex:none;margin:0}.view-toolbar{min-width:0;gap:10px}.view-toolbar :is(input,select){min-width:0}.table-scroll{min-width:0;overflow:auto}
.main[data-page=overview] .client-content,.main[data-page=musicstudio] .client-content,.main[data-page=musicreview] .client-content{overflow:hidden}
body .template-workbench-page,body .template-workbench-page>[data-workbench-mount]{flex:1;height:100%;min-height:0!important;min-width:0;overflow:hidden}
.main :is([data-music-studio-mount],[data-music-review-mount]){flex:1;height:100%;min-height:0;overflow:hidden}
.main[data-page=folders] .client-content{overflow:hidden}.material-browser{display:flex;flex-direction:column;flex:1;min-height:0;margin:0}.material-browser>[role=tabpanel]{flex:1;min-height:0;overflow:auto}
.main[data-page=personas] .persona-page{display:flex;flex-direction:column;flex:1;min-height:0}.persona-grid{min-height:0;overflow:auto}.persona-heading{flex:none}.persona-heading h2{display:none}.persona-heading{justify-content:flex-end}
.main[data-page=products] .product-grid,.main[data-page=productvideo] .product-grid{flex:1;min-height:0;overflow:auto}.product-toolbar{margin:0;flex-wrap:wrap}.product-grid{align-content:start}
.main[data-page=publishing] .client-content>section.panel{display:flex;flex-direction:column;flex:1;min-height:0}.main[data-page=publishing] .table-scroll{flex:1;min-height:0}
.platform-login{height:100dvh;background:#111}.platform-login-card{background:#202020;border-color:#444;box-shadow:none}.platform-brand span{color:#aaa}
@media(max-width:1279px){:root{--client-nav:204px}.global-search{width:150px}.topbar-actions>[data-connection-status]{display:none}.client-create-card{padding:14px}}
@media(max-width:1023px){:root{--client-nav:180px}.global-search{display:none}.client-create-grid{grid-template-columns:1fr}.client-create-card{grid-template-rows:auto;padding:12px}.client-create-card>span{display:none}.client-create-card>svg{grid-row:1!important}.client-home{overflow:auto;grid-template-rows:auto auto minmax(180px,1fr)}}
@media(max-width:767px){:root{--client-nav:160px;--client-pad:8px}body .topbar{padding:0 10px}.breadcrumbs>span,.breadcrumbs>svg{display:none}.topbar-actions>[data-create-task]{display:none}body .nav-item{font-size:12px;padding:6px 8px}.topbar-actions{gap:5px}body .main{padding:8px}.client-home .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#analytics-dashboard{display:flex;flex-direction:column;overflow:auto}#analytics-dashboard>*{flex:none}.client-surface{padding:12px}body .mobile-menu{display:none}.platform-account-page{padding:12px}}
.main[data-page=analytics] .client-content{overflow:hidden}
/* Component geometry. Page > fixed toolbar/status > bounded module > local content. */
.client-content>[hidden],[hidden]{display:none!important}
.section-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;flex:none;min-width:0}
.section-toolbar h3,.section-toolbar h2{margin:0;font-size:15px;font-weight:600}
.section-toolbar>p{margin:0;line-height:1.6}
.panel-scroll{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.panel-tabs{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.panel-tabs>button{background:transparent;color:#aaa;border:1px solid transparent;border-radius:6px;padding:9px 13px;font:inherit;cursor:pointer}
.panel-tabs>button[aria-selected=true]{color:#fff;background:#333;border-color:#555}
.panel-footnote,.panel-help{font-size:12px;color:#aaa;line-height:1.6}
.panel-help{padding:8px 0}.panel-help summary{cursor:pointer;color:#ccc}.panel-help p{margin:8px 0}
.inline-field{display:flex;align-items:center;gap:8px;min-width:0;font-size:13px}
.client-surface{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0;flex:1 1 0;padding:16px;overflow:hidden}
.client-surface :is(p,pre,code,dd){overflow-wrap:anywhere}
.main:is([data-page=workspace],[data-page=account],[data-page=platformusers],[data-page=usage],[data-page=plans],[data-page=billingadmin],[data-page=audit],[data-page=resources],[data-page=notifications],[data-page=brands],[data-page=customers],[data-page=deliveries],[data-page=accounts],[data-page=products],[data-page=productvideo],[data-page=publishing],[data-page=personas],[data-page=service]) .client-content{overflow:hidden}
/* Forms share their own selectors instead of depending on a removed dialog ancestor. */
:is(.account-layout,.usage-panel,.audit-panel,.resources-panel) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:9px 10px;background:#171717;color:#eee;border:1px solid #444;border-radius:6px;font:inherit}
:is(.account-layout,.usage-panel,.audit-panel) label{display:grid;gap:6px;margin:0;font-size:13px;min-width:0}
:is(.account-layout,.usage-panel,.audit-panel) :is(input[type=checkbox],input[type=radio]){width:16px;height:16px;flex:none;padding:0;margin:0}
.account-layout .workspace-role-options label{display:flex;flex-direction:row;align-items:center;gap:8px}
.account-layout .workspace-role-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0;padding:12px}
.account-layout :is(form,fieldset){min-width:0;max-width:none}
.account-layout form{display:flex;flex-direction:column;gap:14px;margin:0}
.account-layout p{font-size:12px;line-height:1.65;margin:6px 0;color:#aaa;overflow-wrap:anywhere}
.account-layout [role=status],.usage-panel>[role=status],.audit-panel>[role=status],.resources-panel>[role=status]{min-height:18px;max-height:64px;overflow:auto;margin:0;font-size:12px;line-height:1.5;flex:none}
.platform-account-page{flex:1 1 0;min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid #444;border-radius:8px;background:#202020}
.platform-account-page>header{display:flex;flex:none;align-items:center;justify-content:space-between;margin:0;padding-bottom:12px;border-bottom:1px solid #383838}
.platform-account-page>header h2{display:none}.platform-account-page>header p{margin:0}
.platform-account-page .platform-account-body{flex:1;min-height:0;max-width:none;display:flex;flex-direction:column}
.platform-account-page footer{margin:0;padding-top:12px;border-top:1px solid #383838;flex:none}
.account-security{overflow:auto;min-height:0;max-width:600px;width:100%;padding-right:12px;box-sizing:border-box}
.account-security h3{margin:0 0 18px;font-size:15px}.account-security [data-password]>.button{align-self:flex-start}
.workspace-panel{display:grid;grid-template-columns:minmax(210px,.65fr) minmax(0,2fr);gap:20px;min-height:0;flex:1}
.workspace-context{min-width:0;min-height:0;overflow:auto;padding-right:16px;border-right:1px solid #383838}
.workspace-context>h3{font-size:15px;margin:0 0 10px}.workspace-context [data-switch]{margin-top:20px}
.workspace-members-panel,.workspace-members-panel>[data-members],.platform-users-panel{display:flex;flex-direction:column;min-height:0;min-width:0;flex:1;gap:10px}
.member-columns,.account-columns{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(220px,1fr);gap:16px;min-height:0;flex:1}
.account-layout .platform-user-list{max-height:none;min-height:0;overflow:auto;margin:0;padding:0 8px 0 0;scrollbar-gutter:stable}
.account-layout .platform-user-row{padding:14px 0;border-bottom:1px solid #383838}.platform-user-row:first-child{padding-top:0}
.platform-user-summary{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}.platform-user-info{min-width:0;flex:1}.platform-user-info strong,.platform-user-info span{display:block;overflow-wrap:anywhere}.platform-user-info span{color:#aaa;font-size:12px;margin-top:5px}
.platform-user-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.platform-user-confirm{padding:14px;margin-top:12px!important;background:#171717;border:1px solid #444;border-radius:6px}
.account-create{overflow:auto;min-width:0;min-height:0;padding:14px;border:1px solid #383838;border-radius:8px;background:#1b1b1b}
.account-create h3{margin:0 0 16px;font-size:14px}
.audit-panel,.usage-panel,.resources-panel{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;gap:12px}
.audit-filters{display:grid;grid-template-columns:minmax(130px,1fr) minmax(130px,1fr) minmax(180px,2fr) auto;align-items:end;gap:12px;flex:none}
.audit-panel>.audit-list{flex:1;min-height:0;max-height:none;overflow:auto;scrollbar-gutter:stable}
.audit-list .audit-row{border:1px solid #383838;border-radius:6px;margin:0 0 8px;padding:12px;background:#1b1b1b}
.audit-row summary{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;cursor:pointer}.audit-row summary>span{font-size:12px;color:#aaa}.audit-row pre{white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.5;padding:12px;background:#151515;border-radius:4px}
.audit-pages{flex:none;justify-content:flex-end;margin:0;padding-top:10px;border-top:1px solid #383838}
.usage-panel>[role=tabpanel],.resources-panel>[role=tabpanel]{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0;gap:12px}
.usage-panel .inline-field{display:flex;margin-left:auto}.usage-panel .inline-field select{width:auto;max-width:240px;margin:0}
.usage-panel .panel-scroll{flex:1}.usage-summary{display:grid;grid-template-columns:1fr 1fr;gap:16px;font-size:12px;color:#aaa;line-height:1.6}.usage-summary p{margin:0 0 12px}
.usage-panel .quota-rows{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.usage-panel .quota-row{padding:12px;background:#1b1b1b}.usage-panel .quota-row p{font-size:12px;margin:0;color:#bbb}.usage-panel .quota-row legend{padding:0 5px}.usage-panel .quota-limit-grid{gap:12px;margin-top:10px}
.usage-panel [data-quota-statement-content] p{font-size:13px;line-height:1.6}.usage-panel [data-quota-statement-content]>details{padding:12px 0;border-top:1px solid #383838}
.resources-panel .resource-health{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);gap:16px}
.resource-occupancy{display:flex;flex-direction:column;min-height:0;min-width:0;border-left:1px solid #383838;padding-left:16px}.resource-occupancy h3{font-size:14px;margin:0 0 12px}.resource-occupancy .resource-list{flex:1;max-height:none}
.resources-panel :is([data-storage-view],[data-backup-view]){flex:1}.resources-panel .resource-diagnostic-grid{grid-template-columns:1fr}.resources-panel .resource-diagnostic-card{padding:12px;margin-bottom:10px}
/* Collections keep toolbar and pagination outside the scrolling rows. */
.record-page{display:flex;flex-direction:column;gap:12px;min-height:0;flex:1}
.record-page>.section-toolbar{justify-content:flex-end}.record-page>.section-toolbar>[role=status]{margin-right:auto}
.record-page .record-list{flex:1;min-height:0;overflow:auto;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));align-content:start}
.record-list .product-card{padding:16px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.record-list .product-card h3,.record-list .product-card p{margin:0;line-height:1.6}.record-list .product-card h3{font-size:15px}.record-list .product-card .product-excerpt{color:#aaa;flex:1}.record-list .product-card>.button{width:100%;white-space:normal}
.notifications-panel{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0}.notification-list{flex:1;min-height:0;overflow:auto}.notification-list .notification-row{display:grid;grid-template-columns:20px minmax(0,1fr);gap:14px;padding:16px 0;border-bottom:1px solid #383838}.notification-row p{line-height:1.6}.notification-row small{display:block;color:#aaa;margin-bottom:12px}
.main[data-page=accounts] .account-grid{min-height:0;flex:1;overflow:auto;align-content:start;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr))}.main[data-page=accounts] .account-card{min-width:0;align-items:flex-start;overflow-wrap:anywhere}.account-card>div{min-width:0}
.main[data-page=publishing] .client-content>section.panel{overflow:hidden}.main[data-page=publishing] .table-scroll{overflow:auto;min-height:0}.main[data-page=publishing] th{position:sticky;top:0;background:#252525;z-index:1}
.main[data-page=personas] .persona-grid{flex:1;min-height:0;align-content:start}
.main[data-page=tasks] .task-schedules{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden;gap:10px}
.task-schedules>.sp-list-heading,.task-schedules>.sp-list-note{flex:none;margin:0}.task-schedules>.sp-list-heading p,.task-schedules>.sp-list-note{font-size:12px;line-height:1.6}.task-schedules>.flow-plan-list{flex:1;min-height:0;overflow:auto;align-content:start;gap:12px}
.main[data-page=tasks] .production-list{flex:1 1 0}.main[data-page=tasks] .analytics-pages{margin:0;flex:none}
.product-workspace>.product-creation{display:flex;flex:1;flex-direction:column;min-height:0;gap:10px}
.product-workspace .product-creation>.product-fields{flex:1;overflow:auto;min-height:0;margin:0;padding:0 10px 0 0;scrollbar-gutter:stable}
.product-workspace .product-creation>:is(.creation-steps,.modal-footer,.creation-confirm,.product-notice){flex:none;margin:0}
.product-workspace .product-creation>.advanced{flex:none;max-height:110px;overflow:auto;margin:0}.product-workspace .creation-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.product-workspace .creation-facts>div{min-width:0}.product-workspace .creation-steps{margin:0}.product-workspace .modal-footer{padding-top:12px;border-top:1px solid #383838}
.product-workspace [data-creation-message]{max-height:72px;overflow:auto}.product-workspace .product-creation>fieldset>.field{max-width:900px}
/* Analytics owns explicit rows; alert presence cannot change module placement. */
#analytics-dashboard{width:100%;max-width:none;flex:1 1 0;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"actions" "filters" "status" "production" "metrics" "details";grid-template-rows:auto auto auto minmax(0,.6fr) minmax(0,1fr) minmax(0,1.4fr);gap:10px;overflow:hidden;margin:0}
#analytics-dashboard>*{min-width:0;min-height:0;margin:0;grid-column:1}
#analytics-dashboard>.page-heading{grid-area:actions;justify-content:flex-end}
#analytics-dashboard>.analytics-toolbar{grid-area:filters;gap:12px;padding:10px 12px;flex-wrap:wrap}
#analytics-dashboard>.analytics-status{grid-area:status;max-height:64px;overflow:auto}
.analytics-status:empty{display:none}
#analytics-dashboard .analytics-alert{margin:0;padding:8px 12px;border-radius:6px}
#analytics-dashboard>.analytics-production{grid-area:production;padding:10px 14px;overflow:auto}
#analytics-dashboard>.analytics-body{grid-area:metrics;display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,18%);gap:12px;overflow:hidden}
#analytics-dashboard .analytics-section-heading{margin:0;gap:8px;font-size:12px;flex:none}
#analytics-dashboard .analytics-production-values{grid-template-columns:repeat(auto-fit,minmax(min(100%,100px),1fr));gap:10px;margin:8px 0 4px}
#analytics-dashboard .analytics-production-values>div{gap:4px}#analytics-dashboard .analytics-production-values strong{font-size:21px}
#analytics-dashboard .analytics-main{display:flex;flex-direction:column;gap:10px;min-height:0}
#analytics-dashboard .analytics-metrics{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(min-content,1fr);gap:8px;min-height:0;overflow:auto;flex:1}
#analytics-dashboard .analytics-metric{min-height:0;padding:10px 12px;gap:5px;justify-content:flex-start}
#analytics-dashboard .analytics-metric strong{font-size:24px}#analytics-dashboard .analytics-metric small{font-size:11px;line-height:1.5}
#analytics-dashboard .analytics-fans{min-height:0;overflow:auto;padding:12px;align-self:stretch;display:flex;flex-direction:column;gap:12px}
#analytics-dashboard .analytics-fans>div{margin:0;gap:6px}#analytics-dashboard .analytics-fans strong{font-size:24px}
.analytics-detail-grid{grid-area:details;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.85fr) minmax(0,1.15fr);gap:12px;min-height:0}
#analytics-dashboard .analytics-detail-grid>section{display:flex;flex-direction:column;gap:10px;min-height:0;min-width:0;overflow:hidden;padding:12px;margin:0}
.analytics-panel-body{flex:1;min-height:0;min-width:0;overflow:auto;scrollbar-gutter:stable}.analytics-panel-body>.analytics-definition{margin:0 0 10px}.analytics-chart-empty{min-height:100px}
#analytics-dashboard .analytics-detail-grid .analytics-section-heading{align-items:flex-start}#analytics-dashboard .analytics-chart-controls{gap:6px}#analytics-dashboard .analytics-chart-controls select{padding:6px}
#analytics-dashboard .analytics-works .analytics-table-scroll{max-height:none;overflow:visible}#analytics-dashboard .analytics-works td:first-child{min-width:160px}
#analytics-dashboard :is(.analytics-works,.analytics-trend-table) :is(th,td){padding:9px 10px}
#analytics-dashboard .analytics-pages{gap:8px;margin:0;padding-top:8px;border-top:1px solid #383838;flex:none;font-size:11px}
/* The old music compact sidebar cannot hide the customer's group labels. */
body.music-studio-page .sidebar .brand>div:not(.brand-mark){display:block}
body.music-studio-page .sidebar .nav-heading{display:block}
body.music-studio-page .sidebar .nav-count{display:inline-flex}
/* Below the supported desktop width keep each module reachable inside its page. */
@media(max-width:1199px){.workspace-panel{grid-template-columns:minmax(180px,.6fr) minmax(0,2fr)}.member-columns{grid-template-columns:minmax(0,1fr);overflow:auto}.member-columns>.platform-user-list{flex:none;overflow:visible}.member-columns>.account-create{overflow:visible}.workspace-context{padding-right:12px}.analytics-detail-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.analytics-detail-grid>.analytics-works{grid-column:1/-1}.analytics-detail-grid{overflow:auto;grid-auto-rows:minmax(230px,1fr)}.audit-filters{grid-template-columns:1fr 1fr}.audit-filters .audit-query{grid-column:1}.resources-panel .resource-health{grid-template-columns:minmax(0,1fr) minmax(190px,1fr)}}
@media(max-width:900px){.workspace-panel,.account-columns{grid-template-columns:1fr;overflow:auto}.workspace-context{border-right:0;padding:0}.account-layout .platform-user-list,.account-create{overflow:visible}.workspace-members-panel,.member-columns{overflow:visible;min-height:200px}.usage-panel .quota-rows,.usage-summary{grid-template-columns:1fr}#analytics-dashboard .analytics-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.resources-panel .resource-health{grid-template-columns:1fr;overflow:auto}.resource-health>.panel-scroll,.resource-health .resource-list{overflow:visible}.resource-occupancy{border-left:0;padding:0}.product-workspace .creation-facts{grid-template-columns:1fr}}
@media(max-width:767px){#analytics-dashboard{display:flex;overflow:auto}#analytics-dashboard>*{flex:none}#analytics-dashboard>.analytics-body{min-height:250px}.analytics-detail-grid{grid-template-columns:1fr;overflow:visible}.analytics-detail-grid>section{min-height:240px!important;max-height:400px}.account-layout .workspace-role-options{grid-template-columns:1fr}.audit-filters{grid-template-columns:1fr}.audit-filters .audit-query{grid-column:auto}.client-surface,.platform-account-page{padding:12px}.creation-steps span{font-size:12px;padding:8px}.usage-panel>.section-toolbar{align-items:flex-start}.usage-panel .inline-field{margin-left:0}}

.platform-account-page .platform-account-body{padding:0;overflow:hidden}
.audit-filters .audit-query{grid-column:auto}
.audit-list .audit-row summary{flex-direction:row}
.main[data-page=review] .client-content{overflow:hidden}
.main[data-page=review] .review-media-grid{flex:1;min-height:0;overflow:auto;align-content:start}
.main:is([data-page=templates],[data-page=videos],[data-page=review]) .media-card-grid{align-content:start}
.record-columns{display:grid;grid-template-columns:minmax(230px,.7fr) minmax(0,1.3fr);gap:16px;min-height:0;flex:1}
.record-columns .record-list{grid-template-columns:1fr}
.record-detail{min-height:0;min-width:0;overflow:auto;border-left:1px solid #383838;padding-left:16px}
.record-detail label{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:13px}
.record-detail select{background:#171717;border:1px solid #444;color:#eee;border-radius:6px;padding:8px}
.record-detail .product-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.record-list .product-card.selected{border-color:#aaa;background:#2b2b2b}
.modal-dialog:has([data-delivery-detail]){width:min(1180px,calc(100vw - 32px));height:min(850px,calc(100dvh - 32px))}
.modal-content:has(>[data-delivery-detail]){display:flex;flex:1;overflow:hidden}
[data-delivery-detail]{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;gap:12px}
.delivery-heading{flex:none;max-height:165px;overflow:auto}.delivery-heading h3{margin:0;font-size:17px}.delivery-heading p{font-size:12px;line-height:1.5;margin:6px 0}
.delivery-columns{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:20px;min-height:0;flex:1}
.delivery-assets,.delivery-discussion{display:flex;flex-direction:column;gap:10px;min-height:0;min-width:0}.delivery-columns h4{font-size:14px;margin:0}.delivery-assets>.panel-scroll{flex:1}.delivery-assets article{padding:14px;margin-bottom:12px}.delivery-assets article h4{margin-bottom:12px}
.delivery-assets code{overflow-wrap:anywhere;font-size:11px}.delivery-assets p,.delivery-assets details{font-size:12px;line-height:1.6}.delivery-assets .button{margin:0 6px 6px 0}
.delivery-discussion{border-left:1px solid #383838;padding-left:20px}.delivery-events{flex:1;font-size:12px;line-height:1.6}.delivery-discussion form{flex:none;max-height:55%;overflow:auto;border-top:1px solid #383838;padding-top:10px}.delivery-discussion fieldset{border:0;padding:0;min-width:0}.delivery-discussion .field{margin:0 0 10px}.delivery-discussion textarea{min-height:60px;max-height:160px}.delivery-discussion input[type=checkbox]{width:auto}
.service-panel{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0}.service-panel>.panel-scroll{flex:1}.service-panel .detail-kv{grid-template-columns:repeat(2,minmax(0,1fr))}.service-panel>.section-toolbar{justify-content:flex-end;border-top:1px solid #383838;padding-top:12px}
@media(max-width:900px){.record-columns{grid-template-columns:minmax(180px,.65fr) minmax(0,1fr)}.record-detail .product-facts{grid-template-columns:1fr}.delivery-columns{grid-template-columns:1fr;overflow:auto}.delivery-columns>section{min-height:220px}.delivery-discussion{padding-left:0;border-left:0}.delivery-discussion form{max-height:none}}
@media(max-width:767px){.record-columns{grid-template-columns:1fr;overflow:auto;grid-template-rows:minmax(150px,.6fr) minmax(220px,1fr)}.record-detail{border-left:0;border-top:1px solid #383838;padding:12px 0 0}}

.main[data-page=servers] .client-content{overflow:hidden}
.main[data-page=servers] .srv-grid{flex:1;min-height:0;overflow:auto;align-content:start}

/* Geometry contract 20261101, F01/F08/F09: parent content box is the only width budget.
   Intrinsic text uses the browser's real font line boxes. No character-count estimates. */
:where(.app-shell,.modal-dialog,.drawer,dialog) *, :where(.app-shell,.modal-dialog,.drawer,dialog) *::before, :where(.app-shell,.modal-dialog,.drawer,dialog) *::after{box-sizing:border-box}
:where(.client-content,.modal-content,.drawer-body) :is(section,article,form,fieldset,label,header,footer,details,dl,dt,dd){min-width:0}
:where(.client-content,.modal-content,.drawer-body) :is(h1,h2,h3,h4,p,small,strong,code,summary,dd){overflow-wrap:anywhere}
:where(.app-shell,.modal-dialog,.drawer) .button{max-width:100%;min-height:var(--client-control,32px);height:auto;white-space:normal;overflow-wrap:anywhere;line-height:1.4}
:where(.app-shell,.modal-dialog,.drawer) :is(.button,.icon-button)>svg{flex:none}
:where(.client-content,.modal-content,.drawer-body) :is(input,select,textarea){min-width:0;max-width:100%}
:where(.client-content,.modal-content,.drawer-body) textarea{resize:vertical;max-height:min(240px,40dvh)}
:where(.client-content,.modal-content,.drawer-body) :is(.form-grid,.field-row,.detail-kv){min-width:0}
.topbar .breadcrumbs{flex:1 1 0;overflow:hidden}.topbar-actions{flex:0 0 auto;max-width:100%;overflow:visible}
.live-connection{max-height:72px;overflow:auto}
/* F03: page toolbar budget <= 18% H, status <= 10% H; records get the remainder. */
.client-content>:is(.page-heading,.view-toolbar,.media-library-toolbar,.library-filters,.tpl-toolbar,.video-filter-panel){flex:none;max-height:max(60px,18cqh);overflow:auto;margin-top:0;margin-bottom:0}
.client-content>:is(.studio-limit,.tpl-footnote,.media-result-count){flex:none;max-height:max(24px,10cqh);overflow:auto;margin:0}
.music-columns-panel{display:flex;flex-direction:column;flex:none;min-height:0;height:clamp(96px,24cqh,200px);overflow:hidden;margin:0}
.music-columns-panel>.panel-header{flex:none;padding:8px 12px;gap:8px;flex-wrap:wrap;max-height:50%;overflow:auto}
.music-columns-panel>.notice{flex:none;max-height:25%;overflow:auto;margin:0;padding:6px 12px}
.music-columns-list{min-height:0;overflow:auto;flex:1;padding:0 12px}.music-columns-list>.watch-card{flex-wrap:wrap;padding:8px 0;gap:8px}.music-columns-list .watch-main{flex:1 1 180px;min-width:0}
/* F06/F07: every row consumes max(full child heights), media aspect ratio included. */
.client-content :is(.media-card-grid,.product-grid,.persona-grid,.account-grid,.srv-grid,.flow-plan-list,.record-list){grid-auto-rows:max-content;align-content:start}
.client-content .media-card{min-width:0;min-height:min-content;align-self:start}
.media-card-body{min-width:0}.media-card-body :is(h2,p){overflow-wrap:anywhere}
.media-card-bottom{gap:8px;align-items:center;flex-wrap:wrap}.media-card-bottom .button{flex-shrink:0;max-width:100%}
/* Inline disclosure pushes its own card height; it cannot cover the next card. */
.media-card-more[open]{flex-basis:100%;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.media-card-more>button{position:static;min-width:0;box-shadow:none}
/* F11: intrinsic action height belongs to its form; sticky footer stays within that owner. */
.modal-dialog{min-width:0;overflow:hidden}.modal-content{flex:1 1 auto;scrollbar-gutter:stable}
.modal-content .modal-footer{position:sticky;bottom:-24px;z-index:2;background:#202020;padding:12px 0;margin-bottom:0;border-top:1px solid #444;max-height:35dvh;overflow:auto}
.modal-content :is(form,fieldset){min-width:0}.modal-header{max-height:25dvh;overflow:auto}
.drawer{display:flex;flex-direction:column}.drawer-header{flex:none;max-height:25dvh;overflow:auto}.drawer-body{flex:1}
dialog :is(header,footer){max-width:100%}dialog :is(button,input,select,textarea){min-width:0;max-width:100%}
.modal-dismiss-confirm{max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto}
/* F03/F04: panel columns have zero automatic minimum, content scroll belongs to each panel. */
.account-columns,.member-columns,.workspace-panel,.record-columns,.resource-health,.delivery-columns{min-width:0}
.client-surface>header,.section-toolbar{max-height:25cqh;overflow:auto}
.client-home{grid-template-rows:minmax(0,.6fr) minmax(0,.45fr) minmax(0,1fr)}
.client-home>.stats-grid,.client-home>.client-create-grid{overflow:auto;grid-auto-rows:max-content}
.client-create-grid{align-content:start}.client-home .stat-card{min-width:0}.client-home .stat-value{overflow-wrap:anywhere}
.client-recent{overflow:hidden}.client-recent .panel-header{flex:none;max-height:35%;overflow:auto}
.persona-page,.product-workspace,.service-panel{overflow:hidden}
.client-content>.empty-state{min-height:0;overflow:auto}
#analytics-dashboard>.analytics-toolbar{max-height:18cqh;overflow:auto}
#analytics-dashboard .analytics-section-heading{flex-wrap:wrap;max-height:35%;overflow:auto}
#analytics-dashboard .analytics-chart-controls{flex-wrap:wrap}
#analytics-dashboard .analytics-pages{flex-wrap:wrap;max-height:30%;overflow:auto}
/* Subpanels can wrap controls; none of these rules removes a field. */
.music-studio :is(.ms-inline,.ms-layer-settings,.ms-position,.ms-cover-tools,.ms-pub-end,.ms-checks){flex-wrap:wrap}
.music-studio .ms-field>span{flex-shrink:1;overflow-wrap:anywhere}
.music-studio .ms-preview>header{height:auto;min-height:34px;flex-wrap:wrap;max-height:30%;overflow:auto}
.music-studio .ms-preview>header>div{max-width:100%;flex-wrap:wrap}
.music-studio .ms-preview>header select{display:block}
.music-studio .ms-player{height:auto;min-height:32px;flex-wrap:wrap;max-height:30%;overflow:auto}
.music-studio .ms-player input{flex:1 1 80px}
.music-studio .ms-text-tabs{height:auto;min-height:38px;overflow:auto;flex:none}
.music-studio .ms-pub-tabs{height:auto;min-height:38px;max-height:25%;overflow:auto}
.music-studio .ms-audio>header{flex-wrap:wrap;gap:8px}
.music-studio .ms-text-tabs button{white-space:normal;overflow-wrap:anywhere}
/* Narrow content: declare a module scroll owner instead of negative remaining widths. */
@container client (max-width:580px){
 .music-studio{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(220px,1fr) minmax(380px,1.6fr) minmax(340px,1.4fr);overflow:auto}
 .ms-center,.ms-right{min-height:0}.ms-publications{min-height:220px}
 .workspace-panel,.account-columns,.member-columns,.record-columns{grid-template-columns:minmax(0,1fr);overflow:auto;grid-auto-rows:max-content}
 .workspace-context,.record-detail{border:0;padding:0}.record-columns>*{min-height:200px}
 .audit-filters,.usage-summary,.usage-panel .quota-rows,.resource-health{grid-template-columns:minmax(0,1fr)}
 .client-recent-row{grid-template-columns:minmax(0,1fr) 24px}.client-recent-row>span:nth-child(2){grid-column:1;grid-row:2}
}
/* Below 560 content px, dashboard modules retain readable minima in one local scroller. */
@container client (max-height:560px){
 #analytics-dashboard{overflow:auto;grid-template-rows:auto auto auto minmax(110px,auto) minmax(230px,auto) minmax(260px,auto)}
 .client-home{overflow:auto;grid-template-rows:minmax(130px,auto) minmax(80px,auto) minmax(180px,1fr)}
 .music-columns-panel{height:96px}
}
@media(max-width:720px){.modal-content .modal-footer{bottom:-18px}}

/* S08 template wizard: Hcontent=Hdialog-header-padding-steps-footer-error-gaps. */
.modal-dialog:has(.tw-wizard){height:min(860px,calc(100dvh - 32px))}
.modal-content:has(>.tw-wizard){display:flex;overflow:hidden;padding:16px}
.modal-content>.tw-wizard{flex:1;min-width:0;min-height:0;width:100%;overflow:hidden}
.tw-wizard>.tw-steps{flex:none;max-height:20%;overflow:auto;padding-bottom:10px;gap:6px}
.tw-wizard>.tw-content{flex:1;min-height:0;max-height:none;overflow:auto;padding:12px 4px}
.tw-wizard>.tw-footer{flex:none;max-height:25%;overflow:auto;flex-wrap:wrap;padding:10px 0 0}
.tw-wizard>#tpl-editor-error{flex:none;max-height:10%;overflow:auto;margin:6px 0 0}
/* S10, S11 canvas editors retain their own coordinate model; only the outside budget changes. */
.flow-cover-dialog.typography-editor[open]{height:min(850px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);padding:16px}
.typography-editor .flow-cover-body{flex:1;min-height:0;max-height:none;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:16px;overflow:hidden}
.typography-editor :is(.typo-preview,.typo-controls){min-width:0;min-height:0;overflow:auto}
.typography-editor>header,.typography-editor>footer{flex:none;max-height:20%;overflow:auto;flex-wrap:wrap}
.typography-editor .typo-canvas-wrap canvas{width:100%;height:min(25dvh,220px);object-fit:contain}
.cover-workbench{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}
.cover-workbench>*{min-width:0}.cover-assets{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))}
/* S12/S13 selector dialogs: the grid gets remaining H, not a fixed viewport deduction. */
.asset-library-dialog[open]{display:flex;flex-direction:column;min-height:0}
.asset-library-dialog>header,.asset-library-dialog>footer,.asset-library-dialog>.material-selection-bar{flex:none;max-height:25dvh;overflow:auto;flex-wrap:wrap}
.asset-library-dialog>:is(.asset-image-grid,.persona-body,.music-directory-list,.material-browser){flex:1;min-height:0;overflow:auto}
.asset-library-dialog .asset-image-grid{grid-auto-rows:max-content}
.main[data-page=folders] .material-browser{height:auto}
.material-tabs,.material-toolbar{max-height:25cqh;overflow:auto;flex-wrap:wrap;flex:none}
.material-audio-row audio{min-width:0;max-width:100%}
/* S17 script body already owns its scroll. Keep message and actions in the remaining budget. */
.modal-dialog:has(#product-scripts){height:min(850px,calc(100dvh - 32px))}
#product-scripts{max-height:none;flex:1}
#product-scripts>.modal-footer{position:static;flex:none;max-height:25%;overflow:auto}
#product-scripts>[data-script-message]{max-height:15%;overflow:auto}
.main[data-page=servers] .srv-summary{flex:none;max-height:20cqh;overflow:auto;margin:0;padding:8px 0}
.main[data-page=servers] .srv-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr))}
@media(max-width:800px){
 .typography-editor .flow-cover-body{grid-template-columns:minmax(0,1fr);overflow:auto;grid-auto-rows:max-content}
 .typography-editor :is(.typo-preview,.typo-controls){overflow:visible}
 .cover-workbench{grid-template-columns:minmax(0,1fr)}
}

/* S04/S05: header + remaining two panes + error + actions, each owns its content. */
.modal-dialog:has(#live-task-modal){width:min(1180px,calc(100vw - 32px));height:min(860px,calc(100dvh - 32px))}
.modal-content:has(>#live-task-modal){display:flex;min-height:0;overflow:hidden;padding:16px}
#live-task-modal{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:12px;overflow:hidden}
.task-detail-header{flex:none;max-height:25%;min-width:0;overflow:auto}
.task-detail-header h3{margin:0;font-size:16px;overflow-wrap:anywhere}
.task-detail-header .modal-help{margin:6px 0}
.task-detail-body{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:16px;flex:1;min-height:0;min-width:0}
.task-detail-media,.task-detail-context{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.task-detail-context{padding-left:16px;border-left:1px solid #444}
.task-detail-body .form-section-title{margin:0 0 10px}
.task-detail-media .live-assets{display:flex;flex-direction:column;gap:12px}
.task-detail-media .live-asset{flex:none;min-width:0;padding:12px}
.task-detail-media .live-preview{display:block;width:100%;max-width:100%;max-height:35dvh;object-fit:contain}
.task-detail-context .live-json{max-width:100%;max-height:none;white-space:pre-wrap;overflow-wrap:anywhere}
.task-detail-context .field{margin-bottom:0}.task-detail-context textarea{width:100%;min-height:80px;max-height:30dvh}
#live-task-modal>#live-action-error{flex:none;max-height:12%;overflow:auto;margin:0}
#live-task-modal>#live-action-error:empty{display:none}
#live-task-modal>.modal-footer{position:static;flex:none;max-height:25%;min-width:0;overflow:auto;margin:0;padding:12px 0 0;flex-wrap:wrap}
@media(max-width:700px){.task-detail-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(120px,1fr) minmax(120px,1fr);overflow:auto}.task-detail-context{border-left:0;padding-left:0;border-top:1px solid #444;padding-top:12px}}
@media(max-height:600px){#live-task-modal{overflow:auto}.task-detail-body{flex:1 0 180px}#live-task-modal>.modal-footer{position:sticky;bottom:0;background:#202020}}

/* S01/S02/S03/S06/S09/S14/S15/S16/S20: F11 dialog, F03 remainder, F04 columns.
   Header/status/actions consume intrinsic capped height; only the named body scrolls. */
.modal-dialog:has(:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry,[data-plan-reader],#publish-material-form,#tpl-trash,#product-form,[data-brand-form],[data-customer-form],[data-delivery-form])){width:min(1180px,calc(100vw - 32px));height:min(860px,calc(100dvh - 32px))}
.modal-content:has(>:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry,[data-plan-reader],#publish-material-form,#tpl-trash,#product-form,[data-brand-form],[data-customer-form],[data-delivery-form])){display:flex;min-height:0;overflow:hidden;padding:16px}
:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry,[data-plan-reader],#publish-material-form,#tpl-trash,#product-form,[data-brand-form],[data-customer-form],[data-delivery-form]){display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:12px;margin:0;overflow:hidden}
:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry)>:is(nav,aside){flex:none;max-height:20%;overflow:auto;position:static;margin:0;padding:4px 0}
:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry)>:is(.flow-body,.sp-entry-body){flex:1;min-width:0;min-height:0;overflow:auto;scrollbar-gutter:stable}
:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry)>footer{flex:none;max-height:25%;overflow:auto;position:static;margin:0;padding-top:12px;flex-wrap:wrap}
:is(#product-form,[data-brand-form],[data-customer-form],[data-delivery-form])>fieldset{flex:1;min-height:0;min-width:0;overflow:auto;scrollbar-gutter:stable;padding:0 6px 0 0;margin:0;border:0}
:is(#product-form,[data-brand-form],[data-customer-form],[data-delivery-form])>p{flex:none;max-height:15%;overflow:auto;margin:0;overflow-wrap:anywhere}
:is(#product-form,[data-brand-form],[data-customer-form],[data-delivery-form],#publish-material-form)>.modal-footer{flex:none;max-height:25%;overflow:auto;position:static;margin:0;padding-top:12px}
.publication-columns{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:16px;flex:1;min-height:0;min-width:0}
.publication-materials,.publication-targets{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.publication-materials>.live-preview{display:block;width:100%;max-height:34dvh;object-fit:contain}
.publication-materials>.modal-help{margin:0 0 12px}.publication-materials .live-assets{display:block}.publication-materials .live-asset{width:100%;margin:10px 0}
.publication-targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:12px}
.publication-targets>.panel{min-width:0;margin:0;padding:12px}.publication-targets .field{margin:0 0 12px}.publication-targets label{overflow-wrap:anywhere}
#publish-material-form>#publish-prepare-error{flex:none;max-height:12%;overflow:auto;margin:0}
.plan-reader-heading{flex:none;max-height:20%;overflow:auto}.plan-reader-heading h3{margin:0;overflow-wrap:anywhere}.plan-reader-heading p{margin:6px 0 0}
.plan-reader-columns{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:16px;flex:1;min-width:0;min-height:0}
.plan-reader-config{min-width:0;min-height:0;overflow:auto;scrollbar-gutter:stable}.plan-reader-config>.simple-details{margin-top:12px}
.plan-reader-columns>.plan-history-section{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;margin:0;padding-left:16px;border-left:1px solid #444}
.plan-history-section>.plan-history-tools{flex:none;max-height:30%;overflow:auto;flex-wrap:wrap}.plan-history-tools :is(label,input,select){min-width:0;max-width:100%}
.plan-history-section>[data-plan-reader-error]{flex:none;max-height:15%;overflow:auto;margin:4px 0}
.plan-history-section>[data-plan-history]{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}.plan-history-list{padding-left:22px}.plan-history-list header,.plan-history-versions{flex-wrap:wrap;gap:8px}
#tpl-trash>.tpl-section-copy,#tpl-trash>.tpl-error{flex:none;max-height:15%;overflow:auto;margin:0}
#tpl-trash>.tpl-trash-list{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
#tpl-trash>.tpl-delete-footer{flex:none;max-height:25%;overflow:auto;margin:0;padding-top:12px}
.tpl-trash-row{min-width:0;flex-wrap:wrap;gap:12px}.tpl-trash-row>div{flex:1 1 240px;min-width:0}.tpl-trash-row strong{overflow-wrap:anywhere}
/* S07: same row height despite scan/status/error changes; QR square bounded by W and H. */
body .modal-dialog.account-login-dialog{height:min(760px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
.account-login-dialog .modal-content{display:flex;flex-direction:column;gap:12px;overflow:hidden;padding:16px}
.account-login-grid{flex:1;min-height:0;min-width:0;gap:16px;grid-template-rows:minmax(0,1fr)}
.account-login-card{min-height:0;overflow:auto;padding:16px;scrollbar-gutter:stable}.account-login-card h3{margin:0 0 12px}
.account-login-code{width:min(220px,100%,32dvh);height:auto;min-height:0;aspect-ratio:1;margin:12px auto 0}
.account-login-footer{flex:none;max-height:25%;overflow:auto;flex-wrap:wrap;margin:0;padding-top:12px}.account-login-footer span{flex:1 1 200px}.account-login-footer button{margin-left:auto}
/* S12/S13/S30: title/tools/status/progress and footer stay outside the list remainder. */
.asset-library-dialog:has(>.image-management-list){height:min(800px,calc(100dvh - 32px))}
.asset-library-dialog>.image-management-list{flex:1;min-height:0;overflow:auto}
.asset-library-dialog>:is(.asset-library-toolbar,.directory-tabs,progress,[role=status],[role=alert]){flex:none;max-height:12dvh;overflow:auto;overflow-wrap:anywhere}
.asset-library-dialog .directory-file{min-width:0;flex-wrap:wrap}.asset-library-dialog .directory-file>span{flex:1 1 160px;min-width:0;overflow-wrap:anywhere}
@media(max-width:900px){.publication-targets{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){
 .publication-columns,.plan-reader-columns{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(160px,.8fr) minmax(200px,1.2fr);overflow:auto}
 .plan-reader-columns>.plan-history-section{padding-left:0;border-left:0;border-top:1px solid #444;padding-top:12px}
}
@media(max-width:640px){.account-login-grid{overflow:auto;grid-template-rows:none;grid-auto-rows:max-content}.account-login-card{overflow:visible}}
@media(max-height:600px){
 :is(#production-plan-editor,#infinite-template-editor,#task-plan-entry,[data-plan-reader],#publish-material-form,#tpl-trash,#product-form,[data-brand-form],[data-customer-form],[data-delivery-form]){overflow:auto}
 :is(#production-plan-editor,#infinite-template-editor,#task-plan-entry)>:is(.flow-body,.sp-entry-body),:is(#product-form,[data-brand-form],[data-customer-form],[data-delivery-form])>fieldset,.publication-columns,.plan-reader-columns,#tpl-trash>.tpl-trash-list{flex:1 0 160px}
 :is(#product-form,[data-brand-form],[data-customer-form],[data-delivery-form],#publish-material-form)>.modal-footer,:is(#production-plan-editor,#infinite-template-editor,#task-plan-entry)>footer,#tpl-trash>.tpl-delete-footer{position:sticky;bottom:0;background:#202020;z-index:2}
}

/* S08 actual general/InfiniteTalk editors and retained H3 entry share F03, not a 57vh nested body. */
.modal-dialog:has(:is(#chiyu-template-media-prototype,#h3-editor,#srv-live-form)){width:min(1180px,calc(100vw - 32px));height:min(860px,calc(100dvh - 32px))}
.modal-content:has(>:is(#chiyu-template-media-prototype,#h3-editor,#srv-live-form)){display:flex;min-height:0;overflow:hidden;padding:16px}
#chiyu-template-media-prototype,#h3-editor,#srv-live-form{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden;gap:12px}
#chiyu-template-media-prototype>.p-page{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;gap:12px;padding:0}
#chiyu-template-media-prototype .p-page>.p-wizard-progress{flex:none;max-height:15%;overflow:auto;margin:0}
#chiyu-template-media-prototype .p-page>p{flex:none;max-height:10%;overflow:auto;margin:0!important}
#chiyu-template-media-prototype .p-page>[data-editor-step]:not([hidden]){flex:1;min-height:0;overflow:auto;margin:0;scrollbar-gutter:stable}
#chiyu-template-media-prototype .p-page>.p-bottom{flex:none;max-height:25%;overflow:auto;margin:0;padding-top:12px;flex-wrap:wrap}
#chiyu-template-media-prototype .p-page>.p-review{flex:none;max-height:25%;overflow:auto;margin:0}
#chiyu-template-media-prototype .p-page>.p-review pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
#chiyu-template-media-prototype .p-bottom .p-row{flex-wrap:wrap;max-width:100%}
#h3-editor>.h3-meta{flex:none;max-height:30%;overflow:auto}#h3-editor>.h3-content{flex:1;min-height:0;max-height:none;overflow:auto}
#h3-editor>.h3-error,#h3-editor>.h3-pending{flex:none;max-height:12%;overflow:auto;margin:0}
#h3-editor>.h3-footer{flex:none;max-height:25%;overflow:auto;flex-wrap:wrap}#h3-editor .h3-footer>div{flex-wrap:wrap}#h3-editor .h3-footer .button{white-space:normal}
#srv-live-form>.srv-form-fields{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
#srv-live-form>:is(.srv-live-form-note,.srv-live-error){flex:none;max-height:12%;overflow:auto;margin:0}
#srv-live-form>.srv-modal-actions{flex:none;max-height:25%;overflow:auto;flex-wrap:wrap;margin:0;padding-top:12px}
.modal-dialog>#publish-freshness{flex:none;max-height:12%;overflow:auto;overflow-wrap:anywhere}
.modal-dialog>#publish-latest{max-height:15%;max-width:calc(100% - 50px);overflow:auto;white-space:normal}
.ms-dialog>:is(header,footer){flex:none;max-height:20dvh;overflow:auto;flex-wrap:wrap}.ms-dialog>.ms-dialog-body{flex:1;min-height:0}.ms-dialog>.ms-dialog-error{max-height:12dvh;overflow:auto}
@media(max-width:800px){#chiyu-template-media-prototype .p-audio-strip,#chiyu-template-media-prototype .p-audio-strip:has(.p-audio-options:empty){grid-template-columns:minmax(0,1fr)}#chiyu-template-media-prototype .p-audio-options,#chiyu-template-media-prototype .p-audio-actions .p-row{max-width:100%}}
@media(max-height:600px){
 #chiyu-template-media-prototype>.p-page,#h3-editor,#srv-live-form{overflow:auto}
 #chiyu-template-media-prototype .p-page>[data-editor-step]:not([hidden]),#h3-editor>.h3-content,#srv-live-form>.srv-form-fields{flex:1 0 160px}
 #chiyu-template-media-prototype .p-page>.p-bottom,#h3-editor>.h3-footer,#srv-live-form>.srv-modal-actions{position:sticky;bottom:0;background:#202020;z-index:2}
}

/* F04/F08/F09: headings use parent remainder after the fixed marker and gap.
   Long labels wrap inside that column instead of becoming its min-content minimum. */
:is(.h3-section-heading,.pp-section-heading)>div{flex:1;min-width:0;overflow-wrap:anywhere}
#h3-editor .detail-kv{grid-template-columns:repeat(2,minmax(0,1fr))}
.detail-kv>div{min-width:0;overflow-wrap:anywhere}
#h3-editor legend{max-width:100%;white-space:normal;overflow-wrap:anywhere}

/* Billing geometry: content W = parent W - 2*padding; cards = (W - 3*gap)/4.
   Header/status remain intrinsic rows; only the remaining panel body scrolls. */
.billing-panel { min-width:0; min-height:0; overflow:hidden; }
.billing-panel > [role="tabpanel"] { min-width:0; min-height:0; }
.billing-panel [hidden] { display:none!important; }
.billing-panel .panel-scroll { min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; }
.billing-overview { display:flex; gap:16px; align-items:flex-start; justify-content:space-between; padding:4px 0 12px; }
.billing-overview h2,.billing-section h3 { margin:0; font-size:16px; }
.billing-overview p,.billing-period { margin:6px 0; line-height:1.5; overflow-wrap:anywhere; }
.billing-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.billing-metric { padding:12px; border:1px solid var(--border); border-radius:8px; min-width:0; }
.billing-metric>span { font-size:12px; color:var(--muted); }
.billing-metric strong { display:block; margin-top:8px; font-size:24px; line-height:1.25; overflow-wrap:anywhere; }
.billing-metric small { font-size:12px; font-weight:400; }
.billing-section { padding:14px 0; border-top:1px solid var(--border); margin-top:12px; }
.billing-section>p,.billing-rules p { font-size:13px; line-height:1.6; margin:8px 0; }
.billing-table-scroll { overflow:auto; min-width:0; }
.billing-table { border-collapse:collapse; width:100%; font-size:13px; table-layout:auto; }
.billing-table th,.billing-table td { padding:10px 12px; text-align:left; border-bottom:1px solid var(--border); vertical-align:top; overflow-wrap:anywhere; }
.billing-table td small { display:block; color:var(--muted); margin-top:3px; }
.billing-table th { font-weight:500; }
.billing-form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:12px; }
.billing-form-grid label { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:13px; }
.billing-form-grid input,.billing-form-grid select { width:100%; min-width:0; box-sizing:border-box; }
.billing-panel [data-billing-content="resources"] { display:flex; flex-direction:column; }
.billing-panel [data-billing-status]:empty { display:none; }
.billing-panel [data-billing-recovery] { padding:10px; border:1px solid var(--border); border-radius:8px; }
@media(max-width:1000px){.billing-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}.billing-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.billing-form-grid{grid-template-columns:minmax(0,1fr);}.billing-overview{flex-wrap:wrap;}.billing-table th,.billing-table td{padding:8px 6px;}}

/* Account navigation: shared header budget = viewport - nav - 2*padding.
   Breadcrumb receives the remainder; right controls never overlap or leave their parent. */
body .sidebar-plan{display:flex;flex:none;align-items:center;gap:8px;min-width:0;height:40px;margin:8px 0;padding:0 10px;border:1px solid #444;border-radius:7px;background:#242424;color:#ddd;text-decoration:none;font-size:13px}
.sidebar-plan>svg{flex:none}.sidebar-plan>span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .sidebar-plan:hover,body .sidebar-plan.active{background:#333;color:#fff}
body .topbar-actions>*{flex-shrink:0}
body .header-credits{display:flex;align-items:center;justify-content:center;gap:6px;width:clamp(96px,12vw,144px);height:32px;padding:0 8px;border:1px solid #444;border-radius:6px;background:#242424;color:#eee;text-decoration:none;min-width:0;font-size:13px}
.header-credits>svg{flex:none}.header-credits>[data-header-credits]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.header-credits>small{flex:none;font-size:11px;color:#aaa}
body .header-avatar{display:flex;align-items:center;justify-content:center;width:32px;height:32px;overflow:hidden;border:1px solid #555;border-radius:50%;background:#393939;color:#eee;text-decoration:none;font-size:14px}
:is(.sidebar-plan,.header-credits,.header-avatar):focus-visible{outline:2px solid #ddd;outline-offset:2px}
.billing-catalog [data-catalog-content]>.billing-section:first-child{margin-top:0;padding-top:0;border-top:0}
.billing-catalog .billing-table{min-width:620px}.billing-catalog .section-toolbar{margin-bottom:12px}
@media(max-width:600px){body .topbar{gap:6px}.topbar-actions>.bell-button{display:none}.topbar-actions{gap:5px}.header-credits{width:96px}}
@media(max-width:480px){.billing-metrics{grid-template-columns:minmax(0,1fr)}}

.platform-login-header{height:54px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;border-bottom:1px solid #333;background:#171717}.platform-login-header .platform-brand{margin:0;font-size:17px}.platform-login-header+.platform-login{height:calc(100dvh - 54px);min-height:0;overflow:auto;box-sizing:border-box}
