:root {
    --dc-blue: #3d79a9;
    --dc-blue-dark: #2f628b;
    --dc-blue-light: #b8d3ea;
    --dc-blue-pale: #dceaf6;
    --dc-text: #202020;
    --dc-muted: #5f6670;
    --dc-background: #ffffff;
    --dc-border: #c8d4df;
    --dc-content-width: 1100px;
    --dc-reading-width: 780px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--dc-background);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--dc-text);
    background: var(--dc-background);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: var(--dc-blue);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--dc-blue-dark);
    text-decoration: underline;
}

.site-header {
    width: 100%;
    background: var(--dc-blue-light);
    border-bottom: 1px solid #9fbdd7;
}

.site-nav {
    width: 100%;
    height: 30px;
    padding: 0 20px 6px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
}

.site-nav a {
    display: inline-block;
    color: #34414d;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--dc-blue-dark);
    text-decoration: underline;
}

.nav-separator {
    color: #657687;
    line-height: 1;
    user-select: none;
}

.header-inner {
    position: relative;
    width: 100%;
    min-height: 102px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-link {
    position: absolute;
    left: 20px;
    top: 50%;
    display: block;
    transform: translateY(-50%);
}

.header-logo {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 100px;
    object-fit: contain;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #46515d;
    text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
    color: #46515d;
    text-decoration: none;
}

.brand-mark {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 4vw, 3.6rem);
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-shadow: 0 1px 0 rgba(255,255,255,0.55);
}

.site-main {
    width: 100%;
    flex: 1 0 auto;
    background: var(--dc-background);
}

.container {
    width: min(100% - 40px, var(--dc-content-width));
    margin: 0 auto;
}

.container.narrow {
    width: min(100% - 40px, var(--dc-reading-width));
}

.center-text {
    text-align: center;
}

.section {
    padding: 36px 0;
}


.section-intro {
    padding-top: 20px;
    padding-bottom: 8px;
}

.section-intro + .section {
    padding-top: 12px;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--dc-blue);
    line-height: 1.2;
}

h1 {
    margin-bottom: 4px;
    font-size: clamp(1.8rem, 3.2vw, 2.5rem);
}

h2 {
    margin-bottom: 18px;
    color: var(--dc-text);
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 500;
}

h3 {
    margin-bottom: 8px;
    color: var(--dc-text);
    font-size: 1.15rem;
    font-weight: 500;
}

p {
    margin: 0 0 14px;
}

.lead {
    margin-bottom: 2px;
    font-size: 0.95rem;
    font-weight: 600;
}

.small-emphasis {
    color: var(--dc-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 48px;
    align-items: start;
    text-align: center;
}

.feature-card {
    min-width: 0;
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.94rem;
}

.site-footer {
    margin-top: 0;
    background: var(--dc-blue-light);
    border-top: 1px solid #9fbdd7;
}

.footer-inner {
    width: 100%;
    padding: 28px 20px;
    text-align: left;
    color: #34414d;
    font-size: 0.88rem;
}

.footer-inner p {
    margin: 3px 0;
}

@media (max-width: 800px) {
    .header-inner {
        min-height: 104px;
        padding-left: 150px;
    }

    .header-logo {
        max-width: 120px;
        max-height: 78px;
    }

    .section {
        padding: 28px 0;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px 24px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15px;
    }

    .header-inner {
        min-height: 92px;
        padding-left: 104px;
        padding-right: 12px;
    }

    .header-logo-link {
        left: 12px;
    }

    .header-logo {
        max-width: 82px;
        max-height: 64px;
    }

    .brand-mark {
        font-size: 1.8rem;
    }

    .container,
    .container.narrow {
        width: min(100% - 28px, var(--dc-content-width));
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer service block: centered without increasing footer height. */
.footer-inner {
    position: relative;
}

.footer-copyright {
    position: relative;
    z-index: 1;
}

.footer-service {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(38vw, 620px);
    text-align: center;
    color: #34414d;
    pointer-events: none;
}

.footer-service-title {
    margin-bottom: 6px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
}

.footer-service-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.footer-service-logos img {
    display: block;
    width: auto;
    max-width: 116px;
    height: 78px;
    object-fit: contain;
}

@media (max-width: 800px) {
    .footer-service {
        width: 42vw;
    }

    .footer-service-logos {
        gap: 10px;
    }

    .footer-service-logos img {
        max-width: 72px;
        height: 52px;
    }
}

/* About page */
.about-intro,
.about-team {
    padding: 32px 0;
}

.about-intro .container,
.about-team .container {
    width: min(100% - 40px, 1000px);
}

.about-intro h1,
.about-team h2 {
    margin-bottom: 20px;
    text-align: center;
}

.about-intro p {
    max-width: 940px;
    margin: 0 auto;
    text-align: center;
}

.about-team {
    padding-top: 8px;
}

.about-team-subtitle {
    margin: -8px 0 24px;
    text-align: center;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    max-width: 860px;
    margin: 0 auto;
}

.team-card {
    padding: 26px;
    background: #f3f3f3;
    text-align: center;
    border-radius: 4px;
}


.team-photo {
    display: block;
    width: 150px;
    height: 150px;
    margin: 0 auto 18px;
    border-radius: 50%;
    object-fit: cover;
}

.team-photo-sonja {
    object-position: center 8%;
}

.team-card h3 {
    margin-bottom: 4px;
}

.team-role {
    margin-bottom: 14px;
    font-weight: 600;
}

.team-quote {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.4;
}

.team-quote-small {
    font-size: 0.75rem;
}

@media (max-width: 700px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

/* Writing section */
.writing-intro,
.writing-series,
.series-page-intro,
.series-books {
    padding: 30px 0;
}

.writing-intro .container.narrow {
    width: min(100% - 48px, 1080px);
}

.writing-copy {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    font-size: clamp(0.95rem, 0.15vw + 0.93rem, 1.04rem);
    line-height: 1.65;
}

.writing-copy p {
    width: min(100%, 980px);
    margin: 0 auto 1rem;
    text-align: center;
    text-wrap: pretty;
}

.writing-series {
    padding-top: 8px;
}

.writing-series-summary {
    width: min(100% - 40px, 900px);
    margin: 0 auto 28px;
    text-align: center;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    width: min(100% - 40px, 900px);
    margin: 0 auto;
}

.series-card {
    display: block;
    padding: 28px;
    color: var(--dc-text);
    background: #f3f3f3;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
}

.series-card:hover,
.series-card:focus-visible {
    color: var(--dc-text);
    text-decoration: none;
    background: var(--dc-blue-pale);
}

.series-card h3 {
    margin-bottom: 12px;
    color: var(--dc-blue);
}

.series-card p {
    margin-bottom: 16px;
}

.series-link-text {
    color: var(--dc-blue-dark);
    font-weight: 700;
}

.series-page-intro p {
    text-align: center;
}

.series-books {
    padding-top: 8px;
}

.book-list {
    display: grid;
    gap: 24px;
    width: min(100% - 40px, 980px);
    margin: 0 auto;
}

.book-entry {
    padding: 26px 30px;
    background: #f3f3f3;
    border-radius: 4px;
}

.book-entry h3 {
    margin-bottom: 14px;
    color: var(--dc-blue);
    text-align: center;
}

.book-entry p:last-child {
    margin-bottom: 0;
}

.book-placeholder {
    text-align: center;
}

@media (max-width: 700px) {
    .writing-intro .container.narrow {
        width: min(100% - 28px, 1080px);
    }

    .writing-copy p {
        width: 100%;
    }

    .series-grid {
        grid-template-columns: 1fr;
    }

    .book-entry {
        padding: 22px 20px;
    }
}

/* Writing images */
.writing-series-hero {
    width: min(100%, 520px);
    margin: 0 auto 24px;
    text-align: center;
}

.writing-series-hero-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    margin: 0 auto;
    object-fit: contain;
}

.series-card-image {
    display: block;
    width: 100%;
    max-width: 260px;
    height: 360px;
    margin: 0 auto 18px;
    object-fit: cover;
    object-position: center;
}

.series-page-cover {
    width: min(100%, 360px);
    margin: 0 auto 24px;
}

.series-page-cover-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

.book-entry-with-cover {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.book-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
}

.book-copy h3 {
    text-align: left;
}

@media (max-width: 700px) {
    .series-card-image {
        max-width: 220px;
        height: 310px;
    }

    .book-entry-with-cover {
        grid-template-columns: 1fr;
    }

    .book-cover {
        width: min(100%, 220px);
        margin: 0 auto;
    }

    .book-copy h3 {
        text-align: center;
    }
}

.site-button {
    display: inline-block;
    padding: 10px 18px;
    color: #ffffff;
    background: var(--dc-blue);
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

.site-button:hover,
.site-button:focus-visible {
    color: #ffffff;
    background: var(--dc-blue-dark);
    text-decoration: none;
}

.book-action {
    margin-top: 18px;
    text-align: center;
}

/* Storm at the Verge book index */
.book-index-links {
    width: min(100% - 40px, 760px);
    margin: 24px auto 0;
    text-align: center;
}

.book-index-links > .site-button {
    margin: 0 4px 18px;
}

.chapter-index {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    margin: 0 auto;
}

.chapter-index a {
    display: block;
    padding: 10px 14px;
    color: var(--dc-blue-dark);
    background: #f3f3f3;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.chapter-index a:hover,
.chapter-index a:focus-visible {
    background: var(--dc-blue-pale);
    text-decoration: underline;
}

/* Inline reader comments */
.commentable-reader p[data-comment-key] {
    position: relative;
    padding-right: 2.25rem;
}

.inline-comment-marker {
    position: absolute;
    top: 0.05rem;
    right: -1.5rem;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid var(--dc-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--dc-blue-dark);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.inline-comment-marker:hover,
.inline-comment-marker:focus-visible,
.inline-comment-marker.has-comments {
    background: var(--dc-blue-pale);
}

.inline-comment-marker.has-comments {
    border-color: var(--dc-blue);
}

.comments-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    width: min(390px, 92vw);
    height: 100vh;
    padding: 18px;
    overflow-y: auto;
    background: #ffffff;
    border-left: 1px solid var(--dc-border);
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(105%);
    transition: transform 0.18s ease;
}

.comments-drawer.is-open {
    transform: translateX(0);
}

.comments-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.comments-drawer-header h3 {
    margin: 0;
}

.comments-close {
    padding: 4px 9px;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
}

.comments-context {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #f3f3f3;
    border-radius: 4px;
    font-size: 0.9rem;
}

.comments-login-actions,
.comments-form-actions,
.comment-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comments-login-actions {
    margin: 12px 0;
}

.comment-login-button,
.comment-submit-button,
.comment-action-button {
    display: inline-block;
    padding: 8px 12px;
    border: 0;
    border-radius: 4px;
    background: var(--dc-blue);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.comment-login-button:hover,
.comment-login-button:focus-visible,
.comment-submit-button:hover,
.comment-submit-button:focus-visible,
.comment-action-button:hover,
.comment-action-button:focus-visible {
    background: var(--dc-blue-dark);
    color: #ffffff;
    text-decoration: none;
}

.comments-list {
    display: grid;
    gap: 12px;
    margin: 14px 0;
}

.comment-item {
    padding: 11px 12px;
    background: #f7f7f7;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
}

.comment-item.is-reply {
    margin-left: 22px;
}

.comment-meta {
    margin-bottom: 5px;
    color: var(--dc-muted);
    font-size: 0.82rem;
}

.comment-body {
    white-space: pre-wrap;
}

.comment-resolved {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dc-blue-dark);
}

.comments-form textarea {
    width: 100%;
    min-height: 100px;
    margin: 8px 0;
    padding: 10px;
    resize: vertical;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
    font: inherit;
}

.comments-terms-box {
    padding: 12px;
    background: var(--dc-blue-pale);
    border: 1px solid var(--dc-border);
    border-radius: 4px;
}

.comments-status {
    margin: 8px 0;
    font-size: 0.9rem;
}

@media (max-width: 700px) {
    .commentable-reader p[data-comment-key] {
        padding-right: 2.1rem;
    }

    .inline-comment-marker {
        right: 0;
    }

    .comments-drawer {
        top: auto;
        bottom: 0;
        width: 100%;
        height: min(72vh, 620px);
        border-top: 1px solid var(--dc-border);
        border-left: 0;
        transform: translateY(105%);
    }

    .comments-drawer.is-open {
        transform: translateY(0);
    }
}

.comment-login-button:disabled,
.comment-login-button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #8a98a5;
}

/* Reader comment terms modal */
.comments-terms-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dc-blue-dark);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.comments-terms-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
}

.comments-terms-modal.is-open {
    display: block;
}

.comments-terms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.comments-terms-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100% - 32px));
    max-height: min(82vh, 760px);
    margin: 7vh auto 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.comments-terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--dc-border);
}

.comments-terms-modal-header h3 {
    margin: 0;
}

.comments-terms-modal-close {
    padding: 6px 10px;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
}

.comments-terms-modal-body {
    padding: 18px 20px 22px;
    overflow-y: auto;
}

.comments-terms-modal-body .site-main,
.comments-terms-modal-body .section,
.comments-terms-modal-body .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.comments-terms-modal-body h1 {
    display: none;
}

.comments-terms-modal-body h2 {
    margin-top: 1.25rem;
}

.comments-modal-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .comments-terms-modal-dialog {
        width: calc(100% - 20px);
        max-height: 88vh;
        margin-top: 4vh;
    }

    .comments-terms-modal-body {
        padding: 14px 16px 18px;
    }
}

/* Footer legal links and legal document modals */
.footer-inner {
    padding-bottom: 48px;
}

.footer-legal-links {
    position: absolute;
    left: 50%;
    bottom: 9px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: min(94vw, 760px);
    white-space: nowrap;
    font-size: 0.78rem;
    line-height: 1.2;
}

.footer-legal-links a {
    color: #34414d;
    text-decoration: none;
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
    color: var(--dc-blue-dark);
    text-decoration: underline;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
}

.legal-modal.is-open {
    display: block;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.legal-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, calc(100% - 32px));
    height: min(86vh, 820px);
    margin: 5vh auto 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.legal-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--dc-border);
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.legal-modal-x {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
    background: #ffffff;
    color: var(--dc-text);
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}

.legal-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.legal-modal-footer {
    flex: 0 0 auto;
    padding: 12px 16px;
    text-align: right;
    border-top: 1px solid var(--dc-border);
    background: #ffffff;
}

.legal-document {
    width: 100%;
    max-width: none;
    color: var(--dc-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
}

.legal-document p,
.legal-document div {
    max-width: none;
}

.legal-document a {
    color: var(--dc-blue-dark);
}

.legal-document ul,
.legal-document ol {
    padding-left: 1.6rem;
}

body.legal-modal-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .footer-inner {
        padding-bottom: 62px;
    }

    .footer-legal-links {
        bottom: 8px;
        width: calc(100% - 20px);
        gap: 5px;
        flex-wrap: wrap;
        white-space: normal;
        font-size: 0.74rem;
    }

    .legal-modal-dialog {
        width: calc(100% - 16px);
        height: 92vh;
        margin-top: 4vh;
    }

    .legal-modal-body {
        padding: 16px;
    }
}


/* Local reader account authentication */
.local-auth-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1rem 0;
}

.local-auth-tabs .is-active {
    font-weight: 700;
    text-decoration: underline;
}

.local-auth-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.local-auth-form label {
    display: grid;
    gap: 0.3rem;
    font-weight: 600;
}

.local-auth-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.7rem;
    border: 1px solid #b8c5d0;
    border-radius: 4px;
    background: #fff;
    color: #111;
    font: inherit;
}

.local-auth-captcha {
    min-height: 78px;
    overflow-x: auto;
}

.comments-recovery-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.comments-recovery-modal.is-open {
    display: flex;
}

.comments-recovery-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: 85vh;
    overflow: auto;
    background: #fff;
    color: #111;
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.comments-recovery-body {
    padding: 1rem 1.2rem 1.25rem;
}

.comments-recovery-code {
    display: block;
    margin: 1rem 0;
    padding: 0.9rem;
    overflow-wrap: anywhere;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    background: #f3f5f7;
    border: 1px solid #d3dae0;
    border-radius: 5px;
}

.comments-delete-account {
    display: block;
    margin-top: 0.8rem;
}

/* Disabled reader-auth actions must look disabled, not merely be non-clickable. */
.comment-submit-button:disabled,
.comment-submit-button[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.35);
    box-shadow: none;
}

.comment-submit-button:disabled:hover,
.comment-submit-button[aria-disabled="true"]:hover {
    transform: none;
}

/* Top-level local-auth tabs: disabled means visibly and functionally disabled. */
.comment-action-button:disabled,
.comment-action-button[aria-disabled="true"] {
    opacity: 0.40;
    cursor: not-allowed;
    filter: grayscale(0.45);
    box-shadow: none;
    pointer-events: none;
}

.comment-action-button:disabled:hover,
.comment-action-button[aria-disabled="true"]:hover {
    transform: none;
}

/* Compact signed-in account actions */
.comments-account-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 0 0.75rem;
}

.comments-text-action {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.comments-text-action:hover,
.comments-text-action:focus-visible {
    text-decoration-thickness: 2px;
}

.comments-delete-account {
    font-size: 0.9rem;
}

.comments-restore-box {
    margin: 0.4rem 0 0.8rem;
    font-size: 0.9rem;
}

.comments-restore-box summary {
    cursor: pointer;
    font-weight: 700;
}

.comments-restore-list {
    margin-top: 0.45rem;
}

.comments-restore-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

/* Reader account deletion confirmation modal */
.comments-delete-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.comments-delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.comments-delete-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 34rem);
    max-height: min(90vh, 42rem);
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 0.45rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.28);
}

.comments-delete-modal-header,
.comments-delete-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
}

.comments-delete-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.comments-delete-modal-header h3 {
    margin: 0;
}

.comments-delete-modal-body {
    padding: 1rem;
}

.comments-delete-modal-body p:first-child {
    margin-top: 0;
}

.comments-delete-modal-body p:last-child {
    margin-bottom: 0;
}

.comments-delete-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.comments-delete-modal-close {
    border: 0;
    background: none;
    padding: 0.25rem 0.4rem;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.comments-delete-confirm {
    font-weight: 700;
}

/* Optional new-reader referral question */
.local-auth-referral {
    margin: 0.8rem 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 0.35rem;
}

.local-auth-referral legend {
    padding: 0 0.25rem;
    font-weight: 700;
}

.local-auth-referral label {
    display: block;
    margin: 0.3rem 0;
}

.local-auth-referral input[type="radio"] {
    width: auto;
    margin-right: 0.35rem;
}

.local-auth-referral-other {
    margin-top: 0.45rem;
}

.local-auth-referral-other input {
    margin-top: 0.3rem;
}

.optional-note {
    font-weight: 400;
}

/* Real-time account-field validation */
.local-auth-field-wrap {
    position: relative;
    display: block;
}

.local-auth-field-wrap input {
    padding-right: 2rem;
}

.local-auth-field-state {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    min-width: 1rem;
    text-align: center;
    font-weight: 800;
    line-height: 1;
}

.local-auth-field-state.is-good {
    color: #198754;
}

.local-auth-field-state.is-bad {
    color: #b42318;
}

.local-auth-field-state.is-checking {
    color: inherit;
}

.local-auth-field-wrap input[aria-invalid="true"] {
    border-color: #b42318;
    box-shadow: 0 0 0 1px #b42318 inset;
}

/* Visible registration field validation messages */
.local-auth-field-message {
    display: block;
    min-height: 1.05rem;
    margin-top: 0.18rem;
    font-size: 0.82rem;
    line-height: 1.15;
}

.local-auth-field-message.is-bad {
    color: #b42318;
    font-weight: 700;
}

.local-auth-field-message.is-good {
    color: #198754;
}

/* Advanced reader identity, moderation, and account controls */
.comments-signed-in {
    margin-bottom: 0.35rem;
}

.comments-account-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.15rem 0 0.8rem;
    flex-wrap: wrap;
}

.comments-account-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.comments-text-action {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.comments-text-action:hover,
.comments-text-action:focus-visible {
    text-decoration-thickness: 2px;
}

.comments-delete-account-link {
    font-size: 0.9rem;
}

.comment-role-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    cursor: default;
    outline: none;
}

.comment-role-badge svg {
    width: 0.98rem;
    height: 0.98rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.comment-role-badge::after {
    content: attr(data-role-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.42rem);
    transform: translateX(-50%) translateY(0.2rem);
    z-index: 10020;
    padding: 0.24rem 0.42rem;
    border-radius: 0.28rem;
    background: rgba(24, 31, 38, 0.96);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.comment-role-badge::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.16rem);
    transform: translateX(-50%);
    z-index: 10019;
    border: 0.27rem solid transparent;
    border-top-color: rgba(24, 31, 38, 0.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, visibility 120ms ease;
}

.comment-role-badge:hover::after,
.comment-role-badge:focus-visible::after,
.comment-role-badge:hover::before,
.comment-role-badge:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

.comment-role-badge:hover::after,
.comment-role-badge:focus-visible::after {
    transform: translateX(-50%) translateY(0);
}

.comment-role-badge:focus-visible {
    box-shadow: 0 0 0 2px rgba(48, 116, 166, 0.24);
}

/* Role-specific line-art symbols. Keep them monochrome and consistent with the site. */
.comment-role-badge.is-author svg {
    stroke-width: 1.55;
}

.comment-role-badge.is-admin svg {
    stroke-width: 1.6;
}

.comment-role-badge.is-moderator svg {
    stroke-width: 1.65;
}

.comment-role-badge.is-collaborator svg {
    stroke-width: 1.7;
}

.comment-role-badge.is-reader svg {
    stroke-width: 1.55;
}

.comment-edited {
    font-style: italic;
    opacity: 0.78;
}

.comment-body.is-masked {
    font-style: italic;
    opacity: 0.72;
}

.comment-inline-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.45rem;
    font-size: 0.9rem;
}

.comment-moderation-actions {
    display: inline-flex;
    gap: 0.6rem;
    padding-left: 0.6rem;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
}

.comments-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
}

.comments-confirm-modal.is-open {
    display: block;
}

.comments-confirm-dialog {
    position: relative;
    z-index: 2;
    width: min(92vw, 560px);
    max-height: 82vh;
    overflow: auto;
    margin: 10vh auto 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.comments-confirm-body {
    padding: 1rem;
}

.comments-confirm-body label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
}

.comments-confirm-body input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.35rem;
}

.local-auth-field-check {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.7rem;
    align-items: center;
    gap: 0.35rem;
}

.identity-validation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    min-height: 1.4rem;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.05rem;
}

.identity-validation.is-good {
    color: #176b35;
}

.identity-validation.is-bad {
    color: #a12622;
}

.reader-control-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.reader-control-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 1.5rem;
}

.reader-control-summary-card {
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.74);
}

.reader-control-summary-card strong,
.reader-control-summary-card span {
    display: block;
}

.reader-control-summary-card strong {
    font-size: 1.5rem;
}

.reader-control-section {
    margin: 1.5rem 0;
}

.reader-control-table-wrap {
    overflow-x: auto;
}

.reader-control-table {
    width: 100%;
    border-collapse: collapse;
}

.reader-control-table th,
.reader-control-table td {
    padding: 0.65rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    vertical-align: top;
    text-align: left;
}

.reader-control-table th {
    font-weight: 700;
}

.reader-control-table code {
    overflow-wrap: anywhere;
}

.reader-control-muted {
    font-size: 0.86rem;
    opacity: 0.72;
    margin-top: 0.18rem;
}

.reader-control-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
}

.reader-control-select {
    max-width: 11rem;
}

.reader-control-comments {
    display: grid;
    gap: 0.8rem;
}

.reader-control-comment {
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 8px;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 700px) {
    .comments-account-nav,
    .comments-account-nav-right {
        align-items: flex-start;
    }

    .reader-control-table {
        min-width: 760px;
    }
}


/* Role/control refinements */
.comments-control-panel-link {
    display: inline-block;
    margin: 0 0 0.7rem;
    font-weight: 700;
}
.comment-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
}
.comment-edit-form textarea {
    width: 100%;
    min-height: 6rem;
    margin: 0.4rem 0;
}
.comment-deleted-note,
.comment-edited {
    font-size: 0.84em;
    font-style: italic;
    opacity: 0.78;
}
.comment-item.is-hidden-comment {
    opacity: 0.72;
    border-style: dashed;
}
.reader-role-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 0.85rem;
    align-items: center;
}
@media (max-width: 700px) {
    .reader-role-grid { grid-template-columns: 1fr; }
}

/* Reader registration password requirements */
.local-auth-password-requirements {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    line-height: 1.3;
    opacity: 0.82;
}

/* Reader moderation/control panel modal */
.comments-control-panel-link {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0.15rem 0 0.8rem;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.comments-control-panel-link:hover,
.comments-control-panel-link:focus-visible {
    text-decoration-thickness: 2px;
}

.comments-control-panel-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.comments-control-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.comments-control-panel-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(96vw, 1180px);
    height: min(92vh, 900px);
    min-height: 20rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 0.5rem;
    box-shadow: 0 1.2rem 4rem rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.comments-control-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.comments-control-panel-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.comments-control-panel-close {
    appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.28);
    border-radius: 0.3rem;
    background: #fff;
    padding: 0.28rem 0.55rem;
    font: inherit;
    cursor: pointer;
}

.comments-control-panel-frame-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.comments-control-panel-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

@media (max-width: 700px) {
    .comments-control-panel-modal {
        padding: 0;
    }

    .comments-control-panel-dialog {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border: 0;
        border-radius: 0;
    }
}

/* Embedded control-panel view used inside the reader modal */
body.reader-control-embedded {
    margin: 0;
    background: #fff;
}

body.reader-control-embedded .site-main {
    min-height: 0;
}

body.reader-control-embedded .site-main > .section {
    padding-top: 0;
    padding-bottom: 0;
}

body.reader-control-embedded .site-main > .section > .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem 1.15rem 1.5rem;
    box-sizing: border-box;
}

body.reader-control-embedded .reader-control-header {
    margin-top: 0;
}

body.reader-control-embedded .reader-control-header h1 {
    margin-top: 0;
}

/* Compact per-comment agreement voting */
.comment-votes {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    margin-right: 0.15rem;
}

.comment-vote-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    min-width: 2.35rem;
    min-height: 1.8rem;
    padding: 0.15rem 0.34rem;
    border: 1px solid rgba(48, 116, 166, 0.28);
    border-radius: 0.32rem;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.comment-vote-button:hover:not(:disabled),
.comment-vote-button:focus-visible:not(:disabled) {
    border-color: currentColor;
    background: rgba(48, 116, 166, 0.08);
}

.comment-vote-button.is-active {
    border-color: currentColor;
    background: rgba(48, 116, 166, 0.14);
    font-weight: 700;
}

.comment-vote-button:disabled {
    cursor: default;
    opacity: 0.58;
}

.comment-vote-arrow {
    font-size: 0.82rem;
    line-height: 1;
}

.comment-vote-count {
    min-width: 0.8rem;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1;
}

/* Color-coded role badges */
.comment-role-badge.is-author {
    color: #8b2f2f;
    background: #f7e8e8;
    border-color: #8b2f2f;
}

.comment-role-badge.is-admin {
    color: #6d4c00;
    background: #fff3c4;
    border-color: #b88900;
}

.comment-role-badge.is-moderator {
    color: #6b2f8a;
    background: #f1e6f7;
    border-color: #8b4aa8;
}

.comment-role-badge.is-collaborator {
    color: #1f6f5f;
    background: #e5f5f1;
    border-color: #2f8c78;
}

.comment-role-badge.is-reader {
    color: #2f5f8f;
    background: #e8f0f8;
    border-color: #4f7fad;
}

/* Vote colors: green agreement, red disagreement */
.comment-vote-button.is-up {
    color: #187a37;
    border-color: rgba(24, 122, 55, 0.42);
}

.comment-vote-button.is-up:hover:not(:disabled),
.comment-vote-button.is-up:focus-visible:not(:disabled),
.comment-vote-button.is-up.is-active {
    background: rgba(24, 122, 55, 0.13);
    border-color: #187a37;
}

.comment-vote-button.is-down {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.42);
}

.comment-vote-button.is-down:hover:not(:disabled),
.comment-vote-button.is-down:focus-visible:not(:disabled),
.comment-vote-button.is-down.is-active {
    background: rgba(180, 35, 24, 0.12);
    border-color: #b42318;
}

.comment-vote-button.is-up.is-active,
.comment-vote-button.is-down.is-active {
    font-weight: 800;
}

.comment-vote-button:disabled {
    opacity: 0.5;
}

/* Comment category selector and labels */
.comments-category-field {
    display: block;
    margin-bottom: 0.55rem;
    font-weight: 700;
}

.comments-category-field select {
    display: block;
    width: 100%;
    margin-top: 0.28rem;
    padding: 0.42rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 0.32rem;
    background: #fff;
    color: inherit;
    font: inherit;
}

.comment-category {
    display: inline-block;
    margin: 0.18rem 0 0.45rem;
    padding: 0.12rem 0.42rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
}

.comment-category.is-general {
    color: #5a6268;
    background: #f1f3f5;
}

.comment-category.is-typo,
.comment-category.is-grammar {
    color: #8a5a00;
    background: #fff4d6;
}

.comment-category.is-inaccurate,
.comment-category.is-continuity {
    color: #a1261d;
    background: #fde9e7;
}

.comment-category.is-clarity,
.comment-category.is-pacing {
    color: #315f8a;
    background: #e9f2fb;
}

.comment-category.is-character,
.comment-category.is-worldbuilding {
    color: #6d3f86;
    background: #f1e8f6;
}

.comment-category.is-suggestion,
.comment-category.is-question {
    color: #1f6f5f;
    background: #e6f5f1;
}

.comment-category.is-kudos {
    color: #7a5a00;
    background: #fff5bf;
}

/* Control-panel reporting additions */
.reader-control-category-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.6rem;
}

.reader-control-category-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.7);
}

.reader-control-category-card .comment-category {
    margin: 0;
}

.reader-control-category-card strong {
    font-size: 1.05rem;
}

.reader-control-comment-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.35rem 0 0.45rem;
}

.reader-control-comment-details .comment-category {
    margin: 0;
}

.reader-control-vote-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    font-weight: 700;
}

.reader-control-vote-summary .is-up {
    color: #187a37;
}

.reader-control-vote-summary .is-down {
    color: #b42318;
}

.reader-control-vote-summary .is-score {
    color: #4e5963;
    font-weight: 600;
}

.reader-control-reply-label {
    display: inline-block;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    background: #eef1f4;
    color: #4e5963;
    font-size: 0.78rem;
    font-weight: 700;
}

.reader-control-table th,
.reader-control-table td {
    vertical-align: top;
}

@media (max-width: 900px) {
    .reader-control-category-summary {
        grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    }
}

/* Site-wide new reader-comment notifications */
.site-comment-notifications {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 10250;
    width: min(25rem, calc(100vw - 2rem));
    max-height: min(70vh, 42rem);
    overflow: hidden;
    border: 1px solid rgba(47, 95, 143, 0.45);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.8rem 2.4rem rgba(0, 0, 0, 0.22);
}

.site-comment-notifications-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.58rem 0.7rem;
    border-bottom: 1px solid rgba(47, 95, 143, 0.2);
    background: #e8f0f8;
    color: #234c73;
}

.site-comment-notifications-count {
    font-size: 0.86rem;
    font-weight: 700;
}

.site-comment-notifications-close {
    appearance: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.site-comment-notifications-list {
    max-height: calc(min(70vh, 42rem) - 2.6rem);
    overflow-y: auto;
}

.site-comment-notification-item {
    padding: 0.62rem 0.72rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-comment-notification-item:last-child {
    border-bottom: 0;
}

.site-comment-notification-link {
    display: inline-block;
    font-weight: 800;
    color: #2f5f8f;
}

.site-comment-notification-byline {
    margin-top: 0.15rem;
    color: #5d6770;
    font-size: 0.77rem;
}

.site-comment-notification-excerpt {
    margin-top: 0.25rem;
    font-size: 0.86rem;
    line-height: 1.35;
}

/* Functional cookie choice banner */
.site-cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 10300;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(47, 95, 143, 0.35);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.7rem 2rem rgba(0, 0, 0, 0.2);
}

.site-cookie-banner-copy {
    display: flex;
    flex: 1 1 auto;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    font-size: 0.86rem;
    line-height: 1.35;
}

.site-cookie-banner-copy strong {
    color: #2f5f8f;
}

.site-cookie-banner-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.45rem;
}

.site-cookie-banner-actions button {
    appearance: none;
    border: 1px solid rgba(47, 95, 143, 0.45);
    border-radius: 0.3rem;
    background: #fff;
    padding: 0.3rem 0.58rem;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.site-cookie-banner-actions .site-cookie-accept {
    background: #2f5f8f;
    color: #fff;
    border-color: #2f5f8f;
}

.site-cookie-banner-close {
    appearance: none;
    order: 3;
    border: 0;
    background: transparent;
    color: #5d6770;
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.comment-item.is-linked-comment {
    outline: 2px solid #2f5f8f;
    outline-offset: 0.2rem;
    border-radius: 0.3rem;
    background: rgba(47, 95, 143, 0.06);
}

@media (max-width: 700px) {
    .site-comment-notifications {
        top: 0.6rem;
        left: 0.6rem;
        width: calc(100vw - 1.2rem);
        max-height: 55vh;
    }

    .site-comment-notifications-list {
        max-height: calc(55vh - 2.6rem);
    }

    .site-cookie-banner {
        left: 0.6rem;
        right: 0.6rem;
        bottom: 0.6rem;
        align-items: stretch;
        flex-direction: column;
        gap: 0.55rem;
    }

    .site-cookie-banner-actions {
        justify-content: flex-end;
    }

    .site-cookie-banner-close {
        position: absolute;
        top: 0.35rem;
        right: 0.45rem;
    }

    .site-cookie-banner-copy {
        padding-right: 1.5rem;
    }
}

/* Moderator escalation queue */
.reader-control-comment.is-escalated {
    border-left: 4px solid #b42318;
    background: rgba(180, 35, 24, 0.045);
}

.reader-control-actions .is-danger {
    border-color: rgba(180, 35, 24, 0.45);
    color: #b42318;
}

.reader-control-actions .is-danger:hover,
.reader-control-actions .is-danger:focus-visible {
    border-color: #b42318;
    background: rgba(180, 35, 24, 0.08);
}

/* Reader registration detail hover/focus card */
.reader-control-identity {
    position: relative;
}

.reader-control-user-tip {
    position: relative;
    display: inline-block;
    cursor: default;
    outline: none;
}

.reader-control-user-tip > strong {
    border-bottom: 1px dotted currentColor;
}

.reader-control-user-tip-card {
    position: absolute;
    left: 0;
    top: calc(100% + 0.45rem);
    z-index: 10400;
    display: none;
    width: min(32rem, 75vw);
    max-width: 32rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(47, 95, 143, 0.32);
    border-radius: 0.45rem;
    background: #fff;
    color: #202830;
    box-shadow: 0 0.7rem 2rem rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
}

.reader-control-user-tip:hover .reader-control-user-tip-card,
.reader-control-user-tip:focus-visible .reader-control-user-tip-card,
.reader-control-user-tip:focus-within .reader-control-user-tip-card {
    display: block;
}

.reader-control-user-tip:focus-visible > strong {
    outline: 2px solid rgba(47, 95, 143, 0.3);
    outline-offset: 2px;
}

.reader-control-user-tip-row {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 0.45rem;
    padding: 0.14rem 0;
    overflow-wrap: anywhere;
}

.reader-control-user-tip-row > strong {
    color: #2f5f8f;
}

@media (max-width: 700px) {
    .reader-control-user-tip-card {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        top: 20vh;
        width: auto;
        max-width: none;
        max-height: 60vh;
        overflow-y: auto;
    }

    .reader-control-user-tip-row {
        grid-template-columns: 1fr;
        gap: 0.05rem;
        padding: 0.25rem 0;
    }
}

/* Persistent unread notification behavior */
.site-comment-notifications-expanded {
    display: block;
}

.site-comment-notifications-minimized {
    display: none;
    appearance: none;
    position: relative;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid rgba(47, 95, 143, 0.45);
    border-radius: 50%;
    background: #e8f0f8;
    color: #2f5f8f;
    box-shadow: 0 0.45rem 1.4rem rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.site-comment-notifications-minimized svg {
    width: 1.45rem;
    height: 1.45rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-comment-notifications-minimized-count {
    position: absolute;
    right: -0.2rem;
    top: -0.35rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.18rem;
    border-radius: 999px;
    background: #b42318;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15rem;
    text-align: center;
}

.site-comment-notifications.is-minimized {
    width: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.site-comment-notifications.is-minimized .site-comment-notifications-expanded {
    display: none;
}

.site-comment-notifications.is-minimized .site-comment-notifications-minimized {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-comment-notifications-read {
    appearance: none;
    margin-left: auto;
    border: 1px solid rgba(47, 95, 143, 0.35);
    border-radius: 0.3rem;
    background: #fff;
    padding: 0.2rem 0.42rem;
    color: #2f5f8f;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.site-comment-notifications-close {
    margin-left: 0;
}

/* Delayed paragraph comment-icon help */
.inline-comment-help-tip {
    position: absolute;
    z-index: 10150;
    width: min(18rem, calc(100vw - 1.5rem));
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(47, 95, 143, 0.35);
    border-radius: 0.42rem;
    background: rgba(255, 255, 255, 0.98);
    color: #202830;
    box-shadow: 0 0.55rem 1.6rem rgba(0, 0, 0, 0.18);
    font-size: 0.8rem;
    line-height: 1.35;
}

.inline-comment-help-tip strong,
.inline-comment-help-tip span {
    display: block;
}

.inline-comment-help-tip strong {
    margin-bottom: 0.18rem;
    color: #2f5f8f;
}

.inline-comment-help-more {
    appearance: none;
    margin-top: 0.38rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2f5f8f;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.comment-system-help-modal {
    position: fixed;
    inset: 0;
    z-index: 10450;
}

.comment-system-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
}

.comment-system-help-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 620px);
    max-height: 82vh;
    overflow: auto;
    margin: 9vh auto 0;
    border: 1px solid rgba(47, 95, 143, 0.35);
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.28);
}

.comment-system-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.comment-system-help-header h3 {
    margin: 0;
}

.comment-system-help-close {
    appearance: none;
    border: 1px solid rgba(47, 95, 143, 0.35);
    border-radius: 0.3rem;
    background: #fff;
    padding: 0.25rem 0.5rem;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.comment-system-help-body {
    padding: 0.9rem 1rem 1rem;
}

.comment-system-help-body p {
    margin: 0 0 0.8rem;
}

.comment-system-help-body p:last-child {
    margin-bottom: 0;
}

/* Chapter manuscript copy deterrence */
.commentable-reader.chapter-copy-protected {
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.commentable-reader.chapter-copy-protected p,
.commentable-reader.chapter-copy-protected h1,
.commentable-reader.chapter-copy-protected h2,
.commentable-reader.chapter-copy-protected h3,
.commentable-reader.chapter-copy-protected blockquote {
    -webkit-user-select: none;
    user-select: none;
}

.commentable-reader.chapter-copy-protected button,
.commentable-reader.chapter-copy-protected a,
.commentable-reader.chapter-copy-protected input,
.commentable-reader.chapter-copy-protected textarea,
.commentable-reader.chapter-copy-protected select,
.commentable-reader.chapter-copy-protected option,
.commentable-reader.chapter-copy-protected label {
    -webkit-user-select: auto;
    user-select: auto;
}

.chapter-copy-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(14rem, 1fr));
    gap: 8rem 4rem;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    opacity: 0.045;
}

.chapter-copy-watermark span {
    display: block;
    align-self: center;
    justify-self: center;
    width: 18rem;
    color: currentColor;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-align: center;
    transform: rotate(-24deg);
    white-space: nowrap;
}

.commentable-reader.chapter-copy-protected > :not(.chapter-copy-watermark) {
    position: relative;
    z-index: 1;
}

@media (max-width: 700px) {
    .chapter-copy-watermark {
        grid-template-columns: 1fr;
        gap: 7rem;
    }
}

@media print {
    .commentable-reader.chapter-copy-protected {
        min-height: 16rem;
    }

    .commentable-reader.chapter-copy-protected > :not(.chapter-copy-watermark) {
        display: none !important;
    }

    .commentable-reader.chapter-copy-protected::after {
        content: "This ARC chapter is not available for printing.";
        display: block;
        padding: 4rem 1rem;
        text-align: center;
        font-weight: 700;
    }

    .chapter-copy-watermark {
        display: none !important;
    }
}


/* Gallery */
.gallery-section {
    padding-top: 18px;
}

.gallery-heading {
    margin: 0 0 18px;
    text-align: center;
}

.gallery-heading h1 {
    margin-bottom: 4px;
}

.gallery-heading p {
    margin: 4px 0 0;
}

.gallery-heading-compact {
    margin-bottom: 18px;
}

.gallery-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0 0 18px;
    color: var(--dc-muted);
    font-size: 0.9rem;
}

.gallery-count {
    color: var(--dc-muted);
    font-size: 0.9rem;
}

.gallery-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
    justify-content: center;
    gap: 28px;
}

.gallery-album-card {
    overflow: hidden;
    background: #f3f3f3;
    border-radius: 4px;
}

.gallery-album-link {
    display: block;
    color: var(--dc-text);
    text-decoration: none;
}

.gallery-album-link:hover,
.gallery-album-link:focus-visible {
    color: var(--dc-text);
    background: var(--dc-blue-pale);
    text-decoration: none;
}

.gallery-album-cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #ffffff;
}

.gallery-album-info {
    padding: 14px 16px 16px;
    text-align: center;
}

.gallery-album-info h2 {
    margin: 0 0 6px;
    color: var(--dc-blue);
    font-size: 1.15rem;
    font-weight: 600;
}

.gallery-album-info p {
    margin: 0;
}


/* Let gallery pages use more of the available viewport on larger displays. */
.gallery-section > .container {
    width: min(calc(100% - 40px), 1600px);
}

.gallery-album-layout {
    display: grid;
    grid-template-columns: clamp(220px, 17vw, 300px) minmax(0, 1fr);
    gap: clamp(20px, 2vw, 34px);
    align-items: start;
    max-width: none;
    margin: 0 auto;
}

.gallery-album-description {
    position: sticky;
    top: 18px;
    padding: 18px 20px;
    background: #f3f3f3;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
}

.gallery-album-description h2 {
    margin: 0 0 10px;
    color: var(--dc-blue);
    font-size: 1.1rem;
    font-weight: 600;
}

.gallery-album-description p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.55;
}

.gallery-album-layout .gallery-photo-grid {
    max-width: none;
    margin: 0;
}

.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    max-width: 980px;
    margin: 0 auto;
}

.gallery-photo-card {
    display: block;
    overflow: hidden;
    background: #f3f3f3;
    border-radius: 4px;
}

.gallery-photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 140ms ease;
}

.gallery-photo-card:hover img,
.gallery-photo-card:focus-visible img {
    transform: scale(1.025);
}

.gallery-album-link:focus-visible,
.gallery-photo-card:focus-visible,
.gallery-photo-nav a:focus-visible,
.gallery-breadcrumb a:focus-visible {
    outline: 2px solid var(--dc-blue-dark);
    outline-offset: 3px;
}

.gallery-photo-page {
    max-width: none;
}

.gallery-photo-detail-layout {
    display: grid;
    grid-template-columns: clamp(220px, 16vw, 300px) minmax(0, 1fr) clamp(220px, 16vw, 300px);
    gap: clamp(18px, 1.8vw, 32px);
    align-items: start;
    width: 100%;
}

.gallery-photo-album-description,
.gallery-photo-description {
    position: sticky;
    top: 18px;
    padding: 18px 20px;
    background: #f3f3f3;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
}

.gallery-photo-album-description h2,
.gallery-photo-description h2 {
    margin: 0 0 10px;
    color: var(--dc-blue);
    font-size: 1.1rem;
    font-weight: 600;
}

.gallery-photo-album-description p,
.gallery-photo-description p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.55;
}

.gallery-description-empty {
    color: var(--dc-muted);
    font-style: italic;
}

.gallery-viewer {
    margin: 0;
    text-align: center;
    border-radius: 4px;
}

.gallery-lightbox {
    position: relative;
    padding: 18px 58px 14px;
    overflow: hidden;
    background: #f4f4f4;
    border: 1px solid #d7d7d7;
    border-radius: 5px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.gallery-lightbox-stage {
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(420px, 70vh, 820px);
    min-height: 0;
    overflow: hidden;
}

.gallery-lightbox img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    margin: 0 auto;
    object-fit: contain;
}

.gallery-lightbox figcaption {
    margin-top: 10px;
    color: var(--dc-text);
}

.gallery-lightbox-arrow,
.gallery-lightbox-close {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34414d;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(52, 65, 77, 0.22);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    line-height: 1;
}

.gallery-lightbox-arrow:hover,
.gallery-lightbox-arrow:focus-visible,
.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
    color: #ffffff;
    background: rgba(61, 121, 169, 0.92);
    text-decoration: none;
}

.gallery-lightbox-arrow:focus-visible,
.gallery-lightbox-close:focus-visible {
    outline: 2px solid var(--dc-blue);
    outline-offset: 2px;
}

.gallery-lightbox-arrow {
    top: 50%;
    width: 46px;
    height: 68px;
    transform: translateY(-50%);
    font-size: 3.2rem;
    font-weight: 300;
}

.gallery-lightbox-prev {
    left: 6px;
    border-radius: 4px;
}

.gallery-lightbox-next {
    right: 6px;
    border-radius: 4px;
}

.gallery-lightbox-close {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.7rem;
}

.gallery-empty {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 22px;
    background: #f3f3f3;
    text-align: center;
    border-radius: 4px;
}

.gallery-empty p {
    margin: 0;
}


@media (max-width: 1000px) {
    .gallery-photo-detail-layout {
        grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    }

    .gallery-photo-description {
        position: static;
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .gallery-section > .container {
        width: min(calc(100% - 28px), 1600px);
    }

    .gallery-album-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .gallery-album-description {
        position: static;
        width: min(100%, 680px);
        margin: 0 auto;
    }

    .gallery-photo-detail-layout {
        grid-template-columns: 1fr;
    }

    .gallery-photo-album-description,
    .gallery-photo-description {
        position: static;
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 640px) {
    .gallery-album-grid {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .gallery-lightbox {
        padding: 12px 42px 12px;
    }

    .gallery-lightbox-stage {
        height: min(62vh, 560px);
        min-height: 280px;
    }

    .gallery-lightbox-arrow {
        width: 36px;
        height: 56px;
        font-size: 2.6rem;
    }

    .gallery-lightbox-close {
        top: 6px;
        right: 6px;
        width: 32px;
        height: 32px;
    }
}

/* Gallery upload manager */
.gallery-upload-app {
    display: grid;
    gap: 22px;
}

.gallery-upload-panel {
    padding: 22px;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: #f7f7f7;
}

.gallery-upload-panel h2 {
    margin-bottom: 16px;
    color: var(--dc-blue);
    font-size: 1.35rem;
    font-weight: 600;
}

.gallery-upload-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-bottom: 18px;
}

.gallery-upload-mode label,
.gallery-upload-cover-choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}

.gallery-upload-fields {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.gallery-upload-fields[hidden] {
    display: none;
}

.gallery-upload-fields label,
.gallery-upload-description-content > label:not(.gallery-upload-cover-choice) {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.gallery-upload-fields input,
.gallery-upload-fields select,
.gallery-upload-fields textarea,
.gallery-upload-description-content textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
    background: #fff;
    color: var(--dc-text);
    font: inherit;
}

.gallery-upload-fields textarea,
.gallery-upload-description-content textarea {
    resize: vertical;
}

.gallery-upload-dropzone {
    display: grid;
    place-items: center;
    gap: 5px;
    min-height: 180px;
    padding: 24px;
    border: 2px dashed #9fbdd7;
    border-radius: 8px;
    background: #fff;
    color: var(--dc-text);
    text-align: center;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.gallery-upload-dropzone:hover,
.gallery-upload-dropzone:focus-visible,
.gallery-upload-dropzone.is-dragover {
    border-color: var(--dc-blue);
    background: var(--dc-blue-pale);
    box-shadow: 0 0 0 3px rgba(48, 116, 166, 0.12);
    outline: none;
}

.gallery-upload-dropzone strong {
    color: var(--dc-blue-dark);
    font-size: 1.15rem;
}

.gallery-upload-dropzone small {
    color: var(--dc-muted);
}

.gallery-upload-selection {
    margin-top: 18px;
}

.gallery-upload-selection-heading,
.gallery-upload-stage-header,
.gallery-upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.gallery-upload-file-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.gallery-upload-file-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 220px) minmax(90px, auto) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: #fff;
}

.gallery-upload-file-row progress {
    width: 100%;
}

.gallery-upload-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.gallery-upload-file-size,
.gallery-upload-file-state,
.gallery-upload-description-filename {
    color: var(--dc-muted);
    font-size: 0.82rem;
}

.gallery-upload-file-row.is-complete .gallery-upload-file-state {
    color: #187a37;
    font-weight: 700;
}

.gallery-upload-file-row.is-error .gallery-upload-file-state,
.comments-status.is-error {
    color: #b42318;
    font-weight: 700;
}

.gallery-upload-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.gallery-upload-stage-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.gallery-upload-stage-header h2,
.gallery-upload-stage-header p {
    margin-bottom: 4px;
}

.gallery-upload-description-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.gallery-upload-description-card {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: #fff;
}

.gallery-upload-description-card img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-upload-description-content {
    display: grid;
    align-content: start;
    gap: 10px;
}

.gallery-upload-description-content h3 {
    margin: 0;
    color: var(--dc-blue-dark);
    font-size: 1rem;
    font-weight: 700;
}

.gallery-upload-cover-choice {
    margin-top: 2px;
}

.gallery-upload-actions-final {
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .gallery-upload-description-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .gallery-upload-panel {
        padding: 16px;
    }

    .gallery-upload-file-row {
        grid-template-columns: 1fr auto;
    }

    .gallery-upload-file-row progress {
        grid-column: 1 / -1;
    }

    .gallery-upload-file-state {
        grid-column: 1;
    }

    .gallery-upload-description-card {
        grid-template-columns: 1fr;
    }

    .gallery-upload-description-card img {
        height: min(55vw, 320px);
    }
}


/* Gallery folder-tree import */
.gallery-folder-import-panel {
    margin-top: 22px;
}

.gallery-folder-file-list {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.gallery-folder-file-list .gallery-upload-file-row {
    grid-template-columns: minmax(260px, 1fr) auto minmax(120px, 220px) minmax(90px, auto);
}

.gallery-folder-path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.gallery-folder-import-summary {
    color: var(--dc-muted);
    font-size: 0.9rem;
}

@media (max-width: 700px) {
    .gallery-folder-file-list .gallery-upload-file-row {
        grid-template-columns: 1fr auto;
    }

    .gallery-folder-file-list .gallery-upload-file-row progress {
        grid-column: 1 / -1;
    }

    .gallery-folder-file-list .gallery-upload-file-state {
        grid-column: 1;
    }
}

/* Gallery custom local-folder chooser */
.gallery-folder-browser {
    margin-top: 14px;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: #fff;
}

.gallery-folder-browser[hidden] {
    display: none;
}

.gallery-folder-browser-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--dc-border);
    background: #f7f9fb;
}

.gallery-folder-browser-header strong,
.gallery-folder-browser-header small {
    display: block;
}

.gallery-folder-browser-header small {
    margin-top: 2px;
    color: var(--dc-muted);
}

.gallery-folder-browser-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.gallery-folder-tree {
    max-height: 390px;
    overflow-y: auto;
    padding: 8px 0;
}

.gallery-folder-tree-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 5px 12px 5px calc(12px + (var(--gallery-folder-depth, 0) * 22px));
    cursor: pointer;
}

.gallery-folder-tree-row:hover,
.gallery-folder-tree-row:focus-within {
    background: var(--dc-blue-pale);
}

.gallery-folder-tree-row input {
    width: auto;
    margin: 0;
}

.gallery-folder-tree-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.gallery-folder-tree-count {
    color: var(--dc-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .gallery-folder-browser-header {
        display: block;
    }

    .gallery-folder-browser-actions {
        justify-content: flex-start;
        margin-top: 8px;
    }

    .gallery-folder-tree-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .gallery-folder-tree-count {
        grid-column: 2;
        white-space: normal;
    }
}
