*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --red: #B91C1C;
    --red-light: #FEE2E2;
    --blue: #185FA5;
    --blue-light: #E6F1FB;
    --green: #166534;
    --green-light: #DCFCE7;
    --amber: #92400E;
    --amber-light: #FEF3C7;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    padding: 0;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
    font-size: 15px;
}

.page {
    min-height: 100vh;
    display: flex;
    background: var(--gray-50);
}

.sidebar {
    width: 236px;
    min-height: 100vh;
    flex-shrink: 0;
    background: var(--red);
}

.page .sidebar .top-row {
    min-height: 40px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.14);
}

.page .sidebar .navbar-brand {
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
}

.page .sidebar .navbar-brand span {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 500;
}

.page .sidebar .navbar-toggler {
    width: 38px;
    height: 28px;
    top: 6px;
    right: 10px;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background-size: 20px;
    background-color: rgba(255, 255, 255, 0.08);
}

.page .sidebar .nav-item {
    padding-bottom: 4px;
    font-size: 12px;
}

.page .sidebar .nav-item:first-of-type {
    padding-top: 12px;
}

.page .sidebar .nav-item:last-of-type {
    padding-bottom: 12px;
}

.page .sidebar .nav-item .nav-link {
    height: 34px;
    color: rgba(255, 255, 255, .72);
    border-radius: 6px;
    line-height: 34px;
}

.page .sidebar .nav-item a.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, .12);
}

.page .sidebar .nav-item .nav-link:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, .08);
}

.page .sidebar .nav-scrollable {
    height: calc(100vh - 40px);
}

.bi-media-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M0 3a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1.8l2.4-1.6A1 1 0 0 1 16 4v8a1 1 0 0 1-1.6.8L12 11.2V13a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3z'/%3E%3C/svg%3E");
}

.bi-issues-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M3 1.5A1.5 1.5 0 0 1 4.5 0h7A1.5 1.5 0 0 1 13 1.5v13a.5.5 0 0 1-.757.429L8 12.383l-4.243 2.546A.5.5 0 0 1 3 14.5v-13z'/%3E%3C/svg%3E");
}

.bi-newsletter-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-.5a.5.5 0 0 0-.5.5v.217l6.5 3.9 6.5-3.9V4a.5.5 0 0 0-.5-.5H2zm12.5 2.467-4.858 2.915L14.5 12.1V5.967zm-.864 6.533L8.84 9.32 8 9.817l-.84-.497-4.796 3.18h11.272zM1.5 12.1l4.858-3.218L1.5 5.967V12.1z'/%3E%3C/svg%3E");
}

.bi-more-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M3 9.5A1.5 1.5 0 1 0 3 6.5a1.5 1.5 0 0 0 0 3zm5 0A1.5 1.5 0 1 0 8 6.5a1.5 1.5 0 0 0 0 3zm5 0A1.5 1.5 0 1 0 13 6.5a1.5 1.5 0 0 0 0 3z'/%3E%3C/svg%3E");
}

main {
    min-width: 0;
    flex: 1;
}

.content {
    min-height: 100vh;
    padding: 24px !important;
}

.cms-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    background: var(--white);
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.article-index {
    width: 100%;
    padding: 20px 24px 28px;
}

.article-list-shell {
    min-height: 0;
    max-width: none;
    margin: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.article-index-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.article-index-header h1 {
    color: var(--gray-900);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.article-index-header h1:focus {
    outline: none;
}

.article-index-actions,
.article-filter-actions,
.article-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-action-button {
    padding: 7px 14px;
    font-size: 13px;
}

.article-filter-panel {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.article-filter-row {
    display: grid;
    gap: 12px;
}

.article-filter-row-primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
}

.article-filter-row-secondary {
    grid-template-columns: minmax(120px, 1fr) minmax(240px, 2fr) auto;
    align-items: end;
}

.article-filter-row-tertiary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
    align-items: end;
}

.article-filter-label {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.article-filter-label.specialty {
    color: var(--blue);
}

.article-filter-icon {
    width: 12px;
    height: 12px;
    display: inline-block;
    color: currentColor;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.article-specialty-select {
    color: var(--blue);
    background-color: var(--blue-light);
    border-color: #B5D4F4;
    font-weight: 500;
}

.article-archived-filter {
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}

.article-archived-filter label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.article-archived-filter input,
.article-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--red);
}

.article-search-button {
    padding: 7px 20px;
    font-size: 13px;
}

.article-table-wrap {
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.article-table thead tr {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.article-table th {
    padding: 9px 10px;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.article-table td {
    padding: 10px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.article-table tbody tr {
    background: var(--white);
}

.article-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.article-table tbody tr:last-child td {
    border-bottom: none;
}

.article-col-id {
    width: 58px;
}

.article-col-issue {
    width: 62px;
}

.article-col-specialty {
    width: 120px;
}

.article-col-admin {
    width: 122px;
}

.article-col-topic {
    width: 130px;
}

.article-col-date {
    width: 126px;
}

.article-col-active {
    width: 52px;
}

.article-col-actions {
    width: 172px;
}

.enl-row-actions {
    display: flex;
    gap: 6px;
}

.enl-row-action {
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.4;
}

.enl-row-delete {
    color: var(--red, #c0392b);
    border-color: var(--red, #c0392b);
}

.enl-row-action:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Newsletter lists need room for every action without a fixed desktop width. */
.enl-list-shell .article-table {
    min-width: 0;
}

.enl-list-shell .article-col-id { width: 6%; }
.enl-list-shell .article-col-specialty { width: 14%; }
.enl-list-shell .article-col-topic { width: 12%; }
.enl-list-shell .article-col-admin { width: 12%; }
.enl-list-shell .article-col-date { width: 14%; }
.enl-list-shell .article-col-actions { width: 22%; }

.enl-list-shell .article-table th,
.enl-list-shell .article-table td {
    padding: 9px 8px;
    overflow-wrap: anywhere;
}

.enl-list-shell .article-specialty-pill {
    white-space: normal;
    overflow-wrap: anywhere;
}

.enl-list-shell .enl-row-actions {
    flex-wrap: wrap;
}

.enl-list-shell .enl-row-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 5px 9px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .enl-list-shell .article-index { padding: 16px 12px; }
    .enl-list-shell .article-table colgroup { display: none; }
    .enl-list-shell .article-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .enl-list-shell .article-table tbody,
    .enl-list-shell .article-table tr { display: block; }
    .enl-list-shell .article-table tbody tr + tr { border-top: 1px solid var(--gray-200); }
    .enl-list-shell .article-table td[data-label] {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: 12px;
        border: 0;
    }
    .enl-list-shell .article-table td[data-label]::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        color: var(--gray-500);
    }
    .enl-list-shell .article-table td[data-label] > * { min-width: 0; }
    .enl-list-shell .article-table-state { display: block; }
}

.article-title-link {
    color: var(--blue);
    font-size: 13px;
    text-decoration: none;
}

.article-id-link {
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.article-id-link:hover {
    text-decoration: underline;
}

.article-title-link:hover {
    text-decoration: underline;
}

.article-draft-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    color: #8a4b00;
    background: #fff0d8;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    vertical-align: middle;
}

.article-section-text {
    margin-top: 3px;
    color: var(--gray-400);
    font-size: 11px;
    line-height: 1.35;
}

.article-specialty-pill {
    max-width: 100%;
    display: inline-block;
    overflow: hidden;
    padding: 2px 7px;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-topic-cell {
    color: var(--gray-600);
    font-size: 12px;
}

.article-table .muted {
    color: var(--gray-500);
    font-size: 12px;
}

.article-table .center {
    text-align: center;
}

.article-row-actions {
    justify-content: flex-end;
    gap: 6px;
}

.article-row-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1;
    text-decoration: none;
}

.article-row-button.edit {
    color: var(--blue);
    border-color: #B5D4F4;
}

.article-row-button.delete {
    color: var(--red);
    border-color: #FCA5A5;
}

.article-table-state {
    height: auto;
    padding: 32px !important;
    color: var(--gray-400);
    background: var(--white);
    font-size: 13px;
    font-weight: 400;
    text-align: center;
}

.cms-topbar {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 18px;
    background: var(--red);
}

.cms-topbar-brand {
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.cms-topbar-nav {
    display: flex;
    gap: 18px;
    font-size: 12px;
    color: rgba(255, 255, 255, .72);
}

.cms-topbar-user {
    margin-left: auto;
}

.cms-topbar-user select {
    width: 148px;
    height: 26px;
    padding: 0 24px 0 8px;
    color: rgba(255, 255, 255, .84);
    background-color: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .22);
    font-size: 12px;
}

.cms-form-body {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 56px 48px;
}

.cms-breadcrumb {
    margin-bottom: 6px;
    color: var(--gray-400);
    font-size: 12px;
}

.cms-breadcrumb a {
    color: var(--blue);
    text-decoration: none;
}

.cms-page-title {
    margin-bottom: 18px;
    color: var(--gray-900);
    font-size: 20px;
    font-weight: 600;
}

.callout-info {
    margin-bottom: 22px;
    padding: 10px 14px;
    color: #0C447C;
    background: var(--blue-light);
    border-left: 3px solid var(--blue);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 13px;
    line-height: 1.55;
}

.readonly-article-notice {
    margin-bottom: 22px;
    padding: 12px 14px;
    color: #7A2E0E;
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    border-left: 4px solid var(--amber);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.article-owner-line {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: -4px 0 18px;
    padding: 4px 10px;
    color: var(--gray-700);
    background: #F8FAFC;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
}

.form-section-title {
    margin: 24px 0 14px;
    padding-bottom: 6px;
    color: var(--gray-400);
    border-bottom: 1px solid var(--gray-200);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.form-section-title-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    margin-bottom: 16px;
}

.form-row.tight {
    margin-bottom: 10px;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-label,
.fset-col-label {
    margin-bottom: 5px;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fset-col-label {
    color: var(--gray-400);
    font-weight: 600;
    letter-spacing: .04em;
}

.badge-req,
.badge-opt,
.badge-new,
.badge-print {
    display: inline-flex;
    align-items: center;
    min-height: 15px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge-req {
    color: var(--red);
    background: var(--red-light);
}

.badge-opt {
    color: var(--gray-400);
    background: var(--gray-100);
    font-weight: 600;
}

.badge-new {
    color: var(--blue);
    background: var(--blue-light);
}

.badge-print {
    color: var(--amber);
    background: var(--amber-light);
    font-weight: 600;
}

.inline-req {
    color: var(--red);
    font-size: 10px;
}

.inline-opt {
    color: var(--gray-400);
    font-size: 10px;
}

select,
input[type="text"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 0 10px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}

input[type="text"],
input[type="datetime-local"] {
    height: 34px;
}

textarea {
    min-height: 92px;
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.5;
    resize: vertical;
}

.media-html-input {
    min-height: 118px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

.rich-text-input {
    min-height: 150px;
}

.custom-body-disclosure > summary {
    list-style: none;
    font-weight: 700;
    color: var(--amber);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.custom-body-disclosure > summary::-webkit-details-marker {
    display: none;
}

.custom-body-disclosure > summary::after {
    content: "+";
}

.custom-body-disclosure[open] > summary::after {
    content: "−";
}

.custom-body-disclosure[open] > summary {
    margin-bottom: 12px;
}

.body-editor-field {
    margin-bottom: 22px;
}

.body-editor {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    overflow: hidden;
}

.body-editor.disabled {
    border-color: #B8C2CC;
}

.body-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--gray-200);
}

.body-editor-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 30px;
    padding: 4px 8px;
    color: var(--gray-700);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.body-editor-toolbar button:hover:not(:disabled) {
    color: var(--blue);
    border-color: #B5D4F4;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .1);
}

.body-editor-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-200);
}

.body-editor-spacer {
    flex: 1 1 auto;
}

.body-editor-snippets {
    display: flex;
    align-items: center;
    gap: 6px;
}

.body-editor-snippets select {
    width: 170px;
    height: 30px;
    min-height: 30px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 12px;
}

.body-editor-source-toggle {
    min-width: 58px;
}

.body-image-inserter {
    padding: 12px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--gray-200);
}

.keyword-tag-autocomplete {
    position: relative;
}

.keyword-tag-input {
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: text;
    transition: border-color .15s, box-shadow .15s;
}

.keyword-tag-input:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}

.keyword-tag-input.disabled {
    color: var(--gray-600);
    background:
        repeating-linear-gradient(
            -45deg,
            #F8FAFC 0,
            #F8FAFC 8px,
            #EEF2F7 8px,
            #EEF2F7 16px
        );
    border-color: #B8C2CC;
    cursor: not-allowed;
}

.keyword-tag-input input {
    flex: 1 1 180px;
    min-width: 150px;
    height: 28px;
    padding: 0 4px;
    border: 0;
    box-shadow: none;
    background: transparent;
    font-family: var(--font);
    font-size: 13px;
    outline: none;
}

.keyword-tag-input input:focus {
    border: 0;
    box-shadow: none;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-height: 26px;
    padding: 3px 5px 3px 8px;
    color: var(--blue);
    background: var(--blue-light);
    border: 1px solid #B5D4F4;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.keyword-tag span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keyword-tag button {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(24, 95, 165, .18);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.keyword-tag button:hover:not(:disabled) {
    background: #FFFFFF;
    border-color: #85B7EB;
}

.keyword-suggestion-list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 236px;
    overflow-y: auto;
    padding: 4px;
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}

.keyword-suggestion {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 9px;
    color: var(--gray-800);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.keyword-suggestion:hover,
.keyword-suggestion:focus {
    color: var(--blue);
    background: var(--blue-light);
    outline: none;
}

.related-article-picker {
    display: grid;
    gap: 8px;
}

.related-articles-panel {
    padding: 20px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #F8FAFC;
}

.related-articles-help {
    margin: 4px 0 14px;
    color: var(--gray-600);
    font-size: 13px;
    line-height: 1.5;
}

.related-articles-panel .related-article-selected {
    background: #FFFFFF;
}

.related-article-picker.disabled {
    opacity: .72;
}

.related-article-selected {
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 7px;
    background: #F8FAFC;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.related-article-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 240px;
    max-width: 100%;
    min-height: 26px;
    padding: 8px;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.related-article-chip span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.related-article-thumbnail {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: cover;
    border-radius: 4px;
}

.related-article-chip button {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.related-article-empty {
    color: var(--gray-400);
    font-size: 13px;
}

.related-article-count {
    margin-left: auto;
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 800;
}

.related-article-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.related-article-search button {
    min-height: 34px;
    padding: 0 13px;
    color: var(--blue);
    background: #FFFFFF;
    border: 1px solid #B5D4F4;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 800;
}

.related-article-search button:hover:not(:disabled) {
    color: #124D86;
    background: var(--blue-light);
}

.related-article-message {
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 700;
}

.related-article-results {
    display: grid;
    gap: 6px;
    max-height: 210px;
    overflow: auto;
    padding: 8px;
    background: #F8FAFC;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.related-article-result {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    text-align: left;
}

.related-article-result:hover:not(:disabled) {
    border-color: #B5D4F4;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .1);
}

.related-article-result-title {
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-article-result-meta {
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 800;
}

.article-multimedia-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.media-source-panel {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.media-upload-dropzone {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 120px;
    padding: 18px;
    color: var(--gray-700);
    background: #F8FAFC;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.media-upload-dropzone:hover {
    background: #F3F7FB;
    border-color: var(--blue);
    box-shadow: 0 8px 24px rgba(18, 79, 136, 0.08);
}

.media-upload-icon {
    width: 46px;
    height: 46px;
    background: var(--blue);
    border-radius: var(--radius-sm);
    position: relative;
}

.media-upload-icon::before {
    position: absolute;
    top: 13px;
    left: 15px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #FFFFFF;
    content: "";
}

.media-upload-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.media-upload-title {
    color: var(--gray-900);
    font-size: 16px;
    font-weight: 900;
}

.media-upload-meta {
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
}

.media-upload-input {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 420px;
    color: var(--gray-600);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
}

.media-upload-input::file-selector-button {
    min-height: 36px;
    margin-right: 12px;
    padding: 0 16px;
    color: #FFFFFF;
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.media-upload-input::file-selector-button:hover {
    background: #124F88;
    border-color: #124F88;
}

.media-upload-list {
    display: grid;
    gap: 12px;
}

.media-upload-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.media-source-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.media-source-selected {
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 700;
}

.media-type-choice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.media-source-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.media-source-filter select {
    min-width: 240px;
}

.media-type-title,
.media-source-title {
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 800;
}

.media-type-button {
    min-height: 36px;
    padding: 0 18px;
    color: #FFFFFF;
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 800;
}

.media-type-button:hover:not(:disabled) {
    background: #124F88;
    border-color: #124F88;
}

.media-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.media-source-card {
    display: grid;
    grid-template-rows: 96px auto auto;
    gap: 8px;
    min-height: 152px;
    padding: 8px;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    text-align: left;
}

.media-source-card:hover:not(:disabled) {
    border-color: #B5D4F4;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .1);
}

.media-source-card.selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .16);
}

.media-source-card img,
.media-source-placeholder {
    width: 100%;
    height: 96px;
    object-fit: cover;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.media-source-placeholder {
    display: grid;
    place-items: center;
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 800;
}

.media-source-name {
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.media-source-meta,
.media-source-empty {
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 700;
}

.duration-selects {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

.field-hint {
    margin-top: 5px;
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 700;
}

.article-multimedia-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 700;
}

.article-multimedia-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--blue);
}

.article-image-picker {
    display: grid;
    grid-template-columns: minmax(132px, 160px) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.article-image-picker .image-preview {
    display: grid;
    place-items: center;
    min-height: 118px;
    overflow: hidden;
    color: var(--gray-400);
    background:
        linear-gradient(45deg, #F6F8FA 25%, transparent 25%),
        linear-gradient(-45deg, #F6F8FA 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #F6F8FA 75%),
        linear-gradient(-45deg, transparent 75%, #F6F8FA 75%);
    background-color: #FFFFFF;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.article-image-picker .image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 118px;
    object-fit: cover;
}

.article-image-picker .image-preview.empty {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.article-image-picker .image-controls {
    display: grid;
    gap: 8px;
    align-content: start;
}

.article-image-picker .image-controls input[type="text"],
.server-image-search {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.article-image-picker .image-controls input[type="text"]:focus,
.server-image-search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}

.article-image-picker .image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.image-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.image-file-button,
.image-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}

.image-file-button {
    color: #FFFFFF;
    background: var(--blue);
    border: 1px solid var(--blue);
}

.image-file-button:hover {
    background: #124D86;
    border-color: #124D86;
}

.image-file-button.disabled,
.image-file-button[aria-disabled="True"],
.image-file-button[aria-disabled="true"] {
    opacity: .48;
    cursor: not-allowed;
}

.image-file-button.disabled:hover {
    background: var(--blue);
    border-color: var(--blue);
}

.image-file-input:focus + .image-file-button,
.image-secondary:focus,
.server-image-close:focus {
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .16);
}

.image-secondary {
    color: var(--blue);
    background: #FFFFFF;
    border: 1px solid #B5D4F4;
}

.image-secondary:hover:not(:disabled) {
    color: #124D86;
    background: var(--blue-light);
    border-color: #85B7EB;
}

.image-upload-icon,
.image-server-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    flex: 0 0 auto;
    background: currentColor;
}

.image-upload-icon {
    mask: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='M4 20h16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.image-server-icon {
    mask: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='7' ry='3'/%3E%3Cpath d='M5 5v6c0 1.7 3.1 3 7 3s7-1.3 7-3V5'/%3E%3Cpath d='M5 11v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.article-image-picker .image-message {
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
}

.article-image-picker .image-message.ok {
    color: #17623A;
    background: #EAF7EF;
}

.article-image-picker .image-message.error {
    color: #8A1F17;
    background: #FDECEA;
}

.server-image-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .44);
}

.server-image-dialog {
    width: min(100%, 820px);
    max-height: min(720px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.server-image-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.server-image-dialog h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.server-image-dialog p {
    margin: 3px 0 0;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.4;
}

.server-image-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--gray-500);
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0;
    line-height: 1;
}

.server-image-close::before {
    content: "\00d7";
    font-size: 20px;
    font-weight: 600;
}

.server-image-close:hover {
    color: var(--gray-800);
    background: var(--gray-50);
}

.server-image-search {
    height: 36px;
    padding: 0 11px;
}

.server-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #F8FAFC;
}

.server-image-option {
    display: grid;
    grid-template-rows: 104px auto;
    gap: 6px;
    min-width: 0;
    padding: 6px;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    text-align: left;
}

.server-image-option:hover:not(:disabled) {
    border-color: #B5D4F4;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .1);
}

.server-image-option img {
    width: 100%;
    height: 104px;
    object-fit: cover;
    border-radius: 3px;
}

.server-image-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-image-empty {
    padding: 28px;
    color: var(--gray-400);
    background: #F8FAFC;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.body-editor-canvas,
.body-editor-source {
    width: 100%;
    min-height: 420px;
}

.body-editor-canvas {
    padding: 16px;
    color: var(--gray-800);
    background: var(--white);
    font-size: 14px;
    line-height: 1.65;
    outline: none;
    overflow: auto;
}

.body-editor-canvas:focus {
    box-shadow: inset 0 0 0 3px rgba(24, 95, 165, .12);
}

.body-editor-canvas[contenteditable="false"] {
    color: var(--gray-600);
    background:
        repeating-linear-gradient(
            -45deg,
            #F8FAFC 0,
            #F8FAFC 8px,
            #EEF2F7 8px,
            #EEF2F7 16px
        );
    cursor: not-allowed;
}

.body-editor-canvas h2,
.body-editor-canvas h3 {
    margin: 0 0 10px;
    color: var(--gray-800);
    font-weight: 800;
}

.body-editor-canvas p,
.body-editor-canvas ul,
.body-editor-canvas ol,
.body-editor-canvas blockquote {
    margin: 0 0 14px;
}

.body-editor-canvas blockquote {
    padding-left: 14px;
    color: var(--gray-600);
    border-left: 3px solid var(--blue);
}

.body-editor-source {
    min-height: 420px;
    border: 0;
    border-radius: 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.edit-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 8px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.edit-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 4px 12px 4px 5px;
    color: var(--gray-600);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}

.edit-step:hover {
    color: var(--gray-800);
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.edit-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--gray-700);
    background: linear-gradient(180deg, #FFFFFF 0%, #F3F6FA 100%);
    border: 1px solid #CBD5E1;
    border-radius: 50%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .9),
        inset 0 -1px 2px rgba(15, 23, 42, .08),
        0 1px 2px rgba(15, 23, 42, .08);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}

.edit-step-label {
    line-height: 1;
    white-space: nowrap;
}

.edit-step.active {
    color: var(--blue);
    background: var(--blue-light);
    border-color: #B5D4F4;
    box-shadow: 0 6px 16px rgba(24, 95, 165, .13);
}

.edit-step.active .edit-step-number {
    color: var(--white);
    background: linear-gradient(180deg, #2A78BD 0%, var(--blue) 100%);
    border-color: #0F4D88;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .25),
        0 0 0 3px rgba(24, 95, 165, .14),
        0 5px 12px rgba(24, 95, 165, .28);
}

.edit-step:hover .edit-step-number {
    border-color: #9FB8D1;
    transform: translateY(-1px);
}

.edit-step.disabled {
    color: var(--gray-400);
    opacity: .7;
    pointer-events: none;
}

.edit-step.disabled .edit-step-number {
    color: var(--gray-400);
    background: #F4F6F8;
    border-color: var(--gray-200);
    box-shadow: none;
    transform: none;
}

select {
    padding-right: 30px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%239CA3AF' stroke-width='2.5' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}

select:disabled,
input:disabled,
textarea:disabled,
button:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.article-readonly input:disabled,
.article-readonly select:disabled,
.article-readonly textarea:disabled,
.article-readonly .image-controls input:disabled {
    color: var(--gray-600);
    background:
        repeating-linear-gradient(
            -45deg,
            #F8FAFC 0,
            #F8FAFC 8px,
            #EEF2F7 8px,
            #EEF2F7 16px
        );
    border-color: #B8C2CC;
    box-shadow: inset 0 0 0 1px rgba(75, 85, 99, .08);
    opacity: 1;
    cursor: not-allowed;
}

.article-readonly button:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.ai-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 10px 12px;
    background: #F8FAFC;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.ai-primary-button,
.ai-field-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-weight: 800;
    line-height: 1.1;
    transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
    white-space: nowrap;
}

.ai-primary-button {
    min-height: 34px;
    padding: 0 14px;
    color: #FFFFFF;
    background: var(--blue);
    border: 1px solid var(--blue);
    font-size: 12px;
}

.ai-primary-button:hover:not(:disabled) {
    background: #124D86;
    border-color: #124D86;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}

.ai-field-button {
    min-height: 26px;
    padding: 0 9px;
    color: var(--blue);
    background: #FFFFFF;
    border: 1px solid #B5D4F4;
    font-size: 11px;
}

.ai-field-button:hover:not(:disabled) {
    color: #124D86;
    background: var(--blue-light);
    border-color: #85B7EB;
}

.ai-message {
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 700;
}

input.pre-filled {
    color: var(--gray-600);
    background: var(--gray-50);
}

.author-list {
    display: grid;
    gap: 8px;
}

.author-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.author-add,
.author-remove {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.author-add {
    justify-self: start;
}

.author-add:hover,
.author-remove:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.fset-wrap {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: 12px;
    font-weight: 600;
}

.fset-error-count {
    color: var(--red);
    font-size: 11px;
}

.fset-item {
    padding: 14px;
    border-bottom: 1px solid var(--gray-100);
    animation: fadeIn .2s ease;
}

.fset-item:last-child {
    border-bottom: none;
}

.fset-item.is-locked {
    background: #FCFCFD;
}

.fset-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.fset-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fset-num {
    padding: 2px 10px;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.fset-lock {
    color: var(--gray-400);
    font-size: 11px;
}

.fset-remove-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    color: var(--red);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    transition: background .12s;
}

.fset-remove-btn:hover {
    background: var(--red-light);
}

.fset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.ms-wrap {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.ms-wrap:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(24, 95, 165, .12);
}

.ms-wrap.disabled {
    opacity: .56;
}

.ms-toggle {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 0 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    text-align: left;
}

.ms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px 0;
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 8px;
    color: var(--blue);
    background: var(--blue-light);
    border: 1px solid #B5D4F4;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ms-tag-x {
    color: inherit;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    opacity: .6;
}

.ms-tag-x:hover {
    opacity: 1;
}

.ms-placeholder {
    padding: 2px 2px;
    color: var(--gray-400);
    font-size: 13px;
}

.ms-toggle-caret {
    flex-shrink: 0;
    margin-left: 4px;
    color: var(--gray-400);
    font-size: 11px;
}

.ms-dropdown {
    display: none;
    max-height: 160px;
    overflow-y: auto;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.ms-wrap.open .ms-dropdown {
    display: block;
}

.ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    font-size: 13px;
}

.ms-option:last-child {
    border-bottom: none;
}

.feature-select-option {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--gray-100);
}

.ms-tags .feature-topic-search {
    flex: 1 1 120px;
    width: 120px;
    min-width: 80px;
    border: 0;
    box-shadow: none;
    padding: 2px;
}

.ms-option:hover {
    background: var(--gray-50);
}

.ms-option.selected {
    color: var(--blue);
    background: var(--blue-light);
}

.ms-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    accent-color: var(--blue);
}

.deco-toggle {
    width: 100%;
    margin-top: 12px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gray-500);
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    transition: background .12s, border-color .12s;
}

.deco-toggle:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.deco-toggle.active {
    color: var(--amber);
    background: var(--amber-light);
    border-color: #FCD34D;
}

.deco-toggle-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.deco-icon {
    font-size: 13px;
}

.deco-body {
    display: none;
    margin-top: 10px;
    padding: 14px;
    background: var(--amber-light);
    border: 1px solid #FCD34D;
    border-radius: var(--radius-sm);
    animation: fadeIn .15s ease;
}

.deco-body.open {
    display: block;
}

.deco-body .form-row {
    margin-bottom: 10px;
}

.deco-body .form-row:last-child {
    margin-bottom: 0;
}

.deco-label {
    margin-bottom: 5px;
    color: var(--amber);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.deco-body input[type="text"],
.deco-body textarea {
    width: 100%;
    padding: 7px 10px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid #FCD34D;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font);
    font-size: 13px;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}

.deco-body input[type="text"] {
    height: 34px;
}

.deco-body textarea {
    min-height: 72px;
    line-height: 1.5;
}

.deco-body input:focus,
.deco-body textarea:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(146, 64, 14, .1);
}

.deco-hint {
    margin-top: 4px;
    color: var(--amber);
    font-size: 11px;
    opacity: .75;
}

.fset-add {
    width: 100%;
    margin-top: 10px;
    padding: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--blue);
    background: none;
    border: 1px dashed #85B7EB;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    transition: background .12s;
}

.fset-add:hover {
    background: var(--blue-light);
}

.save-summary {
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.save-summary.ok {
    color: var(--green);
    background: var(--green-light);
}

.save-summary.error {
    color: var(--red);
    background: var(--red-light);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.btn-save {
    padding: 9px 24px;
    color: var(--white);
    background: var(--red);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    transition: opacity .12s;
}

.btn-save:hover {
    opacity: .88;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    color: var(--gray-500);
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
    transition: background .12s;
}

.btn-cancel:hover {
    background: var(--gray-100);
}

.unsaved-changes-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .35);
}

.unsaved-changes-dialog {
    width: min(100%, 460px);
    padding: 22px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 44px rgba(15, 23, 42, .2);
}

.unsaved-changes-dialog .form-section-title {
    margin-top: 0;
}

.unsaved-changes-dialog p {
    margin: 10px 0 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
}

.unsaved-changes-dialog .form-actions {
    flex-wrap: wrap;
    margin-top: 18px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-panel {
    width: 100%;
    max-width: 420px;
    padding: 36px 40px 40px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 50px rgba(17, 24, 39, .12);
}

.login-panel h1 {
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.login-links {
    margin-top: 8px;
    font-size: 13px;
}

.login-links a {
    color: var(--blue);
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 520px;
    padding: 14px 44px 14px 16px;
    color: var(--white);
    background: var(--red);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(16, 24, 40, .18);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 12px;
    right: 14px;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    body {
        padding: 0;
    }

    .page {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: 0;
    }

    main {
        width: 100%;
        min-width: 0;
    }

    .article-index {
        padding: 18px 14px 24px;
    }

    .article-index-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .article-index-actions,
    .article-filter-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .article-action-button,
    .article-search-button {
        flex: 1 1 130px;
    }

    .article-filter-row-primary,
    .article-filter-row-secondary,
    .article-filter-row-tertiary {
        grid-template-columns: 1fr;
    }

    .article-archived-filter {
        padding-bottom: 0;
    }

    .article-table-wrap {
        max-width: 100%;
        overflow-x: auto;
    }

    .article-table {
        min-width: 1180px;
    }

    .cms-topbar {
        height: auto;
        min-height: 40px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px;
    }

    .cms-topbar-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cms-topbar-user {
        margin-left: 0;
    }

    .cms-form-body {
        padding: 18px 16px 24px;
    }

    .form-row-2,
    .author-row,
    .fset-grid {
        grid-template-columns: 1fr;
    }

    .article-image-picker {
        grid-template-columns: 1fr;
    }

    .form-section-title-inline,
    .fset-item-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Selection controls belong to the editor, never to saved article HTML. */
.body-editor-canvas [data-cms-block] { cursor: pointer; }
.body-editor-canvas [data-cms-media-original] { margin: 16px 0; }
.body-editor-canvas .cms-media-handle { padding: 8px; background: #eff6ff; color: #334155; font-size: 13px; }
.body-editor-canvas [data-cms-video-fixed] { position: relative; width: 100%; margin: 24px 0; background: #000; }
.body-editor-canvas .cms-video-player { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.body-editor-canvas .cms-podcast-player { display: block; width: 100%; height: 180px; border: 0; }
.body-editor-canvas [data-cms-block]:hover { outline: 1px solid #94a3b8; outline-offset: 3px; }
.body-editor-canvas [data-cms-selected] { outline: 2px solid #2563eb; outline-offset: 3px; }
.cms-block-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: #eff6ff; border-bottom: 1px solid #bfdbfe; }
.cms-block-toolbar[hidden] { display: none; }
.cms-block-toolbar [hidden] { display: none; }
.cms-block-toolbar span { margin-right: auto; font-size: 13px; font-weight: 600; color: #1e40af; }
.cms-block-toolbar button { border: 1px solid #cbd5e1; border-radius: 5px; padding: 5px 10px; background: white; color: #334155; font-size: 13px; }
.cms-block-toolbar button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.cms-block-toolbar button:last-child { color: #b91c1c; }
.body-editor-canvas [data-cms-block][draggable="true"] { cursor: grab; }
.body-editor-canvas [data-cms-block][draggable="true"]:active { cursor: grabbing; }
.cms-block-drop-indicator { position: fixed; height: 3px; background: #2563eb; border-radius: 2px; pointer-events: none; z-index: 10000; box-shadow: 0 0 0 2px #dbeafe; }
.related-article-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin:12px 0; }
.related-article-filters label, .related-article-dropdown-label { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:600; color:var(--gray-700); }
.related-article-filters select, .related-article-dropdown { width:100%; min-width:0; padding:9px 10px; border:1px solid var(--gray-300); border-radius:var(--radius-sm); background:white; font-size:13px; }
.related-article-dropdown:disabled { background:var(--gray-50); color:var(--gray-500); }

.related-article-picker select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
.related-article-selected { flex-direction: column; align-items: stretch; }
.related-article-chip { flex: none; width: 100%; box-sizing: border-box; }
.related-article-selection-heading { margin-top: 12px; font-size: 13px; font-weight: 600; }
.related-article-selection-heading span { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--gray-600); }
.related-article-chip .related-article-reorder { width: 28px; height: 28px; border-radius: 4px; }
.related-article-chip button:disabled { opacity: .35; cursor: default; }
.related-article-chip button:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.related-article-chip[draggable="true"] { cursor: grab; }
.related-article-chip[draggable="true"]:active { cursor: grabbing; }
.related-article-chip .related-article-drag-handle { flex: 0 0 16px; color: #64748b; font-size: 22px; line-height: 1; user-select: none; }
.related-article-chip.is-dragging { opacity: .5; }
.related-article-chip.is-drop-target { outline: 2px solid #2563eb; outline-offset: 2px; background: #eff6ff; }
.related-article-chip[draggable="false"] .related-article-drag-handle { opacity: .3; }
