/* Shared shell-header — extracted from main_menu.html so every
   authenticated screen wears the same toolbar. */

:root {
    --nav-height: 108px;
}

.nav-bar-plaque {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shell-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 60;
    background: rgba(8, 9, 13, 0.6);
    backdrop-filter: blur(28px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.shell-header-inner {
    width: 100%;
    max-width: 1760px;
    box-sizing: border-box;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1.15fr) auto minmax(0, 1fr) auto auto;
    gap: clamp(8px, 1vw, 16px);
    align-items: center;
    min-height: 96px;
    padding: 0 24px;
}
.shell-header-inner.guest-mode {
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr) minmax(112px, auto);
    column-gap: 24px;
    min-height: 118px;
}
.shell-header-inner.guest-mode #main-shell-nav-left,
.shell-header-inner.guest-mode #main-shell-nav-center,
.shell-header-inner.guest-mode #main-shell-nav-right {
    display: none;
}

/* Body padding so the fixed header doesn't overlap content. Pages
   opt in via `body.shell-header-mounted` (added by shell-header.js
   once the header is rendered). */
body.shell-header-mounted {
    padding-top: 96px;
}
/* Demote any legacy `<nav class="feature-topbar">` (sticky-top) to
   in-flow when the shell-header is mounted, so the two don't fight
   for the same screen real estate. Templates that still need the
   feature-topbar (e.g. site-editor's action bar) get to keep it as
   a secondary toolbar below the global header. */
body.shell-header-mounted .feature-topbar {
    position: relative;
    top: auto;
}

.shell-brand-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}
.shell-header-inner.guest-mode .shell-brand-stack {
    grid-column: 1;
    justify-self: start;
}
.shell-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
    opacity: .82;
    transition: opacity .2s ease, transform .2s ease;
}
.shell-brand:hover,
.shell-brand.active {
    opacity: 1;
    transform: scale(1.01);
}
.shell-brand svg {
    width: 224px;
    height: 46px;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 0 18px rgba(192, 132, 252, 0.18));
}
.shell-nav-group {
    display: flex;
    align-items: center;
    gap: clamp(4px, .55vw, 8px);
    min-width: 0;
    flex-wrap: nowrap;
}
.shell-nav-group.left { justify-content: flex-start; }
.shell-nav-group.center { justify-content: center; }
.shell-nav-group.right { justify-content: center; }

.shell-header-inner.shell-nav-mode-catalog #main-shell-nav-left,
.shell-header-inner.shell-nav-mode-catalog #main-shell-nav-right {
    display: none;
}
.shell-header-inner.shell-nav-mode-project #main-shell-nav-left,
.shell-header-inner.shell-nav-mode-project #main-shell-nav-right {
    display: none;
}
.shell-header-inner.shell-nav-mode-catalog #main-shell-nav-center,
.shell-header-inner.shell-nav-mode-project #main-shell-nav-center {
    justify-content: center;
    gap: clamp(6px, .8vw, 12px);
}
.shell-header-inner.shell-nav-mode-project {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
}
.shell-header-inner.shell-nav-mode-project #main-shell-nav-center {
    justify-self: center;
}
.shell-header-inner.shell-nav-mode-project .shell-auth {
    justify-self: end;
}
.shell-nav-button.shell-nav-nodes-control {
    min-width: max-content;
    padding: 8px clamp(10px, 1.1vw, 16px);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.shell-nav-button.shell-nav-nodes-control:hover {
    color: #e2e8f0;
    border-color: rgba(168,85,247,.35);
    background: rgba(168,85,247,.08);
}
.shell-nav-button.shell-nav-nodes-control.active {
    color: #f8fafc;
    border-color: rgba(168,85,247,.55);
    background: rgba(168,85,247,.16);
    box-shadow: 0 0 24px rgba(168,85,247,.18);
}

.shell-mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}
.shell-mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}
.shell-mobile-menu-toggle:hover {
    border-color: rgba(192,132,252,.45);
    background: rgba(255,255,255,.08);
}

.shell-auth {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    position: relative;
}
.shell-header-inner.guest-mode .shell-auth {
    grid-column: 3;
    justify-self: end;
}

.shell-auth-link,
.shell-auth-button {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.82);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.shell-auth-link:hover,
.shell-auth-button:hover {
    border-color: rgba(192,132,252,.45);
    color: #fff;
    background: rgba(255,255,255,.08);
}
.shell-auth-button {
    cursor: pointer;
}

.shell-account {
    position: relative;
}
.shell-account-trigger {
    gap: 10px;
}
.shell-account-trigger::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: .75;
}
.shell-account-trigger.is-open::after {
    transform: rotate(225deg) translateY(-1px);
}
.shell-account-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    gap: 2px;
}
.shell-account-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.shell-account-role {
    font-size: 11px;
    color: rgba(255,255,255,.58);
    text-transform: uppercase;
    letter-spacing: .14em;
}
.shell-account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(420px, calc(100vw - 24px));
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(6, 10, 22, .96);
    box-shadow: 0 26px 70px rgba(0,0,0,.42);
    backdrop-filter: blur(18px);
    box-sizing: border-box;
    overflow: hidden;
    z-index: 70;
}
.shell-account-dropdown.hidden {
    display: none !important;
}
.shell-account-summary {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    padding: 18px;
}
.shell-account-summary-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.shell-account-summary-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.shell-account-summary-copy {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255,255,255,.64);
}
.shell-account-pills {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.shell-account-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    padding: 6px 10px;
    font-size: 12px;
    color: rgba(255,255,255,.76);
}
#main-account-state-pill,
#main-account-copy,
#main-account-pills {
    display: none !important;
}
.shell-account-actions {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}
.shell-account-link,
.shell-account-logout {
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.84);
    text-decoration: none;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
    cursor: pointer;
}
.shell-account-link:hover,
.shell-account-logout:hover {
    border-color: rgba(163,177,138,.42);
    background: rgba(255,255,255,.07);
    color: #fff;
}
.shell-account-link::after {
    content: '→';
    color: rgba(255,255,255,.45);
}

/* QR login modal (shared via access-qr-login.js) */
.access-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
}
.access-qr-modal.hidden { display: none; }
.access-qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 5, 10, 0.72);
}
.access-qr-modal-card {
    position: relative;
    width: min(360px, 100%);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.12);
    background: #14101c;
    padding: 18px 18px 20px;
    color: #f3eef7;
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.access-qr-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.access-qr-modal-close {
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.7);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.access-qr-modal-hint {
    margin: 0 0 14px;
    color: rgba(255,255,255,.62);
    font-size: 13px;
    line-height: 1.4;
}
.access-qr-box {
    display: grid;
    place-items: center;
    min-height: 220px;
    margin: 0 auto 12px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
}
.access-qr-box img,
.access-qr-box canvas {
    display: block;
    max-width: 100%;
    height: auto;
}
.access-qr-timer {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,.7);
    margin-bottom: 10px;
}
.access-qr-refresh {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(168,85,247,.18);
    color: #f5e9ff;
    font-weight: 600;
    cursor: pointer;
}
.access-qr-status {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-size: 13px;
    color: rgba(255,255,255,.7);
}
.access-qr-status.is-error { color: #f5a8b8; }


.shell-nav-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #64748b;
    transition: transform .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
    cursor: pointer;
}
.shell-nav-button:hover { transform: scale(1.02); color: #e2e8f0; }
.shell-nav-button.side {
    flex-direction: column;
    gap: 4px;
    padding: 10px clamp(10px, .9vw, 18px);
    border-radius: 16px;
}
.shell-nav-button.side:hover {
    background: rgba(255,255,255,.05);
    color: #e2e8f0;
}
.shell-nav-button.side.active {
    color: #60a5fa;
}
.shell-nav-button.center {
    gap: 12px;
    padding: 12px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(192,132,252,.92), rgba(168,85,247,.92));
    color: white;
    box-shadow: 0 0 30px rgba(168,85,247,.18);
}
.shell-nav-button.center.active {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    color: white;
    box-shadow: 0 0 40px rgba(168,85,247,.3);
}
.shell-nav-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
}
.shell-nav-button.side .shell-nav-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: clamp(.08em, .55vw, .18em);
    text-align: center;
    white-space: nowrap;
}
.shell-nav-button.center .shell-nav-label {
    font-size: 17px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -.03em;
}
.shell-nav-button.active::after {
    content: '';
    position: absolute;
    inset: auto auto -5px 50%;
    width: 6px;
    height: 6px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #60a5fa;
}
.shell-nav-button.center.active::after {
    inset: 0;
    width: auto;
    height: auto;
    transform: none;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.18);
    background: transparent;
}

@media (max-width: 1420px) {
    .shell-brand svg { width: 190px; }
    .shell-nav-button.side { padding: 9px 9px; }
    .shell-nav-button.center { padding: 14px 30px; }
    .shell-auth-link,
    .shell-auth-button { padding: 0 14px; }
}

@media (max-width: 1280px) {
    .shell-header-inner {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        min-height: 84px;
        gap: 12px;
    }
    .shell-header-inner.guest-mode {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
    .shell-mobile-menu-toggle {
        display: inline-flex;
        grid-column: 3;
    }
    .shell-header-inner.guest-mode .shell-mobile-menu-toggle {
        display: none;
    }
    .shell-auth {
        grid-column: 4;
    }
    .shell-nav-group.left,
    .shell-nav-group.center,
    .shell-nav-group.right {
        display: none;
        grid-column: 1 / -1;
        justify-content: center;
        flex-wrap: wrap;
        padding: 0 12px;
    }
    .shell-header-inner.menu-open .shell-nav-group.left,
    .shell-header-inner.menu-open .shell-nav-group.center,
    .shell-header-inner.menu-open .shell-nav-group.right {
        display: flex;
    }
    .shell-header-inner.menu-open .shell-nav-group.left {
        margin-top: 10px;
        padding-top: 14px;
        border-top: 1px solid rgba(255,255,255,.08);
    }
    .shell-header-inner.menu-open .shell-nav-group.right {
        padding-bottom: 14px;
    }
    .shell-header-inner.menu-open {
        padding-bottom: 10px;
    }
    body.shell-header-mounted { padding-top: 84px; }
}
@media (max-width: 760px) {
    .shell-header-inner {
        grid-template-columns: auto auto;
        gap: 8px;
        padding: 0 14px;
    }
    .shell-brand svg { width: 168px; height: 36px; }
    .shell-auth-link,
    .shell-auth-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 12px;
    }
    .shell-account-role {
        display: none;
    }
    .shell-header-inner.menu-open .shell-nav-button.side {
        width: calc(50% - 6px);
        min-height: 44px;
    }
    .shell-header-inner.menu-open .shell-nav-button.center {
        width: min(260px, 100%);
    }
    body.shell-header-mounted { padding-top: 72px; }
    .shell-nav-button.shell-nav-nodes-control {
        min-width: 0;
        max-width: 100%;
    }
}
