:root { --nz-shell-height: 60px; }
body.nz-shell-ready { padding-top: var(--nz-shell-height); }
.nz-project-header { position:fixed; inset:0 0 auto; z-index:1500; height:var(--nz-shell-height); display:flex; align-items:center; gap:22px; padding:8px 28px; border-bottom:1px solid var(--nz-line); background:var(--nz-surface); color:var(--nz-ink); box-shadow:0 3px 18px #10261f08; font-family:var(--nz-font-sans, sans-serif); font-size:14px; text-align:left; }
.nz-project-header *, .nz-project-header *::before { box-sizing:border-box; }
.nz-project-brand { display:flex; align-items:center; gap:10px; font-weight:600; white-space:nowrap; }
.nz-project-mark { display:grid; place-items:center; width:30px; height:30px; background:var(--nz-accent); color:var(--nz-accent-ink); border-radius:9px; font-family:var(--nz-font-serif,serif); font-size:22px; }
.nz-project-switcher { position:relative; }
.nz-project-switcher > summary { list-style:none; display:flex; align-items:center; gap:14px; cursor:pointer; border:1px solid var(--nz-line); border-radius:10px; padding:7px 12px; background:var(--nz-canvas); }
.nz-project-switcher > summary::-webkit-details-marker { display:none; }
.nz-project-switcher[open] > summary { border-color:var(--nz-accent); }
.nz-project-menu { position:absolute; left:0; top:calc(100% + 12px); width:340px; padding:10px; border:1px solid var(--nz-line); border-radius:16px; background:var(--nz-surface); box-shadow:0 16px 50px #061f2333; display:grid; gap:3px; max-height:calc(100dvh - 90px); overflow:auto; }
.nz-project-menu a { display:flex; gap:12px; align-items:center; min-height:64px; padding:10px; border-radius:10px; text-decoration:none; color:var(--nz-ink); font-size:15px; }
.nz-project-menu a:hover,.nz-project-menu a[aria-current="page"] { background:var(--nz-accent-soft); }
.nz-project-menu small { display:block; color:var(--nz-ink-2); font-size:13px; font-weight:400; margin-top:2px; }
.nz-project-icon { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--nz-line); border-radius:10px; color:var(--nz-accent); font-family:var(--nz-font-mono,monospace); font-weight:600; flex-shrink:0; }
.nz-project-preferences { margin-left:auto; display:flex; align-items:center; gap:8px; }
.nz-language-label { margin:0; display:block; }
.nz-project-header select { min-width:100px; width:auto; height:36px; margin:0; padding:6px 26px 6px 10px; border:1px solid var(--nz-line); border-radius:9px; background-color:var(--nz-canvas); color:var(--nz-ink); font:inherit; }
.nz-project-theme { width:36px; min-width:36px; height:36px; padding:0; display:grid; place-items:center; margin:0; border:1px solid var(--nz-line); border-radius:9px; background:var(--nz-canvas); color:var(--nz-ink); cursor:pointer; font-size:23px; line-height:1; }
.nz-project-header :is(button,select,summary,a):focus-visible { outline:3px solid var(--nz-focus,var(--nz-accent)); outline-offset:3px; }
/* 2026-10-20: three themes (White = light, Green = dark, Black = black) in a small menu; selectors are scoped and explicit so app form styles cannot leak in. */
.nz-theme-menu { position:relative; display:block; margin:0; }
.nz-project-header .nz-theme-options { position:absolute; right:0; top:calc(100% + 10px); z-index:2; display:block; min-width:188px; width:max-content; max-width:calc(100vw - 24px); margin:0; padding:6px; border:1px solid var(--nz-line); border-radius:12px; background:var(--nz-surface); color:var(--nz-ink); box-shadow:0 16px 50px #061f2333; text-align:left; }
.nz-project-header .nz-theme-options[hidden] { display:none; }
.nz-project-header .nz-theme-options legend { float:left; width:100%; margin:0; padding:4px 8px 6px; border:0; color:var(--nz-ink-2); font-size:13px; font-weight:500; line-height:1.3; }
.nz-project-header .nz-theme-options label { clear:both; display:flex; align-items:center; gap:10px; width:auto; min-height:40px; margin:0; padding:6px 10px 6px 8px; border-radius:8px; color:var(--nz-ink); font-size:14px; font-weight:400; line-height:1.3; text-transform:none; letter-spacing:0; cursor:pointer; }
.nz-project-header .nz-theme-options label:hover { background:var(--nz-accent-soft); }
.nz-project-header .nz-theme-options input[type="radio"] { flex:none; width:16px; min-width:16px; height:16px; margin:0; padding:0; border:0; box-shadow:none; background:none; accent-color:var(--nz-accent); appearance:auto; -webkit-appearance:radio; cursor:pointer; }
.nz-project-header .nz-theme-options input[type="radio"]:focus-visible { outline:3px solid var(--nz-accent); outline-offset:2px; }
.nz-project-header .nz-theme-options :checked ~ span:last-child { font-weight:600; }
.nz-theme-swatch { flex:none; width:22px; height:22px; border:1px solid var(--nz-line-strong); border-radius:6px; }
.nz-theme-options input[value="light"] + .nz-theme-swatch { background:linear-gradient(135deg,#eef0eb 55%,#286d5e 55%); }
.nz-theme-options input[value="dark"] + .nz-theme-swatch { background:linear-gradient(135deg,#162725 55%,#8acbb1 55%); }
.nz-theme-options input[value="black"] + .nz-theme-swatch { background:linear-gradient(135deg,#0a0a0a 55%,#5ec2b5 55%); }
@media (forced-colors: active) { .nz-theme-swatch { forced-color-adjust:none; } }
.nz-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
body.nz-shell-ready [data-nz-theme-toggle] { display:none!important; }
body[data-nz-app="bot"].nz-shell-ready :is(.shared-sidebar,.sidebar,.nz-rail) { top:var(--nz-shell-height); height:calc(100dvh - var(--nz-shell-height)); }
body[data-nz-app="proxy"].nz-shell-ready .app-rail { top:var(--nz-shell-height); height:calc(100dvh - var(--nz-shell-height)); }
body[data-nz-app="sentinel"].nz-shell-ready .sidebar { top:var(--nz-shell-height); height:calc(100dvh - var(--nz-shell-height)); }
body[data-nz-app="screen"].nz-shell-ready .app { height:calc(100dvh - var(--nz-shell-height)); }
/* 2026-10-11 overlap fix: every app-owned top bar, drawer, overlay, anchor target and full-height frame is offset by the fixed project header. */
body.nz-shell-ready .nz-masthead { top:var(--nz-shell-height,0px); }
body[data-nz-app="guardian"].nz-shell-ready :is(.sb-topbar,.agent-filter-bar) { top:var(--nz-shell-height,0px); }
body[data-nz-app="bot"].nz-shell-ready .panel-top { top:var(--nz-shell-height,0px); }
body[data-nz-app="bot"].nz-shell-ready .toast { top:calc(var(--nz-shell-height,0px) + 16px); }
body[data-nz-app="bot"].nz-shell-ready section[id] { scroll-margin-top:calc(var(--nz-shell-height,0px) + var(--panel-top-h,64px) + 16px); }
body[data-nz-app="sentinel"].nz-shell-ready .topbar { top:var(--nz-shell-height,0px); }
body[data-nz-app="sentinel"].nz-shell-ready .skip-link { top:calc(var(--nz-shell-height,0px) + 8px); }
body[data-nz-app="sentinel"].nz-shell-ready .skip-link:not(:focus) { transform:translateY(calc(-100% - var(--nz-shell-height,0px) - 8px)); }
body[data-nz-app="sentinel"].nz-shell-ready .modal { top:var(--nz-shell-height,0px); }
body[data-nz-app="sentinel"].nz-shell-ready .modal-card { max-height:min(820px, calc(92dvh - var(--nz-shell-height,0px))); }
body[data-nz-app="sentinel"].nz-shell-ready :is(.login-shell,.app-shell,.workspace) { min-height:calc(100dvh - var(--nz-shell-height,0px)); }
body[data-nz-app="proxy"].nz-shell-ready .app-header { top:var(--nz-shell-height,0px); }
body[data-nz-app="proxy"].nz-shell-ready :is(.login-shell,.loading,.app-shell) { min-height:calc(100dvh - var(--nz-shell-height,0px)); }
body[data-nz-app="screen"].nz-shell-ready :is(.login-page,.boot-state) { min-height:calc(100dvh - var(--nz-shell-height,0px)); }
body[data-nz-app="screen"].nz-shell-ready :is(.modal-backdrop,.transfer-backdrop) { top:var(--nz-shell-height,0px); }
@media(max-width:900px) {
 /* The kit's rail drawer hangs under the app masthead; keep that below the project header too. */
 body[data-nz-app="bot"].nz-shell-ready :is(.shared-sidebar,.nz-rail), body[data-nz-app="proxy"].nz-shell-ready .app-rail { top:calc(var(--nz-shell-height,0px) + var(--nz-masthead-h,56px)); height:auto; }
 body[data-nz-app="bot"].nz-shell-ready .nz-rail-scrim, body[data-nz-app="proxy"].nz-shell-ready .app-scrim, body[data-nz-app="sentinel"].nz-shell-ready .app-shell.menu-open .workspace::before { top:var(--nz-shell-height,0px); }
}
@media(max-width:720px) { body[data-nz-app="bot"].nz-shell-ready .toast { top:calc(var(--nz-shell-height,0px) + 12px); } }
html:has(body[data-nz-app="sentinel"]) { overflow-x:clip; }
body[data-nz-app="sentinel"] { overflow-x:clip; }
@media(max-width:600px) {
 .nz-project-header { padding:8px 12px; gap:9px; }
 .nz-project-brand { gap:7px; font-size:13px; }
 .nz-project-header select { min-width:87px; max-width:104px; font-size:13px; padding-left:7px; }
 .nz-project-switcher > summary { padding:7px 8px; gap:5px; font-size:13px; }
 .nz-project-mark { width:25px; height:28px; font-size:19px; }
 .nz-project-menu { position:fixed; left:12px; right:12px; top:66px; width:auto; }
 .nz-project-preferences { gap:5px; }
 .nz-project-theme { width:32px; min-width:32px; }
 .nz-project-brand > [data-nz-current-project] { max-width:64px; overflow:hidden; text-overflow:ellipsis; }
 body[data-nz-app="screen"] .login-header { flex-wrap:wrap; gap:12px; }
 body[data-nz-app="screen"] .login-header .brand-sub { white-space:normal; max-width:240px; }
 body[data-nz-app="screen"] #loginUsername { width:100%; }
}
/* Common administrator credentials are managed at the main site's accounts page. */
.nz-common-account-note { display:none; }
body[data-nz-shared-admin="true"] .nz-common-account-note { display:block; padding:18px; border:1px solid var(--nz-line); border-radius:12px; background:var(--nz-accent-soft); }
body[data-nz-shared-admin="true"] :is(#passwordForm,#password-form,form.password-panel),body[data-nz-shared-admin="true"] .panel-card:has(#passwordForm)>p:not(.nz-common-account-note),body[data-nz-shared-admin="true"] section:has(>#password-form)>.description { display:none; }

/* 2026-10-21 polish: app-wide details/summary or select styles can no longer reshape the header; the Projects arrow is drawn
   and turns when the menu opens; the language list uses the kit chevron; header controls answer the pointer; menus open
   with a short fade (none with reduced motion). */
.nz-project-header details.nz-project-switcher { margin:0; padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
.nz-project-header .nz-project-switcher > summary { min-height:36px; margin:0; gap:10px; color:var(--nz-ink); font-size:14px; font-weight:500; line-height:1.2; transition:border-color 120ms ease, background-color 120ms ease; }
.nz-project-header .nz-project-switcher > summary > span[aria-hidden="true"] { display:inline-block; flex:none; width:7px; height:7px; margin:-4px 2px 0 0; overflow:hidden; color:transparent; font-size:0; line-height:0; border-right:1.6px solid var(--nz-ink-2); border-bottom:1.6px solid var(--nz-ink-2); transform:rotate(45deg); transition:transform 160ms cubic-bezier(.2,0,0,1), margin 160ms cubic-bezier(.2,0,0,1); }
.nz-project-header .nz-project-switcher[open] > summary > span[aria-hidden="true"] { margin-top:3px; transform:rotate(-135deg); }
.nz-project-header select { -webkit-appearance:none; appearance:none; cursor:pointer; background-image:linear-gradient(45deg, transparent 50%, var(--nz-ink-2) 50%), linear-gradient(135deg, var(--nz-ink-2) 50%, transparent 50%); background-size:5px 5px, 5px 5px; background-position:right 15px center, right 10px center; background-repeat:no-repeat; transition:border-color 120ms ease, background-color 120ms ease; }
.nz-project-header .nz-project-theme { transition:border-color 120ms ease, background-color 120ms ease; }
.nz-project-header :is(.nz-project-switcher > summary, .nz-project-theme, select):hover { border-color:var(--nz-line-strong); background-color:var(--nz-raised); }
.nz-project-header .nz-project-theme[aria-expanded="true"] { border-color:var(--nz-accent); }
.nz-project-menu a[aria-current="page"] { box-shadow:inset 3px 0 var(--nz-accent); }
.nz-project-switcher[open] > .nz-project-menu, .nz-project-header .nz-theme-options:not([hidden]) { animation:nz-header-pop 140ms cubic-bezier(.2,0,0,1); }
@keyframes nz-header-pop { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) {
 .nz-project-switcher[open] > .nz-project-menu, .nz-project-header .nz-theme-options:not([hidden]) { animation:none; }
 .nz-project-header :is(.nz-project-switcher > summary, .nz-project-switcher > summary > span, .nz-project-theme, select) { transition:none; }
}
/* Focus ring fix: the older rule used var(--nz-focus), which holds a box-shadow list, as an outline colour. That made the
   outline invalid (style none); pages without the kit base.css (Guardian) showed no keyboard focus on header controls. */
.nz-project-header :is(button,select,summary,a):focus-visible { outline:3px solid var(--nz-accent); outline-offset:3px; box-shadow:none; }

/* 2026-10-25 Nöbet 3: search palette. The header button sits between the projects and the preferences; the palette is a
   native modal dialog anchored high on the screen, so the page under it stays recognisable. */
.nz-project-header .nz-project-search { display:flex; align-items:center; gap:10px; flex:0 1 300px; min-width:0; height:36px; margin:0 0 0 auto; padding:0 8px 0 12px; border:1px solid var(--nz-line); border-radius:9px; background:var(--nz-canvas); color:var(--nz-ink-2); font:inherit; font-size:14px; line-height:1; text-align:left; cursor:pointer; transition:border-color 120ms ease, background-color 120ms ease; }
.nz-project-header .nz-project-search:hover { border-color:var(--nz-line-strong); background-color:var(--nz-raised); color:var(--nz-ink); }
.nz-project-header .nz-project-search svg { flex:none; }
.nz-project-header .nz-search-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nz-project-header .nz-project-search kbd, .nz-palette kbd { flex:none; padding:3px 6px; border:1px solid var(--nz-line); border-bottom-width:2px; border-radius:6px; background:var(--nz-surface); color:var(--nz-ink-2); font-family:var(--nz-font-sans, sans-serif); font-size:12.5px; line-height:1; }
.nz-project-header .nz-project-search + .nz-project-preferences { margin-left:0; }
dialog.nz-palette { position:fixed; inset:0; width:min(640px, calc(100vw - 32px)); max-width:none; max-height:none; margin:min(14vh, 120px) auto auto; padding:0; border:0; background:transparent; color:var(--nz-ink); overflow:visible; font-family:var(--nz-font-sans, sans-serif); font-size:15px; text-align:left; }
dialog.nz-palette::backdrop { background:color-mix(in srgb, var(--nz-canvas) 55%, transparent); backdrop-filter:blur(3px); }
.nz-palette *, .nz-palette *::before { box-sizing:border-box; }
.nz-palette-box { display:flex; flex-direction:column; max-height:min(560px, calc(100dvh - 2 * min(14vh, 120px))); border:1px solid var(--nz-line-strong); border-radius:16px; background:var(--nz-surface); box-shadow:0 24px 70px #061f2340, 0 2px 6px #061f231a; overflow:hidden; }
.nz-palette-field { display:flex; align-items:center; gap:12px; padding:14px 14px 14px 18px; border-bottom:1px solid var(--nz-line); color:var(--nz-ink-2); }
.nz-palette-field svg { flex:none; }
.nz-palette input[type="search"] { flex:1; min-width:0; width:auto; height:auto; margin:0; padding:4px 0; border:0; outline:0; box-shadow:none; background:none; color:var(--nz-ink); font:inherit; font-size:18px; -webkit-appearance:none; appearance:none; }
.nz-palette input[type="search"]::-webkit-search-cancel-button { display:none; }
.nz-palette input[type="search"]::placeholder { color:var(--nz-ink-3); opacity:1; }
.nz-palette-close { flex:none; margin:0; padding:5px 8px; border:1px solid var(--nz-line); border-radius:7px; background:var(--nz-canvas); color:var(--nz-ink-2); font:inherit; font-size:12.5px; cursor:pointer; }
.nz-palette-close:hover { border-color:var(--nz-line-strong); color:var(--nz-ink); }
.nz-palette :is(button,input):focus-visible { outline:3px solid var(--nz-accent); outline-offset:2px; }
.nz-palette input[type="search"]:focus-visible { outline:0; }
.nz-palette-list { flex:1; min-height:0; overflow:auto; padding:6px 8px 8px; overscroll-behavior:contain; }
.nz-palette-group { padding:12px 10px 6px; color:var(--nz-ink-2); font-size:13px; font-weight:500; }
.nz-palette-item { display:flex; align-items:baseline; gap:12px; min-height:42px; padding:10px 12px; border-radius:9px; color:var(--nz-ink); cursor:pointer; }
.nz-palette-item[aria-selected="true"] { background:var(--nz-accent-soft); box-shadow:inset 3px 0 var(--nz-accent); }
.nz-palette-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.nz-palette-meta { flex:none; max-width:45%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--nz-ink-2); font-size:13px; }
.nz-palette-item[data-current="true"] .nz-palette-name::after { content:""; display:inline-block; width:7px; height:7px; margin:0 0 1px 9px; border-radius:50%; background:var(--nz-accent); vertical-align:middle; }
.nz-palette-empty { margin:0; padding:22px 20px; color:var(--nz-ink-2); }
.nz-palette-hint { margin:0; padding:9px 18px; border-top:1px solid var(--nz-line); background:var(--nz-canvas); color:var(--nz-ink-2); font-size:13px; }
dialog.nz-palette[open] .nz-palette-box { animation:nz-palette-in 160ms cubic-bezier(.2,0,0,1); }
@keyframes nz-palette-in { from { opacity:0; transform:translateY(-6px) scale(.985); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { dialog.nz-palette[open] .nz-palette-box { animation:none; } .nz-project-header .nz-project-search { transition:none; } }
@media (max-width: 760px) {
 .nz-project-header .nz-project-search { flex:none; width:36px; padding:0; justify-content:center; }
 .nz-project-header .nz-project-search :is(.nz-search-label, kbd) { display:none; }
 dialog.nz-palette { margin-top:12px; }
 .nz-palette-hint { display:none; }
}
@media (forced-colors: active) { .nz-palette-item[aria-selected="true"] { outline:2px solid Highlight; } }
