/* =========================================================
   Site navigation
   Markup is generated by scripts/sync-nav.js, behaviour is in
   js/site-nav.js. The look follows the Penpot page B9_Navigation.

   < 768px      top bar + bottom tab bar, "More" opens a bottom sheet
   768–1023px   top bar, menu button opens a side drawer
   >= 1024px    full top bar with inline links and a "More" dropdown
   ========================================================= */

.site-nav,
.site-nav__panel,
.site-nav__tabs,
.site-nav__backdrop {
    --sn-bar-h: 56px;
    --sn-tabs-h: 64px;
    --sn-bg: rgba(10, 25, 47, 0.82);
    --sn-bg-solid: #0c1b30;
    --sn-border: rgba(148, 163, 184, 0.2);
    --sn-glass: rgba(255, 255, 255, 0.06);
    --sn-text: #cbd5e1;
    --sn-text-strong: #f1f5f9;
    --sn-text-muted: #94a3b8;
    --sn-text-faint: #64748b;
    --sn-ink: #04121f;
    --sn-emerald: 16, 185, 129;
    --sn-cobalt: 59, 130, 246;
    --sn-violet: 139, 92, 246;
    --sn-accent: rgb(var(--sn-emerald));
    --sn-accent-soft: rgba(var(--sn-emerald), 0.12);
    --sn-hairline: linear-gradient(90deg,
            rgba(var(--sn-emerald), 0) 0%,
            rgba(var(--sn-emerald), 0.7) 25%,
            rgba(var(--sn-cobalt), 0.7) 70%,
            rgba(var(--sn-violet), 0) 100%);
    --sn-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Skip link ---------- */

/* position/z-index are !important throughout: css/main.css forces
   `position: relative; z-index: 1` on every child of a particle-background body. */
.site-nav__skip {
    position: fixed !important;
    top: 8px;
    left: 8px;
    z-index: 1200 !important;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    background: #10b981;
    color: #04121f;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.site-nav__skip:focus {
    transform: none;
}

/* ---------- Top bar ---------- */

/* #header: page-level CSS styles the header by id */
#header.site-nav {
    position: sticky !important;
    top: 0;
    z-index: 1000 !important;
    display: block;
    min-height: 0;
    padding: env(safe-area-inset-top, 0px) 0 0;
    background: var(--sn-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 0;
    box-shadow: none;
}

/* Pages that bring their own sticky toolbar (virtual lab): the site bar scrolls away with the page */
#header.site-nav.site-nav--flow {
    position: relative !important;
}

/* Lab card layouts pad the body (Tailwind p-4 md:p-8): the bar still runs edge to edge */
body.p-4 > #header.site-nav {
    margin: -1rem -1rem 1rem;
}

@media (min-width: 768px) {
    body.md\:p-8 > #header.site-nav {
        margin: -2rem -2rem 2rem;
    }
}

/* Gradient hairline under the bar */
#header.site-nav::after {
    content: "";
    position: absolute;
    top: auto;
    right: 0;
    bottom: -1px;
    left: 0;
    width: auto;
    height: 1px;
    background: var(--sn-hairline);
    pointer-events: none;
}

/* Sized here so the bar is identical on pages with a different .container */
.site-nav .container {
    display: block;
    width: 100%;
    max-width: 1280px;
    min-height: 0;
    margin: 0 auto;
    padding: 0 max(0.75rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
}

.site-nav .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    height: var(--sn-bar-h);
    padding: 0;
}

.site-nav .logo,
.site-nav__panel-brand {
    order: 0;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    height: auto;
    padding: 0;
    text-decoration: none;
}

/* White tile that crops the empty margin of logo.webp */
.site-nav__logo-tile {
    position: relative;
    flex: 0 0 auto;
    display: block;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

.site-nav .site-nav__logo-tile .site-logo,
.site-nav__panel .site-nav__logo-tile .site-logo {
    position: absolute;
    top: -10.5px;
    left: -10.5px;
    width: 57px;
    max-width: none;
    height: 57px;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    filter: none;
}

.site-nav .logo-text,
.site-nav__panel .logo-text {
    background: none;
    color: var(--sn-text-strong);
    -webkit-text-fill-color: var(--sn-text-strong);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-shadow: none;
}

.site-nav .logo-text__ai,
.site-nav__panel .logo-text__ai {
    color: var(--sn-accent);
    -webkit-text-fill-color: var(--sn-accent);
}

.site-nav .header-controls {
    order: 3;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    margin-left: auto;
}

.site-nav__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
}

/* Round glass buttons: search, menu, close */
.site-nav .site-nav__icon-btn,
.site-nav__panel .site-nav__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--sn-border);
    border-radius: 50%;
    background: var(--sn-glass);
    color: var(--sn-text);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-nav .site-nav__icon-btn:hover,
.site-nav .site-nav__icon-btn[aria-expanded="true"],
.site-nav__panel .site-nav__icon-btn:hover {
    border-color: rgba(var(--sn-emerald), 0.3);
    background: var(--sn-accent-soft);
    color: var(--sn-accent);
}

.site-nav .site-nav__icon-btn[hidden] {
    display: none;
}

.site-nav :focus-visible,
.site-nav__panel :focus-visible,
.site-nav__tabs :focus-visible {
    outline: 2px solid var(--sn-accent);
    outline-offset: 2px;
}

/* ---------- Login (created by js/auth-ui.js) ---------- */

/* No `display` here: auth-ui.js shows and hides these inline */
.site-nav .chemai-auth-login {
    align-items: center;
    justify-content: center;
    height: 40px;
    min-height: 40px;
    margin: 0 4px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 16px rgba(var(--sn-emerald), 0.4);
    color: var(--sn-ink) !important;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: none;
    transition: box-shadow 0.15s ease, filter 0.15s ease;
}

.site-nav .chemai-auth-login:hover {
    box-shadow: 0 4px 20px rgba(var(--sn-emerald), 0.55);
    filter: brightness(1.06);
}

.site-nav .chemai-auth-profile {
    margin: 0 4px 0 0;
}

/* ---------- Inline links (desktop only) ---------- */

.site-nav__primary {
    order: 1;
    display: none;
}

.site-nav__list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.site-nav .site-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--sn-text);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.site-nav .site-nav__link:hover {
    background: var(--sn-glass);
    color: var(--sn-text-strong);
}

.site-nav .site-nav__link[aria-current] {
    background: var(--sn-accent-soft);
    color: var(--sn-accent);
    font-weight: 600;
}

/* Glowing underline on the bar's bottom edge */
.site-nav .site-nav__link[aria-current]::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: -13px;
    left: 10px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgb(var(--sn-emerald)), rgb(var(--sn-cobalt)));
    box-shadow: 0 0 8px rgba(var(--sn-emerald), 0.6);
}

.site-nav .site-nav__link[aria-expanded="true"] {
    background: var(--sn-accent-soft);
    box-shadow: inset 0 0 0 1px rgba(var(--sn-emerald), 0.3);
    color: var(--sn-accent);
}

.site-nav__link .site-nav__icon {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.site-nav__link[aria-expanded="true"] .site-nav__icon {
    transform: rotate(180deg);
}

/* ---------- "More" dropdown ---------- */

.site-nav__more {
    position: relative;
}

.site-nav__menu {
    position: absolute;
    top: calc(100% + 22px);
    right: 0;
    z-index: 10;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 264px;
    margin: 0;
    padding: 5px;
    border: 1px solid var(--sn-border);
    border-radius: 14px;
    background: var(--sn-bg-solid);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
    list-style: none;
}

/* Gradient top edge */
.site-nav__menu::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 16px;
    left: 16px;
    height: 1px;
    background: linear-gradient(90deg,
            rgba(var(--sn-emerald), 0),
            rgba(var(--sn-emerald), 0.8) 50%,
            rgba(var(--sn-cobalt), 0));
    pointer-events: none;
}

.site-nav__menu[hidden] {
    display: none;
}

.site-nav .site-nav__menu-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 8px;
    border-radius: 10px;
    background: transparent;
    color: var(--sn-text-strong);
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.site-nav .site-nav__menu-link:hover,
.site-nav .site-nav__menu-link:focus-visible {
    background: rgba(255, 255, 255, 0.05);
}

.site-nav .site-nav__menu-link[aria-current] {
    background: var(--sn-accent-soft);
}

.site-nav__menu-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.site-nav__menu-title {
    color: var(--sn-text-strong);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 18px;
}

.site-nav__menu-desc {
    color: var(--sn-text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 15px;
}

/* ---------- Icon chips (dropdown, drawer, sheet) ---------- */

.site-nav__chip {
    --sn-chip: var(--sn-emerald);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--sn-glass);
    color: rgb(var(--sn-chip));
}

.site-nav__chip--cobalt {
    --sn-chip: var(--sn-cobalt);
}

.site-nav__chip--violet {
    --sn-chip: var(--sn-violet);
}

.site-nav__chip .site-nav__icon {
    width: 20px;
    height: 20px;
}

.site-nav__menu-link .site-nav__chip {
    background: rgba(var(--sn-chip), 0.14);
}

/* ---------- Search (injected by js/main.js) ---------- */

.site-nav .site-search {
    order: 2;
    display: none !important;
}

.site-nav .site-search .search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.site-nav .site-search input[type="search"] {
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0 44px 0 42px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    background: var(--sn-glass);
    box-shadow: none;
    color: var(--sn-text-strong);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-nav .site-search input[type="search"]::placeholder {
    color: var(--sn-text-muted);
    opacity: 1;
}

.site-nav .site-search input[type="search"]:focus {
    border-color: rgba(var(--sn-emerald), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--sn-emerald), 0.15);
}

.site-nav .site-search .search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--sn-text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.site-nav .site-search .clear-btn {
    right: 8px;
    color: var(--sn-text-muted);
}

.site-nav .site-search .clear-btn:hover {
    color: var(--sn-text-strong);
}

.site-nav.site-nav--search-open .site-search {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: block !important;
    max-width: none;
    margin: 0;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    border-bottom: 1px solid var(--sn-border);
    background: var(--sn-bg-solid);
}

/* ---------- Search results (built by js/main.js) ---------- */

.site-nav .site-search .results {
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    box-sizing: border-box;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: min(70vh, 540px);
    padding: 0 6px;
    border: 1px solid var(--sn-border);
    border-radius: 14px;
    /* gradient top edge, then the panel fill */
    background:
        linear-gradient(90deg,
            rgba(var(--sn-emerald), 0),
            rgba(var(--sn-emerald), 0.8) 50%,
            rgba(var(--sn-cobalt), 0)) 16px 0 / calc(100% - 32px) 1px no-repeat,
        var(--sn-bg-solid);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
    color: var(--sn-text);
    text-align: left;
}

.site-nav.site-nav--search-open .site-search .results {
    top: calc(100% + 6px);
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
}

.site-nav .site-search .results-head {
    padding: 14px 10px 10px;
    color: var(--sn-text-muted);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;
    text-transform: uppercase;
}

.site-nav .site-search .result-item {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin: 0 0 2px;
    padding: 10px 10px 10px 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sn-text-strong);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.site-nav .site-search .result-item:hover,
.site-nav .site-search .result-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sn-text-strong);
}

.site-nav .site-search .result-chip {
    --sn-chip: var(--sn-emerald);
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    height: 36px;
    border-radius: 10px;
    background: rgba(var(--sn-chip), 0.14);
    color: #34d399;
}

.site-nav .site-search .result-chip svg {
    width: 20px;
    height: 20px;
}

.site-nav .site-search .result-chip--violet {
    --sn-chip: var(--sn-violet);
    color: #a78bfa;
}

.site-nav .site-search .result-chip--cobalt {
    --sn-chip: var(--sn-cobalt);
    color: #60a5fa;
}

.site-nav .site-search .result-chip--slate {
    background: var(--sn-glass);
    color: var(--sn-text-muted);
}

.site-nav .site-search .result-text {
    flex: 1 1 auto;
    min-width: 0;
}

.site-nav .site-search .result-title,
.site-nav .site-search .result-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav .site-search .result-title {
    color: var(--sn-text-strong);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
}

.site-nav .site-search .result-desc {
    margin-top: 3px;
    color: var(--sn-text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.3;
}

.site-nav .site-search .result-desc:empty {
    display: none;
}

.site-nav .site-search .result-tag {
    flex: 0 0 auto;
    color: #34d399;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.site-nav .site-search .result-tag--violet {
    color: #a78bfa;
}

.site-nav .site-search .result-tag--cobalt {
    color: #60a5fa;
}

.site-nav .site-search .result-tag--slate {
    color: var(--sn-text-muted);
}

/* Keyboard hints: only where there is a keyboard */
.site-nav .site-search .results-foot {
    display: none;
}

.site-nav .site-search .results-foot kbd {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-right: 4px;
    padding: 0 5px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 5px;
    background: var(--sn-glass);
    color: var(--sn-text-muted);
    font-family: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
}

.site-nav .site-search .results-foot kbd:last-of-type {
    margin-right: 6px;
}

.site-nav .site-search .empty-state {
    padding: 24px 16px 26px;
    color: var(--sn-text-muted);
    text-align: center;
}

.site-nav .site-search .empty-state .result-chip {
    display: flex;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border-radius: 12px;
}

.site-nav .site-search .empty-title {
    color: var(--sn-text-strong);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.site-nav .site-search .empty-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.3;
}

/* ---------- Backdrop + panel (sheet on mobile, drawer on tablet) ---------- */

.site-nav__backdrop {
    position: fixed !important;
    inset: 0;
    z-index: 1100 !important;
    background: rgba(2, 8, 20, 0.62);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.site-nav__backdrop.is-open {
    opacity: 1;
}

.site-nav__backdrop[hidden],
.site-nav__panel[hidden] {
    display: none;
}

.site-nav__panel {
    position: fixed !important;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1101 !important;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    max-height: 85dvh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border: 0;
    border-radius: 24px 24px 0 0;
    background: var(--sn-bg-solid);
    color: var(--sn-text);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.55);
    overscroll-behavior: contain;
    transform: translateY(100%);
    transition: transform 0.25s var(--sn-ease);
}

.site-nav__panel.is-open {
    transform: none;
}

/* Emerald wash behind the header */
.site-nav__panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 90px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(var(--sn-emerald), 0.14), rgba(var(--sn-emerald), 0));
    pointer-events: none;
}

/* Gradient edge: top of the sheet, left side of the drawer */
.site-nav__panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 40px;
    left: 40px;
    height: 1px;
    background: linear-gradient(90deg,
            rgba(var(--sn-emerald), 0) 0%,
            rgba(var(--sn-emerald), 0.8) 40%,
            rgba(var(--sn-cobalt), 0.8) 70%,
            rgba(var(--sn-violet), 0) 100%);
    pointer-events: none;
}

.site-nav__panel-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    height: 22px;
    padding: 0;
}

/* Sheet grab handle */
.site-nav__panel-head::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.45);
    transform: translateX(-50%);
}

/* The sheet has no brand row: the close button floats beside the first label */
.site-nav__panel-brand {
    display: none;
}

.site-nav__panel .site-nav__icon-btn {
    position: absolute;
    top: 20px;
    right: 12px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
}

.site-nav__panel .site-nav__icon-btn .site-nav__icon {
    width: 20px;
    height: 20px;
}

.site-nav__panel-nav {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 12px 8px;
}

.site-nav__panel-label {
    margin: 0;
    padding: 12px 12px 10px;
    color: var(--sn-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 14px;
    letter-spacing: 1.2px;
    text-align: left;
    text-transform: uppercase;
}

.site-nav__only-drawer {
    display: none;
}

.site-nav__panel-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.site-nav__panel .site-nav__panel-link {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 12px 0 10px;
    border-radius: 14px;
    background: transparent;
    color: var(--sn-text);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    text-shadow: none;
    transition: background-color 0.15s ease;
}

.site-nav__panel-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Trailing chevron */
.site-nav__panel-link>.site-nav__icon {
    width: 16px;
    height: 16px;
    color: var(--sn-text-faint);
}

.site-nav__panel .site-nav__panel-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sn-text-strong);
}

.site-nav__panel .site-nav__panel-link[aria-current] {
    background: linear-gradient(90deg, rgba(var(--sn-emerald), 0.18), rgba(var(--sn-emerald), 0.03));
    box-shadow: inset 0 0 0 1px rgba(var(--sn-emerald), 0.25);
    color: var(--sn-text-strong);
    font-weight: 600;
}

.site-nav__panel-link[aria-current]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 3px;
    height: 24px;
    margin-top: -12px;
    border-radius: 2px;
    background: var(--sn-accent);
    box-shadow: 0 0 8px rgba(var(--sn-emerald), 0.8);
}

.site-nav__panel-link[aria-current] .site-nav__chip {
    background: rgba(var(--sn-emerald), 0.22);
}

.site-nav__panel-link[aria-current]>.site-nav__icon {
    display: none;
}

/* ---------- "ChemAI Pro" card, pinned under the links ---------- */

.site-nav__panel .site-nav__pro {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
    min-height: 76px;
    margin: 8px 16px 24px;
    padding: 0 14px;
    border-radius: 16px;
    background: linear-gradient(90deg,
            rgba(var(--sn-emerald), 0.2) 0%,
            rgba(var(--sn-cobalt), 0.2) 60%,
            rgba(var(--sn-violet), 0.22) 100%);
    box-shadow: inset 0 0 0 1px rgba(var(--sn-emerald), 0.35);
    color: var(--sn-text-strong);
    text-decoration: none;
    text-shadow: none;
    transition: box-shadow 0.15s ease;
}

.site-nav__panel .site-nav__pro:hover {
    box-shadow: inset 0 0 0 1px rgba(var(--sn-emerald), 0.6);
}

.site-nav__pro-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgb(var(--sn-emerald)), rgb(var(--sn-cobalt)));
    box-shadow: 0 0 14px rgba(var(--sn-emerald), 0.5);
    color: #fff;
}

.site-nav__pro .site-nav__icon {
    width: 20px;
    height: 20px;
}

.site-nav__pro-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.site-nav__pro-title {
    color: var(--sn-text-strong);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 18px;
}

.site-nav__pro-desc {
    color: var(--sn-text);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 15px;
}

/* ---------- Bottom tab bar (mobile only) ---------- */

.site-nav__tabs {
    display: none;
}

@media (max-width: 767.98px) {
    .site-nav__tabs {
        position: fixed !important;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000 !important;
        display: block;
        padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
        border: 0;
        background: rgba(10, 25, 47, 0.94);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }

    .site-nav__tabs::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 1px;
        background: var(--sn-hairline);
        pointer-events: none;
    }

    .site-nav__tabs-list {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        gap: 0;
        height: var(--sn-tabs-h);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .site-nav__tabs .site-nav__tab {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        width: 100%;
        min-width: 0;
        height: var(--sn-tabs-h);
        min-height: 0;
        padding: 12px 2px 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: var(--sn-text-muted);
        font-family: inherit;
        font-size: 0.6875rem;
        font-weight: 500;
        line-height: 14px;
        text-decoration: none;
        text-shadow: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .site-nav__tab .site-nav__icon {
        position: relative;
        z-index: 1;
    }

    .site-nav__tab-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-nav__tabs .site-nav__tab[aria-current],
    .site-nav__tabs .site-nav__tab[aria-expanded="true"] {
        color: var(--sn-accent);
        font-weight: 600;
    }

    /* Glowing pill behind the active icon */
    .site-nav__tabs .site-nav__tab[aria-current]::before,
    .site-nav__tabs .site-nav__tab[aria-expanded="true"]::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 56px;
        height: 30px;
        margin-left: -28px;
        border-radius: 15px;
        background: linear-gradient(90deg, rgba(var(--sn-emerald), 0.26), rgba(var(--sn-cobalt), 0.2));
        box-shadow: inset 0 0 0 1px rgba(var(--sn-emerald), 0.35), 0 0 12px rgba(var(--sn-emerald), 0.35);
    }

    /* Keep page content and floating UI clear of the tab bar */
    body.has-site-tabs {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    /* Virtual-lab floating widgets (song player, Ask ChemAI) ride above the tab bar */
    body.has-site-tabs .lab-song-player,
    body.has-site-tabs .ask-ai-fab {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    body.has-site-tabs .chemai-lab-chat {
        bottom: calc(136px + env(safe-area-inset-bottom, 0px));
        height: min(600px, calc(100dvh - 152px));
    }

    body.chat-fullscreen-active .site-nav__tabs {
        display: none;
    }

    /* Destinations already in the tab bar are not repeated in the sheet */
    .site-nav__panel-item--tab {
        display: none;
    }

    .site-nav .site-nav__menu-btn {
        display: none;
    }
}

/* ---------- Tablet and up: the panel becomes a right-hand drawer ---------- */

@media (min-width: 768px) {
    .site-nav__panel {
        top: 0;
        left: auto;
        width: min(340px, 85vw);
        max-height: none;
        padding-top: env(safe-area-inset-top, 0px);
        border-radius: 0;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
        transform: translateX(100%);
    }

    .site-nav__panel::before {
        height: 120px;
        background: linear-gradient(180deg, rgba(var(--sn-emerald), 0.16), rgba(var(--sn-emerald), 0));
    }

    .site-nav__panel::after {
        right: auto;
        bottom: 0;
        left: 0;
        width: 1px;
        height: auto;
        background: linear-gradient(180deg,
                rgba(var(--sn-emerald), 0.7) 0%,
                rgba(var(--sn-cobalt), 0.4) 50%,
                rgba(var(--sn-violet), 0) 100%);
    }

    .site-nav__panel-head {
        height: 64px;
        padding: 0 12px 0 20px;
    }

    .site-nav__panel-head::before {
        display: none;
    }

    .site-nav__panel-brand {
        display: flex;
    }

    .site-nav__panel .site-nav__icon-btn {
        position: static;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .site-nav__panel .site-nav__icon-btn .site-nav__icon {
        width: 22px;
        height: 22px;
    }

    .site-nav__panel-nav {
        padding-top: 2px;
    }

    .site-nav__only-drawer {
        display: inline;
    }

    .site-nav__only-sheet {
        display: none;
    }

    .site-nav__panel .site-nav__pro {
        margin-bottom: 20px;
    }
}

/* ---------- Desktop ---------- */

@media (min-width: 1024px) {

    .site-nav,
    .site-nav__panel,
    .site-nav__backdrop {
        --sn-bar-h: 64px;
    }

    .site-nav .container {
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }

    .site-nav__primary {
        display: block;
        flex: 0 0 auto;
        margin: 0 auto 0 1rem;
    }

    .site-nav .site-nav__menu-btn,
    .site-nav .site-nav__search-btn {
        display: none;
    }

    .site-nav .header-controls {
        margin-left: 0;
    }

    .site-nav .chemai-auth-login,
    .site-nav .chemai-auth-profile {
        margin-right: 0;
    }

    .site-nav .site-search {
        display: block !important;
        flex: 1 1 200px;
        min-width: 0;
        max-width: 300px;
        margin: 0 2px 0 0;
    }

    /* "/" keycap: the shortcut that focuses the field */
    .site-nav .site-search .search-input-wrap::after {
        content: "/";
        position: absolute;
        top: 50%;
        right: 12px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        margin-top: -11px;
        border: 1px solid rgba(148, 163, 184, 0.3);
        border-radius: 6px;
        background: var(--sn-glass);
        color: var(--sn-text-muted);
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1;
        pointer-events: none;
    }

    /* ...and not under the clear button once something is typed */
    .site-nav .site-search .search-input-wrap:focus-within::after,
    .site-nav .site-search .search-input-wrap:has(input:not(:placeholder-shown))::after {
        display: none;
    }

    .site-nav .site-search .results-foot {
        position: sticky;
        bottom: 0;
        display: flex;
        align-items: center;
        gap: 14px;
        margin: 0 2px;
        padding: 9px 8px 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        background: var(--sn-bg-solid);
        color: #64748b;
        font-size: 0.6875rem;
        font-weight: 500;
        line-height: 1;
    }

    .site-nav .site-search .results-foot span {
        display: inline-flex;
        align-items: center;
    }
}

/* ---------- Motion, print ---------- */

html.site-nav-lock,
html.site-nav-lock body {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {

    .site-nav *,
    .site-nav__panel,
    .site-nav__panel *,
    .site-nav__backdrop {
        transition: none;
    }
}

@media print {

    .site-nav__tabs,
    .site-nav__panel,
    .site-nav__backdrop,
    .site-nav__skip {
        display: none !important;
    }
}
