:root {
    --bg: #f3eee6;
    --bg-deep: #e7dfd2;
    --cream: #fffaf3;
    --ink: #1b1714;
    --muted: #6b6259;
    --line: rgba(27, 23, 20, 0.12);
    --accent: #b85c38;
    --accent-soft: #d08a68;
    --teal: #2f4f4a;
    --teal-deep: #1f3532;
    --shadow: 0 24px 60px rgba(27, 23, 20, 0.12);
    --radius: 28px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(27, 23, 20, 0.28) transparent;
}

html::-webkit-scrollbar,
.modal-card::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb {
    background: rgba(27, 23, 20, 0.28);
    border-radius: 999px;
}

html::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track {
    background: transparent;
}

body {
    font-family: Outfit, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 500px at 90% -10%, rgba(184, 92, 56, 0.12), transparent 55%),
        radial-gradient(900px 400px at 0% 20%, rgba(47, 79, 74, 0.08), transparent 50%),
        var(--bg);
    line-height: 1.55;
    min-height: 100vh;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

body.viewer-open {
    overflow: hidden;
}

h1, h2, h3, .logo-text, .logo-mark {
    font-family: Fraunces, Georgia, serif;
    font-optical-sizing: auto;
    letter-spacing: -0.03em;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
}

.navbar {
    position: sticky;
    top: 14px;
    z-index: 40;
    margin: 14px auto 0;
    max-width: 1120px;
    padding: 0 16px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem 0.7rem 0.85rem;
    background: rgba(255, 250, 243, 0.78);
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(27, 23, 20, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    font-weight: 700;
}

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--teal);
    color: var(--cream);
    font-size: 0.95rem;
}

.logo-text {
    font-size: 1.15rem;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    border-radius: 50%;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-toggle.open span {
    background: transparent;
}

.nav-toggle.open span::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.open span::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-menu {
    display: flex;
    gap: 0.35rem;
}

.nav-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    color: var(--muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--ink);
    background: rgba(184, 92, 56, 0.1);
}

.landing {
    padding-bottom: 0;
}

.showcase-band {
    width: 100%;
    margin: 12px 0 0;
    padding: 0 16px 3.2rem;
}

.showcase-stand.has-preview,
.moment-card.has-preview {
    background-size: cover;
    background-position: center 10%;
}

.showcase-stand {
    position: relative;
    display: block;
    width: 100%;
    height: min(88vh, 980px);
    border: 0;
    padding: 0;
    border-radius: 10px;
    background: var(--teal-deep);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    color: inherit;
}

.showcase-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 5rem 2rem 1.6rem;
    background: linear-gradient(180deg, transparent 0%, rgba(18, 14, 12, 0.78) 58%);
    color: white;
    pointer-events: none;
}

.showcase-overlay .hero-actions,
.showcase-overlay a {
    pointer-events: auto;
}

.showcase-overlay h1 {
    font-size: clamp(2.2rem, 5.4vw, 4.4rem);
    line-height: 0.96;
    margin: 0.45rem 0 0.7rem;
    max-width: 16ch;
}

.showcase-overlay .lede {
    color: rgba(255, 250, 243, 0.82);
    max-width: 34rem;
}

.showcase-overlay .eyebrow {
    color: #f3c2ab;
}

.showcase-overlay .hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin: 0.2rem 0 0;
    color: rgba(255, 250, 243, 0.88);
    font-size: 0.95rem;
}

.showcase-overlay .hero-meta span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0 1rem;
    border-right: 1px solid rgba(255, 250, 243, 0.28);
    line-height: 1.2;
    white-space: nowrap;
}

.showcase-overlay .hero-meta span:first-child {
    padding-left: 0;
}

.showcase-overlay .hero-meta span:last-child {
    border-right: 0;
    padding-right: 0;
}

.showcase-overlay .hero-meta strong {
    color: white;
    font-size: inherit;
    font-weight: 700;
    line-height: inherit;
}

.lede,
.section-kicker,
.empty-copy {
    color: var(--muted);
    max-width: 38rem;
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 1.8rem 0 1.6rem;
}

.btn-primary,
.btn-ghost,
.cta-button,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
    padding: 0.9rem 1.35rem;
    font-family: inherit;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-primary,
.cta-button {
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 24px rgba(184, 92, 56, 0.28);
}

.btn-ghost,
.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-ghost.btn-ghost-light {
    color: var(--ink);
    background: rgba(255, 250, 243, 0.94);
    border-color: rgba(255, 250, 243, 0.94);
    box-shadow: 0 10px 22px rgba(18, 14, 12, 0.22);
}

.btn-primary:hover,
.cta-button:hover {
    transform: translateY(-2px);
    background: #a34d2d;
}

.hero-meta {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-meta strong {
    color: var(--ink);
    font-size: 1.15rem;
}

.hero-slide,
.moment-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
    opacity: 0;
    transition: opacity 0.7s ease;
}

.hero-slide.is-active,
.moment-slide.is-active {
    opacity: 1;
}

.moments-section,
.features {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 5rem;
}

.section-head {
    margin-bottom: 1.8rem;
}

.section-head h2,
.gallery-hero h1,
.auth-card h1,
.admin-card h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
    margin: 0.45rem 0 0.6rem;
}

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

.moments-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}

.moments-grid.count-3 {
    grid-template-columns: repeat(3, 1fr);
}

.moments-grid.count-4 {
    grid-template-columns: 1fr 1fr;
}

.moment-card {
    position: relative;
    display: block;
    overflow: hidden;
    border: 0;
    padding: 0;
    border-radius: 10px;
    text-decoration: none;
    min-height: 280px;
    background: var(--teal-deep);
    box-shadow: var(--shadow);
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
    width: 100%;
}

.moments-grid.count-1 .moment-card {
    min-height: min(58vh, 560px);
}

.moments-grid.count-2 .moment-card,
.moments-grid.count-3 .moment-card,
.moments-grid.count-4 .moment-card {
    min-height: 360px;
}

.moment-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
    display: block;
    min-height: 240px;
}

.moment-card .card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.3rem;
    background: linear-gradient(180deg, transparent, rgba(27, 23, 20, 0.78));
    color: white;
}

.moment-card .eyebrow {
    color: #f3c2ab;
    margin-bottom: 0.25rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding-top: 2.2rem;
    padding-bottom: 2.2rem;
}

.feature {
    padding: 0.4rem 1.4rem;
}

.feature + .feature {
    border-left: 1px solid var(--line);
}

.feature-index {
    font-family: Fraunces, serif;
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
}

.feature p:last-child {
    color: var(--muted);
    margin-top: 0.45rem;
}

.footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 20px 3rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
}

.gallery-page {
    padding-bottom: 4rem;
}

.gallery-page.select-mode,
.admin-page.select-mode {
    padding-bottom: 7rem;
}

.gallery-hero {
    max-width: 1280px;
    margin: 2rem auto 1.5rem;
    padding: 0 20px;
}

.gallery-count {
    color: var(--muted);
    margin-bottom: 1.1rem;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.select-bar {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: none;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    min-height: 48px;
    height: auto;
    padding: 6px 8px;
    background: var(--ink);
    color: white;
    border-radius: 22px;
    box-shadow: var(--shadow);
    max-width: calc(100vw - 32px);
    width: auto;
    box-sizing: border-box;
}

.select-bar > span {
    white-space: nowrap;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0 0.4rem;
}

.select-bar .btn-ghost,
.select-bar .danger,
.select-bar .btn-primary,
.fab-select {
    height: 40px;
    min-height: 40px;
    padding: 0 1.05rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.select-mode .fab-select {
    display: none;
}

.select-bar .btn-ghost {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.select-bar .danger,
button.danger {
    border: 1px solid transparent;
    background: #9b2c2c;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

.select-bar .btn-primary {
    padding: 0 1.05rem;
}

.select-mode .photo-checkbox {
    opacity: 1;
}

.select-mode .photo-item {
    outline: 2px solid transparent;
}

.select-mode .photo-item.is-selected {
    outline-color: var(--accent);
}

.chip,
.page-btn {
    border: 1px solid var(--line);
    background: var(--cream);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.chip.active,
.page-btn.active {
    background: var(--teal);
    color: white;
    border-color: var(--teal);
}

.gallery,
.studio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(52px, 7vw);
    grid-auto-flow: dense;
    gap: 8px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.studio-grid {
    padding: 0;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--bg-deep);
    grid-column: span var(--c, 3);
    grid-row: span var(--r, 4);
}

.photo-item.is-cover::after {
    content: 'Capa';
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: var(--accent);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.photo-item.skeleton {
    background: linear-gradient(90deg, var(--bg-deep) 20%, var(--cream) 50%, var(--bg-deep) 80%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

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

.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1.4rem 1rem 0.4rem;
    color: var(--muted);
    font-weight: 600;
}

.load-sentinel {
    height: 1px;
}

.gallery-loading.hidden {
    display: none;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gallery-more {
    display: flex;
    justify-content: center;
    margin: 1.6rem 0 4rem;
    padding: 0 20px;
}

.load-more:disabled {
    opacity: 0.6;
    cursor: wait;
}

.photo-item.has-preview {
    background-size: cover;
    background-position: center 10%;
}

.photo-item.has-preview::before {
    content: '';
    position: absolute;
    inset: -28px;
    background-image: inherit;
    background-size: cover;
    background-position: center 10%;
    filter: blur(22px);
    transform: scale(1.08);
    pointer-events: none;
}

.photo-item img,
.photo-item .photo-hi {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
    cursor: pointer;
    display: block;
}

.photo-item .photo-hi {
    opacity: 0;
    transition: opacity 0.45s ease;
}

.photo-item .photo-hi.is-ready {
    opacity: 1;
}

.photo-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    opacity: 0;
    pointer-events: none;
}

.select-mode .photo-checkbox {
    opacity: 1;
    pointer-events: auto;
    width: 26px;
    height: 26px;
}

.empty-state,
.auth-card,
.admin-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 2rem 0 5rem;
}

.page-ellipsis {
    color: var(--muted);
    padding: 0.55rem 0.3rem;
}

.btn-download {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 30;
    background: var(--ink);
    color: white;
    text-decoration: none;
    padding: 1rem 1.3rem;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.btn-download.hidden {
    display: none;
}

.fab-select {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 61;
    border: 0;
    background: var(--ink);
    color: white;
    box-shadow: var(--shadow);
    cursor: pointer;
    min-width: 118px;
    height: 48px;
    min-height: 48px;
    text-align: center;
    font-family: inherit;
}

.fab-select.is-active,
.select-mode .fab-select {
    background: var(--accent);
    bottom: max(16px, env(safe-area-inset-bottom));
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(27, 23, 20, 0.45);
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal-card {
    width: min(520px, 100%);
    max-height: min(82vh, 720px);
    overflow: auto;
    background: var(--cream);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.modal-head h2 {
    font-size: 1.5rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--bg);
    font-size: 1.4rem;
    cursor: pointer;
}

.upload-cat-hint {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0.45rem 0 0.8rem;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
}

.image-viewer.visible {
    visibility: visible;
}

.viewer-overlay {
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 10, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.viewer-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    display: grid;
    place-items: center;
    touch-action: none;
}

.viewer-image {
    grid-area: 1 / 1;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 36px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    transform-origin: center center;
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.viewer-image.is-active {
    opacity: 1;
    pointer-events: auto;
}

.viewer-image.is-preview {
    filter: blur(10px);
}

.viewer-loading {
    grid-area: 1 / 1;
    z-index: 3;
    display: none;
    place-items: center;
    align-content: center;
    gap: 0.7rem;
    pointer-events: none;
}

.image-viewer.is-loading .viewer-loading {
    display: grid;
}

.viewer-loading .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 250, 243, 0.18);
    border-top-color: #d08a68;
    border-radius: 50%;
    animation: pwspin 0.7s linear infinite;
}

.viewer-loading p {
    margin: 0;
    color: #fffaf3;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.viewer-toolbar {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(560px, calc(100vw - 24px));
    padding: 8px;
    background: rgba(20, 16, 14, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    backdrop-filter: blur(12px);
}

.viewer-download,
.viewer-action {
    flex: 1;
    text-decoration: none;
    text-align: center;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 0;
}

.viewer-download {
    background: var(--accent);
    color: white;
}

.viewer-action {
    background: rgba(255, 250, 243, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.viewer-menu {
    position: fixed;
    z-index: 10002;
    min-width: 210px;
    padding: 6px;
    background: rgba(20, 16, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.viewer-menu.hidden {
    display: none;
}

.viewer-menu button {
    background: transparent;
    color: white;
    border: 0;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.viewer-menu button:hover {
    background: rgba(255, 250, 243, 0.1);
}

.viewer-nav,
.viewer-close {
    background: rgba(255, 250, 243, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    cursor: pointer;
}

.viewer-nav {
    position: static;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    font-size: 1.7rem;
}

.viewer-close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
}

.viewer-info {
    position: fixed;
    left: 50%;
    top: max(18px, env(safe-area-inset-top));
    transform: translateX(-50%);
    color: white;
    background: rgba(255, 250, 243, 0.12);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    max-width: calc(100vw - 120px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-page {
    min-height: 100vh;
    padding-bottom: 4rem;
}

.auth-card {
    max-width: 460px;
    margin: 4rem auto 0;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.form-field span {
    font-weight: 600;
    font-size: 0.92rem;
}

.form-field input,
.form-field select {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    font: inherit;
    background: white;
}

.error {
    color: #9b2c2c;
    margin-bottom: 1rem;
}

.admin-page {
    background:
        radial-gradient(900px 420px at 100% 0%, rgba(184, 92, 56, 0.1), transparent 55%),
        var(--bg);
    min-height: 100vh;
    padding-bottom: 4rem;
}

.studio-top {
    position: sticky;
    top: 10px;
    z-index: 50;
    width: calc(100% - 32px);
    max-width: 1280px;
    margin: 12px auto 0;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255, 250, 243, 0.86);
    border: 1px solid var(--line);
    border-radius: 24px;
    backdrop-filter: blur(16px);
}

.studio-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.studio-hello {
    color: var(--muted);
    font-weight: 600;
    padding: 0 0.4rem;
}

.studio {
    max-width: 1280px;
    margin: 1.4rem auto 0;
    padding: 0 16px 4rem;
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1.4rem;
    align-items: start;
}

.studio-side,
.studio-main {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.studio-side {
    padding: 1.4rem;
    position: sticky;
    top: 92px;
}

.studio-side > .btn-ghost,
.upload-form > .btn-ghost {
    width: 100%;
    margin-top: 0.55rem;
}

.studio-side h1,
.studio-main-head h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.05;
    margin: 0.35rem 0 1rem;
}

.studio-stats {
    display: grid;
    grid-template-columns: 1fr 92px;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
}

.stat {
    background: var(--bg);
    border-radius: 18px;
    padding: 0.9rem 1rem;
}

.stat strong {
    display: block;
    font-family: Fraunces, serif;
    font-size: 2rem;
    line-height: 1;
}

.stat span,
.stat-cover span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-cover {
    border-radius: 18px;
    overflow: hidden;
    background: var(--teal-deep);
    display: grid;
    place-items: end start;
    min-height: 92px;
    color: white;
}

.stat-cover img {
    width: 100%;
    height: 92px;
    object-fit: cover;
    grid-area: 1 / 1;
}

.stat-cover span {
    grid-area: 1 / 1;
    color: white;
    padding: 0.45rem 0.6rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    width: 100%;
}

.studio-toast {
    background: #e8f5e9;
    color: #276749;
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.studio-toast.error {
    background: #fde8e8;
    color: #9b2c2c;
}

.dropzone {
    display: grid;
    gap: 0.25rem;
    place-items: center;
    text-align: center;
    border: 1.5px dashed var(--line);
    border-radius: 22px;
    padding: 1.4rem 1rem;
    background: var(--bg);
    cursor: pointer;
    margin-bottom: 1rem;
}

.dropzone.dragover,
.dropzone:hover {
    border-color: var(--accent);
    background: rgba(184, 92, 56, 0.06);
}

.dropzone input {
    display: none;
}

.dropzone strong {
    font-family: Fraunces, serif;
    font-size: 1.15rem;
}

.dropzone span,
.dropzone small {
    color: var(--muted);
}

.cover-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.4rem 0 1rem;
    font-weight: 600;
}

.studio-main {
    padding: 1.4rem;
}

.studio-main-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.upload-progress {
    margin-top: 0.85rem;
}

.upload-progress-track {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-deep);
    overflow: hidden;
}

.upload-progress-track span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.25s ease;
}

.upload-progress p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.account-form h3,
.account-block h3 {
    font-size: 1.15rem;
    margin: 0 0 0.8rem;
}

.account-block {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.studio-card {
    display: none;
}

.studio-card-meta,
.studio-card-actions {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0.7rem;
}

.studio-card-meta {
    bottom: 0;
    color: white;
    background: linear-gradient(transparent, rgba(27, 23, 20, 0.82));
}

.studio-card-meta strong,
.studio-card-meta span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-card-meta span {
    opacity: 0.85;
    font-size: 0.8rem;
}

.studio-card-actions {
    top: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.studio-card:hover .studio-card-actions,
.studio-card:focus-within .studio-card-actions {
    opacity: 1;
}

.studio-card-actions button {
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: var(--cream);
    color: var(--ink);
}

.studio-card-actions .danger {
    background: #9b2c2c;
    color: white;
}

.form-label {
    font-weight: 700;
    margin: 0.2rem 0 0.55rem;
}

.cat-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.cat-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-weight: 600;
    font-size: 0.88rem;
}

.cat-manager {
    margin-top: 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.cat-list {
    display: grid;
    gap: 0.45rem;
    margin: 0.7rem 0 0.8rem;
}

.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: var(--bg);
    border-radius: 14px;
    padding: 0.55rem 0.7rem;
    font-weight: 600;
}

.cat-row .danger {
    border: 0;
    background: #9b2c2c;
    color: white;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.cat-form {
    display: flex;
    gap: 0.45rem;
}

.cat-form input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.7rem 0.85rem;
    font: inherit;
}

.studio-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.mini-chip {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.25);
    color: white;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.mini-chip.active {
    background: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 900px) {
    .moments-grid.count-3,
    .moments-grid.count-4 {
        grid-template-columns: 1fr 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .moments-grid.count-1 .moment-card,
    .moments-grid.count-2 .moment-card,
    .moments-grid.count-3 .moment-card,
    .moments-grid.count-4 .moment-card {
        min-height: 300px;
    }

    .feature + .feature {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 1.2rem;
        margin-top: 1.2rem;
    }

    .showcase-stand {
        height: min(78vh, 740px);
    }

    .showcase-overlay {
        padding: 3.2rem 1.2rem 1.2rem;
    }

    .showcase-overlay h1 {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        top: max(8px, env(safe-area-inset-top));
        margin-top: 8px;
        padding: 0 10px;
        max-width: none;
    }

    .nav-container {
        position: relative;
        border-radius: 22px;
        flex-wrap: wrap;
        padding: 0.55rem 0.7rem;
    }

    .nav-toggle {
        display: grid;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.2rem;
        padding: 0.35rem 0 0.45rem;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        font-size: 0.95rem;
        padding: 0.75rem 0.9rem;
    }

    .showcase-band {
        margin-top: 8px;
        padding: 0 12px 2.2rem;
    }

    .showcase-stand {
        height: min(72vh, 620px);
        border-radius: 8px;
    }

    .moment-card {
        border-radius: 8px;
    }

    .showcase-overlay h1,
    .gallery-hero h1,
    .auth-card h1,
    .admin-card h1,
    .section-head h2 {
        font-size: clamp(1.9rem, 9vw, 3rem);
    }

    .lede,
    .section-kicker,
    .empty-copy {
        font-size: 1rem;
    }

    .hero-actions,
    .hero-meta {
        gap: 0.7rem;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-ghost,
    .auth-form .btn-primary,
    .upload-form .btn-primary {
        width: 100%;
        min-height: 48px;
    }

    .moments-section,
    .features {
        padding: 0 16px 3rem;
    }

    .gallery-hero {
        margin-top: 1.2rem;
        padding: 0 16px;
    }

    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
        scrollbar-width: none;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .chip {
        flex: 0 0 auto;
        min-height: 42px;
    }

    .gallery,
    .studio-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: minmax(46px, 14vw);
        gap: 6px;
        padding: 0 12px;
    }

    .photo-item,
    .photo-item img {
        border-radius: 8px;
    }

    .select-mode .photo-checkbox {
        top: 8px;
        right: 8px;
    }

    .viewer-stage {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
    }

    .viewer-image {
        max-width: 100vw;
        max-height: calc(100vh - 96px);
        border-radius: 0;
    }

    .viewer-toolbar {
        width: calc(100vw - 20px);
        gap: 6px;
    }

    .viewer-download,
    .viewer-action {
        padding: 0.75rem 0.5rem;
        font-size: 0.86rem;
    }

    .viewer-hint {
        display: none;
    }

    .select-bar {
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        max-width: none;
        gap: 6px;
        padding: 8px;
        border-radius: 18px;
    }

    .select-bar > span {
        flex: 1 1 calc(50% - 6px);
        text-align: center;
        font-size: 0.8rem;
        padding: 0.2rem 0;
    }

    .select-bar .btn-ghost,
    .select-bar .danger,
    .select-bar .btn-primary {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        padding: 0 0.5rem;
        font-size: 0.82rem;
    }

    .gallery-page.select-mode,
    .admin-page.select-mode {
        padding-bottom: 9rem;
    }

    .viewer-close {
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
    }

    .viewer-info {
        left: 60px;
        right: 60px;
        top: max(16px, env(safe-area-inset-top));
        bottom: auto;
        transform: none;
        text-align: center;
        font-size: 0.85rem;
    }

    .auth-card {
        margin: 1.4rem 12px 0;
        padding: 1.25rem;
        border-radius: 20px;
        max-width: none;
    }

    .studio-top {
        width: calc(100% - 20px);
        margin: 8px 10px 0;
        border-radius: 22px;
        flex-wrap: wrap;
        position: sticky;
        top: 8px;
    }

    .studio-top .nav-toggle {
        display: grid;
        margin-left: auto;
    }

    .studio-user {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .studio-user.open {
        display: flex;
    }

    .studio {
        grid-template-columns: 1fr;
        padding: 0 12px 5rem;
        margin-top: 1rem;
    }

    .studio-side {
        position: static;
        padding: 1.1rem;
        border-radius: 22px;
    }

    .studio-main {
        padding: 1.1rem;
        border-radius: 22px;
    }

    .studio-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .footer {
        flex-direction: column;
        padding: 1.5rem 16px 2.5rem;
    }
}

@media (max-width: 420px) {
    .gallery,
    .studio-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 5px;
        padding: 0 10px;
    }

    .logo-text {
        font-size: 1rem;
    }
}
