/* ---- Tokens ---------------------------------------------------------- */
/* Neutral black, white and grey, with blue only for small highlights (the upload "+", focus rings).
   Always light, like the owner's reference screenshots: there is no dark version, even when the
   visitor's computer is set to dark mode. */
:root {
    --bg: #ffffff;
    --bg-soft: #f5f5f5;
    --surface: #ffffff;
    --text: #111111;
    --muted: #767676;
    --border: #d1d1d1;
    --accent: #111111;
    --accent-hover: #3a3a3a;
    --accent-text: #ffffff;
    --accent-soft: #f0f0f0;
    --highlight: #007fff;
    --success: #1a7f37;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --warn-soft: #fff6e0;
    --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 4px 16px rgb(0 0 0 / 6%);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 18%);
    --radius: 8px;
    --row: 230px; /* target gallery row height */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

/* ---- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
img { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-size: .9em; background: var(--bg-soft); padding: .1em .35em; border-radius: 4px; }
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }
.section { padding-top: 32px; padding-bottom: 32px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }

/* ---- Buttons & forms ------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45em;
    padding: .62em 1.15em; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-danger { color: var(--danger); border-color: currentColor; background: transparent; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: currentColor; }
.btn-block { width: 100%; padding: .85em 1em; font-size: 1.05rem; }
.btn-small { padding: .35em .75em; font-size: .88rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button-row.center { justify-content: center; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
    width: 100%; padding: .6em .75em; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--highlight); outline-offset: 0; border-color: var(--highlight); }
.form { display: grid; gap: 16px; }
.form label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-weight: 600; font-size: .95rem; }
/* A label's text and its <small> note share the first line; the box below takes the full width. */
.form label > :is(input:not([type=checkbox], [type=radio]), select, textarea), .draft-fields label > :is(input:not([type=checkbox]), select) { flex: 1 0 100%; }
.form label small, .form legend small { font-weight: 400; color: var(--muted); }
.form .checkbox, .form .radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input, .radio input { margin-top: .3em; width: 1.05em; height: 1.05em; accent-color: var(--accent); flex: none; }
.radio small { display: block; color: var(--muted); }
.field-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; padding: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 1.05rem; margin-bottom: 12px; }
.notice { padding: 14px 18px; border-radius: var(--radius); margin: 0 0 18px; border: 1px solid transparent; }
.notice ul { margin: 0; padding-left: 1.1em; }
.notice-error { background: var(--danger-soft); border-color: var(--danger); }
.notice-success { background: var(--accent-soft); border-color: var(--success); }
.badge { display: inline-block; padding: .1em .55em; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--border); text-transform: capitalize; }
.badge-published { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge-hidden { background: var(--warn-soft); border-color: transparent; }

/* ---- Search box ------------------------------------------------------ */
.search-form { display: flex; position: relative; width: 100%; }
.search-form input { padding-right: 3em; border-radius: 99px; background: var(--bg-soft); border-color: transparent; }
.search-form input:focus { background: var(--bg); }
.search-form button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: .5em .8em; color: var(--muted); cursor: pointer; }
.search-form button:hover { color: var(--accent); }

/* ---- Header & footer ------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo-mark { display: block; width: 40px; height: 40px; flex: none; }
.logo:hover { color: var(--text); }
.header-search { order: 3; flex: 1 1 100%; }
.main-nav { display: flex; align-items: center; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; font-weight: 600; font-size: .95rem; }
.main-nav a, .main-nav .link-button { color: var(--muted); text-decoration: none; }
.main-nav a:hover, .main-nav .link-button:hover { color: var(--text); }
@media (min-width: 860px) {
    .header-search { order: 0; flex: 1 1 0; min-width: 220px; }
}
.main-nav .nav-submit { gap: .25em; padding: .42em .9em; font-size: .92rem; color: var(--text); }
.main-nav .nav-submit:hover { color: var(--text); border-color: var(--text); }
.count-badge { display: inline-block; min-width: 1.6em; padding: 0 .4em; border-radius: 99px; background: var(--highlight); color: #fff; font-size: .75rem; line-height: 1.6em; text-align: center; }
@media (max-width: 440px) { .hide-narrow { display: none; } }
.flash { padding: 10px 0; font-weight: 600; border-bottom: 1px solid var(--border); }
.flash-success { background: var(--accent-soft); }
.flash-error { background: var(--danger-soft); }
.flash-info { background: var(--bg-soft); }

.site-footer { margin-top: 48px; border-top: 1px solid var(--border); background: var(--bg-soft); font-size: .93rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 32px; padding-bottom: 16px; }
.footer-brand { max-width: 520px; }
.footer-brand p { color: var(--muted); margin-top: 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: flex-start; }
.footer-nav a { color: var(--text); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { color: var(--muted); padding-bottom: 28px; font-size: .85rem; }

/* ---- Home ------------------------------------------------------------ */
.hero {
    position: relative; isolation: isolate; color: #fff; background: #1a1a1a;
    min-height: min(68vh, 560px); display: flex; align-items: center; padding: 64px 0 72px;
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgb(0 0 0 / 22%), rgb(0 0 0 / 45%)), var(--hero, none) center / cover no-repeat;
}
.hero-inner { max-width: 860px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); margin-bottom: .35em; text-shadow: 0 2px 18px rgb(0 0 0 / 35%); }
.hero-lead { font-size: clamp(1rem, 2vw, 1.2rem); opacity: .95; max-width: 640px; margin: 0 auto 1.6em; text-shadow: 0 1px 10px rgb(0 0 0 / 40%); }
.hero-search input { background: #fff; color: #111111; font-size: 1.1rem; padding: .9em 3.4em .9em 1.3em; box-shadow: 0 8px 30px rgb(0 0 0 / 25%); }
.hero-search input:focus { background: #fff; }
.hero-search button { color: #767676; }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; font-size: .92rem; }
.hero-tags span { opacity: .85; }
.hero-tags a { color: #fff; text-decoration: none; padding: .2em .8em; border-radius: 99px; background: rgb(255 255 255 / 16%); backdrop-filter: blur(4px); }
.hero-tags a:hover { background: rgb(255 255 255 / 28%); }
.hero-credit { position: absolute; right: 16px; bottom: 12px; font-size: .8rem; color: rgb(255 255 255 / 82%); text-decoration: none; max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-credit:hover { color: #fff; }

.chip-row { display: flex; gap: 8px; padding-top: 20px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-block; white-space: nowrap; padding: .4em .95em; border-radius: 99px; background: var(--bg-soft); color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 600; border: 1px solid var(--border); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.section-head h1, .section-head h2 { margin: 0; }
.promise { display: grid; gap: 16px; }
@media (min-width: 760px) { .promise { grid-template-columns: repeat(3, 1fr); } }
.promise-item { padding: 22px; border-radius: var(--radius); background: var(--bg-soft); }
.promise-item p { color: var(--muted); margin: 0; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state h1, .empty-state h3 { color: var(--text); }
.empty-state .search-form { max-width: 520px; margin: 0 auto 18px; }

/* ---- Justified gallery ---------------------------------------------- */
/* Each tile grows in proportion to its aspect ratio (--r), so every row
   ends up the same height and fills the full width, Flickr style. */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery::after { content: ""; flex-grow: 1000000; }
.tile {
    position: relative; display: block; overflow: hidden; border-radius: 8px; min-width: 0;
    flex: var(--r) 1 calc(var(--r) * var(--row)); aspect-ratio: var(--r);
    max-height: calc(var(--row) * 1.8);
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tile-icon img { object-fit: contain; padding: 18%; }
.tile-meta {
    position: absolute; inset: auto 0 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
    padding: 34px 12px 10px; color: #fff; font-size: .88rem; font-weight: 600;
    background: linear-gradient(transparent, rgb(0 0 0 / 62%)); opacity: 0; transition: opacity .2s;
}
.tile-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-stat { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.tile:hover .tile-meta, .tile:focus-visible .tile-meta { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
@media (hover: none) { .tile-meta { display: none; } }
@media (max-width: 600px) { .gallery { gap: 6px; --row: 130px; } .tile { border-radius: 6px; } }

/* ---- Results & filters ---------------------------------------------- */
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.results-head h1 { margin-bottom: .2em; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 6px 0 22px; }
.filters label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); min-width: 150px; }
.filters select, .filters input { font-size: .95rem; padding: .45em .65em; color: var(--text); }
.filters .grow { flex: 1 1 260px; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 32px 0 0; }
.page-link { display: inline-block; min-width: 2.4em; text-align: center; padding: .45em .8em; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 600; }
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.page-gap { padding: .45em .2em; color: var(--muted); }

.category-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.category-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 3 / 2; padding: 14px 16px; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; background: #2a2a2a; isolation: isolate; }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .35s; }
.category-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 35%, rgb(0 0 0 / 65%)); }
.category-card:hover { color: #fff; }
.category-card:hover img { transform: scale(1.04); }
.category-name { font-weight: 800; font-size: 1.15rem; }
.category-count { font-size: .85rem; opacity: .9; }

/* ---- Photo page ------------------------------------------------------ */
.photo-layout { display: grid; gap: 28px; padding-top: 24px; }
@media (min-width: 980px) { .photo-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.photo-frame { margin: 0; border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; }
.photo-frame img { display: block; width: auto; max-width: 100%; height: auto; max-height: 78vh; }
.photo-title { margin-top: 18px; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.photo-desc { color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 980px) { .photo-side { position: sticky; top: 84px; } }
.license-line { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.license-line svg { color: var(--accent); width: 1.5em; height: 1.5em; stroke-width: 2.5; }
.license-line strong, .license-line span { display: block; }
.license-line span { color: var(--muted); font-size: .92rem; }
.size-options { gap: 0; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.size-options legend { position: absolute; left: -9999px; }
.size-option { display: flex; align-items: center; gap: 10px; padding: .6em .85em; cursor: pointer; border-top: 1px solid var(--border); }
.size-option:first-of-type { border-top: 0; }
.size-option:has(input:checked) { background: var(--accent-soft); }
.size-option input { accent-color: var(--accent); }
.size-name { font-weight: 600; }
.size-dims { margin-left: auto; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .94rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts-grid dd { text-align: right; }
.credit-hint { margin: 14px 0 6px; font-size: .88rem; color: var(--muted); }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-size: .85rem; padding: .4em .6em; }
.report-link { margin: 14px 0 0; font-size: .85rem; }
.report-link a { color: var(--muted); }

/* ---- Prose pages ----------------------------------------------------- */
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.6em; }
.prose .lead { font-size: 1.15rem; }
.license-grid { display: grid; gap: 16px; margin: 24px 0; }
@media (min-width: 720px) { .license-grid { grid-template-columns: 1fr 1fr; } }
.license-grid .card + .card { margin-top: 0; }
.license-grid h2 { margin-top: 0; font-size: 1.1rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 28px; }
.checklist li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.checklist.yes li::before { content: "✓"; color: var(--success); }
.checklist.care li::before { content: "!"; color: #b7791f; left: 6px; }

/* ---- Accounts -------------------------------------------------------- */
.auth { padding: 40px 16px 64px; background: linear-gradient(180deg, var(--accent-soft), transparent 380px); }
.auth-card { max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 22px 28px; box-shadow: var(--shadow); }
@media (min-width: 600px) { .auth-card { padding: 38px 36px 32px; } }
.auth-mark { display: block; width: 52px; height: 52px; margin: 0 auto 16px; }
.auth-icon { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.auth-icon svg { width: 28px; height: 28px; }
.auth-icon-warn { background: var(--warn-soft); color: #b7791f; }
.auth-card h1 { text-align: center; font-size: 1.6rem; margin-bottom: 8px; }
.auth-lead { text-align: center; color: var(--muted); margin-bottom: 24px; }
.auth-lead strong { color: var(--text); overflow-wrap: anywhere; }
.auth-foot { text-align: center; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .95rem; }
.field { display: grid; gap: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-link { font-size: .88rem; font-weight: 600; }
.field-hint, .form-note { font-size: .86rem; color: var(--muted); font-weight: 400; }
.form-note { margin: 0; }
.password-field { position: relative; }
.password-field input { padding-right: 4.8em; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: .3em .7em; border: 0; border-radius: 6px; background: var(--bg-soft); color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.password-toggle:hover { color: var(--text); }
.notice-pending { background: var(--warn-soft); border-color: #d69e2e; font-size: .94rem; }
.account-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 20px; margin-bottom: 18px; }
.account-head h1 { margin-bottom: 4px; }
.account-head p { margin: 0; }
.account-email { color: var(--text); overflow-wrap: anywhere; }
.account-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1fr 1fr; } }
.account-grid .card + .card { margin-top: 0; }
.account-grid .card-title { font-size: 1.2rem; }
.account-grid .card > p.muted { font-size: .94rem; }
.account-delete { margin-top: 24px; }
.account-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.account-tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.account-tabs a:hover { color: var(--text); }
.account-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.overview-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .overview-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.overview-grid .card + .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.card-head .card-title { margin: 0; }
.badge-soon { text-transform: none; background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.stat-row.stat-placeholders { margin: 18px 0 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-placeholders .stat-value { color: var(--muted); }
.skeleton { display: block; width: 65%; height: .7em; margin-top: 8px; border-radius: 4px; background: var(--border); }
.account-facts { margin-bottom: 18px; }

/* ---- Admin ----------------------------------------------------------- */
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 22px; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--bg-soft); color: var(--text); text-decoration: none; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-alert { background: var(--warn-soft); }
.admin-search { max-width: 520px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg-soft); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-thumb { display: block; width: 72px; height: 50px; object-fit: cover; border-radius: 6px; }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.checks .ok { color: var(--success); }
.checks .bad { color: var(--danger); font-weight: 700; }
.dropzone { position: relative; display: grid !important; place-items: center; min-height: 140px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg-soft); text-align: center; cursor: pointer; padding: 16px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-text { color: var(--muted); font-weight: 600; }
.edit-layout { display: grid; gap: 24px; }
@media (min-width: 900px) { .edit-layout { grid-template-columns: 380px minmax(0, 1fr); align-items: start; } }
.edit-preview { display: block; width: 100%; border-radius: var(--radius); margin-bottom: 16px; }
.edit-layout .facts { margin-bottom: 16px; }
.import-search { padding: 16px; background: var(--bg-soft); border-radius: var(--radius); }
.import-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.import-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-bottom: 20px; }
.import-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.import-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.import-card.is-disabled { opacity: .55; }
.import-pick { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-soft); cursor: pointer; }
.import-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.import-pick input { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; accent-color: var(--accent); z-index: 1; }
.import-flag { position: absolute; right: 8px; bottom: 8px; background: rgb(0 0 0 / 70%); color: #fff; font-size: .78rem; padding: .15em .55em; border-radius: 6px; }
.import-info { display: grid; gap: 3px; padding: 10px 12px 12px; font-size: .86rem; }
.import-info strong { font-size: .92rem; line-height: 1.3; }
.import-info > span { color: var(--muted); }
.import-options { display: grid; gap: 14px; }
.import-options label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.import-options .checkbox { display: flex; font-weight: 400; }
.report { margin-bottom: 14px; }
.report-open { border-left: 4px solid #d69e2e; }
.report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.report-ref { font-size: .9rem; overflow-wrap: anywhere; }
.report-reason { background: var(--bg-soft); padding: 12px; border-radius: 8px; }

/* ---- Log in and Join ------------------------------------------------- */
.auth-sub { text-align: center; margin-bottom: 28px; }
.auth-sub a, .auth-alt a, .invite-foot a, .form-note a, .label-link { color: var(--muted); }
.auth-simple { width: min(472px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 72px; }
.auth-simple h1, .join-form h1 { text-align: center; font-size: clamp(2rem, 3.6vw, 2.6rem); font-weight: 700; margin-bottom: 8px; }
.auth-simple .form label, .join-form .form label { font-weight: 400; }
.auth-simple .btn-block, .join-form .btn-block { padding: .8em 1em; font-size: 1rem; }
.auth-alt { position: relative; margin-top: 48px; padding: 38px 24px; border: 1px solid var(--border); text-align: center; overflow: hidden; }
@media (min-width: 640px) { .auth-alt { margin-left: -64px; margin-right: -64px; } }
.doodle { position: absolute; fill: none; stroke: var(--border); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.doodle-loop { left: 24px; bottom: -16px; width: 80px; height: 72px; }
.doodle-arrow { right: 30px; top: -6px; width: 60px; height: 54px; }

.join { display: grid; min-height: 100vh; }
@media (min-width: 900px) { .join { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.join-art {
    position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
    min-height: 320px; padding: 32px 24px 24px; color: #fff; background: #1a1a1a var(--photo, none) center / cover no-repeat;
}
.join-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 0 0 / 35%), rgb(0 0 0 / 5%) 40%, rgb(0 0 0 / 55%)); }
@media (min-width: 900px) { .join-art { position: sticky; top: 0; height: 100vh; padding: 48px 64px 36px; } }
.join-logo { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.join-logo:hover { color: #fff; }
.join-pitch h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.06; margin-bottom: 14px; text-shadow: 0 2px 20px rgb(0 0 0 / 35%); }
.join-pitch p { font-size: clamp(1rem, 1.6vw, 1.3rem); max-width: 520px; margin: 0; text-shadow: 0 1px 10px rgb(0 0 0 / 45%); }
.join-credit { margin: 0; font-size: .85rem; opacity: .9; }
.join-credit a { color: #fff; }
.join-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px 56px; }
.join-form { width: min(540px, 100%); }

/* ---- "Submit an image" pop-ups and pages ------------------------------ */
dialog.modal { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal-wide { width: min(1040px, calc(100% - 32px)); }
dialog.modal::backdrop { background: rgb(0 0 0 / 55%); }
body:has(dialog[open]) { overflow: hidden; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 88%); color: #111; cursor: pointer; }
.modal-close:hover { background: #fff; }
.submit-stage { display: flex; justify-content: center; align-items: flex-start; min-height: calc(100vh - 150px); padding: 40px 16px 56px; background: var(--bg-soft); }
.modal-card { width: min(520px, 100%); background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-card-wide { width: min(1040px, 100%); }
.submit-profile { padding: 32px; }
.submit-profile h1 { font-size: 1.7rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.plus-badge { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--highlight); color: #fff; font-size: 30px; font-weight: 300; line-height: 1; box-shadow: 0 4px 14px rgb(0 127 255 / 35%); }

.invite-art { position: relative; height: 280px; overflow: hidden; background: var(--bg-soft); }
.invite-drop { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 48%; height: 50%; transform: translate(-50%, -46%); border: 2px dashed #c4c4c4; border-radius: 6px; }
.invite-photo { position: absolute; object-fit: cover; border: 7px solid #fff; border-bottom-width: 22px; background: #ddd; box-shadow: 0 10px 26px rgb(0 0 0 / 20%); }
.invite-photo-a { left: 7%; bottom: -4%; width: 30%; height: 66%; transform: rotate(-5deg); }
.invite-photo-b { right: 5%; top: 7%; width: 36%; height: 44%; transform: rotate(4deg); }
.invite-body { padding: 28px 32px 30px; }
.invite-title { font-size: 1.8rem; margin-bottom: 4px; }
.invite-lead { font-size: 1.05rem; margin-bottom: 18px; }
.tick-list { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0 0 26px; font-size: .95rem; }
.tick-list li { position: relative; padding-left: 24px; }
.tick-list li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }
.invite-foot { text-align: center; margin: 16px 0 0; }

.rules { padding: 48px 48px 32px; }
.rules-top { display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .rules-top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.rules-title { font-size: clamp(2rem, 4.2vw, 2.9rem); margin-bottom: 16px; }
.rules-intro p { font-size: 1.02rem; }
.rules-note { font-size: .86rem; color: var(--muted); }
.rules-note strong { color: var(--text); }
.rules-note a { color: var(--muted); }
.rules-art { position: relative; height: 280px; }
.rules-photo { position: absolute; width: 70%; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: var(--shadow-lg); }
.rules-photo-a { left: 2%; bottom: 0; z-index: 1; transform: rotate(-5deg); }
.rules-photo-b { right: 0; top: 0; transform: rotate(4deg); filter: grayscale(1); opacity: .85; }
.rule-list { list-style: none; display: grid; gap: 20px; padding: 0; margin: 40px 0 30px; font-size: .9rem; }
@media (min-width: 760px) { .rule-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rule-list li { display: flex; gap: 14px; align-items: flex-start; }
.rule-list svg { width: 32px; height: 32px; color: var(--muted); stroke-width: 1.4; }
.rules-agree { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px 18px; }
.rules-agree .checkbox { display: flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
@media (max-width: 600px) { .rules { padding: 32px 20px 24px; } .rules-art { height: 200px; } }

.submit-panel { width: min(1180px, 100%); background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); }
.submit-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; }
.submit-bar h1 { margin: 0; font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.submit-bar a { color: var(--muted); font-size: .92rem; }
.upload-form, .draft-form { margin: 0 16px; }
.upload-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    min-height: 460px; padding: 36px 16px; border: 2px dashed var(--border); border-radius: 6px; text-align: center; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.upload-drop:hover, .upload-drop.is-over { border-color: var(--highlight); background: color-mix(in srgb, var(--highlight) 4%, transparent); }
.upload-drop.is-compact { min-height: 190px; padding: 24px 16px; }
.upload-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { position: relative; display: grid; place-items: center; width: 96px; height: 74px; margin-bottom: 10px; border-radius: 4px; background: var(--bg-soft); color: #b5b5b5; box-shadow: -6px 6px 0 color-mix(in srgb, var(--border) 60%, transparent); }
.upload-icon svg { width: 66px; height: 50px; stroke-width: 1.2; }
.upload-icon .plus-badge { position: absolute; top: -18px; right: -20px; width: 40px; height: 40px; font-size: 26px; }
.upload-drop.is-compact .upload-icon { transform: scale(.75); margin: -8px 0 0; }
.upload-title { font-size: clamp(1.25rem, 2.6vw, 1.8rem); font-weight: 700; letter-spacing: -.01em; }
.file-chip { display: inline-block; vertical-align: middle; padding: .05em .45em; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: .85rem; font-weight: 700; letter-spacing: .02em; }
.upload-hint { font-size: 1.02rem; }
.upload-browse { color: var(--highlight); }
.upload-limit { color: var(--muted); font-size: .9rem; }
.upload-fallback { margin: 12px 0 0; text-align: center; }
.upload-rules { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; padding: 14px 0 4px; margin: 0; color: var(--muted); font-size: .84rem; }
.upload-rules li::before { content: "•"; margin-right: 6px; }
.upload-rules strong { color: var(--text); font-weight: 600; }
.draft-list { display: grid; gap: 12px; padding-top: 12px; }
.draft-list:empty { display: none; }
.draft-card { display: grid; gap: 14px; grid-template-columns: 160px minmax(0, 1fr); align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
@media (max-width: 600px) { .draft-card { grid-template-columns: 1fr; } }
.draft-thumb { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: var(--bg-soft); }
.draft-fields { display: grid; gap: 10px; min-width: 0; }
.draft-fields label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-size: .88rem; font-weight: 600; }
.draft-fields label small { font-weight: 400; color: var(--muted); }
.draft-fields .field-row { gap: 10px; }
.draft-fields input[type=text], .draft-fields select { padding: .45em .6em; font-size: .95rem; }
.draft-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.draft-foot .checkbox { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; font-size: .9rem; font-weight: 600; cursor: pointer; }
.draft-size { font-size: .85rem; }
.draft-remove { margin-left: auto; color: var(--danger); font-size: .88rem; text-decoration: underline; }
.draft-error { margin: 0; color: var(--danger); font-size: .9rem; font-weight: 600; }
.draft-name { font-weight: 600; overflow-wrap: anywhere; }
.upload-progress { height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.upload-progress span { display: block; width: 0; height: 100%; background: var(--highlight); transition: width .2s; }
.submit-error { margin: 12px 16px 0; }
.submit-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; border-top: 1px solid var(--border); }
.submit-foot > a { color: var(--muted); font-size: .88rem; }

.done-card { position: relative; width: min(1180px, 100%); overflow: hidden; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); }
.done-collage { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-top: -24px; padding: 40px 28px 0; -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 62%, transparent); mask-image: linear-gradient(transparent, #000 35%, #000 62%, transparent); }
.done-collage img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.done-collage img:nth-child(odd) { transform: translateY(-36px); }
.done-body { max-width: 680px; margin: 0 auto; padding: 56px 20px 32px; text-align: center; }
.done-avatar { display: grid; place-items: center; width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); font-size: 2.4rem; font-weight: 700; }
.done-body h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.12; }
.done-lead { font-size: 1.05rem; margin-bottom: 24px; }
.done-share-label { margin: 34px 0 10px; color: var(--muted); font-size: .9rem; }
.share-row { display: flex; justify-content: center; gap: 22px; }
.share-row a { color: var(--muted); }
.share-row a:hover { color: var(--text); }
.share-row svg { width: 26px; height: 26px; }
.share-row .fill { fill: currentColor; stroke: none; }
@media (max-width: 700px) { .done-collage { grid-template-columns: repeat(3, minmax(0, 1fr)); } .done-collage img:nth-child(n+4) { display: none; } }

/* ---- Account details and admin review ---------------------------------- */
.account-profile { margin-bottom: 20px; }
.account-profile .card-title { font-size: 1.2rem; }
.profile-row { display: grid; gap: 16px; }
@media (min-width: 760px) { .profile-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.badge-pending { background: color-mix(in srgb, var(--highlight) 14%, transparent); border-color: transparent; color: var(--highlight); text-transform: none; }
.review-card { display: grid; gap: 18px; margin-bottom: 16px; }
@media (min-width: 860px) { .review-card { grid-template-columns: 360px minmax(0, 1fr); align-items: start; } }
.review-preview img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 12px; font-size: .92rem; }
.review-reject { margin-top: 14px; }
.review-reject summary { cursor: pointer; color: var(--danger); font-size: .92rem; font-weight: 600; }
.review-reject .form { margin-top: 12px; }
