/* ─── Variables ─────────────────────────────────────────────────────────────── */

:root {
    color-scheme: dark;
    --bg-page: #000000;      /* page, header, mobile menu */
    --bg-primary: #191919;
    --bg-secondary: #262626;
    --bg-card: #303030;
    --bg-input: #000000;
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.16);
    --text-primary: #ededed;
    --text-secondary: #c0c0c0;
    --text-muted: #a3a3a3;
    --border: #2a2a2a;
    --border-light: #1f1f1f;
    --radius: 0px;
    --radius-lg: 0px;
    --radius-info: 0px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);

    --status-active: #4ade80;
    --status-active-bg: rgba(34, 197, 94, 0.16);
    --status-inactive: #94a3b8;
    --status-inactive-bg: rgba(148, 163, 184, 0.14);
    --status-pending: #fbbf24;
    --status-pending-bg: rgba(251, 191, 36, 0.16);
}

/* Light theme (header toggle → <html data-theme="light">). Only the palette
   changes; the photo viewer and overlays on photos stay dark in both. */
:root[data-theme="light"] {
    color-scheme: light;
    --bg-page: #ffffff;
    --bg-primary: #f2f2f2;
    --bg-secondary: #ebebeb;
    --bg-card: #f7f7f7;
    --bg-input: #ffffff;     /* also photo placeholders */
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.1);
    --text-primary: #171717;
    --text-secondary: #404040;
    --text-muted: #6b6b6b;
    --border: #dcdcdc;
    --border-light: #ececec;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.16);

    --status-active: #15803d;
    --status-active-bg: rgba(22, 163, 74, 0.12);
    --status-inactive: #475569;
    --status-inactive-bg: rgba(71, 85, 105, 0.12);
    --status-pending: #b45309;
    --status-pending-bg: rgba(217, 119, 6, 0.14);
}

/* ─── Reset / Base ─────────────────────────────────────────────────────────── */

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

/* One typeface everywhere: Outfit (headings semibold). Form controls don't
   inherit fonts by default, so they're told to. */
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, h5, h6,
.page-title,
.card-title,
.panel-title,
.modal-title,
.logo-text {
    font-weight: 600;
    letter-spacing: 0;
}

main { flex: 1; }

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

img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
/* Widen the content column on large screens so auto-fill grids (galleries,
   photo grid) pack more columns and tables get more room. */
@media (min-width: 1600px) { .container { max-width: 1500px; } }
@media (min-width: 2000px) { .container { max-width: 1860px; } }
@media (min-width: 2560px) { .container { max-width: 2300px; } }

/* ─── Header ───────────────────────────────────────────────────────────────── */

.site-header {
    background: var(--bg-page);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-primary);
}
.logo:hover { color: var(--text-primary); }
.logo .kudos-icon { width: 26px; height: 26px; }

/* Wordmark: lowercase "phx" set in Outfit. */
.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links-desktop {
    display: flex;
    gap: 2px;
    margin-right: 12px;
}

.nav-link {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.15s;
    text-decoration: none;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-primary); }
.nav-link.active { color: var(--accent); background: var(--accent-light); font-weight: 500; }

.nav-user {
    margin-right: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.nav-user .nav-user-avatar { width: 32px; height: 32px; transition: box-shadow 0.15s; }
.nav-user:hover .nav-user-avatar { box-shadow: 0 0 0 2px var(--accent); }


.nav-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-input) center/cover no-repeat;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    flex: 0 0 auto;
}
.nav-user-avatar--fallback { background-color: var(--bg-secondary); }

.nav-btn {
    padding: 7px 16px;
    border-radius: var(--radius);
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-btn--accent { background: var(--accent); color: #fff; }
.nav-btn--accent:hover { background: var(--accent-dark); }

.nav-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.nav-btn--ghost:hover { background: var(--bg-primary); color: var(--text-primary); }

.theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-moon { display: inline; }

.nav-btn--icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Off-screen but still focusable / clickable — needed because iOS Safari
   does not always trigger a hidden (display:none) file input even via a
   label. Keeps it interactive without showing it. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lang-picker {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    margin-left: 4px;
}
.lang-picker:hover { color: var(--text-primary); border-color: var(--text-muted); }
.lang-picker:focus { outline: none; border-color: var(--accent); }

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.2s;
}

.nav-accordion {
    display: none;
    flex-direction: column;
    background: var(--bg-page);
    border-top: 1px solid var(--border);
}
.nav-accordion.open { display: flex; }

.nav-accordion-link {
    color: var(--text-secondary);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    text-decoration: none;
}
.nav-accordion-link:hover { color: var(--text-primary); background: var(--bg-primary); }
.nav-accordion-link.active { color: var(--accent); font-weight: 500; }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-primary); color: var(--text-primary); }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* Google's light sign-in button style (brand guidelines). */
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #747775; gap: 10px; }
.btn-google:hover { background: #f2f2f2; color: #1f1f1f; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ─── Forms ────────────────────────────────────────────────────────────────── */

.form-field { margin-bottom: 14px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ─── Cards / Panels ────────────────────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-title { font-size: 18px; color: var(--text-primary); }
.card-body { padding: 20px; }

/* ─── Table ────────────────────────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; }

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: var(--accent-light); }

.td-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Badges ───────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-info);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-active   { background: var(--status-active-bg);   color: var(--status-active); }
.badge-inactive { background: var(--status-inactive-bg); color: var(--status-inactive); }
.badge-pending  { background: var(--status-pending-bg);  color: var(--status-pending); }

/* ─── Page layout ───────────────────────────────────────────────────────────── */

.page-section { padding: 28px 0; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title { font-size: 28px; color: var(--text-primary); letter-spacing: 0; line-height: 1.2; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.storage-over { color: var(--status-pending); font-weight: 600; }

.notice {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: var(--status-pending-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}
.notice > i { color: var(--status-pending); }

/* Under the gallery's watermark field: previews an unfinished rebuild left. */
.watermark-pending {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--status-pending-bg);
    color: var(--text-primary);
    font-size: 13px;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.tab {
    background: none;
    border: none;
    padding: 10px 2px;
    margin-bottom: -1px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* ─── Manage section tabs (views/manage-tabs.php) ───────────────────────────── */
/* Bigger than .tabs (used inside pages) so the two levels read apart. */

.manage-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.manage-tabs::-webkit-scrollbar { display: none; }
.manage-tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.manage-tab i { font-size: 14px; opacity: 0.8; }
.manage-tab:hover { color: var(--text-primary); background: var(--bg-secondary); }
.manage-tab.active { color: var(--text-primary); background: var(--bg-secondary); border-bottom-color: var(--accent); }
.manage-tab.active i { color: var(--accent); opacity: 1; }
@media (max-width: 700px) { .manage-tab { padding: 10px 14px; font-size: 14px; } }
/* Phones: labels only, so all four tabs fit without scrolling. */
@media (max-width: 480px) {
    .manage-tabs { gap: 0; }
    .manage-tab { padding: 10px 11px; }
    .manage-tab i { display: none; }
}

.manage-tour-btn {
    margin-left: auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.manage-tour-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Help hints & Manage tour (public/js/help.js) ─────────────────────────── */

.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 2px;
    padding: 0;
    vertical-align: middle;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.page-title .help-btn { width: 30px; height: 30px; font-size: 18px; }
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--accent); background: var(--accent-light); }
.help-pop {
    position: fixed;
    z-index: 400;
    max-width: 300px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

/* Tour: a transparent layer blocks the page, the spotlight's huge shadow dims
   everything around the step's element, the card explains it. */
.tour-layer { position: fixed; inset: 0; z-index: 900; }
.tour-spot {
    position: fixed;
    z-index: 901;
    pointer-events: none;
    outline: 2px solid var(--accent);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s;
}
.tour-card {
    position: fixed;
    z-index: 902;
    width: 340px;
    max-width: calc(100vw - 16px);
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.tour-step { margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.tour-title { margin-bottom: 6px; font-size: 18px; }
.tour-text { margin-bottom: 14px; font-size: 14px; color: var(--text-secondary); }
.tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tour-skip {
    margin-right: auto;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}
.tour-skip:hover { color: var(--text-primary); text-decoration: underline; }

/* ─── Slide panel ───────────────────────────────────────────────────────────── */

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
}
.panel-overlay.open { display: flex; }

.panel {
    width: 460px;
    max-width: 100vw;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.panel-title { font-size: 18px; }

.panel-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--radius);
    transition: all 0.1s;
}
.panel-close:hover { background: var(--border); color: var(--text-primary); }

.panel-body { padding: 22px; flex: 1; }

.panel-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--bg-primary);
}

/* ─── Modal ─────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 28px;
    position: relative;
}

.modal-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* ─── Empty state ────────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 44px; margin-bottom: 12px; color: var(--text-muted); }
.empty-state p { font-size: 14px; }

/* ─── Toast ───────────────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.2s ease;
    max-width: 360px;
}
.toast-success { background: #16a34a; color: #fff; }
.toast-error   { background: #dc2626; color: #fff; }

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── Event grid (home page) ───────────────────────────────────────────────── */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 5px;
}
.event-grid--lg {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
@media (max-width: 1000px) {
    .event-grid--lg { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .event-grid--lg { grid-template-columns: 1fr; }
}
/* Add a column on very wide screens instead of just stretching the cards. */
@media (min-width: 2000px) {
    .event-grid--lg { grid-template-columns: repeat(4, 1fr); }
}
.event-grid--lg .event-meta { padding: 18px 20px; }
.event-grid--lg .event-meta h3 { font-size: 18px; margin-bottom: 6px; }
.event-grid--lg .event-meta .event-sub { font-size: 13px; }

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }

.event-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--bg-primary) center/cover no-repeat;
    border-bottom: 1px solid var(--border-light);
}

.event-cover-empty {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--accent-light), var(--bg-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 32px;
    border-bottom: 1px solid var(--border-light);
}

/* Fill the card so the info row sits at the bottom even when a neighbour's
   title wraps to more lines. */
.event-meta { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.event-meta h3 { font-size: 15px; margin-bottom: 4px; }
.event-meta .event-sub { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: auto; }
.event-sub-left { flex: 0 0 auto; }
.event-photographer { flex: 1 1 auto; min-width: 0; text-align: right; }

/* ─── Photographer cards (home page) ────────────────────────────────────── */

.photographer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 5px;
}
.photographer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.photographer-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
    color: inherit;
}
.photographer-card-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--bg-input) center/cover no-repeat;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 12px;
}
.photographer-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.photographer-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── Photographer of the day (home) ────────────────────────────────────── */

.potd-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.potd-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
    color: inherit;
}
.potd-head {
    display: flex;
    align-items: center;
    gap: 14px;
}
.potd-avatar {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-input) center/cover no-repeat;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.potd-headtext { min-width: 0; flex: 1 1 0; }
.potd-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
/* The photographer's tags sit at the card's right edge; on phones they get
   their own row under the name, still on the right. */
.potd-tags {
    flex: 0 1 auto;
    max-width: 45%;
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
@media (max-width: 600px) {
    .potd-head { flex-wrap: wrap; }
    .potd-tags { max-width: none; flex-basis: 100%; }
}
/* Account → Profile: photography tags picker. */
.ptag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.ptag-option {
    padding: 3px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ptag-option:hover { border-color: var(--accent); color: var(--text-primary); }
.ptag-option.is-picked { background: var(--accent); border-color: var(--accent); color: #fff; }
.ptag-option:disabled { opacity: 0.4; cursor: not-allowed; }
.ptag-option:disabled:hover { border-color: var(--border); color: var(--text-secondary); }

.potd-tag {
    padding: 1px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
}
.potd-bio {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.potd-photos {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}
.potd-photo {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    background: var(--bg-primary) center/cover no-repeat;
}
@media (max-width: 700px) {
    .potd-photos { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Photographers listing ─────────────────────────────────────────────── */

.photographers-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.photographers-item-photos {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-top: auto;
    width: 100%;   /* stretch across the card (grid-as-flex-item won't otherwise) */
}
@media (max-width: 700px) {
    .photographers-item-photos { grid-template-columns: repeat(3, 1fr); }
}
.photographers-item-more { position: relative; }
.photographers-item-more-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
}

/* ─── Photographer page ─────────────────────────────────────────────────── */

.photographer-hero {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.photographer-hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--bg-input) center/cover no-repeat;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    flex: 0 0 auto;
}
.photographer-hero-info { flex: 1 1 300px; min-width: 0; }
.photographer-bio {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}
.photographer-bio--empty { color: var(--text-muted); font-style: italic; }
.photographer-social { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.photographer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: color 0.15s, border-color 0.15s;
}
.photographer-social a:hover { color: var(--accent); border-color: var(--accent); }

/* Account page: one input per social network, its icon on the left. */
.social-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .social-fields { grid-template-columns: 1fr; } }
.social-field { position: relative; display: block; }
.social-field i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}
.social-field .form-input { padding-left: 38px; }

.photographer-event { margin-bottom: 32px; }
.photographer-event-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.photographer-event-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}
.photographer-event-title a { color: var(--text-primary); }
.photographer-event-title a:hover { color: var(--accent); }
.photographer-event-meta { color: var(--text-muted); font-size: 13px; }

.photographer-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}
.photographer-event-tile {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-input);
}
.photographer-event-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
/* Portfolio albums: a bit bigger tiles than the event albums below them. */
.photographer-event--portfolio .photographer-event-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
/* Phones: 3 columns for albums, 2 for portfolio — at the desktop minimums
   both would be 2 columns and the difference would vanish. */
@media (max-width: 480px) {
    .photographer-event-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .photographer-event--portfolio .photographer-event-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
.photographer-event-tile:hover img { transform: scale(1.05); }
.photographer-event-tile--more { position: relative; }
.photographer-event-more-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    z-index: 1;
}

/* ─── Photo grid (event gallery) ───────────────────────────────────────────── */

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

.photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-primary);
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.photo-tile:hover img { transform: scale(1.04); }

.photo-tile.selected { outline: 3px solid var(--accent); outline-offset: -3px; }

.photo-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0);
    font-size: 13px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    z-index: 2;
}
.photo-check:hover { transform: scale(1.08); color: rgba(255, 255, 255, 0.85); }
.photo-tile.selected .photo-check {
    background: var(--accent);
    border-color: #fff;
    color: #fff;
}

/* Kudos: lens-shaped "like" button in the photo's lower-right corner. Tiles
   show it when it has a count or on hover (always on touch screens). */
.kudos-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: none;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, transform 0.1s;
}
.photo-tile:hover .kudos-btn,
.kudos-btn.has-kudos,
.kudos-btn.is-given,
.kudos-btn:focus-visible { opacity: 1; }
@media (hover: none) { .kudos-btn { opacity: 1; } }
.kudos-btn:hover { transform: scale(1.06); background: rgba(0, 0, 0, 0.75); }
.kudos-btn.is-given { background: var(--accent); }
.kudos-btn.is-given:hover { background: var(--accent-dark); }
.kudos-count:empty { display: none; }

/* Camera-iris icon (markup: kudos_icon_svg()). Each blade's translateX moves
   the aperture edge: 0 = resting hexagon, +3 = wide open, -4 = shut. The
   iris turns a little as it opens, like real aperture blades. */
.kudos-icon { width: 18px; height: 18px; flex: none; clip-path: circle(50%); }
.iris-blade { fill: currentColor; transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.4, 1); }
.iris       { transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.4, 1); }
.kudos-btn.is-given .iris-blade { transform: translateX(-1.5px); }
.kudos-btn:hover .iris-blade,
.logo:hover .iris-blade         { transform: translateX(3px); }
.kudos-btn:hover .iris,
.logo:hover .iris               { transform: rotate(-25deg); }

/* Click: shutter snaps shut and reopens to whatever state it's in. The
   header logo uses the same icon and animations. */
.kudos-pop .iris-blade { animation: iris-shutter 0.45s ease-in-out; }
.kudos-pop .iris       { animation: iris-twist 0.45s ease-in-out; }
@keyframes iris-shutter { 45% { transform: translateX(-4px); } }
@keyframes iris-twist   { 45% { transform: rotate(35deg); } }
@media (prefers-reduced-motion: reduce) {
    .iris-blade, .iris { transition: none; }
    .kudos-pop .iris-blade, .kudos-pop .iris { animation: none; }
}

/* The lightbox copy sits in the photo's lower-right corner, mirroring the
   select check top-left. When the caption covers that corner, gallery.js
   (placeLightboxKudos) lifts it above the caption text. */
.lightbox-kudos {
    right: 14px;
    bottom: 14px;
    z-index: 3;
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
    border-radius: 18px;
    font-size: 14px;
    opacity: 1;
}
.lightbox-kudos .kudos-icon { width: 22px; height: 22px; }

.photo-tile .photo-delete,
.photo-tile .photo-cover-btn,
.photo-tile .photo-reorder-btn {
    position: absolute;
    top: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Right to left: delete, cover star, reorder arrows. The cover photo has no
   star, so its arrows take the star's place. */
.photo-tile .photo-delete      { right: 6px; }
.photo-tile .photo-cover-btn   { right: 36px; }
.photo-tile .photo-reorder-btn { right: 66px; }
.photo-tile.is-cover .photo-reorder-btn { right: 36px; }
.photo-tile:hover .photo-delete,
.photo-tile:hover .photo-cover-btn,
.photo-tile:hover .photo-reorder-btn { opacity: 1; }
.photo-tile .photo-delete:hover    { background: #dc2626; }
.photo-tile .photo-cover-btn:hover,
.photo-tile .photo-reorder-btn:hover { background: var(--accent); }
.photo-tile.is-cover .photo-cover-btn { display: none; }
.photo-tile:only-child .photo-reorder-btn { display: none; } /* nothing to reorder */
/* Touch screens can't hover: keep the buttons showing, with bigger targets. */
@media (hover: none) {
    .photo-tile .photo-delete,
    .photo-tile .photo-cover-btn,
    .photo-tile .photo-reorder-btn { opacity: 1; width: 32px; height: 32px; font-size: 14px; }
    .photo-tile .photo-cover-btn   { right: 44px; }
    .photo-tile .photo-reorder-btn { right: 82px; }
    .photo-tile.is-cover .photo-reorder-btn { right: 44px; }
}

/* Reorder mode (gallery edit page, uploader.js). The bar sticks below the
   site header so Save stays in reach in a long gallery. */
.reorder-bar {
    position: sticky;
    top: 72px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.reorder-bar-hint { font-size: 13px; color: var(--text-secondary); flex: 1 1 260px; }
.reorder-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-grid.is-reordering { user-select: none; -webkit-user-select: none; }
.photo-grid.is-reordering .photo-tile { cursor: grab; }
.photo-grid.is-reordering .photo-tile img { -webkit-user-drag: none; }
.photo-grid.is-reordering .photo-tile:hover img { transform: none; }
.photo-grid.is-reordering .photo-delete,
.photo-grid.is-reordering .photo-cover-btn,
.photo-grid.is-reordering .photo-reorder-btn { display: none; }
.photo-drag-handle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    touch-action: none; /* a touch here drags instead of scrolling */
}
.photo-tile.is-drag-source { opacity: 0.35; outline: 2px dashed var(--accent); outline-offset: -2px; }
.photo-drag-ghost {
    position: fixed;
    z-index: 1000;
    margin: 0;
    pointer-events: none;
    cursor: grabbing;
    opacity: 0.92;
    transform: scale(1.04);
    box-shadow: var(--shadow-lg);
}

.photo-cover-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: none;
}
.photo-tile.is-cover .photo-cover-badge { display: inline-block; }

/* Processing-state badge (admin grid) — bottom-right corner. */
.photo-state {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.62);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 2;
}
.photo-state--ready   { color: #34d399; }
.photo-state--pending { color: #fbbf24; }
.photo-state--failed  { color: #f87171; }

/* ─── Dropzone ─────────────────────────────────────────────────────────────── */

.dropzone {
    display: block;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-primary);
    transition: all 0.15s;
    cursor: pointer;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); }
.dropzone--locked { cursor: default; opacity: 0.7; }
.dropzone-icon { font-size: 36px; margin-bottom: 12px; }
.dropzone p { font-size: 14px; margin: 0; }

.upload-list { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}
.upload-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress {
    width: 120px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.upload-progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.15s; }
.upload-status { font-size: 12px; color: var(--text-muted); min-width: 60px; text-align: right; }
.upload-status.error { color: #dc2626; }
.upload-status.done  { color: #16a34a; }

/* ─── Lightbox ─────────────────────────────────────────────────────────────── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-stage { position: relative; display: flex; line-height: 0; }
.lightbox-img { max-width: 96vw; max-height: 86vh; object-fit: contain; display: block; transition: opacity 0.15s ease; }

/* Loading indicator shown while a swiped/clicked next photo is fetching. */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    z-index: 2;
    animation: lightbox-spin 0.8s linear infinite;
}
@keyframes lightbox-spin { to { transform: rotate(360deg); } }
.lightbox-loading .lightbox-spinner { display: block; }
.lightbox-loading .lightbox-img    { opacity: 0.35; }
.lightbox-loading .lightbox-faces  { display: none; }
/* No photo yet (first open, or reopened after closing): the empty stage has
   no size, so keep its buttons out of sight until the photo arrives. */
.lightbox-blank .lightbox-check,
.lightbox-blank .lightbox-kudos { visibility: hidden; }

/* Detected-face overlay: boxes are invisible until the photo is hovered,
   then each glows softly on its own hover and filters to that person. */
.lightbox-faces { position: absolute; inset: 0; pointer-events: none; }
.lightbox-face {
    position: absolute;
    border: 0px solid transparent;
    border-radius: 1000px;
    cursor: pointer;
    pointer-events: auto;
    background: rgba(59, 130, 246, 0);
    transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.lightbox-stage:hover .lightbox-face { border-color: rgba(255, 255, 255, 0.45); }
.lightbox-face:hover {
    background: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 0 0px rgba(255, 255, 255, 0.85), 0 0 24px 9px rgba(59, 130, 246, 0.3);
}

/* Selection toggle inside the lightbox — same look as the tile check, larger. */
.lightbox-check {
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    z-index: 3;
}
.lightbox-check.selected {
    background: var(--accent);
    border-color: #fff;
    color: #fff;
}

.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 24px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0));
    color: #ededed;
    pointer-events: none;
    font-size: 13px;
    text-align: center;
}
.lightbox-info:empty { display: none; }
/* Full info is taller and reaches over the photo: darker behind it. */
.lightbox-info.is-full {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.8) calc(100% - 40px), rgba(0, 0, 0, 0));
}
.lightbox-info-desc {
    color: #f5f5f5;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}
.lightbox-info-primary {
    color: #d4d4d4;
    margin-bottom: 6px;
    font-size: 13px;
}
.lightbox-info-primary i { color: #a1a1a1; margin-right: 5px; }
.lightbox-info-sep { color: #525252; margin: 0 10px; }
/* Info line: main camera settings and up to 4 texts in a row that scrolls
   sideways when it doesn't fit (ends fade while there's more), then the
   full-info toggle, outside the row so it's always in view. As wide as its
   content, so the sides still let clicks through to close the lightbox. */
.lightbox-info-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.lightbox-info-line .lightbox-info-row { margin: 0; min-width: 0; flex: 0 1 auto; }
.lightbox-info-row {
    --fade-start: 0px;
    --fade-end: 0px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    pointer-events: auto;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
            mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
}
.lightbox-info-row::-webkit-scrollbar { display: none; }
.lightbox-info-row.fade-start { --fade-start: 32px; }
.lightbox-info-row.fade-end { --fade-end: 32px; }
.lightbox-info-row > * { flex: 0 0 auto; white-space: nowrap; }
.lightbox-info-exif { margin-right: 8px; color: #a1a1a1; font-size: 12px; }
.lightbox-info-exif i { margin-right: 5px; color: #737373; }
.lightbox-info-toggle {
    flex: 0 0 auto;
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 3px 4px;
    color: #a1a1a1;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
}
.lightbox-info-toggle:hover { color: #fff; }
.lightbox-info-toggle i { margin-right: 5px; }
/* Full info: camera data, texts and tags, each wrapping onto more lines;
   scrolls when taller than 40% of the screen. */
.lightbox-info-full {
    max-width: 960px;
    max-height: 40vh;
    overflow-y: auto;
    margin: 0 auto 8px;
    pointer-events: auto;
    scrollbar-width: thin;
}
.lightbox-info-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.lightbox-info-wrap + .lightbox-info-wrap { margin-top: 8px; }
.lightbox-info-none { color: #a1a1a1; font-size: 12px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    font-size: 28px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }

/* ─── Selection bar (gallery) ──────────────────────────────────────────────── */

.selection-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 50;
}

/* ─── OCR search bar ────────────────────────────────────────────────────── */

.gallery-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.gallery-tools .btn { white-space: nowrap; flex-shrink: 0; }
.ocr-search-wrap {
    position: relative;
    width: 100%;
}
.ocr-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}
.ocr-search-input {
    padding-left: 34px;
}
.ocr-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 60;
    display: none;
}
.ocr-suggest li {
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}
.ocr-suggest li:hover,
.ocr-suggest li.active { background: var(--accent-light); color: var(--accent); }

.filter-status {
    margin: -8px 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── People row (event gallery) ────────────────────────────────────────── */

.people-row {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.people-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.people-count {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
}
.people-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.person-chip {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    line-height: 0;
}
.person-chip-photo {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-repeat: no-repeat;
    background-color: var(--bg-input);
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.1s;
}
.person-chip:hover .person-chip-photo { transform: scale(1.05); }
.person-chip.active .person-chip-photo { border-color: var(--accent); }

/* People panel: only the 10 most common faces by default; "Show all" expands
   the panel to full content width with a wrapping grid of every face. */
.people-row .person-chip.is-overflow { display: none; }
.people-row.people-expanded .person-chip.is-overflow { display: inline-block; }
.people-rows-inline > .people-row.people-expanded { flex-basis: 100%; }
.people-row.people-expanded .people-list {
    flex-wrap: wrap;
    overflow-x: visible;
}
.people-show-all {
    margin-left: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    vertical-align: middle;
}
.people-show-all:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* While a person is selected, only their chip stays in the People panel. */
.people-row.people-filtered .person-chip:not(.active) { display: none; }
.people-row.people-filtered .person-chip.active.is-overflow { display: inline-block; }
.people-row.people-filtered .people-show-all { display: none; }

/* ─── Timeline histogram filter ──────────────────────────────────────────── */

.timeline-histogram {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}
.timeline-day {
    flex-basis: 0;
    flex-shrink: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.timeline-day-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 64px;
}
/* Multi-day timelines add a per-day band row below the bars; shorten the bars so
   the extra row doesn't make the timeline (and the stretched sibling boxes) taller. */
.timeline-histogram.has-days .timeline-day-bars { height: 44px; }
.timeline-bar {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}
.timeline-bar-fill {
    width: 100%;
    background: var(--accent-light);
    border-radius: 2px 2px 0 0;
    transition: background 0.12s ease;
}
.timeline-bar:hover .timeline-bar-fill { background: var(--accent); }
.timeline-bar.is-active .timeline-bar-fill { background: var(--accent-dark); }

/* Per-day band under the histogram for multi-day events. */
.timeline-day-band {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}
.timeline-day-tick {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-light);
    transition: background 0.12s ease;
}
.timeline-day-label {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.2;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.12s ease;
}
.timeline-day-band:hover .timeline-day-tick { background: var(--accent); }
.timeline-day-band:hover .timeline-day-label { color: var(--text-secondary); }
.timeline-day-band.is-active .timeline-day-tick { background: var(--accent-dark); }
.timeline-day-band.is-active .timeline-day-label { color: var(--text-primary); font-weight: 600; }

.timeline-clear {
    margin-left: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    vertical-align: middle;
}
.timeline-clear:hover { color: var(--text-primary); border-color: var(--text-muted); }
.timeline-clear i { margin-right: 3px; font-size: 10px; }

.timeline-selection {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle;
}

.person-chip-fallback {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 22px;
    background: var(--bg-secondary) !important;
}

.people-rows-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 18px;
}
.people-rows-inline > .people-row {
    flex: 1 1 320px;
    min-width: 0;
    margin-bottom: 0;
}
/* Photographers panel hugs its chip count instead of stretching. */
.people-rows-inline > .photographers-row {
    flex: 0 0 auto;
    margin-top: 0;
}
.photographers-row .people-list { flex-wrap: wrap; }

/* Timeline panel: same card chrome as Photographers/People, max 400px wide. */
.people-rows-inline > .timeline-row {
    flex: 0 0 250px;
    max-width: 250px;
}

/* Search panel: same card chrome; matches sibling panel height, bounded width. */
.people-rows-inline > .search-row {
    flex: 0 1 280px;
    max-width: 340px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}
/* Center the input in the leftover space below the title. */
.people-rows-inline > .search-row .ocr-search-wrap { margin: auto 0; }
.filter-title {
    font-size: 26px;
    color: var(--text-primary);
    margin: 8px 0 18px;
    letter-spacing: 0;
    font-weight: 600;
}

.avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--bg-secondary) center/cover no-repeat;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex: 0 0 auto;
}
/* Account page: title + contents in a sticky left column, cards on the right
   (narrower than the full container). Phones: contents is a row of links. */
.account-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 880px);
    gap: 36px;
    align-items: start;
}
.account-toc { position: sticky; top: 84px; }
.account-toc .page-title { margin-bottom: 18px; }
.account-toc-nav { display: flex; flex-direction: column; gap: 2px; }
.account-toc-link {
    padding: 7px 12px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    font-size: 15px;
    text-decoration: none;
}
.account-toc-link:hover { color: var(--text-primary); background: var(--bg-secondary); }
.account-toc-link.is-active { color: var(--text-primary); border-left-color: var(--accent); background: var(--bg-secondary); }
.account-main > .card { scroll-margin-top: 84px; }
@media (max-width: 900px) {
    .account-layout { display: block; }
    .account-toc { position: static; margin-bottom: 18px; }
    .account-toc .page-title { margin-bottom: 12px; }
    .account-toc-nav {
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .account-toc-nav::-webkit-scrollbar { display: none; }
    .account-toc-link {
        flex: 0 0 auto;
        padding: 6px 12px;
        border: 1px solid var(--border);
        font-size: 13px;
        white-space: nowrap;
    }
    .account-toc-link.is-active { border-color: var(--accent); }
}
.account-storage {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
}
.account-storage > i { color: var(--text-muted); }
.account-storage strong { color: var(--text-primary); }
.account-storage-bar { flex: 1; min-width: 120px; }
.avatar-preview--sm {
    width: 56px;
    height: 56px;
    font-size: 20px;
}

.th-avatar { width: 56px; }
.td-avatar { width: 56px; padding-right: 0; }
.user-avatar-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input) center/cover no-repeat;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}
.user-avatar-cell--fallback { background-color: var(--bg-secondary); }
.person-chip-count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-info);
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

/* ─── Lightbox OCR chips ─────────────────────────────────────────────────── */

/* Texts on the photo (entered and detected): pills like the automatic tags,
   in a blue tint. */
.ocr-chip {
    background: rgba(59, 130, 246, 0.16);
    color: #d6e6ff;
    border: 1px solid rgba(147, 197, 253, 0.25);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    line-height: 1.4;
}

/* Automatic tags: neutral pills (OCR text chips are blue). */
.tag-chip {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    font-family: inherit;
    line-height: 1.4;
}
button.tag-chip {
    cursor: pointer;
    pointer-events: auto; /* .lightbox-info lets clicks fall through to close */
    transition: background 0.15s, border-color 0.15s;
}
button.tag-chip:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.ocr-suggest .suggest-tag i { margin-right: 7px; opacity: 0.55; font-size: 11px; }

/* Photographer's × on a tag chip: the chip and × read as one pill. */
.tag-chip-group { display: inline-flex; }
.tag-chip-group .tag-chip { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.tag-chip-x {
    pointer-events: auto;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 999px 999px 0;
    padding: 0 9px 0 7px;
    font-size: 14px;
    line-height: 1;
    font-family: inherit;
}
.tag-chip-x:hover { background: rgba(220, 38, 38, 0.75); border-color: rgba(220, 38, 38, 0.9); color: #fff; }

.tag-menu {
    position: fixed;
    z-index: 5;
    min-width: 220px;
    max-width: 280px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.tag-menu-title { padding: 6px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.tag-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: none;
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.tag-menu button:hover { background: var(--bg-primary); }
.tag-menu button small { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); }

/* ─── Site search (home page box + /search) ─────────────────────────────── */

.home-search { padding-bottom: 0; }
.home-search-hint { margin-top: 10px; font-size: 13px; color: var(--text-muted); }

.site-search { display: flex; gap: 8px; align-items: stretch; }
.site-search-field { position: relative; flex: 1; min-width: 0; }
.site-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.site-search-input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
}
.site-search-input:focus, .site-search-date:focus-within { outline: none; border-color: var(--accent); }
.site-search-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
}
.site-search-date input {
    background: none;
    border: none;
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
}
.site-search-date input:focus { outline: none; }
.site-search-submit { padding: 0 22px; font-size: 15px; }

.site-search-suggest {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    padding: 4px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 420px;
    overflow-y: auto;
    z-index: 60;
}
.site-search-group {
    padding: 8px 14px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.site-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
}
.site-search-item:hover, .site-search-item.active { background: var(--accent-light); color: var(--accent); }
.site-search-item-icon { width: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.site-search-avatar {
    width: 24px;
    height: 24px;
    flex: none;
    border-radius: 50%;
    background: var(--bg-input) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
}
.site-search-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }

@media (max-width: 700px) {
    .site-search { flex-wrap: wrap; }
    .site-search-field { flex-basis: 100%; }
    .site-search-date { flex: 1; height: 44px; }
    .site-search-submit { height: 44px; }
}

.search-heading { margin: 32px 0 14px; font-size: 20px; }
.search-count { font-size: 14px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.search-empty { margin-top: 24px; }

.search-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
@media (max-width: 700px) { .search-groups { grid-template-columns: 1fr; } }
.search-group { background: var(--bg-card); border: 1px solid var(--border); padding: 12px; }
.search-group-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--text-primary);
    text-decoration: none;
}
.search-group-name { font-size: 15px; font-weight: 600; }
.search-group-meta { font-size: 12px; color: var(--text-muted); }
.search-group-open { margin-left: auto; font-size: 12px; color: var(--accent); }
.search-group-head:hover .search-group-name { color: var(--accent); }
.search-group-photos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.search-photo { aspect-ratio: 1 / 1; background: var(--bg-primary) center/cover no-repeat; transition: opacity 0.15s; }
.search-photo:hover { opacity: 0.85; }

.search-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.search-tag {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
}
.search-tag span { margin-left: 4px; font-size: 12px; color: var(--text-muted); }
.search-tag:hover { border-color: var(--accent); color: var(--accent); }

/* Account → Hidden tags */
.hidden-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hidden-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 11px;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    font-size: 13px;
}
.hidden-tag-remove {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    padding: 0 5px;
    border-radius: 50%;
    cursor: pointer;
}
.hidden-tag-remove:hover { color: #fff; background: rgba(220, 38, 38, 0.75); }
.hidden-tags-empty { font-size: 13px; color: var(--text-muted); }
.selection-bar-count { font-size: 14px; font-weight: 500; }

/* ─── Order prints modal ─────────────────────────────────────────────────── */

.prints-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 20px;
}
.prints-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 720px;
    padding: 28px 28px 22px;
    position: relative;
}
.prints-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 18px;
}
.prints-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}
.prints-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    position: relative;
}
.prints-item-photo-wrap {
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.prints-item-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.prints-item-info {
    flex: 1 1 auto;
    min-width: 200px;
}
.prints-item-meta {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}
.prints-item-controls {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.prints-item-option { max-width: 280px; }
.prints-item-qty { max-width: 90px; }
.prints-item-line-total {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.prints-item-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    align-self: flex-start;
    transition: color 0.15s;
}
.prints-item-remove:hover { color: #dc2626; }
.prints-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.prints-total {
    margin-right: auto;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .prints-item { flex-wrap: wrap; }
}

/* ─── OCR (per-photo text) editor modal ──────────────────────────────────── */

.ocr-overlay { padding: 20px; }
.ocr-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 1100px;
    max-width: 100%;
    height: 80vh;
    padding: 24px 24px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.ocr-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}
.ocr-modal-photo {
    position: relative;
    background: #0b0b0b;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
}
.ocr-modal-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
/* While the next photo loads, the old one is hidden (never shown as if it were
   the new one) and a spinner appears if it takes a moment. */
.ocr-modal-photo.is-loading img { visibility: hidden; }
.ocr-photo-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}
.ocr-modal-photo.is-loading .ocr-photo-spinner {
    opacity: 1;
    transition: opacity 0.15s 0.15s;
    animation: lightbox-spin 0.8s linear infinite;
}
/* Previous / next photo in the gallery (also ← → keys and swiping). */
.ocr-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.ocr-nav:hover { background: rgba(0, 0, 0, 0.75); }
.ocr-prev { left: 10px; }
.ocr-next { right: 10px; }
.ocr-photo-count {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}
.ocr-photo-count:empty { display: none; }
.ocr-modal-side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.ocr-side-title { margin-bottom: 8px; }
.ocr-side-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
/* A field with its buttons on one row; the (i) hint button is for phones only. */
.ocr-field { display: flex; align-items: center; gap: 6px; }
.ocr-field .form-input { flex: 1; min-width: 0; }
.ocr-field .help-btn { display: none; flex: none; width: 30px; height: 30px; font-size: 16px; margin: 0; }
.ocr-desc-field { margin-bottom: 18px; }
.ocr-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.ocr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ocr-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ocr-row-input {
    position: relative;
    flex: 1;
    min-width: 0;
    display: block;
}
.ocr-row-input .ocr-row-text { width: 100%; }
.ocr-row-input .ocr-row-text.has-badge { padding-right: 28px; }
.ocr-row-badge {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}
.ocr-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 0;
}

@media (max-width: 760px) {
    .ocr-modal { height: 90vh; }
    .ocr-modal-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
    .ocr-modal-side { max-height: 35vh; } /* the photo takes the rest */
    .ocr-side-title, .ocr-side-hint { display: none; }
    .ocr-field .help-btn { display: inline-flex; }
    .ocr-desc-field { margin-bottom: 10px; }
}

/* ─── Buy modal ─────────────────────────────────────────────────────────── */

.buy-overlay { align-items: center; padding: 20px; }
.buy-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    position: relative;
}
.buy-subtitle { color: var(--text-muted); font-size: 13px; margin: 0 0 8px; }
.buy-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-input);
    cursor: pointer;
}
.buy-method input { margin: 0; }
.buy-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 14px;
    margin: 0;
    font-size: 14px;
}
.buy-details dt { color: var(--text-muted); padding: 4px 0; }
.buy-details dd { margin: 0; padding: 4px 0; word-break: break-all; }
.buy-details dd code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
}
.buy-copy { margin-left: 6px; }

/* Multi-photographer checkout: per-photographer breakdown + order list */
.buy-group,
.buy-multi-order {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-input);
    padding: 10px 12px;
    margin-top: 10px;
}
.buy-group-line { font-size: 14px; }
.buy-group-note { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.buy-group-methods { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.buy-group-method { font-size: 13px; color: var(--text-muted); }
.buy-method-inline { padding: 6px 10px; font-size: 13px; }
.buy-multi-order .buy-details { margin-top: 8px; font-size: 13px; }
.buy-multi-order .btn { margin-top: 8px; }
.buy-group-disabled { opacity: 0.7; }
#buy-stage-multi #buy-multi-list { max-height: 60vh; overflow-y: auto; }

/* ─── Orders inbox / detail ─────────────────────────────────────────────── */

.orders-list { display: flex; flex-direction: column; gap: 8px; }
.order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-card);
    flex-wrap: wrap;
}
.order-row-main { flex: 1; min-width: 240px; }
.order-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.order-row-email { font-size: 14px; }
.order-row-amount { font-weight: 600; }
.order-row-meta { font-size: 12px; color: var(--text-muted); }
.order-row-meta code {
    background: var(--bg-input);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
}
.order-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.order-row-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.order-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    flex: 0 0 auto;
}
.order-thumb-more { font-weight: 600; }

.order-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-info);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.order-status-pending   { background: #fef3c7; color: #92400e; }
.order-status-fulfilled { background: #d1fae5; color: #065f46; }
.order-status-cancelled { background: #fee2e2; color: #991b1b; }

.order-kind-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-info);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.order-row-prints {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
}

.order-awaiting {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.orders-filter.is-active {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .nav-links-desktop { display: none; }
    .nav-hamburger { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .gallery-tools { flex-wrap: wrap; }
    .panel { width: 100%; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; }
}

@media (max-width: 600px) {
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

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