/* Shared shell contract: identical top spacing and breadcrumbs on every layout. */
:root {
    --shell-main-top: 1.25rem;
    --shell-main-bottom: 2rem;
    --shell-breadcrumb-bottom: 0.85rem;
    /* Shared workspace contract: every primary left navigation uses these tracks. */
    --app-sidebar-width: 14rem;
    --app-sidebar-collapsed-width: 2.8rem;
    --app-sidebar-gap: 0.7rem;
}

/* Normalize the independent legacy shells without changing their page-specific markup. */
.sa-shell {
    --layout-sidebar: var(--app-sidebar-width);
    gap: var(--app-sidebar-gap);
}

.sa-shell.sa-sidebar-collapsed {
    grid-template-columns: var(--app-sidebar-collapsed-width) minmax(0, 1fr);
}

.ix-page {
    --ix-sidebar-width: var(--app-sidebar-width);
}

.ix-page__workspace,
.ai-page__layout,
.ai-page__workspace {
    gap: var(--app-sidebar-gap);
}

.ai-page__layout,
.ai-page__workspace {
    grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
}

.ai-page--sidebar-hidden .ai-page__layout,
.ai-page--sidebar-hidden .ai-page__workspace,
.ix-page--sidebar-hidden .ix-page__workspace {
    grid-template-columns: var(--app-sidebar-collapsed-width) minmax(0, 1fr);
}

.pages-module.keywords-module {
    --layout-sidebar: var(--app-sidebar-width);
}

.pages-module.keywords-module.kw-sidebar-hidden {
    grid-template-columns: var(--app-sidebar-collapsed-width) minmax(0, 1fr) !important;
}

/* One visual contract for every primary left navigation. Page modules may
   keep their own markup, but the rail, typography and active states are one
   shared design system. */
.sa-sidebar,
.ix-page__sidebar,
.ai-page__sidebar,
.keywords-sidebar,
.li-sidebar {
    box-sizing: border-box;
    border: 1px solid #252b33 !important;
    border-radius: 0 !important;
    background: #2c333d !important;
    color: #b0b8c4 !important;
    box-shadow: none !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
}

.sa-sidebar-head,
.ix-page__sidebar-head,
.ai-page__nav-head,
.keywords-sidebar-head,
.keywords-sidebar-chrome,
.li-sidebar .sa-sidebar-head {
    box-sizing: border-box;
    min-height: 2.65rem;
    padding: 0.55rem 0.65rem !important;
    border-bottom: 1px solid #3a424c !important;
    background: #262d36 !important;
    color: #e5e7eb !important;
    font-size: 0.8rem;
}

.sa-sidebar-nav,
.ix-page__nav,
.ai-page__nav,
.keywords-nav,
.keywords-sidebar-body,
.li-sidebar .sa-sidebar-nav {
    background: #2c333d !important;
}

.sa-sidebar-nav__link,
.ix-page__nav-link,
.ai-page__nav-link,
.keywords-nav-section__head,
.keywords-module .keywords-sidebar-body a,
.li-sidebar .sa-sidebar-nav__link {
    box-sizing: border-box;
    min-height: 2.35rem;
    padding: 0.58rem 0.7rem !important;
    border-bottom: 1px solid #323a44 !important;
    background: #2c333d !important;
    color: #cbd5e1 !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    line-height: 1.25;
    text-decoration: none !important;
}

.sa-sidebar-nav__link:hover,
.sa-sidebar-nav__link.is-active,
.ix-page__nav-link:hover,
.ix-page__nav-link.is-active,
.ai-page__nav-link:hover,
.ai-page__nav-link.is-active,
.keywords-nav-section__head:hover,
.keywords-nav-section.is-active-group .keywords-nav-section__head,
.keywords-module .keywords-sidebar-body a:hover,
.li-sidebar .sa-sidebar-nav__link:hover,
.li-sidebar .sa-sidebar-nav__link.is-active {
    background: #1f252d !important;
    color: #8ec63f !important;
}

/* The shared sidebar link rule above is !important; keep the current
   keyword page visibly active in the shortcut navigation as well. */
.keywords-module .keywords-sidebar-body .keywords-nav-shortcut.is-active {
    background: #1f252d !important;
    color: #8ec63f !important;
    font-weight: 600 !important;
}

.sa-sidebar-collapse,
.ix-page__sidebar-toggle,
.ai-page__sidebar-toggle,
.keywords-sidebar-toggle,
.li-sidebar .li-sidebar-collapse {
    border-color: #56616d !important;
    background: transparent !important;
    color: #e5e7eb !important;
    border-radius: 0.35rem !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    cursor: pointer;
}

.sa-sidebar select,
.ix-page__sidebar select,
.ai-page__sidebar select,
.keywords-sidebar select,
.li-sidebar select,
.sa-sidebar input,
.ix-page__sidebar input,
.ai-page__sidebar input,
.keywords-sidebar input,
.li-sidebar input {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #3a424c !important;
    border-radius: 0.35rem !important;
    background: #1f252d !important;
    color: #e5e7eb !important;
    font: inherit !important;
    line-height: 1.25 !important;
}

.sa-sidebar select:focus,
.ix-page__sidebar select:focus,
.ai-page__sidebar select:focus,
.keywords-sidebar select:focus,
.li-sidebar select:focus,
.sa-sidebar input:focus,
.ix-page__sidebar input:focus,
.ai-page__sidebar input:focus,
.keywords-sidebar input:focus,
.li-sidebar input:focus {
    border-color: #8ec63f !important;
    outline: 2px solid rgba(142, 198, 63, 0.22);
    outline-offset: 1px;
}

.sa-sidebar label,
.ix-page__sidebar label,
.ai-page__sidebar label,
.keywords-sidebar label,
.li-sidebar label,
.sa-sidebar strong,
.ix-page__sidebar strong,
.ai-page__sidebar strong,
.keywords-sidebar strong,
.li-sidebar strong {
    font-family: inherit !important;
    line-height: 1.25 !important;
}

/* Traffic is a full-width hub, but its toolbar and content use the same
   horizontal rhythm as the primary application shells. */
.tr-page {
    width: 100%;
    max-width: none;
}

.tr-page-toolbar,
.tr-hero,
.tr-layout {
    margin-left: 0;
    margin-right: 0;
}

.site-main {
    padding-top: var(--shell-main-top);
    padding-bottom: var(--shell-main-bottom);
}

.site-main > .container > .page-breadcrumbs,
.site-main .page-breadcrumbs {
    margin: 0 0 var(--shell-breadcrumb-bottom);
    padding: 0.15rem 0 0.25rem;
    min-height: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.admin-content__panel > .page-breadcrumbs {
    margin: 0 0 var(--shell-breadcrumb-bottom);
    padding: 0.15rem 0 0.25rem;
    min-height: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .site-main {
        padding-top: 1rem;
    }

    .site-main > .container > .page-breadcrumbs,
    .site-main .page-breadcrumbs,
    .admin-content__panel > .page-breadcrumbs {
        margin-bottom: 0.7rem;
    }
}
