body {
    background: #f5f7fb;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

.admin-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.admin-header {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 18px;
    min-height: 44px;
}

.admin-header h1 {
    color: #101828;
    font-size: clamp(22px, 2.6vw, 32px);
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}

.admin-title-row {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: max-content;
}

.admin-logo {
    border-radius: 50%;
    display: block;
    height: 38px;
    width: 38px;
}

.admin-logo-link {
    border-radius: 50%;
    display: block;
    flex: 0 0 auto;
}

.admin-back-row {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 16px;
}

.back-button {
    min-width: 96px;
    text-align: center;
}

.toolbar {
    display: flex;
    gap: 7px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.panel {
    background: #fff;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    padding: 20px;
}

.login {
    max-width: 420px;
    margin: 10vh auto;
    width: calc(100% - 32px);
}

.login h1 {
    font-size: clamp(34px, 7vw, 52px);
    line-height: 1.05;
    margin: 0 0 26px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 14px 0 6px;
}

input,
select,
textarea {
    border: 1px solid #cfd7e6;
    border-radius: 6px;
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

input {
    min-height: 46px;
}

textarea {
    min-height: 110px;
}

.inline-field {
    align-items: stretch;
    display: flex;
    gap: 8px;
}

.inline-field input {
    min-width: 0;
}

.inline-field button {
    flex: 0 0 auto;
    min-width: 88px;
}

.field-note {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin: 7px 0 0;
}

.field-note.is-error {
    color: #b42318;
}

.field-note.is-success {
    color: #15803d;
}

.toast-notice {
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    bottom: 24px;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
    color: #166534;
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 16px;
    position: fixed;
    right: 24px;
    z-index: 50;
}

.toast-notice.is-hiding {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.account-display {
    display: grid;
    gap: 12px;
    margin: 0;
}

.account-display div {
    border-bottom: 1px solid #e4ebf5;
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
}

.account-display dt {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin: 0;
}

.account-display dd {
    color: #172033;
    font-size: 17px;
    font-weight: 800;
    margin: 0;
}

.account-edit-panel {
    margin: 0;
}

.account-edit-button {
    background: #1d4ed8;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    margin-top: 18px;
    padding: 10px 14px;
    width: max-content;
}

.account-edit-panel form {
    display: none;
    margin-top: 0;
}

.account-edit-panel.is-editing .account-edit-button,
.account-edit-panel.is-editing .account-display {
    display: none;
}

.account-edit-panel.is-editing form {
    display: block;
}

.form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.body-field {
    min-height: 340px;
}

.json-field {
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    min-height: 520px;
    resize: vertical;
}

.import-panel {
    max-width: 940px;
}

.button,
button {
    background: #1d4ed8;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
}

.login button {
    min-height: 46px;
    padding: 10px 18px;
}

.button.secondary {
    background: #eaf1ff;
    color: #102a6b;
}

.article-form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.advanced-fields + .article-form-actions {
    margin: 18px 0 0;
}

.nav-button {
    background: #eaf1ff;
    color: #102a6b;
    font-size: 14px;
    min-height: 34px;
    min-width: 94px;
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
}

.nav-button:hover,
.button.secondary:hover {
    background: #dbe8ff;
}

.nav-button.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.nav-primary,
.nav-primary.is-active {
    background: #1d4ed8;
    color: #fff;
}

.nav-icon-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 42px;
    padding: 8px;
    width: 42px;
}

.nav-icon-button svg {
    fill: none;
    height: 19px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.1;
    width: 19px;
}

.error {
    background: #fff2f0;
    border: 1px solid #f0b5ae;
    border-radius: 6px;
    color: #9a2d1f;
    padding: 10px 12px;
}

.notice {
    background: #eef8ff;
    border-color: #bfdbfe;
    color: #102a6b;
    font-weight: 800;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.status {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
}

.status-published {
    background: #e8f0ff;
    color: #1d4ed8;
}

.status-draft {
    background: #eee;
    color: #555;
}

.status-review {
    background: #fff0cc;
    color: #8a5c13;
}

.status-button-group {
    background: #eaf1ff;
    border: 1px solid #d7e2f2;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 4px;
}

.status-choice {
    background: transparent;
    border-radius: 6px;
    color: #102a6b;
    min-height: 38px;
    padding: 8px;
}

.status-choice.is-active {
    background: #1d4ed8;
    color: #fff;
}

.admin-toast {
    background: #101828;
    border-radius: 999px;
    bottom: 22px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    left: 50%;
    margin: 0;
    opacity: 0;
    padding: 10px 14px;
    pointer-events: none;
    position: fixed;
    transform: translate(-50%, 12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 30;
}

.admin-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.admin-toast.is-error {
    background: #b42318;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 2fr 1fr;
}

.admin-two-col {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d7e2f2;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(29, 78, 216, 0.06);
    min-height: 116px;
    padding: 18px;
}

.stat-card span {
    color: #667085;
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.stat-card strong {
    color: #1d4ed8;
    display: block;
    font-size: 34px;
    line-height: 1;
}

.stat-value-row {
    align-items: baseline;
    display: flex;
    gap: 14px;
    margin-top: 8px;
}

.stat-delta {
    display: inline-block;
    font-size: 12px;
    font-weight: 900;
    padding: 0;
}

.stat-delta.is-up {
    color: #15803d;
}

.stat-delta.is-down {
    color: #b42318;
}

.stat-delta.is-neutral {
    color: #667085;
}

.metric-cell {
    white-space: nowrap;
}

.compact-table td {
    padding: 9px 8px;
}

.share-click-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.share-click-item {
    background: #f8fbff;
    border: 1px solid #d7e2f2;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 12px;
}

.share-click-item span {
    color: #667085;
    font-size: 12px;
    font-weight: 900;
}

.share-click-item strong {
    color: #172033;
    font-size: 18px;
}

.stats-hero {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.stats-hero h2 {
    font-size: 32px;
    margin: 6px 0;
}

.stats-hero p {
    color: #667085;
    font-weight: 700;
    margin: 0;
}

.eyebrow {
    color: #1d4ed8;
    display: inline-block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.range-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.panel h2 {
    margin-top: 0;
}

button.danger {
    background: #b42318;
}

.filter-bar {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 0.35fr) minmax(220px, 0.45fr) auto;
    margin-bottom: 18px;
}

.article-view-filters {
    grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.25fr) minmax(140px, 0.3fr) minmax(180px, 0.45fr) minmax(140px, 0.3fr) auto;
}

.filter-bar label,
.range-form label {
    margin: 0;
}

.filter-bar span {
    display: block;
    margin-bottom: 6px;
}

.filter-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.panel-title-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.panel-title-row h2 {
    margin: 0;
}

.panel-title-row span {
    color: #667085;
    font-weight: 800;
}

.panel-title-actions {
    align-items: center;
    display: flex;
    gap: 14px;
}

.bulk-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 10px 0 14px;
}

.article-bulk-actions {
    align-items: center;
    gap: 16px;
}

.bulk-left {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.bulk-left small {
    color: #475467;
    font-size: 13px;
    font-weight: 400;
    line-height: 34px;
}

.bulk-separator {
    color: #667085;
    font-weight: 400;
    line-height: 34px;
}

.bulk-action-link,
.article-select-all {
    color: #344054;
    font-size: 15px;
    font-weight: 400;
    line-height: 34px;
}

.article-select-all {
    min-height: 34px;
}

.article-select-all input {
    transform: scale(1.12);
    transform-origin: center;
}

.bulk-submit {
    align-self: center;
    flex: 0 0 auto;
    font-size: 13px;
    margin-left: auto;
    min-height: 34px;
    padding: 8px 12px;
}

.bulk-right {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.bulk-right .bulk-submit {
    margin-left: 0;
}

.bulk-submit.is-restore {
    background: #15803d;
}

.bulk-submit.is-archive {
    background: #344054;
}

.bulk-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.checkbox-label {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin: 0;
}

.checkbox-label input,
.check-cell input {
    min-height: 0;
    width: auto;
}

.check-cell {
    width: 34px;
}

.row-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    white-space: nowrap;
}

.link-button {
    background: transparent;
    border: 0;
    color: #2454d6;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 0;
    padding: 0;
}

.link-button:hover {
    text-decoration: underline;
}

.link-button.restore-link {
    color: #15803d;
}

.link-button.danger-link {
    color: #b42318;
}

.article-views-panel {
    margin-top: 20px;
}

.article-views-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-view-card {
    color: #172033;
    display: grid;
    gap: 10px;
}

.article-view-card strong {
    display: block;
    font-size: 15px;
    line-height: 1.25;
}

.article-view-card:hover strong {
    color: #1d4ed8;
}

.article-view-thumb {
    aspect-ratio: 16 / 10;
    background: #dbe8ff;
    border-radius: 8px;
    display: block;
    overflow: hidden;
    position: relative;
}

.article-view-thumb img,
.article-view-placeholder {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.article-view-placeholder {
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.18), rgba(20, 184, 166, 0.12)),
        #eaf1ff;
}

.article-view-count {
    align-items: center;
    background: rgba(16, 24, 40, 0.78);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    gap: 6px;
    left: 10px;
    padding: 5px 8px;
    position: absolute;
    top: 10px;
}

.article-view-count em {
    color: #bfdbfe;
    font-style: normal;
}

.article-view-list {
    display: grid;
    gap: 6px;
}

.article-view-row {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    gap: 28px;
    grid-template-columns: 260px minmax(0, 1fr);
    padding: 26px 0;
}

.article-view-row:last-child {
    border-bottom: 0;
}

.article-view-row-thumb {
    aspect-ratio: 16 / 10;
    background: #dbe8ff;
    border-radius: 8px;
    display: block;
    overflow: hidden;
    position: relative;
}

.article-view-row-thumb img,
.article-view-row-thumb .article-view-placeholder {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.article-view-row strong {
    display: block;
    font-size: 19px;
    line-height: 1.25;
}

.article-view-row p {
    color: #667085;
    font-weight: 800;
    margin: 6px 0 0;
}

.article-view-main {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.article-view-main > p {
    margin: -16px 0 0;
}

.article-view-open {
    background: rgba(16, 24, 40, 0.78);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    left: 8px;
    padding: 5px 8px;
    position: absolute;
    top: 8px;
}

.article-view-metrics {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
}

.view-metric span {
    color: #667085;
    display: block;
    font-size: 12px;
    font-weight: 900;
}

.view-metric strong {
    color: #1d4ed8;
    display: inline-block;
    font-size: 28px;
    line-height: 1;
}

.view-metric-row {
    align-items: baseline;
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.pagination {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
}

.pagination span {
    color: #667085;
    font-weight: 800;
}

.empty-state {
    color: #667085;
    font-weight: 800;
    text-align: center;
}

.sortable-table tr {
    transition: background 0.16s ease, opacity 0.16s ease;
}

.sortable-table tr.is-dragging {
    background: #eaf1ff;
    opacity: 0.55;
}

.drag-cell {
    width: 42px;
}

.drag-handle {
    color: #1d4ed8;
    cursor: grab;
    display: inline-block;
    font-weight: 900;
    letter-spacing: 0;
}

.child-prefix {
    color: #667085;
    font-weight: 900;
    margin-right: 6px;
}

.collapse-toggle {
    display: none;
}

.collapsible-title-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.collapsible-title-row h2 {
    margin: 0;
}

.collapsible-title-row label {
    color: #1d4ed8;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    margin: 0;
}

.collapse-toggle:checked + .collapsible-title-row label {
    font-size: 0;
}

.collapse-toggle:checked + .collapsible-title-row label::after {
    content: attr(data-open-text);
    font-size: 13px;
}

.collapsible-panel .referrer-row:nth-child(n+6),
.collapsible-panel .activity-table tr:nth-child(n+6) {
    display: none;
}

.collapsible-panel .collapse-toggle:checked ~ .referrer-list .referrer-row:nth-child(n+6) {
    display: grid;
}

.collapsible-panel .collapse-toggle:checked ~ .activity-table tr:nth-child(n+6) {
    display: table-row;
}

.referrer-list {
    display: grid;
    gap: 10px;
}

.referrer-row {
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 0;
    position: relative;
}

.referrer-row strong,
.referrer-row small {
    display: block;
}

.referrer-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.referrer-row i {
    background: #dbe8ff;
    border-radius: 999px;
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    position: relative;
}

.referrer-row i::before {
    background: #1d4ed8;
    border-radius: inherit;
    content: "";
    display: block;
    height: 100%;
    width: var(--bar-width);
}

.advanced-fields {
    border-top: 1px solid #e2e8f0;
    margin-top: 22px;
    padding-top: 18px;
}

.advanced-fields summary {
    color: #1d4ed8;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 12px;
}

small {
    color: #667085;
}

.panel-note {
    color: #667085;
    font-size: 14px;
    font-weight: 700;
    margin: -6px 0 14px;
}

.editor-head {
    align-items: end;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-top: 14px;
}

.editor-head label {
    margin: 0 0 6px;
}

.editor-modebar {
    background: #eaf1ff;
    border-radius: 999px;
    display: inline-flex;
    gap: 3px;
    padding: 3px;
}

.editor-modebar button {
    background: transparent;
    border-radius: 999px;
    color: #102a6b;
    min-height: 30px;
    padding: 5px 10px;
}

.editor-modebar button.is-active {
    background: #1d4ed8;
    color: #fff;
}

.editor-toolbar {
    background: #f8fbff;
    border: 1px solid #cfd7e6;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}

.editor-toolbar button {
    background: #eaf1ff;
    color: #102a6b;
    min-height: 34px;
    padding: 6px 10px;
}

.editor-toolbar button:hover {
    background: #dbe8ff;
}

.editor-toolbar + textarea {
    border-radius: 0 0 6px 6px;
}

.editor-is-rich [data-editor-toolbar] {
    display: none;
}

.editor-is-rich .editor-preview {
    display: none;
}

.editor-preview {
    border: 1px solid #d7e2f2;
    border-radius: 8px;
    margin-top: 14px;
    padding: 16px;
}

.editor-preview-label {
    color: #667085;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.article-body {
    font-size: 17px;
    line-height: 1.72;
}

.article-body h2,
.article-body h3 {
    line-height: 1.2;
    margin: 1.1em 0 0.5em;
}

.article-body img {
    border-radius: 8px;
    height: auto;
    max-width: 100%;
}

.article-body blockquote {
    border-left: 4px solid #1d4ed8;
    color: #475467;
    margin-left: 0;
    padding-left: 14px;
}

.article-body pre {
    background: #101828;
    border-radius: 8px;
    color: #fff;
    overflow-x: auto;
    padding: 14px;
}

.video-embed {
    aspect-ratio: 16 / 9;
    background: #101828;
    border-radius: 8px;
    overflow: hidden;
}

.video-embed iframe {
    border: 0;
    height: 100%;
    width: 100%;
}

.user-list-panel {
    margin-top: 20px;
}

.subscribers-actions {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.subscriber-filter {
    margin: 0;
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subscriber-command-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-fold {
    width: auto;
}

.inline-fold[open] {
    flex-basis: 100%;
    width: 100%;
}

.inline-fold summary {
    background: #1d4ed8;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    list-style: none;
    min-height: 42px;
    padding: 10px 14px;
}

.inline-fold summary::marker {
    content: "";
}

.inline-fold summary::-webkit-details-marker {
    display: none;
}

.inline-fold-panel {
    background: #fff;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    display: grid;
    gap: 18px 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
    margin-top: 22px;
    max-width: none;
    min-width: 0;
    padding: 24px;
    position: static;
}

.inline-fold-panel[hidden] {
    display: none;
}

.inline-fold-panel input[type="hidden"] {
    display: none;
}

.inline-fold-panel p {
    align-items: center;
    display: flex;
    grid-column: 1 / -1;
    justify-content: center;
    margin: 0;
}

.inline-fold-panel p button {
    min-width: 190px;
}

.add-subscriber-panel {
    align-items: start;
}

.add-subscriber-column {
    display: grid;
    gap: 18px;
}

.add-subscriber-column label {
    margin: 0;
}

.compact-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.compact-list li {
    border-top: 1px solid #e4ebf5;
    padding-top: 8px;
}

.compact-list small {
    color: #667085;
    display: block;
    font-size: 12px;
}

.marketing-fold {
    margin-top: 16px;
    padding: 0;
}

.marketing-fold summary {
    background: #eef4ff;
    border-radius: 8px;
    color: #102a6b;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    list-style: none;
    padding: 18px 20px;
}

.marketing-fold summary::-webkit-details-marker {
    display: none;
}

.marketing-fold[open] summary {
    border-bottom: 1px solid #dde3ef;
    border-radius: 8px 8px 0 0;
}

.marketing-form,
.draft-list {
    padding: 0 20px 20px;
}

.marketing-form {
    padding-top: 18px;
}

.marketing-form textarea {
    min-height: 180px;
}

.draft-list {
    border-top: 1px solid #e4ebf5;
}

.draft-list h3 {
    margin: 18px 0 10px;
}

.draft-item {
    align-items: center;
    border-top: 1px solid #e4ebf5;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    padding: 10px 0;
}

.draft-item:first-of-type {
    border-top: 0;
}

.draft-item > button:first-child {
    background: transparent;
    color: #1d4ed8;
    font-weight: 900;
    padding: 0;
    text-align: left;
}

.draft-item small {
    color: #667085;
    white-space: nowrap;
}

.draft-modal[hidden] {
    display: none;
}

.article-bulk-edit-modal[hidden] {
    display: none;
}

.article-bulk-edit-modal {
    align-items: center;
    background: rgba(16, 24, 40, 0.58);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 30;
}

.article-bulk-edit-card {
    background: #fff;
    border-radius: 10px;
    max-height: 86vh;
    max-width: 480px;
    overflow: auto;
    padding: 22px;
    position: relative;
    width: 100%;
}

.article-bulk-edit-card h2 {
    margin: 0 42px 8px 0;
}

.article-bulk-edit-card select {
    width: 100%;
}

.article-bulk-edit-card .form-actions {
    margin-top: 18px;
}

.article-bulk-edit-close {
    background: #eef4ff;
    color: #102a6b;
    min-height: 34px;
    padding: 6px 11px;
    position: absolute;
    right: 14px;
    top: 14px;
}

.draft-modal {
    align-items: center;
    background: rgba(16, 24, 40, 0.58);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 20;
}

.draft-modal-card {
    background: #fff;
    border-radius: 10px;
    max-height: 86vh;
    max-width: 760px;
    overflow: auto;
    padding: 22px;
    position: relative;
    width: min(100%, 760px);
}

.draft-modal-card h2 {
    margin-top: 0;
}

.draft-modal-close {
    background: #eef4ff;
    color: #102a6b;
    min-height: 34px;
    padding: 6px 11px;
    position: absolute;
    right: 14px;
    top: 14px;
}

.draft-modal-body {
    border: 1px solid #dde3ef;
    border-radius: 8px;
    margin-top: 12px;
    padding: 16px;
}

.draft-modal-body img {
    height: auto;
    max-width: 100%;
}

.draft-modal-card .form-actions form {
    margin: 0;
}

.email-editor-panel,
.email-list-panel,
.sent-email-list {
    margin-top: 20px;
}

.email-editor-panel {
    padding: 0;
}

.email-editor-panel summary {
    background: #eaf1ff;
    border-radius: 8px;
    color: #102a6b;
    cursor: pointer;
    display: block;
    font-size: 16px;
    font-weight: 900;
    list-style: none;
    padding: 18px 20px;
}

.email-editor-panel summary::marker {
    content: "";
}

.email-editor-panel summary::-webkit-details-marker {
    display: none;
}

.email-editor-panel[open] summary {
    border-bottom: 1px solid #dde3ef;
    border-radius: 8px 8px 0 0;
}

.email-bulk-form {
    margin-top: 16px;
}

.email-bulk-actions {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #e4ebf5;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(160px, 0.6fr) minmax(180px, 0.8fr) auto auto;
    margin-bottom: 12px;
    padding: 12px;
}

.bulk-check {
    align-items: center;
    color: #344054;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.bulk-check input,
.email-row > input {
    min-height: 0;
    width: auto;
}

.email-list {
    display: grid;
    gap: 10px;
}

.email-row {
    align-items: center;
    border: 1px solid #e4ebf5;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    padding: 14px;
}

.email-row-main {
    min-width: 0;
}

.email-title-button {
    background: transparent;
    color: #1d4ed8;
    font-size: 18px;
    font-weight: 900;
    padding: 0;
    text-align: left;
}

.email-row-main p {
    color: #172033;
    font-weight: 800;
    margin: 5px 0;
}

.email-row-main small {
    color: #667085;
    display: block;
    font-size: 12px;
}

.email-status {
    background: #eef4ff;
    border-radius: 999px;
    color: #102a6b;
    display: inline-block;
    font-size: 11px;
    font-weight: 900;
    margin-right: 6px;
    padding: 3px 8px;
}

.email-status.is-sent {
    background: #dcfce7;
    color: #166534;
}

.subscribers-table {
    margin-top: 20px;
}

.subscriber-list-actions {
    align-items: center;
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    justify-content: flex-end;
}

.subscriber-select-all {
    color: #667085;
}

.subscriber-select-all input,
.subscriber-check input {
    height: 18px;
    width: 18px;
}

.subscriber-list-actions form {
    margin: 0;
}

.subscriber-list-actions button {
    background: transparent;
    color: #1d4ed8;
    min-height: 0;
    padding: 0;
}

.subscriber-list-actions button:disabled {
    color: #98a2b3;
    cursor: default;
}

.subscriber-list-actions .danger-link {
    color: #b42318;
}

.subscriber-list-actions .sep {
    color: #c7d2e5;
}

.subscriber-row {
    align-items: center;
    border-top: 1px solid #e4ebf5;
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr 1.35fr 0.9fr 1fr 0.75fr minmax(160px, 1fr) auto;
    padding: 12px 0;
}

.subscriber-check {
    align-self: center;
    display: flex;
    padding-top: 18px;
}

.subscriber-check input {
    height: 18px;
    min-height: 0;
    width: 18px;
}

.subscriber-row label {
    margin: 0;
    min-width: 0;
}

.subscriber-row label span {
    color: #667085;
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
}

.subscriber-row input,
.subscriber-row select {
    min-height: 38px;
    padding: 8px 10px;
}

.subscriber-row input:disabled,
.subscriber-row select:disabled {
    background: transparent;
    border-color: transparent;
    color: #172033;
    opacity: 1;
    padding-left: 0;
}

.subscriber-row.is-editing input,
.subscriber-row.is-editing select {
    background: #fff;
    border-color: #cfd7e6;
    padding-left: 10px;
}

.subscriber-row button {
    min-height: 38px;
    padding: 8px 12px;
}

.site-footer.admin-footer {
    border-top: 1px solid #d7e2f2;
    margin-top: 30px;
    padding: 20px 0 6px;
    text-align: center;
}

.site-footer.admin-footer .wrap {
    margin: 0 auto;
    max-width: 1180px;
}

.site-footer.admin-footer p {
    color: #667085;
    font-weight: 800;
    margin: 0;
}

.site-footer.admin-footer span,
.site-footer.admin-footer a {
    margin-left: 10px;
}

@media (max-width: 1100px) {
    .stats-grid,
    .article-views-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .admin-shell {
        padding: 16px;
        width: 100%;
    }

    .article-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .article-bulk-actions .bulk-right {
        justify-content: flex-end;
        margin-left: 0;
        width: 100%;
    }

    .form-grid,
    .admin-two-col,
    .filter-bar,
    .article-view-filters {
        grid-template-columns: 1fr;
    }

    .subscriber-row {
        grid-template-columns: 1fr;
    }

    .draft-item {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .draft-item small {
        white-space: normal;
    }

    .subscriber-command-row {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-fold-panel {
        grid-template-columns: 1fr;
        position: static;
        width: 100%;
    }

    .add-subscriber-column {
        gap: 14px;
    }

    .email-bulk-actions,
    .email-row {
        grid-template-columns: 1fr;
    }

    .email-row > input {
        justify-self: start;
    }

    .stats-grid,
    .article-views-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        gap: 10px;
        margin: 14px 0;
    }

    .stat-card {
        min-height: 88px;
        padding: 12px;
    }

    .stat-card span {
        font-size: 11px;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .stat-value-row {
        gap: 8px;
        margin-top: 6px;
    }

    .stat-delta {
        font-size: 11px;
    }

    .article-views-grid {
        gap: 12px;
    }

    .article-views-grid .article-view-card:nth-child(n+5) {
        display: none;
    }

    .article-view-card {
        gap: 8px;
    }

    .article-view-card strong {
        font-size: 13px;
    }

    .article-view-count {
        font-size: 10px;
        left: 6px;
        padding: 4px 6px;
        top: 6px;
    }

    .article-views-panel .panel-title-row {
        align-items: center;
        flex-direction: row;
    }

    .stats-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .admin-header h1 {
        font-size: clamp(26px, 9vw, 38px);
    }

    .admin-title-row {
        min-width: 0;
        width: 100%;
    }

    .toolbar {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
    }

    .nav-button {
        min-width: 0;
    }

    .panel {
        padding: 16px;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        border-bottom: 1px solid #e2e8f0;
        padding: 10px 0;
    }

    td,
    th {
        border-bottom: 0;
        overflow-wrap: anywhere;
        padding: 7px 0;
    }

    .compact-table tr {
        padding: 6px 0;
    }

    .compact-table td,
    .compact-table th {
        padding: 4px 0;
    }

    .compact-table td:first-child {
        font-size: 14px;
        font-weight: 800;
    }

    .share-click-grid {
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-click-item {
        padding: 10px;
    }

    .share-click-item strong {
        font-size: 15px;
    }

    .article-view-row {
        align-items: stretch;
        display: grid;
        gap: 10px;
        grid-template-columns: 118px minmax(0, 1fr);
        padding: 12px 0;
    }

    .article-view-row-thumb {
        align-self: start;
    }

    .article-view-row strong {
        font-size: 14px;
    }

    .article-view-row p {
        font-size: 12px;
        margin-top: 3px;
    }

    .article-view-main {
        gap: 6px;
    }

    .article-view-open {
        font-size: 10px;
        left: 5px;
        padding: 3px 6px;
        top: 5px;
    }

    .article-view-metrics {
        gap: 7px 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 8px;
    }

    .view-metric span {
        font-size: 10px;
    }

    .view-metric strong {
        font-size: 17px;
    }

    .view-metric-row {
        gap: 6px;
        margin-top: 2px;
    }

    .referrer-list,
    .activity-table tbody {
        display: grid;
        gap: 0;
    }

    .collapsible-panel .referrer-row:nth-child(n+3),
    .collapsible-panel .activity-table tr:nth-child(n+3) {
        display: none;
    }

    .collapsible-panel .collapse-toggle:checked ~ .referrer-list .referrer-row:nth-child(n+3),
    .collapsible-panel .collapse-toggle:checked ~ .activity-table tr:nth-child(n+3) {
        display: grid;
    }

    .collapsible-panel .collapse-toggle:checked ~ .activity-table tr:nth-child(n+3) {
        display: block;
    }

    .referrer-row {
        padding: 6px 0;
    }

    .referrer-row small {
        font-size: 11px;
    }

    .activity-table tr {
        padding: 6px 0;
    }

    .activity-table td {
        padding: 3px 0;
    }

    .sortable-table tr {
        align-items: center;
        display: grid;
        gap: 6px;
        grid-template-columns: 18px minmax(70px, 1fr) minmax(62px, 0.75fr) 32px 34px;
        padding: 7px 0;
    }

    .sortable-table td {
        font-size: 12px;
        min-width: 0;
        overflow: hidden;
        padding: 0;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sortable-table .drag-cell {
        width: auto;
    }

    .sortable-table strong {
        font-size: 12px;
    }

    .child-prefix {
        margin-right: 2px;
    }

    .filter-actions,
    .inline-field,
    .panel-title-row,
    .editor-head,
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-field button {
        width: 100%;
    }

    .tox,
    .tox-tinymce {
        max-width: 100%;
    }
}
