/* History.Wiki — Plain, functional, unsentimental. Reference material, not theatre. */
/* Fonts: Source Serif 4 (body/headings) + Source Sans 3 (UI/nav) */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f8f9fa;
    color: #202122;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: #0645ad;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #0b0080;
}

/* ── Layout ── */

.page-shell {
    display: flex;
    min-height: 100vh;
    background: #ffffff;
}

/* ── Sidebar ── */

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-right: 1px solid #a2a9b1;
    padding: 24px 16px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
}

.sidebar-logo {
    display: block;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #202122;
    margin-bottom: 24px;
    letter-spacing: 0;
    text-decoration: none;
}

.sidebar-logo:visited {
    color: #202122;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #72777d;
    letter-spacing: 0.05em;
    margin: 20px 0 6px 0;
    border-bottom: 1px solid #c8ccd1;
    padding-bottom: 4px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin: 6px 0;
}

.sidebar-nav a {
    color: #0645ad;
    font-size: 13px;
}

/* ── Main content area ── */

.main-wrap {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ffffff;
}

/* ── Top bar ── */

.top-bar {
    background: #ffffff;
    border-bottom: 1px solid #a2a9b1;
    padding: 0 40px;
    height: 48px;
    display: flex;
    align-items: center;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    gap: 16px;
}

.top-bar-title {
    font-weight: 600;
    font-size: 14px;
    color: #202122;
}

.top-bar-spacer {
    flex-grow: 1;
}

.top-bar a {
    color: #0645ad;
    font-size: 13px;
}

.login-btn {
    border: 1px solid #a2a9b1;
    padding: 4px 12px;
    background: #f8f9fa;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    border-radius: 2px;
    cursor: pointer;
}

.login-btn:hover {
    background: #eaecf0;
}

/* ── Article area ── */

.article-body {
    max-width: 900px;
    padding: 36px 40px 60px 40px;
    background: #ffffff;
    min-height: calc(100vh - 48px);
    width: 100%;
}

/* ── Article typography ── */

.article-body h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 30px;
    font-weight: 400;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 8px;
    margin-bottom: 20px;
    color: #000;
}

.article-body h2 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    border-bottom: 1px solid #c8ccd1;
    padding-bottom: 4px;
    margin: 32px 0 14px 0;
    color: #000;
}

.article-body h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 24px 0 8px 0;
    color: #202122;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
    margin: 12px 0 16px 24px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body blockquote {
    border-left: 3px solid #a2a9b1;
    padding: 6px 16px;
    margin: 20px 0;
    color: #54595d;
}

.article-body strong {
    font-weight: 600;
}

.article-body em {
    font-style: italic;
}

.article-body hr {
    border: none;
    border-top: 1px solid #c8ccd1;
    margin: 32px 0;
}

/* ── Record & Info blocks ── */

.record-block {
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    margin: 20px 0;
    font-size: 14px;
}

.record-block-header {
    background: #eaecf0;
    border-bottom: 1px solid #c8ccd1;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 12px;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
}

.record-block-body {
    padding: 14px;
    line-height: 1.65;
}

.lead {
    font-size: 18px;
    line-height: 1.6;
    color: #202122;
    margin-bottom: 24px;
}

.record-card {
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    padding: 18px 20px;
    margin: 16px 0;
    border-radius: 2px;
}

.record-card h3 {
    margin-top: 0;
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: normal;
    font-size: 17px;
}

.record-card p {
    margin-bottom: 0;
    font-size: 14px;
    color: #54595d;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin: 16px 0 24px 0;
}

.themes-grid .record-card {
    margin: 0;
}

/* ── Footer ── */

.site-footer {
    border-top: 1px solid #c8ccd1;
    padding: 16px 40px;
    font-size: 12px;
    color: #72777d;
    background: #ffffff;
    font-family: 'Source Sans 3', sans-serif;
}

.menu-toggle {
    display: none;
    border: 1px solid #a2a9b1;
    padding: 4px 12px;
    background: #f8f9fa;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    border-radius: 2px;
    cursor: pointer;
    margin-right: 12px;
}

.menu-toggle:hover {
    background: #eaecf0;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-block;
    }
    
    .sidebar {
        display: none;
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        z-index: 200;
        background: #ffffff;
        border-right: none;
        border-bottom: 1px solid #a2a9b1;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 20px 24px;
    }

    .sidebar.is-open {
        display: block;
    }

    .top-bar {
        padding: 0 16px;
    }

    .article-body {
        padding: 24px 16px 40px 16px;
    }

    .site-footer {
        padding: 16px 16px;
    }
}

/* ── Contributor Authentication & Workspace ── */

.user-name-link {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #0645ad;
    cursor: pointer;
}

.user-name-link:hover {
    text-decoration: underline;
}

.auth-portal-shell {
    max-width: 640px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #c8ccd1;
    padding-bottom: 10px;
}

.auth-tab-btn {
    border: 1px solid #a2a9b1;
    background: #f8f9fa;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
}

.auth-tab-btn.is-active {
    background: #202122;
    color: #ffffff;
    border-color: #202122;
}

.protocol-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #202122;
}

.form-input,
.form-textarea {
    border: 1px solid #a2a9b1;
    background: #ffffff;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 2px;
    width: 100%;
}

.form-input:focus,
.form-textarea:focus {
    outline: 1px solid #0645ad;
    border-color: #0645ad;
}

.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #202122;
}

.form-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.primary-btn {
    border: 1px solid #202122;
    background: #202122;
    color: #ffffff;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 2px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.primary-btn:hover {
    background: #3a3d40;
    color: #ffffff;
    text-decoration: none;
}

.primary-btn:visited {
    color: #ffffff;
}

.secondary-btn {
    border: 1px solid #a2a9b1;
    background: #ffffff;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 2px;
    cursor: pointer;
}

.secondary-btn:hover {
    background: #eaecf0;
}

.credential-hint {
    margin-top: 14px;
    margin-bottom: 0;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    color: #54595d;
    border-top: 1px solid #c8ccd1;
    padding-top: 10px;
}

.notice-banner {
    border: 1px solid #a2a9b1;
    background: #eaecf0;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 2px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 14px;
}

.profile-field-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #72777d;
    margin-bottom: 2px;
}

.profile-field-value {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: #202122;
}

.record-citation-line {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #202122;
    margin-bottom: 6px;
}

.record-author-line {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    color: #54595d;
    margin-bottom: 0;
}

/* ── Top-Level Theme Navigation Bar ── */

.top-bar-themes-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 12px;
    overflow-x: auto;
}

.top-bar-themes-nav a {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #202122;
    white-space: nowrap;
}

.top-bar-themes-nav a:hover {
    color: #0645ad;
}

.top-bar-taxonomy-btn {
    border: 1px solid #1f4d36;
    background: #eaf3ee;
    color: #1f4d36;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.top-bar-taxonomy-btn:hover {
    background: #dcebe3;
}

/* ── Inline Taxonomy Path Composer Box (Frame 1) ── */

.taxonomy-composer-section {
    margin: 20px 0 28px 0;
}

.taxonomy-composer-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-family: 'Source Sans 3', sans-serif;
}

.taxonomy-composer-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #54595d;
}

.taxonomy-open-dialog-link {
    background: none;
    border: none;
    color: #1f4d36;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.taxonomy-composer-box {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px 14px;
    font-family: 'Source Sans 3', sans-serif;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.taxonomy-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.taxonomy-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: #0f172a;
}

.taxonomy-chip-prefix {
    color: #64748b;
    font-weight: 600;
}

.taxonomy-chip-path {
    color: #0f172a;
    font-weight: 600;
}

.taxonomy-chip-remove {
    border: none;
    background: none;
    color: #475569;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.taxonomy-chip-remove:hover {
    color: #0f172a;
}

.taxonomy-composer-input-row {
    margin-bottom: 6px;
}

.taxonomy-composer-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    color: #1e293b;
    padding: 2px 0;
}

.taxonomy-composer-hint-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.taxonomy-hint-icon {
    font-size: 14px;
    color: #64748b;
}

.taxonomy-inline-trigger {
    border: none;
    background: none;
    color: #1f4d36;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* ── Advanced Repository Search Modal Dialog (Frame 2) ── */

.taxonomy-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.taxonomy-modal-dialog {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 12px;
    width: 100%;
    max-width: 920px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    font-family: 'Source Sans 3', sans-serif;
    overflow: hidden;
}

.taxonomy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 28px 16px 28px;
    border-bottom: 1px solid #e5e7eb;
}

.taxonomy-modal-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    border: none;
    padding: 0;
}

.taxonomy-modal-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.taxonomy-modal-close-icon {
    border: none;
    background: none;
    font-size: 22px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.taxonomy-modal-body {
    padding: 18px 28px 24px 28px;
    overflow-y: auto;
}

.taxonomy-modal-intro {
    font-size: 13.5px;
    color: #4b5563;
    margin-bottom: 18px;
}

.taxonomy-columns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.taxonomy-column-right {
    border-left: 1px solid #e5e7eb;
    padding-left: 28px;
}

.taxonomy-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.taxonomy-col-icon {
    font-size: 15px;
    color: #4b5563;
}

.taxonomy-col-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.taxonomy-col-count {
    font-size: 12px;
    color: #6b7280;
}

.taxonomy-active-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #eaf3ee;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.taxonomy-empty-card {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 12.5px;
    color: #64748b;
}

.taxonomy-active-check {
    color: #1f4d36;
    font-size: 14px;
    font-weight: 600;
}

.taxonomy-active-content {
    flex-grow: 1;
}

.taxonomy-active-Resize-crumb {
    font-size: 11.5px;
    color: #4b6356;
    margin-bottom: 2px;
}

.taxonomy-active-leaf {
    font-size: 14px;
    font-weight: 600;
    color: #1f4d36;
}

.taxonomy-active-remove {
    border: none;
    background: none;
    color: #4b5563;
    font-size: 16px;
    cursor: pointer;
}

.taxonomy-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.taxonomy-search-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 7px 10px;
    background: #ffffff;
    margin-bottom: 10px;
}

.taxonomy-search-input-wrap.is-focused,
.taxonomy-search-input-wrap:focus-within {
    border-color: #1f4d36;
    box-shadow: 0 0 0 1px #1f4d36;
}

.taxonomy-search-icon {
    font-size: 13px;
    color: #6b7280;
    margin-right: 8px;
}

.taxonomy-search-input {
    border: none;
    outline: none;
    width: 100%;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13.5px;
    color: #111827;
}

.taxonomy-input-clear {
    border: none;
    background: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
}

.taxonomy-suggestion-card {
    border: 1px solid #84a996;
    background: #eaf3ee;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

.taxonomy-suggestion-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.taxonomy-suggestion-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1f4d36;
}

.taxonomy-enter-badge {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
}

.taxonomy-suggestion-crumb {
    font-size: 11.5px;
    color: #4b6356;
}

.taxonomy-helper-note {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.45;
    margin-bottom: 14px;
}

.taxonomy-tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.taxonomy-tree-link {
    border: none;
    background: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
}

.taxonomy-tree-link:hover {
    text-decoration: underline;
}

.taxonomy-tree-parent-row,
.taxonomy-tree-subparent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 13.5px;
    color: #1f2937;
}

.taxonomy-tree-subparent-row {
    padding-left: 22px;
}

.taxonomy-tree-leaves {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.taxonomy-tree-leaf-row {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    background: transparent;
    padding: 7px 12px 7px 36px;
    border-radius: 6px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13.5px;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
}

.taxonomy-tree-leaf-row:hover {
    background: #f3f4f6;
}

.taxonomy-tree-leaf-row.is-selected {
    background: #eaf3ee;
    color: #1f4d36;
    font-weight: 600;
}

.taxonomy-tree-caret {
    margin-right: 8px;
    color: #6b7280;
}

.taxonomy-tree-label {
    flex-grow: 1;
}

.taxonomy-tree-meta {
    font-size: 12px;
    color: #6b7280;
}

.taxonomy-tree-leaf-row.is-selected .taxonomy-tree-meta {
    color: #1f4d36;
    font-weight: 600;
}

.taxonomy-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.taxonomy-footer-status {
    font-size: 12.5px;
    color: #4b5563;
}

.taxonomy-footer-actions {
    display: flex;
    gap: 10px;
}

.taxonomy-btn-close {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.taxonomy-btn-close:hover {
    background: #f3f4f6;
}

.taxonomy-btn-run {
    border: 1px solid #1f4d36;
    background: #1f4d36;
    color: #ffffff;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.taxonomy-btn-run:hover {
    background: #173b29;
}

.taxonomy-btn-fullscreen {
    border: 1px solid #1f4d36;
    background: #eaf3ee;
    color: #1f4d36;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.taxonomy-btn-fullscreen:hover {
    background: #dcebe3;
}

.top-bar-themes-link {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #202122;
}

/* ── Full-Screen Repository Search Workbench (/search/) ── */

.ws-full-bleed-body {
    max-width: 1180px;
}

.ws-composer-surface {
    margin-bottom: 18px;
}

.ws-composer-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ws-no-chips-hint {
    font-size: 12.5px;
    color: #64748b;
    font-style: italic;
}

.ws-filter-controls-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid #c8ccd1;
    border-radius: 4px;
}

.ws-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ws-workbench-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 24px;
    align-items: start;
}

.ws-tree-panel {
    margin-top: 0;
    margin-bottom: 16px;
}

.ws-tree-panel-body {
    padding: 10px;
}

.ws-results-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #202122;
    padding-bottom: 10px;
    border-bottom: 1px solid #c8ccd1;
    margin-bottom: 14px;
}

.ws-result-card .record-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ws-result-period {
    font-weight: 400;
    color: #54595d;
    font-size: 11.5px;
}

.ws-result-taxonomies {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ws-evidence-tag {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    color: #1f4d36;
    background: #eaf3ee;
    padding: 3px 10px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .top-bar-themes-nav a {
        display: inline-block;
    }

    .ws-filter-controls-bar,
    .ws-workbench-grid,
    .taxonomy-columns-grid {
        grid-template-columns: 1fr;
    }

    .taxonomy-column-right {
        border-left: none;
        border-top: 1px solid #e5e7eb;
        padding-left: 0;
        padding-top: 20px;
    }

    .taxonomy-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* ── Collapsible Sidebar Rail & Multi-Level Hover Flyout ── */

.sidebar {
    position: relative;
    z-index: 200;
    transition: width 0.18s ease, padding 0.18s ease;
}

.sidebar.is-rail-collapsed {
    width: 58px;
    padding: 18px 8px;
}

.sb-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #c8ccd1;
    gap: 6px;
}

.sb-header-row .sidebar-logo {
    margin-bottom: 0;
}

.sb-mini-logo {
    display: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1f4d36;
    text-align: center;
}

.sb-rail-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #c8ccd1;
    border-radius: 4px;
    background: #ffffff;
    color: #54595d;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.sb-rail-toggle-btn:hover {
    background: #eaf3ee;
    color: #1f4d36;
    border-color: #9bb8a8;
}

.sb-icon-expand {
    display: none;
}

.sidebar.is-rail-collapsed .sb-header-row {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding-bottom: 12px;
}

.sidebar.is-rail-collapsed .sb-full-logo {
    display: none;
}

.sidebar.is-rail-collapsed .sb-mini-logo {
    display: block;
}

.sidebar.is-rail-collapsed .sb-icon-collapse {
    display: none;
}

.sidebar.is-rail-collapsed .sb-icon-expand {
    display: block;
}

.sb-top-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-top-item {
    position: relative;
}

.sb-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 5px;
    transition: background 0.12s ease;
}

.sb-top-item:hover > .sb-item-row,
.sb-top-item.is-current > .sb-item-row {
    background: #eaf3ee;
}

.sb-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    color: #202122;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
}

.sb-item-link:visited {
    color: #202122;
}

.sb-item-link:hover {
    text-decoration: none;
    color: #1f4d36;
}

.sb-top-item.is-current > .sb-item-row .sb-item-link {
    color: #1f4d36;
}

.sb-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #374151;
    flex-shrink: 0;
}

.sb-top-item:hover .sb-item-icon,
.sb-top-item.is-current .sb-item-icon {
    color: #1f4d36;
}

.sb-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.sb-flyout-hint-arrow {
    font-size: 15px;
    color: #72777d;
    line-height: 1;
    margin-left: auto;
}

.sb-inline-collapse-btn {
    background: transparent;
    border: none;
    color: #54595d;
    width: 26px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    margin-right: 4px;
    flex-shrink: 0;
}

.sb-inline-collapse-btn:hover {
    background: #d8e8df;
    color: #1f4d36;
}

.sb-chevron-glyph {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.15s ease;
    transform: rotate(-90deg);
}

.sb-top-item.is-inline-expanded .sb-chevron-glyph {
    transform: rotate(0deg);
}

.sb-inline-sublist {
    display: none;
    list-style: none;
    margin: 4px 0 8px 20px;
    padding-left: 10px;
    border-left: 1px solid #c8ccd1;
}

.sb-top-item.is-inline-expanded .sb-inline-sublist {
    display: block;
}

.sb-inline-sublist li {
    margin: 4px 0;
}

.sb-inline-sublist a {
    display: block;
    padding: 3px 6px;
    font-size: 12.5px;
    color: #0645ad;
    border-radius: 3px;
}

.sb-inline-sublist a:hover {
    background: #eef2f5;
    text-decoration: none;
}

/* Collapsed Icon Rail overrides */

.sidebar.is-rail-collapsed .sb-item-label,
.sidebar.is-rail-collapsed .sb-inline-collapse-btn,
.sidebar.is-rail-collapsed .sb-flyout-hint-arrow,
.sidebar.is-rail-collapsed .sb-inline-sublist {
    display: none !important;
}

.sidebar.is-rail-collapsed .sb-item-link {
    justify-content: center;
    padding: 9px 0;
}

/* Multi-Level Hover Flyout Menu */

.sb-multilevel-flyout {
    position: absolute;
    top: -6px;
    left: calc(100% + 8px);
    width: 580px;
    background: #ffffff;
    border: 1px solid #a2a9b1;
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.sb-multilevel-flyout::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -14px;
    width: 14px;
}

.sb-has-flyout:hover > .sb-multilevel-flyout,
.sb-has-flyout:focus-within > .sb-multilevel-flyout {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.sb-flyout-header {
    padding: 12px 16px 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.sb-flyout-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.sb-flyout-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    color: #54595d;
    margin-top: 2px;
}

.sb-flyout-columns {
    display: grid;
    grid-template-columns: 255px 1fr;
    min-height: 260px;
}

.sb-flyout-col-l1 {
    border-right: 1px solid #e5e7eb;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fcfcfd;
}

.sb-flyout-l1-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #202122;
    border: 1px solid transparent;
    transition: background 0.1s ease, border-color 0.1s ease;
}

.sb-flyout-l1-item:visited {
    color: #202122;
}

.sb-flyout-l1-item:hover,
.sb-flyout-l1-item.is-active-branch {
    background: #eaf3ee;
    border-color: #c5ddd0;
    text-decoration: none;
}

.sb-flyout-l1-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sb-flyout-l1-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1f4d36;
}

.sb-flyout-l1-badge {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    color: #54595d;
    white-space: nowrap;
}

.sb-flyout-l1-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11.5px;
    color: #54595d;
    line-height: 1.35;
}

.sb-flyout-col-l2 {
    padding: 12px 14px;
    background: #ffffff;
}

.sb-flyout-l2-pane {
    display: none;
}

.sb-flyout-l2-pane.is-active-pane {
    display: block;
}

.sb-flyout-l2-header {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #54595d;
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.sb-flyout-l2-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sb-flyout-l2-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 9px;
    border-radius: 4px;
    border: 1px solid #eef0f2;
    background: #f8f9fa;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.sb-flyout-l2-link:hover {
    background: #eaf3ee;
    border-color: #b7d4c4;
    text-decoration: none;
}

.sb-flyout-l2-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #0645ad;
}

.sb-flyout-l2-link:hover .sb-flyout-l2-label {
    color: #1f4d36;
}

.sb-flyout-l2-meta {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11.5px;
    color: #54595d;
    line-height: 1.35;
}

.sb-flyout-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 6px 6px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
}

.sb-flyout-footer-link {
    font-weight: 600;
    color: #1f4d36;
}

.sb-flyout-footer-secondary {
    color: #0645ad;
}

@media (max-width: 768px) {
    .sb-multilevel-flyout {
        display: none;
    }
}

/* ── Top-Bar Inline Search & Empirical Report Box ── */

.top-bar-inline-search-wrap {
    flex: 1;
    max-width: 680px;
}

.top-bar-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 1px solid #c8ccd1;
    border-radius: 5px;
    padding: 3px 6px 3px 10px;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.top-bar-search-box:focus-within {
    background: #ffffff;
    border-color: #1f4d36;
    box-shadow: 0 0 0 2px rgba(31, 77, 54, 0.12);
}

.top-bar-search-icon {
    font-size: 13px;
    color: #54595d;
    flex-shrink: 0;
}

.top-bar-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #202122;
    padding: 4px 2px;
    outline: none;
}

.top-bar-search-input::placeholder {
    color: #72777d;
}

.top-bar-search-submit-btn {
    background: #1f4d36;
    color: #ffffff;
    border: 1px solid #1f4d36;
    border-radius: 4px;
    padding: 4px 10px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.top-bar-search-submit-btn:hover {
    background: #163827;
}

/* ── Dialog Search & Empirical Report Box (Non-Chat Search Bar Style) ── */

.taxonomy-llm-search-bar-wrap {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.taxonomy-llm-search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 6px;
}

.taxonomy-llm-input-box {
    flex: 1;
    margin-bottom: 0;
}

.taxonomy-scrollable-tree {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.taxonomy-tree-category-block {
    margin-bottom: 10px;
}

/* ── Archival Empirical Report & Matched Articles Dossier ── */

.synth-dossier-box {
    background: #f8faf9;
    border: 1px solid #bdd4c7;
    border-left: 4px solid #1f4d36;
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 18px;
    font-family: 'Source Sans 3', sans-serif;
    color: #202122;
}

.synth-loading {
    color: #1f4d36;
    font-size: 13.5px;
}

.synth-dossier-header {
    margin-bottom: 8px;
}

.synth-dossier-kicker {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1f4d36;
    margin-bottom: 2px;
}

.synth-dossier-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.synth-dossier-baseline {
    font-size: 13.5px;
    line-height: 1.55;
    color: #202122;
    margin-bottom: 12px;
}

.synth-dossier-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #54595d;
    margin: 12px 0 6px 0;
    border-bottom: 1px solid #dce5df;
    padding-bottom: 3px;
}

.synth-dossier-findings {
    margin: 0 0 10px 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #202122;
}

.synth-dossier-findings li {
    margin-bottom: 5px;
}

.synth-dossier-method {
    font-size: 12px;
    font-style: italic;
    color: #4b5563;
    background: #eef5f1;
    padding: 7px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.synth-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.synth-article-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    text-decoration: none;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.synth-article-card:hover {
    border-color: #1f4d36;
    background: #eaf3ee;
    text-decoration: none;
}

.synth-article-category {
    font-size: 11px;
    font-weight: 600;
    color: #1f4d36;
}

.synth-article-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0645ad;
}

.synth-article-card:hover .synth-article-title {
    color: #1f4d36;
}

.synth-article-summary {
    font-size: 12px;
    color: #54595d;
    line-height: 1.4;
}

/* ── Nested Foundations Pillars & Premises in Sidebar & Flyout ── */

.sb-pillar-link {
    font-weight: 600;
    color: #1f4d36 !important;
}

.sb-inline-level2 {
    list-style: none;
    margin: 3px 0 6px 8px;
    padding-left: 8px;
    border-left: 1px solid #d1d5db;
}

.sb-inline-level2 > li {
    margin: 3px 0;
}

.sb-inline-level2 a {
    font-size: 12px;
    color: #0645ad;
    line-height: 1.35;
    padding: 2px 4px;
}

.sb-inline-level3 {
    list-style: none;
    margin: 2px 0 5px 8px;
    padding-left: 7px;
    border-left: 2px solid #9bb8a8;
}

.sb-inline-level3 a {
    font-size: 11px;
    color: #374151;
    font-style: italic;
    line-height: 1.3;
    background: #f2f7f4;
    border-radius: 3px;
    padding: 3px 5px;
}

.sb-flyout-l2-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-flyout-l3-premise {
    display: block;
    margin-left: 12px;
    padding: 6px 9px;
    border-left: 3px solid #1f4d36;
    background: #eaf3ee;
    border-radius: 0 4px 4px 0;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    color: #1f4d36;
    text-decoration: none;
    line-height: 1.35;
}

.sb-flyout-l3-premise:hover {
    background: #d8e8df;
    text-decoration: none;
}

.protocol-formula {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1f4d36;
    background: #eef4f1;
    border: 1px solid #c3d5cb;
    padding: 10px 14px;
    border-radius: 3px;
    margin: 0 !important;
    text-align: center;
}

.protocol-table-wrap {
    overflow-x: auto;
    padding: 0;
}

.protocol-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    background: #ffffff;
}

.protocol-comparison-table th {
    background: #eaecf0;
    color: #202122;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #a2a9b1;
    border-right: 1px solid #c8ccd1;
}

.protocol-comparison-table th:last-child {
    border-right: none;
}

.protocol-comparison-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e1e4e8;
    border-right: 1px solid #e1e4e8;
    vertical-align: top;
    color: #202122;
}

.protocol-comparison-table td:last-child {
    border-right: none;
    background: #f6faf8;
}

.protocol-comparison-table tr:last-child td {
    border-bottom: none;
}

