:root {
    --background-start: #111111;
    --background-end: #0a0a0a;
    --surface: rgba(26, 26, 26, 0.9);
    --surface-alt: rgba(34, 34, 34, 0.92);
    --accent: #38bdf8;
    --accent-strong: #a855f7;
    --accent-dark: #2563eb;
    --text-primary: #fefefe;
    --text-secondary: #bdbdbd;
    --border: rgba(255, 255, 255, 0.12);
    --surface-contrast: rgba(255, 255, 255, 0.08);
    --success: #21d07a;
    --warning: #ff8c42;
    --danger: #ff4757;
    --header-height: clamp(52px, 6vw, 62px);
    --tabbar-height: 0px;
}

@property --glimmer-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes auroraShift {
    0% {
        transform: translate(-8%, -6%) scale(1);
    }
    50% {
        transform: translate(10%, 6%) scale(1.08);
    }
    100% {
        transform: translate(-4%, 12%) scale(1.02);
    }
}

@keyframes spectralOrbit {
    0% {
        --glimmer-angle: 0deg;
        background-position: 0% 50%;
    }
    50% {
        --glimmer-angle: 200deg;
        background-position: 100% 50%;
    }
    100% {
        --glimmer-angle: 360deg;
        background-position: 0% 50%;
    }
}

* {
    box-sizing: border-box;
}

.d-none {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16.5px;
    line-height: 1.55;
    background: radial-gradient(circle at top left, var(--background-start), var(--background-end));
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: -25%;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.32), transparent 55%) no-repeat,
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.24), transparent 60%) no-repeat;
    filter: blur(140px);
    opacity: 0.55;
    mix-blend-mode: screen;
    animation: none;
    pointer-events: none;
    z-index: -1;
}

body::after {
    animation-direction: alternate-reverse;
    opacity: 0.4;
}

/* Compact Header */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: var(--header-height);
    padding: clamp(10px, 1.6vw, 16px) clamp(18px, 3vw, 28px);
    background: color-mix(in srgb, rgba(0, 0, 0, 0.9) 82%, rgba(20, 20, 20, 0.9));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px) saturate(120%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    gap: clamp(12px, 2vw, 18px);
    flex-wrap: wrap;
}

.brand-privacy-banner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 200px;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.36px;
    color: var(--text-primary);
}

.site-title-text {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-transform: lowercase;
    letter-spacing: 0.08em;
    padding-inline: clamp(6px, 0.8vw, 10px);
    background: conic-gradient(from var(--glimmer-angle),
            hsl(192 93% 62%),
            hsl(259 94% 72%),
            hsl(320 87% 67%),
            hsl(192 93% 62%));
    background-size: 200% 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: spectralOrbit 12s linear infinite;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.28));
}

.site-title-text::after {
    content: '';
    position: absolute;
    inset: 5% -6%;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.08));
    mix-blend-mode: screen;
    opacity: 0.6;
    filter: blur(12px);
    z-index: -1;
}

.aurora-heading {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding-inline: clamp(6px, 0.8vw, 12px);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
    background: conic-gradient(from var(--glimmer-angle),
            hsl(192 93% 62%),
            hsl(259 94% 72%),
            hsl(320 87% 67%),
            hsl(192 93% 62%));
    background-size: 200% 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: spectralOrbit 14s linear infinite;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.22));
}

.aurora-heading::after {
    content: '';
    position: absolute;
    inset: 20% -12%;
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.12));
    mix-blend-mode: screen;
    opacity: 0.5;
    filter: blur(18px);
    z-index: -1;
}

.aurora-heading--xl {
    font-size: clamp(2.2rem, 5vw, 3rem);
    line-height: 1.05;
}

.aurora-heading--lg {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    line-height: 1.1;
}

.aurora-heading--md {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.15;
}

.aurora-heading--sm {
    font-size: clamp(1.1rem, 2.4vw, 1.4rem);
    line-height: 1.2;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.18));
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 2px 0;
}

.privacy-icon {
    font-size: 0.9rem;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.8));
    }
}

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

.privacy-text {
    font-weight: 500;
    opacity: 0.9;
}

.user-compact-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(246, 166, 35, 0.18);
    border: 1px solid rgba(246, 166, 35, 0.45);
    border-radius: 12px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-status {
    font-size: 0.76rem;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--surface-contrast);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.auth-status-success {
    color: var(--text-success);
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}

.auth-status-warning {
    color: var(--text-warning);
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.3);
}

.auth-status-danger {
    color: var(--text-danger);
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.3);
}

.auth-status-info {
    color: var(--text-secondary);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

.btn-compact {
    padding: 6px 14px;
    font-size: 0.85rem;
    background: linear-gradient(120deg, rgba(246, 166, 35, 0.2), rgba(56, 189, 248, 0.18));
    border: 1px solid rgba(246, 166, 35, 0.45);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-compact:hover {
    border-color: color-mix(in srgb, rgba(56, 189, 248, 0.5) 60%, rgba(246, 166, 35, 0.45));
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-icon {
    padding: 8px 14px;
    font-size: 1.25rem;
    background: rgba(246, 166, 35, 0.12);
    border: 1px solid rgba(246, 166, 35, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(246, 166, 35, 0.25);
    border-color: var(--accent);
    transform: scale(1.05);
}

.dashboard {
    height: calc(100vh - var(--header-height) - var(--tabbar-height));
    overflow: hidden;
    padding: clamp(10px, 2.6vw, 16px);
}

.mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--tabbar-height);
    background: rgba(10, 12, 20, 0.9);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(10px) saturate(120%);
    display: none;
    align-items: center;
    justify-content: space-around;
    padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 6px);
    z-index: 1030;
}

.mobile-tabbar .tab-item {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 1.1rem;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 12px;
}

.mobile-tabbar .tab-item.active {
    color: var(--text-primary);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.mobile-tabbar .tab-item.tab-primary {
    font-weight: 700;
    color: #0b1020;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(168, 85, 247, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.65);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.mobile-tabbar .tab-label {
    font-size: 0.7rem;
}

.main-layout {
    display: grid;
    grid-template-columns: minmax(250px, 325px) minmax(230px, 280px) minmax(480px, 1fr);
    grid-template-areas: "templates controls preview";
    height: 100%;
    min-height: 0;
    gap: clamp(12px, 2vw, 18px);
}

.templates-pane {
    grid-area: templates;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid color-mix(in srgb, var(--border) 70%, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    overflow: hidden;
    min-height: 0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.3);
}

.pane-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    background: rgba(17, 24, 39, 0.45);
}

.pane-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pane-subtitle {
    margin: 4px 0 0;
    font-size: 0.74rem;
    color: var(--text-secondary);
    opacity: 0.9;
}

.generate-pane {
    grid-area: controls;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.preview-pane {
    grid-area: preview;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.templates-strip-wrapper {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.templates-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(246, 166, 35, 0.35) transparent;
}

.templates-strip::-webkit-scrollbar {
    width: 6px;
}

.templates-strip::-webkit-scrollbar-track {
    background: transparent;
}

.templates-strip::-webkit-scrollbar-thumb {
    background: rgba(246, 166, 35, 0.35);
    border-radius: 3px;
}

.templates-strip::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

.templates-strip .template-card {
    flex: 0 0 auto;
    min-width: auto;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 10px;
}

/* Compact inner elements only inside the left templates strip */
.templates-strip .template-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
}

.templates-strip .template-profile-header {
    grid-column: 1 / 2;
    grid-row: 1;
    align-items: center;
    gap: 12px;
}

.templates-strip .template-profile-text {
    gap: 4px;
    min-width: 0;
}

.templates-strip .template-profile-name {
    font-size: 1.05rem;
}

.templates-strip .template-profile-handle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.templates-strip .template-profile-bio {
    display: none;
}

.templates-strip .template-profile-previews {
    display: none;
}

.templates-strip .template-tier-badge {
    position: static;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.32);
    box-shadow: none;
    gap: 6px;
    margin-top: -4px;
}

.templates-strip .template-tier-badge .tier-icon {
    font-size: 0.9rem;
}

.templates-strip .template-tier-badge .tier-label {
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.templates-strip .template-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.62);
    margin-top: -4px;
}

.templates-strip .template-meta span {
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 999px;
}

.templates-strip .template-card-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 4px;
}

.templates-strip .template-card-actions .btn {
    width: 100%;
    padding: 6px 0;
    font-size: 0.82rem;
}

.generate-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid color-mix(in srgb, var(--border) 70%, rgba(56, 189, 248, 0.08));
    border-radius: 16px;
    position: relative;
    isolation: isolate;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.32);
    height: 100%;
    overflow: hidden;
}

.generate-panel > :not(.modifiers-section) {
    flex-shrink: 0;
}

.modifiers-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 8px;
    margin-top: 12px;
}

.generate-panel::before {
    content: '';
    position: absolute;
    inset: -40% 5% 50% -30%;
    background: radial-gradient(circle, rgba(246, 166, 35, 0.38), transparent 60%);
    filter: blur(80px);
    opacity: 0.4;
    animation: auroraShift 16s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}


.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
}


.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.panel-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.panel-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}


.user-email {
    font-size: 0.88rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.user-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(246, 166, 35, 0.18), rgba(224, 142, 11, 0.18));
    border: 1px solid rgba(246, 166, 35, 0.45);
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    box-shadow: 0 6px 14px rgba(246, 166, 35, 0.15);
}

.credits-icon {
    font-size: 1rem;
}

.credits-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.credits-value {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.credits-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}


.template-card {
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(20, 24, 40, 0.85), rgba(12, 12, 18, 0.92));
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.template-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.08));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.template-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 18px 40px rgba(56, 189, 248, 0.28);
    transform: translateY(-2px);
}

.template-card:hover::before,
.template-card.active::before {
    opacity: 1;
}

.template-card.active {
    border-color: var(--accent);
    box-shadow: 0 22px 55px rgba(56, 189, 248, 0.35);
}

.template-profile-header {
    display: flex;
    gap: 10px;
    align-items: center;
}

.template-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.template-profile-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-profile-name {
    font-size: 1rem;
    font-weight: 650;
    margin: 0;
}

.template-profile-handle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.58);
}

.template-profile-bio {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.3;
}

.template-profile-previews {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.template-profile-previews .preview-tile {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.08);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}


.template-profile-previews .preview-tile--empty {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.12));
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.template-profile-previews .preview-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 0.35) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-card:hover .template-profile-previews .preview-tile::after {
    opacity: 1;
}

.template-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.25;
}

.template-meta span {
    background: rgba(56, 189, 248, 0.14);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.template-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}


.generation-panel {
    padding: 1.5rem;
    flex-shrink: 0;
}

.generate-panel-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.generate-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.generate-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gen-status {
    font-size: 0.9rem;
    color: var(--text-primary);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.03em;
    backdrop-filter: blur(6px);
}

.btn-generate {
    position: relative;
    padding: 16px 36px;
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.95), rgba(168, 85, 247, 0.95), rgba(56, 189, 248, 0.95));
    background-size: 220% 220%;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    animation: gradientShift 4s ease infinite;
    box-shadow: 0 20px 45px rgba(56, 189, 248, 0.35);
    overflow: hidden;
}

.btn-generate::after {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.45), transparent 65%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.btn-generate:not(:disabled):hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 26px 60px rgba(56, 189, 248, 0.5);
    animation: gradientShift 2.2s ease infinite;
}

.btn-generate:not(:disabled):hover::after {
    opacity: 0.4;
}

.btn-generate:not(:disabled):active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    animation: none;
    box-shadow: none;
}

.btn-generate-text {
    text-transform: uppercase;
    letter-spacing: 1.65px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.generate-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-content: center;
}

.toggle-panel {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    align-items: center;
    margin: 0;
}

.toggle-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: all 0.35s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    backdrop-filter: blur(7px);
    text-align: left;
}

.toggle-card::before {
    content: '';
    position: absolute;
    inset: -120% -20% 30%;
    background: linear-gradient(135deg, rgba(246, 166, 35, 0.24), transparent 60%);
    transform: translate3d(-20%, -30%, 0);
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
}

.toggle-card:hover {
    border-color: rgba(246, 166, 35, 0.55);
    box-shadow: 0 12px 24px rgba(246, 166, 35, 0.15);
}

.toggle-card:hover::before {
    transform: translate3d(10%, -10%, 0);
    opacity: 0.65;
}

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

.toggle-switch {
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.toggle-knob {
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-title {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.toggle-subtitle { display: none; }

.toggle-input:checked + .toggle-switch {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(246, 166, 35, 0.35);
}

.toggle-input:checked + .toggle-switch .toggle-knob {
    transform: translate(12px, -50%);
    background: #000;
    box-shadow: 0 4px 16px rgba(246, 166, 35, 0.5);
}

.toggle-card:has(.toggle-input:checked) {
    border-color: rgba(246, 166, 35, 0.8);
    box-shadow: 0 12px 26px rgba(246, 166, 35, 0.25);
}

.toggle-card:has(.toggle-input:checked)::before {
    opacity: 0.75;
    transform: translate3d(16%, -5%, 0);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 12px 48px rgba(102, 126, 234, 0.6); }
    50% { box-shadow: 0 12px 64px rgba(244, 114, 182, 0.8); }
}

@keyframes glowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    font-size: 0.85rem;
    min-height: 1.2rem;
}

.image-modal-primary > .status-text,
.image-modal-section .status-text {
    min-height: 0;
}

.image-modal-primary > .status-text:not(:empty),
.image-modal-section .status-text:not(:empty) {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.status-text.success {
    color: var(--success);
}

.status-text.error {
    color: var(--danger);
}

.status-text.info {
    color: var(--accent);
}

.admin-only {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
}

.form-control:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--accent);
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-check-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.admin-section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.badge-active {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.badge-inactive {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(244, 63, 94, 0.15);
    color: #fda4af;
}

.gallery-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    padding: 20px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--background-start);
}

#galleryModal .modal-body {
    padding: 0;
}

#galleryModal .empty-message {
    padding: 60px 20px;
}

#authModal .modal-content {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.96), rgba(8, 13, 26, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 22px;
    color: var(--text-primary);
    box-shadow: 0 32px 80px rgba(6, 12, 24, 0.55);
}

#authModal .modal-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 1.4rem 1.6rem 1rem;
}

#authModal .modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#authModal .btn-close {
    filter: invert(1) grayscale(100%);
}

#authModal .modal-body {
    padding: 1.6rem;
}

@media (max-width: 575.98px) {
    #authModal .modal-body {
        padding: 1.25rem;
    }
}

.auth-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.auth-intro {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: 18px;
    padding: 1.45rem;
    box-shadow: 0 24px 60px rgba(14, 23, 42, 0.52);
}

.auth-intro-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.auth-intro-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.6;
}

.auth-intro-footnote {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.7);
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.85rem 1.4rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.38);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-google-btn:hover,
.auth-google-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.45);
}

.auth-google-btn:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.7);
    outline-offset: 4px;
}

.auth-google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
    background: conic-gradient(from 45deg, #4285f4, #ea4335, #fbbc05, #34a853, #4285f4);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.auth-google-text {
    letter-spacing: 0.01em;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(226, 232, 240, 0.6);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1 1 0;
    height: 1px;
    background: rgba(226, 232, 240, 0.14);
}

.auth-email-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 0.35rem;
    box-shadow: 0 12px 30px rgba(10, 18, 36, 0.45);
}

.auth-tabs.is-hidden {
    display: none;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.78);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-tab.is-active {
    background: rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    box-shadow: 0 16px 32px rgba(10, 18, 36, 0.55);
}

.auth-tab:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.7);
    outline-offset: 2px;
}

.auth-card {
    display: none;
    flex-direction: column;
    gap: 1rem;
    background: rgba(9, 17, 35, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 24px 55px rgba(7, 13, 26, 0.55);
}

.auth-card.is-active {
    display: flex;
}

.auth-card .form-label {
    font-weight: 600;
    color: rgba(241, 245, 249, 0.94);
}

.auth-card .form-control {
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-card .form-control:focus {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(56, 189, 248, 0.68);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
    color: var(--text-primary);
}

.auth-card .form-control.is-invalid {
    border-color: rgba(248, 113, 113, 0.75);
}

.auth-card .invalid-feedback {
    color: rgba(248, 113, 113, 0.9);
}

.auth-card small.form-text {
    color: rgba(226, 232, 240, 0.72);
}

.auth-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.auth-card-actions .btn-link {
    color: #38bdf8;
    padding: 0;
}

.auth-card-actions .btn-link:hover,
.auth-card-actions .btn-link:focus-visible {
    text-decoration: underline;
}

.auth-reset-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.auth-email-section[data-active-mode='reset'] .auth-reset-copy {
    color: rgba(226, 232, 240, 0.86);
}

@media (max-width: 575.98px) {
    .auth-intro {
        padding: 1.2rem;
    }

    .auth-card {
        padding: 1.1rem;
    }
}

#imageModal .modal-body {
    padding: 1.75rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(8, 15, 35, 0.9));
}

@media (max-width: 767.98px) {
    #imageModal .modal-body {
        padding: 1.25rem;
    }
}

.image-modal-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.image-modal-primary {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1 1 0;
    min-width: 0;
}

.image-modal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 0 0 320px;
}

@media (min-width: 992px) {
    .image-modal-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .image-modal-sidebar {
        position: sticky;
        top: 24px;
    }
}

@media (max-width: 991.98px) {
    .image-modal-sidebar {
        flex-basis: 100%;
    }
}

.modal-media-frame {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    min-height: 0;
    box-shadow: 0 24px 70px rgba(10, 20, 45, 0.45);
}

.modal-media-frame img,
.modal-media-frame video {
    max-height: min(70vh, 860px);
    width: auto;
    height: auto;
    max-width: 100%;
    border-radius: 16px;
}

.image-modal-section {
    background: rgba(12, 19, 35, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 18px 48px rgba(6, 12, 24, 0.35);
}

.image-modal-section + .image-modal-section {
    margin-top: 0.5rem;
}

.image-modal-section .form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--text-primary);
    border-radius: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.image-modal-section .form-control:focus {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
    color: var(--text-primary);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    margin-top: 0.15rem;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.45);
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#modalMeta {
    background: rgba(8, 15, 35, 0.7);
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    text-align: left;
}

.preview-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 112px;
    grid-template-rows: 1fr;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.9), rgba(12, 18, 32, 0.88));
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 12px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(16px);
    gap: 10px;
}

.preview-container.no-carousel {
    grid-template-columns: 1fr;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.preview-meta {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(148, 163, 184, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 4px 12px;
}

.preview-body {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    position: relative;
    padding: 8px;
    width: 100%;
    margin: 0;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.preview-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}

.preview-actions {
    position: absolute;
    right: 8px;
    top: 8px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.btn-quick-edit {
    background: rgba(255, 215, 0, 0.16);
    border: 1px solid rgba(255, 215, 0, 0.45);
    color: #ffe69a;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(6px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.btn-quick-edit:hover,
.btn-quick-edit:focus-visible {
    background: rgba(255, 215, 0, 0.26);
    color: #fff7c2;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(255, 215, 0, 0.32);
}

.btn-quick-edit.active {
    background: rgba(255, 215, 0, 0.35);
    color: #fff5b7;
    box-shadow: 0 12px 28px rgba(255, 215, 0, 0.38);
}

.quick-edit-popover {
    position: absolute;
    top: 56px;
    right: 8px;
    width: min(320px, calc(100% - 32px));
    background: rgba(18, 22, 39, 0.94);
    border-radius: 18px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(255, 215, 0, 0.18);
    box-shadow: 0 22px 50px rgba(8, 9, 18, 0.55);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(-14px) scale(0.94);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    z-index: 3;
    overflow: hidden;
}

.quick-edit-popover::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 215, 0, 0.45), rgba(125, 211, 252, 0.25), rgba(255, 215, 0, 0.45));
    background-size: 180% 180%;
    opacity: 0.35;
    filter: blur(0.6px);
    z-index: -1;
    animation: quickEditGlow 6s linear infinite;
}

.quick-edit-popover.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.quick-edit-popover.pulse {
    animation: quickEditPulse 0.45s ease;
}

.quick-edit-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.quick-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffe69a;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.quick-edit-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.quick-edit-close {
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.15rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 999px;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.quick-edit-close:hover,
.quick-edit-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(90deg);
}

.quick-edit-copy {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.78);
    margin: 0;
    line-height: 1.35;
}

.quick-edit-textarea {
    background: rgba(28, 30, 45, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.28);
    color: #f8fafc;
    border-radius: 12px;
    resize: vertical;
    min-height: 88px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.quick-edit-textarea::placeholder {
    color: rgba(226, 232, 240, 0.55);
}

.quick-edit-textarea:focus {
    border-color: rgba(255, 215, 0, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.22);
    background: rgba(35, 38, 58, 0.95);
}

.quick-edit-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-edit-actions .btn {
    flex: 1 1 120px;
}

@keyframes quickEditGlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes quickEditPulse {
    0% {
        transform: scale(1);
    }
    60% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

.preview-overlay-meta {
    position: absolute;
    left: 8px;
    bottom: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
    pointer-events: none;
}

.preview-actions .btn-generate-video { padding: 6px 12px; font-size: 0.85rem; }
.preview-actions .btn-sm { padding: 4px 10px; }

.preview-image:hover {
    transform: scale(1.01);
    box-shadow: 0 36px 90px rgba(56, 189, 248, 0.4);
}

.btn-generate-video {
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(168, 85, 247, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.6);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.btn-generate-video:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg, rgba(56, 189, 248, 1), rgba(168, 85, 247, 1));
}

.btn-generate-video:active:not(:disabled) {
    transform: translateY(0);
}

.btn-generate-video:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-secondary);
    text-align: center;
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

.placeholder-text {
    font-size: 1.2rem;
    opacity: 0.6;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Carousel */
.preview-carousel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    flex-shrink: 0;
    min-height: 110px;
    width: 100%;
}

.preview-carousel.vertical {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    flex-direction: column;
    align-items: stretch;
    width: 112px;
    min-height: 0;
    height: 100%;
    padding-top: 0;
    border-top: none;
    border-left: 1px solid rgba(148, 163, 184, 0.16);
}

.carousel-track-wrapper {
    flex: 1 1 0;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) rgba(15, 23, 42, 0.3);
    min-width: 0;
    height: 100px;
}

.preview-carousel.vertical .carousel-track-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    width: 100%;
}

.carousel-track-wrapper::-webkit-scrollbar {
    height: 6px;
}

.preview-carousel.vertical .carousel-track-wrapper::-webkit-scrollbar {
    width: 6px;
}

.carousel-track-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 3px;
}

.carousel-track-wrapper::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 3px;
}

.carousel-track-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

.carousel-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 4px;
    height: 100%;
    align-items: center;
}

.preview-carousel.vertical .carousel-track {
    flex-direction: column;
    align-items: stretch;
    min-width: 0 !important;
}

.carousel-item {
    flex: 0 0 96px;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    height: 96px !important;
    min-height: 96px !important;
    max-height: 96px !important;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    background: rgba(15, 23, 42, 0.65);
    display: block !important;
    margin-right: 12px;
}

.preview-carousel.vertical .carousel-item {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0;
    margin-bottom: 12px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-item:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 12px 24px rgba(56, 189, 248, 0.32);
}

.carousel-item.active {
    border-color: var(--accent);
    box-shadow: 0 16px 32px rgba(56, 189, 248, 0.4);
    transform: translateY(-4px) scale(1.05);
}

.carousel-item-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(168, 85, 247, 0.9));
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.carousel-nav {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-carousel.vertical .carousel-nav {
    width: 100%;
    height: 36px;
}

.carousel-nav:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent);
    transform: scale(1.1);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.image-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.image-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
    border-color: var(--accent);
    z-index: 10;
}

.image-card .image-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-6px);
    z-index: 2;
}

.image-card:hover .image-actions {
    opacity: 1;
    transform: translateY(0);
}

.image-card .image-actions button {
    padding: 4px 10px;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: rgba(248, 113, 113, 0.95);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-card .image-actions button:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.8);
}

.image-card img,
.image-card .gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-card .image-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.95));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-card:hover .image-body {
    opacity: 1;
}

.image-card .image-body strong {
    font-size: 0.75rem;
    display: block;
}

.image-card .image-meta {
    color: var(--text-secondary);
    font-size: 0.7rem;
    display: none;
}

.image-card .image-handle {
    display: none;
    color: var(--accent);
    font-size: 0.72rem;
    margin-top: 4px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.image-card:hover .image-handle {
    display: block;
}

.image-card.bootstrap-preview {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 16px 40px rgba(56, 189, 248, 0.25);
}

.image-card.bootstrap-preview:hover {
    transform: scale(1.04);
    box-shadow: 0 24px 52px rgba(56, 189, 248, 0.35);
}

.image-card.bootstrap-preview .image-body {
    opacity: 1;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.94) 100%);
}

.image-card.bootstrap-preview .image-body strong {
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.image-card.bootstrap-preview .image-handle {
    display: block;
}

.image-card.bootstrap-preview .image-meta {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.35;
}

.image-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.85);
    color: var(--accent);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.5);
    z-index: 6;
}

.bootstrap-badge {
    background: rgba(56, 189, 248, 0.92);
    color: #02121f;
}

.video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(56, 189, 248, 0.95);
    color: #0f172a;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 1.2rem;
    z-index: 5;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

.video-badge.processing-badge {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(249, 115, 22, 0.95));
    color: #0f172a;
    font-weight: 600;
    font-size: 0.85rem;
    animation: pulse-processing 1.5s ease-in-out infinite;
}

.carousel-item-badge.processing-badge {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(249, 115, 22, 0.95));
    color: #0f172a;
    font-weight: 600;
    animation: pulse-processing 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(56, 189, 248, 0.5);
    }
}

@keyframes pulse-processing {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 16px rgba(251, 191, 36, 0.6);
        opacity: 0.9;
    }
}

.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 12px;
}

.video-item {
    background: rgba(9, 15, 28, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: 0 18px 42px rgba(8, 16, 32, 0.35);
}

.video-item:hover {
    border-color: var(--accent);
    box-shadow: 0 24px 54px rgba(56, 189, 248, 0.35);
    transform: translateY(-4px);
}

.video-player {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.video-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: rgba(6, 11, 24, 0.92);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.video-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.video-actions .btn {
    flex: 0 0 auto;
    padding: 0.4rem 0.85rem;
}

@media (max-width: 640px) {
    .video-list {
        grid-template-columns: 1fr;
    }
}

.empty-message {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.empty-message.bootstrap-notice {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.templates-pane .empty-message {
    padding: 20px;
    margin: 0;
    text-align: center;
}

.modal-content {
    background: var(--background-start);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.image-modal-dialog {
    max-width: min(1080px, 95vw);
}

.image-modal-content {
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(5, 10, 22, 0.95));
    box-shadow: 0 40px 120px rgba(6, 12, 24, 0.55);
    overflow: hidden;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-backdrop.show {
    opacity: 0.8;
}

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

.modal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.modal-body {
    background: var(--background-start);
}

.modal-title {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23f8fafc'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    opacity: 1;
    filter: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background-color: rgba(244, 63, 94, 0.3);
    opacity: 1;
    transform: scale(1.1);
}

.btn-close:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.3);
    outline: none;
}

#modal-video {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-meta {
    background: transparent;
    border-radius: 12px;
    padding: 0;
    border: none;
}

.modal-meta dl {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
}

.modal-meta dt {
    color: var(--text-secondary);
}

.modal-meta dd {
    margin: 0;
}

.btn,
.btn-primary,
.btn-success,
.btn-outline-light,
.btn-sm {
    border-radius: 12px;
    transition: all 0.2s ease;
}

.btn-primary,
.btn-success,
.btn-outline-light {
    padding: 8px 20px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent-strong);
}

.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-color: rgba(21, 128, 61, 0.85);
    color: #052e16;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    border-color: rgba(21, 128, 61, 0.95);
    color: #022c22;
}

.btn-success:disabled {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.25);
    color: rgba(2, 44, 34, 0.65);
}

.btn-outline-light {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--text-primary);
}

.btn-outline-light:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent);
    color: var(--text-primary);
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button-row .btn {
    flex: 1 1 160px;
}

/* Admin Panel Overlay */
.admin-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 16, 0.88);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}

.admin-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    background: rgba(12, 17, 33, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.65);
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 28px 36px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(17, 24, 39, 0.92));
    position: sticky;
    top: 0;
    z-index: 5;
}

.admin-header-text h3 {
    margin: 0;
    font-size: 1.6rem;
}

.admin-panel-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-header-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-meta-chip {
    padding: 6px 12px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-meta-chip strong {
    color: var(--text-primary);
}

.btn-close-panel {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close-panel:hover {
    background: rgba(244, 63, 94, 0.3);
    border-color: var(--danger);
}

.admin-panel-content {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.admin-panel-sidebar {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78));
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: auto;
    min-height: 0;
}

.admin-panel-main {
    background: rgba(9, 14, 24, 0.72);
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.admin-panel-main-inner {
    overflow-y: auto;
    padding: 36px 44px 56px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 0;
}

.admin-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-sidebar-section + .admin-sidebar-section {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    padding-top: 24px;
}

.admin-sidebar-heading {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.8);
}

.admin-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-quick-actions .btn {
    justify-content: center;
    font-weight: 500;
}

.admin-sidebar-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.admin-metric-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-metric-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.admin-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-tab {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-secondary);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.admin-tab:is(:hover, :focus-visible) {
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.admin-tab.is-active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.22));
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 18px 32px rgba(13, 148, 136, 0.18);
}

.admin-tab-panels {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
}

.admin-tab-panel {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.admin-tab-panel.is-active {
    display: flex;
}

.admin-tab-panel[hidden] {
    display: none !important;
}

.admin-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 6px 0 10px;
    border-bottom: 1px dashed var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(9, 14, 24, 0.72);
    backdrop-filter: blur(6px);
}

.admin-subtabs .admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    width: auto;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .admin-subtabs {
        border-bottom: none;
        padding: 6px 0;
    }
    .admin-subtabs .admin-tab {
        flex: 1 1 46%;
        justify-content: center;
        text-align: center;
    }
}

.admin-template-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 1fr);
    gap: 32px;
    align-items: start;
    min-height: 0;
    grid-template-areas: "editor library";
}

.admin-template-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
    grid-area: editor;
}

.admin-template-sidebar {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    min-height: 0;
    height: 100%;
    grid-area: library;
}

.admin-card--toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1 1 auto;
    min-height: 0;
}

.admin-template-library-card {
    padding: 28px;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.92) 100%);
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 32px 60px rgba(8, 15, 40, 0.55);
    backdrop-filter: blur(18px);
    gap: 22px;
}

.admin-template-library-header .panel-subtitle {
    margin-bottom: 0;
}

.admin-template-toolbar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 24px 48px rgba(8, 15, 40, 0.5);
    backdrop-filter: blur(12px);
}

.admin-template-toolbar-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-search-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
}

.admin-search-input input {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
}

.admin-select {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    color: var(--text-primary);
}

.admin-count-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent);
}

.admin-filter-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:is(:hover, :focus-visible) {
    border-color: rgba(56, 189, 248, 0.5);
    color: var(--text-primary);
}

.filter-chip.is-active {
    background: rgba(56, 189, 248, 0.2);
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.18);
}

.admin-template-library-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 14px;
    margin-right: -14px;
    max-height: clamp(420px, 78vh, 880px);
}

.admin-template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin: 0;
    padding: 4px 2px 12px 4px;
}

.admin-template-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
    gap: 24px;
    align-items: flex-start;
    min-height: 0;
}

.admin-template-workspace:not(:has(.admin-template-col-left > [data-subtab]:not([hidden]))),
.admin-template-workspace:not(:has(.admin-template-col-right > [data-subtab]:not([hidden]))) {
    grid-template-columns: 1fr;
}

.admin-template-workspace:not(:has(.admin-template-col-left > [data-subtab]:not([hidden]))) .admin-template-col-left {
    display: none;
}

.admin-template-workspace:not(:has(.admin-template-col-right > [data-subtab]:not([hidden]))) .admin-template-col-right {
    display: none;
}

.admin-template-col-left > .admin-card[data-subtab],
.admin-template-col-right > .admin-card[data-subtab] {
    margin-top: 0;
}

.admin-template-workspace .admin-bootstrap-card {
    margin-top: 0;
    height: 100%;
}

.admin-template-col-left .admin-bootstrap-card {
    height: auto !important;
}

.admin-template-card {
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 18px;
    padding: 18px 20px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.88) 0%, rgba(17, 24, 39, 0.92) 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-template-card:is(:hover, :focus-within) {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 30px 55px rgba(56, 189, 248, 0.2);
    transform: translateY(-3px) scale(1.01);
}

.admin-template-card.is-editing {
    border-color: rgba(14, 165, 233, 0.82);
    box-shadow: 0 32px 60px rgba(14, 165, 233, 0.32);
}

.admin-template-card__header,
.admin-template-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-template-card__name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-template-card__name h4 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.admin-template-card__subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.admin-template-card__status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-template-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.admin-template-card__meta span {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent);
}

.admin-template-card__timestamp {
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.admin-template-card__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.admin-form-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-template-form {
    min-height: 100%;
}

.admin-template-form textarea {
    min-height: 160px;
}

.admin-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

@media (min-width: 1100px) {
    .admin-post-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
        gap: 16px;
    }
}

[data-subtab="bootstrap"] .bootstrap-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

@media (min-width: 1200px) {
    [data-subtab="bootstrap"] .bootstrap-gallery {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.templates-category-wrapper {
    margin: 0;
    padding: 12px 20px 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.template-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.template-category-tabs:empty {
    display: none;
}

.template-category-tab {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.template-category-tab:hover,
.template-category-tab:focus-visible {
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--text-primary);
}

.template-category-tab.is-active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.32), rgba(14, 165, 233, 0.26));
    border-color: rgba(56, 189, 248, 0.65);
    color: #fff;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.22);
}

.template-category-tab .category-count {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    font-size: 0.7rem;
    line-height: 1;
}

.admin-modifier-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-modifier-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 24px;
}

.admin-modifier-sidebar,
.admin-modifier-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-modifier-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

.admin-modifier-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-modifier-card:is(:hover, :focus-within) {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 16px 32px rgba(56, 189, 248, 0.18);
}

.admin-modifier-card.is-editing {
    border-color: rgba(14, 165, 233, 0.8);
    box-shadow: 0 18px 36px rgba(14, 165, 233, 0.25);
}

.admin-modifier-card .modifier-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-modifier-card .modifier-name {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-modifier-card .modifier-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-meta-card {
    margin-top: 24px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-meta-toolbar .btn {
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
}

.admin-meta-list {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    padding: 12px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.admin-meta-item:hover,
.admin-meta-item:focus-visible {
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
}

.admin-meta-item.is-active {
    border-color: rgba(56, 189, 248, 0.65);
    background: rgba(56, 189, 248, 0.2);
}

.admin-meta-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-meta-item-subtitle {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.4;
}

.admin-meta-item-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-meta-item-actions .category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 0 8px;
    height: 28px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-meta-item-actions .btn-icon {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-meta-item-actions .btn-icon:hover {
    border-color: rgba(56, 189, 248, 0.5);
    color: var(--accent);
}

@media (max-width: 992px) {
    .admin-meta-toolbar {
        flex-wrap: wrap;
    }

    .admin-meta-toolbar .btn {
        flex: 1 1 auto;
    }
}

.admin-modifier-card .modifier-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.admin-modifier-main .status-text {
    margin-top: 12px;
}

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

textarea[data-autogrow] {
    min-height: 120px;
    resize: vertical;
}

.admin-count-chip + .admin-filter-chips {
    margin-left: auto;
}

.admin-sections-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.admin-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-card {
    background: var(--surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
}

.admin-post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.admin-post-item {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-post-item.is-unpublished {
    border-style: dashed;
    opacity: 0.8;
}

.admin-post-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-post-body {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.admin-post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-post-actions button {
    flex: 0 0 auto;
}

.admin-post-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(56, 189, 248, 0.85);
}

.profile-video-preview {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.6);
    padding: 12px;
}

.profile-video-preview video {
    width: 100%;
    border-radius: 12px;
}

.admin-card--intro {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(14, 165, 233, 0.18));
}

.admin-card--list {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.admin-section-title {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.admin-section-help {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.stacked-form .form-control,
.stacked-form .form-select {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
}

.stacked-form .form-control:focus,
.stacked-form .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.15rem rgba(56, 189, 248, 0.25);
}

.plan-preview-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-preview-item {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 16px;
}

.plan-preview-item h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.plan-preview-item ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
        grid-template-areas:
            "templates preview"
            "controls preview";
    }

    .preview-carousel {
        min-height: 96px;
    }

    .carousel-item {
        flex: 0 0 80px !important;
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        height: 80px !important;
        min-height: 80px !important;
        max-height: 80px !important;
    }

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

    .admin-panel-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-panel-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
        padding: 24px 24px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        overflow: visible;
    }

    .admin-sidebar-section {
        flex: 1 1 260px;
    }

    .admin-sidebar-section + .admin-sidebar-section {
        border-top: none;
        padding-top: 0;
    }

    .admin-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .admin-tab {
        flex: 1 1 calc(50% - 12px);
        text-align: center;
    }

    .admin-panel-main-inner {
        padding: 28px 24px 40px;
    }

    .admin-template-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "library"
            "editor";
        gap: 28px;
    }

    .admin-template-workspace {
        grid-template-columns: 1fr;
    }

    .admin-template-sidebar {
        grid-template-rows: auto 1fr;
    }

    .admin-template-library-card {
        padding: 24px;
        gap: 20px;
    }

    .admin-template-toolbar {
        padding: 16px 18px;
    }

    .admin-modifier-grid {
        grid-template-columns: 1fr;
    }

    .admin-header-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 991px) {
    .main-layout {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        grid-template-areas:
            "preview"
            "controls"
            "templates";
        gap: 16px;
        height: auto;
    }

    .templates-pane {
        max-height: 48vh;
    }

    .templates-strip-wrapper {
        max-height: calc(48vh - 140px);
    }

    .preview-container {
        padding: 20px;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: auto;
    }

    .preview-body {
        padding: 14px;
    }

    .preview-carousel {
        min-height: 88px;
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .preview-carousel.vertical {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: auto;
        min-height: 80px;
        border-left: none;
        border-top: 1px solid rgba(148, 163, 184, 0.16);
        flex-direction: row;
        align-items: center;
    }
    .preview-carousel.vertical .carousel-track-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        height: 100px;
        width: 100%;
    }
    .preview-carousel.vertical .carousel-track {
        flex-direction: row;
        align-items: center;
        min-width: auto !important;
        min-height: 0;
    }

    .carousel-item {
        flex: 0 0 70px !important;
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        height: 70px !important;
        min-height: 70px !important;
        max-height: 70px !important;
    }

    .admin-panel-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }

    .admin-panel-sidebar {
        padding: 20px 20px 12px;
        gap: 16px;
        flex-direction: column;
    }

    .admin-tabs {
        gap: 10px;
    }

    .admin-tab {
        flex: 1 1 48%;
    }

    .admin-panel-main-inner {
        padding: 24px 18px 36px;
    }

    .admin-template-library-card {
        padding: 22px;
    }

    .admin-template-toolbar {
        padding: 16px 18px;
    }

    .admin-template-library-scroll {
        max-height: none;
        overflow-y: visible;
        margin-right: 0;
        padding-right: 0;
    }

    .admin-template-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .preview-carousel {
        min-height: 60px;
    }

    .billing-wrapper {
        gap: 24px;
    }

    .billing-header {
        padding: 24px;
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-header__brand {
        align-items: flex-start;
    }

    :root { --tabbar-height: 64px; }
    .mobile-tabbar { display: flex; }
    .dashboard { overflow-y: auto; overflow-x: hidden; padding-bottom: calc(24px + var(--tabbar-height)); }

    .generate-panel { flex: initial; overflow: visible; }
    .preview-pane { min-height: auto; }
    .templates-pane, .generate-pane { min-height: auto; }
    .preview-carousel.vertical .carousel-nav { width: 38px; height: 38px; }

    .main-layout[data-mobile-tab="preview"] .generate-pane,
    .main-layout[data-mobile-tab="preview"] .templates-pane { display: none; }
    .main-layout[data-mobile-tab="generate"] .preview-pane,
    .main-layout[data-mobile-tab="generate"] .templates-pane { display: none; }
    .main-layout[data-mobile-tab="templates"] .preview-pane,
    .main-layout[data-mobile-tab="templates"] .generate-pane { display: none; }

    .main-layout[data-mobile-tab="templates"] .templates-pane { max-height: none; }
    .main-layout[data-mobile-tab="templates"] .templates-strip-wrapper { max-height: none; }
    .main-layout[data-mobile-tab="generate"] .generate-panel { height: auto; overflow: visible; }
    .main-layout[data-mobile-tab="preview"] .preview-container { height: auto; }
}

@media (max-width: 575px) {
    .compact-header {
        height: auto;
        min-height: 70px;
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .brand-privacy-banner {
        flex: 1 1 100%;
        order: -1;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .privacy-badge {
        font-size: 0.65rem;
    }

    .privacy-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-compact-info {
        gap: 8px;
        font-size: 0.85rem;
    }

    .header-actions {
        gap: 8px;
    }

    .template-card {
        flex: 0 0 120px;
        height: 80px;
    }

    .template-card h3 {
        font-size: 0.85rem;
    }

    .admin-tab {
        flex: 1 1 100%;
    }

    .admin-panel-header {
        padding: 20px;
    }

    .admin-panel-main-inner {
        padding: 20px 16px 32px;
    }

    .admin-template-library-card {
        padding: 20px;
        gap: 18px;
    }

    .admin-template-toolbar {
        padding: 14px 16px;
    }

    .admin-template-layout,
    .admin-modifier-grid,
    .admin-plan-grid {
        grid-template-columns: 1fr;
    }

    .admin-template-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .admin-template-library-scroll {
        margin-right: -10px;
        padding-right: 10px;
    }

    .preview-carousel {
        min-height: 72px;
    }

    .carousel-item {
        flex: 0 0 56px !important;
        width: 56px !important;
        min-width: 56px !important;
        max-width: 56px !important;
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;
    }

    .carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .billing-header h1 {
        font-size: 1.5rem;
    }

    .plan-card {
        padding: 24px 20px;
    }

    :root { --tabbar-height: 68px; }
    .preview-carousel.vertical .carousel-nav { width: 30px; height: 30px; }
}

/* Billing & payment */
.payment-body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at top left, var(--background-start), var(--background-end));
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.billing-wrapper {
    width: min(1080px, 100%);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.billing-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.48);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

/* Compact variant to reduce vertical footprint */
.billing-header--compact {
    padding: 16px 20px;
    gap: 14px;
    align-items: center;
}
.billing-header--compact .billing-quick-stats { display: none; }
.billing-header--compact p:not(.billing-lede) { display: none; }
.billing-header--compact .billing-actions { margin-top: 8px; }
.billing-lede {
    margin: 0;
    color: var(--text-secondary);
}

.billing-header__lead {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.billing-header__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
    min-width: 200px;
}

.billing-header__brand-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(226, 232, 240, 0.6);
}

.billing-header__brand .site-title-text {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.billing-header p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 640px;
}

.billing-eyebrow,
.billing-section__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(226, 232, 240, 0.62);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.billing-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.billing-actions a {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.billing-actions a:hover {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.2);
}

.billing-actions .billing-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.billing-actions .billing-back-link:hover,
.billing-actions .billing-back-link:focus-visible {
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(2, 6, 23, 0.45);
    background: rgba(56, 189, 248, 0.12);
}

.billing-actions .billing-back-link::before {
    content: '←';
    font-size: 1.05em;
    line-height: 1;
}

.billing-quick-stats {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.billing-quick-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.58);
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.9rem;
}

.billing-quick-stat__icon {
    font-size: 1.05rem;
}

.billing-quick-stat__label {
    line-height: 1.2;
}

.billing-section {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.billing-section__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 640px;
}

.billing-section__header p {
    margin: 0;
    color: var(--text-secondary);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    box-shadow: 0 28px 76px rgba(2, 6, 23, 0.38);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 32px 92px rgba(56, 189, 248, 0.18);
}

.plan-card.current {
    border-color: var(--accent);
    box-shadow: 0 36px 96px rgba(56, 189, 248, 0.22);
}

.plan-card h2 {
    margin: 0;
    font-size: inherit;
}

.plan-card__title {
    color: var(--text-primary);
}

.plan-card__meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.plan-card__credits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.plan-card__credits-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: #e0f2fe;
}

.plan-card__credits-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(226, 232, 240, 0.7);
}

.plan-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.plan-card__price-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-card__price-note {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.6);
}

.plan-card__description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.plan-card__perks {
    margin: 0;
    padding-left: 18px;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.92rem;
}

.plan-card button {
    align-self: flex-start;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.18);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.plan-card button:hover {
    background: rgba(56, 189, 248, 0.26);
    border-color: var(--accent);
}

.plan-card__action {
    align-self: flex-start;
}

.plan-card__manage {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.5);
    color: var(--text-primary);
}

.plan-card__manage:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: var(--accent);
    color: var(--text-primary);
}

.plan-card__current {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.38);
    color: rgba(226, 232, 240, 0.85);
    cursor: default;
}

.plan-card__current:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.38);
}

.plan-card__notice {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: rgba(253, 224, 71, 0.85);
}

.plan-card .plan-tag {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 6px 12px;
    font-size: 0.7rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.36);
    color: rgba(226, 232, 240, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.plan-card button.is-loading {
    pointer-events: none;
    opacity: 0.75;
    color: rgba(226, 232, 240, 0.85);
}

.plan-card button.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(226, 232, 240, 0.85);
    border-top-color: transparent;
    animation: spin 0.75s linear infinite;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 575px) {
    .plan-card__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .plan-card__price {
        align-items: flex-start;
    }
}

.payment-status {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 0.95rem;
    min-height: 48px;
}

.payment-status.payment-status--loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-status.payment-status--loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(56, 189, 248, 0.35);
    border-top-color: rgba(168, 85, 247, 0.9);
    animation: spin 0.8s linear infinite;
}

.payment-body .text-success {
    color: var(--accent);
}

@keyframes celebrationPop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    60% {
        transform: scale(1.04);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes celebrationFade {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes celebrationConfetti {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(160px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes managePop {
    0% {
        transform: translateY(12px) scale(0.9);
        opacity: 0;
    }
    70% {
        transform: translateY(-6px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes manageFade {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.payment-celebration {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.payment-celebration__backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.28), transparent 60%),
        radial-gradient(circle at bottom, rgba(168, 85, 247, 0.22), transparent 65%);
    filter: blur(6px);
    opacity: 0.92;
    transition: opacity 0.4s ease;
}

.payment-celebration__card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px 36px;
    box-shadow: 0 40px 120px rgba(10, 14, 25, 0.65);
    max-width: min(420px, 90vw);
    width: min(420px, 90vw);
    text-align: center;
    pointer-events: auto;
    animation: celebrationPop 0.5s cubic-bezier(0.3, 1.2, 0.4, 1);
    overflow: hidden;
}

.payment-celebration__icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    text-shadow: 0 8px 30px rgba(56, 189, 248, 0.45);
}

.payment-celebration__card h2 {
    margin: 0 0 10px;
    font-size: 1.8rem;
}

.payment-celebration__card p {
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.payment-celebration__confetti {
    position: absolute;
    inset: -70px 0 auto;
    height: 180px;
    pointer-events: none;
}

.payment-celebration__confetti span {
    position: absolute;
    top: 0;
    width: 12px;
    height: 16px;
    border-radius: 4px;
    opacity: 0;
    animation: celebrationConfetti 2.4s linear infinite;
}

.payment-celebration__confetti span:nth-child(odd) {
    background: rgba(56, 189, 248, 0.9);
}

.payment-celebration__confetti span:nth-child(even) {
    background: rgba(168, 85, 247, 0.85);
}

.payment-celebration__confetti span:nth-child(1) { left: 8%; animation-delay: 0s; }
.payment-celebration__confetti span:nth-child(2) { left: 18%; animation-delay: 0.2s; }
.payment-celebration__confetti span:nth-child(3) { left: 28%; animation-delay: 0.35s; }
.payment-celebration__confetti span:nth-child(4) { left: 38%; animation-delay: 0.5s; }
.payment-celebration__confetti span:nth-child(5) { left: 48%; animation-delay: 0.65s; }
.payment-celebration__confetti span:nth-child(6) { left: 58%; animation-delay: 0.8s; }
.payment-celebration__confetti span:nth-child(7) { left: 68%; animation-delay: 0.95s; }
.payment-celebration__confetti span:nth-child(8) { left: 78%; animation-delay: 1.1s; }
.payment-celebration__confetti span:nth-child(9) { left: 88%; animation-delay: 1.25s; }
.payment-celebration__confetti span:nth-child(10) { left: 12%; animation-delay: 1.4s; }
.payment-celebration__confetti span:nth-child(11) { left: 34%; animation-delay: 1.55s; }
.payment-celebration__confetti span:nth-child(12) { left: 56%; animation-delay: 1.7s; }
.payment-celebration__confetti span:nth-child(13) { left: 70%; animation-delay: 1.85s; }
.payment-celebration__confetti span:nth-child(14) { left: 92%; animation-delay: 2s; }

.payment-celebration__close {
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-celebration__close:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.8);
}

.payment-celebration--closing .payment-celebration__card {
    animation: celebrationFade 0.35s ease forwards;
}

.payment-celebration--closing .payment-celebration__backdrop {
    opacity: 0;
}

.payment-manage {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-manage__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 32, 0.78);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.payment-manage__card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px 32px;
    width: min(420px, 90vw);
    text-align: center;
    box-shadow: 0 36px 110px rgba(10, 14, 25, 0.55);
    animation: managePop 0.4s cubic-bezier(0.35, 1.2, 0.4, 1);
}

.payment-manage__icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 12px;
}

.payment-manage__card h2 {
    margin: 0 0 10px;
    font-size: 1.6rem;
}

.payment-manage__card p {
    margin: 0 0 16px;
    color: var(--text-secondary);
}

.payment-manage__status {
    min-height: 20px;
    margin-bottom: 18px;
}

.payment-manage__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.payment-manage__actions .btn {
    min-width: 130px;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.payment-manage__actions .btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.payment-manage--busy .payment-manage__card {
    opacity: 0.85;
}

.payment-manage--success .payment-manage__card {
    border-color: var(--accent);
    box-shadow: 0 40px 120px var(--accent);
}

.payment-manage--closing .payment-manage__card {
    animation: manageFade 0.3s ease forwards;
}

.payment-manage--closing .payment-manage__backdrop {
    opacity: 0;
}

.pack-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.4);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pack-section__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pack-section__header h2 {
    margin: 0 0 6px;
    font-size: 1.6rem;
}

.pack-section__header p {
    margin: 0;
    color: var(--text-secondary);
}

.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.pack-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    box-shadow: 0 24px 64px rgba(2, 6, 23, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pack-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 30px 80px rgba(56, 189, 248, 0.16);
}

.pack-card--lifetime {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 28px 84px rgba(56, 189, 248, 0.18);
}

.pack-card--lifetime:hover {
    border-color: var(--accent);
    box-shadow: 0 32px 96px rgba(56, 189, 248, 0.24);
}

.pack-card--gold {
    border-color: rgba(56, 189, 248, 0.45);
}

.pack-card--diamond {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 30px 96px rgba(168, 85, 247, 0.18);
}

.pack-card--lifetime .pack-card__credits-badge {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
}

.pack-card--gold .pack-card__credits-badge {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
}

.pack-card--diamond .pack-card__credits-badge {
    background: rgba(168, 85, 247, 0.14);
    border-color: rgba(168, 85, 247, 0.38);
}

.pack-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 6px 12px;
    font-size: 0.72rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.36);
    color: rgba(226, 232, 240, 0.9);
}

.pack-tag--gold {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.42);
}

.pack-tag--diamond {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.5);
    color: #f3e8ff;
}

.pack-tag--promo {
    top: 46px;
    right: 14px;
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}

.pack-card__limited {
    margin: 4px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
    width: fit-content;
}

.pack-card__action {
    padding: 12px 24px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.9), rgba(168, 85, 247, 0.85));
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: var(--text-primary);
    box-shadow: 0 18px 36px rgba(56, 189, 248, 0.25);
}

.pack-card__action:hover,
.pack-card__action:focus-visible {
    background: linear-gradient(120deg, rgba(56, 189, 248, 1), rgba(168, 85, 247, 0.95));
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Tiered pack action variants */
.pack-card__action--classic {
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: var(--text-primary);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.18);
}

.pack-card__action--classic:hover,
.pack-card__action--classic:focus-visible {
    background: rgba(56, 189, 248, 0.26);
    border-color: var(--accent);
}

.pack-card__action--gold {
    background: linear-gradient(120deg, rgba(246, 166, 35, 0.9), rgba(246, 166, 35, 0.7));
    border: 1px solid rgba(246, 166, 35, 0.6);
    color: var(--text-primary);
    box-shadow: 0 18px 36px rgba(246, 166, 35, 0.22);
}

.pack-card__action--gold:hover,
.pack-card__action--gold:focus-visible {
    background: linear-gradient(120deg, rgba(246, 166, 35, 1), rgba(246, 166, 35, 0.85));
    border-color: rgba(246, 166, 35, 0.9);
}

.pack-card__action--diamond {
    background: linear-gradient(120deg, rgba(168, 85, 247, 0.9), rgba(56, 189, 248, 0.9));
    border: 1px solid rgba(168, 85, 247, 0.55);
    color: var(--text-primary);
    box-shadow: 0 20px 44px rgba(168, 85, 247, 0.25);
}

.pack-card__action--diamond:hover,
.pack-card__action--diamond:focus-visible {
    background: linear-gradient(120deg, rgba(168, 85, 247, 1), rgba(56, 189, 248, 1));
    border-color: rgba(168, 85, 247, 0.8);
}

/* Note under pack indicating lifetime plan unlock */
.pack-card__plan-note {
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.9);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    width: fit-content;
}

.pack-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pack-card__title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pack-card__title {
    margin: 0;
    font-size: inherit;
    color: var(--text-primary);
}

.pack-card__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pack-card__price-per-credit {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
}

.pack-card__savings {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}

.pack-card__credits-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
    width: fit-content;
}

.pack-card__credits-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e0f2fe;
}

.pack-card__credits-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.7);
}

.pack-card__description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.pack-card__perks {
    margin: 0;
    padding-left: 18px;
    color: rgba(226, 232, 240, 0.75);
    font-size: 0.88rem;
}

.pack-card button:not(.pack-card__action) {
    align-self: flex-start;
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.18);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.pack-card button:not(.pack-card__action):hover {
    background: rgba(56, 189, 248, 0.26);
    border-color: var(--accent);
}

.pack-card__notice {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: rgba(253, 224, 71, 0.85);
}

.pack-card button.is-loading {
    pointer-events: none;
    opacity: 0.75;
    color: rgba(226, 232, 240, 0.85);
}

.pack-card button.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(226, 232, 240, 0.85);
    border-top-color: transparent;
    animation: spin 0.75s linear infinite;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 575px) {
    .pack-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pack-card__price {
        align-self: flex-start;
    }
}

.checkout-summary .plan-grid {
    grid-template-columns: minmax(0, 1fr);
}

.checkout-plan-card {
    max-width: 560px;
    margin: 0 auto;
}

.checkout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.checkout-actions__retry {
    padding: 10px 24px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.18);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-actions__retry:hover,
.checkout-actions__retry:focus-visible {
    background: rgba(56, 189, 248, 0.28);
    border-color: var(--accent);
    outline: none;
}

.checkout-actions__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.checkout-actions__link:hover,
.checkout-actions__link:focus-visible {
    color: var(--text-primary);
    outline: none;
}

.admin-bootstrap-card {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bootstrap-controls .form-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.bootstrap-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.bootstrap-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(18, 18, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bootstrap-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 22px 45px rgba(56, 189, 248, 0.25);
}

.bootstrap-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bootstrap-card .bootstrap-meta {
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(5, 8, 12, 0.9) 100%);
    padding: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.78);
}

.bootstrap-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: rgba(12, 12, 20, 0.85);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.bootstrap-remove:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.05);
}

.bootstrap-empty {
    padding: 1.5rem;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    color: var(--text-secondary);
    background: rgba(12, 12, 20, 0.6);
}

/* ----- Tier & Plan Styling ----- */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.plan-badge--free {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(229, 231, 235, 0.85);
}

.plan-badge--premium {
    background: linear-gradient(135deg, rgba(253, 224, 71, 0.28), rgba(250, 204, 21, 0.12));
    border-color: rgba(253, 224, 71, 0.45);
    color: #facc15;
    box-shadow: 0 8px 24px rgba(253, 224, 71, 0.25);
}

.plan-badge--premiumPlus {
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.28), rgba(165, 243, 252, 0.15));
    border-color: rgba(125, 211, 252, 0.5);
    color: #7dd3fc;
    box-shadow: 0 10px 28px rgba(125, 211, 252, 0.25);
}

.tier-badge,
.tier-chip,
.template-tier-badge,
.plan-preview-tier {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(229, 231, 235, 0.85);
}

.tier-badge--guest,
.tier-chip--guest {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(229, 231, 235, 0.9);
}

.tier-badge--gold,
.tier-chip--gold,
.plan-preview-item--premium .plan-preview-tier {
    background: linear-gradient(135deg, rgba(253, 186, 116, 0.25), rgba(245, 158, 11, 0.18));
    border-color: rgba(245, 158, 11, 0.45);
    color: #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.tier-badge--diamond,
.tier-chip--diamond,
.plan-preview-item--premiumPlus .plan-preview-tier {
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(110, 231, 183, 0.15));
    border-color: rgba(125, 211, 252, 0.5);
    color: #67e8f9;
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.22);
}

.template-card {
    position: relative;
}

.template-tier-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    pointer-events: none;
}

.template-card--locked {
    cursor: not-allowed;
}

.template-card--locked .template-card-actions .btn,
.template-card--locked .template-profile-header,
.template-card--locked .template-profile-previews,
.template-card--locked .template-meta {
    filter: grayscale(0.25) brightness(0.85);
}

.template-lock-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.85), rgba(4, 6, 12, 0.92));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.template-card--locked .template-lock-overlay {
    opacity: 1;
    pointer-events: auto;
}

.lock-overlay-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.lock-icon {
    font-size: 1.1rem;
}

.lock-tease {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(229, 231, 235, 0.8);
    text-align: center;
}

@keyframes lockedShake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-4px);
    }
    40%, 80% {
        transform: translateX(4px);
    }
}

.template-card--shake {
    animation: lockedShake 0.45s ease;
}

.modifier-chip--shake {
    animation: lockedShake 0.4s ease;
}

.locked-action {
    position: relative;
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

.locked-action[data-locked-copy]::after {
    content: attr(data-locked-copy);
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(10, 12, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.locked-action[data-locked-copy]:hover::after {
    opacity: 1;
}

.modifiers-chip-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 6px 4px;
    border-radius: 14px;
    background: rgba(15, 18, 28, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
}

.modifiers-chip-scroll::-webkit-scrollbar {
    width: 6px;
}

.modifiers-chip-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.modifiers-chip-scroll::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 3px;
}

.modifiers-chip-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

.modifiers-chip-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 8px;
}

.modifier-chip {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(13, 17, 28, 0.75);
    color: rgba(226, 232, 240, 0.85);
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modifier-chip .modifier-label {
    font-weight: 600;
    text-align: left;
}

.modifier-chip .modifier-tier {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    text-transform: uppercase;
}

.plan-preview-icon {
    font-size: 1rem;
}

.modifier-chip .modifier-tier-icon {
    font-size: 0.82rem;
}

.modifier-chip.active {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.18);
    color: var(--text-primary);
}

.modifier-chip--locked {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
}

.modifier-chip--inactive {
    opacity: 0.35;
}

.plan-preview-list {
    display: grid;
    gap: 18px;
}

.plan-preview-item {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 13, 20, 0.85);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.plan-preview-item:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
}

.plan-preview-item--current {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 18px 46px rgba(56, 189, 248, 0.22);
}

.plan-preview-item--premium {
    border-color: rgba(245, 158, 11, 0.35);
}

.plan-preview-item--premiumPlus {
    border-color: rgba(59, 130, 246, 0.4);
}

.plan-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.plan-preview-credits {
    font-size: 0.92rem;
    color: rgba(226, 232, 240, 0.9);
    font-weight: 600;
}

.plan-preview-price {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plan-preview-description {
    margin: 0;
    color: rgba(226, 232, 240, 0.8);
    font-size: 0.86rem;
}

.plan-preview-perks {
    margin: 0;
    padding-left: 18px;
    font-size: 0.82rem;
    color: rgba(209, 213, 219, 0.85);
    display: grid;
    gap: 6px;
}

.plan-preview-current {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent);
}

/* Photolab styles - Lean & Minimalistic */
.photolab-body {
    min-height: 100vh;
    background: #0a0a0a;
    color: #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Header */
.photolab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #111;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}

/* Apply the same cool animated gradient effect as the main page title */
.photolab-header .photolab-title {
    position: relative;
    background: conic-gradient(from var(--glimmer-angle),
        hsl(192 93% 62%),
        hsl(259 94% 72%),
        hsl(320 87% 67%),
        hsl(192 93% 62%));
    background-size: 200% 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: spectralOrbit 12s linear infinite;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.28));
}

.photolab-header .photolab-title::after {
    content: '';
    position: absolute;
    inset: 8% -6% 0 -6%;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.08));
    mix-blend-mode: screen;
    opacity: 0.6;
    filter: blur(12px);
    z-index: -1;
}

.photolab-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.photolab-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.photolab-back {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.photolab-back:hover {
    color: #fff;
}

.photolab-title {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.photolab-account-email {
    font-size: 0.85rem;
    color: #999;
}

.photolab-credit-chip {
    padding: 0.25rem 0.75rem;
    background: #1a1a1a;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #ffc454;
}

/* Main Layout - 3 Columns */
.photolab-main {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    overflow: visible;
}

/* Sidebars */
.photolab-sidebar {
    background: #111;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.photolab-sidebar-left {
    border-right: 1px solid #222;
    padding: 1.5rem;
}

.photolab-sidebar-right {
    border-left: 1px solid #222;
    padding: 1.5rem;
}

/* Keep Generate visible at the top of the right sidebar */
.photolab-sidebar-right > .photolab-section:has(#photolabStartBtn) {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #111;
    padding-top: 1rem;
    margin-top: -1rem;
    border-bottom: 1px solid #222;
}

.photolab-section {
    margin-bottom: 2rem;
}

.photolab-section:last-child {
    margin-bottom: 0;
}

/* Keep Generate visible at the very top; push Video to the bottom (admin) */
.photolab-sidebar-left > .photolab-section:has(#photolabStartBtn) {
    order: -100;
    position: sticky;
    top: 0;
    background: #111;
    z-index: 6;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #222;
}

.photolab-sidebar-left > .photolab-section:has(#photolabStartBtn)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -16px;
    height: 16px;
    background: linear-gradient(to top, rgba(17, 17, 17, 0), rgba(17, 17, 17, 1));
    pointer-events: none;
}

.photolab-sidebar-left > .photolab-section:has(#photolabFilters) {
    order: -90;
}

.photolab-sidebar-left > .photolab-section:has(#photolabVideoPrompt) {
    order: -80;
}

.photolab-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin: 0 0 1rem 0;
}

/* Dropzone */
.photolab-dropzone {
    width: 100%;
    min-height: 180px;
    border: 2px dashed #333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #0a0a0a;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.photolab-dropzone:hover,
.photolab-dropzone.is-dragover {
    border-color: #555;
    background: #151515;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15), 0 12px 32px rgba(56, 189, 248, 0.08);
    transform: translateY(-1px);
}

.photolab-dropzone-icon {
    font-size: 2.25rem;
    color: #aaa;
}

/* Animated glow border and helper label */
.photolab-dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from var(--glimmer-angle), #38bdf8, #a855f7, #38bdf8);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spectralOrbit 8s linear infinite;
    opacity: 0.25;
    pointer-events: none;
}

.photolab-dropzone.is-dragover::before {
    opacity: 0.55;
}

.photolab-dropzone::after {
    content: 'Drop images or click';
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* Preview List */
.photolab-preview-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.photolab-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.photolab-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photolab-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.photolab-preview-item:hover .photolab-preview-remove {
    opacity: 1;
}

.photolab-preview-remove:hover {
    background: rgba(255, 50, 50, 0.9);
}

.photolab-preview-item.is-selected {
    border-color: #38bdf8;
    transform: translateY(-2px);
}

/* Filter List - Compact Dropdown Style */
.photolab-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.photolab-filter-list::-webkit-scrollbar {
    width: 4px;
}

.photolab-filter-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 999px;
}

.photolab-filter-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    background: #0a0a0a;
}

.photolab-filter-option:hover {
    background: #1a1a1a;
}

.photolab-filter-option.is-selected {
    background: #1a1a2a;
    border-left: 3px solid #7856ff;
}

.photolab-filter-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photolab-filter-name {
    font-size: 0.9rem;
    color: #ddd;
}

.photolab-filter-empty {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

/* Instructions & Generate Button */
.photolab-textarea {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem;
    color: #ddd;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
}

.photolab-textarea:focus {
    outline: none;
    border-color: #555;
}

.photolab-start-btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
}

.photolab-status {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
}

.photolab-status--success {
    color: #4ade80;
}

.photolab-status--warning {
    color: #fbbf24;
}

.photolab-status--error {
    color: #f87171;
}

/* Video task list */
.photolab-video-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.photolab-video-task-empty {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    padding: 0.75rem;
    border: 1px dashed #222;
    border-radius: 8px;
}

.photolab-video-task {
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.photolab-video-task[data-status="failed"] {
    border-color: rgba(248, 113, 113, 0.4);
}

.photolab-video-task[data-status="completed"] {
    border-color: rgba(74, 222, 128, 0.4);
}

.photolab-video-task__header {
    display: flex;
    gap: 0.75rem;
}

.photolab-video-task__preview {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photolab-video-task__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photolab-video-task__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.photolab-video-task__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f3f4f6;
}

.photolab-video-task__status {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b5cf6;
}

.photolab-video-task[data-status="processing"] .photolab-video-task__status,
.photolab-video-task[data-status="created"] .photolab-video-task__status,
.photolab-video-task[data-status="uploading"] .photolab-video-task__status {
    color: #38bdf8;
}

.photolab-video-task[data-status="failed"] .photolab-video-task__status {
    color: #f87171;
}

.photolab-video-task[data-status="completed"] .photolab-video-task__status {
    color: #4ade80;
}

.photolab-video-task__prompt {
    font-size: 0.75rem;
    color: #94a3b8;
}

.photolab-video-task__message {
    font-size: 0.75rem;
    color: #a1a1aa;
}

.photolab-video-task__message.is-error {
    color: #f87171;
}

.photolab-video-task__message.is-success {
    color: #4ade80;
}

.photolab-video-task__message.is-muted {
    color: #555;
}

.photolab-video-task__media {
    border-radius: 12px;
    overflow: hidden;
    background: #050505;
    border: 1px solid #1f1f1f;
}

.photolab-video-task__media video {
    width: 100%;
    display: block;
    background: #000;
}

.photolab-video-task__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.photolab-video-task__actions a {
    font-size: 0.75rem;
    color: #38bdf8;
    text-decoration: none;
}

.photolab-video-task__actions a:hover {
    text-decoration: underline;
}

/* Preview Area - Center */
.photolab-preview-area {
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.photolab-viewer-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
    gap: 0.5rem;
}

.photolab-placeholder-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.photolab-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.photolab-viewer-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
    max-height: calc(100vh - 200px);
    min-height: 300px;
}

.photolab-viewer-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.photolab-viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: #888;
    font-size: 0.9rem;
    animation: shimmerBg 2.2s linear infinite;
}

.photolab-viewer-loading::before {
    content: '';
    width: 22px;
    height: 22px;
    margin-right: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

.photolab-viewer-toolbar {
    padding: 1rem 1.5rem;
    background: #111;
    border-top: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.photolab-viewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.photolab-viewer-filter {
    font-weight: 600;
    font-size: 0.95rem;
}

.photolab-viewer-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #1a1a1a;
}

.photolab-viewer-status[data-status='completed'] {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.photolab-viewer-status[data-status='failed'] {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.photolab-viewer-status[data-status='pending'],
.photolab-viewer-status[data-status='created'] {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.photolab-viewer-actions {
    display: flex;
    gap: 0.5rem;
}

/* History List - Right Sidebar */
.photolab-empty-state {
    padding: 1rem;
    text-align: center;
    color: #555;
    font-size: 0.85rem;
}

.photolab-request-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
}

.photolab-request-list::-webkit-scrollbar {
    width: 4px;
}

.photolab-request-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 999px;
}

.photolab-request-list::-webkit-scrollbar-track {
    background: transparent;
}

.photolab-request-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 0.75rem;
}

.photolab-request-card:hover {
    background: #151515;
}

.photolab-request-card.is-selected {
    border-color: #7856ff;
    background: #1a1a2a;
}

.photolab-request-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: #1a1a1a;
    flex-shrink: 0;
}

.photolab-request-thumb.is-loading {
    background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* Inline spinner beside in-progress status */
.photolab-request-status.status-pending::before,
.photolab-request-status.status-created::before,
.photolab-request-status.status-processing::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-top-color: #fbbf24;
    animation: spin 0.9s linear infinite;
    vertical-align: -2px;
}

.photolab-request-thumb.is-error {
    background: #2a1a1a;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shimmerBg {
    0% { background-color: rgba(0,0,0,0.78); }
    50% { background-color: rgba(0,0,0,0.72); }
    100% { background-color: rgba(0,0,0,0.78); }
}

.photolab-request-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.photolab-request-filter {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photolab-request-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}

.photolab-request-status.status-completed {
    color: #4ade80;
}

.photolab-request-status.status-failed {
    color: #f87171;
}

.photolab-request-status.status-pending,
.photolab-request-status.status-created {
    color: #fbbf24;
}

/* Busy buttons (Photolab only) */
.photolab-body .btn[aria-busy="true"] {
    position: relative;
    pointer-events: none;
    opacity: 0.95;
}

.photolab-body .btn[aria-busy="true"]::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 1200px) {
    .photolab-main {
        grid-template-columns: 260px 1fr 280px;
    }
    
    .photolab-viewer-image-container {
        max-height: calc(100vh - 180px);
        min-height: 250px;
    }
    
    .photolab-request-list {
        max-height: calc(100vh - 230px);
    }
}

@media (max-width: 900px) {
    .photolab-main {
        grid-template-columns: 1fr;
    }
    
    .photolab-sidebar-left,
    .photolab-sidebar-right {
        display: none;
    }
    
    .photolab-viewer-image-container {
        max-height: 60vh;
        min-height: 200px;
    }
    
    .photolab-viewer-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
