/**
 * Knowledge base — spacing, typography, and browse/search chrome.
 * Relies on Bootstrap loaded elsewhere (parent portal CSS).
 */
.kb-layout {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
}

.kb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    padding-bottom: 1rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.kb-toolbar a {
    color: var(--support-brand, #1e40af);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    opacity: 0.82;
}

.kb-toolbar a:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.kb-toolbar a.kb-toolbar-active {
    opacity: 1;
    color: var(--support-brand, #1e40af);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.kb-toolbar-admin {
    margin-left: auto;
    font-weight: 500 !important;
}

@media (max-width: 576px) {
    .kb-toolbar-admin {
        margin-left: 0;
        width: 100%;
    }
}

.kb-page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 0.35rem;
}

.kb-page-lead {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 42rem;
}

.kb-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    color: #64748b;
}

.kb-crumb a {
    color: var(--support-brand, #2563eb);
    text-decoration: none;
}

.kb-crumb a:hover {
    text-decoration: underline;
}

.kb-crumb-sep {
    opacity: 0.45;
    user-select: none;
}

.kb-search-bar .input-group-lg > .form-control {
    border-radius: 0.5rem 0 0 0.5rem;
    border-right: 0;
}

.kb-search-bar .input-group-lg > .btn {
    border-radius: 0 0.5rem 0.5rem 0;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}

.kb-search-scope-bar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.kb-search-scope-bar__input {
    flex: 2 1 12rem;
    min-width: 0;
}

.kb-search-scope-bar__scope {
    flex: 1 1 10rem;
    max-width: 100%;
}

.kb-search-scope-bar__submit {
    flex: 0 0 auto;
}

@media (max-width: 576px) {
    .kb-search-scope-bar__submit {
        width: 100%;
    }
}

.kb-split-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.kb-split-actions__primary {
    flex: 1 1 14rem;
}

.kb-split-actions__secondary {
    flex: 1 1 14rem;
}

.kb-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.65rem;
    padding: 1.15rem 1.25rem;
    height: 100%;
    background: #fafafa;
}

.kb-panel h2 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.65rem;
}

.kb-panel p:last-child {
    margin-bottom: 0;
}

.kb-step-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.kb-step-nav__sep {
    color: #94a3b8;
    user-select: none;
}

.kb-step-nav__link {
    color: var(--support-brand, #2563eb);
    font-weight: 650;
    text-decoration: none;
}

.kb-step-nav__link:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.kb-step-nav__muted {
    color: #94a3b8;
    font-weight: 500;
    cursor: default;
}

.kb-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.65rem;
}

.kb-link-list {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.65rem;
    overflow: hidden;
    background: #fff;
}

ul.kb-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kb-link-list__row {
    margin: 0;
    padding: 0;
}

.kb-link-list__row:last-child .kb-link-list__item {
    border-bottom: 0;
}

.kb-link-list__item {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.15rem 0.75rem;
    align-items: center;
    padding: 0.95rem 1.1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.12s ease;
}

/* Bare <div> lists: each row is its own block even if kb.css fails to load elsewhere */
div.kb-link-list > .kb-link-list__item:last-child {
    border-bottom: 0;
}

.kb-link-list__item:hover {
    background: rgba(37, 99, 235, 0.035);
}

.kb-link-list__title {
    font-weight: 600;
    font-size: 1rem;
    grid-column: 1;
}

.kb-link-list__meta {
    grid-column: 1;
    font-size: 0.8125rem;
    color: #64748b;
}

.kb-link-list__badge {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    white-space: nowrap;
}

.kb-article-shell {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.65rem;
    padding: 1.75rem 1.5rem;
    background: #fff;
}

@media (min-width: 768px) {
    .kb-article-shell {
        padding: 2rem 2.25rem;
    }
}

.kb-article-title {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.kb-article-meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.kb-article-body {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: #1e293b;
    max-width: 50rem;
}

.kb-article-body--plain {
    white-space: pre-wrap;
    word-break: break-word;
}

.kb-article-body--html h2,
.kb-article-body--html h3,
.kb-article-body--html h4 {
    margin-top: 1.35rem;
    margin-bottom: 0.65rem;
    font-weight: 650;
}

.kb-article-body--html ul,
.kb-article-body--html ol {
    padding-left: 1.35rem;
}

.kb-article-attachments {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.kb-article-attachments h2 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.kb-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: #64748b;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    border-radius: 0.65rem;
    background: #fafafa;
}

.kb-empty strong {
    display: block;
    color: #334155;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.kb-org-pill {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}
