:root {
    /* Defaults are overridden by DB-backed theme settings in app/helpers.php. */
    /* `--ink` defines the base foreground text color used across the UI. */
    --ink: #202124;
    /* `--muted` defines secondary text tone for less prominent metadata. */
    --muted: #626975;
    /* `--paper` defines the page-level background tone. */
    --paper: #f8f4ec;
    /* `--panel` defines container backgrounds for cards, panels, and tables. */
    --panel: #fffaf0;
    /* `--gallery-panel` defines the opened public gallery header panel. */
    --gallery-panel: #fffaf0;
    /* `--line` defines shared border and divider color. */
    --line: #ded4c2;
    /* `--accent` defines primary interactive color. */
    --accent: #a5481c;
    /* `--accent-dark` defines darker accent tone for contrast and links. */
    --accent-dark: #713414;
    /* `--field` defines form control background fill. */
    --field: #fffdf8;
    /* `--radius` controls rounded corner size for reusable components. */
    --radius: 16px;
}

/* Global page frame ------------------------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(165, 72, 28, 0.15), transparent 28rem),
        linear-gradient(135deg, var(--paper) 0%, #efe4d0 100%);
    font-family: var(--font-family, Georgia, "Times New Roman", serif);
    line-height: 1.55;
}

a {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Shared navigation and buttons */

.site-header,
.site-main,
.site-footer {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
}

.brand {
    font-size: clamp(1.7rem, 4vw, 3rem);
    text-decoration: none;
    color: var(--ink);
    letter-spacing: -0.04em;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nav a,
.button,
button,
input[type="submit"] {
    border: 1px solid var(--accent-dark);
    background: var(--accent);
    color: #fffdf8;
    padding: 0.55rem 0.85rem;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    border-radius: var(--radius, 16px);
}

.button.secondary,
button.secondary {
    background: transparent;
    color: var(--accent-dark);
}

.nav a.is-update-pending,
.button.is-update-pending,
button.is-update-pending {
    border-color: #7f1d1d !important;
    background: repeating-linear-gradient(135deg, #b91c1c 0 0.55rem, #f59e0b 0.55rem 1.1rem) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #7f1d1d !important;
    font-weight: 800;
}

/* Panels, cards, and gallery grids */

.hero,
.panel,
.gallery-card,
.image-card {
    background: rgba(255, 250, 240, 0.88);
    border: 1px solid var(--line);
    box-shadow: 0 12px 34px rgba(54, 38, 20, 0.08);
}

.hero,
.panel {
    padding: clamp(1rem, 3vw, 2rem);
    margin-bottom: 1rem;
    border-radius: var(--radius, 16px);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.gallery-card,
.image-card {
    overflow: hidden;
    border-radius: var(--radius, 16px);
}

.gallery-card-link {
    display: grid;
    min-height: 12rem;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(165, 72, 28, 0.18), rgba(255, 250, 240, 0.8));
}

.gallery-card img {
    display: block;
    width: 100%;
    height: 8rem;
    object-fit: cover;
}

.gallery-collage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 8rem;
    overflow: hidden;
}

.gallery-collage img {
    height: 100%;
    aspect-ratio: auto;
}

.gallery-locked-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
    background: #1f2937;
    color: #ffffff;
    font-weight: 700;
}

.gallery-collage.collage-count-1 {
    grid-template-columns: 1fr;
}

.gallery-collage.collage-count-3 img:first-child {
    grid-row: span 2;
}

.gallery-card-body {
    display: grid;
    align-content: end;
    min-height: 10rem;
    padding: 1rem;
}

.image-card {
    position: relative;
}

.image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: zoom-in;
}

.image-meta {
    padding: 0.75rem;
}

.inline-editor {
    margin: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.78);
    border-radius: var(--radius, 16px);
}

.hero + .inline-editor {
    margin: 0 0 1rem;
}

.inline-editor summary {
    cursor: pointer;
    color: var(--accent-dark);
    font-weight: 700;
}

.inline-editor[open] summary {
    margin-bottom: 0.75rem;
}

.game-entry {
    margin: -0.25rem 0 1rem;
}

.picture-game {
    margin-bottom: 1rem;
}

.picture-game form {
    margin: 0;
}

.picture-game-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.picture-game-choice {
    display: grid;
    grid-template-rows: minmax(18rem, 58vh) auto;
    gap: 0.75rem;
    width: 100%;
    min-height: 0;
    padding: 0.75rem;
    border: 2px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    text-align: left;
    border-radius: var(--radius, 16px);
}

.picture-game-choice:hover,
.picture-game-choice:focus {
    border-color: var(--accent);
    background: var(--field);
}

.picture-game-choice img {
    width: 100%;
    height: 100%;
    min-height: 18rem;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.04);
    border-radius: calc(var(--radius, 16px) * 0.75);
}

.picture-game-choice span {
    display: grid;
    gap: 0.15rem;
}

.picture-game-choice small {
    color: var(--muted);
}

.image-inline-editor textarea {
    min-height: 5rem;
}

.muted {
    color: var(--muted);
}

/* Admin forms, breadcrumbs, and hierarchy indicators */

.form-grid {
    display: grid;
    gap: 0.8rem;
}

.form-grid-spaced {
    margin-top: 1rem;
}

.bulk-row {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.bulk-row label {
    min-width: min(18rem, 100%);
}

.inline-action-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--accent-dark);
}

.tree-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tree-depth-1 { padding-left: 1.4rem; }
.tree-depth-2 { padding-left: 2.8rem; }
.tree-depth-3 { padding-left: 4.2rem; }
.tree-depth-4 { padding-left: 5.6rem; }
.tree-depth-5 { padding-left: 7rem; }
.tree-depth-6 { padding-left: 8.4rem; }
.tree-depth-7 { padding-left: 9.8rem; }
.tree-depth-8 { padding-left: 11.2rem; }

.tree-branch::before {
    content: "\21B3";
    color: var(--muted);
}

tr.is-subgallery td {
    background: rgba(165, 72, 28, 0.05);
}

label {
    display: grid;
    gap: 0.25rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--ink);
    font: inherit;
    border-radius: var(--radius, 16px);
}

textarea {
    min-height: 8rem;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    padding: 0;
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Tags */

.tag-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0;
}

.gallery-card > .tag-list {
    padding: 0 1rem 1rem;
}

.tag-list-label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.tag {
    color: var(--accent-dark);
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.75);
    border-radius: var(--radius, 16px);
    padding: 0.15rem 0.5rem;
    font-size: 0.9rem;
    text-decoration: none;
}

.tag:hover,
.tag:focus {
    border-color: var(--accent-dark);
    background: var(--panel);
}

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-suggestions button {
    padding: 0.2rem 0.5rem;
    background: transparent;
    color: var(--accent-dark);
}

/* Tables and admin thumbnails */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border-radius: var(--radius, 16px);
    overflow: hidden;
}

th,
td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-thumb {
    display: block;
    width: 5rem;
    height: 3.75rem;
    object-fit: cover;
    border-radius: var(--radius, 16px);
}

.notice {
    padding: 0.75rem 1rem;
    background: #fff3cd;
    border: 1px solid #e3c46d;
    margin-bottom: 1rem;
    border-radius: var(--radius, 16px);
}

.notice.is-alert {
    border-color: #b45309;
    background: #fff4e6;
    box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.18) inset;
}

.notice.is-alert .inline-action-form button {
    border-color: #9a3412;
    background: #d97706;
    color: #fffdf8;
}

.compact-support {
    padding: 0.75rem 1rem;
}

.compact-support h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.support-matrix {
    width: auto;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.support-matrix th,
.support-matrix td {
    padding: 0.35rem 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.support-matrix th[scope="row"] {
    text-align: left;
    font-weight: 700;
}

.support-yes {
    color: #166534;
    font-weight: 700;
}

.support-no {
    color: #b91c1c;
    font-weight: 700;
}

.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.thumbnail-progress {
    width: 100%;
    margin: 0 0 1rem;
}

.thumbnail-progress-bar {
    display: block;
    width: 100%;
    height: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--field);
    border-radius: var(--radius, 16px);
    appearance: none;
}

.thumbnail-progress-bar::-webkit-progress-bar {
    background: var(--field);
}

.thumbnail-progress-bar::-webkit-progress-value {
    background: var(--accent);
    transition: inline-size 0.2s ease;
}

.thumbnail-progress-bar::-moz-progress-bar {
    background: var(--accent);
}

.thumbnail-progress p {
    margin: 0.35rem 0 0;
}

.tree-toggle,
.tree-spacer {
    display: inline-grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
}

.tree-toggle {
    padding: 0;
    background: transparent;
    color: var(--accent-dark);
}

/* Voting and lightbox */

.vote-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vote-row button {
    padding: 0.2rem 0.55rem;
}

.vote-row button.is-active {
    background: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(165, 72, 28, 0.18);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) 4rem;
    grid-template-areas: "previous stage next";
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: rgba(20, 15, 10, 0.88);
}

.lightbox[hidden] {
    display: none;
}

.lightbox.is-fullscreen {
    padding: 0;
    gap: 0;
    background: #050505;
    grid-template-columns: 1fr;
    grid-template-areas: "stage";
}

.lightbox.is-mobile-fullscreen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    gap: 0;
    background: #050505;
    grid-template-columns: 1fr;
    grid-template-areas: "stage";
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    touch-action: none;
    overscroll-behavior: contain;
}

.lightbox.is-fullscreen figure,
.lightbox.is-mobile-fullscreen figure {
    width: 100%;
    height: 100%;
}

.lightbox.is-fullscreen img,
.lightbox.is-mobile-fullscreen img {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    border-radius: 0;
}

.lightbox.is-fullscreen .lightbox-meta,
.lightbox.is-mobile-fullscreen .lightbox-meta {
    position: absolute;
    inset: auto 1rem 1rem;
    max-width: min(58rem, calc(100% - 2rem));
    padding: 0.75rem;
    background: rgba(10, 10, 10, 0.42);
    border-radius: var(--radius, 16px);
    backdrop-filter: blur(8px);
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-toolbar > .lightbox-fullscreen-link,
.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-toolbar > .lightbox-map-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 2.25rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid #fffdf8;
    border-radius: var(--radius, 16px);
    background: rgba(255, 253, 248, 0.12);
    color: #fffdf8;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-toolbar > .lightbox-map-button[hidden] {
    display: none !important;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-meta {
    max-width: min(42rem, calc(100% - 2rem));
    padding: 0.45rem 0.6rem;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-toolbar {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    max-width: 100%;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-toolbar > .lightbox-fullscreen-link,
.lightbox.is-fullscreen:not(.is-mobile-fullscreen) .lightbox-toolbar > .lightbox-map-button {
    width: auto;
    min-width: 0;
    padding: 0.25rem 0.55rem;
    font-size: 0.9rem;
}

.lightbox-fullscreen-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    min-width: 2.6rem;
}

.lightbox-mobile-fullscreen-button {
    display: none;
    place-items: center;
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    left: max(1rem, env(safe-area-inset-left));
    min-width: 3rem;
    min-height: 3rem;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
}

.lightbox.is-mobile-device .lightbox-fullscreen-button {
    display: none;
}

.lightbox.is-mobile-device .lightbox-mobile-fullscreen-button {
    display: inline-grid;
}

.lightbox figure {
    grid-area: stage;
    display: grid;
    justify-items: center;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.lightbox img {
    display: block;
    margin: 0 auto;
    max-width: min(100%, calc(100vw - 8rem));
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--radius, 16px);
}

.lightbox-meta {
    display: grid;
    gap: 0.45rem;
    justify-items: center;
    max-width: min(58rem, 100%);
}

.lightbox figure {
    margin: 0;
    color: #fffdf8;
    text-align: center;
}

.lightbox-stage-link {
    position: relative;
    display: grid;
    place-items: center;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
}

.lightbox-stage-link:hover,
.lightbox-stage-link:focus,
.lightbox-stage-link:focus-visible,
.lightbox-stage-link:active {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.lightbox-stage-link::-moz-focus-inner {
    border: 0 !important;
}

.lightbox.is-fullscreen .lightbox-stage-link,
.lightbox.is-mobile-fullscreen .lightbox-stage-link {
    width: 100%;
    height: 100%;
    cursor: zoom-out;
}

.lightbox-stage-link > img {
    grid-area: 1 / 1;
}

.lightbox:not(.is-fullscreen):not(.is-mobile-fullscreen) .lightbox-stage-link {
    width: var(--lightbox-stage-width, auto);
    height: var(--lightbox-stage-height, auto);
}

.lightbox:not(.is-fullscreen):not(.is-mobile-fullscreen) .lightbox-stage-link > img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.lightbox-transition-image {
    opacity: 0;
    pointer-events: none;
    transition: opacity 80ms ease;
}

.lightbox-transition-image.is-visible {
    opacity: 1;
}

.lightbox button {
    border-color: #fffdf8;
}

.lightbox-vote {
    justify-content: center;
    margin: 0;
    padding: 0;
}

.lightbox-vote-label {
    min-width: auto;
    color: #2a2118;
    font-weight: 700;
}

.lightbox-vote-panel {
    width: min(34rem, 100%);
    padding: 0.7rem;
    border: 2px solid #fffdf8;
    background: #fffdf8;
    color: #2a2118;
    border-radius: var(--radius, 16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.lightbox-score-badge {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.45rem;
    min-width: 9rem;
    padding: 0.35rem 0.85rem;
    border: 2px solid #fffdf8;
    background: #fffdf8;
    color: #2a2118;
    border-radius: var(--radius, 16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    font-weight: 800;
}

.lightbox-score-badge strong {
    color: var(--accent-dark);
    font-size: 1.45rem;
    line-height: 1;
}

.lightbox-vote-panel .vote-row {
    flex-wrap: wrap;
}

.lightbox-vote-panel .vote-row span {
    min-width: auto;
}

.lightbox-vote-panel button {
    border-color: var(--accent-dark);
    background: var(--accent);
    color: #fffdf8;
}

.lightbox-vote-indicator {
    min-width: 6.75rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: var(--radius, 16px);
    font-weight: 700;
}

.lightbox-vote-indicator.is-up {
    border-color: #1d7f39;
    color: #1d7f39;
}

.lightbox-vote-indicator.is-down {
    border-color: #a73333;
    color: #a73333;
}

.lightbox-nav {
    min-width: 3rem;
    min-height: 3rem;
    border-radius: var(--radius, 16px);
    font-size: 1.5rem;
    justify-self: center;
}

.lightbox-previous {
    grid-area: previous;
}

.lightbox-next {
    grid-area: next;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.lightbox.is-mobile-device .lightbox-close {
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
}

.lightbox-hud,
.lightbox-meta {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.lightbox.is-fullscreen .lightbox-hud,
.lightbox.is-fullscreen .lightbox-meta,
.lightbox.is-mobile-fullscreen .lightbox-hud,
.lightbox.is-mobile-fullscreen .lightbox-meta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.35rem);
}

.lightbox.is-fullscreen.is-ui-visible .lightbox-hud,
.lightbox.is-fullscreen.is-ui-visible .lightbox-meta,
.lightbox.is-mobile-fullscreen.is-ui-visible .lightbox-hud,
.lightbox.is-mobile-fullscreen.is-ui-visible .lightbox-meta {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split figure {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(560px, 38vw);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-stage-link {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-self: stretch;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-stage-link img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-meta {
    position: static;
    inset: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    justify-self: center;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0.5rem;
    min-width: 0;
    min-height: 0;
    padding: 0.5rem;
    border-left: 1px solid rgba(255, 253, 248, 0.18);
    background: rgba(10, 10, 10, 0.24);
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split[hidden] {
    display: none !important;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-title {
    color: #fffdf8;
    font-size: 0.95rem;
    font-weight: 700;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-canvas {
    min-height: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-canvas .leaflet-container {
    width: 100%;
    height: 100%;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-canvas .leaflet-container img,
.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-canvas .leaflet-container .leaflet-tile {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: none;
    max-height: none;
    max-width: none;
    object-fit: initial;
    opacity: 1;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-canvas .leaflet-tile-loaded {
    opacity: 1 !important;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split-close {
    justify-self: end;
    margin-top: 2.75rem;
}

.lightbox.is-fullscreen .lightbox-nav,
.lightbox.is-mobile-fullscreen .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox.is-fullscreen .lightbox-previous,
.lightbox.is-mobile-fullscreen .lightbox-previous {
    left: 1rem;
}

.lightbox.is-fullscreen .lightbox-next,
.lightbox.is-mobile-fullscreen .lightbox-next {
    right: 1rem;
}

.lightbox.is-fullscreen figure a,
.lightbox.is-mobile-fullscreen figure a {
    width: 100%;
    height: 100%;
}

body.has-mobile-lightbox {
    overflow: hidden;
}

.has-lightbox {
    overflow: hidden;
}

/* Responsive adjustments */

.site-footer {
    padding: 2rem 0;
    text-align: center;
}

.site-footer-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.site-footer-link:hover,
.site-footer-link:focus {
    color: var(--accent);
    text-decoration: underline;
}

/* Compact admin treatment */

.admin-page {
    --ink: #1d2327;
    --muted: #646970;
    --line: #dcdcde;
    --paper: #f0f0f1;
    --panel: #fff;
    --field: #fff;
    background: var(--paper);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.admin-page .site-header {
    width: 100%;
    padding: 0.55rem 1rem;
    background: #1d2327;
    color: #f0f0f1;
}

.admin-page .brand {
    color: #f0f0f1;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.admin-page .nav {
    gap: 0.35rem;
}

.admin-page .nav a,
.admin-page .button,
.admin-page button,
.admin-page input[type="submit"] {
    padding: 0.35rem 0.6rem;
    border-color: #2271b1;
    background: #2271b1;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.4;
}

.admin-page .button.secondary,
.admin-page button.secondary,
.admin-page .tree-toggle {
    background: #fff;
    color: #2271b1;
}

.admin-page .gallery-row-actions {
    gap: 0.2rem;
    white-space: nowrap;
}

.admin-page .gallery-row-actions .gallery-row-action {
    padding: 0.16rem 0.38rem;
    font-size: 12px;
    line-height: 1.05;
}

.admin-page .site-main,
.admin-page .site-footer {
    width: min(1280px, calc(100% - 2rem));
}

.admin-page .hero,
.admin-page .panel {
    padding: 1rem;
    border-color: #c3c4c7;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    border-radius: 4px;
}

.admin-page .hero h1,
.admin-page .panel h1,
.admin-page .panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    line-height: 1.25;
}

.admin-page .bulk-row {
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.admin-page .bulk-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    font-weight: 600;
}

.admin-page input,
.admin-page textarea,
.admin-page select {
    min-height: 2rem;
    padding: 0.35rem 0.5rem;
    border-color: #8c8f94;
    border-radius: 3px;
}

.admin-page input[type="checkbox"] {
    width: 0.95rem;
    height: 0.95rem;
    min-height: 0;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.admin-page label:has(input[type="checkbox"]) {
    align-items: center;
}

.admin-page .admin-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    font-weight: 600;
}

.admin-devmode-panel--secondary {
    margin-top: 1rem;
    border-style: dashed;
    opacity: 0.92;
}

.admin-devmode-panel--secondary h2 {
    font-size: 1.05rem;
}

.admin-page table {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.25;
}

.admin-page th {
    background: #f6f7f7;
    color: #1d2327;
    font-weight: 600;
}

.admin-page th,
.admin-page td {
    padding: 0.22rem 0.45rem;
    vertical-align: middle;
}

.admin-page td input[type="checkbox"] {
    width: 0.9rem;
    height: 0.9rem;
}

.admin-flag.is-enabled {
    color: #1f8a3b;
    font-weight: 800;
    display: inline-block;
    min-width: 1ch;
}

.admin-page tr:hover td {
    background: #f6f7f7;
}

.admin-page tr.is-subgallery td {
    background: #fbfbfc;
}

.admin-page .admin-thumb {
    width: 4rem;
    height: 3rem;
    border-radius: 3px;
}

.admin-page .tree-toggle,
.admin-page .tree-spacer {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    padding: 0;
    font-size: 11px;
    line-height: 1;
}

.admin-page .tree-title {
    gap: 0.18rem;
}

.admin-page .thumbnail-progress-bar {
    height: 0.55rem;
    border-radius: 3px;
}

@media (max-width: 680px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .lightbox {
        grid-template-columns: 1fr;
        grid-template-areas: "stage";
    }

    .lightbox img {
        max-width: calc(100vw - 2rem);
    }

    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .lightbox-previous {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .picture-game-pair {
        grid-template-columns: 1fr;
    }

    .picture-game-choice {
        grid-template-rows: minmax(15rem, 48vh) auto;
    }
}



.gallery-list-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0;
    column-gap: 0;
    align-items: start;
    overflow: visible;
}

.gallery-list-content {
    min-width: 0;
}

.gallery-image-grid {
    min-width: 0;
}

.back-to-top-button {
    position: sticky;
    top: calc(100dvh - 5.25rem);
    z-index: 900;
    margin-left: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: max-content;
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(255, 253, 248, 0.7);
    background: var(--accent);
    color: #fffdf8;
    box-shadow: 0 14px 34px rgba(54, 38, 20, 0.24);
    font-weight: 800;
    line-height: 1;
    opacity: 0;
    transform: translateY(0.75rem);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.back-to-top-button[hidden] {
    display: none;
}

.back-to-top-button.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top-button:hover,
.back-to-top-button:focus-visible {
    box-shadow: 0 18px 44px rgba(54, 38, 20, 0.32);
    transform: translateY(-2px);
}

.back-to-top-button span:first-child {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.18);
    font-size: 1.05rem;
}

@media (max-width: 980px) {
    .gallery-list-frame {
        display: block;
    }

    .back-to-top-button {
        position: fixed;
        right: 0.85rem;
        bottom: 0.85rem;
        top: auto;
        padding: 0.65rem 0.8rem;
    }
}


/* Public design refinements */
.public-page .hero {
    position: relative;
    overflow: hidden;
    border: 0;
    background: var(--gallery-panel);
}

.public-page .hero h1 {
    max-width: 100%;
    margin: 0 0 0.35rem;
    font-size: clamp(1.75rem, 3.4vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: 0;
    overflow-wrap: normal;
    word-break: normal;
}

.public-page .hero p {
    max-width: 68ch;
}

.public-page .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.85rem;
}

.public-page .hero .breadcrumbs {
    margin-top: 1rem;
}

.public-page .gallery-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.public-page .gallery-card:hover,
.public-page .gallery-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(54, 38, 20, 0.14);
}

.public-page .gallery-card img,
.public-page .gallery-collage {
    height: 12rem;
}

.public-page .gallery-card-body {
    min-height: 8rem;
}

.public-page .gallery-card-body h2,
.public-page .image-meta h2 {
    margin: 0 0 0.25rem;
    line-height: 1.15;
}

.public-page .image-card {
    background: rgba(255, 250, 240, 0.94);
}

.public-page .image-meta p {
    margin-top: 0.25rem;
}

.gallery-card > .tag-list .tag-list-label,
.hero .tag-list .tag-list-label {
    opacity: 0.7;
}

.vote-row {
    margin-top: 0.6rem;
}

.vote-row span {
    min-width: 5.25rem;
}

.vote-row button {
    min-width: 2.1rem;
    font-weight: 800;
    line-height: 1;
}

.lightbox figure {
    display: grid;
    gap: 0.75rem;
    justify-items: center;
}

.lightbox-meta {
    display: grid;
    gap: 0.45rem;
    justify-items: center;
    max-width: min(58rem, 100%);
}

.lightbox-description {
    max-width: min(52rem, 100%);
    margin: 0;
    color: rgba(255, 253, 248, 0.9);
    overflow-wrap: anywhere;
}

.lightbox-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.lightbox-fullscreen-link {
    padding: 0.3rem 0.7rem;
    border: 1px solid #fffdf8;
    background: rgba(255, 253, 248, 0.12);
    color: #fffdf8;
    border-radius: var(--radius, 16px);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.lightbox-counter,
.lightbox-help {
    color: rgba(255, 253, 248, 0.78);
    font-size: 0.9rem;
}

.lightbox-original-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    border: 1px solid #fffdf8;
    border-radius: var(--radius, 16px);
    color: #fffdf8;
    padding: 0.35rem 0.65rem;
    text-decoration: none;
}


/* Leaflet base layout for EXIF GPS maps.
   The map library is loaded only when a visitor opens a map, but these rules
   must already exist before Leaflet measures the canvas. Without them, tile
   panes can be initialized with incomplete dimensions and the map appears as
   broken rectangular fragments. These rules intentionally mirror the small
   subset of Leaflet 1.9.x CSS required for tile, marker, popup and control
   positioning. */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
    left: 0;
    position: absolute;
    top: 0;
}

.leaflet-container {
    background: #ddd;
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    touch-action: pan-x pan-y;
}

.leaflet-tile-pane {
    z-index: 200;
}

.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-shadow-pane {
    z-index: 500;
}

.leaflet-marker-pane {
    z-index: 600;
}

.leaflet-tooltip-pane {
    z-index: 650;
}

.leaflet-popup-pane {
    z-index: 700;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
    user-select: none;
}

.leaflet-tile {
    filter: inherit;
    visibility: hidden;
}

.leaflet-tile-loaded {
    opacity: 1;
    visibility: inherit;
}

.leaflet-fade-anim .leaflet-tile {
    opacity: 0;
    transition: opacity 0.2s linear;
    will-change: opacity;
}

.leaflet-fade-anim .leaflet-tile-loaded {
    opacity: 1;
}

.leaflet-zoom-animated {
    transform-origin: 0 0;
}

.leaflet-zoom-hide {
    visibility: hidden;
}

.leaflet-interactive {
    cursor: pointer;
}

.leaflet-grab {
    cursor: grab;
}

.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
    cursor: grabbing;
}

.leaflet-control {
    pointer-events: auto;
    position: relative;
    z-index: 800;
}

.leaflet-top,
.leaflet-bottom {
    pointer-events: none;
    position: absolute;
    z-index: 1000;
}

.leaflet-top {
    top: 0;
}

.leaflet-right {
    right: 0;
}

.leaflet-bottom {
    bottom: 0;
}

.leaflet-left {
    left: 0;
}

.leaflet-control {
    clear: both;
    float: left;
}

.leaflet-right .leaflet-control {
    float: right;
}

.leaflet-top .leaflet-control {
    margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
    margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
    margin-left: 10px;
}

.leaflet-right .leaflet-control {
    margin-right: 10px;
}

.leaflet-control-zoom a {
    background: #fff;
    border-bottom: 1px solid #ccc;
    color: #000;
    display: block;
    font: 700 18px/26px Arial, Helvetica, sans-serif;
    height: 26px;
    text-align: center;
    text-decoration: none;
    width: 26px;
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus {
    background: #f4f4f4;
}

.leaflet-control-zoom-in {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.leaflet-control-zoom-out {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-bottom: 0;
}

.leaflet-bar {
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}

.leaflet-popup {
    margin-bottom: 20px;
    position: absolute;
    text-align: center;
}

.leaflet-popup-content-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
    padding: 1px;
    text-align: left;
}

.leaflet-popup-content {
    line-height: 1.3;
    margin: 13px 24px 13px 20px;
    min-height: 1px;
}

.leaflet-popup-tip-container {
    height: 20px;
    left: 50%;
    margin-left: -20px;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    width: 40px;
}

.leaflet-popup-tip {
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
    height: 17px;
    margin: -10px auto 0;
    padding: 1px;
    transform: rotate(45deg);
    width: 17px;
}

.leaflet-popup-close-button {
    color: #757575;
    font: 16px/24px Tahoma, Verdana, sans-serif;
    height: 24px;
    position: absolute;
    right: 0;
    text-align: center;
    text-decoration: none;
    top: 0;
    width: 24px;
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
    color: #111;
}

.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    font-size: 11px;
    line-height: 1.4;
    padding: 0 5px;
}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
    pointer-events: auto;
}

.leaflet-container img.leaflet-tile,
.leaflet-container img.leaflet-marker-icon,
.leaflet-container img.leaflet-marker-shadow {
    max-height: none;
    max-width: none;
}

.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer {
    border: 0;
    padding: 0;
}

.leaflet-container .leaflet-control-attribution a {
    color: #0078a8;
}

.leaflet-default-icon-path {
    background-image: url("https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png");
}

/* GPS map controls for EXIF photo locations. */
.image-card {
    position: relative;
}

.image-preview-link {
    display: block;
}

.photo-map-pin {
    align-items: center;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.1rem;
    height: 2.2rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 0.85rem;
    top: 0.85rem;
    width: 2.2rem;
    z-index: 2;
}

.photo-map-pin:hover,
.photo-map-pin:focus-visible,
.lightbox-map-button:hover,
.lightbox-map-button:focus-visible {
    transform: translateY(-1px);
}

.lightbox-map-button {
    padding: 0.35rem 0.7rem;
}

.map-overlay {
    align-items: center;
    background: rgba(2, 6, 23, 0.82);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1.5rem;
    position: fixed;
    z-index: 1200;
}

.map-overlay[hidden] {
    display: none;
}

.map-dialog {
    background: var(--panel-bg, #fff);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
    border-radius: 1rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    color: var(--text, #111827);
    max-width: 1120px;
    padding: 1rem;
    position: relative;
    width: min(96vw, 1120px);
}

.map-dialog h2 {
    margin: 0 4.5rem 0.75rem 0;
}

.map-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.map-canvas {
    border-radius: 0.75rem;
    height: min(70vh, 720px);
    min-height: 360px;
    overflow: hidden;
    width: 100%;
}

.map-popup {
    max-width: 240px;
}

.map-popup img {
    border-radius: 0.45rem;
    display: block;
    height: auto;
    margin-bottom: 0.5rem;
    max-width: 220px;
    width: 100%;
}

.map-popup h3 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.map-popup p {
    margin: 0.35rem 0;
}

.map-attribution-note {
    margin: 0.65rem 0 0;
}

body.has-map-overlay {
    overflow: hidden;
}

.exif-admin-summary dl {
    display: grid;
    gap: 0.35rem 1rem;
    grid-template-columns: max-content minmax(0, 1fr);
}

.exif-admin-summary dt {
    font-weight: 700;
}

.exif-admin-summary dd {
    margin: 0;
}

/* Leaflet fullscreen split hardening.
   Browser fullscreen applies the gallery lightbox image rules to every image
   inside the fullscreen element. Leaflet also keeps old tile containers around
   during zoom/resize transitions. These local overrides keep map tiles as raw
   map tiles so the split map cannot inherit photo sizing, filters, radius or
   transitions from the fullscreen viewer. */
.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split .leaflet-container img.leaflet-tile,
.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split .leaflet-container .leaflet-tile-pane img {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    filter: none !important;
    height: 256px !important;
    margin: 0 !important;
    max-height: none !important;
    max-width: none !important;
    object-fit: initial !important;
    opacity: 1 !important;
    padding: 0 !important;
    transition: none !important;
    visibility: visible !important;
    width: 256px !important;
}

.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split .leaflet-tile-container,
.lightbox.is-fullscreen:not(.is-mobile-fullscreen).is-map-split .lightbox-map-split .leaflet-tile-pane {
    filter: none !important;
    opacity: 1 !important;
}


/* Leaflet marker icon hardening.
   Keep the GPS pin dimensions independent from gallery image and fullscreen
   image rules while leaving map tiles controlled by the tile-specific reset. */
.leaflet-container img.leaflet-marker-icon {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    filter: none !important;
    height: 41px !important;
    margin: 0 !important;
    max-height: none !important;
    max-width: none !important;
    object-fit: initial !important;
    opacity: 1 !important;
    padding: 0 !important;
    transition: none !important;
    visibility: visible !important;
    width: 25px !important;
    z-index: auto;
}

.leaflet-container img.leaflet-marker-shadow {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    filter: none !important;
    height: 41px !important;
    margin: 0 !important;
    max-height: none !important;
    max-width: none !important;
    object-fit: initial !important;
    opacity: 1 !important;
    padding: 0 !important;
    transition: none !important;
    visibility: visible !important;
    width: 41px !important;
}

.leaflet-container .leaflet-marker-pane {
    z-index: 600;
}

.leaflet-container .leaflet-shadow-pane {
    z-index: 500;
}

/* CSS-only Leaflet marker for gallery GPS maps.
   This avoids Leaflet's external PNG marker dependency, which can appear as a
   broken image in fullscreen or on hosts that restrict CDN image loading. */
.leaflet-container .gallery-leaflet-marker {
    background: transparent !important;
    border: 0 !important;
    display: block !important;
    height: 40px !important;
    margin: 0 !important;
    opacity: 1 !important;
    overflow: visible !important;
    padding: 0 !important;
    visibility: visible !important;
    width: 26px !important;
}

.leaflet-container .gallery-leaflet-marker-pin {
    background: #2f80d1;
    border: 2px solid #ffffff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    display: block;
    height: 26px;
    left: 0;
    position: absolute;
    top: 0;
    transform: rotate(-45deg);
    width: 26px;
}

.leaflet-container .gallery-leaflet-marker-pin::after {
    background: #ffffff;
    border-radius: 50%;
    content: "";
    display: block;
    height: 8px;
    left: 7px;
    position: absolute;
    top: 7px;
    width: 8px;
}

.leaflet-container .gallery-leaflet-marker-shadow {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 50%;
    bottom: -1px;
    display: block;
    height: 9px;
    left: 4px;
    position: absolute;
    transform: rotate(-12deg);
    width: 22px;
}

.image-detail-panel {
    text-align: center;
}

.image-detail-photo {
    display: block;
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.favicon-current {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.favicon-current img,
.favicon-preview-row canvas {
    width: 48px;
    height: 48px;
    border: 1px solid var(--line, #d6cfc2);
    border-radius: 0.5rem;
    background: #fff;
    image-rendering: auto;
}

.favicon-cropper {
    display: grid;
    gap: 0.8rem;
    max-width: 360px;
}

.favicon-crop-stage {
    width: 256px;
    height: 256px;
    border: 1px solid var(--line, #d6cfc2);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
    touch-action: none;
}

.favicon-crop-stage canvas {
    display: block;
    width: 256px;
    height: 256px;
    cursor: grab;
}

.favicon-crop-stage canvas:active {
    cursor: grabbing;
}

.favicon-preview-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.lightbox.is-fullscreen,
.lightbox.is-mobile-fullscreen,
.lightbox:fullscreen {
    background: #050505 !important;
}


.gallery-dev-overlay {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2147483000;
    width: min(35rem, calc(100vw - 1.5rem));
    max-height: min(60vh, 34rem);
    overflow: hidden;
    color: rgba(255, 255, 255, 0.94);
    background: rgba(5, 10, 18, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.7rem;
    box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.68rem;
    line-height: 1.28;
    pointer-events: none;
}

.gallery-dev-overlay header,
.gallery-dev-overlay footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.gallery-dev-overlay footer {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 0;
    opacity: 0.72;
}

.gallery-dev-overlay strong {
    display: inline-grid;
    place-items: center;
    min-width: 2.2rem;
    min-height: 1.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.gallery-dev-overlay pre {
    margin: 0;
    padding: 0.45rem 0.55rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.gallery-dev-overlay canvas {
    display: block;
    width: 100%;
    height: 72px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.lightbox.is-fullscreen .gallery-dev-overlay,
.lightbox.is-mobile-fullscreen .gallery-dev-overlay,
.lightbox:fullscreen .gallery-dev-overlay {
    right: 0.75rem;
    bottom: 0.75rem;
}

@media (max-width: 720px) {
    .gallery-dev-overlay {
        right: 0.5rem;
        bottom: 0.5rem;
        width: calc(100vw - 1rem);
        font-size: 0.62rem;
    }
}
