:root {
    --bg: #faf8f4;
    --surface: #fffefa;
    --text: #152e32;
    --muted: #637173;
    --line: #deded7;
    --brand: #073b40;
    --soft: #efede6;
    --accent: #12648a;
    --danger: #a32626;
    --radius: 14px;
    color-scheme: light;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font:
        16px/1.65 system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
}
body[data-theme='dark'] {
    --bg: #132326;
    --surface: #1b2e31;
    --text: #e9eeea;
    --muted: #b1c0bf;
    --line: #385054;
    --brand: #c5e8df;
    --soft: #253b3e;
    --accent: #87cce7;
    --danger: #ffb4b4;
    color-scheme: dark;
}
a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    color: var(--accent);
}
button,
input,
textarea,
select {
    font: inherit;
}
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 19px;
    border: 1px solid var(--brand);
    border-radius: 9px;
    background: var(--brand);
    color: var(--surface);
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    transition:
        opacity 0.15s,
        background 0.15s;
}
button:hover,
.button:hover {
    opacity: 0.85;
    color: var(--surface);
}
button:disabled {
    cursor: wait;
    opacity: 0.55;
}
.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}
.secondary:hover {
    background: var(--soft);
    color: var(--text);
}
.text-button,
.icon-button {
    background: none;
    color: var(--text);
    border-color: transparent;
    padding: 8px 10px;
}
.text-button:hover,
.icon-button:hover {
    color: var(--accent);
    background: var(--soft);
}
input,
textarea,
select {
    width: 100%;
    max-width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    min-height: 46px;
}
textarea {
    resize: vertical;
}
input[type='checkbox'] {
    width: 20px;
    min-height: 20px;
    accent-color: var(--brand);
}
:focus-visible {
    outline: 3px solid #39a9d6;
    outline-offset: 3px;
}
h1,
h2,
h3,
h4 {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0 0 0.65em;
}
h1 {
    font-size: clamp(32px, 4.4vw, 60px);
}
h2 {
    font-size: 30px;
}
h3 {
    font-size: 24px;
}
p {
    margin: 0 0 1em;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 24px 0;
}
label {
    display: block;
}
[hidden] {
    display: none !important;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.skip-link {
    position: fixed;
    top: -80px;
    z-index: 100;
    background: var(--surface);
    padding: 12px;
}
.skip-link:focus {
    top: 10px;
}
.wrap {
    max-width: 1200px;
    padding: 0 32px;
    margin: auto;
}
.narrow {
    max-width: 780px;
    margin: 48px auto;
    padding: 0 24px;
}
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    max-width: 1320px;
    min-height: 80px;
    padding: 10px 32px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 40px;
}
.brand {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 0;
    background: transparent;
    border-radius: 0;
    line-height: 1;
}
.brand img {
    width: 112px;
    height: auto;
}
.header-inner nav,
.header-tools {
    display: flex;
    align-items: center;
    gap: 24px;
}
.header-inner nav a {
    padding: 14px 0;
    font-size: 14px;
}
.header-inner nav .active {
    border-bottom: 2px solid var(--brand);
    font-weight: 700;
}
.header-tools {
    margin-inline-start: auto;
    gap: 12px;
}
.admin-link {
    font-size: 12px;
}
.language-picker {
    position: relative;
    flex-shrink: 0;
    z-index: 30;
}
.language-picker summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 650;
}
.language-picker summary::-webkit-details-marker {
    display: none;
}
.language-picker summary:hover,
.language-picker[open] summary {
    background: var(--soft);
}
.language-picker svg {
    width: 18px;
    height: 18px;
}
.language-picker .language-chevron {
    width: 12px;
    height: 12px;
}
.language-picker[open] .language-chevron {
    transform: rotate(180deg);
}
.language-options {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    width: 196px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 35px #0002;
}
.language-options a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 14px;
}
.language-options a:hover,
.language-options a[aria-current] {
    background: var(--soft);
    color: var(--accent);
}

.view-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.view-count svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.eyebrow {
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 0.055em;
    font-weight: 650;
    margin: 0 0 12px;
}
.intro-lead {
    font-size: 19px;
    color: var(--muted);
    max-width: 640px;
}
.search {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 6px;
    margin: 25px 0 10px;
    max-width: 680px;
}
.search > span {
    font-size: 26px;
    padding-inline-start: 10px;
}
.search input {
    border: 0;
    background: transparent;
    min-width: 0;
}
.category-tabs {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 10px 0 22px;
    scrollbar-width: thin;
}
.category-tabs a,
.subcategories a {
    flex-shrink: 0;
    background: var(--soft);
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 14px;
    min-height: 42px;
}
.category-tabs .selected,
.subcategories .selected {
    color: var(--surface);
    background: var(--brand);
}
.subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}
.feature-section {
    margin: 12px 0 55px;
}
.feature-card {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 34px;
    align-items: center;
}
.card-photo {
    overflow: hidden;
    background: var(--soft);
    border-radius: var(--radius);
    aspect-ratio: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.card-photo:hover img {
    transform: scale(1.025);
}
.feature-card .card-photo {
    aspect-ratio: 1.35;
}
.feature-card h2 {
    font-size: clamp(28px, 3vw, 42px);
}
.meta {
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.muted {
    color: var(--muted);
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 35px 0 24px;
}
.section-heading h1,
.section-heading h2 {
    margin-bottom: 0;
}
.story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 25px;
}
.story-card .card-copy {
    padding: 18px 0 0;
}
.story-card h2 {
    font-size: 26px;
    overflow-wrap: anywhere;
}
.feature-card .card-copy {
    padding: 0;
}
.story-card .eyebrow {
    margin-bottom: 8px;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 50px 0;
}
.site-footer {
    border-top: 1px solid var(--line);
    max-width: 1200px;
    margin: 70px auto 0;
    padding: 40px 32px;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 30px;
    color: var(--muted);
}
.site-footer .brand {
    color: var(--text);
}
.site-footer p {
    font-size: 13px;
    margin-top: 14px;
}
.site-footer nav {
    display: flex;
    gap: 20px;
    font-size: 13px;
}
.site-footer small {
    font-size: 12px;
}
.empty-state {
    text-align: center;
    padding: 65px 10px;
}
.article-wrap {
    max-width: 1080px;
    margin: 42px auto;
    padding: 0 32px;
}
.back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 22px;
}
.article-heading {
    max-width: 840px;
    margin: 0 auto;
}
.article-heading h1 {
    font-size: clamp(34px, 4.7vw, 62px);
}
.article-lead {
    font-size: 21px;
    color: var(--muted);
}
.article-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 24px 0;
}
.article-info p {
    margin: 0;
}
.article-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 5px;
}
.article-tools button {
    font-size: 12px;
}
.article-cover {
    margin: 24px 0 38px;
}
.article-cover img {
    width: 100%;
    max-height: 490px;
    object-fit: cover;
    border-radius: var(--radius);
}
.reading-column {
    max-width: 720px;
    margin-inline: auto;
}
.contents {
    background: var(--soft);
    padding: 16px 20px;
    border-radius: 9px;
    margin: 0 0 32px;
}
.contents summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
}
.contents ol {
    padding-inline-start: 25px;
}
.contents li {
    margin: 8px 0;
}
.contents a {
    color: var(--accent);
}
.article-body {
    font-size: 19px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}
.article-body p {
    margin: 0 0 1.3em;
}
.article-body h2 {
    font-size: 32px;
    margin: 1.5em 0 0.6em;
}
.article-body h3 {
    font-size: 25px;
    margin: 1.5em 0 0.6em;
}
.article-body blockquote {
    margin: 25px 0;
    padding: 24px;
    border-inline-start: 3px solid var(--accent);
    background: var(--soft);
    border-radius: 0 10px 10px 0;
}
.article-body li {
    padding-inline-start: 5px;
    margin-bottom: 8px;
}
.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-body figure {
    margin: 30px 0;
}
.article-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 25px 0;
    height: auto;
}
.article-body figcaption {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.article-body table {
    display: block;
    max-width: 100%;
    overflow: auto;
    border-collapse: collapse;
}
.article-body td,
.article-body th {
    border: 1px solid var(--line);
    padding: 10px;
}
.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 25px 0;
}
.article-gallery img {
    border-radius: 10px;
}
.article-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 35px 0;
}
.related {
    border-top: 1px solid var(--line);
    padding-top: 35px;
    margin: 60px 0;
}
.comments {
    padding-top: 15px;
}
.comments textarea {
    margin-bottom: 14px;
}
.comment {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}
.comment > div:first-child {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}
.comment time {
    font-size: 12px;
    color: var(--muted);
}
.comment p {
    margin: 12px 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 30;
    pointer-events: none;
}
.reading-progress span {
    display: block;
    height: 100%;
    background: #2499b6;
    width: 0;
}
.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    background: var(--brand);
    color: var(--surface);
    padding: 12px 22px;
    border-radius: 10px;
    z-index: 100;
}
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.notice {
    padding: 16px 20px;
    background: var(--soft);
    border-radius: 8px;
    margin: 20px auto;
}
.error {
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 12px;
}
.install {
    padding: 30px;
}
.admin-page {
    padding-top: 28px;
}
.admin-list {
    margin-top: 30px;
}
.admin-item {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}
.admin-item h2 {
    font-size: 24px;
    margin: 8px 0;
}
.admin-thumb {
    aspect-ratio: 1.4;
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
}
.admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.badge {
    font-size: 11px;
    background: var(--soft);
    border-radius: 5px;
    padding: 4px 9px;
}
.inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.editor-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 28px;
}
.editor-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.editor-bar > a {
    font-size: 14px;
}
.save-status {
    font-size: 12px;
    color: var(--muted);
}
.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 35px;
    padding-top: 28px;
}
.editor-document {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    min-width: 0;
}
.editor-cover {
    position: relative;
    background: var(--soft);
    border-radius: 10px;
    min-height: 170px;
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.editor-cover img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}
.editor-cover button {
    position: absolute;
    bottom: 18px;
    inset-inline-start: 18px;
}
.title-input,
.excerpt-input {
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    resize: none;
    overflow: hidden;
}
.title-input {
    font:
        38px/1.18 Georgia,
        serif;
    letter-spacing: -0.025em;
    min-height: 100px;
    margin-bottom: 14px;
}
.excerpt-input {
    font-size: 19px;
    color: var(--muted);
    margin-bottom: 24px;
    min-height: 65px;
}
.format-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    position: sticky;
    top: 85px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 5px;
    z-index: 10;
}
.format-toolbar button {
    min-height: 40px;
    min-width: 40px;
    padding: 7px;
    border: 0;
    background: transparent;
    color: var(--text);
}
.format-toolbar button:hover {
    background: var(--soft);
}
.editable {
    min-height: 350px;
    padding: 24px 0;
    outline: none;
}
.editable:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}
.editable:focus-visible {
    outline: 0;
}
.block-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}
.block-actions > span {
    font-size: 13px;
    margin-inline-end: 10px;
}
.block-actions button {
    font-size: 13px;
}
.editor-settings {
    padding: 8px 0;
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100dvh - 120px);
    overflow: auto;
}
.editor-settings h2 {
    font: 650 20px system-ui;
}
.editor-settings label {
    font-size: 13px;
    margin-bottom: 24px;
}
.editor-settings input,
.editor-settings select,
.editor-settings textarea {
    margin-top: 8px;
    font-size: 14px;
}
.editor-settings .check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.check-label input {
    margin: 0;
}
.field-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}
.editor-settings details {
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 22px 0;
}
.editor-settings summary {
    cursor: pointer;
}
.editor-settings details[open] summary {
    margin-bottom: 15px;
}
.editor-buttons {
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding-top: 24px;
}
.editor-buttons h3 {
    font: 650 16px system-ui;
}
.button-fields {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}
.button-fields input {
    font-size: 13px;
    min-width: 0;
}
.danger {
    color: var(--danger);
}
.mobile-settings-button,
.settings-close {
    display: none;
}
dialog {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 28px;
    width: min(460px, 92vw);
}
dialog::backdrop {
    background: #0006;
}
dialog .inline-actions {
    justify-content: flex-end;
    margin-top: 20px;
}
body:has(.editor-page) .site-footer {
    margin-top: 45px;
}
@media (min-width: 1400px) {
    .editor-document {
        padding: 40px 50px;
    }
}
@media (max-width: 950px) {
    .header-inner {
        gap: 20px;
        padding: 10px 24px;
    }
    .header-inner nav,
    .header-tools {
        gap: 12px;
    }
    .admin-link {
        max-width: 85px;
        line-height: 1.3;
    }
    .story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .feature-card {
        gap: 24px;
    }
    .editor-layout {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 20px;
    }
    .editor-document {
        padding: 22px;
    }
    .editor-page {
        padding: 0 20px;
    }
    .title-input {
        font-size: 32px;
    }
    .site-footer {
        flex-wrap: wrap;
    }
    .site-footer nav {
        flex-wrap: wrap;
    }
}
@media (max-width: 700px) {
    body {
        font-size: 15px;
    }
    .wrap {
        padding: 0 20px;
    }
    .header-inner {
        padding: 9px 16px;
        min-height: 65px;
        gap: 18px;
    }
    .brand {
        font-size: 27px;
    }
    .header-inner nav {
        display: none;
    }
    .header-tools {
        gap: 3px;
    }
    .admin-link {
        font-size: 10px;
        max-width: 70px;
    }
    .icon-button {
        padding: 5px;
        min-width: 36px;
    }

    .intro-lead {
        font-size: 17px;
    }
    .search {
        margin-top: 20px;
    }
    .search button {
        padding: 10px 14px;
    }
    .category-tabs {
        margin-inline: -20px;
        padding-inline: 20px;
    }
    .category-tabs a {
        font-size: 13px;
    }
    .feature-section {
        margin: 6px 0 35px;
    }
    .feature-card {
        display: block;
    }
    .feature-card .card-photo {
        aspect-ratio: 1.4;
    }
    .feature-card .card-copy {
        padding-top: 20px;
    }
    .feature-card h2 {
        font-size: 29px;
    }
    .story-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .story-card h2 {
        font-size: 25px;
    }
    .story-card .card-photo {
        aspect-ratio: 1.7;
    }
    .section-heading {
        align-items: flex-start;
    }
    .section-heading h2 {
        font-size: 26px;
    }
    .section-heading > .muted {
        font-size: 11px;
        white-space: nowrap;
    }
    .site-footer {
        padding: 30px 20px;
        display: block;
        margin-top: 45px;
    }
    .site-footer nav {
        gap: 18px;
        margin: 25px 0;
    }
    .article-wrap {
        padding: 0 20px;
        margin-top: 22px;
    }
    .article-heading h1 {
        font-size: 35px;
    }
    .article-lead {
        font-size: 18px;
    }
    .article-info {
        display: block;
    }
    .article-tools {
        margin-top: 12px;
        gap: 6px;
    }
    .article-cover {
        margin: 18px -4px 28px;
    }
    .article-cover img {
        max-height: 300px;
        aspect-ratio: 1.4;
    }
    .article-body {
        font-size: 18px;
        line-height: 1.85;
    }
    .article-body h2 {
        font-size: 28px;
    }
    .article-body h3 {
        font-size: 24px;
    }
    .related {
        margin: 40px 0;
    }
    .related .story-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
    }
    .related .story-card {
        min-width: 80%;
        scroll-snap-align: start;
    }
    .comments h2 {
        font-size: 27px;
    }
    .article-actions .button {
        width: 100%;
    }
    .admin-page {
        padding-top: 15px;
    }
    .admin-page h1 {
        font-size: 30px;
    }
    .admin-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }
    .admin-item h2 {
        font-size: 21px;
    }
    .admin-item > .button {
        grid-column: 2;
        justify-self: start;
    }
    .editor-page {
        padding: 0 12px 85px;
    }
    .editor-bar {
        gap: 6px;
        padding: 10px 0;
        flex-wrap: wrap;
    }
    .editor-bar > a {
        font-size: 12px;
    }
    .editor-bar > .inline-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    .editor-bar button {
        font-size: 12px;
        min-height: 44px;
        padding: 9px 7px;
    }
    .save-status {
        font-size: 11px;
        max-width: 65%;
        text-align: end;
    }
    .editor-layout {
        display: block;
        padding-top: 14px;
    }
    .editor-document {
        padding: 16px 14px;
        border-radius: 10px;
    }
    .editor-cover {
        min-height: 145px;
        margin-bottom: 22px;
    }
    .editor-cover img {
        height: 200px;
    }
    .editor-cover button {
        font-size: 12px;
        bottom: 10px;
        inset-inline-start: 10px;
    }
    .title-input {
        font-size: 29px;
    }
    .excerpt-input {
        font-size: 17px;
    }
    .format-toolbar {
        top: 112px;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 1px;
    }
    .format-toolbar button {
        min-width: 37px;
        flex-shrink: 0;
        padding: 7px 5px;
    }
    .editable {
        min-height: 360px;
    }
    .block-actions {
        gap: 8px;
    }
    .block-actions > span {
        width: 100%;
    }
    .editor-settings {
        position: fixed;
        inset: auto 0 0;
        z-index: 60;
        max-height: 88dvh;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 20px 20px 0 0;
        padding: 22px 24px 40px;
        box-shadow: 0 -20px 80px #0004;
        display: none;
    }
    .editor-settings.open {
        display: block;
    }
    .settings-close {
        display: flex;
        margin-inline-start: auto;
        margin-bottom: 16px;
    }
    .mobile-settings-button {
        display: flex;
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 30;
        box-shadow: 0 4px 20px #0002;
        padding: 12px 25px;
    }
    .button-fields {
        grid-template-columns: 1fr auto;
    }
    .button-fields input {
        grid-column: 1;
    }
    .button-fields button {
        grid-column: 2;
        grid-row: 1 / 3;
    }
    .editor-page + .site-footer {
        display: none;
    }
    .inline-actions {
        gap: 7px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        transition: none !important;
    }
}
@media print {
    .site-header,
    .site-footer,
    .article-tools,
    .reading-progress,
    .related,
    .comments,
    .back-link {
        display: none;
    }
    .article-wrap {
        max-width: none;
    }
    .article-body {
        font-size: 12pt;
    }
    .article-cover img {
        max-height: 240px;
    }
}

@media (max-width: 420px) {
    .header-inner {
        gap: 10px;
    }
    .header-inner .brand {
        font-size: 25px;
        flex-shrink: 0;
    }
    .admin-link {
        font-size: 0;
        width: 24px;
        max-width: 24px;
    }
    .admin-link::before {
        content: '⚙';
        font-size: 20px;
    }
    .header-tools {
        min-width: 0;
    }
    .editor-bar > .inline-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .editor-bar button {
        min-width: 0;
        padding-inline: 4px;
        font-size: 11px;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 900px) {
    .header-inner {
        gap: 20px;
    }
    .header-tools {
        gap: 6px;
    }
}
@media (max-width: 700px) {
    .brand {
        padding: 6px;
    }
    .brand img {
        width: 84px;
    }
    .language-picker summary {
        gap: 5px;
        padding: 8px;
    }
    .header-inner {
        gap: 10px;
    }
    .header-tools {
        gap: 3px;
    }
}

.settings-page form {
    display: grid;
    gap: 16px;
}
.settings-page h1 {
    font-size: 40px;
}
.settings-page h2 {
    margin-top: 28px;
}
.connection-test {
    margin-top: 16px;
}
.translation-panel button {
    width: 100%;
}
.translation-panel a {
    color: var(--accent);
    text-decoration: underline;
}

/* The hero photograph fades into the page behind live text and search. */
.journal-intro {
    position: relative;
    isolation: isolate;
    min-height: 350px;
    padding: 48px 0 14px;
}
.journal-intro-copy {
    position: relative;
    z-index: 1;
    width: 76%;
    min-width: 0;
}
.journal-intro h1 {
    max-width: 680px;
    font-size: clamp(36px, 4.2vw, 56px);
    margin-bottom: 20px;
}
.journal-intro .intro-lead {
    max-width: 720px;
    font-size: 18px;
    color: var(--text);
}
.journal-intro .search {
    max-width: 760px;
    margin-top: 24px;
    box-shadow: 0 5px 20px #152e3207;
}
.journal-intro-photo {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: -62px;
    inset-inline-end: -32px;
    width: 88%;
    pointer-events: none;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, #000 64%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 64%);
}
.journal-intro-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg), transparent 19%);
}
.journal-intro-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right 55%;
}
body[data-theme='dark'] .journal-intro-photo {
    opacity: 0.38;
}
[dir='rtl'] .journal-intro-photo {
    transform: scaleX(-1);
}
.journal-intro + .category-tabs {
    position: relative;
    z-index: 1;
}
@media (max-width: 900px) {
    .journal-intro-copy {
        width: 84%;
    }
    .journal-intro h1 {
        max-width: 580px;
    }
}
@media (max-width: 700px) {
    .brand {
        padding: 0;
    }
    .journal-intro {
        min-height: 330px;
        padding: 32px 0 8px;
    }
    .journal-intro-copy {
        width: 100%;
    }
    .journal-intro h1 {
        max-width: 410px;
        font-size: clamp(32px, 7vw, 42px);
    }
    .journal-intro .intro-lead {
        font-size: 16px;
        max-width: 92%;
    }
    .journal-intro-photo {
        inset-inline-end: -20px;
        width: 100%;
        bottom: -56px;
        opacity: 0.35;
        mask-image: linear-gradient(to right, transparent 5%, #000 100%);
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 5%,
            #000 100%
        );
    }
    .journal-intro-photo::after {
        background: linear-gradient(to top, var(--bg), transparent 22%);
    }
    body[data-theme='dark'] .journal-intro-photo {
        opacity: 0.22;
    }
}

.brand .brand-logo-dark {
    display: none;
}
body[data-theme='dark'] .brand .brand-logo-light {
    display: none;
}
body[data-theme='dark'] .brand .brand-logo-dark {
    display: block;
}

/* Article management stays usable on narrow screens. */
.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
button.danger {
    color: #c33b42;
    border: 1px solid currentColor;
}
@media (max-width: 600px) {
    .article-actions {
        grid-column: 1/-1;
    }
    .article-actions > * {
        flex: 1;
    }
}
.admin-item > div {
    min-width: 0;
    overflow-wrap: anywhere;
}
.admin-item {
    grid-template-columns: 140px minmax(0, 1fr) auto;
}
@media (max-width: 700px) {
    .admin-item {
        grid-template-columns: 80px minmax(0, 1fr);
    }
    .article-actions {
        grid-column: 1/-1;
    }
    .admin-page .section-heading {
        flex-wrap: wrap;
    }
    .admin-page .section-heading button {
        max-width: 100%;
    }
}

/* A complete article arrives as one package. */
.import-panel {
    padding: 0;
    margin-bottom: 28px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgb(15 48 50 / 3%);
}
.import-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    cursor: pointer;
    list-style: none;
}
.import-summary::-webkit-details-marker {
    display: none;
}
.import-summary::marker {
    content: '';
}
.import-summary:hover {
    background: var(--bg);
}
.import-summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -4px;
}
.import-mark {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--soft);
    color: var(--brand);
}
.import-mark svg {
    width: 25px;
    height: 25px;
}
.import-summary-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.import-summary-copy strong {
    font-size: 18px;
    font-weight: 650;
    line-height: 1.35;
}
.import-summary-copy > span {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}
.import-format {
    font-size: 12px;
    white-space: nowrap;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 4px 10px;
}
.import-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.2s;
}
.import-panel[open] .import-chevron {
    transform: rotate(180deg);
}
#import-article {
    display: grid;
    gap: 20px;
    padding: 0 28px 24px;
}
.import-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 212px;
    margin: 0;
    padding: 28px 24px;
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    background: var(--bg);
    text-align: center;
    cursor: pointer;
    transition:
        background 0.18s,
        border-color 0.18s,
        box-shadow 0.18s;
}
.import-dropzone:hover,
.import-dropzone.is-dragging,
.import-dropzone:focus-within {
    border-color: var(--accent);
    background: var(--soft);
}
.import-dropzone:focus-within {
    box-shadow: 0 0 0 3px var(--line);
}
.import-dropzone.has-file {
    border-style: solid;
    border-color: var(--brand);
}
.import-dropzone input[type='file'] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    min-width: 0;
}
.import-upload-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 3px;
    color: var(--brand);
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
}
.import-upload-icon svg {
    width: 25px;
    height: 25px;
}
.import-file-title {
    max-width: 100%;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.import-file-hint {
    font-size: 14px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.5;
}
.import-file-tag {
    font-size: 11px;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.6;
}
.import-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.import-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: 490px;
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
}
.import-note svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    margin-top: 1px;
}
.import-submit {
    flex-shrink: 0;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 11px;
}
.import-submit:disabled {
    cursor: not-allowed;
}
.import-next {
    width: 18px;
    height: 18px;
}
[dir='rtl'] .import-next {
    transform: rotate(180deg);
}
.import-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: import-spin 0.8s linear infinite;
}
.import-form[aria-busy='true'] .import-spinner {
    display: inline-block;
}
.import-form[aria-busy='true'] .import-next {
    display: none;
}
.import-form[aria-busy='true'] .import-dropzone {
    opacity: 0.7;
}
#import-status {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    overflow-wrap: anywhere;
}
#import-status:empty {
    display: none;
}
#import-status.is-error {
    color: var(--danger);
}
@keyframes import-spin {
    to {
        transform: rotate(360deg);
    }
}
@media (max-width: 600px) {
    .import-summary {
        padding: 20px 18px;
        gap: 12px;
    }
    .import-mark {
        flex-basis: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .import-summary-copy strong {
        font-size: 16px;
    }
    .import-summary-copy > span {
        font-size: 12px;
    }
    .import-format {
        display: none;
    }
    #import-article {
        padding: 0 18px 20px;
        gap: 16px;
    }
    .import-dropzone {
        min-height: 210px;
        padding: 24px 16px;
    }
    .import-file-title {
        font-size: 16px;
    }
    .import-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .import-submit {
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    .import-chevron,
    .import-dropzone {
        transition: none;
    }
    .import-spinner {
        animation: none;
    }
}

/* The queue stays visible across blog pages, independently of the editor. */
.queue-toggle {
    position: relative;
}
.queue-toggle svg {
    width: 21px;
    height: 21px;
}
#translation-queue-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border-radius: 100px;
    background: var(--accent);
    color: var(--surface);
    font-size: 11px;
    line-height: 19px;
    font-weight: 700;
}
.translation-queue-panel {
    position: fixed;
    top: 86px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 104px);
    z-index: 95;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 60px rgb(0 0 0 / 16%);
    overflow: hidden;
}
.translation-queue-panel[hidden] {
    display: none;
}
.queue-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 8px;
}
.queue-heading .eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
}
.queue-heading h2 {
    margin: 2px 0 0;
    font-size: 24px;
    line-height: 1.2;
}
.queue-summary {
    margin: 0;
    padding: 0 20px 15px;
    color: var(--muted);
    font-size: 13px;
    border-bottom: 1px solid var(--line);
}
.queue-jobs {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    padding: 0 16px;
}
.queue-job {
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
}
.queue-job:last-child {
    border-bottom: 0;
}
.queue-job-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    margin-bottom: 8px;
}
.queue-status {
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--soft);
    color: var(--muted);
}
.queue-job-running .queue-status {
    color: var(--accent);
}
.queue-job-error .queue-status,
.queue-job-interrupted .queue-status {
    color: var(--danger);
}
.queue-fraction {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.queue-job-title {
    display: block;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.queue-job progress {
    display: block;
    width: 100%;
    height: 5px;
    appearance: none;
    accent-color: var(--accent);
    border: 0;
    border-radius: 6px;
    background: var(--soft);
    overflow: hidden;
    margin: 13px 0;
}
.queue-job progress::-webkit-progress-bar {
    background: var(--soft);
}
.queue-job progress::-webkit-progress-value {
    background: var(--accent);
}
.queue-job progress::-moz-progress-bar {
    background: var(--accent);
}
.queue-languages {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.queue-languages span {
    font-size: 10px;
    line-height: 1.6;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
}
.queue-languages .is-done {
    color: var(--brand);
    background: var(--soft);
}
.queue-languages .is-current {
    border-color: var(--accent);
    color: var(--accent);
}
.queue-remaining {
    font-size: 11px;
    color: var(--muted);
    margin: 9px 0 0;
}
.queue-job-error,
.queue-error {
    font-size: 12px;
    color: var(--danger);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.queue-error {
    margin: 12px 20px;
}
.queue-retry {
    font-size: 12px;
    min-height: 35px;
    padding: 6px 10px;
    margin-top: 10px;
}
.queue-empty {
    font-size: 14px;
    color: var(--muted);
    padding: 16px 4px;
}
.queue-footer {
    display: grid;
    gap: 6px;
    border-top: 1px solid var(--line);
    padding: 12px 20px;
    font-size: 11px;
    color: var(--muted);
}
.queue-footer a {
    color: var(--accent);
    justify-self: start;
}
#queue-editor-note {
    margin: 16px 24px;
    font-size: 14px;
}
#queue-editor-note[hidden] {
    display: none;
}
.queue-cron-command {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    background: var(--soft);
    border: 1px solid var(--line);
    font:
        13px/1.6 ui-monospace,
        monospace;
    overflow-wrap: anywhere;
    user-select: all;
}
@media (max-width: 600px) {
    .translation-queue-panel {
        right: 12px;
        top: 78px;
        max-height: calc(100dvh - 92px);
    }
    .header-tools {
        gap: 6px;
    }
    .queue-toggle {
        flex-shrink: 0;
    }
    #queue-editor-note {
        margin: 12px 0;
    }
}
@media (max-width: 400px) {
    .header-inner {
        padding-inline: 10px;
        gap: 4px;
    }
    .header-inner .brand img {
        width: 72px;
    }
    .header-tools {
        gap: 1px;
    }
    .header-tools .icon-button {
        min-width: 32px;
        padding: 4px;
    }
    .language-picker summary {
        padding-inline: 5px;
        gap: 3px;
    }
}
