:root {
    --bg: #f2f3ef;
    --bg-soft: #f8f8f4;
    --card: #ffffff;
    --ink: #111317;
    --muted: #54606f;
    --line: #d5dbdf;
    --accent: #175a9f;
    --accent-dark: #0f3f70;
    --accent-soft: #e9f1fb;
    --shadow: 0 14px 36px rgba(16, 23, 31, 0.11);
    --btn-bg: #f6f9fc;
    --btn-solid: #f6f9fc;
    --btn-text: #1f3348;
    --btn-border: #cfd9e5;
    --btn-bg-hover: #edf3f8;
    --btn-shadow: none;
    --icon-btn-size: 32px;
    --icon-btn-gap: 8px;
    --container-max: 100%;
    --page-pad: clamp(8px, 1.8vw, 26px);
    --section-gap: 18px;
    --card-radius: 18px;
}

* { box-sizing: border-box; }

body.site-page {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f4f6f8;
    color: var(--ink);
    min-height: 100vh;
    font-weight: 400;
}

:where(h1, h2, h3, h4, h5, h6, strong, b, .header-link, .lang-switch, .search-btn, .clear-link, .folder-name, .label, .btn, .site-footer a, .meta-inline-toggle, .history-label, .history-submit-btn, .admin-success, .admin-stat-item strong, .status-code, .status-title) {
    font-weight: 400;
}

.topbar {
    margin: 12px auto var(--section-gap);
    width: 100%;
    max-width: var(--container-max);
    padding: 0 var(--page-pad);
}

.topbar-inner {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 10px 16px;
    padding: 8px 14px 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
}

.wrap {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--page-pad) 12px;
}

.wrap > .card:last-child,
.wrap > .gallery:last-child,
.wrap > .home-cover:last-child {
    margin-bottom: 0;
}

.brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.brand-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
    overflow: hidden;
}

.brand-logo {
    display: block;
    width: min(100%, 500px);
    max-height: 82px;
    height: auto;
    object-fit: contain;
    object-position: left center;
    margin-top: -2px;
    margin-bottom: -2px;
}

.search-form {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    width: clamp(260px, 23vw, 320px);
}

.header-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    padding: 5px 6px;
    border-radius: 999px;
    border: 1px solid #d7e1ec;
    background: rgba(240, 246, 252, 0.88);
}

.header-link {
    font-size: 14px;
    font-weight: 700;
    color: #1f3348;
    text-decoration: none;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef3f9;
    border: 1px solid #d5e0ec;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #5a6777;
    border: 1px solid #d1dbe6;
    border-radius: 999px;
    padding: 5px 10px;
    background: #fff;
}

.lang-switch a {
    color: #5a6777;
    text-decoration: none;
}

.lang-switch a.active {
    color: #0f3f70;
}

.search-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    border: 1px solid #bcc8d6;
    border-radius: 12px;
    padding: 9px 10px;
    font-size: 13px;
    color: #1b2330;
    background: rgba(255, 255, 255, 0.95);
}

.search-input::placeholder {
    font-size: 13px;
}

.search-input:focus {
    outline: none;
    border-color: #6f95bf;
    box-shadow: none;
}

.search-btn,
.clear-link {
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    line-height: 1;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: auto;
}

.search-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    cursor: pointer;
    box-shadow: none;
}

.search-btn:hover,
.clear-link:hover,
.btn:hover,
.meta-inline-toggle:hover,
.history-submit-btn:hover,
.prompt-row button:hover,
.prompt-row a:hover {
    background: var(--btn-bg-hover);
}

.download-card {
    padding: 20px;
}

.clear-link {
    display: inline-block;
    background: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}

h2, p { margin-top: 0; }

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

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    padding: clamp(14px, 1.5vw, 18px);
    margin-bottom: var(--section-gap);
    box-shadow: none;
}

.card h2 {
    margin-bottom: 8px;
    font-size: clamp(1.2rem, 1.8vw, 1.45rem);
    letter-spacing: -0.02em;
}

.folder-head-card {
    padding: 12px;
}

.folder-title-rail {
    border: 1px solid #cfd9e5;
    border-radius: 12px;
    background: #f6f9fc;
    padding: 10px 14px;
    text-align: center;
}

.folder-title-rail h2 {
    margin: 0;
    line-height: 1.2;
}

.folder-head-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.folder-head-actions .btn,
.folder-head-actions .clear-link {
    position: relative;
    z-index: 3;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
}

.image-select-toggle {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.selection-mode .image-select-toggle {
    opacity: 1;
    pointer-events: auto;
}

.image-select-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.image-select-indicator {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    background: rgba(31, 51, 72, 0.84);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.image-select-toggle input:checked + .image-select-indicator {
    background: #2f6f45;
}

.selection-mode .image-card.selected {
    border-color: #86b89a;
    box-shadow: 0 0 0 2px rgba(76, 142, 93, 0.2) inset;
}

.folders {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.folder-box {
    display: block;
    background: #f6f9fc;
    border: 1px solid #ccd6e0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: none;
    width: 100%;
}

.folder-box-button {
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
}

.folder-box-button:hover {
    background: var(--btn-bg-hover);
}

.home-cover {
    margin-bottom: 20px;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: none;
    background: #f6f9fc;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.home-cover.single { grid-template-columns: 1fr; }

.home-cover img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 12px;
}

.home-cover-title {
    grid-column: 1 / -1;
    margin: 2px 2px 4px;
    font-size: clamp(1.2rem, 1.8vw, 1.45rem);
    letter-spacing: -0.02em;
    color: #16202d;
}

.folder-name {
    font-size: 18px;
    font-weight: 400;
    color: #16202d;
    word-break: break-word;
}

.folder-meta,
.empty,
.small {
    color: var(--muted);
    font-size: 14px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--icon-btn-gap);
    margin-top: 10px;
}

.btn {
    display: inline-block;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: none;
    pointer-events: auto;
}

.btn.secondary {
    background: var(--btn-bg);
    box-shadow: none;
}

.btn[disabled],
.history-submit-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.bulk-download-cta {
    display: none !important;
    border: 1px solid var(--btn-border) !important;
    outline: 0;
    background: var(--btn-bg) !important;
    color: var(--btn-text) !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.selection-mode .bulk-download-cta {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.bulk-download-cta:focus,
.bulk-download-cta:focus-visible {
    outline: 0;
    box-shadow: none !important;
}

.bulk-download-cta:disabled {
    background: #e2e8ef !important;
    color: #6a7684 !important;
    border: 1px solid #c5d0db !important;
    opacity: 1;
    cursor: not-allowed;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(14px, 1.5vw, 18px);
}

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

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

.gallery.masonry-active {
    display: block;
    position: relative;
}

.gallery.masonry-active .image-card {
    position: absolute;
    margin: 0;
}

.image-card {
    background: var(--card);
    border: 1px solid #cfd9e3;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

.image-box {
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: 12px;
    margin: 6px;
    overflow: hidden;
    transform-origin: center;
}

.image-box img {
    display: block;
    width: 100%;
    height: auto;
}

.image-info {
    padding: 0;
    margin: 0;
    min-height: 0;
}

.search-result-card > .image-info {
    padding: 12px 14px 14px;
}

.meta-line {
    margin: 7px 0;
    line-height: 1.45;
    word-break: break-word;
}

.label {
    font-weight: 700;
    color: #142030;
}

body.site-page.metadata-hidden .metadata-block { display: none; }
body.site-page.metadata-hidden .image-card.meta-open .metadata-block { display: block; }
body.site-page:not(.metadata-hidden) .image-card.meta-closed .metadata-block { display: none; }
body.site-page:not(.metadata-hidden) .image-card > .image-info {
    padding: 14px 16px 18px;
}
body.site-page:not(.metadata-hidden) .image-card .metadata-block {
    margin: 0 0 12px;
    line-height: 1.6;
}
body.site-page:not(.metadata-hidden) .image-card .metadata-block:last-child {
    margin-bottom: 0;
}

.meta-inline-toggle {
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    min-width: 58px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 400;
    color: var(--btn-text);
    background: var(--btn-bg);
    box-shadow: none;
    cursor: pointer;
    pointer-events: auto;
    line-height: 1;
    white-space: nowrap;
}

.site-footer {
    width: 100%;
    max-width: var(--container-max);
    margin: 8px auto 24px;
    padding: 0 var(--page-pad);
    color: #4c5a69;
    font-size: 14px;
}

.site-footer-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.site-footer a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

@media (hover: hover) and (pointer: fine) and (min-width: 721px) {}

@media (max-width: 720px) {
    body.site-page {
        font-size: 16px;
    }

    .topbar {
        padding: 0 10px;
        margin: 8px auto 12px;
    }

    .topbar-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
        gap: 10px;
        padding: 10px 10px 12px;
        border-radius: 14px;
    }

    .wrap { padding: 0 10px 8px; }

    .folder-head-card {
        padding: 10px;
    }

    .folder-title-rail {
        padding: 9px 11px;
        border-radius: 10px;
    }

    .folder-head-actions {
        margin-top: 8px;
        gap: 7px;
    }

    .image-select-indicator {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .brand-link {
        width: auto;
        max-width: 100%;
        margin: 0 auto;
    }
    .brand-logo {
        max-height: 72px;
        width: min(100%, 420px);
        margin-top: 0;
        margin-bottom: 0;
        object-position: center center;
    }

    .header-tools {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 7px;
        padding: 0;
        border: 0;
        background: transparent;
        border-radius: 0;
    }
    .header-link {
        flex: 1 1 calc(50% - 4px);
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 8px 10px;
        font-size: 13px;
    }
    .lang-switch {
        flex: 0 0 100%;
        justify-content: center;
        min-height: 36px;
    }

    .search-form {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        margin: 0;
        display: block;
    }
    .search-input {
        display: block;
        width: 100%;
        margin: 0 auto;
        min-height: 42px;
        font-size: 16px;
        border-radius: 11px;
    }
    .search-btn {
        min-height: 42px;
        border-radius: 11px;
        padding-inline: 14px;
    }
    .search-form .clear-link {
        grid-column: 1 / -1;
        text-align: center;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .folders { grid-template-columns: 1fr; }
    .home-cover { grid-template-columns: 1fr; }
    .home-cover img { height: 100%; }
    .gallery { grid-template-columns: 1fr; }

    .card,
    .image-card {
        border-radius: 12px;
    }
    .card {
        padding: 14px;
        margin-bottom: 14px;
    }
    body.site-page:not(.metadata-hidden) .image-card > .image-info {
        padding: 12px 13px 15px;
    }
    body.site-page:not(.metadata-hidden) .image-card .metadata-block {
        margin-bottom: 10px;
        line-height: 1.58;
    }
    .actions {
        gap: var(--icon-btn-gap);
    }
    .actions .btn,
    .actions .clear-link {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
    }
    .btn,
    .clear-link {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
    }

    .site-footer {
        padding: 0 10px;
        margin: 6px auto 20px;
    }
    .site-footer-inner {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
        padding: 10px 12px;
        text-align: center;
    }

    .meta-inline-toggle {
        min-width: 56px;
        height: 32px;
        font-size: 12px;
    }

}

.actions .btn,
.actions .clear-link,
.actions .meta-inline-toggle {
    max-width: 100%;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-btn-size);
    height: var(--icon-btn-size);
    min-width: var(--icon-btn-size);
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-text);
    font-size: 16px;
    line-height: 1;
    box-shadow: none;
}

.icon-back {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.icon-download {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.icon-meta {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.icon-zoom {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.actions .icon-btn {
    flex: 0 0 auto;
}

@media (max-width: 480px) {
    .topbar {
        padding: 0 8px;
    }

    .wrap,
    .site-footer {
        padding-left: 8px;
        padding-right: 8px;
    }

    .header-link {
        flex: 1 1 100%;
    }

    .search-form {
        width: 100%;
        margin: 0;
        display: block;
    }

    .search-btn {
        width: 100%;
    }

    .search-btn.icon-btn { width: var(--icon-btn-size); }
}

/* Home page: dedicated mobile header behavior */
@media (max-width: 720px) {
    .home-page .header-tools {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 2px;
    }

    .home-page .header-tools::-webkit-scrollbar {
        display: none;
    }

    .home-page .header-link {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .home-page .lang-switch {
        flex: 0 0 auto;
        min-height: 36px;
        font-size: 12px;
        padding: 5px 9px;
    }

    .home-page .search-form {
        width: 100%;
        margin: 0;
        display: block;
    }
}

@media (max-width: 480px) {
    .home-page .header-link {
        font-size: 11px;
        padding: 7px 9px;
    }

    .home-page .search-form {
        width: 100%;
        margin: 0;
        display: block;
    }
}

/* Static/legal pages */
body.site-page.legal-page {
    min-height: 100vh;
}

.legal-page .legal-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.55;
}

.legal-page .legal-list li {
    margin-bottom: 8px;
}

.history-login-form {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.history-page .card {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.history-table-wrap {
    overflow: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history-table th {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid #d8e0e8;
}

.history-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eef2f6;
}

.admin-wrap {
    padding-top: 4px;
    padding-bottom: 26px;
}

.admin-wrap > :last-child {
    margin-bottom: 28px;
}

.admin-success {
    color: #1f6a32;
    font-weight: 700;
}

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

.admin-stat-item {
    border: 1px solid #d8e0e8;
    background: linear-gradient(170deg, rgba(248, 252, 255, 0.95), rgba(245, 249, 253, 0.9));
    border-radius: 12px;
    padding: 10px 12px;
}

.admin-stat-item strong {
    display: block;
    margin-top: 3px;
}

.admin-gallery-passwords-card,
.admin-passwords-card {
    padding-bottom: 24px;
}

.admin-gallery-passwords-card {
    padding: 22px;
}

.admin-gallery-passwords-card h2 {
    margin-bottom: 14px;
    line-height: 1.2;
}

.admin-gallery-passwords-card .history-login-form {
    margin-top: 4px;
    gap: 12px;
}

.admin-gallery-passwords-card .history-login-row {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
    gap: 14px;
}

.admin-gallery-passwords-card .history-password-input {
    min-height: 46px;
    border-radius: 16px;
    font-size: 17px;
    padding: 0 18px;
}

.admin-gallery-passwords-card .history-submit-btn {
    min-height: 46px;
    border-radius: 16px;
    padding: 0 22px;
    font-size: 16px;
    white-space: nowrap;
}

.admin-lookup-result {
    margin-top: 16px;
    border: 1px solid #d7e1ec;
    border-radius: 14px;
    background: linear-gradient(170deg, rgba(248, 252, 255, 0.95), rgba(244, 249, 253, 0.9));
    padding: 14px 16px;
}

.admin-lookup-title {
    margin: 0;
    color: #1c2736;
    font-size: 1.02rem;
}

.admin-lookup-password {
    margin: 10px 0 0;
}

.admin-lookup-password code {
    display: inline-block;
    font-size: 1.9rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    font-weight: 700;
    color: #10273f;
}

.admin-lookup-count {
    margin: 8px 0 0;
}

.admin-lookup-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.admin-lookup-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.75);
}

.admin-lookup-item-name {
    color: #1c2736;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.admin-lookup-item-password {
    font-size: 1.05rem;
    font-weight: 700;
    color: #10273f;
    white-space: nowrap;
}

.admin-lookup-result-error {
    background: linear-gradient(170deg, rgba(255, 245, 245, 0.95), rgba(255, 239, 239, 0.9));
    border-color: #f0c3c3;
}

.history-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
}

.history-login-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: stretch;
}

.history-password-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #bcc8d6;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    color: #1b2330;
    background: rgba(255, 255, 255, 0.96);
}

.history-password-input:focus {
    outline: none;
    border-color: #6f95bf;
    box-shadow: 0 0 0 4px rgba(23, 90, 159, 0.14);
}

.history-submit-btn {
    min-height: 46px;
    border: 1px solid var(--btn-border);
    border-radius: 12px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--btn-text);
    cursor: pointer;
    pointer-events: auto;
    background: var(--btn-bg);
    box-shadow: none;
}

@media (max-width: 720px) {
    .legal-page .header-tools {
        justify-content: flex-start;
    }

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

    .history-submit-btn {
        width: 100%;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .admin-gallery-passwords-card {
        padding: 18px;
    }

    .admin-gallery-passwords-card .history-login-row {
        grid-template-columns: 1fr;
    }

    .admin-gallery-passwords-card .history-password-input,
    .admin-gallery-passwords-card .history-submit-btn {
        width: 100%;
    }

    .admin-lookup-password code {
        font-size: 1.4rem;
        word-break: break-all;
    }

    .admin-lookup-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .admin-lookup-item-password {
        white-space: normal;
        word-break: break-all;
    }
}

/* Download prompt page */
body.prompt-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #eef2f6;
    font-family: Arial, Helvetica, sans-serif;
    color: #1a2430;
}

.prompt-box {
    width: min(92vw, 440px);
    background: #fff;
    border: 1px solid #d8e0e8;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(15, 30, 45, 0.15);
}

.prompt-box h1 {
    margin: 0 0 10px;
    font-size: 22px;
}

.prompt-box p {
    margin: 0 0 12px;
    color: #556170;
}

.prompt-error {
    margin: 0 0 12px;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #efb0b0;
    background: #fff3f3;
    color: #8b1e1e;
    font-size: 14px;
}

.prompt-page input[type="password"] {
    width: 100%;
    border: 1px solid #bcc8d6;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 15px;
    box-sizing: border-box;
}

.prompt-row {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.prompt-row button,
.prompt-row a {
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    pointer-events: auto;
}

.prompt-row button {
    background: var(--btn-bg);
    color: var(--btn-text);
    cursor: pointer;
}

.prompt-row a {
    background: var(--btn-bg);
    color: var(--btn-text);
}

/* Viewer page */
html.viewer-page,
body.viewer-page {
    margin: 0;
    padding: 0;
    background: #0f1318;
}

body.viewer-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.viewer-image {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    display: block;
    transition: filter 0.2s ease-out;
}

.viewer-image.is-loading {
    filter: blur(1.5px);
}

/* HTTP status pages */
body.site-page.status-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.status-wrap {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px 20px;
    flex: 1 0 auto;
}

.status-card {
    background: linear-gradient(165deg, #ffffff, #f8fbff);
    border: 1px solid #cfd9e5;
    border-radius: 22px;
    padding: 30px 26px;
    box-shadow: 0 18px 44px rgba(16, 28, 40, 0.14);
}

.status-code {
    margin: 0 0 8px;
    font-size: clamp(3.2rem, 11vw, 7rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #123b66;
}

.status-title {
    margin: 0 0 10px;
    font-size: clamp(1.25rem, 3vw, 2.05rem);
    line-height: 1.15;
}

.status-desc {
    margin: 0 0 10px;
    font-size: clamp(1rem, 1.9vw, 1.15rem);
    color: #33465a;
    max-width: 70ch;
}

.status-sub {
    margin: 0;
    color: #54606f;
}

@media (max-width: 720px) {
    .status-wrap {
        padding: 18px 10px 14px;
    }

    .status-card {
        border-radius: 14px;
        padding: 20px 14px;
    }
}

body.site-page *,
body.prompt-page *,
body.viewer-page * {
    font-weight: 400 !important;
}

*,
*::before,
*::after {
    transition: none !important;
    animation: none !important;
}

.topbar-inner,
.card,
.folder-box,
.home-cover,
.site-footer-inner,
.prompt-box,
.status-card,
.admin-stat-item {
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.search-btn,
.clear-link,
.btn,
.btn.secondary,
.meta-inline-toggle,
.history-submit-btn,
.prompt-row button,
.prompt-row a {
    background-image: none !important;
    box-shadow: none !important;
    background-color: var(--btn-bg) !important;
    color: var(--btn-text) !important;
    border-color: var(--btn-border) !important;
}

.search-input:focus,
.history-password-input:focus {
    box-shadow: none !important;
}
