/* ==========================================================
   Base / reset
   ========================================================== */
:root {
    --color-primary: #7c8cff;
    --color-primary-dark: #6474f5;
    --color-text: #e8edf5;
    --color-text-muted: #b5bfd0;
    --color-bg: #070b12;
    --color-bg-alt: #0c111b;
    --color-border: #223044;
    --color-success: #067647;
    --color-success-bg: rgba(6, 118, 71, 0.16);
    --color-error: #f87171;
    --color-error-bg: rgba(180, 35, 24, 0.18);
    --radius: 12px;
    --max-width: 1120px;
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--color-text);
    background:
        radial-gradient(circle at top left, rgba(124, 140, 255, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 22%),
        linear-gradient(180deg, #05070c 0%, #0a0f17 100%);
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: auto;
    text-shadow: none;
}

body *,
body *::before,
body *::after {
    text-shadow: none;
}

.subtext,
.eyebrow,
.status-label,
.status-value,
label,
.site-nav a {
    text-shadow: none;
}

body.app-shell-page {
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 20%),
        linear-gradient(180deg, #05060a 0%, #090d14 100%);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
h1, h2, h3, h4 { font-family: Rubik, "DM Sans", sans-serif; font-weight: 500; }
button, .btn, label { font-weight: 500; }

.subtext { color: #c3ccda; font-weight: 500; }

/* Site-wide typography normalization: neutral, readable app text. */
body {
    color: #eeeeee;
    -webkit-font-smoothing: auto;
    text-rendering: optimizeLegibility;
}

body h1,
body h2,
body h3,
body h4 {
    color: #f1f1f1;
    font-family: Rubik, "DM Sans", sans-serif;
    font-weight: 500;
    letter-spacing: 0;
    text-shadow: none;
}

body p,
body span,
body label,
body button,
body input,
body textarea,
body select,
body a {
    text-shadow: none;
    filter: none;
}

body p,
body label,
body .subtext,
body .app-nav-meta,
body .app-user-plan {
    color: #b8b8b8;
    font-weight: 400;
}

body a,
body .app-nav-title,
body .status-text,
body .status-value {
    color: #e1e1e1;
}

body .eyebrow,
body .section-kicker,
body .downloads-eyebrow {
    color: #b0b0b0;
    font-weight: 600;
    letter-spacing: .08em;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================
   Header / nav
   ========================================================== */
.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 9, 15, 0.86);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 140, 255, 0.14);
    border: 1px solid rgba(124, 140, 255, 0.22);
    color: #aebcff;
    font-weight: 800;
    font-size: 0.96rem;
    line-height: 1;
    text-transform: uppercase;
}

.brand-text {
    letter-spacing: 0.02em;
}

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

.site-nav a {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.site-nav a.active,
.site-nav a:hover { color: var(--color-text); text-decoration: none; }

.site-nav .btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 999px;
    background: #f4f4f2;
    color: #0e1013;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(255,255,255,0.12);
    font-weight: 700;
}
.site-nav .btn.btn-primary:hover {
    background: #ffffff;
    color: #0e1013;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--color-text);
}

/* ==========================================================
   App shell
   ========================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 26%),
        linear-gradient(180deg, #05060a 0%, #090d14 100%);
}

.app-sidebar {
    width: 270px;
    flex: 0 0 270px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(10, 13, 20, 0.98), rgba(7, 9, 14, 0.98));
    padding: 22px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
}

.app-brand-text {
    letter-spacing: 0.02em;
}

.app-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.16);
    color: #92a1ff;
    font-size: 1.05rem;
    line-height: 1;
    border: 1px solid rgba(129, 140, 248, 0.18);
    font-weight: 800;
    text-transform: uppercase;
}

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

.app-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 14px;
    color: #b8c1d6;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(17, 20, 28, 0.76);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.app-nav-link:hover,
.app-nav-link.active {
    color: #eef3ff;
    background: rgba(24, 29, 39, 0.96);
    border-color: rgba(129, 140, 248, 0.28);
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.18), 0 6px 18px rgba(10, 12, 18, 0.28);
}

.app-nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.12);
    color: #dfe7ff;
    font-size: 1rem;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.app-nav-title {
    display: block;
    font-weight: 600;
    font-size: 0.96rem;
}

.app-nav-subtitle {
    display: block;
    color: #7e889b;
    font-size: 0.8rem;
    margin-top: 2px;
}

.app-sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.app-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.95), rgba(37, 99, 235, 0.85));
    color: #fff;
    font-weight: 700;
}

.app-user-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.app-user-meta {
    color: #7e889b;
    font-size: 0.82rem;
}

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

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 12, 18, 0.94);
    backdrop-filter: blur(14px);
}

.app-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7e889b;
    font-size: 0.92rem;
}

.app-breadcrumbs a {
    color: #7e889b;
    text-decoration: none;
}

.app-breadcrumbs a:hover {
    color: #e8edf5;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-user-menu {
    position: relative;
}

.app-user-chip {
    border: 1px solid #363636;
    cursor: pointer;
    font: inherit;
    transition: border-color 140ms ease, background 140ms ease;
}

.app-user-chip:hover,
.app-user-chip:focus-visible {
    background: #2b2b2b;
    border-color: #f1f1f1;
    outline: none;
}

.app-user-dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 10px);
    right: 0;
    width: 210px;
    padding: 7px;
    border: 1px solid #363636;
    border-radius: 12px;
    background: #171717;
}

.app-user-dropdown[hidden] {
    display: none;
}

.app-user-dropdown-heading {
    display: grid;
    gap: 3px;
    padding: 8px 10px 10px;
    border-bottom: 1px solid #2b2b2b;
}

.app-user-dropdown-heading strong {
    color: #f4f4f4;
    font-size: .82rem;
}

.app-user-dropdown-heading small {
    overflow: hidden;
    color: #969696;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-dropdown a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #e8e8e8;
    font-size: .78rem;
    text-decoration: none;
}

.app-user-dropdown a:hover,
.app-user-dropdown a:focus-visible {
    background: #292929;
    color: #fff;
    outline: none;
}

.app-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #d8deea;
    font-size: 0.9rem;
}

.app-balance-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .2), 0 0 12px rgba(34, 197, 94, .8);
}

.app-balance-dot.status-balance-low {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .2), 0 0 12px rgba(239, 68, 68, .8);
}

.app-user-chip {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.18);
    color: #f3f5fb;
    font-weight: 700;
}

.app-content {
    flex: 1;
    padding: 28px;
}

.app-container {
    max-width: none;
    padding: 0;
}

.admin-subnav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(11, 15, 24, 0.72);
    backdrop-filter: blur(14px);
}

.admin-subnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: #9aa6ba;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.admin-subnav-link:hover,
.admin-subnav-link.active {
    color: #f3f5fb;
    background: rgba(124, 140, 255, 0.14);
    border-color: rgba(124, 140, 255, 0.22);
    text-decoration: none;
}

@media (max-width: 1080px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
        position: relative;
        top: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .app-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .app-topbar {
        height: auto;
        padding: 16px 18px;
        gap: 14px;
        align-items: flex-start;
        flex-direction: column;
    }

    .app-topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .app-content {
        padding: 18px;
    }

    .app-nav {
        grid-template-columns: 1fr;
    }

    .app-nav-link {
        padding: 10px 10px;
    }
}

/* The background selector is part of the playground, not a nested card. */
body.camera-simple .xmax-background-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    width: min(100%, 452px);
    max-width: 452px;
}
body.camera-simple .xmax-background-card .device-field { padding: 0; }
body.camera-simple .xmax-background-upload,
body.camera-simple .xmax-primary-reference,
body.camera-simple .xmax-secondary-reference {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(100%, 452px);
    max-width: 452px;
    min-height: 88px;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #303030;
    border-radius: 12px;
    background: #181818;
}
body.camera-simple .xmax-background-upload[hidden] { display: none; }
body.camera-simple .xmax-background-inline-actions {
    width: min(100%, 452px);
    margin-top: 8px;
}
body.camera-simple .xmax-background-inline-actions .btn-small {
    margin: 0;
}
body.camera-simple .xmax-background-upload > label,
body.camera-simple .xmax-primary-reference > label,
body.camera-simple .xmax-secondary-reference > label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    margin: 0 !important;
}
body.camera-simple .xmax-background-upload > input[type="file"],
body.camera-simple .xmax-primary-reference > input[type="file"],
body.camera-simple .xmax-secondary-reference > input[type="file"] {
    width: 100%;
    min-height: 34px;
    height: 34px;
    box-sizing: border-box;
    font-size: 0.76rem;
    line-height: 1.2;
    color: #96a2b3;
    background: #202020;
    border: 1px dashed #3a3a3a;
    border-radius: 8px;
    padding: 5px;
    margin: 0;
}
body.camera-simple .xmax-background-upload {
    row-gap: 8px;
}
body.camera-simple .xmax-background-upload > label,
body.camera-simple .xmax-background-upload > input[type="file"] {
    margin-bottom: 0;
}
body.camera-simple .xmax-background-upload input[type="file"]::file-selector-button,
body.camera-simple .xmax-primary-reference input[type="file"]::file-selector-button,
body.camera-simple .xmax-secondary-reference input[type="file"]::file-selector-button {
    margin-right: 6px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: #2b2b2b;
    color: #f5f7fb;
    cursor: pointer;
}
body.camera-simple .xmax-background-upload img,
body.camera-simple .xmax-primary-reference img,
body.camera-simple .xmax-secondary-reference img,
body.camera-simple .xmax-dimx-scene img {
    display: block;
    width: min(100%, 200px);
    max-height: 145px;
    margin-top: 0;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

body.camera-simple .xmax-scene-options {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    background: transparent !important;
    padding: 0 !important;
}
body.camera-simple .xmax-scene-option {
    position: relative;
    min-width: 0 !important;
    min-height: 98px !important;
    padding: 5px !important;
    overflow: hidden;
    background: #202020 !important;
    border: 1px solid #303030 !important;
}
body.camera-simple .xmax-scene-option img {
    display: block !important;
    width: 100% !important;
    height: 66px !important;
    max-height: none !important;
    object-fit: cover;
    border: 0;
    border-radius: 5px;
}
body.camera-simple .xmax-scene-option span {
    display: block !important;
    padding-top: 5px;
    font-size: .72rem;
}

body.camera-simple #xmaxCustomBackgroundPreview,
body.camera-simple #xmaxDimxScenePreview {
    width: min(100%, 280px) !important;
    height: 160px !important;
    max-height: 160px !important;
    object-fit: contain;
    background: #111;
}

.xmax-scene-option.is-selected {
    border-color: #7c8cff !important;
    box-shadow: 0 0 0 2px rgba(124, 140, 255, .32), 0 6px 18px rgba(0, 0, 0, .28) !important;
}
.xmax-scene-option.is-selected::after {
    content: '\2713';
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #7c8cff;
    color: #10131f;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
}

/* Camera UI refresh: presentation only. Existing controls and their IDs stay
   untouched so the realtime, upload, and mode flows continue to work. */
body.camera-simple {
    background: #151515;
    color: #f3f3f3;
}
body.camera-simple .app-content { padding: 0 24px 44px; }
body.camera-simple .camera-workspace {
    width: min(1040px, 100%);
    max-width: none;
    margin: 0 auto;
    gap: 22px;
}
body.camera-simple .camera-page-head { gap: 0; }
body.camera-simple .camera-product-bar {
    padding: 36px 0 20px;
    border-bottom: 1px solid #2b2b2b;
}
body.camera-simple .camera-product-title h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -.035em;
}
body.camera-simple .camera-tabs {
    gap: 24px;
    padding: 0;
    border: 0;
}
body.camera-simple .camera-tabs a:first-child {
    padding: 14px 0 11px;
    color: #f4f4f4;
    border-bottom: 2px solid #f4f4f4;
    font-size: .9rem;
}
body.camera-simple .camera-tabs a:last-child { margin-left: auto; }
body.camera-simple .camera-route-card { display: none; }
body.camera-simple .camera-grid { gap: 16px; }
body.camera-simple .camera-card {
    padding: 16px;
    border: 1px solid #323232;
    border-radius: 16px;
    background: #181818;
    box-shadow: none;
}
body.camera-simple .camera-card .section-head { margin-bottom: 12px; }
body.camera-simple .camera-card .eyebrow {
    display: none;
}
body.camera-simple .camera-card .section-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
}
body.camera-simple .camera-card .section-head > .badge { display: none; }
body.camera-simple .camera-card .video-frame {
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 10px;
    background: #242424;
}
@media (max-width: 768px) {
    body.camera-studio-page.camera-simple .camera-card .video-frame,
    body.camera-simple .camera-card .video-frame {
        aspect-ratio: 9 / 16;
    }
    body.camera-studio-page.camera-simple .camera-card .video-frame.ai-frame,
    body.camera-simple .camera-card .video-frame.ai-frame {
        aspect-ratio: 16 / 9;
    }
    body.camera-simple .camera-card .video-frame video {
        object-fit: contain;
    }
}
body.camera-simple .camera-card .video-overlay { background: transparent; }
body.camera-simple .camera-controls-main,
body.camera-simple .camera-controls-ai {
    margin-top: 12px;
    gap: 8px;
}
body.camera-simple .camera-controls .btn {
    padding: 8px 13px;
    border-radius: 9px;
    font-size: .78rem;
    }
    body.camera-simple .camera-controls .btn:disabled {
        background: rgba(255, 255, 255, 0.1);
        color: var(--color-text-muted);
        cursor: not-allowed;
    }

    /* Authenticated navigation collapses into a clean slide-out menu on phones. */
    .app-nav-toggle {
        display: none;
        width: 40px;
        height: 40px;
        padding: 9px;
        border: 1px solid #3a3a3a;
        border-radius: 9px;
        background: #242424;
        cursor: pointer;
    }
    .app-nav-toggle span {
        display: block;
        height: 2px;
        margin: 4px 0;
        border-radius: 2px;
        background: #d0d0d0;
    }

    @media (max-width: 720px) {
        body.app-shell-page {
            overflow-x: hidden;
        }
        body.app-shell-page .app-shell {
            display: block;
            min-height: 100vh;
        }
        body.app-shell-page .app-sidebar {
            position: fixed;
            z-index: 30;
            inset: 0 auto 0 0;
            width: min(86vw, 320px);
            height: 100vh;
            box-sizing: border-box;
            padding: 18px 14px;
            border-right: 1px solid #303030;
            border-bottom: 0;
            background: #171717;
            transform: translateX(-105%);
            transition: transform 180ms ease;
            box-shadow: 18px 0 40px rgba(0, 0, 0, .35);
        }
        body.app-shell-page .app-sidebar.open {
            transform: translateX(0);
        }
        body.app-shell-page .app-main {
            width: 100%;
        }
        body.app-shell-page .app-topbar {
            position: sticky;
            top: 0;
            z-index: 20;
            min-height: 64px;
            box-sizing: border-box;
            padding: 12px 14px;
            flex-direction: row;
            align-items: center;
            gap: 10px;
        }
        body.app-shell-page .app-nav-toggle {
            display: block;
            flex: 0 0 40px;
        }
        body.app-shell-page .app-breadcrumbs {
            min-width: 0;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            font-size: .82rem;
        }
        body.app-shell-page .app-topbar-right {
            width: auto;
            margin-left: auto;
            gap: 8px;
        }
        body.app-shell-page .app-balance-pill {
            max-width: 120px;
            padding: 7px 9px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            font-size: .76rem;
        }
        body.app-shell-page .app-user-chip {
            width: 34px;
            height: 34px;
            flex: 0 0 34px;
        }
        body.app-shell-page .app-content {
            padding: 14px;
        }
        body.app-shell-page .app-nav {
            display: flex;
            flex-direction: column;
        }
    }
body.camera-simple .camera-controls-ai { justify-content: flex-start; }
body.camera-simple .ai-toolbar { min-height: 0; }
body.camera-simple .ai-hint { display: none; }
body.camera-simple .ai-status-row { display: none; }
body.camera-simple .camera-settings {
    padding: 0;
    gap: 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .camera-settings-head {
    display: block;
    margin-top: 2px;
}
body.camera-simple .camera-settings-head .eyebrow { display: none; }
body.camera-simple .camera-settings-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}
body.camera-simple .camera-settings-head p { display: none; }
body.camera-simple .xmax-mode-card,
body.camera-simple .xmax-background-card,
body.camera-simple .ai-transform-form {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .xmax-mode-card label,
body.camera-simple .xmax-background-card label,
body.camera-simple .ai-transform-form > .device-field > label {
    margin-bottom: 7px;
    color: #9e9e9e;
    font-size: .78rem;
}
body.camera-simple .xmax-mode-options {
    display: inline-flex;
    width: auto;
    max-width: 300px;
    padding: 4px;
    gap: 6px;
    border: 0;
    border-radius: 13px;
    background: #242424;
}
body.camera-simple .xmax-background-options {
    width: fit-content;
    max-width: 100%;
    padding: 4px;
    gap: 2px;
    border: 0;
    border-radius: 13px;
    background: #242424;
}
body.camera-simple .xmax-mode-option,
body.camera-simple .xmax-background-option {
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #a9a9a9;
    font-size: .78rem;
}
body.camera-simple .xmax-mode-option {
    flex: 0 0 auto;
    min-width: 84px;
}
body.camera-simple .xmax-mode-option.is-selected,
body.camera-simple .xmax-background-option.is-selected {
    background: #3b3b3b;
    color: #f5f5f5;
    box-shadow: none;
}
body.camera-simple .xmax-mode-option span { display: none; }
body.camera-simple .xmax-mode-card .subtext,
body.camera-simple .xmax-background-status,
body.camera-simple .ai-transform-form > p.subtext,
body.camera-simple .ai-form-row { display: none; }
body.camera-simple .ai-transform-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 18px;
}
body.camera-simple .xmax-prompt-field { grid-column: 1 / -1; }
body.camera-simple .xmax-prompt-field textarea {
    min-height: 58px;
    padding: 11px 12px;
    border: 1px solid #303030;
    border-radius: 10px;
    background: #1b1b1b;
    font-size: .82rem;
}
body.camera-simple .ai-preset-row { display: none; }
body.camera-simple .camera-settings-grid { gap: 14px; }
body.camera-simple .xmax-primary-reference,
body.camera-simple .xmax-secondary-reference {
    padding: 12px;
    border: 1px solid #303030;
    border-radius: 12px;
    background: #181818;
}
body.camera-simple .xmax-primary-reference input[type="file"],
body.camera-simple .xmax-secondary-reference input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed #4a4a4a;
    border-radius: 8px;
    background: #202020;
    font-size: .75rem;
}
body.camera-simple .xmax-background-upload,
body.camera-simple .xmax-primary-reference,
body.camera-simple .xmax-secondary-reference {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 452px !important;
    max-width: 100% !important;
    margin: 0;
}
body.camera-simple .xmax-background-card {
    width: 452px !important;
    max-width: 100% !important;
}
body.camera-simple .xmax-primary-reference .subtext,
body.camera-simple .xmax-secondary-reference .subtext,
body.camera-simple .active-image-pill { display: none; }
body.camera-simple .xmax-action-row { grid-column: 1 / -1; margin-top: 0; }
body.camera-simple .xmax-action-row .btn {
    padding: 9px 14px;
    border-radius: 9px;
    font-size: .78rem;
}
body.camera-simple .camera-advanced {
    margin-top: 0;
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid #2b2b2b;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .camera-advanced .camera-settings-head p { display: none; }
@media (max-width: 760px) {
    body.camera-simple .app-content { padding: 0 14px 30px; }
    body.camera-simple .camera-product-bar { padding-top: 24px; }
    body.camera-simple .camera-grid,
    body.camera-simple .ai-transform-form,
    body.camera-simple .camera-settings-grid { grid-template-columns: 1fr; }
    body.camera-simple .xmax-prompt-field,
    body.camera-simple .xmax-action-row { grid-column: auto; }
    body.camera-simple .xmax-mode-options,
    body.camera-simple .xmax-background-options { width: 100%; overflow-x: auto; }
}

/* Final visual state: Account is free on the page, and Background is not a
   nested card. These rules intentionally come last to beat legacy sizing. */
body.account-page .app-container { max-width: 900px; margin: 0; }
body.account-page .panel {
    padding: 0;
    margin: 0 0 30px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.account-page .panel + .panel {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
body.camera-simple .xmax-background-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .xmax-background-card .device-field { padding: 0; }

/* Keep the signed-in workspace compact without changing camera behavior. */
body.camera-simple .app-content { padding: 18px 22px; }
body.camera-simple .camera-workspace { max-width: 1040px; margin: 0 auto; gap: 12px; }
body.camera-simple .camera-page-head { gap: 10px; }
body.camera-simple .camera-product-title h1 { font-size: 1.75rem; }
body.camera-simple .camera-tabs { padding-bottom: 6px; }
body.camera-simple .camera-route-card,
body.camera-simple .camera-card,
body.camera-simple .camera-settings,
body.camera-simple .camera-advanced { padding: 16px; }
body.camera-simple .camera-route-card { gap: 10px; }
body.camera-simple .camera-route-head { gap: 10px; }
body.camera-simple .camera-route-option { padding: 12px; border-radius: 13px; }
body.camera-simple .camera-route-option p { margin-top: 6px; line-height: 1.4; font-size: .8rem; }
body.camera-simple .camera-route-tag { min-height: 24px; margin-bottom: 7px; padding: 0 8px; font-size: .68rem; }
body.camera-simple .camera-route-option h3 { font-size: .92rem; }
body.camera-simple .camera-route-actions { margin-top: 9px; gap: 7px; }
body.camera-simple .camera-grid { gap: 12px; }
body.camera-simple .camera-settings { gap: 12px; }
body.camera-simple .camera-settings-head { gap: 8px; }
body.camera-simple .camera-settings-head h2 { font-size: 1.05rem; }
body.camera-simple .camera-settings-head p { font-size: .78rem; }
body.camera-simple .xmax-mode-card,
body.camera-simple .xmax-background-card,
body.camera-simple .ai-transform-form { padding: 12px; }
body.camera-simple .xmax-mode-options,
body.camera-simple .xmax-background-options { gap: 4px; }
body.camera-simple .xmax-mode-option,
body.camera-simple .xmax-background-option { padding: 7px 9px; font-size: .76rem; }
body.camera-simple .xmax-mode-option span { font-size: .63rem; }
body.camera-simple .xmax-prompt-field textarea { min-height: 58px; }
body.camera-simple .ai-preset-row { gap: 6px; }
body.camera-simple .ai-preset-row .btn { padding: 6px 8px; font-size: .7rem; }
body.camera-simple .camera-settings-grid { gap: 12px; }
body.camera-simple .camera-advanced { margin-top: 0; }

body.account-page .app-content {
    padding: 18px 20px 32px;
}
body.account-page > .app-shell .app-container,
body.account-page .app-container {
    width: min(100%, 620px);
    margin: 0;
}
body.account-page .page-header {
    width: min(100%, 620px);
    margin: 6px 0 18px;
    text-align: left;
}
body.account-page .page-header h1 { font-size: 1.6rem; margin-bottom: 6px; }
body.account-page .page-header p { font-size: .83rem; margin: 0; }
body.account-page .panel {
    width: min(100%, 620px);
    margin: 0 0 18px;
    padding: 18px 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(17, 20, 27, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
body.account-page .panel h2 { margin: 0 0 6px; font-size: 1rem; }
body.account-page .panel .subtext { margin: 0 0 16px; font-size: .76rem; color: var(--color-text-muted); }
body.account-page .panel + .panel { padding-top: 18px; }
body.account-page form { width: 100%; max-width: 100%; }
body.account-page .form-group { margin-bottom: 12px; }
body.account-page .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: .76rem;
    color: var(--color-text-muted);
}
body.account-page .form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    font-size: .85rem;
}
body.account-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 8px 14px;
    font-size: .78rem;
}

/* Let the active background control sit with the playground fields instead
   of looking like a separate page inside the transformation form. */
body.camera-simple .xmax-background-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .xmax-background-card .device-field { padding: 0; }

/* Compact, professional account settings layout. */
body.account-page .app-content { padding: 18px 20px 32px; }
body.account-page .app-container {
    max-width: 620px;
    margin: 0 auto;
}
body.account-page .page-header {
    margin: 6px 0 18px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}
body.account-page .page-header h1 {
    font-size: 1.7rem;
    margin-bottom: 6px;
}
body.account-page .page-header p {
    font-size: .85rem;
    margin: 0;
}
body.account-page .panel {
    padding: 18px 20px 16px;
    margin: 0 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(17, 20, 27, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
body.account-page .panel h2 {
    margin: 0 0 6px;
    font-size: 1.02rem;
}
body.account-page .panel .subtext {
    margin: 0 0 16px;
    font-size: .78rem;
    color: var(--color-text-muted);
}
body.account-page .panel + .panel {
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
body.account-page form {
    max-width: 100%;
}
body.account-page .form-group {
    margin-bottom: 12px;
}
body.account-page .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: .78rem;
    color: var(--color-text-muted);
}
body.account-page .form-group input {
    width: 100%;
    max-width: 100%;
    padding: 9px 10px;
    font-size: .86rem;
    box-sizing: border-box;
}
body.account-page .btn {
    margin-top: 4px;
    padding: 8px 14px;
    font-size: .8rem;
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    transition: transform .12s ease, opacity .12s ease, background-color .16s ease, box-shadow .16s ease;
    text-shadow: none;
}
.btn:hover { text-decoration: none; }
.btn:active {
    transform: translateY(1px) scale(.985);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .18);
}
.btn.is-loading,
.btn[aria-busy="true"] {
    pointer-events: none;
    opacity: .72;
    cursor: wait;
}
.btn.is-loading::after,
.btn[aria-busy="true"]::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: -1px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: nav-loading-spin .7s linear infinite;
}

.btn-primary {
    background: #dfe5ff;
    color: #171b22;
    font-weight: 700;
}
.btn-primary:hover { background: #cdd8ff; }

.btn-outline {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f0f3fa;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); }

.btn-block { display: block; width: 100%; }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }

.btn-block { display: block; width: 100%; }

/* ==========================================================
   Alerts / flash messages
   ========================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 20px 0;
    font-size: 0.95rem;
}
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-error   { background: var(--color-error-bg);   color: var(--color-error); }

/* ==========================================================
   Hero / landing page
   ========================================================== */
.hero {
    padding: 96px 0 72px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(124, 140, 255, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(12, 17, 27, 0.92) 0%, rgba(7, 11, 18, 0.98) 100%);
}
.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    max-width: 780px;
    margin: 0 auto 20px;
}
.hero p.lead {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 620px;
    margin: 0 auto 32px;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.section { padding: 72px 0; }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-header p { color: var(--color-text-muted); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.feature-card {
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 27, 0.96));
    box-shadow: var(--shadow);
}
.feature-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(124, 140, 255, 0.14);
    color: #dbe4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

.cta-band {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.85), rgba(15, 118, 110, 0.82));
    color: #fff;
    text-align: center;
    padding: 64px 0;
    border-radius: var(--radius);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #e0e7ff; margin-bottom: 28px; }
.cta-band .btn-primary { background: #fff; color: var(--color-primary); }
.cta-band .btn-primary:hover { background: #eef2ff; }

/* ==========================================================
   Auth forms (login / register)
   ========================================================== */
.auth-wrap {
    max-width: 420px;
    margin: 56px auto;
    padding: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(12, 17, 27, 0.98));
}
.auth-wrap h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-wrap .subtext { color: var(--color-text-muted); margin-bottom: 28px; font-size: 0.95rem; }

/* Authentication pages keep the brand and form focused without public navigation. */
body.auth-minimal-page .site-nav,
body.auth-minimal-page .footer-nav { display: none; }
body.auth-minimal-page .site-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
}
body.auth-minimal-page .site-nav a:not(:first-child) { display: none; }
body.auth-minimal-page .nav-toggle { display: none; }
body.auth-minimal-page .site-header .brand { pointer-events: none; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(6, 9, 15, 0.72);
    color: var(--color-text);
}
.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.18);
}
.form-error { color: var(--color-error); font-size: 0.85rem; margin-top: 4px; }
.field-error input { border-color: var(--color-error); }

.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ==========================================================
   Dashboard
   ========================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 40px 0 28px;
}
.page-header p { color: var(--color-text-muted); margin: 4px 0 0; }

.page-header-hero {
    align-items: end;
    padding: 22px 24px;
    margin-top: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: calc(var(--radius) + 8px);
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(12, 17, 27, 0.98) 100%);
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--color-primary);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
}

.hero-pills {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.badge-secondary {
    background: rgba(16, 185, 129, 0.12);
    color: #b5f7dc;
}

.workspace-shell {
    margin-bottom: 28px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.section-head-inline {
    margin-bottom: 16px;
}

.section-head h2 {
    margin-bottom: 4px;
}

.panel-tight {
    padding: 22px;
}

.sidebar-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 18px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 27, 0.96));
}

.sidebar-title {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.sidebar-note {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 27, 0.96));
}

.active-image-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.14);
    border: 1px solid rgba(129, 140, 248, 0.18);
    color: #dbe4ff;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==========================================================
   Camera workspace
   ========================================================== */
.camera-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

.camera-stage {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #04050a;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: none;
}

@media (max-width: 720px) {
    body.camera-studio-page .camera-card .video-frame {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 9 / 16;
        min-height: 0;
        max-height: calc(100vh - 165px);
        margin: 0 auto;
    }
    body.camera-studio-page .camera-card .video-frame.ai-frame {
        aspect-ratio: 16 / 9;
    }
    .video-frame video,
    .output-body.mirror-mode .output-frame video {
        object-fit: contain;
        object-position: center center;
        transform: none;
    }
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #d1d5db;
    padding: 24px;
}

.video-overlay .icon-lg { font-size: 2.2rem; margin-bottom: 8px; }
.video-overlay p { margin: 2px 0; }
.video-overlay .subtext { color: #9ca3af; font-size: 0.85rem; }
.video-frame.is-live .video-overlay { display: none; }

.camera-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.camera-controls-main,
.camera-controls-ai {
    margin-top: 16px;
}

.ai-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    margin: 18px 0 6px;
}

.camera-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 88px;
}

.camera-footnote {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: rgba(11, 15, 24, 0.56);
    backdrop-filter: blur(12px);
}

.camera-footnote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 14px;
    align-items: start;
}

.camera-footnote-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-label { font-size: 0.8rem; color: var(--color-text-muted); }
.status-value { font-weight: 600; font-size: 0.95rem; }

.status-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.18);
}
.status-dot.status-live {
    background: var(--color-success);
    box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.15);
}
.status-dot.status-error {
    background: var(--color-error);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15);
}
.status-dot.status-pending {
    background: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.device-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.device-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}
.device-field select {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(6, 9, 15, 0.72);
    color: var(--color-text);
    font-size: 0.9rem;
}
.device-field select:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.camera-hint { margin: 0; }
#permissionAlert { margin-top: 16px; }

.ai-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ai-video-col {
    min-width: 0;
}

.ai-video-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.ai-frame { aspect-ratio: 16 / 9; }
.ai-frame video { transform: none; }

.ai-hint { margin: 0; }

.ai-status-row {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.status-dot.status-static {
    background: none;
    box-shadow: none;
    width: auto;
    height: auto;
    font-size: 1rem;
    line-height: 1;
}

.ai-transform-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.device-field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(6, 9, 15, 0.72);
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.device-field input[type="file"] {
    font-size: 0.85rem;
}

#aiImagePreview,
#aiBackgroundPreview {
    margin-top: 10px;
    max-width: 160px;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
}

.ai-form-row {
    display: flex;
    align-items: center;
}

.ai-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
}

.ai-checkbox-label input { width: 16px; height: 16px; }

@media (max-width: 860px) {
    .camera-layout,
    .ai-video-grid { grid-template-columns: 1fr; }
    .camera-sidebar { position: static; }
    .page-header-hero { padding: 18px; }
    .ai-toolbar { align-items: stretch; }
    .ai-status-row { gap: 20px; }
}

/* ==========================================================
   Camera studio theme
   ========================================================== */
body.camera-studio-page {
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 20%),
        linear-gradient(180deg, #06070d 0%, #0a0d14 100%);
    color: #e5e7eb;
}

body.camera-studio-page .site-header {
    background: rgba(6, 7, 13, 0.78);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

body.camera-studio-page .brand,
body.camera-studio-page .site-nav a {
    color: #e5e7eb;
}

body.camera-studio-page .site-nav a {
    color: rgba(229, 231, 235, 0.72);
}

body.camera-studio-page .site-nav a.active,
body.camera-studio-page .site-nav a:hover {
    color: #ffffff;
}

body.camera-studio-page .page-header-hero,
body.camera-studio-page .panel,
body.camera-studio-page .sidebar-card {
    background: rgba(11, 15, 24, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
    color: #e5e7eb;
    backdrop-filter: blur(16px);
}

body.camera-studio-page .panel-tight {
    padding: 20px;
}

body.camera-studio-page .page-header p,
body.camera-studio-page .panel .subtext,
body.camera-studio-page .subtext,
body.camera-studio-page .status-label,
body.camera-studio-page .sidebar-title,
body.camera-studio-page .device-field label,
body.camera-studio-page .ai-video-label {
    color: rgba(229, 231, 235, 0.68);
}

body.camera-studio-page .badge {
    background: rgba(79, 70, 229, 0.18);
    color: #dbe4ff;
    border: 1px solid rgba(99, 102, 241, 0.24);
}

body.camera-studio-page .badge-secondary {
    background: rgba(16, 185, 129, 0.12);
    color: #b5f7dc;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

body.camera-studio-page .video-frame {
    background: #04050a;
    border-color: rgba(255, 255, 255, 0.08);
}

body.camera-studio-page .camera-sidebar {
    gap: 12px;
}

body.camera-studio-page .sidebar-card {
    padding: 16px;
}

body.camera-studio-page .sidebar-note {
    display: none;
}

body.camera-studio-page .camera-footnote {
    margin-top: 18px;
    background: rgba(11, 15, 24, 0.56);
}

body.camera-studio-page .video-overlay {
    background: rgba(4, 5, 10, 0.82);
    color: #f3f4f6;
}

body.camera-studio-page .device-field select,
body.camera-studio-page .device-field textarea {
    background: rgba(6, 7, 13, 0.72);
    color: #f9fafb;
    border-color: rgba(255, 255, 255, 0.1);
}

body.camera-studio-page .device-field select option {
    color: #111827;
}

body.camera-studio-page .btn-outline {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f9fafb;
}

body.camera-studio-page .btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.camera-studio-page .btn-primary {
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

body.camera-studio-page .alert-error {
    background: rgba(180, 35, 24, 0.16);
    color: #fecaca;
    border: 1px solid rgba(180, 35, 24, 0.22);
}

body.camera-studio-page .ai-transform-form,
body.camera-studio-page .ai-status-row {
    border-color: rgba(255, 255, 255, 0.08);
}

body.camera-studio-page .status-dot {
    background: rgba(148, 163, 184, 0.9);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

body.camera-studio-page .status-dot.status-live {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

body.camera-studio-page .status-dot.status-error {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.14);
}

body.camera-studio-page .status-dot.status-pending {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

body.camera-studio-page .camera-controls-main,
body.camera-studio-page .camera-controls-ai {
    margin-top: 14px;
}

body.camera-studio-page .page-header-hero,
body.camera-studio-page .camera-footnote {
    display: none;
}

body.camera-studio-page .camera-workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 0 14px;
}

body.camera-studio-page .camera-page-head {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.camera-studio-page .camera-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(229, 231, 235, 0.52);
    font-size: 0.92rem;
}

body.camera-studio-page .camera-breadcrumbs a {
    color: rgba(229, 231, 235, 0.7);
}

body.camera-studio-page .camera-title-row {
    display: none;
}

body.camera-studio-page .camera-product-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

body.camera-studio-page .camera-product-copy {
    max-width: 820px;
}

body.camera-studio-page .camera-product-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.camera-studio-page .camera-product-title h1 {
    margin: 0;
    font-size: clamp(2.1rem, 3.2vw, 3.2rem);
    letter-spacing: -0.04em;
}

body.camera-studio-page .camera-product-copy p {
    margin: 10px 0 0;
    color: rgba(229, 231, 235, 0.7);
    max-width: 720px;
}

body.camera-studio-page .model-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #edf0ff;
    font-weight: 600;
}

body.camera-studio-page .camera-product-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

body.camera-studio-page .camera-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

body.camera-studio-page .camera-tabs a {
    color: rgba(229, 231, 235, 0.62);
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
}

body.camera-studio-page .camera-tabs a.active {
    color: #f3f5fb;
    border-bottom-color: #2f6bff;
}

body.camera-studio-page .camera-tabs-spacer {
    flex: 1;
}

body.camera-studio-page .camera-route-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.camera-studio-page .camera-route-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

body.camera-studio-page .camera-route-head p {
    margin: 0;
    max-width: 760px;
}

body.camera-studio-page .camera-route-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

body.camera-studio-page .camera-route-option {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

body.camera-studio-page .camera-route-option-primary {
    background: linear-gradient(180deg, rgba(47, 107, 255, 0.12), rgba(255, 255, 255, 0.03));
    border-color: rgba(47, 107, 255, 0.22);
}

body.camera-studio-page .camera-route-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(229, 231, 235, 0.72);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.camera-studio-page .camera-route-option h3 {
    margin: 0;
    font-size: 1.05rem;
}

body.camera-studio-page .camera-route-option p {
    margin: 10px 0 0;
    color: rgba(229, 231, 235, 0.7);
    line-height: 1.6;
}

body.camera-studio-page .camera-route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

body.camera-studio-page .camera-credit,
body.camera-studio-page .camera-doc-link {
    color: rgba(229, 231, 235, 0.62);
    font-size: 0.92rem;
}

body.camera-studio-page .camera-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.camera-studio-page .camera-credit-icon {
    color: #2f6bff;
}

body.camera-studio-page .camera-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

body.camera-studio-page .camera-card {
    min-width: 0;
}

body.camera-studio-page .camera-card .video-frame {
    aspect-ratio: 16 / 9;
}

body.camera-studio-page .camera-card .video-frame.ai-frame {
    background: #04050a;
}

@media (max-width: 768px) {
    /* Keep the transformed mobile surface portrait. This rule follows the
       desktop studio rule so it cannot be overwritten by the cascade. */
    body.camera-studio-page.camera-simple .camera-card .video-frame.ai-frame,
    body.camera-simple .camera-card .video-frame.ai-frame {
        /* The Xmax response contains the portrait subject centered in a
           landscape transport frame. Use a portrait stage and crop only the
           transport's empty sidebars, matching the phone output view. */
        aspect-ratio: 9 / 16;
        height: auto;
        max-height: none;
    }

    body.camera-studio-page.camera-simple .camera-card .video-frame.ai-frame video,
    body.camera-simple .camera-card .video-frame.ai-frame video {
        object-fit: cover;
        object-position: center center;
    }
}

body.camera-studio-page .camera-settings {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.camera-studio-page .camera-settings-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

body.camera-studio-page .camera-settings-head p {
    margin: 0;
    max-width: 620px;
}

body.camera-studio-page .camera-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

body.camera-studio-page .camera-advanced {
    display: block;
    margin-top: 18px;
}

body.camera-studio-page .camera-advanced .camera-footnote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 14px;
}

@media (max-width: 860px) {
    body.camera-studio-page .camera-grid,
    body.camera-studio-page .camera-settings-grid,
    body.camera-studio-page .camera-advanced .camera-footnote-grid,
    body.camera-studio-page .camera-route-grid { grid-template-columns: 1fr; }
    .camera-sidebar { position: static; }
    .page-header-hero { padding: 18px; }
    .ai-toolbar { align-items: stretch; }
    .ai-status-row { gap: 20px; }
    body.camera-studio-page .camera-tabs {
        gap: 12px;
    }
    body.camera-studio-page .camera-tabs-spacer {
        display: none;
    }
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 27, 0.96));
    box-shadow: var(--shadow);
}
.stat-card .label { color: var(--color-text-muted); font-size: 0.85rem; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; margin-top: 6px; }
.status-live { color: var(--color-accent, #8d9cff); font-weight: 700; }
.admin-quick-links { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.admin-settings-page .page-header { margin-top: 26px; margin-bottom: 18px; }
.admin-settings-page .page-header h1 { font-size: 1.45rem; }
.admin-settings-page .panel {
    padding: 18px 20px;
    margin-bottom: 14px;
    border-radius: 10px;
}
.admin-settings-page .panel h2 { font-size: 1rem; margin-bottom: 4px; }
.admin-settings-page .panel > .subtext,
.admin-settings-page .panel form > .subtext { font-size: .76rem; margin-bottom: 14px; }
.admin-settings-page .form-group { margin-bottom: 11px; }
.admin-settings-page .form-group label { font-size: .76rem; margin-bottom: 5px; }
.admin-settings-page input,
.admin-settings-page select,
.admin-settings-page textarea { padding: 8px 10px; font-size: .82rem; }
.admin-settings-page .btn { padding: 8px 12px; font-size: .78rem; }
.admin-settings-page .stat-grid { gap: 12px; margin-bottom: 14px; }
.admin-settings-page .stat-grid .form-group { margin-bottom: 0; }
.admin-settings-page .admin-runtime-section { margin: 0 0 18px; padding: 14px 0 2px; border-top: 1px solid var(--color-border); }
.admin-settings-page .admin-runtime-section:first-of-type { border-top: 0; padding-top: 0; }
.admin-settings-page .admin-runtime-section-heading { margin-bottom: 11px; color: var(--color-text); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.admin-settings-page .admin-runtime-grid { display: grid; gap: 12px; align-items: start; }
.admin-settings-page .admin-runtime-grid-identity { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-settings-page .admin-runtime-grid-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-settings-page .admin-runtime-grid .form-group { min-width: 0; margin-bottom: 0; }
@media (max-width: 900px) {
    .admin-settings-page .admin-runtime-grid-identity,
    .admin-settings-page .admin-runtime-grid-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .admin-settings-page .admin-runtime-grid-identity,
    .admin-settings-page .admin-runtime-grid-controls { grid-template-columns: 1fr; }
}
.admin-package-panel { padding: 14px 16px; }
.admin-package-fields {
    display: grid;
    grid-template-columns: 1.35fr .8fr .65fr .8fr .85fr .55fr;
    gap: 10px;
}
.admin-package-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.admin-package-bottom .admin-package-description {
    flex: 0 1 420px;
    width: 100%;
    min-width: 240px;
    font-size: .84rem;
    padding: 9px 10px;
}
.admin-package-bottom label { white-space: nowrap; font-size: .76rem; color: var(--color-text-muted); }
.admin-package-new { border-style: dashed; }
.admin-credit-unit-note { font-size: .75rem; margin-top: 8px; }
.admin-dashboard-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}
.admin-dashboard-stats .stat-card {
    position: relative;
    min-width: 0;
    padding: 15px 16px 14px;
    border: 0;
    border-top: 2px solid rgba(124, 140, 255, .72);
    border-left: 1px solid rgba(124, 140, 255, .22);
    border-radius: 10px 10px 5px 5px;
    background: rgba(12, 17, 27, .82);
    box-shadow: none;
}
.admin-dashboard-stats .stat-card::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 38%;
    bottom: 0;
    height: 1px;
    background: rgba(124, 140, 255, .3);
}
.admin-dashboard-stats .stat-card .label { font-size: .72rem; letter-spacing: .02em; }
.admin-dashboard-stats .stat-card .value { margin-top: 3px; font-size: 1.28rem; }
.admin-session-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-session-panel { padding: 14px 16px; }
.admin-session-table-wrap { overflow-x: auto; }
.admin-session-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .78rem; }
.admin-session-table th,
.admin-session-table td { padding: 9px 8px; text-align: left; vertical-align: middle; }
.admin-session-table th { color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }
.admin-session-table td { border-top: 1px solid var(--color-border); }
.admin-session-table td:first-child { padding-left: 0; }
.admin-session-table th:first-child { padding-left: 0; }
.admin-session-table td strong { font-size: .8rem; }
.admin-session-table td span:not(.admin-session-status) { color: var(--color-text-muted); font-size: .7rem; }
.admin-session-status { color: var(--color-text-muted); }
.admin-session-status.is-active { color: var(--color-primary); }
.admin-users-panel { padding: 14px 16px; }
.admin-users-table-wrap { overflow-x: auto; }
.admin-users-table { width: 100%; min-width: 1220px; border-collapse: collapse; font-size: .78rem; }
.admin-users-table th,
.admin-users-table td { padding: 9px 8px; text-align: left; vertical-align: middle; }
.admin-users-table th { color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }
.admin-users-table td { border-top: 1px solid var(--color-border); }
.admin-users-table th:first-child,
.admin-users-table td:first-child { padding-left: 0; min-width: 190px; }
.admin-users-table td strong { font-size: .8rem; }
.admin-users-table td:first-child span { color: var(--color-text-muted); font-size: .7rem; }
.admin-user-credit { white-space: nowrap; }
.admin-user-credit strong,
.admin-user-credit small { display: block; }
.admin-user-credit small { color: var(--color-text-muted); font-size: .7rem; margin-top: 2px; }
.admin-user-actions { min-width: 390px; }
.admin-user-actions > div { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-user-actions form { display: inline-flex; align-items: center; gap: 6px; }
.admin-user-actions input[type="number"] { width: 82px !important; padding: 7px 8px !important; font-size: .76rem !important; }
.admin-user-actions .btn { white-space: nowrap; }
.admin-email-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); gap:16px; }
.admin-email-panel { padding:16px 18px; }
.admin-email-panel h2 { font-size:1rem; }
.admin-email-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.admin-email-fields label, .admin-email-panel > form > label { display:grid; gap:5px; color:var(--color-text-muted); font-size:.75rem; }
.admin-email-fields input, .admin-email-fields select, .admin-email-panel > form > label input { min-width:0; padding:8px 9px; font-size:.8rem; }
.admin-email-check { display:flex !important; align-items:center; gap:7px; margin:10px 0 13px; color:var(--color-text) !important; }
.admin-email-health { margin:13px 0 0; color:var(--color-text-muted); font-size:.72rem; }
.admin-email-events { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 14px; }
.admin-email-events form label, .admin-email-event-options label { color:var(--color-text-muted); font-size:.75rem; }
.admin-email-recipient-form { display:grid; grid-template-columns:1fr 2fr auto; gap:10px; align-items:start; }
.admin-email-recipient-form > input { min-width:0; padding:8px 9px; }
.admin-email-event-options { display:flex; flex-wrap:wrap; gap:6px 10px; }
.admin-email-recipient { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 0; border-top:1px solid var(--color-border); font-size:.8rem; }
.admin-email-template { display:grid; gap:7px; padding:12px 0; border-top:1px solid var(--color-border); max-width:760px; }
.admin-email-template h3 { font-size:.82rem; margin:0; }
.admin-email-template label { display:grid; gap:5px; color:var(--color-text-muted); font-size:.72rem; }
.admin-email-template input, .admin-email-template textarea { padding:7px 9px; font-size:.78rem; }
.admin-email-logs > div { display:grid; grid-template-columns:65px 1.2fr 1fr 160px; gap:10px; padding:8px 0; border-top:1px solid var(--color-border); font-size:.72rem; }
.admin-email-logs strong { color:var(--color-primary); }
.admin-email-logs small { grid-column:2/-1; color:#f39a9a; }
@media (max-width:900px) { .admin-email-grid { grid-template-columns:1fr; } .admin-email-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } .admin-email-events { grid-template-columns:repeat(2,minmax(0,1fr)); } .admin-email-recipient-form { grid-template-columns:1fr; } }
@media (max-width:600px) { .admin-email-fields, .admin-email-events { grid-template-columns:1fr; } .admin-email-logs > div { grid-template-columns:1fr 1fr; } .admin-email-logs small { grid-column:1/-1; } }
.admin-user-status { font-size: .7rem; font-weight: 700; }
.admin-user-status.is-active { color: #9fb8ff; }
.admin-user-status.is-suspended { color: #ff9b9b; }
.admin-user-actions input[name="credit_adjustment"] { width: 106px !important; }
.admin-dashboard-panel {
    padding: 18px 20px;
    margin-bottom: 16px;
    border-radius: 10px;
}
.admin-dashboard-panel h2 { font-size: 1rem; margin-bottom: 3px; }
.admin-dashboard-panel .subtext { font-size: .76rem; }
.admin-dashboard-panel .btn { padding: 7px 11px; font-size: .74rem; }
.admin-dashboard-panel .credits-history-list { margin-top: 12px !important; }
.admin-dashboard-panel .credits-history-row { padding: 9px 0; font-size: .78rem; }
.admin-dashboard-panel .credits-history-row small { font-size: .7rem; color: var(--color-text-muted); }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(124, 140, 255, 0.14);
    color: #dbe4ff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 28px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 27, 0.96));
    box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.15rem; margin-bottom: 6px; }
.panel .subtext { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.subtext {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Placeholder "coming soon" blocks (camera, pricing tiers, etc.) */
.placeholder-box {
    border: 2px dashed rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    padding: 64px 24px;
    text-align: center;
    color: var(--color-text-muted);
    background: rgba(6, 9, 15, 0.58);
}
.placeholder-box .icon-lg { font-size: 2.5rem; margin-bottom: 12px; }

/* ==========================================================
   Pricing
   ========================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.price-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 27, 0.96));
    box-shadow: var(--shadow);
}
.price-card.featured {
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
    position: relative;
}
.price-card .plan-name { font-weight: 700; margin-bottom: 6px; }
.price-card .price { font-size: 2.2rem; font-weight: 800; margin: 12px 0; }
.price-card .price span { font-size: 0.95rem; font-weight: 500; color: var(--color-text-muted); }
.price-card ul { list-style: none; padding: 0; margin: 24px 0; text-align: left; color: var(--color-text-muted); font-size: 0.9rem; }
.price-card li { padding: 6px 0; }
.price-card form,
.price-card .btn-block { margin-top: auto; }

/* Credits page: compact, centered card selector. */
.credits-page { max-width: 1040px; margin: 0 auto; padding: 14px 0 48px; }
.credits-page-head { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin: 8px 0 22px; }
.credits-page-head h1 { margin:0 0 6px; font-size:1.75rem; letter-spacing:-.03em; }
.credits-page-head p { margin:0; color:var(--color-text-muted); font-size:.9rem; }
.credits-remaining { text-align:right; color:var(--color-text-muted); }
.credits-remaining span { display:block; font-size:.78rem; }
.credits-remaining strong { display:block; margin-top:4px; color:var(--color-text); font-size:1.55rem; }
.credit-purchase-panel { max-width:960px; margin:0 auto; padding:22px 24px; border:1px solid rgba(255,255,255,.1); border-radius:18px; background:rgba(18,20,28,.72); }
.credit-options { display:grid; grid-template-columns:repeat(4,174px); justify-content:center; gap:14px; }
.credit-option { min-height:168px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:12px; border:1px solid rgba(255,255,255,.08); border-radius:13px; background:#050609; color:var(--color-text); cursor:pointer; transition:border-color .18s ease, transform .18s ease, background .18s ease; }
.credit-option:hover { transform:translateY(-2px); border-color:rgba(255,255,255,.3); }
.credit-option.is-selected { border-color:rgba(255,255,255,.75); background:#090b10; box-shadow:0 0 0 1px rgba(255,255,255,.08); }
.credit-mark { display:grid; place-items:center; width:34px; height:34px; margin-bottom:6px; border-radius:50%; background:#303036; color:#6355ff; font-size:1.45rem; }
.credit-option strong { font-size:1.25rem; font-weight:500; }
.credit-option span:not(.credit-mark) { color:var(--color-text-muted); font-size:.78rem; }
.credit-option em { width:100%; margin-top:8px; padding:7px 8px; border:1px solid rgba(255,255,255,.12); border-radius:999px; color:var(--color-text); font-style:normal; font-size:.8rem; }
.credits-buy-button { display:block; width:100%; margin-top:20px; padding:11px; border-radius:999px; text-align:center; font-size:.9rem; }
.credit-alt-payment { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:18px; color:var(--color-text-muted); font-size:.9rem; }
.credit-alt-payment form { display:flex; gap:10px; align-items:center; }
.credit-alt-payment select { min-width:220px; }
.credits-history { max-width:960px; margin:28px auto 0; }
.credits-history-head { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.credits-history-head h2 { margin:0; font-size:1.25rem; }
.credits-invoice-label { padding:9px 15px; border:1px solid rgba(255,255,255,.1); border-radius:999px; color:var(--color-text-muted); font-size:.9rem; }
.credits-empty { padding:34px 0; text-align:center; color:var(--color-text-muted); }
.credits-history-list { margin-top:16px; border-top:1px solid rgba(255,255,255,.08); }
.credits-history-row { display:grid; grid-template-columns:2fr 1fr 1fr 1.4fr; gap:12px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,.08); color:var(--color-text-muted); font-size:.82rem; }
.credits-history-row span:first-child { color:var(--color-text); }
@media (max-width: 900px) { .credit-options { grid-template-columns:repeat(2,minmax(145px,174px)); } }
@media (max-width: 600px) { .credits-page { padding-top:8px; } .credits-page-head { align-items:flex-start; flex-direction:column; } .credits-remaining { text-align:left; } .credit-purchase-panel { padding:18px; } .credit-options { gap:12px; } .credit-option { min-height:170px; } .credit-alt-payment { align-items:stretch; flex-direction:column; } .credit-alt-payment form { flex-direction:column; align-items:stretch; } .credit-alt-payment select { min-width:0; width:100%; } .credits-history-row { grid-template-columns:1fr 1fr; } }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 0;
    margin-top: 64px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-nav a { color: var(--color-text-muted); margin-left: 18px; }
.footer-nav a:first-child { margin-left: 0; }

/* Final compact workspace overrides. Keep these after the legacy rules so
   Camera and Account stay visually small without changing their behavior. */
body.camera-simple .app-content { padding: 18px 22px; }
body.camera-simple .camera-workspace { max-width: 1040px; margin: 0 auto; gap: 12px; }
body.camera-simple .camera-page-head { gap: 10px; }
body.camera-simple .camera-product-title h1 { font-size: 1.75rem; }
body.camera-simple .camera-tabs { padding-bottom: 6px; }
body.camera-simple .camera-route-card,
body.camera-simple .camera-card,
body.camera-simple .camera-settings,
body.camera-simple .camera-advanced { padding: 16px; }
body.camera-simple .camera-route-card { gap: 10px; }
body.camera-simple .camera-route-head { gap: 10px; }
body.camera-simple .camera-route-option { padding: 12px; border-radius: 13px; }
body.camera-simple .camera-route-option p { margin-top: 6px; line-height: 1.4; font-size: .8rem; }
body.camera-simple .camera-route-tag { min-height: 24px; margin-bottom: 7px; padding: 0 8px; font-size: .68rem; }
body.camera-simple .camera-route-option h3 { font-size: .92rem; }
body.camera-simple .camera-route-actions { margin-top: 9px; gap: 7px; }
body.camera-simple .camera-grid { gap: 12px; }
body.camera-simple .camera-settings { gap: 12px; }
body.camera-simple .camera-settings-head { gap: 8px; }
body.camera-simple .camera-settings-head h2 { font-size: 1.05rem; }
body.camera-simple .camera-settings-head p { font-size: .78rem; }
body.camera-simple .xmax-mode-card,
body.camera-simple .xmax-background-card,
body.camera-simple .ai-transform-form { padding: 12px; }
body.camera-simple .xmax-mode-options,
body.camera-simple .xmax-background-options { gap: 4px; }
body.camera-simple .xmax-mode-option,
body.camera-simple .xmax-background-option { padding: 7px 9px; font-size: .76rem; }
body.camera-simple .xmax-mode-option span { font-size: .63rem; }
body.camera-simple .xmax-prompt-field textarea { min-height: 58px; }
body.camera-simple .ai-preset-row { gap: 6px; }
body.camera-simple .ai-preset-row .btn { padding: 6px 8px; font-size: .7rem; }
body.camera-simple .camera-settings-grid { gap: 12px; }
body.camera-simple .camera-advanced { margin-top: 0; }

body.account-page .app-content { padding: 18px 20px 32px; }
body.account-page .app-container {
    max-width: 620px;
    margin: 0 auto;
}
body.account-page .page-header {
    max-width: 620px;
    margin: 6px auto 18px;
}
body.account-page .page-header h1 { font-size: 1.7rem; margin-bottom: 6px; }
body.account-page .page-header p { font-size: .85rem; margin: 0; }
body.account-page .panel {
    padding: 18px 20px 16px;
    margin: 0 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(17, 20, 27, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
body.account-page .panel h2 { margin: 0 0 6px; font-size: 1.02rem; }
body.account-page .panel .subtext { margin: 0 0 16px; font-size: .78rem; color: var(--color-text-muted); }
body.account-page .panel + .panel { padding-top: 18px; }
body.account-page form { max-width: 100%; }
body.account-page .form-group { margin-bottom: 12px; }
body.account-page .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: .78rem;
    color: var(--color-text-muted);
}
body.account-page .form-group input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    font-size: .86rem;
}
body.account-page .btn { margin-top: 4px; padding: 8px 14px; font-size: .8rem; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 860px) {
    .feature-grid,
    .pricing-grid,
    .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .admin-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
    .admin-dashboard-stats { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .admin-package-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .admin-package-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-package-bottom { align-items: stretch; flex-wrap: wrap; }
    .admin-package-bottom .admin-package-description { flex-basis: 100%; max-width: none; }
}

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(6, 9, 15, 0.96);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px 24px;
        gap: 14px;
    }
    .site-nav.open { display: flex; }
    .header-inner { position: relative; }
    .hero { padding: 64px 0 48px; }
    .auth-wrap { margin: 32px auto; padding: 24px; }
}

/* Keep the playground background controls on the page surface. */
body.camera-simple .xmax-background-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .xmax-background-card .device-field { padding: 0; }

/* Last-wins safeguards for the camera UI refresh. */
body.camera-simple .camera-route-card { display: none; }
body.camera-simple .camera-workspace { width: min(1040px, 100%); max-width: none; margin: 0 auto; }
body.camera-simple .camera-card { padding: 16px; border-radius: 16px; background: #181818; box-shadow: none; }
body.camera-simple .camera-settings { padding: 0; border: 0; background: transparent; box-shadow: none; }
body.camera-simple .xmax-background-card,
body.camera-simple .xmax-mode-card,
body.camera-simple .ai-transform-form { padding: 0; border: 0; background: transparent; box-shadow: none; }
body.camera-simple .xmax-mode-options,
body.camera-simple .xmax-background-options { width: fit-content; max-width: 100%; padding: 4px; border: 0; border-radius: 13px; background: #242424; }
body.camera-simple .xmax-mode-option,
body.camera-simple .xmax-background-option { border: 0; border-radius: 9px; background: transparent; color: #a9a9a9; font-size: .78rem; }
body.camera-simple .xmax-mode-option.is-selected,
body.camera-simple .xmax-background-option.is-selected { background: #3b3b3b; color: #f5f5f5; box-shadow: none; }

/* Last-wins Account layout: left aligned and free of stacked cards. */
body.account-page .app-container { max-width: 900px; margin: 0; }
body.account-page .panel { padding: 0; margin: 0 0 30px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body.account-page .panel + .panel { padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .08); }

/* Credits page: compact four-card purchase layout. */
body.credits-page-body .app-content { padding: 18px 28px 48px; }
body.public-app-shell-page { background: #0a0a0c; }
body.public-app-shell-page .public-app-shell { display: flex; min-height: 100vh; background: #0a0a0c; }
body.public-app-shell-page .public-app-sidebar { width: 238px; flex: 0 0 238px; padding: 26px 16px; border-right: 1px solid #26262b; background: #0a0a0c; }
body.public-app-shell-page .public-app-brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 28px; color: #f1f1f1; font-size: 18px; font-weight: 600; text-decoration: none; }
body.public-app-shell-page .public-app-brand-mark { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #3a3a3a; border-radius: 9px; background: #242424; color: #ededed; font-weight: 700; }
body.public-app-shell-page .public-app-brand-logo { width: 150px; height: 44px; object-fit: contain; object-position: left center; }
body.public-app-shell-page .public-app-mobile-brand .public-app-brand-logo { width: 120px; height: 34px; }
body.app-shell-page .app-brand-logo { width: 150px; height: 44px; object-fit: contain; object-position: left center; }
body:not(.app-shell-page) .brand-logo { width: 150px; height: 44px; object-fit: contain; object-position: left center; }
.home-brand-logo { width: 150px; height: 44px; object-fit: contain; object-position: left center; flex-shrink: 0; }
body.public-app-shell-page .public-app-nav { display: flex; flex-direction: column; gap: 4px; }
body.public-app-shell-page .public-app-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; border-radius: 10px; color: #a4a4a4; text-decoration: none; transition: background .2s ease, color .2s ease, transform .2s ease; }
body.public-app-shell-page .public-app-nav a:hover, body.public-app-shell-page .public-app-nav a.active { color: #f2f2f2; background: rgba(124, 140, 255, .1); border: 0; box-shadow: inset 2px 0 0 var(--color-primary); transform: translateX(2px); }
body.public-app-shell-page .public-app-nav-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: #8993a7; }
body.public-app-shell-page .public-app-nav a.active .public-app-nav-icon { color: var(--color-primary); background: rgba(124, 140, 255, .12); }
body.public-app-shell-page .public-app-nav-icon svg { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.public-app-shell-page .public-app-nav b, body.public-app-shell-page .public-app-nav small { display: block; }
body.public-app-shell-page .public-app-nav b { font-size: 13.5px; }
body.public-app-shell-page .public-app-nav small { margin-top: 2px; color: #777777; font-size: 11.5px; }
body.public-app-shell-page .public-app-main { min-width: 0; flex: 1; background: #0a0a0c; }
body.public-app-shell-page .public-app-topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; min-height: 70px; padding: 16px 40px; border-bottom: 1px solid #26262b; background: rgba(10,10,12,.96); backdrop-filter: blur(14px); }
body.public-app-shell-page .public-app-login { margin-left: auto; padding: 9px 20px; border-radius: 8px; background: #3b3b3b; color: #f5f5f5; font-size: 13.5px; text-decoration: none; }
body.public-app-shell-page .public-app-login:hover { background: #4a4a4a; }
body.public-app-shell-page .public-app-content { min-height: calc(100vh - 70px); padding: 18px 28px 48px; background: #0a0a0c; }
body.public-app-shell-page .public-app-content > .container { max-width: 1120px; }
body.public-app-shell-page .public-app-nav-toggle, body.public-app-shell-page .public-app-mobile-brand, body.public-app-shell-page .public-app-backdrop { display: none; }
@media (max-width: 760px) {
    body.public-app-shell-page .public-app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
    body.public-app-shell-page .public-app-sidebar.open { transform: translateX(0); }
    body.public-app-shell-page .public-app-backdrop.open { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); }
    body.public-app-shell-page .public-app-topbar { padding: 12px 16px; }
    body.public-app-shell-page .public-app-nav-toggle { display: inline-flex; width: 36px; height: 36px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #3a3a3a; border-radius: 8px; background: #242424; }
    body.public-app-shell-page .public-app-nav-toggle span { width: 16px; height: 1px; background: #ededed; }
    body.public-app-shell-page .public-app-mobile-brand { display: flex; align-items: center; gap: 8px; margin-left: 10px; color: #f1f1f1; font-weight: 600; }
    body.public-app-shell-page .public-app-mobile-brand .public-app-brand-mark { width: 24px; height: 24px; border-radius: 7px; }
    body.public-app-shell-page .public-app-content { padding: 14px 16px 36px; }
    body.public-app-shell-page .credit-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.credits-page-body .credits-page {
    width: min(1040px, 100%);
    max-width: none;
    margin: 0 auto;
    padding: 16px 0 48px;
}
body.credits-page-body .credits-page-head {
    margin: 0 0 22px;
    align-items: flex-end;
}
body.credits-page-body .credits-page-head h1 {
    margin: 0 0 5px;
    font-size: 1.8rem;
    font-weight: 600;
}
body.credits-page-body .credits-page-head p { font-size: .92rem; }
body.credits-page-body .credits-remaining span { font-size: .78rem; }
body.credits-page-body .credits-remaining strong { font-size: 1.65rem; }

.account-usage-summary {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0 0 28px;
    padding: 0 2px 22px;
    border-bottom: 1px solid var(--color-border);
}
.account-usage-summary > div { display: grid; gap: 4px; }
.account-usage-summary > div:first-child { min-width: 150px; }
.account-summary-label { color: var(--color-text-muted); font-size: .8rem; }
.account-usage-summary strong { color: var(--color-text); font-size: 1.15rem; }
.account-usage-summary small { color: var(--color-text-muted); font-size: .78rem; }
.account-usage-summary .btn { margin-left: auto; }
@media (max-width: 700px) {
    .account-usage-summary { align-items: flex-start; flex-wrap: wrap; gap: 18px 26px; }
    .account-usage-summary .btn { margin-left: 0; }
}
body.credits-page-body .credit-purchase-panel {
    width: 100%;
    max-width: none;
    padding: 24px 26px 26px;
    border: 1px solid #303030;
    border-radius: 18px;
    background: #181818;
    box-shadow: none;
}
body.credits-page-body .credit-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    justify-content: initial;
}
body.credits-page-body .credit-option {
    min-width: 0;
    min-height: 170px;
    padding: 12px;
    border: 1px solid #252525;
    border-radius: 13px;
    background: #050505;
    color: #f1f1f1;
}
body.credits-page-body .credit-option:hover {
    border-color: #707070;
    transform: translateY(-1px);
}
body.credits-page-body .credit-option.is-selected {
    border-color: #a9a9a9;
    background: #080808;
    box-shadow: none;
}
body.credits-page-body .credit-mark {
    width: 36px;
    height: 36px;
    margin-bottom: 7px;
    background: #303030;
    color: #d3d3d3;
    font-size: 1.35rem;
}
body.credits-page-body .credit-option strong { font-size: 1.3rem; }
body.credits-page-body .credit-option span:not(.credit-mark) { font-size: .78rem; }
body.credits-page-body .credit-option em {
    margin-top: 9px;
    padding: 7px 8px;
    border-color: #303030;
    color: #d5d5d5;
    font-size: .8rem;
}
body.credits-page-body .credits-buy-button {
    margin-top: 22px;
    padding: 11px;
    border: 0;
    background: #b2b2b2;
    color: #151515;
    font-size: .9rem;
}
body.credits-page-body .credits-buy-button:hover { background: #8f8f8f; }
.credit-payment-method { margin:0 0 24px; padding:18px; border:1px solid #303030; border-radius:14px; background:#111; text-align:left; }
.credit-payment-method-head { margin:0 0 14px; }
.credit-payment-eyebrow { display:block; margin-bottom:5px; color:#a7a7a7; font-size:.7rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.credit-payment-method h2 { margin:0; color:#f2f2f2; font-size:1rem; font-weight:650; }
.credit-payment-method p { margin:5px 0 0; color:#a7a7a7; font-size:.8rem; line-height:1.45; }
.crypto-method-options { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; }
.crypto-method-option { position:relative; display:flex; align-items:center; gap:11px; min-width:0; min-height:76px; padding:12px; border:1px solid #393939; border-radius:11px; background:#090909; color:#f1f1f1; cursor:pointer; text-align:left; transition:border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
.crypto-method-option:hover { border-color:#878787; background:#101010; transform:translateY(-1px); }
.crypto-method-option:focus-visible { outline:0; border-color:#d5d5d5; box-shadow:0 0 0 3px rgba(213,213,213,.16); }
.crypto-method-option.is-selected { border-color:#b8b8b8; background:#171717; box-shadow:inset 3px 0 0 #e4e4e4; }
.crypto-method-option img { width:34px; height:34px; flex:0 0 34px; object-fit:contain; }
.crypto-method-copy { display:grid; min-width:0; gap:3px; }
.crypto-method-copy strong { overflow:hidden; color:#f2f2f2; font-size:.87rem; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.crypto-method-copy small { color:#a7a7a7; font-size:.7rem; line-height:1.25; }
.crypto-method-check { display:none; position:absolute; top:8px; right:8px; width:18px; height:18px; border-radius:50%; background:#e6e6e6; color:#111; font-size:.7rem; font-weight:800; line-height:18px; text-align:center; }
.crypto-method-option.is-selected .crypto-method-check { display:block; }
.crypto-method-note { padding-top:12px; border-top:1px solid #292929; }
.credit-payment-method small, .credit-payment-warning { color:var(--color-text-muted); font-size:.78rem; line-height:1.45; }
.credit-payment-warning { margin:0 auto 16px; text-align:center; }
body.credits-page-body .crypto-payment-header { max-width:620px; margin-right:auto; margin-left:auto; text-align:center; }
.crypto-payment-kicker { display:block; margin-bottom:8px; color:#9d9d9d; font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.crypto-payment-card { width:min(100%,560px); margin:0 auto; padding:24px; border:1px solid #343434; border-radius:18px; background:#181818; text-align:center; }
.crypto-payment-card h2 { margin:0; color:#f2f2f2; font-size:1.2rem; }
.crypto-payment-countdown { position:relative; display:grid; place-items:center; width:64px; height:64px; margin:0 auto 12px; }
.crypto-payment-countdown svg { position:absolute; inset:0; width:64px; height:64px; transform:rotate(-90deg); }
.crypto-payment-countdown circle { fill:none; stroke-width:4; }
.crypto-payment-countdown-track { stroke:#333; }
.crypto-payment-countdown-progress { stroke:#aeb9ff; stroke-linecap:round; stroke-dasharray:169.65; stroke-dashoffset:0; transition:stroke-dashoffset 1s linear; }
.crypto-payment-countdown span { position:relative; color:#f4f4f4; font-size:.7rem; font-weight:750; letter-spacing:-.03em; }
.crypto-payment-status { display:flex; align-items:center; justify-content:center; gap:10px; margin:10px 0 20px !important; padding:12px 14px; border:1px solid #303030; border-radius:10px; background:#101010; color:#b9b9b9; text-align:left; }
.crypto-payment-status strong { display:block; color:#f1f1f1; font-size:.92rem; }
.crypto-payment-status small { display:block; margin-top:2px; color:#898989; font-size:.68rem; }
.crypto-payment-spinner { width:16px; height:16px; border:2px solid #505050; border-top-color:#f4f4f4; border-radius:50%; flex:0 0 auto; }
.crypto-payment-card.is-polling .crypto-payment-spinner { animation:crypto-payment-spin .75s linear infinite,crypto-payment-breathe 1.7s ease-in-out infinite; }
.crypto-payment-card [data-payment-details] { min-height:150px; padding:0; border:1px solid #303030; border-radius:13px; background:#0a0a0a; overflow:hidden; text-align:left; }
.crypto-payment-instruction { padding:17px 18px; }
.crypto-payment-address-block { border-top:1px solid #303030; }
.crypto-payment-step { margin:0 0 5px; color:#a9a9a9; font-size:.76rem; font-weight:650; letter-spacing:.05em; text-transform:uppercase; }
.crypto-payment-value { display:flex; align-items:baseline; gap:9px; margin:0 0 10px; color:#f5f5f5; }
.crypto-payment-amount strong { font-size:1.5rem; letter-spacing:.01em; word-break:break-all; }
.crypto-payment-amount span { padding:3px 6px; border:1px solid #515151; border-radius:5px; color:#d5d5d5; font-size:.72rem; font-weight:750; letter-spacing:.08em; }
.crypto-payment-network { margin:0 0 20px; color:#b7b7b7; font-size:.85rem; }
.crypto-payment-address { display:block; max-width:100%; padding:11px; overflow-x:auto; border:1px solid #363636; border-radius:8px; background:#151515; color:#f4f4f4; font:600 .76rem/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; text-align:left; white-space:nowrap; word-break:normal; box-sizing:border-box; scrollbar-width:thin; }
.crypto-payment-qr-wrap { display:grid; place-items:center; width:242px; min-height:242px; margin:22px auto 18px; padding:10px; border:1px solid #343434; border-radius:12px; background:#fff; box-sizing:border-box; }
.crypto-payment-qr-wrap [data-payment-qr] { display:grid; place-items:center; width:220px; height:220px; overflow:hidden; color:#111; font-size:.75rem; line-height:1.35; text-align:center; }
.crypto-payment-qr-wrap [data-payment-qr] img, .crypto-payment-qr-wrap [data-payment-qr] canvas, .crypto-payment-qr-wrap [data-payment-qr] table { display:block !important; width:220px !important; height:220px !important; max-width:220px !important; max-height:220px !important; box-sizing:border-box; }
.crypto-payment-qr-wrap [data-payment-qr] table { table-layout:fixed !important; border-collapse:collapse !important; border-spacing:0 !important; }
.crypto-payment-qr-wrap [data-payment-qr] td { width:auto !important; height:auto !important; padding:0 !important; line-height:0 !important; }
.crypto-payment-actions { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; margin:0 auto 16px; }
.crypto-payment-actions .btn { display:flex; align-items:center; justify-content:center; min-height:43px; margin:0; padding:9px 10px; font-size:.8rem; white-space:nowrap; transition:transform .12s ease,background .18s ease,border-color .18s ease,color .18s ease; }
.crypto-payment-actions .btn:not(:disabled):hover { border-color:#bfc9ff; background:#272b3a; color:#fff; }
.crypto-payment-actions .btn:not(:disabled):active { transform:translateY(2px) scale(.98); background:#111; }
.crypto-payment-actions .btn.is-copied { border-color:#55c58b; background:#123122; color:#e7fff1; }
.crypto-payment-expiry { min-height:1.2em; color:#aaa; font-size:.78rem; }
@keyframes crypto-payment-spin { to { transform:rotate(360deg); } }
@keyframes crypto-payment-breathe { 50% { opacity:.45; } }
@media (max-width:600px) { .crypto-payment-card { padding:18px; } .crypto-payment-card [data-payment-details] { min-height:0; } .crypto-payment-amount strong { font-size:1.25rem; } .crypto-payment-actions { grid-template-columns:1fr 1fr; } .crypto-payment-actions [data-open-wallet] { grid-column:1 / -1; } }
body.credits-page-body .credits-history { width: 100%; max-width: none; margin-top: 30px; }
body.credits-page-body .credits-history-head h2 { font-size: 1.3rem; }
body.credits-page-body .credits-invoice-label { padding: 8px 13px; font-size: .82rem; }
body.credits-page-body .credits-history-row { font-size: .82rem; }
/* Keep credit purchase history useful without allowing it to turn the Credits
   page into a long transaction ledger. Newest purchases stay at the top. */
body.credits-page-body .credits-history-list { max-height:270px; overflow-y:scroll; overscroll-behavior:contain; padding-right:8px; scrollbar-color:#666 #202020; scrollbar-gutter:stable; }
body.credits-page-body .credits-history-list:focus-visible { outline:2px solid var(--color-primary); outline-offset:4px; border-radius:6px; }
body.credits-page-body .credits-history-list::-webkit-scrollbar { width:10px; }
body.credits-page-body .credits-history-list::-webkit-scrollbar-track { border-radius:999px; background:#202020; }
body.credits-page-body .credits-history-list::-webkit-scrollbar-thumb { min-height:40px; border:2px solid #202020; border-radius:999px; background:#707070; }
body.credits-page-body .credits-history-scroll-cue { display:flex; align-items:center; justify-content:center; gap:7px; margin:10px 0 0; color:#9b9b9b; font-size:.76rem; }
body.credits-page-body .credits-history-scroll-cue span { display:inline-grid; width:20px; height:20px; place-items:center; border:1px solid #444; border-radius:50%; color:#dedede; font-size:.82rem; }
@media (max-width: 760px) {
    body.credits-page-body .app-content { padding: 14px 16px 36px; }
    body.credits-page-body .credits-page-head { align-items: flex-start; flex-direction: column; }
    body.credits-page-body .credits-remaining { text-align: left; }
    body.credits-page-body .credit-purchase-panel { padding: 16px; }
    body.credits-page-body .credit-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crypto-method-options { grid-template-columns:1fr; }
    .crypto-method-option { min-height:64px; }
}

/* Shared graphite theme. Keep one restrained accent across every page. */
:root {
    --color-primary: #b2b2b2;
    --color-primary-dark: #8f8f8f;
    --color-text: #f1f1f1;
    --color-text-muted: #969696;
    --color-bg: #111111;
    --color-bg-alt: #191919;
    --color-border: #303030;
}
body,
body.app-shell-page,
body.camera-simple {
    background: #111111;
}
body {
    color: var(--color-text);
}
body.app-shell-page .app-shell {
    background: #111111;
}
body.app-shell-page .app-sidebar {
    background: #171717;
    border-right-color: #2d2d2d;
}
body.app-shell-page .app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #151515;
    border-bottom-color: #2d2d2d;
    backdrop-filter: none;
}
body.app-shell-page .app-nav-link {
    color: #a4a4a4;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
    padding: 9px 12px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
body.app-shell-page .app-nav-link:hover,
body.app-shell-page .app-nav-link.active {
    color: #f2f2f2;
    background: rgba(124, 140, 255, .1);
    border: 0;
    box-shadow: inset 2px 0 0 var(--color-primary);
}
body.app-shell-page .app-nav-link:hover {
    transform: translateX(2px);
}
body.app-shell-page .app-nav-icon,
body.app-shell-page .app-brand-mark {
    background: transparent;
    border: 0;
    color: #8993a7;
}
body.app-shell-page .app-nav-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}
body.app-shell-page .app-nav-icon svg {
    width: 17px;
    height: 17px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.app-shell-page .app-nav-link.active .app-nav-icon {
    color: var(--color-primary);
    background: rgba(124, 140, 255, .12);
    border-radius: 8px;
}
body.app-shell-page .app-user-card {
    padding: 10px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
}
body.app-shell-page .app-sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    gap: 8px;
}
body.app-shell-page .app-user-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
}
body.app-shell-page .app-sidebar-footer > .btn {
    display: block;
    width: 100%;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: .78rem;
    color: #a4a4a4;
    background: transparent;
    border-color: #303030;
    box-shadow: none;
}
body.app-shell-page .app-sidebar-footer > .btn:hover {
    color: #f2f2f2;
    background: rgba(124, 140, 255, .08);
    border-color: rgba(124, 140, 255, .35);
}
body.app-shell-page .app-balance-pill,
body.app-shell-page .app-user-chip {
    background: #242424;
}
body.app-shell-page .app-balance-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2), 0 0 12px rgba(34, 197, 94, .8); }
body.app-shell-page .app-balance-dot.status-balance-low { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .2), 0 0 12px rgba(239, 68, 68, .8); }
.btn-primary { background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }
body.camera-simple .camera-tabs a.active { border-bottom-color: var(--color-primary); }
body.camera-simple .xmax-mode-option.is-selected,
body.camera-simple .xmax-background-option.is-selected { background: #3b3b3b; }
body.camera-simple .camera-card,
body.camera-simple .xmax-primary-reference,
body.camera-simple .xmax-secondary-reference { background: #181818; border-color: #303030; }
body.camera-simple .camera-card .video-frame { background: #242424; }
body.app-shell-page .panel,
body.app-shell-page .price-card,
body.app-shell-page .stat-card,
body.app-shell-page .credit-purchase-panel {
    background: #181818;
    border-color: #303030;
    box-shadow: none;
}
body.app-shell-page .panel input,
body.app-shell-page .panel textarea,
body.app-shell-page .panel select {
    background: #111111;
    border-color: #303030;
    color: #f1f1f1;
}
body.app-shell-page .panel input:focus,
body.app-shell-page .panel textarea:focus,
body.app-shell-page .panel select:focus {
    border-color: #b2b2b2;
    box-shadow: 0 0 0 3px rgba(178, 178, 178, .14);
}
body.app-shell-page .credit-option.is-selected { border-color: #8a8a8a; }

/* Keep authentication and camera transformation surfaces in the graphite
   palette used by the rest of the refreshed site. */
.auth-wrap {
    background: #181818;
    border-color: #303030;
    box-shadow: none;
}
.form-group input {
    background: #111111;
    border-color: #303030;
}
.form-group input:focus {
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(178, 178, 178, .14);
}
body.camera-simple .xmax-mode-options,
body.camera-simple .xmax-background-options {
    border: 0;
    background: #242424;
}
body.camera-simple .xmax-mode-option,
body.camera-simple .xmax-background-option {
    border: 0;
    background: transparent;
    color: #a9a9a9;
}
body.camera-simple .xmax-mode-option.is-selected,
body.camera-simple .xmax-background-option.is-selected {
    background: #3b3b3b;
    color: #f5f5f5;
    box-shadow: none;
}
body.camera-simple .xmax-prompt-field textarea,
body.camera-simple .xmax-primary-reference input[type="file"],
body.camera-simple .xmax-secondary-reference input[type="file"] {
    background: #181818;
    border-color: #3a3a3a;
    color: #ededed;
}
body.camera-simple .xmax-prompt-field textarea:focus {
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(178, 178, 178, .14);
}

/* Final palette pass: no blue surfaces or translucent blur on account/login
   chrome, and no outer board around the transformation controls. */
body.app-shell-page .app-topbar,
body.app-shell-page .app-sidebar,
body.app-shell-page .app-shell,
body.app-shell-page .app-content,
body:not(.app-shell-page) .site-header {
    background: #151515;
    background-image: none;
    backdrop-filter: none;
}
body.app-shell-page .app-shell,
body:not(.app-shell-page) main { background-color: #111111; }
body.app-shell-page .btn-primary,
body.app-shell-page .btn-primary:focus,
body.app-shell-page .btn-primary:active,
body.app-shell-page .btn-primary:not(:disabled):hover,
body:not(.app-shell-page) .btn-primary,
body:not(.app-shell-page) .btn-primary:focus,
body:not(.app-shell-page) .btn-primary:active,
body:not(.app-shell-page) .btn-primary:not(:disabled):hover {
    background: #3b3b3b;
    border-color: #4a4a4a;
    color: #f5f5f5;
}
body.app-shell-page .btn-primary:hover,
body:not(.app-shell-page) .btn-primary:hover {
    background: #4a4a4a;
    border-color: #5a5a5a;
}
body.app-shell-page .btn-outline,
body.app-shell-page .btn-outline:focus,
body.app-shell-page .btn-outline:active,
body.app-shell-page .btn-outline:not(:disabled):hover,
body:not(.app-shell-page) .btn-outline,
body:not(.app-shell-page) .btn-outline:focus,
body:not(.app-shell-page) .btn-outline:active,
body:not(.app-shell-page) .btn-outline:not(:disabled):hover {
    background: #1f1f1f;
    border-color: #3a3a3a;
    color: #ededed;
}
body.app-shell-page .btn-outline:hover,
body:not(.app-shell-page) .btn-outline:hover { background: #2a2a2a; }
body.camera-simple .camera-settings {
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.camera-simple .xmax-prompt-field textarea,
body.camera-simple .xmax-primary-reference input[type="file"],
body.camera-simple .xmax-secondary-reference input[type="file"] {
    background: #181818;
    border-color: #3a3a3a;
    color: #ededed;
}
body.camera-simple .xmax-prompt-field textarea:focus {
    border-color: #b2b2b2;
    box-shadow: 0 0 0 3px rgba(178, 178, 178, .14);
}

/* Final camera transformation palette: graphite and ash, without blue UI
   surfaces or bright white action buttons. */
body.camera-simple .xmax-mode-options {
    display: flex;
    width: 250px;
    max-width: 250px;
    min-width: 0;
    padding: 4px;
    gap: 6px;
    border: 0;
    border-radius: 13px;
    background: #242424;
    box-sizing: border-box;
}
body.camera-simple .xmax-background-options {
    width: fit-content;
    max-width: 100%;
    padding: 4px;
    gap: 2px;
    border: 0;
    border-radius: 13px;
    background: #242424;
}
body.camera-simple .xmax-mode-option,
body.camera-simple .xmax-background-option {
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #a9a9a9;
}
body.camera-simple .xmax-mode-option {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 6px;
    font-size: .72rem;
}
body.camera-simple .xmax-mode-option.is-selected,
body.camera-simple .xmax-background-option.is-selected {
    background: #3b3b3b;
    color: #f5f5f5;
    box-shadow: none;
}

/* Universal compact XMAX mode style across all pages, matching the camera mobile layout. */
body.camera-simple .xmax-mode-options,
.output-body.output-simple.xmax-output .xmax-mode-options,
.xmax-mode-options {
    display: flex;
    width: 250px;
    max-width: 250px;
    min-width: 0;
    padding: 4px;
    gap: 6px;
    border: 0;
    border-radius: 13px;
    background: #242424;
    box-sizing: border-box;
}
body.camera-simple .xmax-mode-option,
.output-body.output-simple.xmax-output .xmax-mode-option,
.xmax-mode-option {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 6px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #a9a9a9;
    font-size: .72rem;
}
body.camera-simple .xmax-mode-option span,
.output-body.output-simple.xmax-output .xmax-mode-option span,
.xmax-mode-option span {
    display: none;
}
body.camera-simple .xmax-mode-option:hover,
body.camera-simple .xmax-background-option:hover,
body.camera-simple .xmax-mode-option:focus-visible,
body.camera-simple .xmax-background-option:focus-visible {
    background: #303030;
    color: #f5f5f5;
}
body.camera-simple .xmax-prompt-field textarea,
body.camera-simple .xmax-primary-reference input[type="file"],
body.camera-simple .xmax-secondary-reference input[type="file"] {
    border-color: #3a3a3a;
    background: #181818;
    color: #ededed;
}
body.camera-simple .camera-controls .btn-primary,
body.camera-simple .xmax-action-row .btn-primary {
    background: #3b3b3b;
    border-color: #4a4a4a;
    color: #f5f5f5;
}
body.camera-simple .camera-controls .btn-primary:hover,
body.camera-simple .xmax-action-row .btn-primary:hover {
    background: #4a4a4a;
    border-color: #5a5a5a;
}

/* Do not allow the transformation form to create a horizontal page wider
   than a phone. Legacy desktop widths on its file controls caused the prompt
   and reference panel to run off the right edge. */
@media (max-width: 760px) {
    body.camera-simple .camera-settings,
    body.camera-simple .ai-transform-form,
    body.camera-simple .camera-settings-grid,
    body.camera-simple .xmax-mode-card,
    body.camera-simple .xmax-primary-reference,
    body.camera-simple .xmax-secondary-reference {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    body.camera-simple .xmax-prompt-field textarea,
    body.camera-simple .xmax-primary-reference input[type="file"],
    body.camera-simple .xmax-secondary-reference input[type="file"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
}

/* Final auth palette: keep login/register surfaces graphite, with no blue or
   purple gradient, focus ring, or bright submit button. */
body:not(.app-shell-page) .auth-wrap {
    background: #181818;
    border-color: #303030;
    box-shadow: none;
}
body:not(.app-shell-page) .auth-wrap input {
    background: #111111;
    border-color: #303030;
    color: #ededed;
}
body:not(.app-shell-page) .auth-wrap input:focus {
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(178, 178, 178, .14);
}
body:not(.app-shell-page) .auth-wrap .btn-primary {
    background: #3b3b3b;
    border-color: #4a4a4a;
    color: #f5f5f5;
}
body:not(.app-shell-page) .auth-wrap .btn-primary:hover {
    background: #4a4a4a;
    border-color: #5a5a5a;
}

/* Final Credits page rules. These are intentionally last so legacy pricing
   and universal button rules cannot expand or recolor the purchase cards. */
body.credits-page-body .credits-page {
    width: min(1040px, 100%);
    max-width: none;
    margin: 0 auto;
    padding: 16px 0 48px;
}
body.credits-page-body .credits-page-head { margin: 0 0 22px; }
body.credits-page-body .credit-purchase-panel {
    width: 100%;
    max-width: none;
    padding: 24px 26px 26px;
    border: 1px solid #303030;
    border-radius: 18px;
    background: #181818;
    box-shadow: none;
}
body.credits-page-body .credit-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
body.credits-page-body .credit-option {
    min-width: 0;
    min-height: 170px;
    padding: 12px;
    border: 1px solid #252525;
    border-radius: 13px;
    background: #050505;
    color: #f1f1f1;
}
body.credits-page-body .credit-option:hover { border-color: #707070; }
body.credits-page-body .credit-option.is-selected {
    border-color: #a9a9a9;
    background: #080808;
    box-shadow: none;
}
body.credits-page-body .credit-mark { background: #303030; color: #d3d3d3; }
body.credits-page-body .credits-buy-button {
    margin-top: 22px;
    padding: 11px;
    border: 0;
    background: #b2b2b2;
    color: #151515;
}
body.credits-page-body .credits-buy-button:hover { background: #8f8f8f; }

/* Desktop companion downloads. Native installers are enabled only when a
   signed release URL is configured in the server environment. */
body.downloads-page-body .downloads-page {
    width: min(1040px, 100%);
    margin: 0 auto;
    padding: 24px 0 56px;
}
body.downloads-page-body .downloads-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0 30px;
    border-bottom: 1px solid #26262b;
}
body.downloads-page-body .downloads-eyebrow {
    display: block;
    margin-bottom: 10px;
    color: #8b94a8;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
body.downloads-page-body .downloads-hero h1 {
    margin: 0 0 10px;
    color: #f3f3f1;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -.045em;
}
body.downloads-page-body .downloads-hero p {
    max-width: 570px;
    margin: 0;
    color: #8c8c94;
    font-size: .92rem;
    line-height: 1.65;
}
body.downloads-page-body .downloads-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid #2b2b30;
    border-radius: 999px;
    color: #b5b5ba;
    font-size: .74rem;
}
body.downloads-page-body .downloads-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a9a9ae; }
body.downloads-page-body .downloads-local-note { margin: 18px 0 0; max-width: 760px; color: #a9a9ae; font-size: .78rem; line-height: 1.55; }
body.downloads-page-body .downloads-local-note strong { color: #e8e8e6; }
body.downloads-page-body .downloads-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 26px 0 38px;
}
body.downloads-page-body .download-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #29292e;
    border-radius: 14px;
    background: #131316;
}
body.downloads-page-body .download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 20px;
    border: 1px solid #38383e;
    border-radius: 11px;
    color: #eeeeec;
    background: #0d0d10;
}
body.downloads-page-body .download-icon svg { width: 22px; height: 22px; }
body.downloads-page-body .download-card h2 { margin: 0 0 5px; color: #f3f3f1; font-size: 1.15rem; }
body.downloads-page-body .download-card p { margin: 0 0 12px; color: #8c8c94; font-size: .82rem; }
body.downloads-page-body .download-format { margin: 0; color: #606068; font-size: .72rem; }
body.downloads-page-body .download-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 38px;
    margin-top: 22px;
    padding: 8px 11px;
    border: 1px solid #eeeeec;
    border-radius: 8px;
    color: #f5f5f3;
    background: transparent;
    font-size: .75rem;
    font-weight: 650;
}
body.downloads-page-body .download-action:hover { color: #fff; background: #1b1b1f; }
body.downloads-page-body .download-action.is-unavailable { border-color: #35353b; color: #676770; cursor: default; }
body.downloads-page-body .downloads-flow {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 34px;
    padding-top: 26px;
    border-top: 1px solid #26262b;
}
body.downloads-page-body .downloads-flow h2 { margin: 0; color: #f3f3f1; font-size: 1.25rem; letter-spacing: -.03em; }
body.downloads-page-body .downloads-flow ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: download-step; }
body.downloads-page-body .downloads-flow li { counter-increment: download-step; color: #8c8c94; font-size: .78rem; line-height: 1.5; }
body.downloads-page-body .downloads-flow li::before { content: "0" counter(download-step); display: block; margin-bottom: 12px; color: #66666d; font-size: .7rem; font-weight: 700; letter-spacing: .12em; }
body.downloads-page-body .downloads-flow strong { display: block; margin-bottom: 4px; color: #e8e8e6; font-size: .82rem; }
body.downloads-page-body .downloads-flow span { display: block; }
@media (max-width: 760px) {
    body.downloads-page-body .downloads-page { padding: 14px 0 38px; }
    body.downloads-page-body .downloads-hero { display: block; }
    body.downloads-page-body .downloads-status { margin-top: 18px; }
    body.downloads-page-body .downloads-grid { grid-template-columns: 1fr; padding-top: 20px; }
    body.downloads-page-body .downloads-flow { grid-template-columns: 1fr; gap: 22px; }
    body.downloads-page-body .downloads-flow ol { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    body.credits-page-body .credits-page-head { align-items: flex-start; flex-direction: column; }
    body.credits-page-body .credits-remaining { text-align: left; }
    body.credits-page-body .credit-purchase-panel { padding: 16px; }
    body.credits-page-body .credit-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Final account layout: compact, left-aligned, and responsive without stacked
   cards or shadows around the profile controls. */
body.account-page .app-content {
    padding: clamp(16px, 3vw, 30px) clamp(16px, 4vw, 42px) 48px;
}
body.account-page .app-container {
    width: min(100%, 820px);
    max-width: none;
    margin: 0;
}
body.account-page .page-header {
    width: 100%;
    max-width: 820px;
    margin: 0 0 20px;
    text-align: left;
}
body.account-page .page-header h1 {
    margin: 0 0 5px;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    letter-spacing: -.02em;
}
body.account-page .page-header p {
    margin: 0;
    font-size: .85rem;
}
body.account-page .account-usage-summary {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) minmax(190px, 1.35fr) auto;
    align-items: center;
    gap: 18px 28px;
    width: 100%;
    max-width: 820px;
    margin: 0 0 26px;
    padding: 0 0 20px;
    border-bottom: 1px solid #292929;
}
body.account-page .account-usage-summary > div {
    min-width: 0;
    gap: 3px;
}
body.account-page .account-usage-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
}
body.account-page .account-usage-summary .btn {
    margin: 0;
    white-space: nowrap;
}
body.account-page .panel {
    width: 100%;
    max-width: 820px;
    margin: 0 0 26px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.account-page .panel + .panel {
    padding-top: 24px;
    border-top: 1px solid #292929;
}
body.account-page .panel h2 {
    margin: 0 0 5px;
    font-size: 1.08rem;
    letter-spacing: -.01em;
}
body.account-page .panel .subtext {
    margin: 0 0 16px;
    font-size: .8rem;
}
body.account-page form {
    width: 100%;
    max-width: 820px;
}
body.account-page .form-group {
    margin-bottom: 13px;
}
body.account-page .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: .78rem;
}
body.account-page .form-group input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 9px;
    background: #111111;
    border-color: #303030;
    box-sizing: border-box;
}
body.account-page .form-group input:focus {
    border-color: #8a8a8a;
    box-shadow: none;
}
body.account-page .panel .btn {
    margin-top: 2px;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: .8rem;
}

@media (max-width: 760px) {
    body.account-page .account-usage-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 20px;
    }
    body.account-page .account-usage-summary .btn {
        grid-column: 1 / -1;
        justify-self: start;
    }
}
@media (max-width: 520px) {
    body.account-page .app-content {
        padding: 16px 14px 36px;
    }
    body.account-page .page-header {
        margin-bottom: 18px;
    }
    body.account-page .page-header h1 {
        font-size: 1.4rem;
    }
    body.account-page .account-usage-summary {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-bottom: 18px;
    }
    body.account-page .account-usage-summary .btn {
        grid-column: auto;
    }
    body.account-page .panel {
        margin-bottom: 22px;
    }
    body.account-page .panel + .panel {
        padding-top: 20px;
    }
}

/* Keep password visibility controls inside the existing input treatment. */
.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    border: 0;
    padding: 5px 4px;
    background: transparent;
    color: var(--color-text-muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--color-text);
}

/* Keep authentication fields dark even when shared/browser form styles win. */
body:not(.app-shell-page) .auth-wrap,
body:not(.app-shell-page) .auth-wrap form,
body:not(.app-shell-page) .auth-wrap .password-input-wrap {
    background: #181818;
}

body:not(.app-shell-page) .auth-wrap input,
body:not(.app-shell-page) .auth-wrap input:-webkit-autofill,
body:not(.app-shell-page) .auth-wrap input:-webkit-autofill:hover,
body:not(.app-shell-page) .auth-wrap input:-webkit-autofill:focus {
    background-color: #111111;
    -webkit-text-fill-color: #ededed;
    box-shadow: 0 0 0 1000px #111111 inset;
    color: #ededed;
}

body:not(.app-shell-page) .auth-wrap .password-toggle {
    background: transparent;
    color: #bdbdbd;
}

body:not(.app-shell-page) .auth-wrap .password-toggle:hover,
body:not(.app-shell-page) .auth-wrap .password-toggle:focus-visible {
    background: transparent;
    color: #ffffff;
}

/* Keep the focused dark authentication layout usable in narrow webviews. */
@media (max-width: 560px) {
    html, body { overflow-x: hidden; }

    body.auth-minimal-page .site-header .header-inner {
        min-height: 60px;
        height: 60px;
        gap: 12px;
        padding: 0 14px;
        overflow: hidden;
    }

    body.auth-minimal-page .site-header .brand {
        min-width: 0;
        overflow: hidden;
    }

    body.auth-minimal-page .site-header .brand-logo {
        width: auto;
        max-width: min(145px, 48vw);
        height: auto;
    }

    body.auth-minimal-page .site-nav {
        position: static;
        display: flex;
        flex: 0 0 auto;
        width: auto;
        margin-left: auto;
        padding: 0;
        border: 0;
        background: transparent;
        white-space: nowrap;
    }

    body.auth-minimal-page .site-nav a:first-child {
        display: inline-flex;
        padding: 8px 0 8px 8px;
    }

    body.auth-minimal-page .nav-toggle { display: none; }

    body.auth-minimal-page main > .container {
        width: 100%;
        padding-left: 14px;
        padding-right: 14px;
    }

    body.auth-minimal-page .auth-wrap {
        width: 100%;
        max-width: 420px;
        margin: 24px auto;
        padding: 22px 18px;
        border-radius: 16px;
    }

    body.auth-minimal-page .auth-wrap h1 { font-size: 1.4rem; }
    body.auth-minimal-page .auth-wrap .subtext { margin-bottom: 22px; }
}

/* Small feedback state for camera route changes. */
a.is-nav-loading {
    pointer-events: none;
    opacity: .72;
}

a.is-nav-loading::before {
    content: "";
    width: 11px;
    height: 11px;
    margin-right: 7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: nav-loading-spin .7s linear infinite;
    flex: 0 0 auto;
}

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

/* Mobile app header: this must be the final rule because earlier desktop
   palette rules share the same selector. Fixed positioning avoids Safari's
   unreliable sticky behavior inside the flex app shell. */
@media (max-width: 720px) {
    body.app-shell-page .app-main {
        padding-top: 64px;
    }

    body.app-shell-page .app-topbar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: auto;
        left: 0;
        width: 100%;
        min-height: 64px;
        height: 64px;
        margin: 0;
        z-index: 20;
    }
}
