/* =====================================================
   PSiDEA EXPORT — Clean Blue Professional Theme
   ===================================================== */

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
    color: #0F172A;
    background: #F8FAFC;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #2563EB; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: #0F172A; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.875rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }

/* CSS variables */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --primary-50: #EFF6FF;
    --secondary: #0EA5E9;
    --accent: #3B82F6;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #0F172A;
    --muted: #64748B;
    --border: #E2E8F0;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.05);
    --shadow: 0 4px 12px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
    --shadow-lg: 0 20px 40px -12px rgba(37,99,235,.18), 0 8px 24px rgba(15,23,42,.06);
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.container.narrow { max-width: 640px; }
.main { min-height: calc(100vh - 200px); padding: 24px 0 80px; }

/* ---------- Topbar ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(10px);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-weight: 700;
    display: grid; place-items: center;
    border-radius: 8px;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
}
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.brand-name em { color: var(--primary); font-style: normal; font-weight: 600; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--muted); font-weight: 500; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav-user { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.avatar {
    width: 30px; height: 30px;
    background: var(--primary-light); color: var(--primary-dark);
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700;
}

/* ---------- Footer ---------- */
.sitefoot { background: var(--surface); border-top: 1px solid var(--border); padding: 20px 0; margin-top: 60px; }
.sitefoot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.sitefoot a { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s ease;
    text-decoration: none;
    line-height: 1;
    font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #F1F5F9; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon {
    display: grid; place-items: center;
    width: 28px; height: 28px;
    background: rgba(15,23,42,.6); color: white;
    border-radius: 50%; border: none; cursor: pointer;
    font-size: 1rem; line-height: 1;
}
.btn-icon:hover { background: var(--danger); }
.btn-glass {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: white;
    backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255,255,255,.25); color: white; }
.btn-white {
    background: white;
    color: var(--primary-dark);
    font-weight: 700;
}
.btn-white:hover { background: rgba(255,255,255,.92); color: var(--primary-dark); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-compact { gap: 10px; }
.form label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .9rem; font-weight: 500; color: var(--text);
}
.form label.checkbox {
    flex-direction: row; align-items: center; font-weight: 400;
}
.form label small { color: var(--muted); font-weight: 400; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="date"],
.form input[type="search"],
.form textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.form input[readonly] { background: #F1F5F9; cursor: copy; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.req { color: var(--danger); }

/* Card form */
.card-form {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* ---------- Auth card ---------- */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin: 20px auto;
}
.auth-card h1 { margin-bottom: 6px; }
.auth-foot { text-align: center; margin: 18px 0 0; color: var(--muted); }

/* ---------- Hero (landing) ---------- */
.hero {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, #EFF6FF 0%, #F8FAFC 100%);
    text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.eyebrow {
    display: inline-block;
    background: var(--primary-light); color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .82rem; font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
.hero h1 .grad {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 580px; margin: 12px auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-meta { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; color: var(--muted); font-size: .9rem; }
.hero-meta li::before { content: "✓ "; color: var(--primary); font-weight: bold; }

/* ---------- Section title ---------- */
.section-title { font-size: 1.5rem; margin-top: 40px; margin-bottom: 16px; }

/* ---------- Page header ---------- */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 16px;
    margin-bottom: 28px; padding-top: 8px;
}
.page-header h1 { margin: 0; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .92rem; }
.back-link { color: var(--muted); font-size: .9rem; }
.back-link:hover { color: var(--primary); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.features { padding: 60px 0; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-icon { font-size: 2rem; margin-bottom: 10px; }

/* ---------- Stats ---------- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--muted); font-size: .9rem; }

/* ---------- Empty state ---------- */
.empty-state {
    background: var(--surface);
    border: 2px dashed var(--border);
    padding: 50px 20px;
    text-align: center;
    border-radius: var(--radius);
    color: var(--muted);
}
.empty-state.small { padding: 30px 20px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 10px; }
.empty-state .btn { margin-top: 10px; }

/* ---------- Event card (dashboard) ---------- */
.events-grid { margin-bottom: 60px; }
.event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all .15s;
}
.event-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.event-card-link { display: block; color: var(--text); }
.event-card-link:hover { text-decoration: none; }
.event-card-cover {
    aspect-ratio: 4/3;
    background: var(--primary-50);
    overflow: hidden;
}
.event-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.event-card-placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-light));
}
.event-card-body { padding: 14px 16px; }
.event-card-body h3 { margin: 0 0 6px; }
.event-card-meta {
    display: flex; flex-wrap: wrap; gap: 8px 14px;
    color: var(--muted); font-size: .85rem;
}
.event-card-meta .lock { color: var(--warning); }

/* ---------- Event detail layout ---------- */
.event-grid-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}
@media (max-width: 900px) {
    .event-grid-layout { grid-template-columns: 1fr; }
}

.event-side .side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.side-card h3 { font-size: 1rem; margin-bottom: 12px; }
.side-card.danger { border-color: #FECACA; background: #FEF2F2; }

.qr-box {
    background: white;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 12px;
}
.qr-box img { margin: 0 auto; max-width: 100%; }
.share-row { display: flex; gap: 6px; margin-bottom: 8px; }
.share-row input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; }

/* ---------- Upload zone ---------- */
.upload-zone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    margin-bottom: 24px;
    text-align: center;
    transition: all .15s;
    cursor: pointer;
}
.upload-zone.drag,
.upload-zone:hover { border-color: var(--primary); background: var(--primary-50); }
.upload-zone-inner > * { margin: 6px auto; }
.upload-icon { font-size: 2.5rem; color: var(--primary); }
.upload-progress { margin-top: 16px; text-align: left; }
.progress-info { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.progress-bar {
    background: var(--border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.progress-bar > div {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    height: 100%;
    width: 0;
    transition: width .2s;
}

/* ---------- Flash messages ---------- */
.flashes { padding-top: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: .92rem;
    border: 1px solid;
}
.flash-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.flash-error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.flash-info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.flash-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }


/* =====================================================
   GALLERY V2 — Masonry + Cover + Lightbox + Favorites
   ===================================================== */

body.gallery-page { background: #FAFBFC; }

/* ---------- Cover / Hero ---------- */
.gallery-cover {
    position: relative;
    min-height: 360px;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-dark);
    color: white;
    overflow: hidden;
}
.gallery-cover.no-cover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
}
.cover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(15,23,42,.25) 0%,
        rgba(15,23,42,.55) 60%,
        rgba(15,23,42,.85) 100%);
}
.cover-content {
    position: relative;
    z-index: 2;
    padding: 80px 20px 50px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp .6s ease-out;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cover-eyebrow {
    display: inline-block;
    font-size: .72rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
    color: white;
    font-weight: 500;
}
.cover-content h1 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin: 0 0 12px;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.cover-meta {
    color: rgba(255,255,255,.85);
    font-size: 1.05rem;
    margin: 0 0 28px;
    display: flex;
    gap: 8px 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.cover-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cover-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Toolbar ---------- */
.gallery-toolbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(250,251,252,.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.toolbar-inner {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}
.toolbar-search {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 380px;
}
.toolbar-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .95rem;
    background: white;
    transition: all .15s;
    font-family: inherit;
    color: var(--text);
}
.toolbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
.toolbar-search::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .9rem;
    opacity: .6;
    pointer-events: none;
}
.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.chip {
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    color: var(--muted);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.chip-count {
    background: rgba(255,255,255,.25);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}
.chip:not(.active) .chip-count {
    background: var(--border);
    color: var(--muted);
}
select.chip {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ---------- Masonry grid (CSS columns) ---------- */
.masonry-grid {
    column-count: 4;
    column-gap: 12px;
    padding: 28px 0 60px;
}
@media (max-width: 1100px) { .masonry-grid { column-count: 3; } }
@media (max-width: 720px)  { .masonry-grid { column-count: 2; column-gap: 8px; } }
@media (max-width: 380px)  { .masonry-grid { column-count: 1; } }

.masonry-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 12px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--primary-50);
    cursor: zoom-in;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
    transition: transform .25s ease, box-shadow .25s ease;
    display: block;
}
.masonry-item.hidden { display: none; }
.masonry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15,23,42,.12);
}
.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .5s ease;
}
.masonry-item:hover img { transform: scale(1.03); }

/* Item heart button */
.item-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    opacity: 0;
    transform: scale(.8);
    transition: opacity .2s, transform .2s, background .15s;
    padding: 0;
    line-height: 1;
}
.masonry-item:hover .item-fav,
.masonry-item.is-fav .item-fav {
    opacity: 1;
    transform: scale(1);
}
.item-fav:hover {
    background: rgba(239,68,68,.85);
}
.masonry-item.is-fav .item-fav {
    background: #EF4444;
    color: white;
}
.item-fav::after { content: "♡"; }
.masonry-item.is-fav .item-fav::after { content: "❤"; }

/* Item action buttons (download, etc.) */
.item-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, rgba(15,23,42,.7));
    padding: 30px 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.masonry-item:hover .item-actions {
    opacity: 1;
    pointer-events: auto;
}
.item-action {
    background: rgba(255,255,255,.92);
    color: var(--text);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
    font-size: .9rem;
    transition: all .15s;
    padding: 0;
}
.item-action:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    text-decoration: none;
}

/* Filter empty state */
.filter-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.filter-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: .5;
}

/* Gallery description card */
.gallery-desc-card {
    margin: 28px auto 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 24px;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
    max-width: 720px;
    text-align: center;
}

/* Event admin: bulk select toolbar */
.event-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 10px;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Lightbox v2 ---------- */
.lb2 {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: rgba(8,10,15,.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    animation: lb2In .25s ease-out;
}
.lb2[hidden] { display: none; }
@keyframes lb2In {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.lb2-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    z-index: 5;
    gap: 12px;
}
.lb2-counter {
    font-size: .92rem;
    color: rgba(255,255,255,.7);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.lb2-title {
    font-size: .95rem;
    color: rgba(255,255,255,.85);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
    text-align: center;
}
.lb2-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.lb2-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}
.lb2-btn:hover {
    background: rgba(255,255,255,.18);
    transform: scale(1.06);
    text-decoration: none;
    color: white;
}
.lb2-btn.is-fav {
    background: #EF4444;
    border-color: #EF4444;
}
.lb2-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 70px;
}
@media (max-width: 700px) {
    .lb2-stage { padding: 0 12px; }
}
.lb2-img {
    max-width: 100%;
    max-height: calc(100vh - 220px);
    object-fit: contain;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity .25s;
}
.lb2-img.loading { opacity: .3; }
.lb2-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.6rem;
    transition: all .15s;
    padding: 0;
    line-height: 1;
}
.lb2-nav:hover {
    background: rgba(255,255,255,.2);
    transform: translateY(-50%) scale(1.06);
}
.lb2-prev { left: 16px; }
.lb2-next { right: 16px; }
@media (max-width: 700px) {
    .lb2-nav { width: 42px; height: 42px; }
    .lb2-prev { left: 4px; }
    .lb2-next { right: 4px; }
}
.lb2-thumbs {
    height: 80px;
    background: rgba(0,0,0,.35);
    border-top: 1px solid rgba(255,255,255,.06);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 12px;
}
.lb2-thumb {
    display: inline-block;
    width: 56px;
    height: 56px;
    margin-right: 6px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: .55;
    transition: all .15s;
    border: 2px solid transparent;
    vertical-align: top;
    padding: 0;
    background: transparent;
}
.lb2-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lb2-thumb:hover { opacity: .9; }
.lb2-thumb.active {
    opacity: 1;
    border-color: var(--secondary);
    transform: scale(1.05);
}
.lb2-spinner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}
.lb2-spinner.show { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .topbar-inner { padding: 10px 16px; }
    .topnav a:not(.btn) { display: none; }
    .topnav-user { display: none; }
    .hero { padding: 36px 0 24px; }
    .auth-card { padding: 22px; }
    .stat-num { font-size: 1.5rem; }
    .gallery-toolbar { padding: 10px 0; }
    .toolbar-inner { gap: 8px; }
    .toolbar-search { max-width: 100%; }
    .cover-content { padding: 60px 20px 36px; }
}
