:root {
    --ink: #1a2442;
    --muted: #616d86;
    --line: #e1e5f0;
    --paper: #f5f6fa;
    --pine: #19234a;
    --green: #4e55ae;
    --mint: #edeeff;
    --error: #aa2c46;
    font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
}
.desk { grid-template-columns: 206px minmax(0, 1fr); }
.sidebar { background: #fff; border-right: 1px solid var(--line); color: var(--ink); gap: 34px; padding: 22px 14px 18px; }
.masthead { color: var(--ink); padding: 2px 4px; }
.masthead strong { font-family: inherit; font-weight: 750; font-size: 18px; line-height: 1.05; }
.brand-mark { border: 0; border-radius: 13px; background: #e5e7ff; color: #393e9c; font-family: inherit; font-size: 15px; font-weight: 750; }
.masthead small, .account small { color: var(--muted); }
.navigation button { color: #505d79; padding: 11px 12px; }
.navigation button:hover { background: #f1f2fc; }
.navigation button[aria-current] { background: #eaebfd; border-color: #dddef9; color: #343a99; }
.avatar { background: #e6e9fb; color: #373f8f; }
.account-menu.surface { box-shadow: 0 8px 25px #20295724; }
.settings-navigation { display: flex; flex-wrap: wrap; align-items: center; padding: 6px; margin-bottom: 22px; }
.settings-navigation > strong { padding: 9px 11px; font-size: 14px; }
.auth-masthead { background: #ebeefe; border-right: 1px solid var(--line); }
.workspace { padding: 36px clamp(18px, 3.1vw, 43px) 54px; }
.page-heading { margin-bottom: 24px; }
h1 { font: 750 clamp(29px, 3.4vw, 43px)/1.08 "Avenir Next", Avenir, system-ui, sans-serif; letter-spacing: -.045em; }
.page-heading p.heading-date { margin: 0 0 7px; color: #666eb0; font-weight: 650; font-size: 13px; }
.primary, .sign-in { background: #424ab0; border-color: #424ab0; color: white; }
.primary:hover, .sign-in:hover { background: #363e9b; }
.button { border-color: #d8ddef; border-radius: 8px; }
.button:hover { background: #f0f1ff; }
.primary:hover { background: #363e9b; }
input, select, textarea { border-color: #d6ddef; }
.surface { border-color: var(--line); border-radius: 14px; box-shadow: 0 3px 12px #20295708; }
.story-row[aria-current] { background: #f0f1fe; }
.story-row:hover { background: #f6f7ff; }
.pill { background: #eeefff; color: #4a4da6; }
.feedback { background: #ededfd; color: #444a92; }
.form-card h2, .surface-heading h2, dialog h2 { font: 720 17px/1.25 "Avenir Next", Avenir, system-ui, sans-serif; }
.form-card:first-child { grid-row: auto; }
.report-form .form-card:first-child { grid-row: span 2; }
.story h2 { font-family: Georgia, "Times New Roman", serif; }
.story-source, .text-button { color: #454eab; }
.story-to-article { margin-top: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { padding: 16px 14px; min-height: 91px; }
.metric:first-child { background: #ecefff; border-color: #dfe4fc; }
.metric span { display: block; color: #586586; font-size: 12px; font-weight: 650; }
.metric strong { display: block; margin-top: 5px; color: #273470; font-size: 28px; font-weight: 740; line-height: 1.2; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.dashboard-grid > * { min-width: 0; }
.surface-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px; border-bottom: 1px solid var(--line); }
.activity-list { min-width: 0; }
.activity-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); padding: 13px 15px; text-align: left; background: transparent; color: var(--ink); }
button.activity-row:hover { background: #f5f6fe; }
.activity-row:last-child { border-bottom: 0; }
.activity-row strong { display: block; font-size: 13px; font-weight: 720; line-height: 1.35; overflow-wrap: anywhere; }
.activity-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-tag { flex-shrink: 0; display: inline-flex; padding: 4px 7px; border-radius: 7px; background: #f0f2f8; color: #596584; font-size: 11px; font-weight: 650; text-transform: capitalize; }
.status-tag[data-status=published], .status-tag[data-status=ready], .status-tag[data-status=active] { background: #e5f6eb; color: #286444; }
.status-tag[data-status=scheduled], .status-tag[data-status=processing] { background: #eeeafe; color: #57449f; }
.status-tag[data-status=failed] { background: #fbe8ec; color: #9b2c49; }
.library-filters, .library-pager { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px; border-bottom: 1px solid var(--line); }
.library-pager:empty { display: none; }
.library-filters label:first-child { flex: 1; }
.library-pager { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.compose-top, .compose-actions, .section-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.compose-top { margin-bottom: 13px; }
.compose-top a { display: inline-block; text-decoration: none; }
.compose-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(225px, 1fr); gap: 13px; align-items: start; }
.compose-main, .compose-side, .settings-fields { display: grid; gap: 10px; }
.compose-grid .form-card { gap: 10px; padding: 15px; }
.compose-grid label, .settings-fields label { font-size: 12px; }
.editor-tools { display: flex; gap: 5px; flex-wrap: wrap; }
.editor-tools .button { font-size: 11px; padding: 5px 7px; }
#article-body { min-height: 230px; line-height: 1.55; }
.settings-card summary { cursor: pointer; font-size: 13px; padding: 13px; font-weight: 680; }
.settings-card .settings-fields { padding: 0 13px 13px; }
.settings-fields label { display: grid; gap: 5px; font-weight: 650; }
.check, .form-card .check, .settings-fields .check { display: flex; gap: 7px; align-items: center; }
.check input { width: auto; accent-color: #4e55ae; }
.compose-actions { position: sticky; bottom: 5px; margin-top: 14px; padding: 10px; background: #ffffffed; }
.compose-actions div { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.compose-actions .feedback { margin: 0; }
.file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding: 7px 0; font-size: 12px; }
.file-row img { width: 38px; height: 32px; object-fit: cover; border-radius: 5px; }
.file-row strong { flex: 1 0 90px; overflow-wrap: anywhere; }
.issue-cover { width: min(140px, 100%); max-height: 192px; object-fit: contain; object-position: left; border-radius: 6px; }
.issue-actions, .newsletter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.newsletter-actions { padding-top: 14px; }
.newsletter-actions p { margin-right: auto; font-size: 13px; color: var(--muted); }
#issue-detail:not(:empty) { display: grid; gap: 10px; }
dialog { width: min(470px, calc(100% - 30px)); max-height: 80vh; overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
dialog::backdrop { background: #121d4a64; }
.reader { margin: 36px auto; padding: 0 18px 35px; max-width: 775px; }
.reader-brand { color: #4b55ac; font-size: 13px; font-weight: 750; margin-bottom: 10px; }
.reader h1 { margin-bottom: 11px; }
.reader-summary { font-size: 19px; color: #465471; margin: 10px 0; }
.reader-copy { margin-top: 16px; font: 17px/1.7 Georgia, "Times New Roman", serif; }
.reader-copy img, .reader-cover { display: block; max-width: 100%; height: auto; margin: 16px 0; border-radius: 6px; }
.reader-cover { width: 100%; }
.article-tag-picker { position: relative; display: grid; gap: 5px; }
.article-tag-picker input { width: 100%; }
.article-tag-picker .hint { margin: 0; }
.article-tag-options { position: absolute; z-index: 4; top: 62px; inset-inline: 0; max-height: 215px; overflow-y: auto; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 8px 20px #28345624; list-style: none; }
.article-tag-options li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border-radius: 5px; cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.article-tag-options li:hover, .article-tag-options li[aria-selected=true] { background: #edf0ff; }
.article-tag-options small { flex: none; color: var(--muted); }
.follow-channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 315px), 1fr)); gap: 14px; }
.follow-channel-grid .form-card { grid-row: auto; }
.follow-channel-grid input { width: 100%; }
.follow-channel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.follow-channel-actions .feedback { margin: 0; }
.category-language {
    display: grid;
    gap: 4px;
    min-width: 112px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}
.category-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; align-items: start; }
.category-form { display: grid; gap: 12px; }
.category-list { margin-top: 16px; }
.category-nav-preview { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.category-nav-preview li { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.category-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto 106px auto; gap: 8px 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.category-row > label.check, .category-row > button { margin-top: 19px; }
.category-row > .feedback { grid-column: 1 / -1; margin: 0; }
.editor-access-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; gap: 14px; }
.editor-access-list .editor-access-card { grid-row: auto; min-width: 0; overflow-wrap: anywhere; }
.editor-access-options { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0; padding: 0; border: 0; }
.editor-access-options legend { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.editor-access-card > button { justify-self: start; }
.staff-list { display: grid; }
.staff-row { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(160px, 1.2fr) auto; gap: 12px 16px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.staff-row:last-child { border-bottom: 0; }
.staff-row > button { justify-self: end; }
.staff-identity { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.staff-role-labels { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.staff-role-labels .status-tag { white-space: normal; overflow-wrap: anywhere; }
.staff-dialog { width: min(580px, calc(100% - 30px)); }
.staff-dialog summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 650; }
.staff-dialog details .location-fields { margin-top: 10px; }
.staff-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.staff-permission-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); }
.staff-page-feedback { margin: 10px 14px 0; }
@media (min-width: 666px) {
    .sidebar > .navigation { min-height: 0; overflow-y: auto; padding-block: 2px; }
}
@media (max-width: 640px) {
    .staff-row { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .staff-row > button { justify-self: start; }
}
@media (max-width: 690px) {
    .category-row { grid-template-columns: minmax(0, 1fr) 88px; }
    .category-row > label:first-child { grid-column: 1 / -1; }
    .category-row > label.check, .category-row > button { margin-top: 0; }
    .category-row > label.check { align-self: center; }
    .category-row > button { justify-self: start; }
}
.reader-form { max-width: 500px; padding: 20px 0; display: grid; gap: 14px; }
.reader-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
.reader-form label.check { display: flex; }
@media (max-width: 900px) { .desk { grid-template-columns: 158px minmax(0, 1fr); } .masthead strong { font-size: 15px; } }
@media (max-width: 740px) { .dashboard-grid, .compose-grid { grid-template-columns: 1fr; } .compose-actions { position: static; } .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 665px) { .desk { grid-template-columns: 1fr; } .sidebar { border: 0; border-bottom: 1px solid var(--line); gap: 12px; } .report-form .form-card:first-child { grid-row: auto; } }

.notification-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 13px 15px; margin-bottom: 16px; }
.notification-filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 650; }
.notification-filters label input { min-height: 36px; }
.notification-filters > span { align-self: center; color: var(--muted); font-size: 12px; }
.notification-report-content:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.notification-report-content > * { min-width: 0; }
.notification-report-content .metric-grid { margin: 0; }
.notification-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr); gap: 14px; align-items: start; }
.notification-trend { padding: 15px; }
.notification-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.notification-chart-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; background: var(--chart-colour); }
.notification-chart-plot { display: flex; gap: 2px; height: 116px; margin-top: 12px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); }
.notification-chart-day { display: flex; gap: 1px; align-items: flex-end; flex: 1; min-width: 0; }
.notification-chart-day i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--chart-colour); }
.notification-chart-day:hover { background: #263a7210; }
.notification-trend [data-series=new_devices] { --chart-colour: #5057b2; }
.notification-trend [data-series=sent] { --chart-colour: #297b66; }
.notification-trend [data-series=clicked] { --chart-colour: #b36923; }
.notification-chart-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 11px; color: var(--muted); }
.notification-daily summary { cursor: pointer; padding: 10px 15px; font-size: 13px; font-weight: 700; border-top: 1px solid var(--line); }
.notification-stat-list { margin: 0; padding: 2px 15px; }
.notification-stat-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.notification-stat-list > div:last-child { border-bottom: 0; }
.notification-stat-list dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.notification-table-scroll { overflow-x: auto; }
.notification-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
.notification-table thead { background: #f6f7fc; color: #586586; }
.notification-table th, .notification-table td { border-block-end: 1px solid var(--line); padding: 10px 11px; vertical-align: top; }
.notification-table tbody th { font-weight: 550; }
.notification-table tbody tr:last-child > * { border-bottom: 0; }
.notification-table td { font-variant-numeric: tabular-nums; }
.notification-table strong, .notification-table small { display: block; }
.notification-table small, #notification-delivery-alert, .notification-section-note { color: var(--muted); font-size: 12px; }
.notification-table small { margin-top: 4px; }
.notification-table .button { white-space: nowrap; font-size: 12px; }
.notification-campaign-table { min-width: 690px; }
.notification-detail-table { min-width: 805px; }
.notification-section-note { margin: 0; padding: 10px 15px; }
.notification-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 0 15px 14px; }
.notification-breakdowns section { border: 1px solid var(--line); border-radius: 9px; }
.notification-breakdowns h3 { padding: 10px 12px 3px; font-size: 13px; }
.notification-breakdowns .notification-stat-list { padding-inline: 12px; }
.notification-report-content .status-tag[data-status=sent] { background: #e5f6eb; color: #286444; }
.notification-report-content .status-tag[data-status=expired] { background: #faefde; color: #8b541e; }
@media (max-width: 880px) { .notification-analysis-grid { grid-template-columns: minmax(0, 1fr); } }
