/* ----------------------------------------
   Base Reset
----------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #f3f1ed;
    color: #1f1f1f;
}

a {
    color: #111;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ----------------------------------------
   Layout
----------------------------------------- */

header {
    background: #f3f1ed;
    border-bottom: 1px solid #ddd8cf;
    padding: 18px 32px 14px;
    font-size: 14px;
}

header a {
    color: #111;
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.brand {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.2px;
    justify-self: center;
    text-transform: none;
}

.explore-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.explore-nav a {
    color: #444;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.explore-nav a:hover {
    color: #111;
}

.header-left {
    justify-self: start;
}

.header-left a {
    color: #444;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    font-weight: 600;
}

.header-left a:hover {
    color: #111;
}

.header-right {
    justify-self: end;
}

.nsfw-toggle {
    font: inherit;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #333;
    border: 1px solid #d2d2d2;
    background: #f7f7f7;
    padding: 3px 8px 3px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    min-height: 28px;
}

.nsfw-toggle:hover {
    color: #111;
    border-color: #999;
}

.nsfw-toggle-label {
    font-size: 10px;
    letter-spacing: 0.8px;
}

.nsfw-toggle-state {
    font-size: 9px;
    letter-spacing: 0.7px;
    color: #5f5f5f;
    text-transform: uppercase;
    line-height: 1;
    user-select: none;
    pointer-events: none;
    transform: translateX(6px);
    transition: transform 0.2s ease, color 0.2s ease;
}

.nsfw-toggle.is-on .nsfw-toggle-state {
    color: #303030;
    transform: translateX(-6px);
}

.nsfw-switch {
    width: 56px;
    height: 18px;
    border-radius: 999px;
    background: #cfcfcf;
    border: 1px solid #bdbdbd;
    position: relative;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nsfw-switch-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #b8b8b8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.nsfw-toggle.is-on .nsfw-switch {
    background: #b8b8b8;
}

.nsfw-toggle.is-on .nsfw-switch-thumb {
    transform: translateX(38px);
}

body.nsfw-blur-enabled img[data-nsfw="1"] {
    filter: blur(14px);
    transform: scale(1.03);
    transition: filter 0.2s ease;
}

body.nsfw-blur-enabled .thumb:hover img[data-nsfw="1"] {
    filter: blur(4px);
}

main {
    max-width: 1040px;
    margin: 30px auto 48px;
    padding: 0 20px;
}

/* ----------------------------------------
   Image Page
----------------------------------------- */

.image-detail-layout {
    display: block;
    margin-bottom: 24px;
}

.image-detail-main {
    min-width: 0;
    max-width: 980px;
    margin: 0 auto;
}

.image-wrapper {
    text-align: center;
    margin-bottom: 14px;
}

.image-detail-controls {
    margin-top: 10px;
}

.main-image-shell {
    display: inline-block;
}

.main-image {
    max-width: 100%;
    height: auto;
    box-shadow: 0 8px 22px rgba(10,0,0,0.08);
    border-radius: 0;
    background: #fff;
}

.favorite-toggle {
    position: static;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.favorite-row {
    display: flex;
    justify-content: flex-end;
}

.moderation-row {
    margin-top: 8px;
    width: min(100%, 980px);
    display: flex;
    justify-content: flex-end;
}

.postcard-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.image-actions-row {
    margin-top: 8px;
    width: min(100%, 980px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.postcard-toggle {
    border: 1px solid #d0d0d0;
    background: #fafafa;
    color: #444;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 6px 10px;
    cursor: pointer;
}

.postcard-toggle:hover {
    border-color: #9c9c9c;
    color: #111;
}

.postcard-toggle.is-disabled {
    cursor: not-allowed;
    color: #888;
    background: #f2f2f2;
    border-color: #e1e1e1;
}

.postcard-disabled-tip {
    font-size: 11px;
    line-height: 1.35;
    color: #7a7368;
}

.postcard-composer {
    margin: 14px auto 0;
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
}

.postcard-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 26px;
}

.postcard-modal[hidden] {
    display: none !important;
}

.postcard-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 12, 0.62);
}

.postcard-modal-panel {
    position: relative;
    z-index: 1;
    width: min(1120px, 96vw);
    max-height: 92vh;
    overflow: auto;
    border: 1px solid #d8d8d8;
    background: #f5f5f5;
    box-shadow: 0 16px 46px rgba(0, 0, 0, 0.36);
    padding: 14px;
}

.postcard-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dedede;
}

.postcard-modal-head h3 {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #555;
}

.postcard-modal-close {
    border: 1px solid #ccc;
    background: #fff;
    color: #666;
    width: 28px;
    height: 28px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.postcard-modal-close:hover {
    color: #111;
    border-color: #999;
}

.postcard-modal .postcard-composer {
    margin: 0;
    width: 100%;
}

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

.postcard-fields {
    border: 1px solid #e2e2e2;
    background: #fff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.postcard-field {
    display: grid;
    gap: 5px;
    text-align: left;
}

.postcard-field span {
    font-size: 10px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #666;
}

.postcard-field select,
.postcard-field textarea,
.postcard-field input {
    width: 100%;
    border: 1px solid #d8d8d8;
    background: #fcfcfc;
    color: #222;
    font: inherit;
    font-size: 13px;
    padding: 7px;
}

.postcard-field textarea {
    resize: vertical;
}

.postcard-focus-wrap {
    gap: 7px;
}

.postcard-range-field {
    display: grid;
    grid-template-columns: 14px 1fr 40px;
    align-items: center;
    gap: 8px;
}

.postcard-range-field span {
    font-size: 10px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #666;
}

.postcard-range-field input[type="range"] {
    width: 100%;
    padding: 0;
}

.postcard-range-value {
    font-size: 11px;
    color: #555;
    text-align: right;
    min-width: 34px;
}

.postcard-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.postcard-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cdcdcd;
    background: #fff;
    color: #444;
    font-size: 10px;
    letter-spacing: 0.65px;
    text-transform: uppercase;
    padding: 6px 10px;
    cursor: pointer;
    text-decoration: none;
}

.postcard-action:hover {
    border-color: #9c9c9c;
    color: #111;
    text-decoration: none;
}

.postcard-action.is-primary {
    background: #f4f4f4;
}

.postcard-status {
    min-height: 16px;
    text-align: left;
    color: #666;
    font-size: 12px;
}

.postcard-link-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.postcard-link-wrap input {
    flex: 1 1 240px;
    border: 1px solid #d8d8d8;
    background: #fcfcfc;
    color: #222;
    font: inherit;
    font-size: 12px;
    padding: 6px;
}

.postcard-share-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.postcard-share-icon {
    width: 26px;
    height: 26px;
    border: 1px solid #cdcdcd;
    background: #fff;
    color: #444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    text-decoration: none;
}

.postcard-share-icon:hover {
    border-color: #9c9c9c;
    color: #111;
    text-decoration: none;
}

.postcard-share-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.postcard-preview-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 0;
}

.postcard-preview {
    --postcard-back-background: url("/static/post-card2.webp") center center / 100% 100% no-repeat;
    --postcard-front-width: min(100%, 380px);
    --postcard-front-ratio: 3 / 2;
    --postcard-back-width: min(100%, 380px);
    --postcard-back-ratio: 3 / 2;
    --postcard-active-width: var(--postcard-front-width);
    --postcard-active-ratio: var(--postcard-front-ratio);
    width: var(--postcard-active-width);
    aspect-ratio: var(--postcard-active-ratio);
    position: relative;
    perspective: 1200px;
    border: 0;
    background: transparent;
    display: block;
    overflow: hidden;
    transition: width 0.25s ease, aspect-ratio 0.25s ease;
}

.postcard-preview.postcard-layout-portrait {
    --postcard-front-width: min(100%, 300px);
    --postcard-front-ratio: 2 / 3;
}

.postcard-preview.is-flipped {
    --postcard-active-width: var(--postcard-back-width);
    --postcard-active-ratio: var(--postcard-back-ratio);
}

.postcard-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.62s cubic-bezier(0.22, 0.68, 0.19, 1);
    will-change: transform;
}

.postcard-face {
    position: absolute;
    inset: 0;
    border: 0;
    background: transparent;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    transform: translateZ(0);
}

.postcard-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.postcard-preview.postcard-fit-fit .postcard-front img {
    object-fit: contain;
}

.postcard-front {
    opacity: 1;
    background: #ebe5da;
}

.postcard-back {
    transform: rotateY(180deg);
    opacity: 1;
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
    background: var(--postcard-back-background);
    background-color: #e8dcc0;
    color: #463c2f;
    font-family: "Times New Roman", Georgia, serif;
}

.postcard-preview.is-flipped .postcard-card {
    transform: rotateY(180deg);
}

.postcard-back-grid {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 24% 12.2% 16%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 50.5% 49.5%;
    gap: 3%;
    background: var(--postcard-back-background);
    background-color: #e8dcc0;
}

.postcard-note-panel {
    padding: 2% 18px 0 4px;
    border-right: 0;
    text-align: left;
    min-width: 0;
}

.postcard-note-title {
    display: none;
}

.postcard-message {
    min-height: 0;
    max-width: 94%;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.32;
    color: #514733;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
    font-family: "Bradley Hand", "Segoe Print", "Lucida Handwriting", "Snell Roundhand", "Apple Chancery", cursive;
}

.postcard-sender {
    margin-top: 10px;
    font-size: 12px;
    color: #5a4f3c;
    font-style: normal;
    font-family: "Bradley Hand", "Segoe Print", "Lucida Handwriting", "Snell Roundhand", "Apple Chancery", cursive;
}

.postcard-address-panel {
    padding-top: 8%;
    display: grid;
    align-content: start;
    gap: 10%;
}

.postcard-recipient-address {
    min-height: 16px;
    font-size: 12px;
    line-height: 1.2;
    color: #4d4437;
    font-family: "Bradley Hand", "Segoe Print", "Lucida Handwriting", "Snell Roundhand", "Apple Chancery", cursive;
    text-align: left;
    padding: 0 6px 2px 4px;
}

.postcard-address-line {
    display: none;
}

.postcard-template-classic {
    background: var(--postcard-back-background);
    background-color: #e8dcc0;
    color: #463c2f;
    font-family: "Times New Roman", Georgia, serif;
}

.postcard-page {
    display: grid;
    gap: 14px;
    justify-items: center;
}

.postcard-preview-large {
    --postcard-front-width: min(760px, 100%);
    --postcard-front-ratio: 3 / 2;
    --postcard-back-width: min(760px, 100%);
    --postcard-back-ratio: 3 / 2;
    height: auto;
}

.postcard-preview-large.postcard-layout-portrait {
    --postcard-front-width: min(600px, 72vw);
    --postcard-front-ratio: 2 / 3;
}

.postcard-page-actions {
    display: flex;
    gap: 10px;
}

.postcard-vignette-actions {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 10px;
}

.moderation-toggle {
    border: 1px solid #d0d0d0;
    background: #fafafa;
    color: #444;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 6px 10px;
    cursor: pointer;
}

.moderation-toggle:hover {
    border-color: #9c9c9c;
    color: #111;
}

.moderation-toggle.is-active {
    border-color: #b56f74;
    background: #f9ecec;
    color: #8f2d34;
}

.favorite-toggle:hover {
    transform: scale(1.08);
}

.favorite-icon {
    width: 30px;
    height: 30px;
    display: block;
    background-color: #4a4a4a;
    -webkit-mask: url("/static/clean_heart.svg") center / contain no-repeat;
    mask: url("/static/clean_heart.svg") center / contain no-repeat;
    transition: background-color 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.favorite-toggle:hover .favorite-icon {
    animation: favorite-beat 0.65s ease-in-out infinite;
}

.favorite-toggle.is-active {
    background: transparent;
}

.favorite-toggle.is-active .favorite-icon {
    background-color: #d24a58;
}

@keyframes favorite-beat {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.14);
    }
    40% {
        transform: scale(1.02);
    }
    60% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

.image-fallback-note {
    margin: 8px auto 0;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.4px;
    color: #666;
    background: #f1f1f1;
    border: 1px solid #dedede;
    border-radius: 999px;
    padding: 4px 9px;
}

.image-fallback-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #b9b9b9;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 30px;
}

.image-detail-side .meta {
    margin-bottom: 0;
}

.meta .users {
    margin-top: 8px;
}

.meta .users a {
    margin-right: 8px;
    font-size: 12px;
    color: #444;
}

.meta .users a:hover {
    color: #000;
}

.meta-saves {
    font-weight: 600;
}

.meta-more-link {
    margin-top: 10px;
}

.meta-more-link a {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #555;
    border: 1px solid #d8d8d8;
    background: #fff;
    padding: 5px 8px;
    display: inline-block;
}

.meta-more-link a:hover {
    color: #111;
    border-color: #aaa;
    text-decoration: none;
}

.meta-preview-note {
    margin-top: 8px;
    font-size: 11px;
    color: #777;
}

.meta-cluster {
    margin: -2px 0 14px;
    color: #666;
    font-size: 12px;
}

.image-nav {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(243, 241, 237, 0.9);
    backdrop-filter: blur(3px);
    border: 1px solid #ddd8cf;
    padding: 7px 10px;
    margin: -6px 0 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.image-nav a {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.65px;
    color: #4a4a4a;
}

.toolbar {
    margin: -4px 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.toolbar .nsfw-toggle {
    margin-left: auto;
}

.image-context {
    margin-top: 4px;
}

.image-context-module {
    margin-bottom: 8px;
}

.image-meta-inline {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

.image-meta-saves {
    font-weight: 600;
    color: #444;
}

.image-meta-users a {
    color: #444;
}

.image-meta-users a:hover {
    color: #111;
}

.image-meta-link {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #555;
    border: 1px solid #d8d8d8;
    background: #fff;
    padding: 4px 7px;
}

.image-meta-link:hover {
    color: #111;
    border-color: #aaa;
    text-decoration: none;
}

.image-summary {
    margin: 12px auto 0;
    max-width: 700px;
    border: 0;
    border-top: 1px solid #d8d2c8;
    border-bottom: 1px solid #e3ddd3;
    background: transparent;
    padding: 12px 2px 10px;
    text-align: left;
}

.image-summary h3 {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.7px;
    color: #4b4b4b;
}

.image-summary-grid {
    margin: 0;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 6px 10px;
}

.image-summary-grid dt {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.55px;
}

.image-summary-grid dd {
    margin: 0;
    color: #333;
    font-size: 12px;
}

.image-summary-grid dd code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    font-size: 11px;
    line-height: 1.35;
}

.image-summary-note {
    margin: 8px 0 0;
    color: #777;
    font-size: 11px;
}

.image-insights {
    margin: 12px auto 0;
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.image-insights.is-single {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
    .image-insights {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.view-toggle,
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.view-toggle a,
.quick-filters a {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #666;
    border: 1px solid #d6d1c8;
    padding: 4px 8px;
    background: #f8f6f2;
}

.view-toggle a.is-active,
.quick-filters a.is-active {
    color: #111;
    border-color: #999;
}

/* ----------------------------------------
   Grid
----------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.grid-dense {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.grid-comfortable {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.grid-masonry {
    display: block;
    column-count: 5;
    column-gap: 12px;
}

.thumb {
    display: block;
    background: #fbfaf7;
    border: 1px solid #e7e1d7;
    overflow: hidden;
    transition: all 0.15s ease;
    position: relative;
}

.grid-masonry .thumb {
    margin: 0 0 12px;
    break-inside: avoid;
}

.thumb img {
    width: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumb img.is-ready {
    opacity: 1;
}

.thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f2f2f2 0%, #ececec 40%, #f2f2f2 80%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

.thumb.is-loaded::before {
    display: none;
}

.thumb:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #d9d1c4;
}

.thumb-moderation-toggle {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 4;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #cfcfcf;
    color: #555;
    font-size: 9px;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    user-select: none;
}

.thumb-moderation-toggle:hover,
.thumb-moderation-toggle:focus-visible {
    border-color: #a5a5a5;
    color: #222;
    outline: none;
}

.thumb-moderation-toggle.is-active {
    border-color: #b63f49;
    color: #9d1e29;
    background: rgba(255, 240, 241, 0.95);
}

.thumb-moderation-clear {
    position: absolute;
    left: 6px;
    top: 6px;
    z-index: 4;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #b9b9b9;
    color: #666;
    background: rgba(255, 255, 255, 0.94);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    display: none;
}

.thumb-moderation-clear.is-visible {
    display: block;
}

.thumb-moderation-clear:hover,
.thumb-moderation-clear:focus-visible {
    border-color: #9d2f38;
    color: #8a1a25;
    outline: none;
}

/* ----------------------------------------
   Missing States
----------------------------------------- */

.thumb-missing {
    height: 120px;
    background:
        url("/static/emoji-minecraft-missing-575-svgrepo-com.svg") center 40% / 22px 22px no-repeat,
        linear-gradient(135deg, #f0f0f0, #e2e2e2);
    opacity: 0.9;
}

.thumb-fallback {
    display: none;
    height: 120px;
    color: #777;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        -45deg,
        #f2f2f2,
        #f2f2f2 8px,
        #ebebeb 8px,
        #ebebeb 16px
    );
    flex-direction: column;
    gap: 8px;
}

.thumb-fallback::before {
    content: "";
    width: 22px;
    height: 22px;
    background: url("/static/emoji-minecraft-missing-575-svgrepo-com.svg") center / contain no-repeat;
    opacity: 0.75;
}

.thumb.is-broken .thumb-fallback {
    display: flex;
}

.missing {
    padding: 60px;
    background: #f0f0f0;
    color: #888;
    font-size: 14px;
}

.missing-image-game {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 14px;
    text-align: left;
}

.missing-image-game-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 14px;
    margin-bottom: 8px;
}

.missing-image-game-head strong {
    font-size: 14px;
    color: #403d39;
}

.missing-image-game-head span {
    font-size: 11px;
    letter-spacing: 0.35px;
    color: #706a62;
}

.missing-image-game-stats {
    display: flex;
    gap: 10px 16px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #625d56;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.missing-image-game-stats strong {
    color: #2d2a27;
}

.missing-image-game-board {
    position: relative;
    width: 100%;
    min-height: 260px;
    border: 1px dashed #c6bfb2;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.65) 0, rgba(255, 255, 255, 0) 46%),
        repeating-linear-gradient(
            -45deg,
            rgba(227, 221, 210, 0.38),
            rgba(227, 221, 210, 0.38) 10px,
            rgba(241, 237, 231, 0.72) 10px,
            rgba(241, 237, 231, 0.72) 20px
        );
    overflow: hidden;
}

.missing-image-game-canvas {
    display: block;
    width: 100%;
    height: 260px;
}

.missing-image-game-status {
    position: absolute;
    left: 10px;
    bottom: 8px;
    font-size: 10px;
    color: #625d56;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    background: rgba(245, 241, 234, 0.86);
    border: 1px solid #d1c9bc;
    padding: 3px 6px;
}

.missing-image-game-reset {
    margin-top: 10px;
}

/* ----------------------------------------
   Section Titles
----------------------------------------- */

h2, h3 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
    font-weight: 600;
    font-size: 20px;
    margin: 30px 0 12px;
    text-transform: none;
    letter-spacing: 0.1px;
    color: #232323;
}

.pager-meta {
    margin: -4px 0 20px;
    color: #5d5d5d;
    font-size: 12px;
}

.pager {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pager a,
.pager .disabled {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.pager .disabled {
    color: #999;
}

.favorites-meta {
    margin: -4px 0 18px;
    color: #666;
    font-size: 12px;
}

.page-intent {
    margin: -2px 0 16px;
    color: #5f5b54;
    font-size: 14px;
    line-height: 1.45;
    max-width: 72ch;
}

.discover-tabs {
    margin: -2px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discover-tabs a {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #666;
    border: 1px solid #d6d1c8;
    padding: 4px 8px;
    background: #f8f6f2;
}

.discover-tabs a.is-active {
    color: #111;
    border-color: #8e8677;
    background: #f1ece3;
}

.favorites-transfer {
    margin: -6px 0 16px;
    border: 1px solid #e2e2e2;
    background: #fafafa;
    padding: 10px;
}

.favorites-transfer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.favorites-transfer-label {
    display: block;
    margin: 10px 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #666;
}

.favorites-transfer textarea {
    width: 100%;
    min-height: 96px;
    border: 1px solid #d6d6d6;
    background: #fff;
    color: #333;
    font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    padding: 8px;
    resize: vertical;
}

.favorites-transfer-status {
    font-size: 11px;
    color: #666;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

/* ----------------------------------------
   Lists
----------------------------------------- */

.user-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e8e8e8;
}

.user-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.user-list li a {
    font-weight: 600;
    color: #111;
}

.user-list li span {
    color: #666;
    font-size: 12px;
}

.hall-chart {
    display: grid;
    gap: 8px;
}

.hall-chart-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 80px;
    align-items: center;
    gap: 10px;
}

.hall-chart-user {
    font-size: 12px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hall-chart-user:hover {
    color: #000;
}

.hall-chart-bar-wrap {
    height: 16px;
    background: #ececec;
    border: 1px solid #dddddd;
    overflow: hidden;
}

.hall-chart-bar {
    height: 100%;
    min-width: 2px;
    background: linear-gradient(90deg, #8c8c8c, #5f5f5f);
}

.hall-chart-value {
    text-align: right;
    font-size: 11px;
    color: #555;
    font-variant-numeric: tabular-nums;
}

.hall-details {
    margin-top: 14px;
}

.hall-details summary {
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #555;
    padding: 4px 0;
}

@media (max-width: 720px) {
    header {
        padding: 14px 16px;
    }

    .header-inner {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 10px;
    }

    .brand {
        justify-self: start;
    }

    .header-right {
        justify-self: start;
    }

    .explore-nav {
        gap: 10px;
    }

    .image-detail-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .grid-masonry {
        column-count: 2;
    }

    .postcard-composer {
        grid-template-columns: 1fr;
    }

    .postcard-modal {
        padding: 12px;
    }

    .postcard-modal-panel {
        width: 100%;
        max-height: 95vh;
        padding: 10px;
    }

    .postcard-back {
        background-position: center center;
    }

    .postcard-back-grid {
        padding: 22% 10% 15%;
        gap: 3%;
    }

    .postcard-message {
        font-size: 12px;
    }

    .postcard-address-panel {
        padding-top: 10%;
        gap: 14%;
    }

    .user-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .hall-chart-row {
        grid-template-columns: minmax(0, 1fr) 64px;
        gap: 8px;
    }

    .hall-chart-user {
        grid-column: 1 / -1;
    }
}

/* ----------------------------------------
   Theme V2 - Minimal Archive Shell
----------------------------------------- */

:root {
    --bg: #f7f5f1;
    --surface: #fcfbf9;
    --line: #ddd8cf;
    --text: #171614;
    --muted: #67635d;
    --accent: #9b3a3a;
}

body {
    background: var(--bg);
    color: var(--text);
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 11px;
}

.brand {
    font-family: "IBM Plex Sans", "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.header-left a,
.explore-nav a {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.6px;
}

.header-left a:hover,
.explore-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

main {
    max-width: 1180px;
    margin: 22px auto 42px;
    padding: 0 18px;
}

h2,
h3 {
    color: var(--text);
    letter-spacing: 0.35px;
}

h2 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    text-transform: none;
}

h3 {
    margin: 18px 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.page-intent {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 10px;
}

.image-detail-main {
    max-width: 1040px;
}

.main-image {
    box-shadow: none;
    border: 1px solid var(--line);
    background: #fff;
}

.image-actions-row {
    margin-top: 10px;
}

.postcard-toggle,
.moderation-toggle,
.postcard-action,
.postcard-modal-close {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
}

.postcard-toggle:hover,
.moderation-toggle:hover,
.postcard-action:hover,
.postcard-modal-close:hover {
    border-color: #bdb6aa;
    color: var(--text);
}

.favorite-icon {
    width: 34px;
    height: 34px;
    background-color: #56514c;
}

.favorite-toggle.is-active .favorite-icon {
    background-color: #df4254;
}

.image-fallback-note {
    background: #f2f0eb;
    border-color: var(--line);
    color: var(--muted);
}

.image-summary {
    margin: 0;
    max-width: none;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 12px;
}

.image-summary h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.image-summary-grid dt {
    color: #5e5953;
}

.image-summary-grid dd,
.image-summary-note {
    color: #36332f;
}

.image-summary-variant-note {
    margin-left: 8px;
    border: 1px solid var(--line);
    background: #f5f1e9;
    color: #5a544c;
    font-size: 10px;
    letter-spacing: 0.15px;
    padding: 1px 5px;
}

.image-analysis {
    border: 1px solid var(--line);
    background: var(--surface);
    margin-top: 0;
    padding: 12px;
}

.image-analysis h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.image-analysis-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.image-analysis-actions .postcard-action {
    font-size: 10px;
    padding: 3px 7px;
}

.image-analysis-run-status {
    color: var(--muted);
    font-size: 10px;
}

.image-analysis-caption {
    margin: 0;
    color: #36332f;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.image-analysis-tags {
    margin-top: 8px;
}

.image-analysis-label {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #5e5953;
}

.image-analysis-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.image-analysis-tag {
    border: 1px solid var(--line);
    background: #f5f1e9;
    color: #4d4842;
    font-size: 10px;
    letter-spacing: 0.2px;
    padding: 2px 6px;
}

.image-analysis-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.image-detail-controls {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.image-nav a,
.view-toggle a,
.quick-filters a,
.discover-tabs a,
.pager a,
.pager .disabled {
    border: 1px solid var(--line);
    background: var(--surface);
    color: #5d5853;
}

.image-nav a:hover,
.view-toggle a:hover,
.quick-filters a:hover,
.discover-tabs a:hover,
.pager a:hover {
    color: var(--text);
    border-color: #bdb6aa;
    text-decoration: none;
}

.view-toggle a.is-active,
.quick-filters a.is-active,
.discover-tabs a.is-active {
    color: var(--text);
    border-color: #b2ab9e;
    background: #f1ede5;
}

.discover-hero {
    margin: 12px 0 14px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at right top, #f3ede4 0%, #fcfbf9 54%);
    padding: 12px;
}

.discover-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.discover-kpi {
    border: 1px solid #d8d2c5;
    background: rgba(255, 255, 255, 0.78);
    padding: 8px 9px;
}

.discover-kpi-label {
    display: block;
    color: #686259;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.discover-kpi-value {
    display: block;
    margin-top: 3px;
    color: #1a1815;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
}

.discover-saver-strip {
    margin-top: 9px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.discover-saver-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 4px 7px;
    color: #4b463f;
    font-size: 10px;
    letter-spacing: 0.25px;
}

.discover-saver-name {
    font-weight: 700;
}

.discover-saver-count {
    margin-left: 6px;
    color: #726c63;
}

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

.discover-card {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 10px;
}

.discover-card-head p {
    margin: 0 0 9px;
    color: #666058;
    font-size: 11px;
    line-height: 1.45;
}

.discover-card h3 {
    margin: 0 0 5px;
}

.discover-preview-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.discover-preview-thumb {
    min-height: 52px;
}

.discover-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-meta-inline {
    color: var(--muted);
    margin-top: 10px;
}

.image-meta-inline a {
    color: var(--text);
}

.grid {
    gap: 10px;
}

.thumb {
    border: 1px solid transparent;
    background: #f1eee8;
}

.thumb:hover {
    transform: translateY(-1px);
    border-color: #c4bdae;
    box-shadow: none;
}

.thumb img {
    display: block;
}

.thumb-fallback {
    background: rgba(249, 247, 243, 0.94);
    color: #6a655e;
}

.missing {
    border: 1px dashed #c8c2b6;
    background: #f2eee7;
    color: #6c675f;
}

.hall-chart-bar-wrap {
    background: #ece7de;
    border: 1px solid #d5cec0;
}

.hall-chart-bar {
    background: linear-gradient(90deg, #867f75, #5f594f);
}

@media (max-width: 720px) {
    header {
        padding: 10px 14px;
    }

    .brand {
        font-size: 16px;
    }

    main {
        margin-top: 16px;
        padding: 0 12px;
    }
}

/* ----------------------------------------
   Theme V2.1 - Hierarchy + Density + Rhythm
----------------------------------------- */

header {
    padding: 10px 18px 9px;
}

.header-inner {
    gap: 12px;
}

.brand {
    font-size: 16px;
    letter-spacing: 0.15px;
}

.explore-nav {
    gap: 10px;
}

.header-left a,
.explore-nav a {
    font-size: 9px;
    letter-spacing: 0.65px;
}

.secret-mode-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.65px;
    color: var(--muted);
    text-transform: uppercase;
    cursor: pointer;
}

.secret-mode-toggle:hover {
    color: var(--text);
}

.secret-mode-toggle.is-active {
    color: var(--accent);
}

main {
    max-width: 1220px;
    margin: 18px auto 38px;
    padding: 0 16px;
}

h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

h3 {
    margin: 22px 0 9px;
    font-size: 10px;
    letter-spacing: 0.75px;
}

.page-intent {
    max-width: 84ch;
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.45;
}

.toolbar {
    margin: 10px 0 14px;
    gap: 8px;
}

.view-toggle,
.quick-filters {
    gap: 5px;
}

.image-nav a,
.view-toggle a,
.quick-filters a,
.discover-tabs a,
.pager a,
.pager .disabled {
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 4px 8px;
}

.image-detail-main {
    max-width: 1080px;
}

.image-insights {
    margin-top: 10px;
    gap: 10px;
}

.image-summary {
    margin-top: 0;
    padding: 10px 11px;
}

.image-analysis {
    margin-top: 0;
    padding: 10px 11px;
}

.image-analysis-caption {
    font-size: 12px;
}

.image-summary-grid dt {
    font-size: 10px;
}

.image-summary-grid dd {
    font-size: 13px;
}

.image-meta-inline {
    font-size: 11px;
    line-height: 1.45;
}

.grid {
    gap: 8px;
}

.grid-dense {
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
}

.grid-comfortable {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
}

.grid-masonry {
    column-gap: 8px;
}

.thumb {
    border-radius: 0;
}

.thumb img {
    border-radius: 0;
}

.hall-chart {
    gap: 6px;
}

.hall-chart-row {
    grid-template-columns: 170px minmax(0, 1fr) 70px;
    gap: 8px;
}

.hall-chart-user {
    font-size: 11px;
}

.hall-chart-value {
    font-size: 10px;
}

@media (max-width: 720px) {
    header {
        padding: 9px 12px;
    }

    .brand {
        font-size: 15px;
    }

    .header-left a,
    .explore-nav a {
        font-size: 9px;
    }

    h2 {
        font-size: 18px;
    }

    main {
        margin-top: 14px;
        padding: 0 10px;
    }

    .grid {
        gap: 6px;
    }

    .discover-kpis {
        grid-template-columns: 1fr;
    }

    .discover-cards {
        grid-template-columns: 1fr;
    }

    .discover-preview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ----------------------------------------
   Postcard View — vignette focus
----------------------------------------- */

.postcard-vignette-frame {
    position: relative;
    display: grid;
    place-items: center;
    isolation: isolate;
    box-shadow:
        0 0 80px 60px rgba(15, 12, 8, 0.35),
        0 0 0 100vmax rgba(15, 12, 8, 0.5);
}
