@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@800&display=swap');

/* Universal two-line KwizIQ shell; source: brand/guidelines.md section 6. */
.topbar-shell { container-type: inline-size; position: sticky; top: 0; z-index: 10; flex: none; }
.topbar, .topbar * { box-sizing: border-box; }
.topbar {
  --navy: #004064; --navy-dark: #0a172a; --sky: #a6deff;
  --kwiziq-navy: #0a172a; --kwiziq-accent-corporate: #f28d00;
  --kwiziq-tile-investors: #153e75; --kwiziq-version-muted: #8e9bae;
  --kwiziq-font-display: Poppins, sans-serif; --kwiziq-avatar-ring-width: .125rem;
  --kwiziq-topbar-line-gap: .2em;
  position: relative; display: flex; flex-wrap: nowrap;
  align-items: flex-start; justify-content: space-between; gap: .7em;
  width: 100%; max-width: none; margin: 0;
  padding: .5em .875em; background: var(--kwiziq-navy); color: #dfe6ea;
  border-bottom: .0625em solid rgb(255 255 255 / .08);
  font-family: Inter, system-ui, sans-serif; font-size: min(1rem, 4.1cqi); line-height: 1.25;
}
.topbar .brand { display: flex; flex-wrap: nowrap; align-items: center; gap: .7em; min-width: 0; color: #dfe6ea; text-decoration: none; padding: 0; }
.topbar .brand-tile { position: relative; display: block; width: 3.65em; height: 3.65em; flex-shrink: 0; border-radius: 22.07%; background: var(--kwiziq-tile-investors); }
.topbar .brand-icon { display: block; width: 100%; height: 100%; }
.topbar .wordmark { display: flex; flex-direction: column; gap: var(--kwiziq-topbar-line-gap); min-width: 0; }
.topbar .brand-line-one { display: flex; align-items: center; height: 2.25em; }
.topbar .brand .brand-logo { display: block; height: 1.25em; width: auto; flex-shrink: 0; }
.topbar .brand-line-two { display: flex; align-items: baseline; gap: .4em; white-space: nowrap; line-height: 1.2; }
.topbar .brand-context { font-family: var(--kwiziq-font-display); font-size: 1em; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--kwiziq-accent-corporate); }
.topbar .wordmark .app-release { margin: 0; font-family: Inter, system-ui, sans-serif; font-size: .8125em; font-weight: 600; line-height: 1.2; color: var(--kwiziq-version-muted); }
.topbar .development-badge, .topbar .staging-badge { position: absolute; top: -.28em; left: 50%; transform: translateX(-50%); display: block; white-space: nowrap; text-align: center; font-size: .56em; line-height: 1.2; font-weight: 900; padding: .08em .42em; border-radius: 999em; box-shadow: 0 0 0 .15em var(--kwiziq-navy); }
.topbar .development-badge { min-width: 3.1em; background: #ff6a00; color: #fff; }
.topbar .staging-badge { background: #b8ff00; color: #0a172a; }
.topbar .site-menu { flex-shrink: 0; }
.topbar .site-menu > .profile-trigger { position: relative; display: block; width: 2.25em; height: 2.25em; min-height: 0; padding: 0; border: 0; border-radius: 999em; list-style: none; cursor: pointer; }
.topbar .profile-trigger:hover .profile-avatar,
.topbar .profile-trigger:focus-visible .profile-avatar,
.topbar .site-menu[open] .profile-avatar { border-color: #ffb64f; }
.profile-trigger::-webkit-details-marker { display: none; }
.topbar .profile-avatar { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; border: var(--kwiziq-avatar-ring-width) solid var(--kwiziq-accent-corporate); background: #004064; color: #fff; font-size: .75rem; font-weight: 700; }
.topbar .profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.topbar .profile-chevron { position: absolute; right: -.125rem; bottom: -.125rem; display: grid; place-items: center; width: .875rem; height: .875rem; background: #0a172a; border: .0625rem solid rgb(255 255 255 / .3); border-radius: 999rem; color: #dfe6ea; font-size: .75rem; line-height: 1; }
.topbar .site-menu[open] .profile-chevron { transform: none; }
.topbar .menu-content { position: absolute; top: 100%; right: .5rem; width: min(24rem, calc(100% - 1rem)); max-height: calc(100dvh - 4.7125em); overflow-y: auto; padding: .875rem; background: #0a172a; color: #dfe6ea; border: .0625rem solid rgb(255 255 255 / .15); border-radius: 0 0 .5rem .5rem; box-shadow: 0 .5rem 1rem rgb(10 23 42 / .2); }
.topbar .profile-identity { display: grid; gap: .25rem; padding: .25rem .5rem .75rem; margin-bottom: .5rem; border-bottom: .0625rem solid rgb(255 255 255 / .15); overflow-wrap: anywhere; }
.topbar .profile-identity span { font-size: .8125rem; color: #aebcc6; }
.topbar .user-chip { display: block; margin: 0; padding: 0; border: 0; }
.topbar .user-chip form { margin: 0; }
.topbar .user-chip button, .topbar .pwa-install { display: block; width: 100%; text-align: left; min-height: 2.5rem; padding: .5rem; border: 0; border-radius: .25rem; background: transparent; color: #dfe6ea; font: 600 .875rem Inter, system-ui, sans-serif; cursor: pointer; }
.topbar .user-chip button:hover { background: #004064; }
.topbar .profile-build { padding: .75rem .5rem .25rem; margin-top: .5rem; border-top: .0625rem solid rgb(255 255 255 / .15); font: .625rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: rgb(223 230 234 / .56); overflow-wrap: anywhere; }
.topbar :focus-visible { outline: .1875rem solid #a6deff; outline-offset: .1875rem; }
.topbar > .btn { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 2.25em; padding: .375em .625em; background: transparent; color: #dfe6ea; border: .0625rem solid rgb(255 255 255 / .3); border-radius: .375rem; font-size: .8125rem; text-decoration: none; }
.topbar [hidden] { display: none !important; }

/* Role selection is independent of the account disclosure. */
.topbar .header-controls { display: flex; align-items: flex-start; gap: .5em; flex-shrink: 0; }
.topbar .role-picker { margin: 0; }
.topbar .role-picker > summary { display: flex; align-items: center; justify-content: center; gap: .25em; min-height: 2.25em; padding: .25em .5em; border: .0625rem solid rgb(255 255 255 / .3); border-radius: .375rem; font-size: .8125em; cursor: pointer; list-style: none; }
.topbar .role-picker > summary::after { content: '⌄'; }
.topbar .role-picker > summary::-webkit-details-marker { display: none; }
.topbar .role-picker-icon { display: none; }
.topbar .view-as { position: absolute; right: .5rem; top: 100%; display: grid; gap: .25rem; width: min(22rem, calc(100% - 1rem)); max-height: calc(100dvh - 5em); overflow-y: auto; margin: 0; padding: .5rem; background: var(--navy-dark); color: #dfe6ea; border: .0625rem solid var(--sky); border-radius: .375rem; box-shadow: 0 .5rem 1rem rgb(10 23 42 / .2); font-size: .875rem; }
.topbar .view-as p { margin: 0; padding: .5rem .75rem; }
.topbar .view-as button { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.75rem; padding: .5rem .75rem; background: transparent; color: inherit; border: .0625rem solid transparent; border-radius: .25rem; font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.topbar .view-as button:hover, .topbar .view-as button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.topbar .view-as button[aria-pressed="true"] span { color: var(--sky); }

/* One set of permission-filtered links: scrollable tabs, then a desktop rail. */
.workspace-shell { min-width: 0; }
.workspace-shell > main, .workspace-content { width: 100%; min-width: 0; }
.app-navigation { display: flex; gap: .25rem; overflow-x: auto; padding: .5rem .75rem; margin: 0; background: #0a172a; color: #dfe6ea; font: 600 .875rem/1.4 Inter, system-ui, sans-serif; scrollbar-width: thin; }
.app-navigation a { display: flex; align-items: center; flex: 0 0 auto; min-height: 2.75rem; padding: .5rem .75rem; color: inherit; border-bottom: .1875rem solid transparent; border-radius: .25rem .25rem 0 0; text-decoration: none; white-space: nowrap; }
.app-navigation a:hover, .app-navigation a[aria-current="page"] { background: #004064; color: #fff; }
.app-navigation a[aria-current="page"] { border-color: #f28d00; }
.app-navigation a:focus-visible { outline: .1875rem solid #a6deff; outline-offset: -.1875rem; }
.deck-workspace { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.deck-workspace > .app-navigation { flex-shrink: 0; }
.deck-workspace > iframe { min-width: 0; }
@media (min-width: 64rem) {
  .workspace-shell:has(> .app-navigation) { display: grid; grid-template-columns: 13rem minmax(0, 1fr); align-items: start; }
  .app-navigation { flex-direction: column; overflow-x: hidden; padding: .75rem; align-self: stretch; }
  .app-navigation a { flex: none; white-space: normal; border-bottom: 0; border-inline-start: .1875rem solid transparent; border-radius: 0 .25rem .25rem 0; }
  .deck-workspace:has(> .app-navigation) { align-items: stretch; }
  .deck-workspace > .app-navigation { min-height: 0; overflow-y: auto; }
  .deck-workspace > iframe { height: 100%; }
}
@media (max-width: 25rem) {
  .topbar { gap: .4em; padding-inline: .5em; }
  .topbar .brand { gap: .4em; }
  .topbar .header-controls { gap: .3em; }
  .topbar .role-picker > summary { padding-inline: .3em; }
}
