/* =================================================================
   WF Portal — THE TOP BAR (portal-look-and-feel.md 3.5)
   -----------------------------------------------------------------
   For tenants on NavLayout "top": the rail's vocabulary laid across
   the frame's top edge - 64px, no bottom border, the sheet under it
   with the side gaps (nav-side.css). The workspace chip on the left,
   Home and My jobs, the groups as menus (Design / Launch / Listen /
   Pinned / Platform), New, then Settings, Help and the account chip.
   On a phone: the mark, search, the bell and team chat
   (.wf-nav-phone), the burger - the shell bar hides there, as in the
   side layout.
   The menus sit on the CARD surface (they track the page, not the nav
   colour). Shared pieces (.wf-avatar, .wf-sidebar-plus,
   .wf-sidebar-count) live in nav-side.css.

   Global (not scoped): the links render outside any component's
   CSS-isolation scope. The whole file is a token-only door
   (Tests/ShellTokensOnlyTests).
   ================================================================= */
/* @tokens-only */

.wf-navbar {
    position: relative;
    z-index: 1030; /* the shell's layers - see nav-side.css */
    flex: none;
    background: var(--theme-nav-background);
    color: var(--theme-nav-text);
}
.wf-shell--island .wf-navbar {
    border: 1px solid var(--theme-nav-border);
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-elev-2);
}
.wf-shell--top.wf-shell--island > .wf-main { margin-top: 8px; }

.wf-navbar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 64px;
    padding: 0 12px;
}

.wf-nav-item { position: relative; list-style: none; }

/* -- The workspace chip ------------------------------------------ */
.wf-nav-ws {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 260px;
    margin-right: 10px;
    padding: 6px 10px 6px 6px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-nav-text-hover);
    font: inherit;
    cursor: pointer;
    transition: background var(--wf-motion);
}
.wf-nav-ws:hover { background: var(--theme-nav-hover-background); }
.wf-nav-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: var(--wf-radius-tile);
    /* The current-page pill's tint (16%) - the fill the theme engine reads the strong ink on at AA (NavInk). */
    background: color-mix(in srgb, var(--theme-nav-text-active) 16%, var(--theme-nav-background));
    color: var(--theme-nav-text-hover);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}
.wf-nav-mark img { width: 100%; height: 100%; object-fit: contain; }
/* The name over the workspace's tagline (when it has one) - the side rail's switcher, laid in the chip. */
.wf-nav-ws-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; text-align: left; }
.wf-nav-ws-name { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.wf-nav-ws-line {
    overflow: hidden;
    color: var(--theme-nav-text);
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* -- The collapse container + the two halves --------------------- */
.wf-nav-collapse { display: flex; flex: 1; align-items: center; min-width: 0; }
.wf-nav-links,
.wf-nav-right {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.wf-nav-right { margin-left: auto; }

/* -- Links and group buttons: 34px, radius sm, 13.5/500 ---------- */
.wf-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 11px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-nav-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--wf-motion), color var(--wf-motion);
}
/* THE HOVER - the strongest nav ink, never dimmer than at rest. This file owns the top bar's hover colours; root.css's
   prose-link hover no longer reaches the chrome (it outranked this rule and painted the primary ink - dark on a dark
   bar). Tests/TheRailHoverReadsStrongTests. */
.wf-nav-link:hover,
.wf-nav-link.open { background: var(--theme-nav-hover-background); color: var(--theme-nav-text-hover); }
.wf-nav-link.active {
    background: color-mix(in srgb, var(--theme-nav-text-active) 16%, transparent);
    color: var(--theme-nav-text-hover);
    font-weight: 600;
}
.wf-nav-link > .bi:first-child { font-size: 15px; }
.wf-nav-link:focus-visible,
.wf-nav-ws:focus-visible,
.wf-nav-new:focus-visible,
.wf-nav-me:focus-visible,
.wf-nav-toggle:focus-visible {
    outline: 2px solid var(--theme-nav-text-active);
    outline-offset: -2px;
}
.wf-chevron { font-size: 10px; opacity: .55; transition: transform 200ms var(--wf-ease); }
.wf-nav-link.open .wf-chevron { transform: rotate(180deg); }

/* -- New (accent = "make something new") ------------------------- */
.wf-nav-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin-left: 6px;
    padding: 0 12px 0 6px;
    border: 1px solid color-mix(in srgb, var(--theme-nav-text-hover) 18%, transparent);
    border-radius: var(--wf-radius-sm);
    background: color-mix(in srgb, var(--theme-nav-text-hover) 9%, transparent);
    color: var(--theme-nav-text-hover);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--wf-motion);
}
.wf-nav-new:hover { background: color-mix(in srgb, var(--theme-nav-text-hover) 15%, transparent); }

/* -- The account chip -------------------------------------------- */
.wf-nav-me {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: 4px;
    padding: 4px 10px 4px 4px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--wf-motion);
}
.wf-nav-me:hover,
.wf-nav-me.open { background: var(--theme-nav-hover-background); }
.wf-nav-me .wf-avatar {
    background: color-mix(in srgb, var(--theme-nav-text-active) 16%, var(--theme-nav-background));
    color: var(--theme-nav-text-hover);
}
.wf-nav-me-text { display: flex; flex-direction: column; max-width: 160px; line-height: 1.2; }
.wf-nav-me-text b { overflow: hidden; color: var(--theme-nav-text-hover); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wf-nav-me-text small { color: var(--theme-nav-text); font-size: 11.5px; }

/* -- The menus: the card surface, elevation 3, radius lg --------- */
.wf-nav-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1045;
    min-width: 240px;
    max-height: min(70vh, 560px);
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    background: var(--theme-background-float);
    box-shadow: var(--wf-elev-3);
    color: var(--theme-text);
    animation: wf-shell-pop 140ms var(--wf-ease) both;
}
.wf-nav-menu.is-end { right: 0; left: auto; }
.wf-nav-menuhdr { display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px; color: var(--theme-text-muted); font-size: 12px; font-weight: 600; }
.wf-nav-menuitem {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: var(--theme-text);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}
/* A hovered menu line reads in the emphasis ink - at least as strong as at rest. */
.wf-nav-menuitem:hover,
.wf-nav-menuitem:focus-visible { background: var(--wf-card-hover); color: var(--theme-text-emphasis); outline: none; }
.wf-nav-menuitem > .bi:first-child { flex: none; width: 18px; color: var(--theme-text-muted); font-size: 15px; text-align: center; }
.wf-nav-menuitem.active { background: var(--wf-primary-soft); color: var(--theme-text-emphasis); font-weight: 600; }
.wf-nav-menuitem.active > .bi:first-child { color: var(--wf-primary-ink); }
.wf-nav-menuitem .wf-sidebar-count { margin-left: auto; background: var(--wf-neutral-soft); color: var(--theme-text-secondary); }
.wf-nav-menuitem.is-signout,
.wf-nav-menuitem.is-signout > .bi:first-child { color: var(--wf-danger-ink); }
.wf-nav-menuitem[target="_blank"]::after {
    content: "\F142";
    margin-left: auto;
    padding-left: 8px;
    font-family: "bootstrap-icons";
    font-size: 11px;
    opacity: .45;
}
.wf-nav-menutile {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: var(--wf-radius-tile);
    background: var(--wf-neutral-soft);
    color: var(--theme-text-secondary);
    font-size: 12px;
    font-weight: 700;
}
.wf-nav-menutext { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; white-space: normal; }
.wf-nav-menutext b { color: var(--theme-text-emphasis); font-weight: 600; }
.wf-nav-menutext small { color: var(--theme-text-muted); font-size: 12px; }
.wf-nav-menudivider { height: 1px; margin: 5px 8px; background: var(--wf-line); }
.wf-nav-backdrop { position: fixed; inset: 0; z-index: 1029; background: transparent; }

/* -- The phone's search + bell (beside the burger; the shell bar hides on a phone) -- */
.wf-nav-phone { display: none; }

/* -- The phone's hamburger --------------------------------------- */
.wf-nav-toggle {
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border: 0;
    border-radius: var(--wf-radius-pill);
    background: transparent;
    color: var(--theme-nav-text-hover);
    font-size: 19px;
    cursor: pointer;
}
.wf-nav-toggle:hover { background: var(--theme-nav-hover-background); }

/* =================================================================
   Responsive — the phone
   ================================================================= */
@media (max-width: 991.98px) {
    .wf-nav-me-text { display: none; }
}

@media (max-width: 767.98px) {
    .wf-navbar-inner { height: 56px; padding: 0 8px; }
    /* The workspace chip gives way on a narrow phone - its name ellipsizes - so the row's icons (team chat among them)
       and the burger always fit, down to 320px under a finger. */
    .wf-navbar-inner > .wf-nav-item { flex: 0 1 auto; min-width: 0; }
    .wf-nav-ws { max-width: 100%; margin-right: 4px; }
    .wf-nav-phone { display: flex; align-items: center; gap: 2px; margin-left: auto; }
    .wf-nav-phone > .wf-shell-iconbtn { color: var(--theme-nav-text-hover); }
    .wf-nav-phone > .wf-shell-iconbtn:hover { background: var(--theme-nav-hover-background); }
    .wf-nav-toggle { display: grid; flex: none; margin-left: 2px; }
    .wf-nav-collapse {
        position: absolute;
        top: 56px;
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        max-height: calc(100vh - 56px);
        padding: 10px;
        overflow-y: auto;
        border-top: 1px solid var(--theme-nav-divider);
        background: var(--theme-nav-background);
        box-shadow: var(--wf-elev-3);
    }
    .wf-nav-collapse.show { display: flex; }
    .wf-nav-links,
    .wf-nav-right { flex-direction: column; align-items: stretch; width: 100%; margin: 0; }
    .wf-nav-right { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--theme-nav-divider); }
    .wf-nav-link,
    .wf-nav-new,
    .wf-nav-me { width: 100%; margin: 0; }
    .wf-nav-menu { position: static; margin: 4px 0 6px; box-shadow: none; animation: none; }
    .wf-nav-me-text { display: flex; }
    .wf-shell--island .wf-navbar { border-radius: 0; }

}

/* A finger on the phone row: search, the "?", the bell, team chat and the burger are 44px targets (3.17). */
@media (max-width: 767.98px) and (pointer: coarse) {
    .wf-nav-phone .wf-shell-iconbtn,
    .wf-nav-toggle { width: 44px; height: 44px; }
}
/* @end-tokens-only */
