/* Content / admin UI on top of StuTheme (does not restyle header/footer). */

.site-content .help,
.site-content .form-text {
    color: #5a6578;
    font-size: 0.9rem;
}

body[data-theme="dark"] .site-content .help,
body[data-theme="dark"] .site-content .form-text,
body.dark-mode .site-content .help,
body.dark-mode .site-content .form-text {
    color: rgba(255, 255, 255, 0.65);
}

.site-content {
    /* Side gutters = previous leftover / 3 (was 2rem min, or 100% − 72rem when wider) */
    width: calc(100% - max(2rem, 100% - 72rem) / 3);
    margin-inline: auto;
    padding: 0.5rem 0 1rem;
}

.site-content.site-content--bleed {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-left: 0;
    padding-right: 0;
}

/* E94 — wider shell for /editor/articles list + calendar hub */
.site-content.site-content--editor-wide {
    /* Same rule as .site-content with 96rem / 1rem baseline (E94) */
    width: calc(100% - max(1rem, 100% - 96rem) / 3);
}

.site-content--editor-wide .editor-article-list__title {
    max-width: 28rem;
}

.site-content .hero {
    margin-bottom: 1.5rem;
}

.site-content .hero h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    color: #142033;
    line-height: 1.2;
}

.site-content .hero > p {
    margin: 0.65rem 0 0;
    max-width: 40rem;
    color: #5a6578;
    font-size: 1.05rem;
}

body[data-theme="dark"] .site-content .hero h1,
body.dark-mode .site-content .hero h1 {
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .hero > p,
body.dark-mode .site-content .hero > p {
    color: rgba(255, 255, 255, 0.72);
}

.site-content .panel {
    position: relative;
    padding: 1.35rem 1.5rem;
    border: 1px solid rgba(20, 32, 51, 0.1);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0.35rem 1.25rem rgba(20, 32, 51, 0.06);
}

/* E57 — ❓ help on config containers (not site header) */
.article-editor-panel {
    position: relative;
}

.dashboard-help-trigger {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.72;
}

.dashboard-help-trigger:hover,
.dashboard-help-trigger:focus-visible {
    opacity: 1;
    background: rgba(20, 32, 51, 0.06);
    outline: none;
}

body[data-theme="dark"] .dashboard-help-trigger:hover,
body[data-theme="dark"] .dashboard-help-trigger:focus-visible,
body.dark-mode .dashboard-help-trigger:hover,
body.dark-mode .dashboard-help-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-help-body .dashboard-help-section h3 {
    margin-bottom: 0.35rem;
}

/* Centered auth surfaces (login / secret admin login) */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 0 1rem;
}

.auth-page__hero {
    width: 100%;
    max-width: 32rem;
    text-align: center;
}

.auth-page__panel {
    width: 100%;
    max-width: 32rem;
    margin-inline: auto;
}

.auth-page__secret-url {
    text-align: center;
    margin: 0 0 1rem;
    word-break: break-all;
}

.auth-page__secret-url code {
    display: inline-block;
    max-width: 100%;
    font-size: 0.85rem;
    line-height: 1.45;
}

body[data-theme="dark"] .site-content .panel,
body.dark-mode .site-content .panel {
    background: rgba(52, 73, 97, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    color: rgba(255, 255, 255, 0.9);
}

.site-flash-messages {
    margin: 0 0 1rem;
}

.site-flash-messages:empty {
    display: none;
    margin: 0;
}

.site-flash-messages .alert:last-child {
    margin-bottom: 0;
}

.site-content .flash {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #1e90ff;
    background: rgba(30, 144, 255, 0.1);
}

.site-content .flash--error {
    border-left-color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
    color: #8a1f1f;
}

.site-content .flash--warning {
    border-left-color: #d68910;
    background: rgba(214, 137, 16, 0.12);
    color: #7a4e00;
}

.site-content .flash--success {
    border-left-color: #1e8449;
    background: rgba(30, 132, 73, 0.1);
    color: #145a32;
}

.article-ai-disclosure {
    margin: 0.85rem 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(20, 32, 51, 0.12);
    background: rgba(30, 144, 255, 0.06);
}

.article-ai-disclosure__title {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5a6578;
}

.article-ai-disclosure__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-ai-disclosure__badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #142033;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(20, 32, 51, 0.14);
}

.article-ai-disclosure__note {
    margin: 0.55rem 0 0;
    font-size: 0.9rem;
    color: #3a4558;
}

body[data-theme="dark"] .article-ai-disclosure,
body.dark-mode .article-ai-disclosure {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .article-ai-disclosure__title,
body.dark-mode .article-ai-disclosure__title {
    color: rgba(255, 255, 255, 0.65);
}

body[data-theme="dark"] .article-ai-disclosure__badge,
body.dark-mode .article-ai-disclosure__badge {
    color: #f2f5f9;
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .article-ai-disclosure__note,
body.dark-mode .article-ai-disclosure__note {
    color: rgba(255, 255, 255, 0.8);
}

.article-ai-disclosure-fieldset legend,
.article-ai-disclosure-fieldset .form-label {
    font-weight: 600;
}

.site-content .empty-state {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: #5a6578;
    background: rgba(30, 144, 255, 0.05);
    border: 1px dashed rgba(30, 144, 255, 0.35);
    border-radius: 0.75rem;
}

body[data-theme="dark"] .site-content .empty-state,
body.dark-mode .site-content .empty-state {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Readable buttons on light + dark panels (admin / editor / forms). */
.site-content .btn-primary,
.site-content .btn-primary:disabled,
.site-content .btn-primary.disabled {
    background: #1e90ff !important;
    background-color: #1e90ff !important;
    border-color: #1e90ff !important;
    color: #fff !important;
}

.site-content .btn-primary:hover,
.site-content .btn-primary:focus {
    background: #1873cc !important;
    background-color: #1873cc !important;
    border-color: #1873cc !important;
    color: #fff !important;
}

.site-content .btn-outline-primary {
    background-color: transparent !important;
    border-color: #1e90ff !important;
    color: #1e90ff !important;
}

.site-content .btn-outline-primary:hover,
.site-content .btn-outline-primary:focus {
    background: #1e90ff !important;
    border-color: #1e90ff !important;
    color: #fff !important;
}

.site-content .btn-outline-secondary {
    background-color: #fff !important;
    border-color: #adb5bd !important;
    color: #212529 !important;
}

.site-content .btn-outline-secondary:hover,
.site-content .btn-outline-secondary:focus {
    background-color: #f1f3f5 !important;
    color: #212529 !important;
}

.site-content .btn-outline-success {
    background-color: transparent !important;
    border-color: #198754 !important;
    color: #198754 !important;
}

.site-content .btn-outline-success:hover,
.site-content .btn-outline-success:focus {
    background: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
}

.site-content .btn-outline-danger {
    background-color: #fff !important;
    border-color: #c0392b !important;
    color: #c0392b !important;
}

.site-content .btn-outline-danger:hover,
.site-content .btn-outline-danger:focus {
    background: #c0392b !important;
    border-color: #c0392b !important;
    color: #fff !important;
}

.site-content .btn-success {
    background: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
}

.site-content .btn-warning {
    background: #e0a800 !important;
    border-color: #e0a800 !important;
    color: #212529 !important;
}

body[data-theme="dark"] .site-content .btn-primary,
body[data-theme="dark"] .site-content .btn-primary:disabled,
body[data-theme="dark"] .site-content .btn-primary.disabled,
body.dark-mode .site-content .btn-primary,
body.dark-mode .site-content .btn-primary:disabled,
body.dark-mode .site-content .btn-primary.disabled {
    background: #1e90ff !important;
    background-color: #1e90ff !important;
    border-color: #1e90ff !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .btn-primary:hover,
body[data-theme="dark"] .site-content .btn-primary:focus,
body.dark-mode .site-content .btn-primary:hover,
body.dark-mode .site-content .btn-primary:focus {
    background: #4aa3ff !important;
    background-color: #4aa3ff !important;
    border-color: #4aa3ff !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .btn-outline-primary,
body.dark-mode .site-content .btn-outline-primary {
    background-color: transparent !important;
    border-color: #6bb6ff !important;
    color: #6bb6ff !important;
}

body[data-theme="dark"] .site-content .btn-outline-primary:hover,
body[data-theme="dark"] .site-content .btn-outline-primary:focus,
body.dark-mode .site-content .btn-outline-primary:hover,
body.dark-mode .site-content .btn-outline-primary:focus {
    background: #1e90ff !important;
    border-color: #1e90ff !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .btn-outline-secondary,
body.dark-mode .site-content .btn-outline-secondary {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    color: #f3f6fb !important;
}

body[data-theme="dark"] .site-content .btn-outline-secondary:hover,
body[data-theme="dark"] .site-content .btn-outline-secondary:focus,
body.dark-mode .site-content .btn-outline-secondary:hover,
body.dark-mode .site-content .btn-outline-secondary:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .btn-outline-success,
body.dark-mode .site-content .btn-outline-success {
    background-color: transparent !important;
    border-color: #5dd39e !important;
    color: #5dd39e !important;
}

body[data-theme="dark"] .site-content .btn-outline-success:hover,
body[data-theme="dark"] .site-content .btn-outline-success:focus,
body.dark-mode .site-content .btn-outline-success:hover,
body.dark-mode .site-content .btn-outline-success:focus {
    background: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .btn-outline-danger,
body.dark-mode .site-content .btn-outline-danger {
    background-color: transparent !important;
    border-color: #ff8a80 !important;
    color: #ff8a80 !important;
}

body[data-theme="dark"] .site-content .btn-outline-danger:hover,
body[data-theme="dark"] .site-content .btn-outline-danger:focus,
body.dark-mode .site-content .btn-outline-danger:hover,
body.dark-mode .site-content .btn-outline-danger:focus {
    background: #c0392b !important;
    border-color: #c0392b !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .btn-warning,
body.dark-mode .site-content .btn-warning {
    color: #0b1220 !important;
}

.site-content .form-label {
    font-weight: 600;
    color: #3a4558;
}

body[data-theme="dark"] .site-content .form-label,
body.dark-mode .site-content .form-label {
    color: rgba(255, 255, 255, 0.85);
}

.site-content .form-control,
.site-content .form-select {
    border-radius: 0.5rem;
}

.site-content .admin-filter-card {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 0.75rem;
    background: rgba(30, 144, 255, 0.06);
    border: 1px solid rgba(30, 144, 255, 0.15);
}

body[data-theme="dark"] .site-content .admin-filter-card,
body.dark-mode .site-content .admin-filter-card {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Soft info / action boxes (snapshots chain, setup notes, nested forms) */
.site-content .admin-soft-panel {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 32, 51, 0.12);
    background: rgba(20, 32, 51, 0.04);
    color: inherit;
}

.site-content .admin-soft-panel--danger {
    border-color: rgba(192, 57, 43, 0.45);
    background: rgba(192, 57, 43, 0.06);
}

body[data-theme="dark"] .site-content .admin-soft-panel,
body.dark-mode .site-content .admin-soft-panel {
    background: rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
}

body[data-theme="dark"] .site-content .admin-soft-panel--danger,
body.dark-mode .site-content .admin-soft-panel--danger {
    background: rgba(192, 57, 43, 0.18);
    border-color: rgba(231, 76, 60, 0.55);
}

body[data-theme="dark"] .site-content .admin-soft-panel .text-muted,
body.dark-mode .site-content .admin-soft-panel .text-muted,
body[data-theme="dark"] .site-content .admin-soft-panel .form-text,
body.dark-mode .site-content .admin-soft-panel .form-text {
    color: rgba(255, 255, 255, 0.55) !important;
}

/* Bootstrap tables inside admin panels */
body[data-theme="dark"] .site-content .table,
body.dark-mode .site-content .table {
    --bs-table-color: rgba(255, 255, 255, 0.9);
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 255, 255, 0.12);
    --bs-table-striped-color: rgba(255, 255, 255, 0.9);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: rgba(255, 255, 255, 0.95);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .site-content .table > :not(caption) > * > *,
body.dark-mode .site-content .table > :not(caption) > * > * {
    color: inherit;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    background-color: var(--bs-table-bg);
}

body[data-theme="dark"] .site-content .table thead th,
body.dark-mode .site-content .table thead th {
    color: rgba(255, 255, 255, 0.75);
    border-bottom-color: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .site-content .table code,
body.dark-mode .site-content .table code,
body[data-theme="dark"] .site-content .panel code,
body.dark-mode .site-content .panel code {
    color: #9ecbff;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
}

/* Nav tabs (snapshots / similar admin tabs) */
body[data-theme="dark"] .site-content .nav-tabs,
body.dark-mode .site-content .nav-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.14);
}

body[data-theme="dark"] .site-content .nav-tabs .nav-link,
body.dark-mode .site-content .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border-color: transparent;
    background: transparent;
}

body[data-theme="dark"] .site-content .nav-tabs .nav-link:hover,
body.dark-mode .site-content .nav-tabs .nav-link:hover,
body[data-theme="dark"] .site-content .nav-tabs .nav-link:focus,
body.dark-mode .site-content .nav-tabs .nav-link:focus {
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.18) rgba(255, 255, 255, 0.18) transparent;
    isolation: isolate;
}

body[data-theme="dark"] .site-content .nav-tabs .nav-link.active,
body.dark-mode .site-content .nav-tabs .nav-link.active {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(52, 73, 97, 0.85);
    border-color: rgba(255, 255, 255, 0.18) rgba(255, 255, 255, 0.18) transparent;
}

body[data-theme="dark"] .site-content .form-check-label,
body.dark-mode .site-content .form-check-label {
    color: rgba(255, 255, 255, 0.88);
}

body[data-theme="dark"] .site-content .form-control,
body.dark-mode .site-content .form-control,
body[data-theme="dark"] .site-content .form-select,
body.dark-mode .site-content .form-select {
    color: rgba(255, 255, 255, 0.92);
    background-color: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .site-content .form-control::placeholder,
body.dark-mode .site-content .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

body[data-theme="dark"] .site-content .form-control:focus,
body.dark-mode .site-content .form-control:focus,
body[data-theme="dark"] .site-content .form-select:focus,
body.dark-mode .site-content .form-select:focus {
    color: rgba(255, 255, 255, 0.95);
    background-color: rgba(0, 0, 0, 0.45);
    border-color: rgba(30, 144, 255, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.25);
}

.site-content .admin-link-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.site-content .admin-hub-section:last-of-type {
    margin-bottom: 0 !important;
}

/* Hub search stays in document flow (no sticky chrome while scrolling tiles) */
.site-content .admin-hub-search {
    position: static;
    z-index: auto;
    backdrop-filter: none;
}

.site-content .admin-hub-search-results {
    margin-top: 0.75rem;
    border: 1px solid rgba(20, 32, 51, 0.12);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.site-content .admin-hub-search-hit {
    display: block;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: #142033;
    border-bottom: 1px solid rgba(20, 32, 51, 0.08);
}

.site-content .admin-hub-search-hit:hover {
    background: rgba(30, 144, 255, 0.08);
    color: #142033;
}

.site-content .admin-hub-search-hit strong {
    display: block;
    margin-bottom: 0.2rem;
}

.site-content .admin-hub-search-hit span {
    display: block;
    font-size: 0.9rem;
    color: #5b6575;
}

.site-content .admin-hub-search-path {
    display: block;
    font-size: 0.78rem;
    color: #7a8496;
    margin-bottom: 0.15rem;
}

.site-content .admin-link-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.site-content .admin-hub-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.site-content .admin-hub-chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.3;
    border-radius: 999px;
    border: 1px solid rgba(20, 32, 51, 0.16);
    background: rgba(20, 32, 51, 0.03);
    color: inherit;
    text-decoration: none;
}

.site-content .admin-hub-chip:hover {
    border-color: rgba(30, 144, 255, 0.45);
    background: rgba(30, 144, 255, 0.08);
}

.site-content .admin-hub-search-empty {
    padding: 0.85rem 1rem;
}

.site-content .admin-settings-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 32, 51, 0.1);
    background: rgba(30, 144, 255, 0.04);
    position: static;
}

.site-content .admin-settings-toc a {
    font-size: 0.9rem;
}

body[data-theme="dark"] .site-content .admin-hub-search-results,
body.dark-mode .site-content .admin-hub-search-results {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .site-content .admin-hub-search-hit,
body.dark-mode .site-content .admin-hub-search-hit {
    color: #e8eef7;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .site-content .admin-hub-search-hit span,
body.dark-mode .site-content .admin-hub-search-hit span {
    color: #a8b3c4;
}

body[data-theme="dark"] .site-content .admin-hub-search-path,
body.dark-mode .site-content .admin-hub-search-path {
    color: rgba(232, 238, 247, 0.5);
}

body[data-theme="dark"] .site-content .admin-hub-chip,
body.dark-mode .site-content .admin-hub-chip {
    border-color: rgba(232, 238, 247, 0.2);
    background: rgba(232, 238, 247, 0.06);
    color: #e8eef7;
}

body[data-theme="dark"] .site-content .admin-settings-toc,
body.dark-mode .site-content .admin-settings-toc {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

.site-content .admin-link-card {
    display: flex;
    flex-direction: column;
    height: 9.5rem;
    padding: 1.1rem 1.2rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 32, 51, 0.1);
    background: #fff;
    text-decoration: none;
    color: #142033;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    overflow: hidden;
}

.site-content .admin-link-card:hover {
    border-color: #1e90ff;
    box-shadow: 0 0.35rem 1rem rgba(30, 144, 255, 0.15);
    transform: translateY(-1px);
    color: #142033;
}

.site-content .admin-link-card strong {
    display: block;
    flex: 0 0 auto;
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-content .admin-link-card span {
    flex: 1 1 auto;
    min-height: 0;
    color: #5a6578;
    font-size: 0.92rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

body[data-theme="dark"] .site-content .admin-link-card,
body.dark-mode .site-content .admin-link-card {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .admin-link-card span,
body.dark-mode .site-content .admin-link-card span {
    color: rgba(255, 255, 255, 0.7);
}

.site-content .badge-severity-minor { background: #6c757d; }
.site-content .badge-severity-major { background: #e0a800; color: #212529 !important; }
.site-content .badge-severity-critical { background: #c0392b; }

.site-content .badge-status-new { background: #1e90ff; }
.site-content .badge-status-in_progress { background: #6f42c1; }
.site-content .badge-status-resolved { background: #198754; }
.site-content .badge-status-reopened { background: #fd7e14; }

/* Admin role badges + invite/edit role picker (E3-S11) */
.site-content .admin-role-badge {
    display: inline-block;
    margin: 0.1rem 0.15rem 0.1rem 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.site-content .admin-role-badge--admin {
    background: #c0392b;
    color: #fff;
}

.site-content .admin-role-badge--author {
    background: #1e90ff;
    color: #fff;
}

.site-content .admin-role-badge--editor {
    background: #1873cc;
    color: #fff;
}

.site-content .admin-role-badge--redactor {
    background: #6f42c1;
    color: #fff;
}

.site-content .admin-role-badge--contributor {
    background: #6c757d;
    color: #fff;
}

.site-content .admin-role-badge--commenter {
    background: #198754;
    color: #fff;
}

.site-content .admin-roles__list {
    display: grid;
    gap: 0.75rem;
}

.site-content .admin-roles__item .form-check-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-left: 0.15rem;
}

.site-content .admin-roles__name {
    font-weight: 600;
}

.site-content .admin-roles__desc {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: #5a6578;
    line-height: 1.35;
}

body[data-theme="dark"] .site-content .admin-roles__desc,
body.dark-mode .site-content .admin-roles__desc {
    color: rgba(255, 255, 255, 0.65);
}

.site-content .admin-roles__matrix summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
}

.site-content .admin-roles__matrix-table th,
.site-content .admin-roles__matrix-table td {
    font-size: 0.85rem;
    white-space: nowrap;
}

.site-content .admin-roles__matrix-table th[scope="row"] {
    white-space: normal;
    min-width: 9rem;
}

.site-content .detail-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(20, 32, 51, 0.08);
}

body[data-theme="dark"] .site-content .detail-block,
body.dark-mode .site-content .detail-block {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.site-content .detail-block:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.site-content .detail-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6578;
}

body[data-theme="dark"] .site-content .detail-label,
body.dark-mode .site-content .detail-label {
    color: rgba(255, 255, 255, 0.55);
}

.site-content .table > :not(caption) > * > * {
    vertical-align: middle;
}

.site-content .editor-list-filters__form .form-label {
    font-weight: 600;
}

.site-content .editor-list-filters {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.site-content .editor-list-filters--accordion {
    padding: 0;
    overflow: hidden;
}

.site-content .editor-list-filters-accordion-item {
    border: 0;
}

.site-content .editor-list-filters-accordion-item > .accordion-header .accordion-button {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    box-shadow: none;
}

.site-content .editor-list-filters-accordion__body {
    padding: 0.75rem 1rem 1rem;
}

body[data-theme="dark"] .site-content .editor-list-filters-accordion-item > .accordion-header .accordion-button,
body.dark-mode .site-content .editor-list-filters-accordion-item > .accordion-header .accordion-button {
    background-color: transparent;
    color: inherit;
}

body[data-theme="dark"] .site-content .editor-list-filters-accordion-item > .accordion-header .accordion-button:not(.collapsed),
body.dark-mode .site-content .editor-list-filters-accordion-item > .accordion-header .accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .site-content .editor-list-filters,
body.dark-mode .site-content .editor-list-filters {
    border-color: rgba(255, 255, 255, 0.12);
}

.site-content .editor-article-list__table {
    --editor-article-list-gap: 0.35rem;
}

.site-content .editor-article-list__title {
    min-width: 12rem;
    max-width: 28rem;
}

.site-content .editor-article-list__completeness {
    width: auto;
    min-width: 4.25rem;
    max-width: 7.5rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    vertical-align: middle;
    line-height: 1.2;
}

.site-content .editor-article-list__completeness-mark {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
    cursor: help;
}

.site-content .editor-article-list__completeness .article-quality-badge {
    vertical-align: middle;
    margin-right: 0.1rem;
}

.site-content .editor-article-list__completeness-help {
    display: inline-block;
    font-size: 0.95rem;
    line-height: 1;
    cursor: help;
    opacity: 0.85;
}

.site-content .editor-article-list__completeness-help:hover,
.site-content .editor-article-list__completeness-help:focus {
    opacity: 1;
}

.site-content .editor-article-list__thumb {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    object-fit: cover;
    border-radius: 0.35rem;
    background: rgba(20, 32, 51, 0.06);
}

.site-content .editor-article-list__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a93a3;
    border: 1px solid rgba(20, 32, 51, 0.12);
}

body[data-theme="dark"] .site-content .editor-article-list__thumb,
body.dark-mode .site-content .editor-article-list__thumb {
    background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .site-content .editor-article-list__thumb--empty,
body.dark-mode .site-content .editor-article-list__thumb--empty {
    color: #9aa3b5;
    border-color: rgba(255, 255, 255, 0.14);
}

.site-content .editor-article-list__category {
    max-width: 12rem;
    white-space: normal;
    word-break: break-word;
}

.site-content .editor-article-list__sort-link:hover {
    color: var(--bs-primary) !important;
}

.site-content .editor-article-list__locales {
    display: flex;
    flex-wrap: wrap;
    gap: var(--editor-article-list-gap);
    align-items: center;
}

.site-content .editor-article-list__locale-btn {
    min-width: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-content .editor-article-list__locale-btn.is-selected {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.45);
    outline: 2px solid transparent;
}

.site-content .editor-article-list__actions .btn {
    min-width: 2.25rem;
}

.site-content .editor-article-list__publish-menu {
    min-width: 16rem;
    z-index: 1080;
}

.site-content pre.timeline-dump {
    max-height: 18rem;
    overflow: auto;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    background: #142033;
    color: #e8eef7;
    font-size: 0.8rem;
}

.site-content .markdown-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    min-height: 18rem;
    line-height: 1.45;
}

.site-content .article-body-editor .EasyMDEContainer {
    border-radius: 0.5rem;
}

.site-content .article-body-editor .EasyMDEContainer .CodeMirror {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    min-height: 20rem;
    border-radius: 0 0 0.5rem 0.5rem;
    border-color: rgba(20, 32, 51, 0.18);
}

.site-content .article-body-editor .EasyMDEContainer .CodeMirror.is-invalid {
    border-color: var(--bs-form-invalid-border-color, #dc3545);
}

.article-editor-sidebar .invalid-feedback[data-article-field-error="1"],
.article-body-editor .invalid-feedback[data-article-field-error="1"],
.article-editor-sidebar [data-taxonomy-combobox] .invalid-feedback[data-article-field-error="1"],
.article-editor-shell .article-field-error-message[data-article-field-error="1"] {
    display: block;
    color: var(--bs-form-invalid-color, #dc3545);
}

.article-editor-shell [data-article-error-field].article-field-has-error {
    outline: 1px solid rgba(220, 53, 69, 0.35);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.article-editor-shell .article-editor-validation-fallback[data-article-validation-fallback="1"] {
    border-color: rgba(220, 53, 69, 0.45);
}

.article-editor-shell .article-editor-validation-fallback.article-field-has-error:focus {
    outline: 2px solid rgba(220, 53, 69, 0.55);
    outline-offset: 2px;
}

.article-editor-shell .article-editor-qa-panel[data-article-qa-panel="1"] {
    border-color: rgba(255, 193, 7, 0.55);
}

.article-editor-shell .article-editor-qa-panel .article-qa-list {
    list-style: none;
    padding-left: 0;
}

.article-editor-shell .article-editor-qa-panel .article-qa-finding {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem 0.5rem;
    align-items: start;
    padding: 0.35rem 0.4rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.article-editor-shell .article-editor-qa-panel .article-qa-finding:hover,
.article-editor-shell .article-editor-qa-panel .article-qa-finding:focus {
    background: rgba(255, 193, 7, 0.12);
    outline: none;
}

.article-editor-shell .article-editor-qa-panel .article-qa-severity {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 600;
}

.article-editor-shell .article-editor-qa-panel .article-qa-severity--critical {
    color: #b02a37;
}

.article-editor-shell .article-editor-qa-panel .article-qa-severity--high {
    color: #a15c00;
}

.article-editor-shell .article-editor-qa-panel .article-qa-severity--medium {
    color: #6c5a00;
}

.article-editor-shell .article-editor-qa-panel .article-qa-severity--low {
    color: #5c636a;
}

.article-editor-shell .CodeMirror .article-qa-line-highlight {
    background: rgba(255, 193, 7, 0.22);
}

.site-content .article-body-editor .editor-toolbar {
    border-color: rgba(20, 32, 51, 0.18);
    border-radius: 0.5rem 0.5rem 0 0;
    background: rgba(20, 32, 51, 0.03);
}

.site-content .article-body-editor .editor-toolbar button.code,
.site-content .article-body-editor .editor-toolbar button.code-block {
    color: #0b5ed7;
}

.site-content .article-body-editor .editor-statusbar {
    color: rgba(20, 32, 51, 0.65);
}

body[data-theme="dark"] .site-content .article-body-editor .editor-toolbar,
body.dark-mode .site-content .article-body-editor .editor-toolbar {
    background: rgba(232, 238, 247, 0.06);
    border-color: rgba(232, 238, 247, 0.18);
}

body[data-theme="dark"] .site-content .article-body-editor .EasyMDEContainer .CodeMirror,
body.dark-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror {
    background: #142033;
    color: #e8eef7;
    border-color: rgba(232, 238, 247, 0.18);
}

/*
 * E91 — line-number gutter contrast only.
 * Do not set height / min-height / padding / margin that would fight fitEditorHeight
 * or the writing-mode flush-bottom lock (article-editor-flush-bottom rule).
 */
.site-content .article-body-editor .CodeMirror-gutters {
    background: rgba(20, 32, 51, 0.04);
    border-right: 1px solid rgba(20, 32, 51, 0.12);
}

.site-content .article-body-editor .CodeMirror-linenumber {
    color: rgba(20, 32, 51, 0.45);
}

body[data-theme="dark"] .site-content .article-body-editor .CodeMirror-gutters,
body.dark-mode .site-content .article-body-editor .CodeMirror-gutters {
    background: rgba(232, 238, 247, 0.04);
    border-right-color: rgba(232, 238, 247, 0.14);
}

body[data-theme="dark"] .site-content .article-body-editor .CodeMirror-linenumber,
body.dark-mode .site-content .article-body-editor .CodeMirror-linenumber {
    color: rgba(232, 238, 247, 0.45);
}

body[data-theme="dark"] .site-content .article-body-editor .EasyMDEContainer .CodeMirror .CodeMirror-cursor,
body.dark-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror .CodeMirror-cursor {
    border-left: 1px solid #e8eef7 !important;
}

body[data-theme="dark"] .site-content .article-body-editor .EasyMDEContainer .CodeMirror.CodeMirror-focused div.CodeMirror-cursors,
body.dark-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror.CodeMirror-focused div.CodeMirror-cursors {
    visibility: visible;
}

body[data-theme="dark"] .site-content .article-body-editor .EasyMDEContainer .CodeMirror textarea,
body.dark-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror textarea {
    caret-color: #e8eef7;
}

body[data-theme="dark"] .site-content .article-body-editor .editor-toolbar a,
body[data-theme="dark"] .site-content .article-body-editor .editor-toolbar button,
body.dark-mode .site-content .article-body-editor .editor-toolbar a,
body.dark-mode .site-content .article-body-editor .editor-toolbar button {
    color: #e8eef7;
}

body[data-theme="dark"] .site-content .article-body-editor .editor-statusbar,
body.dark-mode .site-content .article-body-editor .editor-statusbar {
    color: rgba(232, 238, 247, 0.7);
}

.media-library-card {
    display: block;
    border: 1px solid rgba(20, 32, 51, 0.12);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
    color: #142033;
    height: 100%;
}

.media-library-card__img {
    display: block;
    width: 100%;
    height: 9rem;
    object-fit: cover;
}

.media-library-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
}

.media-library-preview {
    display: block;
    max-width: min(100%, 36rem);
    max-height: 22rem;
    width: auto;
    height: auto;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 32, 51, 0.12);
}

body[data-theme="dark"] .media-library-card,
body.dark-mode .media-library-card {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f2f5f9;
}

/* Registration honeypot — off-screen, not display:none (bots often skip hidden fields) */
.register-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.register-captcha--required .form-label::after {
    content: " *";
    color: #b42318;
}

/* E13-S05: keyboard skip link (visible on focus only) */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0.75rem;
    z-index: 10000;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    background: #1E90FF;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0.35rem 1rem rgba(20, 32, 51, 0.25);
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
    left: 0.75rem;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* E34 — article editor main + sidebar */
/* E51 — top action bar + viewport minus bar */
.article-editor-writing-mode {
    --article-action-bar-height: 2.75rem;
}

/* Lock the page: only the Markdown surface (and sidebar) may scroll. */
html:has(body.article-editor-writing-mode),
body.article-editor-writing-mode {
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
}

.article-editor-action-bar {
    flex: 0 0 var(--article-action-bar-height);
    width: 100%;
    height: var(--article-action-bar-height);
    min-height: var(--article-action-bar-height);
    max-height: var(--article-action-bar-height);
    margin: 0;
    border: 0;
    border-radius: 0;
    color: #fff;
    z-index: 20;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.article-editor-action-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
    padding: 0 0.75rem;
}

.article-editor-action-bar__left,
.article-editor-action-bar__right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.article-editor-action-bar__left {
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    max-width: min(100%, 58vw);
}

.article-editor-action-bar__right {
    flex: 0 0 auto;
}

.article-editor-action-bar__siblings {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

/* E162 quality badge (action bar + list) — click opens détail page (S13) */
.article-quality-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-inline-start: 0.25rem;
    text-decoration: none;
}

.article-quality-badge:hover,
.article-quality-badge:focus-visible {
    text-decoration: none;
    filter: brightness(1.08);
}

.article-quality-badge__summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.35rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    user-select: none;
}

.article-quality-badge--pending {
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: 0.35rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
}

.article-quality-badge--gold .article-quality-badge__summary {
    background: linear-gradient(135deg, #c9a227 0%, #f5d76e 45%, #b8860b 100%);
    border-color: #ffe9a0;
    color: #1a1400;
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.35);
}

.article-quality-badge--green .article-quality-badge__summary {
    background: rgba(25, 135, 84, 0.85);
    border-color: rgba(144, 238, 144, 0.7);
}

.article-quality-badge--orange .article-quality-badge__summary {
    background: rgba(253, 126, 20, 0.9);
    border-color: rgba(255, 193, 7, 0.75);
}

.article-quality-badge--red .article-quality-badge__summary {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(255, 180, 180, 0.7);
}

.article-quality-badge__gold-label {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-inline-end: 0.15rem;
}

.article-quality-badge__denom {
    font-weight: 500;
    opacity: 0.85;
    font-size: 0.7rem;
}

.article-quality-badge--compact .article-quality-badge__summary,
.article-quality-badge--compact.article-quality-badge--pending {
    padding: 0.05rem 0.3rem;
    font-size: 0.7rem;
}

.article-quality-badge--compact .article-quality-badge__gold-label {
    display: none;
}

.article-quality-badge--compact .article-quality-badge__denom {
    display: none;
}

.site-content .editor-article-list__locale-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    vertical-align: middle;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge {
    margin-inline-start: 0;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge__summary {
    min-width: 1.5rem;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    padding: 0.12rem 0.28rem;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge--pending {
    color: #6c757d;
    border: 1px dashed rgba(0, 0, 0, 0.25);
    border-style: dashed;
    background: #f8f9fa;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge--gold .article-quality-badge__summary {
    color: #1a1400;
    background: linear-gradient(135deg, #c9a227 0%, #f5d76e 45%, #b8860b 100%);
    border-color: #b8860b;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge--green .article-quality-badge__summary {
    color: #fff;
    background: #198754;
    border-color: #146c43;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge--orange .article-quality-badge__summary {
    color: #fff;
    background: #fd7e14;
    border-color: #dc6502;
}

.site-content .editor-article-list__locale-wrap .article-quality-badge--red .article-quality-badge__summary {
    color: #fff;
    background: #dc3545;
    border-color: #b02a37;
}

.article-quality-report__excerpt {
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.35rem;
    padding: 0.35rem 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 36rem;
}

.article-editor-action-bar__btn--sibling {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex: 0 0 auto;
    padding-inline: 0.45rem;
}

.article-editor-action-bar__sibling-short {
    display: none;
}

@media (max-width: 991.98px) {
    .article-editor-action-bar__left {
        max-width: min(100%, 52vw);
    }

    .article-editor-action-bar__sibling-full {
        display: none;
    }

    .article-editor-action-bar__sibling-short {
        display: inline;
        font-weight: 600;
        letter-spacing: 0.02em;
    }

    .article-editor-action-bar__btn--sibling {
        min-width: 2.25rem;
        justify-content: center;
        padding-inline: 0.35rem;
    }
}

.article-editor-action-bar__btn {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: transparent;
    line-height: 1.2;
}

.article-editor-action-bar__btn:hover,
.article-editor-action-bar__btn:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.55);
}

.article-editor-action-bar__btn--primary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
}

.article-editor-action-bar__btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-width: 2rem;
    padding-inline: 0;
}

.article-editor-action-bar__btn:disabled,
.article-editor-action-bar__btn[disabled] {
    opacity: 0.45;
    pointer-events: none;
}

html:not([data-theme="dark"]) .article-editor-action-bar,
body:not(.dark-mode):not([data-theme="dark"]) .article-editor-action-bar {
    background: radial-gradient(ellipse at bottom, #87CEFA 0%, #1E90FF 100%);
}

html[data-theme="dark"] .article-editor-action-bar,
body.dark-mode .article-editor-action-bar,
body[data-theme="dark"] .article-editor-action-bar {
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.article-editor-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    gap: 0;
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.site-content .article-editor-layout {
    align-items: flex-start;
}

.article-editor-writing-mode .site-content {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    /* Beat Bootstrap utility pb-5 (!important) on <main> */
    padding: 0 !important;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Flash must not reserve space above the action bar (empty root has Twig whitespace). */
.article-editor-writing-mode .site-content > .site-flash-messages {
    position: absolute;
    top: var(--article-action-bar-height, 2.75rem);
    left: 0;
    right: 0;
    z-index: 40;
    margin: 0 !important;
    padding: 0.5rem 0.75rem 0;
    flex: none;
    height: 0;
    overflow: visible;
    pointer-events: none;
}

.article-editor-writing-mode .site-content > .site-flash-messages:has(.alert) {
    height: auto;
}

.article-editor-writing-mode .site-content > .site-flash-messages .alert {
    pointer-events: auto;
}

.article-editor-writing-mode .site-content .article-editor-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    /* Explicitly reserve the top action bar — never size to full 100dvh */
    flex: 1 1 0%;
    min-height: 0;
    height: calc(100dvh - var(--article-action-bar-height));
    max-height: calc(100dvh - var(--article-action-bar-height));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.article-editor-writing-mode .dashboard-help-trigger {
    top: 0.35rem;
    right: 0.5rem;
    z-index: 40;
    background: rgba(255, 255, 255, 0.85);
}

body[data-theme="dark"] .article-editor-writing-mode .dashboard-help-trigger,
body.dark-mode .article-editor-writing-mode .dashboard-help-trigger {
    background: rgba(20, 32, 51, 0.75);
}

.article-editor-writing-mode .site-content #article-editor-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.article-editor-writing-mode .site-content .article-editor-layout {
    margin: 0;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    flex: 1 1 0%;
    /* height:0 + flex:1 forces fill of the panel even if form has extra siblings */
    height: 0;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.site-content .article-editor-main {
    min-width: 0;
}

.article-editor-writing-mode .site-content .article-editor-main {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.article-editor-writing-mode .site-content .article-editor-main > .row {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-editor-writing-mode .site-content .article-body-editor {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.article-editor-writing-mode .site-content .article-body-editor > .mb-3,
.article-editor-writing-mode .site-content .article-body-editor > div {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin: 0 !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-editor-writing-mode .site-content .article-body-editor .form-text,
.article-editor-writing-mode .site-content .article-body-editor .help-text,
.article-editor-writing-mode .site-content .article-body-editor .editor-statusbar {
    display: none !important;
}

/*
 * Native textarea fallback (before EasyMDE mounts, or if CDN fails):
 * fill the writing column flush to the bottom — no manual resize needed.
 */
.article-editor-writing-mode .site-content .article-body-editor textarea.markdown-editor {
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0.75rem 1rem;
    resize: none;
    border-radius: 0;
    box-sizing: border-box;
}

.article-editor-writing-mode .site-content .article-body-editor .EasyMDEContainer {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    overflow: hidden;
}

.article-editor-writing-mode .site-content .article-body-editor .editor-toolbar {
    flex: 0 0 auto;
}

/*
 * Fill remaining height under the EasyMDE toolbar via fitEditorHeight(setSize).
 * Avoid height:* !important here — it defeats cm.setSize() inline height.
 */
.article-editor-writing-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror {
    flex: 1 1 0%;
    min-height: 0 !important;
    max-height: 100%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    margin: 0;
    border-radius: 0;
    overflow: hidden !important;
}

/*
 * CodeMirror 5 hides the native scrollbar with a negative margin-right and draws
 * .CodeMirror-vscrollbar instead. Our flush-bottom rule zeros that margin, which
 * exposed BOTH bars. Keep margin/padding flush and hide the fake CM bars so only
 * the native .CodeMirror-scroll scrollbar remains.
 */
.article-editor-writing-mode .site-content .article-body-editor .CodeMirror-vscrollbar,
.article-editor-writing-mode .site-content .article-body-editor .CodeMirror-hscrollbar,
.article-editor-writing-mode .site-content .article-body-editor .CodeMirror-scrollbar-filler,
.article-editor-writing-mode .site-content .article-body-editor .CodeMirror-gutter-filler {
    display: none !important;
}

.article-editor-writing-mode .site-content .article-body-editor .CodeMirror-scroll {
    min-height: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    margin-right: 0 !important;
    overflow: auto !important;
}

.article-editor-writing-mode .site-content .article-body-editor .CodeMirror-sizer {
    margin-bottom: 0 !important;
    border-right-width: 0 !important;
}

.article-editor-writing-mode .site-content .article-body-editor .EasyMDEContainer,
.article-editor-writing-mode .site-content .article-body-editor .editor-toolbar,
.article-editor-writing-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror {
    border-radius: 0;
}

.article-editor-writing-mode .site-content .article-body-editor .editor-toolbar {
    border-top: 0;
}

.site-content .article-editor-sidebar {
    min-width: 0;
    align-self: stretch;
}

.article-editor-writing-mode .site-content .article-editor-sidebar {
    height: 100%;
    max-height: 100%;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.site-content .article-editor-splitter {
    display: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(20, 32, 51, 0.14);
}

.site-content .article-editor-splitter:focus-visible {
    outline: 2px solid #1E90FF;
    outline-offset: 1px;
}

.site-content .article-editor-sidebar-inner {
    width: 100%;
    position: sticky;
    top: 0;
    height: 100%;
    max-height: none;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    background: rgba(20, 32, 51, 0.02);
    border-radius: 0 !important;
    margin-top: 0;
}

.article-editor-writing-mode .site-content .article-editor-sidebar-inner {
    position: relative;
    top: auto;
    height: auto;
    min-height: 100%;
    overflow: visible;
    /* Override Bootstrap p-3 so the pane sits flush under the action bar */
    padding: 0.75rem 0.75rem 1rem !important;
    border-radius: 0 !important;
    border-top: 0 !important;
}

.site-content .article-editor-main-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.site-content .article-editor-main-hint {
    margin: 0;
    font-size: 0.9rem;
    color: #5a6578;
}

.site-content .article-sidebar-section + .article-sidebar-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(20, 32, 51, 0.12);
}

.site-content .article-editor-sidebar-accordion + .article-sidebar-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(20, 32, 51, 0.12);
}

.site-content .article-sidebar-section-title {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.site-content .article-sidebar-actions {
    margin-top: 1.25rem;
}

.site-content .article-media-sidebar-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-content .article-media-inline-width__range {
    width: 100%;
}

.site-content .article-media-inline-width__value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.site-content .article-attachment-sidebar-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-content .article-attachment {
    margin: 1rem 0;
}

.site-content .article-attachment__caption,
.site-content .article-attachment__name {
    font-weight: 600;
}

.site-content .article-attachment__size {
    color: rgba(20, 32, 51, 0.65);
    font-size: 0.9em;
}

.site-content .article-attachment__player {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
}

.site-content .article-attachment--document {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(20, 32, 51, 0.12);
    border-radius: 0.35rem;
    background: rgba(20, 32, 51, 0.03);
}

.media-library-card__file {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 9rem;
    background: rgba(20, 32, 51, 0.06);
}

.media-library-card__file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background: #142033;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}

.media-library-card__kind {
    align-self: flex-start;
    font-weight: 500;
}

.site-content [data-youtube-tools="1"] .form-control-sm {
    font-size: 0.875rem;
}

.site-content #article-media-picker-modal .card-img-top,
.site-content #series-cover-picker-modal .card-img-top {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.site-content .article-media-picker-modal__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--bs-modal-bg, #fff);
    border-top: 1px solid rgba(20, 32, 51, 0.12);
}

.site-content .article-media-picker-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 2px solid rgba(20, 32, 51, 0.12);
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.65);
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-content .article-media-picker-card:hover,
.site-content .article-media-picker-card:focus-visible {
    border-color: rgba(30, 144, 255, 0.55);
    box-shadow: 0 0 0 0.15rem rgba(30, 144, 255, 0.15);
    outline: none;
}

.site-content .article-media-picker-card--selected {
    border-color: rgba(30, 144, 255, 0.9);
    box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.2);
}

.site-content .article-media-picker-card__img-wrap {
    display: block;
    aspect-ratio: 16 / 9;
    background: rgba(20, 32, 51, 0.05);
}

.site-content .article-media-picker-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-content .article-media-picker-card__meta {
    display: block;
    padding: 0.35rem 0.45rem 0.5rem;
}

.site-content .article-media-picker-detail__img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    background: rgba(20, 32, 51, 0.04);
    border-radius: 0.35rem;
}

.site-content .article-attachment-picker-modal__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--bs-modal-bg, #fff);
    border-top: 1px solid rgba(20, 32, 51, 0.12);
}

.site-content .article-attachment-picker-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    min-height: 5.5rem;
    padding: 0.55rem 0.65rem;
    border: 2px solid rgba(20, 32, 51, 0.12);
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.65);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-content .article-attachment-picker-card:hover,
.site-content .article-attachment-picker-card:focus-visible {
    border-color: rgba(30, 144, 255, 0.55);
    box-shadow: 0 0 0 0.15rem rgba(30, 144, 255, 0.15);
    outline: none;
}

.site-content .article-attachment-picker-card--selected {
    border-color: rgba(30, 144, 255, 0.9);
    box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.2);
}

.site-content .article-attachment-picker-card__kind {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: rgba(20, 32, 51, 0.65);
}

.site-content .article-attachment-picker-card__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 600;
    word-break: break-word;
}

.site-content .article-attachment-picker-card__meta {
    margin-top: auto;
}

.site-content .article-cover-preview__thumb {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 16 / 9;
    border-radius: 0.35rem;
    overflow: hidden;
    background: rgba(20, 32, 51, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.site-content .article-cover-preview__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-content .article-media-quick-upload__summary {
    cursor: pointer;
    list-style-position: outside;
}

.site-content .article-media-quick-upload[open] > .article-media-quick-upload__summary {
    margin-bottom: 0.75rem;
}

.site-content .article-editor-sidebar .form-text {
    font-size: 0.8rem;
}

.site-content .article-editor-panels-accordion {
    --bs-accordion-border-width: 1px;
    --bs-accordion-border-color: rgba(20, 32, 51, 0.12);
    --bs-accordion-btn-padding-x: 0.75rem;
    --bs-accordion-btn-padding-y: 0.55rem;
    --bs-accordion-body-padding-x: 0.75rem;
    --bs-accordion-body-padding-y: 0.75rem;
}

.site-content .article-editor-panel-item {
    border: 1px solid rgba(20, 32, 51, 0.12);
    border-radius: 0.35rem;
    margin-bottom: 0.45rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.35);
}

.site-content .article-editor-panel-item .accordion-button {
    font-size: 0.9rem;
    font-weight: 650;
    box-shadow: none;
    background: rgba(20, 32, 51, 0.04);
}

.site-content .article-editor-panel-item .accordion-button:not(.collapsed) {
    background: rgba(30, 144, 255, 0.12);
    color: inherit;
}

.site-content .article-editor-media-l2-accordion {
    --bs-accordion-border-width: 1px;
    --bs-accordion-border-color: rgba(20, 32, 51, 0.1);
    --bs-accordion-btn-padding-x: 0.65rem;
    --bs-accordion-btn-padding-y: 0.45rem;
    --bs-accordion-body-padding-x: 0.65rem;
    --bs-accordion-body-padding-y: 0.65rem;
}

.site-content .article-editor-media-l2-item {
    border: 1px solid rgba(20, 32, 51, 0.1);
    border-radius: 0.3rem;
    margin-bottom: 0.35rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.55);
}

.site-content .article-editor-media-l2-item .accordion-button {
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: none;
    background: rgba(20, 32, 51, 0.03);
}

.site-content .article-editor-media-l2-item .accordion-button:not(.collapsed) {
    background: rgba(30, 144, 255, 0.1);
    color: inherit;
}

.site-content .article-editor-media-l2-body {
    padding-top: 0.15rem;
}

.site-content .article-taxonomy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.site-content .article-taxonomy-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.site-content .article-taxonomy-suggestions {
    max-height: 14rem;
    overflow-y: auto;
    z-index: 5;
    position: relative;
}

.site-content .article-taxonomy-select-row {
    display: none !important;
}

.site-content .article-editor-sidebar-accordion {
    --bs-accordion-border-width: 0;
    --bs-accordion-border-radius: 0;
    --bs-accordion-inner-border-radius: 0;
    --bs-accordion-btn-padding-x: 0.85rem;
    --bs-accordion-btn-padding-y: 0.7rem;
    --bs-accordion-body-padding-x: 0;
    --bs-accordion-body-padding-y: 0;
}

.site-content .article-editor-sidebar-accordion-item {
    background: transparent;
    border: 0;
}

.site-content .article-editor-sidebar-mobile-toggle .accordion-button {
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: none;
    border-radius: 0.4rem !important;
    background: rgba(20, 32, 51, 0.05);
    color: inherit;
}

.site-content .article-editor-sidebar-mobile-toggle .accordion-button:not(.collapsed) {
    background: rgba(30, 144, 255, 0.12);
    color: inherit;
    box-shadow: none;
}

.site-content .article-editor-sidebar-mobile-toggle .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.25);
}

.site-content .article-editor-sidebar-mobile-toggle .accordion-button::after {
    margin-left: auto;
}

@media (min-width: 1200px) {
    .site-content .article-editor-layout {
        display: grid;
        grid-template-columns: minmax(420px, 1fr) 4px minmax(360px, 42vw);
        gap: 0;
        align-items: stretch;
        height: 100%;
        overflow: hidden;
    }

    .site-content .article-editor-splitter {
        display: block;
        width: 4px;
        min-height: 100%;
        align-self: stretch;
        justify-self: center;
        cursor: col-resize;
        touch-action: none;
    }

    .site-content .article-editor-splitter:hover,
    .site-content .article-editor-splitter:focus-visible,
    .site-content .article-editor-layout.is-resizing .article-editor-splitter {
        background: rgba(30, 144, 255, 0.45);
    }

    /* Desktop: no accordion chrome; settings always expanded. */
    .site-content .article-editor-sidebar-mobile-toggle {
        display: none !important;
    }

    .site-content .article-editor-sidebar-collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }

    .site-content .article-editor-sidebar-collapse-body {
        padding: 0;
    }
}

@media (max-width: 1199.98px) {
    /*
     * E128-S03: let the action bar wrap / grow so primary actions stay reachable.
     * Do not reorder buttons — only spacing and overflow. Desktop (< this query) stays fixed-height.
     */
    .article-editor-action-bar {
        height: auto;
        min-height: var(--article-action-bar-height);
        max-height: none;
        overflow: visible;
    }

    .article-editor-action-bar__inner {
        flex-wrap: wrap;
        align-items: center;
        height: auto;
        min-height: var(--article-action-bar-height);
        padding-block: 0.35rem;
        row-gap: 0.35rem;
    }

    .article-editor-action-bar__left,
    .article-editor-action-bar__right {
        flex-wrap: wrap;
        row-gap: 0.3rem;
    }

    .article-editor-action-bar__left {
        max-width: 100%;
        overflow-x: visible;
        flex: 1 1 auto;
    }

    .article-editor-action-bar__right {
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    .article-editor-action-bar__siblings {
        flex-wrap: wrap;
        row-gap: 0.3rem;
    }

    /* Mobile: stack sidebar above Markdown; unlock page scroll (writing mode). */
    html:has(body.article-editor-writing-mode),
    body.article-editor-writing-mode {
        height: auto;
        max-height: none;
        overflow: auto;
    }

    .article-editor-writing-mode .site-content {
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
    }

    .article-editor-writing-mode .site-content .article-editor-panel,
    .article-editor-writing-mode .site-content #article-editor-form {
        display: block;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        flex: none;
    }

    .article-editor-action-bar {
        position: sticky;
        top: 0;
    }

    .article-editor-shell {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .article-editor-writing-mode .site-content .article-editor-layout,
    .site-content .article-editor-layout {
        display: flex;
        flex-direction: column;
        flex: none;
        flex-wrap: nowrap;
        align-items: stretch;
        grid-template-columns: none !important;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .site-content .article-editor-splitter {
        display: none !important;
    }

    .article-editor-writing-mode .site-content .article-editor-sidebar {
        order: -1;
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 0 0.75rem;
    }

    .site-content .article-editor-sidebar-inner,
    .article-editor-writing-mode .site-content .article-editor-sidebar-inner {
        position: static;
        top: auto;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding: 0.75rem !important;
        border-top: 0 !important;
    }

    .site-content .article-editor-sidebar-desktop-title {
        display: none !important;
    }

    .site-content .article-editor-sidebar-collapse-body {
        padding-top: 0.85rem;
    }

    .article-editor-writing-mode .site-content .article-editor-main {
        order: 0;
        height: auto;
        min-height: min(60vh, 28rem);
        overflow: visible;
        padding: 0 0.75rem 0;
        margin: 0;
        display: block;
    }

    .article-editor-writing-mode .site-content .article-editor-main > .row,
    .article-editor-writing-mode .site-content .article-body-editor,
    .article-editor-writing-mode .site-content .article-body-editor > .mb-3,
    .article-editor-writing-mode .site-content .article-body-editor > div,
    .article-editor-writing-mode .site-content .article-body-editor .EasyMDEContainer {
        height: auto;
        min-height: 0;
        display: block;
        flex: none;
    }

    .article-editor-writing-mode .site-content .article-body-editor textarea.markdown-editor {
        height: auto !important;
        min-height: 18rem !important;
        resize: vertical;
    }

    .article-editor-writing-mode .site-content .article-body-editor .EasyMDEContainer .CodeMirror {
        min-height: 18rem !important;
        height: auto !important;
        flex: none;
    }

    /*
     * EasyMDE only hides .no-mobile below 700px. On tablet (700–1199) side-by-side /
     * fullscreen stay available and paint a fixed half-screen preview (top:50px) that
     * ignores the action bar + « Paramètres » accordion above the writer (E45-S06).
     * Note: EasyMDE puts non-fa className tokens (incl. no-mobile) on the <button>.
     */
    .article-editor-writing-mode .article-body-editor .editor-toolbar button.no-mobile,
    .article-editor-writing-mode .article-body-editor .editor-toolbar .no-mobile {
        display: none !important;
    }

    .article-editor-writing-mode .article-body-editor .editor-preview-side,
    .article-editor-writing-mode .article-body-editor .editor-preview-active-side {
        display: none !important;
    }

    .article-editor-writing-mode .article-body-editor .CodeMirror-sided {
        width: 100% !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        height: auto !important;
    }
}

body[data-theme="dark"] .site-content .article-editor-sidebar-inner,
body.dark-mode .site-content .article-editor-sidebar-inner {
    background: #151b26;
    border-color: rgba(232, 238, 247, 0.22);
    color: #e8eef7;
}

body[data-theme="dark"] .site-content .article-editor-splitter,
body.dark-mode .site-content .article-editor-splitter {
    background: rgba(232, 238, 247, 0.28);
}

body[data-theme="dark"] .site-content .article-sidebar-section + .article-sidebar-section,
body.dark-mode .site-content .article-sidebar-section + .article-sidebar-section,
body[data-theme="dark"] .site-content .article-editor-sidebar-accordion + .article-sidebar-actions,
body.dark-mode .site-content .article-editor-sidebar-accordion + .article-sidebar-actions {
    border-top-color: rgba(232, 238, 247, 0.16);
}

body[data-theme="dark"] .site-content .article-editor-sidebar-mobile-toggle .accordion-button,
body.dark-mode .site-content .article-editor-sidebar-mobile-toggle .accordion-button {
    background: #2c3444;
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .article-editor-sidebar-mobile-toggle .accordion-button:not(.collapsed),
body.dark-mode .site-content .article-editor-sidebar-mobile-toggle .accordion-button:not(.collapsed) {
    background: #1a5a9c;
    color: #ffffff;
}

body[data-theme="dark"] .site-content .article-editor-sidebar-desktop-title,
body.dark-mode .site-content .article-editor-sidebar-desktop-title {
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .article-editor-panels-accordion,
body.dark-mode .site-content .article-editor-panels-accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-color: #e8eef7;
    --bs-accordion-border-color: rgba(232, 238, 247, 0.28);
    --bs-accordion-btn-color: #f3f6fb;
    --bs-accordion-btn-bg: rgba(232, 238, 247, 0.12);
    --bs-accordion-active-color: #ffffff;
    --bs-accordion-active-bg: rgba(30, 144, 255, 0.32);
    --bs-accordion-btn-focus-border-color: rgba(110, 186, 255, 0.7);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.28);
}

body[data-theme="dark"] .site-content .article-editor-panel-item,
body.dark-mode .site-content .article-editor-panel-item {
    border-color: rgba(232, 238, 247, 0.32);
    background: #121722;
}

body[data-theme="dark"] .site-content .article-editor-panel-item .accordion-button,
body.dark-mode .site-content .article-editor-panel-item .accordion-button {
    background: #2c3444;
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .article-editor-panel-item .accordion-button:hover,
body.dark-mode .site-content .article-editor-panel-item .accordion-button:hover {
    background: #3a4356;
    color: #ffffff;
}

body[data-theme="dark"] .site-content .article-editor-panel-item .accordion-button:not(.collapsed),
body.dark-mode .site-content .article-editor-panel-item .accordion-button:not(.collapsed) {
    background: #1a5a9c;
    color: #ffffff;
}

body[data-theme="dark"] .site-content .article-editor-panel-item .accordion-button:focus,
body.dark-mode .site-content .article-editor-panel-item .accordion-button:focus {
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.28);
}

body[data-theme="dark"] .site-content .article-editor-panel-body,
body.dark-mode .site-content .article-editor-panel-body {
    color: #e8eef7;
    background: #0e131c;
}

body[data-theme="dark"] .site-content .article-editor-sidebar .form-label,
body.dark-mode .site-content .article-editor-sidebar .form-label {
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .article-editor-sidebar .form-text,
body[data-theme="dark"] .site-content .article-editor-sidebar .help,
body[data-theme="dark"] .site-content .article-editor-sidebar .text-muted,
body.dark-mode .site-content .article-editor-sidebar .form-text,
body.dark-mode .site-content .article-editor-sidebar .help,
body.dark-mode .site-content .article-editor-sidebar .text-muted {
    color: #cdd5e0 !important;
}

body[data-theme="dark"] .site-content .article-editor-sidebar .form-control,
body.dark-mode .site-content .article-editor-sidebar .form-control,
body[data-theme="dark"] .site-content .article-editor-sidebar .form-select,
body.dark-mode .site-content .article-editor-sidebar .form-select {
    color: #f3f6fb;
    background-color: #0a0e16;
    border-color: rgba(232, 238, 247, 0.42);
}

body[data-theme="dark"] .site-content .article-editor-sidebar a,
body.dark-mode .site-content .article-editor-sidebar a {
    color: #8ec9ff;
}

body[data-theme="dark"] .site-content .article-editor-sidebar a:hover,
body[data-theme="dark"] .site-content .article-editor-sidebar a:focus,
body.dark-mode .site-content .article-editor-sidebar a:hover,
body.dark-mode .site-content .article-editor-sidebar a:focus {
    color: #c5e3ff;
}

body[data-theme="dark"] .site-content .article-editor-sidebar .btn-outline-primary,
body.dark-mode .site-content .article-editor-sidebar .btn-outline-primary {
    background-color: #1a5a9c !important;
    border-color: #7ec4ff !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .site-content .article-editor-sidebar .btn-outline-primary:hover,
body[data-theme="dark"] .site-content .article-editor-sidebar .btn-outline-primary:focus,
body.dark-mode .site-content .article-editor-sidebar .btn-outline-primary:hover,
body.dark-mode .site-content .article-editor-sidebar .btn-outline-primary:focus {
    background: #1e90ff !important;
    border-color: #1e90ff !important;
    color: #fff !important;
}

body[data-theme="dark"] .site-content .article-editor-media-l2-accordion,
body.dark-mode .site-content .article-editor-media-l2-accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-color: #e8eef7;
    --bs-accordion-border-color: rgba(232, 238, 247, 0.24);
    --bs-accordion-btn-color: #f3f6fb;
    --bs-accordion-btn-bg: rgba(232, 238, 247, 0.1);
    --bs-accordion-active-color: #ffffff;
    --bs-accordion-active-bg: rgba(30, 144, 255, 0.28);
}

body[data-theme="dark"] .site-content .article-editor-media-l2-item,
body.dark-mode .site-content .article-editor-media-l2-item {
    border-color: rgba(232, 238, 247, 0.28);
    background: #161c28;
}

body[data-theme="dark"] .site-content .article-editor-media-l2-item .accordion-button,
body.dark-mode .site-content .article-editor-media-l2-item .accordion-button {
    background: #2c3444;
    color: #f3f6fb;
}

body[data-theme="dark"] .site-content .article-editor-media-l2-item .accordion-button:not(.collapsed),
body.dark-mode .site-content .article-editor-media-l2-item .accordion-button:not(.collapsed) {
    background: #1a5a9c;
    color: #ffffff;
}

body[data-theme="dark"] .site-content .article-editor-media-l2-body,
body.dark-mode .site-content .article-editor-media-l2-body {
    color: #e8eef7;
    background: #0e131c;
}

body[data-theme="dark"] .site-content .article-attachment__size,
body.dark-mode .site-content .article-attachment__size {
    color: rgba(232, 238, 247, 0.78);
}

body[data-theme="dark"] .site-content .article-attachment--document,
body.dark-mode .site-content .article-attachment--document {
    border-color: rgba(232, 238, 247, 0.22);
    background: rgba(232, 238, 247, 0.06);
    color: #e8eef7;
}

/* E32-S08 — admin analytics charts */
.analytics-trend {
    width: 100%;
    min-height: 240px;
}

.analytics-trend__canvas {
    display: block;
    width: 100%;
    height: 240px;
}

.analytics-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.analytics-bar__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.analytics-bar__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
    font-size: 0.875rem;
}

.analytics-bar__value {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}

.analytics-bar__track {
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.12);
    overflow: hidden;
}

.analytics-bar__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--bs-primary, #0d6efd);
    transition: width 0.35s ease;
}

.analytics-bar__fill--accent {
    background: var(--bs-success, #198754);
}

.analytics-bar__fill--warn {
    background: var(--bs-warning, #ffc107);
}

body[data-theme="dark"] .analytics-bar__track,
body.dark-mode .analytics-bar__track {
    background: rgba(232, 238, 247, 0.1);
}

.analytics-compare-card {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
    height: 100%;
    background: rgba(13, 110, 253, 0.04);
}

.analytics-compare-card--prev {
    background: rgba(108, 117, 125, 0.08);
}

body[data-theme="dark"] .analytics-compare-card,
body.dark-mode .analytics-compare-card {
    background: rgba(13, 110, 253, 0.12);
}

body[data-theme="dark"] .analytics-compare-card--prev,
body.dark-mode .analytics-compare-card--prev {
    background: rgba(232, 238, 247, 0.06);
}

/* E34-S10 — category hub reorder + locale badges */
.blog-category-hub__row .btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}
.blog-category-hub__locales .badge {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
}
.blog-category-hub__actions form {
    margin: 0;
}

/* E19 — first-install setup: compact centered two-column form */
.setup-page {
    width: min(56rem, 100%);
    margin-inline: auto;
}

.setup-page__hero {
    text-align: center;
    margin-bottom: 1.35rem;
}

.setup-page__hero h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #142033;
    line-height: 1.2;
}

.setup-page__hero p {
    margin: 0.65rem auto 0;
    max-width: 36rem;
    color: #5a6578;
    font-size: 1.02rem;
}

body[data-theme="dark"] .setup-page__hero h1,
body.dark-mode .setup-page__hero h1 {
    color: #f3f6fb;
}

body[data-theme="dark"] .setup-page__hero p,
body.dark-mode .setup-page__hero p {
    color: rgba(255, 255, 255, 0.72);
}

.setup-page__card {
    margin-inline: auto;
}

.setup-readiness-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.15rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(20, 32, 51, 0.1);
    border-radius: 0.65rem;
    background: rgba(20, 32, 51, 0.03);
}

.setup-readiness-bar__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    font-size: 0.95rem;
    color: #142033;
}

body[data-theme="dark"] .setup-readiness-bar,
body.dark-mode .setup-readiness-bar {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .setup-readiness-bar__summary,
body.dark-mode .setup-readiness-bar__summary {
    color: rgba(255, 255, 255, 0.88);
}

.setup-form__fieldset {
    min-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.setup-form__fieldset legend {
    margin-bottom: 0.35rem;
    float: none;
    width: auto;
    font-size: 1.1rem;
    font-weight: 650;
}

.setup-form__actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(20, 32, 51, 0.08);
}

.setup-backup-confirm {
    margin-top: 0.35rem;
    padding: 0.85rem 0.95rem;
    border: 1px dashed rgba(196, 137, 14, 0.45);
    border-radius: 0.65rem;
    background: rgba(255, 193, 7, 0.08);
}

.setup-backup-confirm[hidden] {
    display: none !important;
}

body[data-theme="dark"] .setup-backup-confirm,
body.dark-mode .setup-backup-confirm {
    border-color: rgba(255, 193, 7, 0.35);
    background: rgba(255, 193, 7, 0.1);
}

body[data-theme="dark"] .setup-form__actions,
body.dark-mode .setup-form__actions {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.setup-readiness-list__item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.setup-readiness-list__item:last-child {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .setup-form__columns > [class*="col-"] + [class*="col-"] {
        padding-top: 0.25rem;
        border-top: 1px solid rgba(20, 32, 51, 0.08);
    }

    body[data-theme="dark"] .setup-form__columns > [class*="col-"] + [class*="col-"],
    body.dark-mode .setup-form__columns > [class*="col-"] + [class*="col-"] {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* E83 — editorial publication calendar */
.site-content .editor-calendar__week,
.site-content .editor-calendar__month {
    table-layout: fixed;
}

.site-content .editor-calendar__day-head,
.site-content .editor-calendar__month-head {
    text-align: center;
    font-size: 0.85rem;
    white-space: nowrap;
}

.site-content .editor-calendar__lane-head,
.site-content .editor-calendar__lane-label {
    width: 3.25rem;
    text-align: center;
    vertical-align: top;
    font-weight: 700;
}

.site-content .editor-calendar__week-cell,
.site-content .editor-calendar__month-cell {
    vertical-align: top;
    min-height: 4.5rem;
    padding: 0.35rem;
}

.site-content .editor-calendar__month-cell.is-outside {
    background: rgba(0, 0, 0, 0.03);
}

.site-content .editor-calendar__month-day {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.site-content .editor-calendar__event {
    display: block;
    margin-bottom: 0.35rem;
    padding: 0.25rem 0.35rem;
    border-radius: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.25;
    text-decoration: none;
    border-left: 3px solid transparent;
    background: rgba(13, 110, 253, 0.06);
    color: inherit;
}

.site-content .editor-calendar__event:hover {
    background: rgba(13, 110, 253, 0.12);
    text-decoration: none;
}

.site-content .editor-calendar__event--fr {
    border-left-color: #0d6efd;
}

.site-content .editor-calendar__event--en {
    border-left-color: #198754;
}

.site-content .editor-calendar__event--lt {
    border-left-color: #fd7e14;
}

.site-content .editor-calendar__event--nb {
    border-left-color: #0dcaf0;
}

.site-content .editor-calendar__event--scheduled {
    font-style: italic;
}

.site-content .editor-calendar__event.is-draggable {
    cursor: grab;
}

.site-content .editor-calendar__event.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.site-content .editor-calendar__drop-cell.is-drop-target {
    outline: 2px dashed var(--bs-primary, #0d6efd);
    outline-offset: -2px;
    background: rgba(13, 110, 253, 0.06);
}

.site-content .editor-calendar__event-time {
    font-weight: 600;
    margin-right: 0.25rem;
}

.site-content .editor-calendar__event-locale {
    font-weight: 700;
    margin-right: 0.25rem;
}

.site-content .editor-calendar__event-title {
    word-break: break-word;
}

.site-content .editor-calendar__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.site-content .editor-calendar__legend-item::before {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.15rem;
    background: #6c757d;
}

.site-content .editor-calendar__legend-item--fr::before {
    background: #0d6efd;
}

.site-content .editor-calendar__legend-item--en::before {
    background: #198754;
}

.site-content .editor-calendar__legend-item--lt::before {
    background: #fd7e14;
}

.site-content .editor-calendar__legend-item--nb::before {
    background: #0dcaf0;
}

.site-content .editor-calendar__legend-item--scheduled::before {
    background: transparent;
    border: 2px dashed #6c757d;
}

.site-content .editor-calendar__legend-item--published::before {
    background: #6c757d;
}

[data-bs-theme='dark'] .site-content .editor-calendar__month-cell.is-outside {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme='dark'] .site-content .editor-calendar__event {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme='dark'] .site-content .editor-calendar__event:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* E90 — shared AI wait overlay (StuBlogAiWait; indeterminate or determinate fill) */
.stu-ai-wait-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    pointer-events: all;
}

.stu-ai-wait-overlay[hidden] {
    display: none !important;
}

.stu-ai-wait-overlay__panel {
    width: min(28rem, calc(100vw - 2rem));
    padding: 1.25rem 1.5rem;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    outline: none;
}

.stu-ai-wait-overlay__panel:focus {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(13, 110, 253, 0.45);
}

body[data-theme='dark'] .stu-ai-wait-overlay__panel,
body.dark-mode .stu-ai-wait-overlay__panel,
[data-bs-theme='dark'] .stu-ai-wait-overlay__panel {
    background: #1e293b;
    color: #e2e8f0;
}

.stu-ai-wait-overlay__bar {
    height: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #94a3b8 0%, #0d6efd 40%, #94a3b8 80%);
    background-size: 200% 100%;
    animation: stu-ai-wait-indeterminate 1.2s linear infinite;
}

.stu-ai-wait-overlay__bar.is-determinate {
    animation: none;
    background: #0d6efd;
    background-size: auto;
    max-width: 100%;
    transition: width 0.2s ease-out;
}

/* E90-S07: media query + JS class (testable / forced) — static bar, no pulse */
.stu-ai-wait-overlay--reduced-motion .stu-ai-wait-overlay__bar {
    animation: none;
    background: #0d6efd;
}

.stu-ai-wait-overlay--reduced-motion .stu-ai-wait-overlay__bar.is-determinate {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .stu-ai-wait-overlay__bar {
        animation: none;
        background: #0d6efd;
    }

    .stu-ai-wait-overlay__bar.is-determinate {
        transition: none;
    }
}

@keyframes stu-ai-wait-indeterminate {
    from {
        background-position: 100% 0;
    }
    to {
        background-position: -100% 0;
    }
}

.stu-ai-wait-overlay__status {
    margin: 0.85rem 0 0;
    font-size: 0.95rem;
    text-align: center;
}

.stu-ai-wait-overlay__elapsed {
    margin: 0.45rem 0 0;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    opacity: 0.85;
    font-weight: 600;
}

.stu-ai-wait-overlay__force-wrap {
    margin: 0.85rem 0 0;
    text-align: center;
}

.stu-ai-wait-overlay__force-wrap[hidden] {
    display: none !important;
}

.stu-ai-wait-overlay__force {
    max-width: 100%;
}

.stu-ai-usage-recap__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme='dark'] .stu-ai-usage-recap__row,
body.dark-mode .stu-ai-usage-recap__row,
[data-bs-theme='dark'] .stu-ai-usage-recap__row {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.stu-ai-usage-recap__row:last-child {
    border-bottom: 0;
}

.stu-ai-usage-recap__error {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.35rem;
    background: rgba(220, 53, 69, 0.12);
    color: #842029;
    font-size: 0.9rem;
}

body[data-theme='dark'] .stu-ai-usage-recap__error,
body.dark-mode .stu-ai-usage-recap__error,
[data-bs-theme='dark'] .stu-ai-usage-recap__error {
    background: rgba(220, 53, 69, 0.2);
    color: #f1aeb5;
}

.ai-usage-run--focus {
    outline: 2px solid rgba(13, 110, 253, 0.65);
    outline-offset: 1px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.2);
    transition: box-shadow 0.3s ease, outline-color 0.3s ease;
}

.ai-usage-col-expand {
    width: 1.75rem;
}

.ai-usage-expand-btn {
    text-decoration: none;
    line-height: 1;
}

.ai-usage-steps-table {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.ai-usage-step-row td {
    border-top-style: dashed;
}

.ai-usage-step-indent {
    padding-left: 0.75rem !important;
}

.ai-usage-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-usage-status-chip .badge {
    font-weight: 600;
    vertical-align: baseline;
}

.ai-usage-status-chip.active .badge {
    color: inherit;
}

/* While overlay is up, reinforce non-interactive page chrome (inert is primary). */
body.stu-ai-wait-active {
    overflow: hidden;
}

/* E105 — staff badges / CTAs on public post cards */
.post-card-staff-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    z-index: 2;
    max-width: calc(100% - 1rem);
}

.post-card-staff-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
}

.post-card-staff-badge--locale {
    background: rgba(37, 99, 235, 0.9);
}

.post-card-staff-badge--published {
    background: rgba(22, 163, 74, 0.92);
}

.post-card-staff-badge--draft {
    background: rgba(15, 23, 42, 0.82);
}

.post-card-staff-badge--scheduled {
    background: rgba(217, 119, 6, 0.92);
}

.post-card-staff-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}


/* E116 — revision unified / split diff */
.site-content .revision-diff {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.35rem;
    overflow: auto;
    max-height: 36rem;
    background: #fff;
}

.site-content .revision-diff__hunk-head {
    padding: 0.35rem 0.6rem;
    background: rgba(13, 110, 253, 0.08);
    color: #0b5ed7;
    font-weight: 600;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.site-content .revision-diff__line {
    display: flex;
    align-items: flex-start;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.05rem 0.4rem;
}

.site-content .revision-diff__gutter {
    display: inline-flex;
    gap: 0.35rem;
    min-width: 4.5rem;
    color: rgba(0, 0, 0, 0.45);
    user-select: none;
}

.site-content .revision-diff__lineno {
    display: inline-block;
    min-width: 2rem;
    text-align: right;
}

.site-content .revision-diff__prefix {
    display: inline-block;
    width: 1rem;
    font-weight: 700;
    user-select: none;
}

.site-content .revision-diff__text {
    flex: 1;
}

.site-content .revision-diff__line--insert,
.site-content .revision-diff__cell--insert {
    background: rgba(25, 135, 84, 0.12);
}

.site-content .revision-diff__line--delete,
.site-content .revision-diff__cell--delete {
    background: rgba(220, 53, 69, 0.12);
}

.site-content .revision-diff__line--equal {
    background: transparent;
}

.site-content .revision-diff__split-head,
.site-content .revision-diff__split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.site-content .revision-diff__split-head {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-content .revision-diff__split-col {
    padding: 0.2rem 0.5rem;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    min-height: 1.4rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.site-content .revision-diff__split-col:last-child {
    border-right: 0;
}

.site-content .revision-diff-meta__table code.revision-diff__meta-value {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85em;
}

[data-bs-theme='dark'] .site-content .revision-diff {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme='dark'] .site-content .revision-diff__hunk-head {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

[data-bs-theme='dark'] .site-content .revision-diff__line--insert,
[data-bs-theme='dark'] .site-content .revision-diff__cell--insert {
    background: rgba(34, 197, 94, 0.18);
}

[data-bs-theme='dark'] .site-content .revision-diff__line--delete,
[data-bs-theme='dark'] .site-content .revision-diff__cell--delete {
    background: rgba(248, 113, 113, 0.18);
}

/* E144 — series hub cover (lightweight, not a home hero) */
.series-hub-cover {
    max-height: 280px;
    overflow: hidden;
}

.series-hub-cover__img {
    max-height: 280px;
    object-fit: cover;
}
