:root {
    --fgr-bar-bg-default:     var(--fg-parchment,    #FAF6ED);
    --fgr-bar-text-default:   var(--fg-ink-4,        #6B6050);
    --fgr-bar-link-default:   var(--fg-ink,          #1A1510);
    --fgr-bar-link-h-default: var(--fg-gold-deep,    #B8922A);
    --fgr-bar-border-default: var(--fg-border-soft,  rgba(26,21,16,.08));
}

/* ═══════════════════════════════════════════════════════
   FIDEOGRAPH UTILITY BAR  v2
   Sits above the main nav on every page.
   ═══════════════════════════════════════════════════════ */

/* ── Core token mapping ──────────────────────────────── */
:root {
    --fgr-bar-bg:       var(--fg-parchment,    #FAF6ED);
    --fgr-bar-text:     var(--fg-ink-4,        #6B6050);
    --fgr-bar-link:     var(--fg-ink,          #1A1510);
    --fgr-bar-link-h:   var(--fg-gold-deep,    #B8922A);
    --fgr-bar-border:   1px solid var(--fg-border-soft, rgba(26,21,16,.08));
}

/* ── Base ────────────────────────────────────────────── */
.fgr-bar {
    position: relative;
    z-index: 8990;
    width: 100%;
    height: var(--fgr-bar-height, 36px);
    background: var(--fgr-bar-bg, var(--fgr-bar-bg-default));
    color: var(--fgr-bar-text, var(--fgr-bar-text-default));
    border-bottom: var(--fgr-bar-border, 1px solid var(--fgr-bar-border-default));
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11.5px;
    line-height: 1;
    box-sizing: border-box;
}

.fgr-bar__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fgr-bar__left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.fgr-bar__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Icon ────────────────────────────────────────────── */
.fgr-bar__icon {
    flex-shrink: 0;
    color: var(--fgr-bar-text);
    opacity: .6;
}

/* ── Descriptor (visitor) ────────────────────────────── */
.fgr-bar__descriptor {
    font-size: 11px;
    color: var(--fgr-bar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .75;
}

/* ── Auxiliary links ─────────────────────────────────── */
.fgr-bar__aux {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fgr-bar__link {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--fgr-bar-link, var(--fgr-bar-link-default));
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s;
}
.fgr-bar__link:hover {
    color: var(--fgr-bar-link-h, var(--fgr-bar-link-h-default));
    text-decoration: none;
}

.fgr-bar__link--signin {
    font-weight: 600;
}

/* ── Separator ───────────────────────────────────────── */
.fgr-bar__sep {
    width: 1px;
    height: 14px;
    background: var(--fgr-bar-text);
    opacity: .2;
    flex-shrink: 0;
}

/* ── CTA button (visitor) ────────────────────────────── */
.fgr-bar__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all .15s;
}
.fgr-bar__cta--outlined {
    color: var(--fgr-bar-link);
    border: 1px solid var(--fgr-bar-link);
    background: transparent;
}
.fgr-bar__cta--outlined:hover {
    background: var(--fgr-bar-link);
    color: var(--fgr-bar-bg);
}
.fgr-bar__cta--solid {
    color: #fff;
    background: var(--fgr-bar-link);
    border: 1px solid var(--fgr-bar-link);
}
.fgr-bar__cta--solid:hover {
    opacity: .85;
}

/* ═══════════════════════════════════════════════════════
   LOGGED-IN STATE
   ═══════════════════════════════════════════════════════ */

/* ── Session dot ─────────────────────────────────────── */
.fgr-bar__session-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1A6A38;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(26,106,56,.2);
}
.fgr-bar__session-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--fgr-bar-link);
    white-space: nowrap;
}
.fgr-bar__session-sub {
    font-size: 10.5px;
    color: var(--fgr-bar-text);
    opacity: .6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── XP + Streak pills ──────────────────────────────── */
.fgr-bar__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--fgr-bar-link);
    white-space: nowrap;
}
.fgr-bar__pill-unit {
    font-weight: 400;
    opacity: .6;
    font-size: 10px;
}
.fgr-bar__pill--xp svg { margin-top: -1px; }
.fgr-bar__pill--streak svg { margin-top: -1px; }

/* ── Notification bell wrap + dropdown ───────────────── */
.fgr-bar__bell-wrap {
    position: relative;
}
.fgr-bar__bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--fgr-bar-link);
    text-decoration: none;
    transition: background .15s;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}
.fgr-bar__bell:hover {
    background: rgba(0,0,0,.05);
}
.fgr-bar__bell--active svg {
    stroke: var(--fg-gold, #C9A84C);
}
.fgr-bar__bell-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--fg-crimson, #8B3000);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fg-font-mono, 'DM Mono', monospace);
    line-height: 1;
    pointer-events: none;
}

/* Notification dropdown panel */
.fgr-bar__notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 320px;
    background: #fff;
    border: 1px solid #E8E2D8;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    z-index: 9100;
    overflow: hidden;
}
.fgr-bar__notif-dropdown[hidden] { display: none; }

.fgr-bar__notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px 11px;
    border-bottom: 1px solid #F0EDE8;
}
.fgr-bar__notif-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1A1510;
    letter-spacing: -.01em;
}
.fgr-bar__notif-mark-all {
    font-size: 11px;
    font-weight: 600;
    color: #B8922A;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}
.fgr-bar__notif-mark-all:hover { opacity: .75; }

.fgr-bar__notif-list {
    max-height: 320px;
    overflow-y: auto;
}
.fgr-bar__notif-loading {
    padding: 24px 16px;
    text-align: center;
    font-size: 12px;
    color: #9A9A9A;
}
.fgr-bar__notif-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 12.5px;
    color: #9A9A9A;
}

/* Individual notification item */
.fgr-bar__notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid #F7F4F0;
    cursor: pointer;
    transition: background .1s;
    text-decoration: none;
}
.fgr-bar__notif-item:last-child { border-bottom: none; }
.fgr-bar__notif-item:hover { background: #FAFAF7; }
.fgr-bar__notif-item--unread { background: rgba(201,168,76,.04); }
.fgr-bar__notif-item--unread:hover { background: rgba(201,168,76,.08); }

.fgr-bar__notif-item__icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #F0EDE8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}
.fgr-bar__notif-item__body { flex: 1; min-width: 0; }
.fgr-bar__notif-item__title {
    font-size: 12.5px;
    color: #1A1510;
    line-height: 1.4;
    margin-bottom: 2px;
    font-weight: 500;
}
.fgr-bar__notif-item--unread .fgr-bar__notif-item__title { font-weight: 700; }
.fgr-bar__notif-item__detail {
    font-size: 11.5px;
    color: #7A7268;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fgr-bar__notif-item__time {
    font-size: 10.5px;
    color: #A89E90;
    margin-top: 3px;
}
.fgr-bar__notif-item__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C9A84C;
    flex-shrink: 0;
    margin-top: 10px;
}

.fgr-bar__notif-footer {
    display: block;
    padding: 11px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #B8922A;
    text-decoration: none;
    border-top: 1px solid #F0EDE8;
    transition: background .1s;
}
.fgr-bar__notif-footer:hover {
    background: #FAF7F2;
    color: #B8922A;
    text-decoration: none;
}

/* ── Avatar ──────────────────────────────────────────── */
.fgr-bar__avatar-wrap {
    position: relative;
}
.fgr-bar__avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background .12s;
    font-family: inherit;
}
.fgr-bar__avatar-btn:hover {
    background: rgba(0,0,0,.04);
}
.fgr-bar__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.fgr-bar__avatar--lg {
    width: 36px;
    height: 36px;
    font-size: 13px;
}
.fgr-bar__avatar-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--fgr-bar-link);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fgr-bar__avatar-caret {
    color: var(--fgr-bar-text);
    opacity: .5;
    transition: transform .15s;
}
.fgr-bar__avatar-btn[aria-expanded="true"] .fgr-bar__avatar-caret {
    transform: rotate(180deg);
}

/* ── Avatar dropdown ─────────────────────────────────── */
.fgr-bar__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 240px;
    background: #fff;
    border: 1px solid #E8E2D8;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    z-index: 9100;
    overflow: hidden;
}
.fgr-bar__dropdown[hidden] { display: none; }
.fgr-bar__dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #F0EDE8;
}
.fgr-bar__dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: #1A1A1A;
}
.fgr-bar__dropdown-email {
    font-size: 11px;
    color: #9A9A9A;
    margin-top: 2px;
}
.fgr-bar__dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 12.5px;
    color: #4A4A4A;
    text-decoration: none;
    transition: background .1s;
}
.fgr-bar__dropdown-item:hover {
    background: #FAF7F2;
    color: #1A1A1A;
    text-decoration: none;
}
.fgr-bar__dropdown-divider {
    height: 1px;
    background: #F0EDE8;
    margin: 0;
}
.fgr-bar__dropdown-item--signout {
    color: #C0392B;
}
.fgr-bar__dropdown-item--signout:hover {
    background: #FEF2F2;
    color: #C0392B;
}

/* ── Dashboard CTA button ────────────────────────────── */
.fgr-bar__dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--fg-parchment, #FAF6ED);
    background: var(--fg-ink, #1A1510);
    padding: 5px 14px;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
}
.fgr-bar__dash-btn:hover {
    opacity: .85;
    color: var(--fg-parchment, #FAF6ED);
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════
   VERIFICATION BANNER
   ═══════════════════════════════════════════════════════ */
.fgr-verify-banner {
    background: #FFFBEB;
    border-bottom: 1px solid #FDE68A;
    font-size: 12px;
    color: #92400E;
    padding: 6px 0;
}
.fgr-verify-banner__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fgr-verify-banner__resend {
    background: none;
    border: none;
    color: #92400E;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

/* ── Archetype pill ──────────────────────────────────── */
.fgr-bar__pill--arch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .15s;
    text-decoration: none;
}
.fgr-bar__pill--arch:hover { opacity: .75; text-decoration: none; }
.fgr-bar__pill-arch-label { font-size: 10.5px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .fgr-bar__descriptor,
    .fgr-bar__aux,
    .fgr-bar__sep,
    .fgr-bar__session-sub,
    .fgr-bar__avatar-name,
    .fgr-bar__pill-unit,
    .fgr-bar__pill-arch-label {
        display: none;
    }
    .fgr-bar__inner {
        padding: 0 12px;
    }
    .fgr-bar__right {
        gap: 6px;
    }
    .fgr-bar__dash-btn {
        padding: 4px 10px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .fgr-bar__pill--xp,
    .fgr-bar__pill--streak {
        display: none;
    }
    .fgr-bar--hide-mobile {
        display: none !important;
    }
}
