/* ============================================================
   ShutterBox — editorial gallery design system
   Light "gallery wall" chrome; photos provide the colour.
   ============================================================ */

:root {
    color-scheme: light;

    /* Palette — warm bone paper + ink, single clay accent */
    --paper: #f5f1ea;
    --paper-2: #efe9df;
    --card: #fbf9f5;
    --ink: #1d1a16;
    --ink-strong: #000;
    --ink-soft: #5b554c;
    --ink-faint: #8c857a;
    --line: rgba(29, 26, 22, 0.12);
    --line-soft: rgba(29, 26, 22, 0.07);
    --clay: #b14d2a;
    --clay-deep: #8f3c1f;
    --clay-tint: rgba(177, 77, 42, 0.10);

    /* Neutral interaction washes (theme-aware hover/active fills) */
    --wash: rgba(29, 26, 22, 0.05);
    --wash-strong: rgba(29, 26, 22, 0.07);

    /* Semantic feedback (flash messages, form errors) */
    --ok-fg: #2f6b3b;
    --ok-bg: rgba(79, 157, 93, 0.10);
    --ok-border: rgba(79, 157, 93, 0.30);
    --danger-fg: #9c352c;
    --danger-bg: rgba(200, 69, 59, 0.10);
    --danger-border: rgba(200, 69, 59, 0.30);
    --info-border: rgba(177, 77, 42, 0.25);

    /* Client selection markers (fixed semantics) */
    --m-red: #c8453b;
    --m-orange: #d97c2b;
    --m-yellow: #d9b525;
    --m-green: #4f9d5d;
    --m-blue: #3b78b8;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(29, 26, 22, .05), 0 12px 28px -16px rgba(29, 26, 22, .30);
    --shadow-lg: 0 24px 60px -28px rgba(29, 26, 22, .45);

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --sidebar-w: 248px;
    --sidebar-rail-w: 68px;
}

/* Dark variant — used by the public gallery / lightbox where photos shine, and
   by the main app when the OS prefers dark or the user toggles it (see the
   data-theme resolution script in base.html.twig). Single source for the dark
   palette; the tokens below mirror the light ones in :root. */
[data-theme="dark"] {
    color-scheme: dark;

    --paper: #16140f;
    --paper-2: #100e0a;
    --card: #1f1c16;
    --ink: #f3efe7;
    --ink-strong: #fff;
    --ink-soft: #b7b0a4;
    --ink-faint: #837c70;
    --line: rgba(243, 239, 231, 0.14);
    --line-soft: rgba(243, 239, 231, 0.08);
    --clay: #e07a4f;
    --clay-deep: #c96338;
    --clay-tint: rgba(224, 122, 79, 0.14);

    --wash: rgba(243, 239, 231, 0.06);
    --wash-strong: rgba(243, 239, 231, 0.10);

    /* Lift the feedback colours so text stays legible on dark surfaces while the
       hue (green = ok, red = danger, clay = info) keeps its meaning. */
    --ok-fg: #86c896;
    --ok-bg: rgba(79, 157, 93, 0.18);
    --ok-border: rgba(134, 200, 150, 0.34);
    --danger-fg: #f0928a;
    --danger-bg: rgba(200, 69, 59, 0.22);
    --danger-border: rgba(240, 146, 138, 0.34);
    --info-border: rgba(224, 122, 79, 0.34);

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -20px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .8);
}

/* The main app's dark surfaces sit a touch lighter (warm charcoal) than the
   photo-first public gallery, which stays near-black so images pop. Declared on
   <body> so they cascade through the whole dashboard but leave .public-page at
   the darker [data-theme="dark"] defaults. */
[data-theme="dark"] body.app-shell {
    --paper: #221f18;
    --paper-2: #1a1711;
    --card: #2d2920;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* `display: flex/grid` on a class beats the UA [hidden] rule, so enforce it. */
[hidden] {
    display: none !important;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--paper);
    /* faint paper grain + warm vignette */
    background-image: radial-gradient(1200px 600px at 100% -10%, var(--clay-tint), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Visible keyboard focus everywhere (theme-aware). Inputs opt out via their own
   `outline: none` + clay box-shadow, which is more specific and wins. */
:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 2px;
    border-radius: 2px;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ── App shell layout ─────────────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    transition: grid-template-columns .2s ease;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    background: var(--paper-2);
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 26px;
    min-width: 0;
}

/* Collapse toggle (desktop only — mobile uses the burger). */
.nav-collapse-btn {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.nav-collapse-btn:hover {
    background: var(--card);
    color: var(--ink);
}

.nav-collapse-icon {
    transition: transform .2s ease;
}

.brand-mark {
    font-size: 22px;
    color: var(--clay);
    line-height: 1;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-weight: 500;
    font-size: 14.5px;
    transition: background .16s ease, color .16s ease;
}

.nav-item:hover {
    background: var(--card);
    color: var(--ink);
}

.nav-item.is-active {
    background: var(--clay);
    color: #fff;
}

.nav-item.is-active:hover {
    background: var(--clay-deep);
    color: #fff;
}

.nav-icon {
    display: inline-flex;
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    color: var(--ink-faint);
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-item:hover .nav-icon,
.nav-item.is-active .nav-icon {
    color: inherit;
}

.sidebar-foot {
    margin-top: auto;
    padding: 14px 10px 2px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-meta {
    font-size: 12.5px;
    color: var(--ink-faint);
    font-style: italic;
    font-family: var(--font-display);
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 10px;
}

.sidebar-user-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    font-family: var(--font-ui);
    font-size: 12.5px;
    color: var(--ink-faint);
    background: transparent;
    cursor: pointer;
}

.sidebar-user .nav-icon,
.sidebar-theme .nav-icon {
    width: 18px;
    height: 18px;
}

.sidebar-logout:hover {
    color: var(--clay);
}

/* Theme toggle: styled like the footer links but it's a <button>. */
.sidebar-theme {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    font-family: var(--font-ui);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-faint);
    background: transparent;
    border: none;
    cursor: pointer;
}

.sidebar-theme:hover {
    color: var(--clay);
}

/* Show the icon for the theme you'd switch *to*: moon while light, sun while dark. */
.theme-icon--sun {
    display: none;
}

[data-theme="dark"] .theme-icon--moon {
    display: none;
}

[data-theme="dark"] .theme-icon--sun {
    display: inline;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 15px 40px;
    border-bottom: 1px solid var(--line-soft);
}

.topbar-title {
    min-width: 0;
}

/* Breadcrumb trail (replaces the old eyebrow + page-title block).
   One font (UI) and one size throughout; hierarchy comes from colour/weight. */
.crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    min-width: 0;
}

.crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ink-faint);
    min-width: 0;
}

a.crumb {
    transition: color .14s ease;
}

a.crumb:hover {
    color: var(--clay);
}

.crumb--current {
    color: var(--ink);
    font-weight: 600;
}

.crumb-kind {
    color: var(--clay);
    white-space: nowrap;
}

.crumb-sep {
    color: var(--ink-faint);
    font-size: 15px;
    opacity: .55;
}

/* Page actions live in their own bar directly under the topbar; only rendered
   when the page defines any (see base.html.twig). */
.action-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 13px 40px;
    border-bottom: 1px solid var(--line-soft);
}

.content {
    padding: 30px 40px 64px;
    width: 100%;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash::before {
    content: "●";
    font-size: 9px;
}

.flash--success {
    background: var(--ok-bg);
    border-color: var(--ok-border);
    color: var(--ok-fg);
}

.flash--error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-fg);
}

.flash--info {
    background: var(--clay-tint);
    border-color: var(--info-border);
    color: var(--clay-deep);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    transition: transform .12s ease, background .16s ease, border-color .16s ease;
}

.btn:hover {
    border-color: var(--ink-faint);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.btn--primary:hover {
    background: var(--ink-strong);
}

.btn--accent {
    background: var(--clay);
    color: #fff;
    border-color: var(--clay);
}

.btn--accent:hover {
    background: var(--clay-deep);
}

.btn--ghost {
    background: transparent;
}

.btn--sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ── Cards / panels ───────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}

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

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 500;
    line-height: 1;
}

.stat-label {
    font-size: 12.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 36px 0 14px;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 64px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--ink-soft);
}

.empty-title {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 6px;
}

/* ── Forms ────────────────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field input, .field textarea, .field select {
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--ink);
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--clay);
    box-shadow: 0 0 0 3px var(--clay-tint);
}

/* ── Selection markers (client feedback) ──────────────────── */
.marker {
    --c: var(--ink-faint);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.marker-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.marker--red {
    --c: var(--m-red);
}

.marker--orange {
    --c: var(--m-orange);
}

.marker--yellow {
    --c: var(--m-yellow);
}

.marker--green {
    --c: var(--m-green);
}

.marker--blue {
    --c: var(--m-blue);
}

.btn--danger {
    color: var(--danger-fg);
}

.btn--danger:hover {
    border-color: var(--m-red);
    background: var(--danger-bg);
}

.muted {
    color: var(--ink-faint);
    font-size: 13px;
}

.field-hint {
    font-weight: 400;
    color: var(--ink-faint);
    font-size: 12px;
}

/* ── Lists (projects) ─────────────────────────────────────── */
.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.list-main {
    min-width: 0;
    flex: 1;
}

.list-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 500;
}

.list-sub {
    color: var(--ink-soft);
    font-size: 14px;
    margin: 2px 0 0;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-actions form {
    margin: 0;
}

/* ── Projects overview (atelier catalog) ──────────────────── */
.project-grid {
    display: grid;
    gap: 28px 22px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease;
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--ink-faint);
}

/* Cover montage — large lead tile + up to two stacked on the right */
.project-card__cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--paper-2);
    display: grid;
    gap: 3px;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.project-cover__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.project-card__cover .project-cover__img:first-child {
    grid-row: 1 / 3;
}

.project-card:hover .project-cover__img {
    transform: scale(1.04);
}

/* single cover fills the frame; two split it evenly */
.project-cover--1 .project-cover__img:first-child {
    grid-column: 1 / 3;
}

.project-cover--2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.project-cover--2 .project-cover__img:first-child {
    grid-row: 1;
}

/* empty — brand mark on a warm tint */
.project-cover--0 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    place-items: center;
    background-image: radial-gradient(120% 100% at 28% 18%, var(--clay-tint), transparent 60%);
}

.project-cover__empty {
    font-size: 56px;
    color: var(--clay);
    opacity: .32;
}

.project-card__count {
    position: absolute;
    left: 12px;
    bottom: 12px;
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 4px 11px;
    border-radius: 999px;
    color: var(--paper);
    background: color-mix(in srgb, var(--ink) 76%, transparent);
    backdrop-filter: blur(4px);
}

.project-card__body {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px 18px 14px;
    flex: 1;
}

.project-card__name {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 500;
    line-height: 1.15;
    transition: color .16s ease;
}

/* stretched link — the whole card opens the project; actions sit above it */
.project-card__name a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-card:hover .project-card__name {
    color: var(--clay-deep);
}

.project-card__desc {
    color: var(--ink-soft);
    font-size: 14px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

.project-card__date {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 12.5px;
    color: var(--ink-faint);
}

.project-card__actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
    .project-card {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .project-cover__img, .project-card:hover .project-cover__img {
        transition: none;
        transform: none;
    }
}

/* ── Activity feed ────────────────────────────────────────── */
.feed {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.feed-thumb {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--paper-2);
    display: grid;
    place-items: center;
}

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

.feed-body {
    min-width: 0;
    flex: 1;
}

.feed-line {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
}

.feed-comment {
    color: var(--ink-soft);
    font-size: 14px;
    margin: 4px 0 0;
}

.feed-meta {
    color: var(--ink-faint);
    font-size: 12px;
    margin: 5px 0 0;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.pagination-status {
    font-size: 13px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.pagination [aria-disabled="true"] {
    opacity: .4;
    pointer-events: none;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-narrow {
    max-width: 560px;
}

/* Space out stacked cards (e.g. the two sections on /settings) so they don't
   touch. Matches the .danger-card offset, which already sets the same value. */
.form-narrow + .form-narrow {
    margin-top: 18px;
}

.danger-card {
    margin-top: 18px;
}

.danger-card .section-title {
    margin-top: 0;
}

.card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 520px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

/* ── Share links ──────────────────────────────────────────── */
.link-row {
    align-items: flex-start;
}

.link-row .list-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 10px;
}

.link-tag {
    font-size: 12px;
    color: var(--ink-soft);
    background: var(--paper-2);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 2px 10px;
}

.copy-field {
    display: flex;
    gap: 8px;
    max-width: 460px;
}

.copy-input {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--ink-soft);
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.copy-preview-wrap {
    margin: 10px 0 8px;
}

.copy-preview-wrap label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.copy-preview {
    width: 100%;
    resize: vertical;
    min-height: 42px;
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink-soft);
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.copy-preview--inline {
    width: min(360px, 38vw);
    min-height: 38px;
    resize: none;
    vertical-align: middle;
}

.review-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.link-row .list-actions {
    flex-direction: column;
    align-items: stretch;
}

.is-copied {
    background: var(--m-green) !important;
    color: #fff !important;
    border-color: var(--m-green) !important;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: var(--clay);
}

/* ── Gallery detail bar ───────────────────────────────────── */
.detail-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin-bottom: 26px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.status-form {
    margin: 0;
}

.status-form select {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.detail-meta {
    color: var(--ink-faint);
    font-size: 13.5px;
}

.detail-bar-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.detail-bar-actions form {
    margin: 0;
}

/* ── Gallery grid / cards ─────────────────────────────────── */
.gallery-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.gallery-card {
    display: flex;
    flex-direction: column;
    transition: transform .14s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
}

.gallery-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-2);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
}

.gallery-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-cover-empty {
    font-size: 40px;
    color: var(--ink-faint);
    opacity: .4;
}

.gallery-cover .badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.gallery-meta {
    padding: 12px 4px 2px;
}

.gallery-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
}

.gallery-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

/* ── Upload dropzone ──────────────────────────────────────── */
/* The whole work area accepts drops; a hint + outline appear while dragging. */
.gallery-work {
    position: relative;
    border-radius: var(--radius);
    transition: outline-color .16s ease;
    outline: 2px dashed transparent;
    outline-offset: 6px;
}

.gallery-work.is-drag {
    outline-color: var(--clay);
}

.drop-hint {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
    place-items: center;
    border-radius: var(--radius);
    background: var(--clay-tint);
    color: var(--clay-deep);
    font-family: var(--font-display);
    font-size: 22px;
    font-style: italic;
    pointer-events: none;
}

.gallery-work.is-drag .drop-hint {
    display: grid;
}

.dropzone {
    border: 1.5px dashed var(--line);
    border-radius: var(--radius);
    background: var(--card);
    padding: 30px;
    text-align: center;
    margin-bottom: 26px;
    transition: border-color .16s ease, background .16s ease;
}

.dropzone-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--paper-2);
    color: var(--clay);
    font-size: 20px;
    margin-bottom: 10px;
}

.dropzone-text {
    font-size: 15px;
    margin: 0;
}

.dropzone-hint {
    font-size: 12.5px;
    color: var(--ink-faint);
    margin: 4px 0 0;
}

.linklike {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--clay);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.dropzone-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.dropzone-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
}

.dropzone-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--clay);
    transition: width .2s ease;
}

.dropzone-count {
    font-size: 12.5px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* Slim upload affordance shown below a populated grid (the big dropzone is kept
   only for the empty-gallery onboarding case). */
.dropzone--slim {
    padding: 14px 20px;
    margin: 18px 0 0;
    border-width: 1px;
}

.dropzone--slim .dropzone-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.dropzone--slim .dropzone-mark {
    width: 28px;
    height: 28px;
    font-size: 15px;
    margin-bottom: 0;
}

.dropzone--slim .dropzone-text {
    font-size: 14px;
}

.dropzone--slim .dropzone-progress {
    margin-top: 12px;
}

/* ── Gallery toolbox / asset grid ─────────────────────────── */
.gallery-tools-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.gallery-main-col {
    min-width: 0;
}

.gallery-toolbox {
    position: sticky;
    top: 24px;
    padding: 18px;
}

.gallery-toolbox .section-title {
    margin-top: 0;
}

/* The handle is the sticky bottom bar on mobile only; on desktop the toolbox is
   a regular sidebar, so it is hidden and the body shows permanently. */
.toolbox-handle {
    display: none;
}

.toolbox-body {
    min-width: 0;
}

.toolbox-section {
    border-top: 1px solid var(--line-soft);
    padding-top: 16px;
    margin-top: 16px;
}

.toolbox-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.toolbox-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
    margin: 0 0 12px;
}

.toolbox-wide {
    width: 100%;
    justify-content: center;
}

.toolbox-section > .toolbox-wide + form,
.toolbox-section > .toolbox-wide + .toolbox-wide {
    margin-top: 8px;
}

.toolbox-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.marker-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.marker-filter-options label {
    position: relative;
    cursor: pointer;
}

.marker-filter-options input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.marker-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: border-color .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}

.marker-filter-pill:hover {
    border-color: var(--ink-faint);
    color: var(--ink);
}

.marker-filter-pill.is-active,
.marker-filter-options input:checked + .marker-filter-pill {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.marker-filter-options input:focus-visible + .marker-filter-pill {
    box-shadow: 0 0 0 3px var(--clay-tint);
    border-color: var(--clay);
}

.marker-filter-count {
    color: inherit;
    opacity: .72;
}

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

.asset-grid--sm { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.asset-grid--md { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.asset-grid--lg { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }

/* Toolbar above the grid: filter/sort controls on the left, size switcher right. */
.asset-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 16px;
}

.asset-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
}

.asset-filter-search,
.asset-filter-sort {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--ink);
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.asset-filter-search {
    min-width: 150px;
}

.asset-filter-search:focus,
.asset-filter-sort:focus {
    outline: none;
    border-color: var(--clay);
    box-shadow: 0 0 0 3px var(--clay-tint);
}

.asset-filter-markers {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

/* Compact the shared marker pills to line up with the inputs in the bar. */
.asset-filter .marker-filter-pill {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 12.5px;
}

.asset-filter-check {
    margin-bottom: 0;
    white-space: nowrap;
}

.grid-size-switch {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
    flex: 0 0 auto;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.grid-size-opt {
    display: grid;
    place-items: center;
    width: 32px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.grid-size-opt:hover:not(.is-active) {
    color: var(--ink);
    background: var(--wash);
}

.grid-size-opt.is-active {
    color: var(--clay);
    background: var(--clay-tint);
    cursor: default;
}

.asset {
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asset-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--paper-2);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
}

.asset-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.asset-state {
    font-size: 12px;
    color: var(--ink-faint);
}

.asset--failed .asset-thumb {
    border-color: var(--danger-border);
}

.asset--failed .asset-state {
    color: var(--m-red);
}

.asset-del {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    opacity: 0;
    transition: opacity .14s ease;
}

.asset:hover .asset-del {
    opacity: 1;
}

.asset-del-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(29, 26, 22, .7);
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

.asset-del-btn:hover {
    background: var(--m-red);
}

.asset-select-wrap {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s ease;
}

/* Reveal the checkbox when hovering the photo (so it can be picked directly) and
   keep every checkbox visible once selection mode is active. */
.asset-thumb:hover .asset-select-wrap,
.is-selection-mode .asset-select-wrap {
    opacity: 1;
    pointer-events: auto;
}

/* Touch devices have no hover, so the checkbox would otherwise stay hidden until
   selection mode. Show it permanently there. */
@media (hover: none) {
    .asset-select-wrap {
        opacity: 1;
        pointer-events: auto;
    }
}

.asset-select-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.asset-select-box {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(251, 249, 245, .9);
    border: 1px solid rgba(29, 26, 22, .25);
    box-shadow: var(--shadow);
}

.asset-select-box::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
}

.asset-select-input:checked + .asset-select-box {
    background: var(--clay);
    border-color: var(--clay);
}

.asset-select-input:checked + .asset-select-box::after {
    content: "✓";
    width: auto;
    height: auto;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}

.asset-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 2px;
}

.asset-marker, .asset-comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 700;
}

.asset-marker .marker-swatch {
    width: 9px;
    height: 9px;
}

.asset-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 22px 8px 7px;
    color: rgba(245, 241, 234, .78);
    font-size: 11px;
    background: linear-gradient(transparent, rgba(29, 26, 22, .74));
    opacity: 0;
    transition: opacity .14s ease;
}

.asset:hover .asset-caption {
    opacity: 1;
}

.asset-filename {
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1120px) {
    .gallery-tools-layout {
        grid-template-columns: 1fr;
        /* Reserve room so the collapsed bottom bar never hides the last assets. */
        padding-bottom: 64px;
    }

    /* The toolbox detaches into a sticky bar pinned to the bottom of the
       viewport. Collapsed it shows only the handle; tapping slides the tools up
       as a sheet. This keeps the photos at the top instead of pushing them down. */
    .gallery-toolbox {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 60;
        top: auto;
        padding: 0;
        border-radius: var(--radius) var(--radius) 0 0;
        box-shadow: var(--shadow-lg);
        max-height: min(80vh, 620px);
        display: flex;
        flex-direction: column;
    }

    .toolbox-handle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 14px 18px;
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--line-soft);
        font: inherit;
        color: var(--ink);
        cursor: pointer;
        text-align: left;
    }

    .toolbox-handle-title {
        font-weight: 700;
    }

    .toolbox-handle-meta {
        margin-left: auto;
        font-size: 13px;
        color: var(--ink-soft);
    }

    .toolbox-handle-chevron {
        font-size: 12px;
        color: var(--ink-soft);
        transition: transform .2s ease;
    }

    .is-toolbox-open .toolbox-handle-chevron {
        transform: rotate(180deg);
    }

    /* Collapsed by default: only the handle is visible. */
    .toolbox-body {
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 18px 18px;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: max-height .25s ease, opacity .2s ease, padding .25s ease;
    }

    .is-toolbox-open .toolbox-body {
        max-height: calc(min(80vh, 620px) - 52px);
        opacity: 1;
        visibility: visible;
        padding-top: 16px;
    }

    .gallery-toolbox .section-title {
        display: none;
    }
}

@media (max-width: 520px) {
    .toolbox-actions {
        flex-direction: column;
    }
}

/* ── Review (client selection) ────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    transition: border-color .14s ease, color .14s ease;
}

.filter-pill:hover {
    border-color: var(--ink-faint);
    color: var(--ink);
}

.filter-pill.is-active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.filter-note {
    margin-left: auto;
    color: var(--ink-faint);
    font-size: 13px;
}

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

.review-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.review-thumb {
    aspect-ratio: 3 / 2;
    background: var(--paper-2);
}

.review-thumb .asset-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.review-body {
    padding: 14px 16px 16px;
}

.review-markers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.review-markers .marker {
    font-size: 12.5px;
    color: var(--ink-soft);
    background: var(--paper-2);
    border-radius: 999px;
    padding: 3px 10px;
}

.review-comment {
    border-top: 1px solid var(--line-soft);
    padding-top: 8px;
    margin-top: 8px;
}

.review-comment:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.review-comment-meta {
    font-size: 12px;
    color: var(--ink-faint);
}

.review-comment-body {
    margin: 3px 0 0;
    font-size: 14px;
}

/* ── Lightbox ─────────────────────────────────────────────── */
body.lb-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    padding: 22px 24px 20px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(12, 10, 8, 0.94);
    backdrop-filter: blur(6px);
    animation: lb-fade .18s ease;
}

@keyframes lb-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lb-panel {
    width: 100%;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
}

.lb-sidebar {
    min-width: 0;
    overflow: auto;
    border-radius: var(--radius);
    background: rgba(245, 241, 234, .08);
    border: 1px solid rgba(245, 241, 234, .14);
    color: rgba(245, 241, 234, .86);
    padding: 14px;
}

.lb-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(245, 241, 234, .12);
}

.lb-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.lb-section h2 {
    margin: 0 0 12px;
    color: #f5f1ea;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
}

.lb-section-body {
    font-size: 13px;
}

.lb-info-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.lb-info-list div {
    border-bottom: 1px solid rgba(245, 241, 234, .10);
    padding-bottom: 9px;
}

.lb-info-list dt {
    color: rgba(245, 241, 234, .52);
    font-size: 11px;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.lb-info-list dd {
    margin: 2px 0 0;
    color: #f5f1ea;
    overflow-wrap: anywhere;
}

.lb-comment {
    border-bottom: 1px solid rgba(245, 241, 234, .10);
    padding: 0 0 12px;
    margin: 0 0 12px;
}

.lb-comment-meta {
    margin: 0 0 5px;
    color: rgba(245, 241, 234, .55);
    font-size: 12px;
}

.lb-comment-body {
    margin: 0;
    color: rgba(245, 241, 234, .88);
    white-space: pre-wrap;
}

.lb-empty, .lb-empty-inline {
    color: rgba(245, 241, 234, .48);
    font-style: italic;
}

.lb-viewer {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px;
}

.lb-stage {
    margin: 0;
    min-height: 0;
    /* Hidden, not auto: when zoomed the image is panned via transform (drag),
       so the overflow is clipped rather than scrolled. */
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
    padding: 24px;
    border-radius: var(--radius);
    overscroll-behavior: contain;
}

.lb-img {
    max-width: 100%;
    max-height: calc(100vh - 178px);
    object-fit: contain;
    transform-origin: center center;
    transition: transform .12s ease;
    border-radius: 6px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
    animation: lb-pop .22s ease;
}

/* When zoomed past 100% the image is draggable. touch-action: none stops the
   browser from scrolling/zooming the page so the pan gesture is ours. */
.lb-zoomed .lb-img {
    cursor: grab;
    touch-action: none;
}

.lb-grabbing .lb-img {
    cursor: grabbing;
    /* No easing while dragging — the image must track the pointer 1:1. */
    transition: none;
}

@keyframes lb-pop {
    from {
        transform: scale(.97);
        opacity: .4;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lb-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(245, 241, 234, .08);
    border: 1px solid rgba(245, 241, 234, .14);
    color: rgba(245, 241, 234, .72);
}

.lb-markers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 180px;
}

.lb-marker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(245, 241, 234, .10);
    color: rgba(245, 241, 234, .86);
    font-size: 12px;
    font-weight: 700;
}

.lb-marker-count {
    opacity: .72;
    font-variant-numeric: tabular-nums;
}

.lb-markers-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(245, 241, 234, .72);
    margin-right: 2px;
}

.lb-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    background: var(--c, var(--ink-faint));
    border: 2px solid transparent;
    opacity: .4;
    transition: opacity .14s ease, transform .12s ease, box-shadow .14s ease;
}

.lb-dot:hover {
    opacity: .8;
    transform: scale(1.12);
}

.lb-dot.is-on {
    opacity: 1;
    border-color: rgba(245, 241, 234, .92);
    box-shadow: 0 0 0 2px var(--c);
}

.lb-zoom {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
}

.lb-zoom input {
    width: 150px;
    accent-color: var(--clay);
}

.lb-reset {
    border: 1px solid rgba(245, 241, 234, .16);
    border-radius: 999px;
    padding: 5px 10px;
    background: transparent;
    color: rgba(245, 241, 234, .78);
    cursor: pointer;
}

.lb-counter {
    margin-left: auto;
    color: rgba(245, 241, 234, .74);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.lb-close, .lb-nav {
    position: fixed;
    z-index: 2;
    background: rgba(245, 241, 234, .10);
    color: #f5f1ea;
    border: 1px solid rgba(245, 241, 234, .18);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease;
}

.lb-close:hover, .lb-nav:hover {
    background: rgba(245, 241, 234, .22);
}

.lb-close {
    top: 22px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 26px;
}

.lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 30px;
}

.lb-prev {
    left: 344px;
}

.lb-next {
    right: 24px;
}

@media (max-width: 760px) {
    .lightbox {
        padding: 14px 12px;
    }

    .lb-panel {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .lb-sidebar {
        order: 2;
        max-height: 28vh;
    }

    .lb-stage {
        padding: 12px;
    }

    .lb-img {
        max-height: 50vh;
    }

    .lb-bottom {
        gap: 10px;
    }

    .lb-markers {
        min-width: 0;
    }

    .lb-zoom input {
        width: 110px;
    }

    .lb-counter {
        width: 100%;
        margin-left: 0;
        text-align: right;
    }

    .lb-nav {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }

    .lb-prev {
        left: 10px;
    }

    .lb-next {
        right: 10px;
    }

    .lb-close {
        top: 14px;
        right: 14px;
    }
}

/* ── Badges & status pills ────────────────────────────────── */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
}

.badge--muted {
    background: var(--ink-soft);
}

.status-pill {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.status-pill--draft {
    color: var(--ink-faint);
}

.status-pill--in_review {
    color: var(--m-orange);
    border-color: rgba(217, 124, 43, .4);
    background: rgba(217, 124, 43, .08);
}

.status-pill--online {
    color: var(--m-green);
    border-color: rgba(79, 157, 93, .4);
    background: rgba(79, 157, 93, .10);
}

/* Segmented status switcher in the gallery topbar. Each option is a plain POST
   button; the current status is highlighted, the others are quiet until hovered. */
.status-switch {
    display: inline-flex;
    gap: 0;
    margin-right: auto;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
}

.status-switch-opt {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.status-switch-opt:hover:not(.is-active) {
    color: var(--ink);
    background: var(--wash);
}

.status-switch-opt.is-active {
    cursor: default;
}

/* The active option borrows the matching status-pill colour for instant
   recognition (draft = neutral, in_review = clay, online = green). */
.status-switch-opt.status-pill--draft.is-active {
    color: var(--ink);
    background: var(--wash-strong);
    border-color: var(--line);
}

.status-switch-opt.status-pill--in_review.is-active {
    color: var(--m-orange);
    background: rgba(217, 124, 43, .12);
    border-color: rgba(217, 124, 43, .4);
}

.status-switch-opt.status-pill--online.is-active {
    color: var(--m-green);
    background: rgba(79, 157, 93, .14);
    border-color: rgba(79, 157, 93, .4);
}

@media (max-width: 720px) {
    .status-switch-opt {
        padding: 6px 10px;
    }
}

/* ── Public client gallery (dark) ─────────────────────────── */
.public-page {
    min-height: 100vh;
}

.public-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 32px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.public-brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-brand .brand-mark {
    color: var(--clay);
}

.public-gallery-name {
    margin-left: auto;
    color: var(--ink-faint);
    font-style: italic;
    font-family: var(--font-display);
}

.public-main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px;
}

.pub-intro {
    margin-bottom: 30px;
}

.pub-heading {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 500;
}

.pub-sub {
    color: var(--ink-soft);
    max-width: 60ch;
    margin-top: 6px;
}

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

.pub-asset {
    margin: 0;
}

.pub-frame {
    aspect-ratio: 3 / 2;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-2);
    border: 1px solid var(--line);
}

.pub-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform .3s ease;
}

.pub-img:hover {
    transform: scale(1.03);
}

.pub-markers {
    display: flex;
    gap: 9px;
    padding: 12px 2px 6px;
}

.pub-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    background: var(--c, var(--ink-faint));
    border: 2px solid transparent;
    opacity: .35;
    transition: opacity .14s ease, transform .12s ease, box-shadow .14s ease;
}

.pub-dot:hover {
    opacity: .75;
    transform: scale(1.12);
}

.pub-dot.is-on {
    opacity: 1;
    border-color: var(--paper);
    box-shadow: 0 0 0 2px var(--c);
}

.pub-comments {
    font-size: 13px;
}

.pub-comments summary {
    cursor: pointer;
    color: var(--ink-soft);
    list-style: none;
    padding: 4px 0;
}

.pub-comments summary::-webkit-details-marker {
    display: none;
}

.pub-comments summary:hover {
    color: var(--ink);
}

.pub-comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.pub-comment-form input, .pub-comment-form textarea {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--ink);
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}

.pub-comment-form button {
    align-self: flex-start;
}

.unlock-wrap {
    display: grid;
    place-items: center;
    min-height: 70vh;
}

.unlock-card {
    width: 100%;
    max-width: 360px;
}

.unlock-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
}

.unlock-lead {
    color: var(--ink-soft);
    margin: 4px 0 18px;
}

/* ── Mobile drawer (checkbox hack, no JS) ─────────────────── */
.nav-burger, .nav-scrim {
    display: none;
}

.nav-burger {
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 6px;
}

.nav-burger span {
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

/* ── Collapsed sidebar (desktop icon rail) ────────────────── */
@media (min-width: 861px) {
    html.nav-collapsed .app-shell {
        grid-template-columns: var(--sidebar-rail-w) 1fr;
    }

    html.nav-collapsed .sidebar {
        padding-left: 12px;
        padding-right: 12px;
    }

    html.nav-collapsed .sidebar-head {
        flex-direction: column;
        gap: 14px;
    }

    html.nav-collapsed .brand {
        padding: 4px 0 0;
        justify-content: center;
    }

    html.nav-collapsed .nav-collapse-btn {
        margin-bottom: 22px;
    }

    html.nav-collapsed .nav-collapse-icon {
        transform: rotate(180deg);
    }

    html.nav-collapsed .nav-item,
    html.nav-collapsed .sidebar-user-name,
    html.nav-collapsed .sidebar-logout,
    html.nav-collapsed .sidebar-theme {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    html.nav-collapsed .sidebar-foot {
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Keep the labels in the accessibility tree (and as native tooltips via the
       title attribute) while hiding them visually in the rail. */
    html.nav-collapsed .brand-name,
    html.nav-collapsed .nav-label,
    html.nav-collapsed .sidebar-meta {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    /* The collapse rail is a desktop affordance; on mobile the burger drawer
       takes over, so neither the toggle nor a collapsed state apply. */
    .nav-collapse-btn {
        display: none;
    }

    .sidebar {
        position: fixed;
        z-index: 40;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform .24s ease;
    }

    .nav-toggle-cb:checked ~ .sidebar {
        transform: none;
        box-shadow: var(--shadow-lg);
    }

    .nav-toggle-cb:checked ~ .nav-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(0, 0, 0, .35);
    }

    .nav-burger {
        display: flex;
    }

    .topbar {
        padding: 14px 20px;
    }

    .action-bar {
        padding: 11px 20px;
    }

    .content {
        padding: 22px 20px 56px;
    }
}
