/* One header owns brand, back/menu actions and the persistent #progress nav.
   #app remains the scrolling workspace; viewport/keyboard sizing is unchanged. */
.app-frame { grid-template-rows:auto minmax(0,1fr) auto; }
.app-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.app-frame .app-topbar { display:grid; align-items:center; background:#fff; border-bottom:1px solid var(--line); }
.app-frame .app-topbar .app-topbar-title { display:none !important; }
.app-frame .app-topbar > .app-navigation { min-width:0; height:auto; margin:0; border:0; background:transparent; overflow:visible; }
.app-topbar .app-brand { min-width:0; }
.app-topbar .app-brand .brand-home { display:flex; min-height:44px; flex:0 0 auto; }
.app-topbar .app-brand:has(.app-home-link:not([hidden])) .brand-home { display:flex; }
.app-topbar .app-header-back,
.app-topbar .app-home-link,
.app-topbar .app-menu-button { min-width:44px; min-height:44px; }
.app-topbar .app-navigation .nav-bottom { display:none; }

@media (min-width:1000px) {
 .app-frame { grid-template-rows:76px minmax(0,1fr) auto; }
 .app-frame .app-topbar { grid-template-columns:auto minmax(0,1fr) auto; gap:20px; padding:0 24px; }
 .app-topbar .app-brand { gap:8px; }
 .app-topbar .app-brand .brand-logo { width:140px; max-height:44px; }
 .app-topbar .app-header-back { padding:8px; }
 .app-topbar .app-header-back::after,
 .app-topbar .app-menu-button::after { display:none; }
 .app-topbar .app-topbar-actions { justify-self:end; }
 .app-topbar .app-topbar-actions .app-menu-button { width:44px; padding:8px; }
 .app-frame .app-topbar > .app-navigation { display:block; padding:0; }
 .app-topbar .app-navigation .mobile-progress { display:none; }
 .app-topbar .app-navigation .progress-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; width:100%; max-width:760px; margin:0 auto; }
 .app-topbar .app-navigation .step-button { justify-content:center; min-width:0; min-height:44px; padding:8px 6px; gap:7px; border-radius:10px; font-size:13px; line-height:1.25; }
 .app-topbar .app-navigation .step-number { width:25px; height:25px; flex-basis:25px; }
 .app-topbar .app-navigation .step-name { min-width:0; }
}

@media (min-width:1200px) {
 .app-frame .app-topbar { padding-inline:max(32px, calc((100% - 1320px) / 2 + 32px)); gap:24px; }
 .app-topbar .app-brand { gap:12px; }
 .app-topbar .app-brand .brand-logo { width:156px; max-height:46px; }
 .app-topbar .app-header-back { padding-inline:8px; }
 .app-topbar .app-header-back::after { display:inline; }
 .app-topbar .app-topbar-actions .app-menu-button { width:auto; padding-inline:12px; }
 .app-topbar .app-menu-button::after { display:inline; }
 .app-topbar .app-navigation .step-button { font-size:14px; gap:8px; }
}

@media (max-width:999px) {
 .app-frame .app-topbar { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"brand actions" "progress progress"; column-gap:8px; row-gap:0; padding:4px 12px 0; }
 .app-topbar .app-brand { grid-area:brand; gap:6px; min-height:48px; }
 .app-topbar .app-brand .brand-logo { width:128px; max-height:38px; }
 .app-topbar .app-header-back { padding:8px; }
 .app-topbar .app-header-back::after,
 .app-topbar .app-menu-button::after { display:none; }
 .app-topbar .app-home-link { padding-inline:4px; gap:6px; font-size:14px; }
 .app-topbar .app-topbar-actions { grid-area:actions; justify-self:end; }
 .app-topbar .app-topbar-actions .app-menu-button { width:44px; padding:10px; }
 .app-frame .app-topbar > .app-navigation { display:grid; grid-area:progress; grid-template-areas:"progress"; padding:0 4px; }
 .app-topbar .app-navigation .mobile-progress { display:flex; grid-area:progress; align-self:start; justify-content:space-between; width:100%; min-width:0; min-height:18px; margin:3px 0 0; gap:8px; color:var(--muted); font-size:12px; line-height:1.4; pointer-events:none; z-index:1; }
 .app-topbar .mobile-progress > span { flex-shrink:0; white-space:nowrap; }
 .app-topbar .mobile-progress > strong { min-width:0; margin:0; color:var(--ink); font-size:12px; font-weight:600; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
 .app-topbar .app-navigation .progress-nav { display:grid; grid-area:progress; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; width:100%; max-width:none; margin:0; }
 .app-topbar .app-navigation .step-button { position:relative; min-height:44px; height:44px; padding:0; border:0; border-radius:0; background:transparent; font-size:0; }
 .app-topbar .app-navigation .step-button::after { content:''; position:absolute; inset:32px 0 auto; height:3px; border-radius:3px; background:#e5eaf1; }
 .app-topbar .app-navigation .step-button.active::after { background:var(--teal); }
 .app-topbar .app-navigation .step-button.complete::after { background:#9cacc2; }
 .app-topbar .app-navigation .step-button .step-number,
 .app-topbar .app-navigation .step-button .step-name { display:none; }
 .app-topbar .app-navigation .step-button:focus-visible { outline-offset:-3px; }
 body[data-keyboard="true"] .app-frame .app-topbar > .app-navigation,
 body[data-view="menu"] .app-frame .app-topbar > .app-navigation,
 body[data-view="summary"] .app-frame .app-topbar > .app-navigation,
 body[data-view="confirmation"] .app-frame .app-topbar > .app-navigation { display:none; }
}
