/* Shared header for Home, viewer and account pages. Migrated to the Design System: tokens only (checked by scripts/ds-lint.mjs).
   Buttons, avatar and account menu use .ds-button, .ds-avatar and .ds-menu from ds-components.css; this file only lays them out. */
.atlas-header{font:var(--ds-text-base)/1.5 var(--ds-font-body);color:var(--ds-color-text);background:var(--ds-color-surface);border-bottom:1px solid var(--ds-color-line);box-sizing:border-box}
.atlas-header :is(button,a,summary):focus-visible{outline:var(--ds-focus-ring);outline-offset:var(--ds-focus-offset)}
.atlas-header .atlas-header-logo{display:inline-flex;flex-shrink:0;text-decoration:none;white-space:nowrap}
.atlas-header .atlas-header-logo atlas-logo{--ds-logo-width:var(--ds-logo-width-sm)}
.atlas-header--guest .header-contact>span{display:none}
.atlas-header .account-controls{display:flex;flex-direction:column;align-items:flex-end;gap:5px;min-width:0;margin-left:auto}
.atlas-header .account-actions{display:flex;align-items:center;justify-content:flex-end;gap:20px;flex-wrap:wrap}
.atlas-header .account-actions .landing-nav{margin:0 8px 0 0;gap:24px;font:var(--ds-text-md)/1.5 var(--ds-font-body)}
.atlas-header .landing-nav :is(a,button):not(.ds-button){font:inherit;color:var(--ds-color-text-muted)}
.atlas-header .account-menu{position:relative}
.header-commerce-panel{width:min(400px,calc(100vw - var(--ds-space-4) * 2));box-sizing:border-box;margin:0;gap:var(--ds-space-4)}
.header-commerce-panel:not(:popover-open){display:none}
.commerce-overview{display:grid;gap:var(--ds-space-3);min-width:0}
#screen-analysis-loading[hidden],#capture-group[hidden],#audit-run-card[hidden]{display:none}
#screen-dialog>#audit-run-card{flex:none;padding:var(--ds-space-3) var(--ds-space-6)}
#evidence-panel.is-analyzing>:not(#screen-analysis-loading){display:none}
.commerce-metrics.ds-stats{grid-template-columns:repeat(2,minmax(0,1fr));margin:0;gap:var(--ds-space-3)}
.header-commerce-panel .commerce-metrics .ds-stat{flex-direction:row-reverse;align-items:center;justify-content:space-between;padding:var(--ds-space-4);gap:var(--ds-space-2)}
.header-commerce-panel .commerce-metrics .ds-stat>atlas-icon{display:inline-flex;flex:0 0 auto;padding:var(--ds-space-2)}
.commerce-facts{display:grid;gap:var(--ds-space-3);margin:0}
.commerce-facts dd{margin:0;text-align:right}
.commerce-balance-row.ds-card{display:flex;align-items:center;gap:var(--ds-space-4);padding:var(--ds-space-4)}
.commerce-balance-row dt{flex:1;min-width:0}
.commerce-balance-row dt>span{display:grid;gap:var(--ds-space-1)}
.commerce-balance-row dt strong{display:flex;align-items:center;gap:var(--ds-space-2)}
.commerce-balance-row dd{flex-shrink:0}
.commerce-balance-row .commerce-balance-amount{display:flex;align-items:center;justify-content:space-between;gap:var(--ds-space-2);order:-1;flex:0 0 calc(var(--ds-space-16) + var(--ds-space-4));text-align:left;font-size:var(--ds-text-2xl);font-weight:var(--ds-weight-semibold);line-height:var(--ds-leading-hero);font-variant-numeric:tabular-nums}
.commerce-balance-row dt strong,.commerce-balance-row .commerce-balance-amount{color:var(--ds-color-brand)}
#scene-home .commerce-home-card a.ds-link{color:var(--ds-color-brand)}
#scene-home .commerce-home-card a.ds-link:hover{color:var(--ds-color-brand-hover)}
.commerce-dialog.ds-dialog{width:min(1040px,calc(100vw - var(--ds-space-4) * 2));max-height:calc(100dvh - var(--ds-space-4) * 2);padding:0;overflow:hidden}
.commerce-dialog[open]{display:flex;flex-direction:column}
.commerce-operation-dialog.ds-dialog{width:min(640px,calc(100vw - var(--ds-space-4) * 2))}
.commerce-operation-dialog .commerce-modal-head{padding:var(--ds-space-4)}
.commerce-operation-dialog .commerce-modal-body{gap:var(--ds-space-3);padding:0 var(--ds-space-4) var(--ds-space-4)}
.commerce-operation-dialog .commerce-modal-footer{justify-content:flex-end;padding:var(--ds-space-3) var(--ds-space-4)}
.commerce-operation-dialog .ds-stat{padding:var(--ds-space-3)}
.commerce-operation-dialog .ds-stat>atlas-icon{display:none}
.commerce-operation-dialog .ds-stat strong{font-size:var(--ds-text-xl)}
.commerce-dialog [hidden],.commerce-pack-grid[hidden]{display:none}
.commerce-modal-head{flex:0 0 auto;justify-content:space-between;align-items:flex-start;padding:var(--ds-space-6)}
.commerce-heading{display:grid;gap:var(--ds-space-2);min-width:0;flex:1}
.commerce-heading h2{margin:0;padding:0}
.commerce-modal-body{display:grid;align-content:start;gap:var(--ds-space-6);padding:0 var(--ds-space-6) var(--ds-space-6);min-height:0;overflow:auto;overscroll-behavior:contain}
.commerce-modal-footer{flex:0 0 auto;justify-content:space-between;padding:var(--ds-space-4) var(--ds-space-6)}
.commerce-modal-footer .ds-field__hint{flex:1;min-width:0}
.commerce-modal-body>p{margin:0}
.commerce-pack-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--ds-space-4)}
.commerce-pack{display:grid;min-width:0;align-content:start;grid-template-rows:auto auto 1fr auto auto}
.commerce-pack .ds-badge{justify-self:start;white-space:normal}
.commerce-pack[data-sku="atlas-plus-60"]{grid-column:span 2}
.commerce-pack .ds-button{width:100%;margin-top:var(--ds-space-2)}
.commerce-centered{justify-content:center;margin-top:var(--ds-space-6)}
.commerce-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:var(--ds-space-4)}
.commerce-fields .ds-field{min-width:0}
.commerce-account{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ds-space-5)}
.commerce-account>.ds-banner,.commerce-account>.commerce-account-history{grid-column:1/-1}
.commerce-account>.ds-card{min-width:0;align-content:start}
.commerce-account .ds-card>.ds-button{justify-self:start}
.commerce-account .commerce-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
.commerce-account .commerce-balance-row.ds-card{flex-direction:column;align-items:flex-start;justify-content:flex-start}
.commerce-account .commerce-balance-row dt{flex:0 0 auto;width:100%}
.commerce-account .commerce-balance-row .commerce-balance-amount{flex:0 0 auto;width:100%}
@media(max-width:760px){
 .commerce-pack-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .commerce-fields{grid-template-columns:1fr}
 .commerce-metrics .ds-stat{flex-direction:column;align-items:flex-start}
 .commerce-metrics .ds-stat>atlas-icon{display:none}
 .commerce-account{grid-template-columns:1fr}
}
@media(max-width:480px){
 .commerce-modal-head{padding:var(--ds-space-4)}
 .commerce-modal-body{padding:0 var(--ds-space-4) var(--ds-space-4);gap:var(--ds-space-4)}
 .commerce-modal-footer{padding:var(--ds-space-4);gap:var(--ds-space-2)}
 .commerce-shop-footer{flex-direction:column;align-items:flex-start}
 .commerce-shop-footer .ds-field__hint{flex:none}
 .commerce-pack-grid{grid-template-columns:1fr}
 .commerce-pack[data-sku="atlas-plus-60"]{grid-column:auto}
 .commerce-modal-footer>.ds-button{flex:1}
}
.atlas-header .account-menu summary{display:flex;align-items:center;gap:10px;width:auto;height:auto;min-height:var(--ds-control-height-compact);padding:0;border:0;border-radius:var(--ds-radius-md);background:transparent;color:var(--ds-color-text);cursor:pointer;font-size:var(--ds-text-md);font-weight:var(--ds-weight-semibold);list-style:none}
.atlas-header .account-menu summary::-webkit-details-marker{display:none}
.atlas-header .account-menu summary:hover,.atlas-header .account-menu[open] summary{background:transparent;color:var(--ds-color-brand);border:0}
.atlas-header .atlas-account-name{overflow-wrap:anywhere;white-space:normal}
.atlas-header .account-menu summary>atlas-icon{--ds-icon-size:14px;color:var(--ds-color-text-muted)}
.atlas-header .account-menu-panel{position:absolute;right:0;top:calc(100% + 16px);width:260px;min-width:0;z-index:60}
.account-status:empty{display:none}
.atlas-header .account-publish-icon{display:none;transform:rotate(-90deg);--ds-icon-size:18px}
.atlas-header[data-header-context="home"],.atlas-header[data-header-context="account"]{display:flex;flex-wrap:wrap;align-items:center;gap:24px;min-height:82px;padding:18px max(24px,calc((100% - 1360px)/2))}
#home-view:has(#scene-home:not([hidden])) .atlas-header.home-header{min-height:82px;padding:18px max(24px,calc((100% - 1360px)/2));gap:24px}
#home-view:has(#scene-home:not([hidden])) .atlas-header.home-header.is-compact{min-height:68px;padding-block:12px}
.atlas-header-context{border-left:1px solid var(--ds-color-line);padding-left:24px;font-size:var(--ds-text-sm);color:var(--ds-color-text-muted);white-space:nowrap}
.atlas-header-back{margin-left:auto;font-size:var(--ds-text-md);white-space:nowrap}
.atlas-header-back+.account-controls{margin-left:4px}
.atlas-header.app-header{min-height:82px;padding:18px 28px;gap:24px}
.atlas-header.app-header .header-navigation{gap:14px}
.atlas-header.app-header .header-utilities{gap:12px}
.atlas-header.app-header .account-actions{gap:12px}
.atlas-header.app-header .header-utilities .account-controls{margin:0 4px 0 0}
@media(max-width:900px){.atlas-header-context{display:none}.atlas-header .account-actions{gap:14px}}
@media(min-width:761px){.atlas-header--guest .landing-nav [data-open-atlases]{display:none}}
@media(max-width:760px){.atlas-header.app-header{padding:14px 16px;gap:12px;min-height:70px}.atlas-header .atlas-account-name{display:none}.atlas-header .account-menu summary{gap:6px}.atlas-header .account-actions{gap:10px}}
@media(min-width:601px){.atlas-header--guest .atlas-header-sign-in>atlas-icon{display:none}}
@media(max-width:600px){
 #home-view:has(#scene-home:not([hidden])) .atlas-header--guest.home-header{gap:var(--ds-space-1)}
 .atlas-header--guest .atlas-header-logo atlas-logo{--ds-logo-width:var(--ds-logo-width-header-mobile)}
 .atlas-header--guest .account-actions{gap:var(--ds-space-1)}
 .atlas-header--guest .atlas-header-sign-in-label{display:none}
}
@media(max-width:760px){
 .atlas-header.app-header{grid-template-columns:minmax(0,1fr)}
 .atlas-header.app-header .header-navigation{grid-column:1;grid-row:1}
 .atlas-header.app-header .header-utilities{grid-column:1;grid-row:2}
 .atlas-header.app-header .header-utilities{width:100%;flex-wrap:wrap}
 .atlas-header.app-header .header-search-row{grid-column:1;grid-row:3}
}
@media(max-width:600px){
 .atlas-header[data-header-context="account"],.atlas-header[data-header-context="home"],#home-view:has(#scene-home:not([hidden])) .atlas-header.home-header{padding:14px 16px;gap:12px;min-height:70px}
 #home-view:has(#scene-home:not([hidden])) .atlas-header.atlas-header--guest.home-header{padding:var(--ds-space-3) var(--ds-space-4);gap:var(--ds-space-1)}
 .atlas-header--guest.home-header .atlas-header-logo{width:var(--ds-logo-width-header-mobile)}
 .atlas-header--guest.home-header :is(.shell-icon,.atlas-header-sign-in){width:var(--ds-control-height-compact);min-width:var(--ds-control-height-compact);height:var(--ds-control-height-compact);padding:0}
 .atlas-header[data-header-context="account"] .account-controls{margin-left:auto}
 .atlas-header .account-actions .landing-nav{gap:10px;margin-right:0}
 .atlas-header .account-menu summary>atlas-icon{display:none}
 .atlas-header .account-menu-panel{max-height:calc(100dvh - var(--ds-space-16) * 2);overflow-y:auto}
 .atlas-header-back{gap:0}
 .atlas-header-back span{display:none}
 .atlas-header .account-menu-panel{width:min(260px,calc(100vw - 32px))}
 .atlas-header.app-header{column-gap:8px}
 .atlas-header.app-header .header-navigation{gap:8px}
 .atlas-header.app-header .atlas-header-brand{flex-shrink:0}
 .atlas-header.app-header .atlas-header-logo{overflow:visible;text-overflow:clip}
 .atlas-header.app-header .header-utilities{gap:6px}
 .atlas-header.app-header .account-actions{gap:6px}
 .atlas-header.app-header .header-utilities .account-controls{margin:0 0 0 auto;order:1}
 .atlas-header.app-header .account-menu{position:static}
 .atlas-header.app-header .account-menu-panel{right:16px}
 .atlas-header.app-header :is(.header-icon,#open-sites-atlas){width:36px;min-width:36px;height:40px;padding:0}
}
