:root {
    --eddie-shell-global-h: 58px;
    --eddie-shell-context-h: 44px;
    --eddie-shell-total-h: calc(var(--eddie-shell-global-h) + var(--eddie-shell-context-h));
    --eddie-shell-bg: rgba(6, 10, 17, 0.96);
    --eddie-shell-bg-solid: #070b12;
    --eddie-shell-raised: rgba(255, 255, 255, 0.065);
    --eddie-shell-border: rgba(255, 255, 255, 0.10);
    --eddie-shell-text: #f4f7fb;
    --eddie-shell-muted: #91a0b7;
    --eddie-shell-accent: #2171b5;
    --eddie-shell-accent-strong: #2c91e2;
    --eddie-shell-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
    --eddie-shell-radius: 10px;
    --eddie-shell-fast: 160ms;
    --eddie-shell-panel: 260ms;
}

html.eddie-light,
body.eddie-light {
    --eddie-shell-bg: rgba(248, 251, 255, 0.96);
    --eddie-shell-bg-solid: #f7f9fc;
    --eddie-shell-raised: rgba(15, 23, 42, 0.055);
    --eddie-shell-border: rgba(15, 23, 42, 0.12);
    --eddie-shell-text: #0f172a;
    --eddie-shell-muted: #5f6f85;
    --eddie-shell-shadow: 0 18px 52px rgba(15, 23, 42, 0.14);
}

body.eddie-app-menu-open { overflow: hidden !important; }

.eddie-app-shell {
    position: sticky !important;
    inset: 0 0 auto !important;
    top: 0 !important;
    z-index: 9000 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: var(--eddie-shell-global-h) !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--eddie-shell-text) !important;
    background: var(--eddie-shell-bg) !important;
    box-shadow: 0 1px 0 var(--eddie-shell-border) !important;
    backdrop-filter: blur(18px) saturate(1.18) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.18) !important;
    transition: transform var(--eddie-shell-panel) ease, background var(--eddie-shell-fast) ease !important;
}

.eddie-app-shell::after { display: none !important; content: none !important; }

.eddie-app-shell__global {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
    align-items: center;
    gap: 18px;
    width: min(100%, 1440px);
    height: var(--eddie-shell-global-h);
    min-height: var(--eddie-shell-global-h);
    margin: 0 auto;
    padding: 0 clamp(16px, 2.6vw, 38px);
}

.eddie-app-shell__brand-group,
.eddie-app-shell__actions,
.eddie-app-shell__destinations {
    display: flex;
    align-items: center;
}

.eddie-app-shell__brand-group { min-width: 0; gap: 10px; }
.eddie-app-shell__actions { justify-content: flex-end; gap: 8px; }
.eddie-app-shell__destinations { justify-content: center; gap: 3px; }

.eddie-app-shell__menu-button {
    display: inline-flex !important;
    flex: 0 0 38px;
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 8px 7px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.eddie-app-shell__menu-button:hover,
.eddie-app-shell__menu-button:focus-visible { background: var(--eddie-shell-raised) !important; outline: none; }
.eddie-app-shell__menu-button span { display: block !important; width: 100% !important; height: 2px !important; margin: 0 !important; border-radius: 99px !important; background: var(--eddie-shell-text) !important; }

.eddie-app-shell__brand {
    color: var(--eddie-shell-text) !important;
    font-family: var(--er-font-head, Inter, system-ui, sans-serif);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.035em;
    text-decoration: none !important;
    white-space: nowrap;
}

.eddie-app-shell__surface {
    min-width: 0;
    padding-left: 10px;
    border-left: 1px solid var(--eddie-shell-border);
    color: var(--eddie-shell-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.eddie-app-shell__destinations a,
.eddie-app-shell__action,
.eddie-app-shell__account-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--eddie-shell-muted) !important;
    background: transparent;
    font: 800 13px/1 var(--er-font-body, Inter, system-ui, sans-serif);
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--eddie-shell-fast) ease, background var(--eddie-shell-fast) ease, border-color var(--eddie-shell-fast) ease, transform var(--eddie-shell-fast) ease;
}

.eddie-app-shell__destinations a:hover,
.eddie-app-shell__destinations a:focus-visible,
.eddie-app-shell__destinations a.is-active {
    color: var(--eddie-shell-text) !important;
    background: var(--eddie-shell-raised);
    border-color: var(--eddie-shell-border);
    outline: none;
    opacity: 1;
}

.eddie-app-shell__destinations a.is-active { box-shadow: inset 0 -2px 0 var(--eddie-shell-accent-strong); }
.eddie-app-shell__action:hover,
.eddie-app-shell__action:focus-visible,
.eddie-app-shell__account-button:hover,
.eddie-app-shell__account-button:focus-visible { color: var(--eddie-shell-text) !important; background: var(--eddie-shell-raised); border-color: var(--eddie-shell-border); outline: none; opacity: 1; }
.eddie-app-shell__action.is-primary { color: #fff !important; border-color: rgba(96, 165, 250, 0.34); background: linear-gradient(180deg, var(--eddie-shell-accent-strong), var(--eddie-shell-accent)); box-shadow: 0 8px 22px rgba(33, 113, 181, 0.24); }
.eddie-app-shell__account-button i { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }

.eddie-app-shell__context {
    display: block;
    width: 100%;
    min-height: var(--eddie-shell-context-h);
    border-top: 1px solid var(--eddie-shell-border);
    background: var(--eddie-shell-bg-solid);
}

.eddie-app-shell__context-inner {
    display: flex;
    align-items: center;
    width: min(100%, 1440px);
    min-height: var(--eddie-shell-context-h);
    margin: 0 auto;
    padding: 5px clamp(16px, 2.6vw, 38px);
    overflow-x: auto;
    scrollbar-width: none;
}
.eddie-app-shell__context-inner::-webkit-scrollbar { display: none; }

.eddie-app-shell__context .filterRow,
.eddie-app-shell__context #filterRow,
.eddie-app-shell__context .eddie-my-vault__workspace-row,
.eddie-app-shell__context .eddie-app-shell__context-links {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.eddie-app-shell__context .chip,
.eddie-app-shell__context .eddie-my-vault__mode-btn,
.eddie-app-shell__context .eddie-app-shell__context-links a {
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 11px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    color: var(--eddie-shell-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}

.eddie-app-shell__context .chip:hover,
.eddie-app-shell__context .chip.active,
.eddie-app-shell__context .eddie-my-vault__mode-btn:hover,
.eddie-app-shell__context .eddie-my-vault__mode-btn.is-active,
.eddie-app-shell__context .eddie-app-shell__context-links a:hover,
.eddie-app-shell__context .eddie-app-shell__context-links a.is-active {
    color: var(--eddie-shell-text) !important;
    border-color: var(--eddie-shell-border) !important;
    background: var(--eddie-shell-raised) !important;
}

.eddie-app-shell__context .eddie-my-vault__workspace-switch { margin-left: auto !important; }

.eddie-app-shell__drawer {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100000 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100vw !important;
    height: 100svh !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: rgba(0, 0, 0, 0.56) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
    transition: opacity var(--eddie-shell-panel) ease, visibility 0s linear var(--eddie-shell-panel) !important;
}

.eddie-app-shell__drawer.show,
.eddie-app-shell__drawer.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity var(--eddie-shell-panel) ease, visibility 0s linear 0s !important;
}

.eddie-app-shell__drawer-panel {
    display: flex !important;
    flex-direction: column !important;
    width: min(390px, 92vw) !important;
    max-width: 390px !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 18px !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-right: 1px solid var(--eddie-shell-border) !important;
    border-radius: 0 !important;
    background: var(--eddie-shell-bg-solid) !important;
    color: var(--eddie-shell-text) !important;
    box-shadow: var(--eddie-shell-shadow) !important;
    transform: translateX(-102%) !important;
    transition: transform var(--eddie-shell-panel) cubic-bezier(.2,.8,.2,1) !important;
}

.eddie-app-shell__drawer.show .eddie-app-shell__drawer-panel,
.eddie-app-shell__drawer.is-open .eddie-app-shell__drawer-panel { transform: translateX(0) !important; }

.eddie-app-shell__drawer-head {
    position: sticky !important;
    top: -18px !important;
    z-index: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    min-height: 58px !important;
    margin: -18px -18px 14px !important;
    padding: 10px 18px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--eddie-shell-border) !important;
    background: var(--eddie-shell-bg-solid) !important;
}
.eddie-app-shell__drawer-title { color: var(--eddie-shell-text) !important; font-size: 17px !important; font-weight: 900 !important; }
.eddie-app-shell__drawer-close { min-height: 34px !important; padding: 7px 11px !important; border: 1px solid var(--eddie-shell-border) !important; border-radius: 8px !important; color: var(--eddie-shell-text) !important; background: var(--eddie-shell-raised) !important; font-size: 12px !important; font-weight: 850 !important; cursor: pointer; }

.eddie-app-shell__drawer-nav { display: grid; gap: 6px; margin-bottom: 14px; }
.eddie-app-shell__drawer-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; color: var(--eddie-shell-text) !important; background: transparent; font-size: 15px; font-weight: 850; text-decoration: none !important; }
.eddie-app-shell__drawer-nav a:hover,
.eddie-app-shell__drawer-nav a.is-active { border-color: var(--eddie-shell-border); background: var(--eddie-shell-raised); opacity: 1; }
.eddie-app-shell__drawer-nav a i { color: var(--eddie-shell-muted); font-style: normal; }

.eddie-app-shell__account-card { margin: 0 0 14px; padding: 14px; border: 1px solid var(--eddie-shell-border); border-radius: 10px; background: var(--eddie-shell-raised); }
.eddie-app-shell__account-card strong { display: block; margin-bottom: 4px; color: var(--eddie-shell-text); font-size: 14px; }
.eddie-app-shell__account-card p { margin: 0 0 12px; color: var(--eddie-shell-muted) !important; font-size: 12.5px; line-height: 1.45; }
.eddie-app-shell__account-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.eddie-app-shell__account-actions a { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; border: 1px solid var(--eddie-shell-border); border-radius: 8px; color: var(--eddie-shell-text) !important; background: transparent; font-size: 12px; font-weight: 850; text-decoration: none !important; }
.eddie-app-shell__account-actions a.is-primary { color: #fff !important; border-color: rgba(96, 165, 250, 0.34); background: var(--eddie-shell-accent); }

.eddie-app-shell__drawer-secondary { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--eddie-shell-border); }
.eddie-app-shell__drawer-secondary a { color: var(--eddie-shell-muted) !important; font-size: 12px; font-weight: 800; text-decoration: none !important; }
.eddie-app-shell__theme { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important; min-height: 48px !important; margin: 10px 0 0 !important; padding: 10px 0 !important; border: 0 !important; border-top: 1px solid var(--eddie-shell-border) !important; background: transparent !important; cursor: pointer; }
.eddie-app-shell__theme-copy { color: var(--eddie-shell-text) !important; font-size: 13px !important; font-weight: 800 !important; }
.eddie-app-shell__theme input { position: absolute !important; opacity: 0 !important; pointer-events: none !important; }
.eddie-app-shell__theme > i { position: relative; width: 40px; height: 22px; border-radius: 99px; background: rgba(148, 163, 184, 0.34); transition: background var(--eddie-shell-fast) ease; }
.eddie-app-shell__theme > i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.24); transition: transform var(--eddie-shell-fast) ease; }
.eddie-app-shell__theme input:checked + i { background: var(--eddie-shell-accent); }
.eddie-app-shell__theme input:checked + i::after { transform: translateX(18px); }
.eddie-app-shell__drawer-foot { padding-top: 8px; color: var(--eddie-shell-muted) !important; opacity: .62; font-size: 11px !important; }

/* Feed keeps its module-specific mobile filters, but the shared shell owns the top bar. */
.eddie-app-shell--feed.mobileGone { transform: translateY(-100%) !important; }

/* Vault is a full-height workspace. Account for both global and context rows. */
body.eddie-my-vault-page .eddie-my-vault--shell { --eddie-vault-topbar-h: var(--eddie-shell-total-h) !important; }
body.eddie-my-vault-page .eddie-app-shell--vault.eddie-my-vault__nav {
    flex: 0 0 var(--eddie-shell-total-h) !important;
    height: auto !important;
    min-height: var(--eddie-shell-total-h) !important;
}
body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__workspace-row { min-height: 34px !important; }
body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__mode-switch--desktop { display: flex !important; }
body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__mode-switch--mobile { display: none !important; }
body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__workspace-switch { display: none !important; }

/* Board app spacing now starts beneath a consistent shell. */
.eddie-bulletins-app > .eddie-app-shell { margin: 0 -18px !important; width: calc(100% + 36px) !important; }

@media (max-width: 860px) {
    :root { --eddie-shell-global-h: 54px; --eddie-shell-context-h: 46px; }
    .eddie-app-shell__global { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-inline: 12px; }
    .eddie-app-shell__destinations { display: none; }
    .eddie-app-shell__brand-group { gap: 8px; }
    .eddie-app-shell__brand { font-size: 17px; }
    .eddie-app-shell__surface { font-size: 10px; padding-left: 8px; }
    .eddie-app-shell__actions .eddie-app-shell__action.is-quiet { display: none; }
    .eddie-app-shell__actions .eddie-app-shell__account-button span { display: none; }
    .eddie-app-shell__account-button { width: 38px; padding-inline: 0; }
    .eddie-app-shell__account-button i { width: 8px; height: 8px; transform: rotate(45deg) translate(-1px,-1px); }
    .eddie-app-shell__context-inner { padding-inline: 10px; }
    .eddie-app-shell__context .eddie-my-vault__mode-switch--desktop { display: none !important; }
    .eddie-app-shell__context .eddie-my-vault__mode-switch--mobile { display: flex !important; }
    .eddie-app-shell__context .eddie-my-vault__workspace-switch { display: flex !important; margin-left: auto !important; }
    .eddie-app-shell__drawer-panel { width: min(360px, 94vw) !important; }
    .eddie-bulletins-app > .eddie-app-shell { margin: 0 -12px !important; width: calc(100% + 24px) !important; }
}

@media (max-width: 520px) {
    .eddie-app-shell__actions .eddie-app-shell__action { min-height: 34px; padding: 6px 9px; font-size: 11px; }
    .eddie-app-shell__actions .eddie-app-shell__action.is-primary { display: none; }
    .eddie-app-shell__surface { max-width: 82px; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
    .eddie-app-shell,
    .eddie-app-shell__drawer,
    .eddie-app-shell__drawer-panel { transition-duration: 1ms !important; }
}

/* Vault's historical stylesheet has several high-specificity topbar repairs.
   These selectors deliberately outrank them while the old bar remains as a
   rollback fallback for installations without Theme Core. */
html body.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault.eddie-my-vault__nav,
html body.eddie-standalone-page.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault.eddie-my-vault__nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;
    flex: 0 0 var(--eddie-shell-total-h) !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--eddie-shell-total-h) !important;
    min-height: var(--eddie-shell-total-h) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--eddie-shell-bg) !important;
    box-shadow: 0 1px 0 var(--eddie-shell-border) !important;
}

html body.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault.eddie-my-vault__nav::after,
html body.eddie-standalone-page.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault.eddie-my-vault__nav::after {
    display: none !important;
    content: none !important;
}

html body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__mode-switch--desktop { display: flex !important; }
html body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__mode-switch--mobile,
html body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__workspace-switch { display: none !important; }

@media (max-width: 860px) {
    html body.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault.eddie-my-vault__nav,
    html body.eddie-standalone-page.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault.eddie-my-vault__nav {
        flex-basis: var(--eddie-shell-total-h) !important;
        height: var(--eddie-shell-total-h) !important;
        min-height: var(--eddie-shell-total-h) !important;
    }

    html body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__mode-switch--desktop { display: none !important; }
    html body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__mode-switch--mobile,
    html body.eddie-my-vault-page .eddie-app-shell--vault .eddie-my-vault__workspace-switch { display: flex !important; }
}

/* U1 desktop compatibility: the legacy Vault desktop stylesheet hides the
   whole workspace row. The shared shell owns this row now, so restore it
   without changing the legacy fallback used when Theme Core is unavailable. */
@media (min-width: 861px) {
    html body.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault .eddie-my-vault__workspace-row,
    html body.eddie-standalone-page.eddie-my-vault-page .eddie-my-vault--shell > .eddie-app-shell--vault .eddie-my-vault__workspace-row {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        min-height: 34px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}
