:root {
    --bg: #050505;
    --panel: rgba(18, 20, 24, 0.82);
    --panel-border: rgba(136, 99, 255, 0.35);
    --text: #f5f1ea;
    --muted: #a6a1b4;
    --accent: #9d7cff;
    --accent-strong: #9fd7ff;
    --card: #0d0e12;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --screen-h1-size: clamp(1.9rem, 6vw, 2.4rem);
    --screen-h1-size-wide: clamp(2.2rem, 3.4vw, 2.8rem);
    --screen-h1-line-height: 1.12;
    --screen-h1-letter-spacing: -0.01em;
    --screen-h1-weight: 600;
}

/* Talking object /start funnel */
.start-funnel-body {
    background:
        linear-gradient(135deg, rgba(244, 123, 79, 0.14), transparent 28%),
        linear-gradient(225deg, rgba(64, 179, 162, 0.14), transparent 32%),
        linear-gradient(180deg, #101114 0%, #08090b 54%, #060708 100%);
}

.start-funnel-shell {
    width: min(1160px, 100%);
    padding-inline: 24px;
}

.start-funnel-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 12px;
}

.start-funnel-progress span {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.start-funnel-progress span.is-active {
    background: #f47b4f;
}

.start-funnel-step {
    display: none;
    width: 100%;
    flex: 1;
    padding: 34px 0 42px;
}

.start-funnel-step.is-active {
    display: grid;
    align-content: center;
    gap: 20px;
}

.start-funnel-step:not(.start-funnel-step--hero) {
    width: min(100%, 900px);
    margin-inline: auto;
}

.start-funnel-step[data-step="login"] {
    width: min(100%, 620px);
}

.start-funnel-step--hero.is-active,
.start-funnel-paywall {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
    align-items: center;
    gap: clamp(26px, 6vw, 72px);
}

.start-funnel-copy {
    max-width: 720px;
}

.start-funnel-copy h1 {
    margin: 0;
    max-width: 780px;
    color: #fff;
    font-size: clamp(2.7rem, 5.2vw, 5.35rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0;
    text-wrap: balance;
}

.start-funnel-copy p:not(.eyebrow) {
    max-width: 58ch;
    color: rgba(245, 241, 234, 0.72);
    font-size: 1.06rem;
    line-height: 1.62;
}

.start-upload-row {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(160px, 220px);
    gap: 14px;
    align-items: stretch;
    max-width: 760px;
}

.start-upload-card {
    display: grid;
    min-height: 96px;
    align-content: center;
    gap: 8px;
    padding: 16px;
    border: 1px dashed rgba(245, 241, 234, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
    cursor: pointer;
}

.start-upload-card:hover {
    border-color: rgba(244, 123, 79, 0.64);
    background: rgba(244, 123, 79, 0.1);
}

.start-upload-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.start-upload-card span {
    font-size: 1.08rem;
    font-weight: 850;
}

.start-upload-card small,
.start-sample-card small {
    color: rgba(245, 241, 234, 0.62);
    line-height: 1.4;
}

.start-upload-preview {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
}

.start-upload-preview img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 96px;
    object-fit: cover;
}

.start-choice-separator {
    max-width: 820px;
    margin: -2px 0 0;
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.start-sample-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 820px;
}

.start-sample-card {
    display: grid;
    gap: 10px;
    align-items: center;
    justify-items: center;
    min-height: 132px;
    padding: 14px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.start-sample-card:hover,
.start-sample-card.is-selected,
.start-template-list button:hover,
.start-template-list button.is-selected {
    border-color: rgba(244, 123, 79, 0.58);
    background: rgba(244, 123, 79, 0.11);
}

.start-sample-thumb {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #f47b4f, #40b3a2);
    color: #09090c;
    font-size: 1.35rem;
    font-weight: 950;
}

.start-sample-card strong {
    display: block;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    line-height: 1.15;
}

.start-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 820px;
}

.start-choice-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.start-template-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 820px;
}

.start-template-list button {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(245, 241, 234, 0.86);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 760;
    cursor: pointer;
}

.start-own-idea[hidden],
.start-upload-preview[hidden] {
    display: none;
}

.start-summary-list {
    display: grid;
    gap: 10px;
    max-width: 820px;
    margin: 0;
}

.start-summary-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.start-summary-list dt {
    color: rgba(245, 241, 234, 0.56);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.start-summary-list dd {
    min-width: 0;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.start-funnel-paywall .start-plan-card {
    align-self: center;
}

.start-funnel-paywall {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
}

.start-funnel-paywall .start-paywall-main {
    max-width: 720px;
    text-align: center;
    justify-self: center;
}

.start-funnel-paywall .start-result-copy {
    margin-inline: auto;
}

.start-funnel-paywall .start-plan-grid {
    width: min(100%, 820px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: center;
}

.start-funnel-paywall .start-plan-card {
    min-height: 270px;
    align-self: stretch;
}

.start-funnel-paywall .start-plan-note {
    grid-column: 1 / -1;
}

.start-paywall-benefits {
    width: min(100%, 820px);
    justify-self: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.start-paywall-benefits h2 {
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
    letter-spacing: 0;
}

.start-paywall-benefits .start-paywall-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

@media (max-width: 840px) {
    .start-funnel-shell {
        padding-inline: 16px;
    }

    .start-funnel-step {
        padding-top: 22px;
    }

    .start-funnel-step--hero.is-active,
    .start-funnel-paywall {
        grid-template-columns: 1fr;
        align-content: start;
    }

    .start-funnel-copy h1 {
        font-size: clamp(2.45rem, 12vw, 4rem);
    }

    .start-upload-row,
    .start-sample-grid,
    .start-choice-grid,
    .start-choice-grid--compact {
        grid-template-columns: 1fr;
    }

    .start-summary-list div {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ── API templates ── */

.app-shell.templates-shell,
.app-shell.template-detail-shell {
    width: min(100%, 980px);
}

.templates-hero {
    margin-top: 36px;
    max-width: 660px;
}

.templates-hero h1 {
    margin: 8px 0 0;
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.templates-section {
    margin-top: 42px;
}

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

.templates-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.templates-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(18, 20, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    isolation: isolate;
}

.templates-card-media::after,
.template-detail-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.72));
    pointer-events: none;
}

.templates-card-media img,
.templates-card-media video,
.template-detail-media img,
.template-detail-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 600ms ease;
}

.templates-card:hover .templates-card-media img,
.templates-card:hover .templates-card-media video,
.templates-card:focus-visible .templates-card-media img,
.templates-card:focus-visible .templates-card-media video {
    transform: scale(1.04);
}

.templates-card-category {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.78rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0;
}

.templates-card-media strong {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    color: #fff;
    font-size: clamp(1.55rem, 2.8vw, 2.35rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.templates-card-description {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.62);
    font-size: 1rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.templates-empty {
    margin-top: 42px;
    max-width: 520px;
}

.templates-empty h1,
.templates-empty h2 {
    margin: 0 0 12px;
    color: #fff;
}

.templates-empty p {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.66);
}

.templates-primary-link,
.template-use-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 18px;
    padding: 0 22px;
    background: #f47b4f;
    color: #fff;
    font-weight: 850;
    text-decoration: none;
}

.template-back-link {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 780;
    text-decoration: none;
}

.template-detail {
    display: grid;
    gap: 34px;
    max-width: 760px;
    margin-top: 0;
}

.template-detail-panel {
    display: grid;
    gap: 24px;
    margin-top: 24px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
        rgba(8, 8, 12, 0.38);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.template-detail-media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 28px;
    background: rgba(18, 20, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    isolation: isolate;
}

.template-detail-media h1 {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    z-index: 2;
    margin: 0;
    color: #fff;
    font-size: clamp(2.4rem, 7vw, 4.7rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.template-detail-section h2 {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.66);
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.template-detail-section p,
.template-prompt-box {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.12rem, 2.4vw, 1.45rem);
    line-height: 1.45;
}

.template-prompt-box {
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.055);
}

.template-detail-chip {
    width: max-content;
    margin: -8px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.66);
    font-weight: 760;
}

.template-detail-action {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -14px -14px;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
}

.template-use-button {
    width: 100%;
    min-height: 68px;
    border-radius: 24px;
    font-size: 1.35rem;
}

@media (max-width: 760px) {
    .app-shell.templates-shell,
    .app-shell.template-detail-shell {
        padding-inline: 18px;
    }

    .templates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 12px;
    }

    .templates-card-media {
        border-radius: 18px;
    }

    .templates-card-category {
        top: 13px;
        right: 13px;
        font-size: 0.68rem;
    }

    .templates-card-media strong {
        left: 14px;
        right: 14px;
        bottom: 14px;
        font-size: clamp(1.35rem, 8vw, 2.05rem);
    }

    .templates-card-description {
        font-size: 0.95rem;
    }

    .template-detail-media {
        border-radius: 22px;
    }

    .template-detail-media h1 {
        left: 22px;
        right: 22px;
        bottom: 22px;
    }
}

html {
    background-color: var(--bg);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    background:
        radial-gradient(circle at 18% 12%, rgba(125, 82, 255, 0.28), transparent 30%),
        radial-gradient(circle at 82% 88%, rgba(219, 77, 186, 0.18), transparent 30%),
        radial-gradient(circle at 68% 22%, rgba(97, 74, 255, 0.12), transparent 26%),
        linear-gradient(180deg, #110d1f 0%, #090711 54%, #06050a 100%);
    color: var(--text);
}

body.drawer-open {
    overflow: hidden;
}

.app-shell {
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 18px 16px 40px;
}

.login-body {
    min-height: 100vh;
}

.login-clean {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px 16px 44px;
}

.login-clean-inner {
    width: min(520px, 100%);
    display: grid;
    justify-items: center;
}

.login-modal {
    position: relative;
    width: min(520px, 100%);
    padding: 44px 28px 30px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 18% 18%, rgba(157, 124, 255, 0.18), transparent 38%),
        radial-gradient(circle at 82% 86%, rgba(217, 79, 195, 0.12), transparent 42%),
        rgba(10, 11, 14, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-brand {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.login-heading {
    margin: 0;
    text-align: center;
    font-family: inherit;
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-transform: none;
    text-wrap: balance;
    max-width: 14ch;
    margin-inline: auto;
}


.login-subtitle {
    margin: 12px 0 0;
    text-align: center;
    color: rgba(245, 241, 234, 0.62);
    font-size: 1rem;
}

.login-providers {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    width: 100%;
}

.login-provider {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 0 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(245, 241, 234, 0.92);
    text-decoration: none;
    text-align: left;
    font-weight: 700;
    font-size: 1.05rem;
    font-family: inherit;
    width: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.login-provider:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.login-provider[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.login-provider-badge {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}

.login-provider-icon {
    width: 44px;
    height: 44px;
    display: block;
    object-fit: contain;
}

.login-provider-badge-dot {
    width: 14px;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(135deg, #8f63ff 0%, #d94fc3 100%);
}

.login-legal {
    margin: 20px 0 0;
    max-width: 44ch;
    text-align: center;
    color: rgba(245, 241, 234, 0.42);
    font-size: 0.9rem;
    line-height: 1.5;
}

.login-legal a {
    color: rgba(245, 241, 234, 0.72);
    text-decoration: none;
}

.login-legal a:hover {
    text-decoration: underline;
}

.create-shell {
    padding-bottom: 100px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.start-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #101114 0%, #08090b 42%, #060708 100%);
}

.start-body[data-start-mode="make-photo-dance"] {
    background:
        radial-gradient(circle at 84% 18%, rgba(244, 123, 79, 0.24), transparent 27%),
        radial-gradient(circle at 16% 74%, rgba(159, 215, 255, 0.18), transparent 30%),
        linear-gradient(145deg, #2a1747 0%, #171022 48%, #321b40 100%);
    color: #f8f3ff;
}

.start-body[data-start-mode="make-photo-dance"] .start-brand,
.start-body[data-start-mode="make-photo-dance"] .start-topbar-link,
.start-body[data-start-mode="make-photo-dance"] .start-copy h1 {
    color: #fff;
}

.start-body[data-start-mode="make-photo-dance"] .start-topbar-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.start-body[data-start-mode="make-photo-dance"] .start-copy p:not(.eyebrow) {
    color: rgba(248, 243, 255, 0.74);
}

.start-body[data-start-mode="make-photo-dance"] .start-proof-list li {
    color: rgba(248, 243, 255, 0.84);
}

.start-body[data-start-mode="make-photo-dance"] .start-proof-list li::before {
    box-shadow: inset 0 0 0 4px #211437;
}

.start-body[data-start-mode="make-photo-dance"] .start-inline-offer {
    color: rgba(248, 243, 255, 0.62);
}

.start-shell {
    width: min(100%, 1100px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 20px 46px;
    display: flex;
    flex-direction: column;
}

.start-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 58px;
}

.start-brand,
.start-topbar-link {
    color: var(--text);
    text-decoration: none;
}

.start-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 1.12rem;
    font-weight: 850;
}

.start-brand img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.start-topbar-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 8px;
    color: rgba(245, 241, 234, 0.82);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    font-weight: 780;
}

.start-offer-strip,
.start-offer-box {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(245, 241, 234, 0.82);
}

.start-offer-strip {
    margin-top: 16px;
    padding: 11px 14px;
    font-size: 0.9rem;
}

.start-offer-strip strong,
.start-offer-box strong {
    flex-shrink: 0;
    color: #fff;
}

.start-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 18px;
}

.start-progress span {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.start-progress span.is-active {
    background: #f47b4f;
}

.start-step {
    display: none;
    width: 100%;
    flex: 1;
    padding: 42px 0 0;
}

.start-step.is-active {
    display: grid;
    align-content: center;
    gap: 18px;
}

.start-step--hero.is-active,
.start-paywall,
.start-demo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: center;
    gap: clamp(24px, 6vw, 64px);
}

.start-step--center.is-active {
    justify-items: center;
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

.start-copy,
.start-step-heading {
    max-width: 680px;
}

.start-copy h1,
.start-step-heading h1,
.start-step--center h1,
.start-paywall h1 {
    margin: 0;
    max-width: 720px;
    color: #fff;
    font-size: clamp(2.35rem, 4vw, 4rem);
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    text-wrap: balance;
}

.start-step-heading h1,
.start-step--center h1,
.start-paywall h1 {
    font-size: clamp(2rem, 3.5vw, 3.35rem);
}

.start-step--center h1 {
    max-width: 620px;
    font-size: clamp(2rem, 3.2vw, 3rem);
}

.start-paywall h1 {
    font-size: clamp(2rem, 3.2vw, 3rem);
}

.start-copy p:not(.eyebrow),
.start-step-heading p:not(.eyebrow),
.start-step--center p:not(.eyebrow),
.start-result-copy {
    max-width: 54ch;
    color: rgba(245, 241, 234, 0.68);
    font-size: 1rem;
    line-height: 1.55;
}

.start-proof-list {
    display: grid;
    gap: 9px;
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

.start-proof-list li {
    position: relative;
    padding-left: 24px;
    color: rgba(245, 241, 234, 0.82);
    font-weight: 720;
    line-height: 1.35;
}

.start-proof-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #f47b4f;
    box-shadow: inset 0 0 0 4px #08090b;
}

.start-primary,
.start-secondary,
.start-back,
.start-provider {
    font: inherit;
    text-decoration: none;
}

.start-primary,
.start-secondary {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0 24px;
    border: 0;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
}

.start-primary {
    color: #fff;
    background: #f47b4f;
    box-shadow: 0 14px 34px rgba(244, 123, 79, 0.16);
}

.start-secondary {
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-primary:hover,
.start-secondary:hover,
.start-topbar-link:hover,
.start-provider:hover {
    filter: brightness(1.06);
}

.start-back {
    width: max-content;
    min-height: 42px;
    border: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    font-weight: 780;
    cursor: pointer;
}

.start-media-panel {
    position: relative;
    width: min(100%, 340px);
    justify-self: end;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 10px;
    background: #111318;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.32);
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero .eyebrow {
    display: none;
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero.is-active {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: center;
    gap: 22px;
    padding-top: 32px;
    text-align: center;
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero .start-copy {
    display: contents;
}

.start-body[data-start-mode="make-photo-dance"] .start-copy h1 {
    order: 1;
    max-width: 760px;
    font-size: clamp(2.65rem, 5vw, 4.1rem);
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero .start-copy > p:not(.eyebrow) {
    order: 3;
    max-width: 42ch;
    margin: 0;
}

.start-body[data-start-mode="make-photo-dance"] .start-proof-list {
    display: none;
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero .start-actions {
    order: 4;
    display: grid;
    justify-items: center;
    gap: 13px;
    width: min(100%, 540px);
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero .start-primary {
    width: min(100%, 520px);
    min-height: 60px;
    border-radius: 999px;
}

.start-body[data-start-mode="make-photo-dance"] .start-step--hero .start-media-panel {
    order: 2;
    justify-self: center;
    width: auto;
    height: min(40vh, 360px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(244, 123, 79, 0.1);
}

.start-media-panel video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.start-media-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.72));
}

.start-media-caption {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 1;
    display: grid;
    gap: 5px;
    color: #fff;
}

.start-media-caption strong {
    font-size: 1.05rem;
}

.start-media-caption span {
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.92rem;
}

.start-option-grid {
    display: grid;
    gap: 10px;
    max-width: 760px;
}

.start-option-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 860px;
}

.start-option-card,
.start-choice,
.start-input-card,
.start-login-card,
.start-price-card,
.start-demo-insight,
.start-plan-card {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-option-card,
.start-choice {
    color: #fff;
    cursor: pointer;
}

.start-option-card {
    min-height: 148px;
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: start;
    gap: 16px;
    padding: 18px;
    text-align: left;
    font: inherit;
}

.start-option-card:hover,
.start-option-card.is-selected,
.start-choice:hover,
.start-choice.is-selected {
    border-color: rgba(244, 123, 79, 0.54);
    background: rgba(244, 123, 79, 0.11);
}

.start-option-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #f47b4f;
}

.start-option-icon svg,
.start-choice svg,
.start-result-badge svg {
    width: 25px;
    height: 25px;
    display: block;
}

.start-option-icon path,
.start-option-icon rect,
.start-option-icon circle,
.start-choice path,
.start-result-badge path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.start-option-icon path:first-child:last-child,
.start-result-badge path {
    fill: currentColor;
    stroke: none;
}

.start-option-card strong {
    display: block;
    margin-bottom: 7px;
    font-size: 1.08rem;
    line-height: 1.2;
}

.start-option-card small {
    color: rgba(245, 241, 234, 0.62);
    font-size: 0.95rem;
    line-height: 1.42;
}

.start-choice {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px 0 20px;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 820;
    text-align: left;
}

.start-demo-copy {
    display: grid;
    gap: 18px;
    max-width: 680px;
}

.start-demo-copy h1 {
    margin: 0;
    max-width: 680px;
    color: #fff;
    font-size: clamp(2rem, 3.5vw, 3.3rem);
    line-height: 1;
    letter-spacing: 0;
    text-wrap: balance;
}

.start-demo-insight {
    display: grid;
    gap: 7px;
    max-width: 560px;
    padding: 16px;
}

.start-demo-insight span {
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.start-demo-insight strong {
    color: #fff;
    line-height: 1.4;
}

.start-demo-media {
    justify-self: center;
}

.start-choice svg {
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.48);
}

.start-input-card {
    display: grid;
    gap: 12px;
    max-width: 760px;
    padding: 18px;
}

.start-input-card span {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 820;
}

.start-input-card textarea {
    width: 100%;
    resize: vertical;
    min-height: 160px;
    border: 0;
    outline: 0;
    border-radius: 8px;
    padding: 16px;
    color: #fff;
    background: rgba(0, 0, 0, 0.24);
    font: inherit;
    line-height: 1.45;
}

.start-input-card textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.start-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.start-inline-offer {
    max-width: 34ch;
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.92rem;
    line-height: 1.4;
}

.start-loader {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f47b4f;
    animation: start-spin 900ms linear infinite;
}

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

.start-result-badge {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #09090c;
    background: #9fd7ff;
    box-shadow: 0 18px 48px rgba(159, 215, 255, 0.2);
}

.start-login-card {
    width: min(100%, 520px);
    display: grid;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

.start-provider {
    min-height: 62px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid rgba(17, 18, 23, 0.14);
    border-radius: 8px;
    color: #111217;
    background: #fff;
    font-weight: 850;
    text-align: center;
    transition: filter 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.start-provider span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
}

.start-provider img {
    display: block;
}

.start-provider::after {
    content: "";
    width: 32px;
    height: 1px;
}

.start-provider:hover,
.start-provider:focus-visible {
    filter: brightness(1.04);
    outline: none;
    transform: translateY(-1px);
}

.start-provider[data-login-provider="apple"] {
    border-color: rgba(255, 255, 255, 0.2);
    background: #000;
    color: #fff;
}

.start-login-note {
    width: min(100%, 520px);
    margin: -4px 0 0;
    color: rgba(245, 241, 234, 0.52);
    font-size: 0.84rem;
    line-height: 1.45;
    text-align: center;
}

.start-paywall-main {
    max-width: 680px;
}

.start-offer-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    max-width: 620px;
    margin-top: 18px;
    padding: 14px;
}

.start-offer-box span {
    color: rgba(245, 241, 234, 0.7);
    line-height: 1.45;
}

.start-paywall-features {
    display: grid;
    gap: 12px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.start-paywall-features li {
    position: relative;
    padding-left: 30px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.4;
}

.start-paywall-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #f47b4f;
    box-shadow: inset 0 0 0 4px #08090b;
}

.start-price-card,
.start-plan-card {
    display: grid;
    gap: 13px;
    padding: 20px;
}

.start-plan-grid {
    display: grid;
    gap: 14px;
}

.start-plan-note {
    margin: 0;
    color: rgba(245, 241, 234, 0.5);
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: center;
}

.start-plan-card {
    min-width: 0;
}

.start-plan-card--featured {
    border-color: rgba(244, 123, 79, 0.44);
    background: rgba(244, 123, 79, 0.095);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.start-price-card h2,
.start-plan-card h2 {
    margin: 0;
    color: #fff;
    font-size: 1.55rem;
}

.start-price,
.start-price-card p:last-child,
.start-plan-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.4;
}

.start-price {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.98rem;
    font-weight: 760;
    line-height: 1.35;
}

.start-price-badge {
    width: max-content;
    border-radius: 8px;
    padding: 7px 10px;
    color: #fff;
    background: rgba(244, 123, 79, 0.22);
    font-size: 0.78rem;
    font-weight: 900;
}

.start-checkout-status {
    min-height: 1.3em;
    color: rgba(245, 241, 234, 0.6);
    font-size: 0.84rem;
}

@media (max-width: 840px) {
    .start-shell {
        padding: 16px 16px 32px;
    }

    .start-step--hero.is-active,
    .start-body[data-start-mode="make-photo-dance"] .start-step--hero.is-active,
    .start-paywall,
    .start-demo {
        grid-template-columns: 1fr;
    }

    .start-step--hero.is-active {
        align-content: start;
    }

    .start-media-panel {
        justify-self: center;
        width: min(100%, 320px);
        max-height: 52vh;
    }

    .start-option-grid--two {
        grid-template-columns: 1fr;
    }

    .start-option-card {
        min-height: 118px;
    }

    .start-actions {
        display: grid;
        gap: 14px;
    }

    .start-actions .start-primary {
        width: 100%;
    }

    .start-offer-strip {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .start-body[data-start-mode="make-photo-dance"] .start-step--hero.is-active {
        align-content: start;
        gap: 18px;
    }

    .start-body[data-start-mode="make-photo-dance"] .start-step--hero .start-media-panel {
        justify-self: center;
        width: min(100%, 320px);
        height: auto;
        max-height: none;
    }
}

@media (max-width: 560px) {
    .start-progress {
        margin-top: 18px;
    }

    .start-step {
        padding-top: 18px;
    }

    .start-copy h1,
    .start-step-heading h1,
    .start-step--center h1,
    .start-paywall h1 {
        max-width: 100%;
        font-size: clamp(2.1rem, 9vw, 3rem);
    }

    .start-step--center h1 {
        font-size: clamp(2rem, 8vw, 2.75rem);
    }

    .start-primary,
    .start-secondary {
        width: 100%;
    }

    .start-copy .start-primary {
        margin-top: 4px;
    }

    .start-choice {
        min-height: 58px;
    }

    .start-demo-copy h1 {
        max-width: 100%;
        font-size: clamp(2.1rem, 9vw, 3rem);
    }

    .start-body[data-start-mode="make-photo-dance"] .start-copy h1 {
        max-width: 100%;
        font-size: clamp(2.15rem, 9vw, 2.9rem);
    }

    .start-body[data-start-mode="make-photo-dance"] .start-copy p:not(.eyebrow) {
        font-size: 0.98rem;
        line-height: 1.45;
    }
}

.topbar,
.section-heading,
.prompt-controls,
.template-copy,
.action-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-pill,
.menu-button,
.prompt-panel,
.generator-output,
.template-card,
.drawer-panel {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.status-pill {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid rgba(108, 244, 200, 0.25);
    border-radius: 999px;
    background: rgba(4, 12, 10, 0.68);
    font-weight: 700;
}

.status-pill-solid {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(23, 31, 51, 0.92);
}

.status-logo {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.menu-button {
    width: 48px;
    height: 48px;
    display: inline-grid;
    gap: 4px;
    place-content: center;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.menu-button span {
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.topbar-button {
    min-width: 0;
    height: 46px;
    padding: 0 18px;
    justify-content: center;
    white-space: nowrap;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: min(280px, 42vw);
    height: 48px;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 160ms ease, background-color 160ms ease;
}

.topbar-user:hover,
.topbar-user:focus-visible {
    border-color: rgba(157, 124, 255, 0.32);
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.topbar-user-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, rgba(157, 124, 255, 0.85), rgba(255, 118, 188, 0.72));
    font-size: 0.9rem;
    font-weight: 800;
}

.topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-user-copy {
    display: none;
    min-width: 0;
    line-height: 1.08;
}

.topbar-user-name,
.topbar-user-email {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-name {
    font-size: 0.88rem;
    font-weight: 800;
}

.topbar-user-email {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.topbar-app {
    display: grid;
    grid-template-columns: auto auto;
    gap: 12px;
    align-items: center;
    margin: -18px -16px 0;
    padding: 14px 16px 12px;
    background: linear-gradient(180deg, rgba(87, 81, 123, 0.42), rgba(40, 35, 69, 0.34));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.topbar-actions-app {
    justify-content: flex-end;
}

.topbar-nav {
    display: none;
}

.topbar-nav-link {
    padding: 8px 16px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 160ms ease, background-color 160ms ease;
}

.topbar-nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.topbar-nav-link.is-active {
    color: var(--text);
    background: rgba(157, 124, 255, 0.14);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--text);
    font-size: 1.28rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.search-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.search-shell input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.search-shell input::placeholder {
    color: rgba(245, 241, 234, 0.5);
}

.search-icon {
    color: rgba(245, 241, 234, 0.62);
    font-size: 1.2rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
}

.profile-chip-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.9rem;
}

.profile-chip-caret {
    font-size: 0.9rem;
    color: rgba(245, 241, 234, 0.7);
}

.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 30;
    visibility: hidden;
    pointer-events: none;
}

.mobile-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    transition: opacity 180ms ease;
}

.mobile-drawer.is-open .drawer-backdrop {
    opacity: 1;
}

.drawer-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    left: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background: rgba(13, 14, 18, 0.92);
    box-shadow: var(--shadow);
    transform: translateY(-12px) scale(0.98);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.mobile-drawer.is-open .drawer-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.bottom-nav {
    position: fixed;
    right: 10px;
    bottom: 4px;
    left: 10px;
    z-index: 20;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(9, 10, 14, 0.98);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.bottom-nav-link {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 5px 4px 4px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    line-height: 1.1;
}

.bottom-nav-link.is-active {
    color: var(--text);
    background: rgba(157, 124, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(157, 124, 255, 0.18);
}

.bottom-nav-link--create {
    color: #fff;
    transform: translateY(-8px);
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: linear-gradient(180deg, #a88cff, #7f5cff);
    box-shadow:
        0 14px 30px rgba(127, 92, 255, 0.38),
        0 0 0 5px rgba(9, 10, 14, 0.96);
}

.bottom-nav-link--create.is-active {
    background: linear-gradient(180deg, #b69cff, #8b6cff);
    box-shadow:
        0 16px 34px rgba(139, 108, 255, 0.46),
        0 0 0 5px rgba(9, 10, 14, 0.96),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.bottom-nav-link--create .bottom-nav-icon {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.bottom-nav-link--create .bottom-nav-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.4;
}

.bottom-nav-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
}

.bottom-nav-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.drawer-header,
.drawer-nav {
    display: grid;
}

.drawer-header {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}

.drawer-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 1.2rem;
}

.drawer-group,
.drawer-nav {
    margin-top: 18px;
}

.drawer-heading {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.drawer-nav {
    gap: 8px;
}

.drawer-link {
    display: block;
    padding: 14px 16px;
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
    background: transparent;
}

.drawer-link.is-active,
.drawer-link:hover,
.drawer-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 340px;
    margin-top: 18px;
    padding: 22px 16px 18px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(3, 3, 3, 0.02) 20%, rgba(3, 3, 3, 0.84) 100%),
        url("https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=1200&q=80") center/cover;
    box-shadow: var(--shadow);
}

.login-copy {
    display: grid;
    gap: 10px;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.login-stack {
    display: grid;
    gap: 18px;
}

.eyebrow,
.section-kicker,
.output-label {
    margin: 0;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
}

h1,
h2,
h3 {
    margin: 0;
}

h1 {
    margin-top: 0;
    max-width: none;
    font-family: inherit;
    font-size: var(--screen-h1-size);
    line-height: var(--screen-h1-line-height);
    letter-spacing: var(--screen-h1-letter-spacing);
    font-weight: var(--screen-h1-weight);
    text-transform: none;
    text-wrap: balance;
}

.login-intro {
    max-width: 28ch;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.hero-intro {
    max-width: 30ch;
    margin: 16px 0 0;
    color: rgba(245, 241, 234, 0.78);
    line-height: 1.6;
}

.prompt-panel {
    margin-top: 24px;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: 0 18px 40px rgba(8, 5, 22, 0.35);
}

.composer-shell {
    margin-top: 22px;
}

.composer-header h1 {
    max-width: 18ch;
    margin-top: 10px;
    font-size: clamp(1.75rem, 6.4vw, 2.75rem);
    line-height: 1.06;
    text-transform: none;
}

.composer-mode-subtitle {
    max-width: 52ch;
    margin: 10px 0 0;
    color: rgba(245, 241, 234, 0.68);
    font-size: 1rem;
    line-height: 1.45;
}

.composer-card {
    margin-top: 18px;
    padding: 18px;
    border-radius: 28px;
    background: rgba(31, 28, 35, 0.92);
    box-shadow: var(--shadow);
}

.composer-main {
    display: grid;
    gap: 14px;
}

.composer-textarea-wrap {
    display: grid;
    gap: 10px;
}

.composer-textarea {
    width: 100%;
    min-height: 184px;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.55;
}

.composer-textarea::placeholder {
    color: rgba(245, 241, 234, 0.42);
}

.composer-count {
    justify-self: end;
    color: rgba(245, 241, 234, 0.54);
    font-size: 0.92rem;
}

.composer-controls {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.composer-models-error[hidden] {
    display: none !important;
}

.composer-models-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.35;
    color: rgba(255, 230, 210, 0.95);
    background: rgba(255, 140, 60, 0.12);
    border: 1px solid rgba(255, 160, 90, 0.28);
}

.composer-models-retry {
    margin: 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.composer-models-retry:hover {
    background: rgba(255, 255, 255, 0.12);
}

.composer-model-trigger:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.composer-model-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.composer-model-row:has(.composer-estimate-row:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.composer-estimate-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 4px 0 0;
}

/* [hidden] alone is overridden by `display: flex` above — must re-hide explicitly */
.composer-estimate-row[hidden] {
    display: none !important;
}

.composer-estimate-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.composer-select-wrap,
.composer-settings {
    width: 100%;
}

.composer-model-trigger {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
}

.composer-select-wrap {
    position: relative;
    display: block;
}

.composer-model-trigger {
    width: 100%;
    min-height: 50px;
    padding: 0 44px 0 16px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.composer-model-trigger-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.composer-chevron {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.composer-select-caret {
    position: absolute;
    top: 50%;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: rgba(245, 241, 234, 0.78);
    pointer-events: none;
}

.composer-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #8f63ff 0%, #d94fc3 100%);
    color: #fff6ff;
    font: inherit;
    cursor: pointer;
}

.composer-send-icon {
    display: block;
    flex-shrink: 0;
    color: inherit;
    shape-rendering: geometricPrecision;
}

.composer-settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.composer-settings-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.composer-settings-copy small {
    color: var(--muted);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-credit-gem {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    transform: rotate(45deg);
    flex-shrink: 0;
    background: linear-gradient(145deg, #7ec8ff 0%, #4b9fff 55%, #2d7ae8 100%);
    box-shadow: 0 0 8px rgba(75, 159, 255, 0.45);
}

.composer-credit-amount {
    margin: 0;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #6ee7dc;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.composer-settings-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(245, 241, 234, 0.72);
    transition: transform 160ms ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.composer-settings-toggle[aria-expanded="true"] .composer-settings-arrow {
    transform: rotate(180deg);
}

.composer-inputs[hidden],
.composer-inputs-panel[hidden] {
    display: none;
}

.composer-inputs,
.composer-settings {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.composer-inputs-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.composer-inputs-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.composer-inputs-copy small,
.composer-input-meta,
.composer-inputs-note {
    color: var(--muted);
}

.composer-inputs-copy small {
    font-size: 0.92rem;
}

.composer-inputs-arrow {
    display: inline-flex;
    color: rgba(245, 241, 234, 0.72);
    transition: transform 160ms ease;
}

.composer-inputs-toggle[aria-expanded="true"] .composer-inputs-arrow {
    transform: rotate(180deg);
}

.composer-inputs-panel {
    padding: 0 16px 14px;
}

.composer-inputs-body {
    display: grid;
}

.composer-input-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-input-row:last-child {
    border-bottom: 0;
}

.composer-input-icon {
    color: #b064ff;
    font-size: 1.1rem;
}

.composer-input-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.composer-input-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.composer-input-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-input-label {
    font-weight: 650;
}

.composer-input-requirement {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.composer-input-requirement.is-required {
    border: 1px solid rgba(176, 100, 255, 0.64);
    background: rgba(176, 100, 255, 0.18);
    color: #f4eaff;
}

.composer-input-meta {
    font-size: 0.82rem;
    line-height: 1.25;
}

.composer-input-preview {
    width: 72px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.composer-input-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.composer-input-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(176, 100, 255, 0.48);
    border-radius: 10px;
    color: #f4eaff;
    font-weight: 700;
    cursor: pointer;
}

.composer-input-action[aria-disabled="true"] {
    opacity: 0.58;
    pointer-events: none;
}

.composer-input-remove {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
}

.composer-inputs-note {
    margin: 10px 2px 0;
    font-size: 0.84rem;
}

body.model-picker-open {
    overflow: hidden;
}

.model-picker-sheet[hidden] {
    display: none !important;
}

.model-picker-sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
}

.model-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.model-picker-panel {
    position: relative;
    max-height: min(78vh, 620px);
    border-radius: 24px 24px 0 0;
    background: rgba(14, 15, 19, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    padding-bottom: env(safe-area-inset-bottom, 0);
    display: flex;
    flex-direction: column;
    animation: model-picker-panel-in 220ms ease;
}

@keyframes model-picker-panel-in {
    from {
        transform: translateY(12px);
        opacity: 0.92;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.model-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.model-picker-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.model-picker-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: -8px -6px -8px 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(245, 241, 234, 0.85);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.model-picker-close:hover {
    background: rgba(255, 255, 255, 0.06);
}

.model-picker-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 20px;
}

.model-picker-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--text);
    cursor: pointer;
}

.model-picker-item:last-child {
    border-bottom: 0;
}

.model-picker-item:hover,
.model-picker-item:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.model-picker-item.is-selected {
    background: rgba(157, 124, 255, 0.08);
}

.model-picker-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-picker-item-title {
    font-weight: 650;
    font-size: 0.98rem;
    line-height: 1.25;
    color: var(--text);
}

.model-picker-item.is-selected .model-picker-item-title {
    color: #d4c4ff;
}

.model-picker-item-desc {
    font-size: 0.82rem;
    line-height: 1.4;
    color: rgba(166, 161, 180, 0.95);
}

.model-picker-tag {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
}

.model-picker-tag--hot {
    background: linear-gradient(135deg, #ff8a4c 0%, #e85d25 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(232, 93, 37, 0.35);
}

.model-picker-tag--popular {
    background: linear-gradient(135deg, #5eb0ff 0%, #3d7dff 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(61, 125, 255, 0.3);
}

.model-picker-tag--efficient {
    background: linear-gradient(135deg, #52d89a 0%, #2fb27a 100%);
    color: #07140f;
    box-shadow: 0 2px 10px rgba(47, 178, 122, 0.3);
}

.model-picker-tag--default {
    background: rgba(157, 124, 255, 0.22);
    color: #e8e2ff;
    border: 1px solid rgba(157, 124, 255, 0.35);
}

.model-picker-tag--api {
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
}

.create-toast[hidden] {
    display: none !important;
}

.create-toast {
    position: fixed;
    z-index: 45;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(24px + env(safe-area-inset-bottom, 0));
    width: min(430px, calc(100vw - 32px));
    pointer-events: none;
}

@media (max-width: 768px) {
    .create-toast {
        bottom: calc(88px + env(safe-area-inset-bottom, 0));
    }
}

.create-toast-inner {
    pointer-events: auto;
    padding: 14px 16px 16px;
    border-radius: 20px;
    background: rgba(16, 17, 22, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.create-toast--error .create-toast-inner {
    border-color: rgba(255, 130, 110, 0.35);
    background: rgba(26, 16, 18, 0.97);
}

.create-toast--loading .create-toast-inner {
    border-color: rgba(157, 124, 255, 0.28);
    background: rgba(18, 16, 28, 0.97);
}

.create-toast--loading .create-toast-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.create-toast--loading .create-toast-title::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(200, 175, 255, 0.95);
    border-radius: 50%;
    animation: create-toast-spin 0.65s linear infinite;
}

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

.create-toast-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}

.create-toast-body {
    margin: 0 0 8px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(245, 241, 234, 0.9);
    white-space: pre-line;
}

.create-toast--error .create-toast-body {
    color: rgba(255, 220, 214, 0.92);
}

.create-toast-credits {
    margin: 0 0 12px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(166, 161, 180, 0.95);
}

.create-toast-credits[hidden] {
    display: none !important;
}

.create-toast-primary[hidden] {
    display: none !important;
}

.create-toast-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.create-toast-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(143, 99, 255, 0.95) 0%, rgba(217, 79, 195, 0.92) 100%);
    color: #fff8ff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(120, 60, 200, 0.28);
}

.create-toast-primary:hover {
    filter: brightness(1.06);
}

.create-toast-dismiss {
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(245, 241, 234, 0.72);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.create-toast-dismiss:hover {
    color: rgba(245, 241, 234, 0.95);
    background: rgba(255, 255, 255, 0.06);
}

/* Desktop / tablet wide: centered modal; default above = mobile bottom sheet */
@media (min-width: 640px) {
    .model-picker-sheet {
        justify-content: center;
        align-items: center;
        padding: 24px;
    }

    .model-picker-panel {
        width: min(480px, calc(100vw - 48px));
        max-height: min(85vh, 680px);
        border-radius: 24px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow:
            0 24px 80px rgba(0, 0, 0, 0.55),
            0 0 0 1px rgba(255, 255, 255, 0.04);
        animation: model-picker-panel-in-desktop 220ms ease;
    }

    @keyframes model-picker-panel-in-desktop {
        from {
            transform: scale(0.96);
            opacity: 0;
        }

        to {
            transform: scale(1);
            opacity: 1;
        }
    }
}

.composer-settings-panel {
    padding: 0 16px 14px;
}

.composer-settings-panel[hidden] {
    display: none;
}

.composer-settings-body {
    display: grid;
    gap: 20px;
    padding: 0;
}

.composer-settings-empty {
    margin: 0;
    color: var(--muted);
}

.composer-setting-group {
    display: grid;
    gap: 12px;
}

.composer-setting-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}

.composer-setting-label {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.composer-help-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #8f63ff 0%, #d94fc3 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: 0;
}

.composer-help-popover {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(164, 110, 255, 0.28);
    border-radius: 14px;
    background: rgba(20, 18, 28, 0.96);
    color: rgba(245, 241, 234, 0.82);
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 12px 28px rgba(7, 6, 14, 0.42);
}

.composer-help-popover p {
    margin: 0;
}

.composer-option-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.composer-option-grid--compact {
    gap: 7px;
}

.composer-option-button {
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(18, 19, 24, 0.72);
    color: rgba(245, 241, 234, 0.9);
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.composer-option-grid--compact .composer-option-button {
    min-height: 40px;
    padding: 0 8px;
    font-size: 0.88rem;
}

.composer-option-button.is-active {
    border-color: rgba(164, 110, 255, 0.85);
    background: linear-gradient(135deg, #8f63ff 0%, #b564ff 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(143, 99, 255, 0.28);
}

.composer-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.composer-toggle-button {
    position: relative;
    width: 58px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background-color 160ms ease;
}

.composer-toggle-button::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    transition: transform 160ms ease;
}

.composer-toggle-button[aria-checked="true"] {
    background: linear-gradient(135deg, #8f63ff 0%, #d94fc3 100%);
}

.composer-toggle-button[aria-checked="true"]::after {
    transform: translateX(24px);
}

.composer-pricing-tip {
    padding: 16px 16px 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #f7cf4e;
    color: rgba(245, 241, 234, 0.86);
    line-height: 1.55;
}

.composer-pricing-tip p {
    margin: 0;
}

.login-panel {
    margin-top: 0;
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    background: rgba(14, 16, 21, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 18px 40px rgba(8, 5, 22, 0.35);
}

.login-panel-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.login-caption {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field span {
    font-size: 0.9rem;
    font-weight: 500;
}

.login-field input {
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    transition: border-color 160ms ease, background-color 160ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-field input:focus {
    border-color: rgba(108, 244, 200, 0.48);
    background: rgba(255, 255, 255, 0.07);
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-row a {
    color: var(--text);
    text-decoration: none;
}

.login-row a:visited {
    color: var(--text);
}

.remember-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.remember-toggle input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    accent-color: var(--accent-strong);
}

.login-remember {
    justify-self: start;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-submit {
    width: 100%;
    margin-top: 6px;
}

.login-oauth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 4px;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-oauth-divider::before,
.login-oauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-oauth-divider span {
    flex: 0 0 auto;
}

.login-google {
    display: block;
    width: 100%;
    margin-top: 12px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.login-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.prompt-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 14px;
}

.field-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.prompt-field input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.prompt-field input::placeholder {
    color: var(--muted);
}

.prompt-controls {
    gap: 12px;
}

.mode-switch {
    display: inline-flex;
    gap: 8px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.mode-button,
.icon-button,
.generate-button,
.tool-card,
.template-copy button {
    border: 0;
    color: var(--text);
    font: inherit;
}

.mode-button,
.icon-button,
.template-copy button {
    background: transparent;
}

.mode-button {
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--muted);
}

.mode-button.is-active {
    background: rgba(157, 124, 255, 0.28);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(157, 124, 255, 0.45);
}

.icon-button,
.generate-button,
.template-copy button {
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
}

.icon-button {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.08);
}

.generate-button {
    min-width: 114px;
    height: 46px;
    padding: 0 18px;
    background: linear-gradient(135deg, #8f63ff 0%, #d94fc3 100%);
    color: #fff6ff;
    font-weight: 700;
}

.section-heading {
    margin-top: 30px;
}

.quick-section {
    margin-top: 24px;
}

.home-hero {
    margin-top: 32px;
    text-align: center;
}

.home-hero .section-kicker {
    margin: 0 0 14px;
    color: rgba(245, 241, 234, 0.55);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.home-hero-title {
    margin: 0 auto;
    max-width: 18ch;
    font-size: var(--screen-h1-size);
    line-height: var(--screen-h1-line-height);
    letter-spacing: var(--screen-h1-letter-spacing);
    text-transform: none;
    text-wrap: balance;
    font-weight: var(--screen-h1-weight);
}

.home-hero-title .accent {
    background: linear-gradient(120deg, #d9b8ff 0%, #9fd7ff 50%, #ffb6e6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Launcher cards (home rich-media variant) ── */

.launcher-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.launcher-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(18, 20, 24, 0.6);
    color: #fff;
    text-decoration: none;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
    isolation: isolate;
}

.launcher-card:hover,
.launcher-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(157, 124, 255, 0.55);
    box-shadow: 0 24px 50px rgba(10, 6, 24, 0.55);
    outline: none;
}

.launcher-card-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.launcher-card-media > img,
.launcher-card-video,
.launcher-card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.launcher-card-poster {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.launcher-card-video {
    position: relative;
    z-index: 1;
    transition: transform 600ms ease;
}

.launcher-card:hover .launcher-card-video,
.launcher-card:hover .launcher-card-media > img {
    transform: scale(1.04);
}

.launcher-card-media > img {
    transition: transform 600ms ease;
}

.launcher-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

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

.launcher-card-ideas {
    display: grid;
    align-content: start;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 18px 14px;
    background:
        radial-gradient(circle at 22% 10%, rgba(181, 108, 255, 0.42), transparent 42%),
        radial-gradient(circle at 90% 18%, rgba(83, 174, 255, 0.24), transparent 38%),
        linear-gradient(160deg, rgba(26, 23, 41, 0.96), rgba(16, 19, 28, 0.96));
}

.launcher-card-ideas span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.launcher-card-ideas span:nth-child(even) {
    margin-left: 18px;
}

.launcher-card-label {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 36px 14px 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0.78) 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.005em;
}

.idea-section {
    margin-top: 34px;
}

.home-template-group {
    margin-top: 20px;
}

.home-template-group:first-of-type {
    margin-top: 0;
}

.home-template-group h3 {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.92rem;
    font-weight: 820;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-templates-grid {
    gap: 14px;
}

.home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.home-section-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    color: rgba(245, 241, 234, 0.96);
    font-size: 1.18rem;
    line-height: 1.15;
    letter-spacing: 0;
}

.home-section-icon {
    width: 22px;
    height: 22px;
    color: #b56cff;
    flex: 0 0 auto;
}

.home-section-icon svg,
.idea-card-icon svg,
.idea-card-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

.idea-strip {
    display: grid;
    grid-auto-columns: minmax(148px, 1fr);
    grid-auto-flow: column;
    gap: 12px;
    margin-inline: 0;
    margin-block: 0;
    padding: 0 0 4px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.idea-strip::-webkit-scrollbar {
    display: none;
}

.idea-strip li {
    min-width: 0;
}

.idea-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    min-height: 150px;
    padding: 14px 14px 48px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(circle at 24% 12%, rgba(157, 124, 255, 0.26), transparent 44%),
        linear-gradient(180deg, rgba(38, 34, 56, 0.9), rgba(25, 22, 35, 0.82));
    color: #fff;
    text-decoration: none;
    scroll-snap-align: start;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.idea-card:hover,
.idea-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(181, 108, 255, 0.58);
    outline: none;
}

.idea-card-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(181, 108, 255, 0.18);
    color: #c890ff;
}

.idea-card-label {
    align-self: end;
    max-width: 11ch;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: 0;
}

.idea-card-arrow {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(9, 8, 16, 0.48);
    color: rgba(255, 255, 255, 0.88);
}

.idea-card-arrow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.idea-card--blue {
    background:
        radial-gradient(circle at 24% 12%, rgba(83, 174, 255, 0.24), transparent 44%),
        linear-gradient(180deg, rgba(35, 40, 62, 0.9), rgba(23, 25, 39, 0.84));
}

.idea-card--blue .idea-card-icon {
    background: rgba(83, 174, 255, 0.16);
    color: #7ac7ff;
}

.idea-card--pink {
    background:
        radial-gradient(circle at 24% 12%, rgba(255, 105, 172, 0.24), transparent 44%),
        linear-gradient(180deg, rgba(50, 33, 54, 0.9), rgba(29, 22, 37, 0.84));
}

.idea-card--pink .idea-card-icon {
    background: rgba(255, 105, 172, 0.16);
    color: #ff8abc;
}

.idea-card--green {
    background:
        radial-gradient(circle at 24% 12%, rgba(99, 220, 150, 0.22), transparent 44%),
        linear-gradient(180deg, rgba(30, 47, 46, 0.9), rgba(21, 31, 34, 0.84));
}

.idea-card--green .idea-card-icon {
    background: rgba(99, 220, 150, 0.14);
    color: #7ae59d;
}

.idea-card--gold {
    background:
        radial-gradient(circle at 24% 12%, rgba(255, 190, 79, 0.24), transparent 44%),
        linear-gradient(180deg, rgba(54, 43, 31, 0.9), rgba(32, 27, 24, 0.84));
}

.idea-card--gold .idea-card-icon {
    background: rgba(255, 190, 79, 0.15);
    color: #ffc36a;
}

@media (prefers-reduced-motion: reduce) {
    .launcher-card-video {
        display: none;
    }
    .launcher-card-poster {
        opacity: 1;
    }
    .launcher-card,
    .launcher-card-video,
    .launcher-card-media > img,
    .idea-card {
        transition: none;
    }
}

.feature-banner {
    position: relative;
    min-height: 300px;
    padding: 26px 22px 44px;
    overflow: hidden;
    border: 1px solid rgba(199, 228, 225, 0.3);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(9, 20, 36, 0.16), rgba(6, 9, 19, 0.82)),
        url("https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=1200&q=80") center/cover;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.feature-banner::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(49, 77, 131, 0), rgba(49, 77, 131, 0.74));
}

.feature-copy {
    position: relative;
    z-index: 1;
}

.feature-copy h1 {
    max-width: 9ch;
    font-size: clamp(2.2rem, 8vw, 4rem);
    line-height: 0.92;
    text-transform: none;
}

.feature-progress {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 1;
    width: 120px;
    height: 10px;
    margin-left: -60px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
}

.feature-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.94);
}

.primary-grid {
    display: grid;
}

.primary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.primary-card {
    display: grid;
    gap: 12px;
    justify-items: center;
    padding: 22px 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    color: #f5fff8;
    text-decoration: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    background:
        radial-gradient(circle at 50% 34%, rgba(172, 196, 255, 0.34), rgba(172, 196, 255, 0.06) 40%, rgba(255, 255, 255, 0.02) 66%),
        linear-gradient(180deg, rgba(109, 113, 143, 0.5), rgba(74, 77, 102, 0.36));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.primary-card-icon {
    display: inline-grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: radial-gradient(circle, rgba(168, 191, 255, 0.48), rgba(168, 191, 255, 0.1) 64%, transparent 72%);
    color: rgba(245, 255, 248, 0.96);
    font-size: 1.8rem;
    text-shadow: 0 0 18px rgba(168, 191, 255, 0.34);
}

.home-tabs {
    gap: 10px;
    margin-top: 20px;
}

.home-tab {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.96rem;
}

.home-tab.is-active {
    background: rgba(255, 255, 255, 0.14);
    font-weight: 700;
}

.choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.choice-card {
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.choice-media {
    min-height: 170px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
}

.choice-card h3,
.choice-card p {
    padding: 0;
}

.choice-card h3 {
    font-size: 0.96rem;
}

.choice-card p {
    margin-top: 4px;
    font-size: 0.84rem;
}

.kling-topbar {
    margin-top: 2px;
}

.feature-stage {
    margin-top: 16px;
}

.feature-banner {
    position: relative;
    min-height: 210px;
    padding: 22px 20px 46px;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(9, 20, 36, 0.24), rgba(6, 9, 19, 0.84)),
        url("https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.feature-banner::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(49, 77, 131, 0), rgba(49, 77, 131, 0.9));
}

.feature-copy {
    position: relative;
    z-index: 1;
}

.feature-copy h1 {
    max-width: 10ch;
    font-size: clamp(2rem, 8vw, 3.8rem);
    line-height: 0.95;
    text-transform: none;
}

.feature-dots {
    position: absolute;
    right: 18px;
    bottom: 16px;
    z-index: 1;
    display: flex;
    gap: 6px;
}

.feature-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
}

.feature-dots .is-active {
    width: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
}

.primary-grid,
.secondary-row {
    display: grid;
}

.primary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}


.section-heading a {
    color: var(--text);
    text-decoration: none;
    opacity: 0.84;
}

.hero-actions,
.launch-grid,
.tool-strip,
.recent-list,
.choice-grid,
.inspiration-grid,
.create-options,
.profile-shell,
.library-shell,
.library-grid,
.profile-stats,
.profile-badges,
.profile-menu {
    display: grid;
}

.hero-actions {
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 12px;
    margin-top: 24px;
}

.launch-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(157, 124, 255, 0.2), transparent 34%),
        radial-gradient(circle at top left, rgba(217, 79, 195, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(22, 16, 36, 0.98), rgba(11, 9, 19, 0.98));
    box-shadow: var(--shadow);
}

.promo-banner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    min-height: 168px;
    padding: 18px;
    border: 1px solid rgba(157, 124, 255, 0.14);
    border-radius: 24px;
    background:
        linear-gradient(90deg, rgba(81, 22, 32, 0.88), rgba(56, 16, 44, 0.52)),
        url("https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.promo-banner h1 {
    max-width: 12ch;
    font-size: clamp(2rem, 8vw, 3.2rem);
}

.launch-title {
    margin: 18px 0 0;
    max-width: 12ch;
    color: #f5f1ea;
    font-family: inherit;
    font-size: clamp(2rem, 8vw, 3.3rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.launch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.launch-card,
.choice-card {
    display: grid;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.launch-card {
    position: relative;
    padding: 12px;
    border: 1px solid rgba(157, 124, 255, 0.16);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(157, 124, 255, 0.08));
}

.launch-media,
.choice-media {
    border-radius: 16px;
    background-position: center;
    background-size: cover;
}

.launch-media {
    min-height: 112px;
}

.launch-copy {
    padding-right: 28px;
}

.launch-copy h2 {
    font-size: 1.2rem;
}

.launch-copy p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.launch-arrow {
    position: absolute;
    right: 14px;
    bottom: 18px;
    color: rgba(245, 241, 234, 0.74);
    font-size: 1.15rem;
}

.explore-tools-button {
    display: inline-grid;
    place-items: center;
    width: 100%;
    min-height: 58px;
    margin-top: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #8f63ff 0%, #d94fc3 100%);
    color: #fff6ff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 18px 34px rgba(143, 99, 255, 0.28);
}

.tool-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.tool-shortcut {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 14px 8px;
    color: var(--text);
    text-decoration: none;
}

.tool-shortcut-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.15rem;
}

.home-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.home-tabs::-webkit-scrollbar {
    display: none;
}

.home-tab {
    display: inline-grid;
    place-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.home-tab.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.hero-link {
    text-decoration: none;
}

.ghost-button {
    display: inline-grid;
    place-items: center;
    height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.small-button {
    height: 40px;
    padding: 0 14px;
    font-size: 0.88rem;
}

.recent-list,
.choice-grid,
.inspiration-grid,
.create-options {
    gap: 14px;
    margin-top: 16px;
}

.recent-card,
.choice-card,
.inspiration-card,
.option-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: rgba(16, 14, 27, 0.8);
    box-shadow: var(--shadow);
}

.recent-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
}

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

.choice-card {
    overflow: hidden;
    padding: 0 0 18px;
}

.choice-media {
    min-height: 200px;
    border-radius: 22px 22px 0 0;
}

.choice-card h3,
.launch-copy h2 {
    margin: 0;
}

.choice-card h3,
.choice-card p {
    padding: 0 18px;
}

.recent-card h3,
.option-card h3,
.choice-card h3 {
    font-size: 1.1rem;
}

.recent-card p,
.choice-card p,
.inspiration-card p,
.option-card p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.inspiration-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inspiration-card {
    min-height: 132px;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(217, 79, 195, 0.16), transparent 38%),
        rgba(16, 14, 27, 0.8);
}

.inspiration-card p {
    margin-top: 0;
    color: var(--text);
    font-weight: 700;
}

.create-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
    padding: 20px;
}

.option-card-primary {
    background:
        linear-gradient(180deg, rgba(143, 99, 255, 0.18), rgba(16, 14, 27, 0.88)),
        rgba(16, 14, 27, 0.8);
}

.option-kicker {
    margin: 0;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
}

.profile-shell {
    gap: 18px;
    margin-top: 18px;
    padding-bottom: 24px;
}

.profile-card {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background: rgba(16, 14, 27, 0.82);
    box-shadow: var(--shadow);
}

.profile-card-spotlight {
    background:
        radial-gradient(circle at top right, rgba(217, 79, 195, 0.18), transparent 34%),
        rgba(16, 14, 27, 0.82);
}

.profile-header,
.profile-section-heading,
.profile-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.profile-header {
    align-items: flex-start;
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(143, 99, 255, 0.28), rgba(217, 79, 195, 0.22));
    color: #ffb36c;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 800;
}

.profile-avatar--image {
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.profile-identity {
    flex: 1;
    min-width: 0;
}

.profile-identity h1 {
    max-width: none;
    font-size: 1.7rem;
    line-height: 1;
    text-transform: none;
}

.profile-identity p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.profile-stat {
    display: grid;
    gap: 4px;
    padding: 18px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    text-decoration: none;
    text-align: center;
}

.profile-stat strong {
    font-size: 1.25rem;
}

.profile-stat span {
    color: var(--muted);
    font-size: 0.84rem;
}

.profile-stat-hot {
    box-shadow: inset 0 0 0 1px rgba(255, 151, 76, 0.18);
}

.profile-stat-cta {
    background: linear-gradient(180deg, rgba(255, 151, 76, 0.2), rgba(114, 78, 255, 0.1));
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.profile-stat-cta:hover {
    box-shadow: inset 0 0 0 1px rgba(255, 151, 76, 0.34), 0 12px 28px rgba(255, 122, 54, 0.16);
    transform: translateY(-1px);
}

.profile-stat-warm {
    background: linear-gradient(180deg, rgba(255, 151, 76, 0.14), rgba(255, 255, 255, 0.04));
}

.profile-code-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 22px 18px;
    border: 1px solid rgba(255, 151, 76, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(64, 37, 20, 0.78), rgba(38, 23, 15, 0.92));
}

.profile-code-card strong {
    color: #ff9c4b;
    font-size: 1.9rem;
    letter-spacing: 0.22em;
}

.profile-code-card span {
    color: rgba(245, 241, 234, 0.6);
    font-size: 0.84rem;
}

.profile-badges {
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 10px;
    margin-top: 14px;
}

.profile-badge {
    display: inline-grid;
    place-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-menu {
    gap: 0;
    padding-top: 6px;
    padding-bottom: 6px;
}

.profile-action {
    padding: 16px 0;
    color: var(--text);
    text-decoration: none;
}

.profile-action + .profile-action {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-action strong {
    display: block;
    font-size: 1rem;
}

.profile-action p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.profile-action > span {
    color: rgba(245, 241, 234, 0.4);
    font-size: 1.4rem;
}

.pricing-page {
    min-height: 100vh;
}

.pricing-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 112px;
}

.pricing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 28px;
    align-items: end;
}

.pricing-hero--solo {
    grid-template-columns: minmax(0, 1fr);
}

.pricing-heading {
    max-width: 880px;
}

.pricing-heading h1 {
    max-width: 760px;
    margin: 8px 0 12px;
    color: #fffaf2;
    font-size: var(--screen-h1-size-wide);
    line-height: var(--screen-h1-line-height);
    letter-spacing: var(--screen-h1-letter-spacing);
    font-weight: var(--screen-h1-weight);
    text-transform: none;
    text-wrap: balance;
}

.pricing-heading p:last-child {
    margin: 0;
    color: rgba(245, 241, 234, 0.72);
    font-size: 1rem;
    line-height: 1.65;
}

.pricing-account {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 58%),
        rgba(15, 14, 20, 0.74);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.2);
}

.pricing-account div {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.pricing-account span,
.pricing-plan-label {
    display: block;
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pricing-account strong {
    display: block;
    margin-top: 7px;
    overflow-wrap: anywhere;
    color: #fffaf2;
    font-size: 1.05rem;
}

.pricing-account-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    grid-column: 1 / -1;
    border: 1px solid rgba(245, 241, 234, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fffaf2;
    font-size: 0.92rem;
    font-weight: 750;
    text-decoration: none;
}

.pricing-account-link:hover {
    border-color: rgba(245, 241, 234, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.pricing-benefits {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: center;
    margin-top: 34px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background: rgba(16, 14, 27, 0.82);
    box-shadow: var(--shadow);
}

.pricing-benefits h2 {
    margin: 6px 0 0;
    color: #fffaf2;
    font-size: 1.55rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.pricing-plan {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    gap: 22px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
        rgba(12, 10, 21, 0.68);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.pricing-plan-featured {
    border-color: rgba(184, 111, 255, 0.42);
    background:
        linear-gradient(135deg, rgba(184, 111, 255, 0.18), transparent 44%),
        linear-gradient(180deg, rgba(159, 215, 255, 0.09), transparent 58%),
        rgba(14, 11, 24, 0.95);
}

.pricing-plan-muted {
    border-color: rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 48%),
        rgba(12, 12, 14, 0.76);
}

.pricing-plan-kicker {
    display: flex;
    min-height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pricing-plan-head h2 {
    margin: 8px 0 14px;
    color: #fffaf2;
    font-size: 1.55rem;
    letter-spacing: 0;
}

.pricing-price {
    margin: 0;
    color: var(--accent-strong);
    font-size: clamp(1.3rem, 2vw, 1.85rem);
    font-weight: 800;
    line-height: 1.05;
}

.pricing-description {
    min-height: 66px;
    margin: 12px 0 0;
    color: rgba(245, 241, 234, 0.62);
    font-size: 0.9rem;
    line-height: 1.45;
}

.pricing-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(184, 111, 255, 0.16);
    color: #c99cff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.pricing-features {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    color: rgba(245, 241, 234, 0.82);
    font-size: 0.9rem;
    line-height: 1.5;
    list-style: none;
}

.pricing-features li {
    position: relative;
    padding-left: 24px;
}

.pricing-features li::before {
    content: "";
    position: absolute;
    top: 0.58em;
    left: 0;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(157, 124, 255, 0.45);
}

.pricing-primary,
.pricing-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 100%;
    margin-top: auto;
    padding: 0 18px;
    border-radius: 13px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.pricing-primary {
    border: 0;
    background: linear-gradient(90deg, #d44edc, #7f5cff);
    color: #fff;
}

.pricing-primary:hover {
    filter: brightness(1.04);
}

.pricing-primary:disabled {
    cursor: wait;
    opacity: 0.7;
}

.pricing-secondary {
    border: 1px solid rgba(245, 241, 234, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fffaf2;
}

.pricing-disabled,
.pricing-disabled:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.pricing-status {
    min-height: 1.25rem;
    margin: -14px 0 0;
    color: rgba(245, 241, 234, 0.68);
    font-size: 0.84rem;
    line-height: 1.45;
}

.billing-page {
    min-height: 100vh;
}

.billing-manage-shell {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 18px 0 96px;
}

.billing-manage-heading {
    max-width: none;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background: rgba(16, 14, 27, 0.82);
    box-shadow: var(--shadow);
}

.billing-manage-heading h1 {
    max-width: none;
    margin: 8px 0 12px;
    color: #fffaf2;
    font-size: clamp(1.85rem, 3vw, 2.25rem);
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
}

.billing-manage-heading p:last-child {
    margin: 0;
    color: rgba(245, 241, 234, 0.72);
    font-size: 1rem;
    line-height: 1.65;
}

.billing-overview-grid,
.billing-manage-grid,
.billing-plan-list,
.billing-action-list,
.billing-account-list {
    display: grid;
}

.billing-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.billing-overview-card,
.billing-panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background: rgba(16, 14, 27, 0.82);
    box-shadow: var(--shadow);
}

.billing-overview-card {
    min-width: 0;
    padding: 18px 14px;
    text-align: center;
}

.billing-overview-card--primary {
    border-color: rgba(255, 151, 76, 0.18);
    background: linear-gradient(180deg, rgba(255, 151, 76, 0.14), rgba(255, 255, 255, 0.04));
}

.billing-overview-card span,
.billing-account-list dt {
    display: block;
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.billing-overview-card strong {
    display: block;
    margin-top: 7px;
    overflow-wrap: anywhere;
    color: #fffaf2;
    font-size: 1.25rem;
    line-height: 1.15;
}

.billing-overview-card p {
    margin: 7px 0 0;
    color: rgba(245, 241, 234, 0.66);
    font-size: 0.84rem;
    line-height: 1.4;
}

.billing-manage-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.billing-panel {
    padding: 18px;
}

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

.billing-panel-head h2 {
    margin: 6px 0 0;
    color: #fffaf2;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.billing-plan-list,
.billing-action-list {
    gap: 12px;
}

.billing-plan-row,
.billing-action-row {
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.billing-plan-row + .billing-plan-row,
.billing-action-row + .billing-action-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.billing-plan-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 140px);
    gap: 12px;
    align-items: center;
    padding: 16px 0;
}

.billing-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    color: #fffaf2;
    text-decoration: none;
}

.billing-action-row:hover {
    color: #fff;
}

.billing-plan-row strong,
.billing-action-row strong {
    display: block;
    color: #fffaf2;
    font-size: 1rem;
}

.billing-plan-row p,
.billing-action-row p {
    margin: 6px 0 0;
    color: rgba(245, 241, 234, 0.64);
    font-size: 0.9rem;
    line-height: 1.45;
}

.billing-plan-button {
    min-height: 42px;
    margin-top: 0;
    border-radius: 8px;
}

.billing-plan-row .pricing-status {
    grid-column: 1 / -1;
    margin: 0;
}

.billing-panel--account {
    position: static;
}

.billing-account-list {
    gap: 12px;
    margin: 18px 0 0;
}

.billing-account-list div {
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.billing-account-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.billing-account-list dd {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
    color: #fffaf2;
    font-size: 0.98rem;
    font-weight: 750;
}

.billing-secondary-action {
    margin-top: 22px;
}

.billing-result-shell {
    display: grid;
    min-height: calc(100vh - 96px);
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 112px;
    place-items: center;
}

.billing-result-card {
    width: 100%;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 50%),
        rgba(12, 12, 14, 0.92);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.billing-result-card--success {
    border-color: rgba(72, 211, 178, 0.28);
    background:
        linear-gradient(135deg, rgba(72, 211, 178, 0.16), transparent 48%),
        rgba(12, 12, 14, 0.94);
}

.billing-result-card--pending {
    border-color: rgba(246, 210, 124, 0.3);
    background:
        linear-gradient(135deg, rgba(246, 210, 124, 0.14), transparent 48%),
        rgba(12, 12, 14, 0.94);
}

.billing-result-card--cancel {
    border-color: rgba(255, 255, 255, 0.12);
}

.billing-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f6d27c;
    font-size: 1.7rem;
    font-weight: 850;
    line-height: 1;
}

.billing-result-card--success .billing-result-icon {
    color: #48d3b2;
}

.billing-result-card h1 {
    max-width: 12ch;
    margin: 8px 0 14px;
    color: #fffaf2;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.billing-result-card p:not(.eyebrow) {
    max-width: 58ch;
    margin: 0;
    color: rgba(245, 241, 234, 0.7);
    font-size: 1rem;
    line-height: 1.65;
}

.billing-result-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0 0;
}

.billing-result-summary div {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.billing-result-summary dt {
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.billing-result-summary dd {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    color: #fffaf2;
    font-size: 1rem;
    font-weight: 800;
}

.billing-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.logout-button {
    display: inline-grid;
    place-items: center;
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid rgba(255, 151, 76, 0.22);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(74, 32, 24, 0.92), rgba(48, 20, 17, 0.96));
    color: #ffb27a;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow);
}

html.dramalize-nav-pending::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9998;
    background: linear-gradient(
        90deg,
        rgba(108, 244, 200, 0.1),
        rgba(143, 99, 255, 0.95),
        rgba(217, 79, 195, 0.95),
        rgba(108, 244, 200, 0.1)
    );
    background-size: 200% 100%;
    animation: dramalize-nav-bar 1.1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dramalize-nav-bar {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
}

.page-loading-overlay[hidden] {
    display: none !important;
}

.page-loading-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-loading-center {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 28px 32px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(14, 16, 21, 0.92);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(108, 244, 200, 0.85);
    animation: dramalize-spin 0.75s linear infinite;
}

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

.page-loading-label {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(245, 241, 234, 0.88);
    text-align: center;
    max-width: 16rem;
}

@media (prefers-reduced-motion: reduce) {
    html.dramalize-nav-pending::before {
        animation: none;
        background-position: 0 0;
    }

    .page-loading-spinner {
        animation: none;
        border-color: rgba(108, 244, 200, 0.45);
    }
}

.library-shell {
    gap: 18px;
    margin-top: 18px;
    padding-bottom: 24px;
}

.library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.library-header h1 {
    margin: 6px 0 0;
    font-size: 1.65rem;
    line-height: 1.1;
}

.library-header-cta {
    flex-shrink: 0;
    margin-top: 4px;
}

.library-empty-blank {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 8px 0 16px;
}

.library-empty {
    margin: 0;
    padding: 24px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(16, 14, 27, 0.72);
    color: var(--muted);
    text-align: center;
}

.library-empty--plain {
    width: 100%;
    max-width: 420px;
}

.library-empty-cta {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.library-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 16px;
}

.library-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background: rgba(16, 14, 27, 0.82);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.library-card[data-video-url][data-status="completed"] {
    cursor: pointer;
}

.library-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.35);
}

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

.library-card-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.2);
}

.library-status {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(8, 6, 14, 0.82);
    backdrop-filter: blur(8px);
    color: rgba(245, 241, 234, 0.92);
}

.library-status--completed {
    color: rgba(108, 244, 200, 0.95);
}

.library-status--in_progress {
    color: rgba(255, 200, 120, 0.95);
}

.library-status--failed {
    color: rgba(255, 120, 120, 0.95);
}

.library-card-body {
    padding: 14px 16px 16px;
    display: grid;
    gap: 8px;
}

.library-card-model {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.library-card-snippet {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-card-date {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(245, 241, 234, 0.45);
}

.library-card-link {
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-strong);
    text-decoration: none;
    cursor: pointer;
}

.library-card-link:hover {
    text-decoration: underline;
}

body.library-video-open {
    overflow: hidden;
}

.library-video-modal[hidden] {
    display: none !important;
}

.library-video-modal {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.library-video-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.library-video-panel {
    position: relative;
    width: 100%;
    max-height: min(88vh, 760px);
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 0;
    background: rgba(14, 15, 19, 0.98);
    box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.55);
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.library-video-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.library-video-heading {
    min-width: 0;
}

.library-video-meta,
.library-video-prompt {
    margin: 0;
    color: var(--muted);
}

.library-video-meta {
    font-size: 0.78rem;
}

.library-video-header h2 {
    margin: 4px 0 0;
    font-size: 1.05rem;
    line-height: 1.25;
}

.library-video-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: -8px -6px 0 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(245, 241, 234, 0.88);
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.library-video-close:hover {
    background: rgba(255, 255, 255, 0.06);
}

.library-video-frame {
    overflow: hidden;
    border-radius: 18px;
    background: #000;
    aspect-ratio: 16 / 9;
}

.library-video-frame video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.library-video-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.library-video-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.library-video-action-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.library-video-action:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.library-video-prompt {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.86rem;
    line-height: 1.45;
}

.library-video-prompt.is-empty {
    color: rgba(245, 241, 234, 0.45);
}

.library-footer-meta {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.library-footer {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

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

.library-pagination-label {
    font-size: 0.84rem;
    color: rgba(245, 241, 234, 0.62);
    text-align: center;
    padding: 0 4px;
}

@media (min-width: 640px) {
    .library-video-modal {
        align-items: center;
        padding: 24px;
    }

    .library-video-panel {
        width: min(860px, calc(100vw - 48px));
        border-radius: 24px;
        border: 1px solid rgba(255, 255, 255, 0.11);
        padding: 18px;
        box-shadow:
            0 24px 90px rgba(0, 0, 0, 0.58),
            0 0 0 1px rgba(255, 255, 255, 0.04);
    }

    .library-video-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.75fr);
    }
}

.ghost-button.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.template-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    gap: 14px;
    overflow-x: auto;
    margin-top: 16px;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.template-strip::-webkit-scrollbar {
    display: none;
}

.template-card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border-radius: 26px;
    background-color: var(--card);
    background-position: center;
    background-size: cover;
    box-shadow: var(--shadow);
}

.template-tag {
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.78rem;
}

.template-copy h3 {
    max-width: 10ch;
    font-size: 1.35rem;
}

.template-copy button {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.1rem;
}

@media (max-width: 1180px) and (min-width: 769px) {
    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 769px) {

    /* ── Shell ── */

    .app-shell {
        width: min(1440px, calc(100vw - 64px));
        padding: 28px 48px 56px;
    }

    /* ── Header / nav ── */

    .topbar-app {
        position: relative;
        width: 100vw;
        left: 50%;
        transform: translateX(-50%);
        margin: -28px 0 0;
        padding: 16px 48px;
        grid-template-columns: auto 1fr auto;
    }

    .topbar-nav {
        display: flex;
        align-items: center;
        gap: 6px;
        justify-self: center;
    }

    .topbar-nav-link {
        padding: 10px 22px;
        font-size: 1rem;
    }

    .topbar-user-copy {
        display: block;
    }

    .menu-button {
        display: none;
    }

    /* ── Feature banner (home) ── */

    .feature-banner {
        min-height: 360px;
        padding: 36px 32px 52px;
        border-radius: 28px;
    }

    .feature-copy h1 {
        max-width: 14ch;
        font-size: clamp(3rem, 5vw, 4.4rem);
    }

    .hero-intro {
        max-width: 48ch;
    }

    /* ── Primary grid (home) ── */

    .primary-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
        gap: 16px;
    }

    .primary-card {
        padding: 28px 16px 22px;
        border-radius: 26px;
    }

    .primary-card-icon {
        width: 72px;
        height: 72px;
        border-radius: 20px;
        font-size: 2rem;
    }

    /* ── Home tabs ── */

    .home-tabs {
        gap: 10px;
        margin-top: 20px;
    }

    .home-tab {
        min-height: 44px;
        padding: 0 20px;
        font-size: 1rem;
    }

    /* ── Choice grid (home recommended) ── */

    .choice-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }

    .choice-media {
        min-height: 220px;
    }

    .choice-card h3 {
        font-size: 1.05rem;
    }

    /* ── Section headings ── */

    .section-heading {
        margin-top: 36px;
    }

    .section-heading h2 {
        font-size: 2rem;
    }

    /* ── Composer (create page) ── */

    .composer-shell {
        max-width: 1180px;
        margin-inline: auto;
    }

    .composer-header {
        max-width: 1180px;
        margin-inline: auto;
    }

    .composer-header h1 {
        max-width: 32ch;
        font-size: clamp(2rem, 4vw, 2.8rem);
    }

    .composer-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
        gap: 20px;
        align-items: start;
        padding: 24px;
        border-radius: 30px;
    }

    .composer-main {
        min-height: min(560px, calc(100vh - 260px));
        grid-template-rows: minmax(340px, 1fr) auto auto;
    }

    .composer-textarea-wrap {
        min-height: 340px;
        grid-template-rows: minmax(0, 1fr) auto;
        padding: 2px 2px 0;
    }

    .composer-textarea {
        min-height: 0;
        font-size: 1.05rem;
    }

    .composer-controls {
        position: sticky;
        top: 92px;
        max-height: calc(100vh - 116px);
        margin-top: 0;
        overflow-y: auto;
        padding-right: 2px;
    }

    .composer-inputs-toggle,
    .composer-settings-toggle {
        padding: 16px 18px;
    }

    .composer-inputs-panel,
    .composer-settings-panel {
        padding-right: 18px;
        padding-left: 18px;
    }

    /* ── Library grid ── */

    .library-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .library-header h1 {
        font-size: 2rem;
        max-width: none;
        text-transform: none;
        line-height: 1.1;
    }

    /* ── Hero ── */

    .hero {
        min-height: 460px;
        padding: 32px 28px 24px;
        border-radius: 34px;
    }

    .hero h1 {
        max-width: 6.5ch;
        font-size: clamp(4.2rem, 8vw, 6.5rem);
    }

    /* ── Prompt panel ── */

    .prompt-panel {
        width: min(100%, 640px);
        margin-top: 32px;
        padding: 18px;
        border-radius: 28px;
    }

    .prompt-field {
        padding: 14px 14px 18px;
    }

    .prompt-field input {
        font-size: 1.06rem;
    }

    .mode-button {
        padding: 12px 22px;
    }

    .icon-button,
    .generate-button {
        height: 52px;
    }

    .generate-button {
        min-width: 132px;
    }

    /* ── Misc content grids ── */

    .recent-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tool-strip {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .recent-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .small-button {
        min-width: 100px;
    }

    /* ── Profile ── */

    .profile-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 560px;
        margin-inline: auto;
    }

    .profile-shell .logout-button {
        width: 100%;
    }

    .profile-identity h1 {
        font-size: 2rem;
    }

    /* ── Templates ── */

    .template-strip {
        grid-auto-columns: minmax(280px, 1fr);
        grid-auto-flow: column;
        gap: 18px;
    }

    .template-card {
        min-height: 320px;
        padding: 22px;
        border-radius: 30px;
    }

    .template-copy h3 {
        max-width: 12ch;
        font-size: 1.7rem;
    }

    /* ── Home (simplified launcher) ──
       Home is a lightweight entry point; other pages keep their own wide layouts.
       We vertically center the content so it doesn't float in the top of the viewport. */

    .app-shell--home {
        width: min(100%, 760px);
        padding: 24px 20px 48px;
        display: flex;
        flex-direction: column;
    }

    .app-shell--home .home-hero {
        margin-top: 40px;
    }

    .app-shell--home .home-hero-title {
        max-width: 20ch;
        font-size: var(--screen-h1-size-wide);
    }

    .app-shell--home .launcher-grid {
        grid-template-columns: repeat(3, minmax(180px, 220px));
        justify-content: center;
        gap: 16px;
    }

    .app-shell--home .launcher-card {
        border-radius: 24px;
    }

    .app-shell--home .launcher-card-label {
        padding: 44px 16px 18px;
        font-size: 1.05rem;
    }

    .app-shell--home .home-templates-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .app-shell {
        padding: 18px 18px 96px;
    }

    .create-shell {
        padding-bottom: 104px;
    }

    .topbar-button {
        height: 44px;
        padding: 0 16px;
    }

    .topbar-app {
        grid-template-columns: 1fr auto;
        margin: -18px -18px 0;
        padding: 18px;
        background: rgba(20, 16, 38, 0.64);
    }

    /* search + profile-chip removed from header */

    .brand-lockup {
        gap: 12px;
        font-size: 1.36rem;
    }

    .status-logo {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .menu-button {
        width: 54px;
        height: 54px;
        border-radius: 18px;
    }

    .bottom-nav {
        display: grid;
        right: 12px;
        bottom: 8px;
        left: 12px;
        padding: 8px;
        border-radius: 24px;
    }

    .bottom-nav-link {
        gap: 4px;
        padding: 8px 3px 7px;
        font-size: 0.72rem;
    }

    .bottom-nav-icon {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 0.95rem;
    }

    .bottom-nav-link--create {
        transform: translateY(-10px);
    }

    .bottom-nav-link--create .bottom-nav-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .bottom-nav-icon svg {
        width: 18px;
        height: 18px;
    }

    .drawer-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 16px;
        border-radius: 24px;
    }

    .login-clean {
        padding: 26px 16px 38px;
    }

    .login-copy {
        gap: 8px;
        padding: 0 14px;
    }

    .login-intro {
        max-width: 22ch;
        line-height: 1.5;
    }

    .login-panel {
        margin: 0 14px;
        padding: 16px;
        border-radius: 24px;
    }

    .prompt-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .action-group {
        width: 100%;
    }

    .hero-actions,
    .launch-grid,
    .tool-strip,
    .inspiration-grid,
    .create-options,
    .profile-badges,
    .pricing-grid,
    .billing-overview-grid,
    .billing-manage-grid,
    .billing-plan-row {
        grid-template-columns: 1fr;
    }

    .pricing-hero,
    .pricing-account,
    .pricing-benefits {
        grid-template-columns: 1fr;
    }

    .pricing-shell {
        width: 100%;
        padding-top: 24px;
    }

    .billing-manage-shell {
        width: 100%;
        padding: 24px 0 92px;
    }

    .pricing-heading h1 {
        max-width: none;
        font-size: var(--screen-h1-size);
        line-height: var(--screen-h1-line-height);
    }

    .billing-manage-heading h1 {
        max-width: 14ch;
        font-size: clamp(2rem, 10vw, 2.85rem);
        line-height: 1.04;
    }

    .pricing-account {
        margin-top: 22px;
    }

    .pricing-plan {
        min-height: auto;
        padding: 20px;
    }

    .pricing-benefits {
        padding: 18px;
    }

    .pricing-description {
        min-height: 0;
    }

    .billing-panel {
        padding: 20px;
    }

    .billing-panel--account {
        position: static;
    }

    .billing-plan-button {
        width: 100%;
    }

    .billing-result-shell {
        min-height: auto;
        width: 100%;
        padding: 32px 0 92px;
    }

    .billing-result-card {
        padding: 24px;
    }

    .billing-result-summary,
    .billing-result-actions {
        grid-template-columns: 1fr;
    }

    .billing-result-card h1 {
        max-width: 100%;
    }

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

    .promo-banner {
        min-height: 196px;
        align-items: flex-start;
        flex-direction: column;
    }

    .feature-banner {
        min-height: 276px;
    }

    .composer-shell {
        margin-top: 22px;
    }

    .composer-header {
        display: grid;
        gap: 10px;
    }

    .composer-header .eyebrow {
        font-size: 0.78rem;
    }

    .composer-header h1 {
        max-width: 16ch;
        margin-top: 0;
        font-size: clamp(1.7rem, 8.4vw, 2.1rem);
        line-height: 1.06;
    }

    .composer-card {
        margin-top: 20px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .composer-textarea-wrap {
        min-height: 180px;
        padding: 16px 16px 14px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 22px;
        background:
            radial-gradient(circle at 18% 0%, rgba(157, 124, 255, 0.12), transparent 40%),
            rgba(29, 29, 36, 0.78);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .composer-textarea {
        min-height: 118px;
        font-size: 1.04rem;
        line-height: 1.5;
    }

    .composer-count {
        font-size: 0.9rem;
    }

    .composer-controls {
        margin-top: 14px;
        gap: 12px;
    }

    .composer-model-row {
        align-items: center;
        gap: 10px;
    }

    .composer-model-trigger {
        min-height: 46px;
        padding-left: 14px;
        padding-right: 38px;
        border-color: rgba(255, 255, 255, 0.15);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.07);
        font-size: 0.94rem;
    }

    .composer-estimate-row {
        margin: 0;
        justify-content: center;
    }

    .composer-estimate-pill {
        min-height: 40px;
        padding: 0 11px;
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.07);
        font-size: 0.86rem;
    }

    .composer-credit-amount {
        font-size: 0.86rem;
        color: #6ef0e6;
    }

    .composer-chevron {
        width: 18px;
        height: 18px;
    }

    .composer-send {
        width: 54px;
        height: 54px;
        box-shadow: 0 14px 30px rgba(155, 84, 255, 0.32);
    }

    .composer-send-icon {
        width: 23px;
        height: 23px;
    }

    .composer-inputs,
    .composer-settings {
        border-color: rgba(255, 255, 255, 0.13);
        border-radius: 20px;
        background:
            radial-gradient(circle at 18% 0%, rgba(157, 124, 255, 0.1), transparent 42%),
            rgba(31, 31, 39, 0.78);
    }

    .composer-inputs-toggle,
    .composer-settings-toggle {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 16px;
    }

    .composer-settings-toggle::before {
        content: "⚙";
        display: inline-grid;
        place-items: center;
        width: 30px;
        height: 30px;
        color: #a76cff;
        font-size: 1.15rem;
    }

    .composer-inputs-toggle::before {
        content: "⌘";
        display: inline-grid;
        place-items: center;
        width: 30px;
        height: 30px;
        color: #a76cff;
        font-size: 1.15rem;
    }

    .composer-inputs-copy {
        gap: 2px;
    }

    .composer-inputs-copy strong {
        font-size: 1.05rem;
    }

    .composer-inputs-copy small {
        font-size: 0.86rem;
    }

    .composer-inputs-panel,
    .composer-settings-panel {
        padding: 0 14px 14px;
    }

    .composer-input-row {
        grid-template-columns: auto minmax(0, 1fr) auto auto auto;
        min-height: 60px;
        border-color: rgba(255, 255, 255, 0.08);
        background: transparent;
    }

    .composer-input-preview {
        width: 78px;
        height: 42px;
    }

    .composer-input-action {
        min-height: 34px;
        padding: 0 12px;
        border-radius: 10px;
        font-size: 0.88rem;
    }

    .composer-input-remove {
        width: 28px;
        height: 28px;
    }

    .composer-settings-copy {
        gap: 2px;
    }

    .composer-settings-copy strong {
        font-size: 1.05rem;
    }

    .composer-settings-copy small {
        font-size: 0.86rem;
    }

    .composer-settings-body {
        gap: 13px;
        padding: 0;
    }

    .composer-setting-group {
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
    }

    .composer-setting-header {
        gap: 8px;
    }

    .composer-setting-label {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .composer-help-chip {
        width: 20px;
        height: 20px;
        font-size: 0.72rem;
    }

    .composer-help-popover {
        grid-column: 1 / -1;
        width: auto;
        padding: 10px 12px;
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .composer-option-button {
        min-height: 34px;
        padding: 0 8px;
        border-radius: 8px;
        text-align: center;
        font-size: 0.9rem;
    }

    .composer-option-grid {
        gap: 0;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.13);
        border-radius: 10px;
        background: rgba(10, 11, 16, 0.38);
    }

    .composer-option-grid {
        grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
    }

    .composer-option-grid .composer-option-button {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .composer-option-grid .composer-option-button + .composer-option-button {
        border-left: 1px solid rgba(255, 255, 255, 0.11);
    }

    .composer-option-grid .composer-option-button.is-active {
        background: linear-gradient(135deg, #8f63ff 0%, #b564ff 100%);
        box-shadow: inset 0 0 0 1px rgba(214, 190, 255, 0.24);
    }

    .composer-option-grid--compact {
        grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
        overflow: hidden;
    }

    .composer-toggle-row {
        display: contents;
    }

    .composer-toggle-button {
        justify-self: end;
        width: 52px;
        height: 30px;
    }

    .composer-toggle-button::after {
        width: 24px;
        height: 24px;
    }

    .composer-toggle-button[aria-checked="true"]::after {
        transform: translateX(22px);
    }

    .composer-pricing-tip {
        padding: 12px 14px;
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-left: 0;
        border-radius: 14px;
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .primary-grid {
        gap: 10px;
    }

    .primary-card {
        padding: 18px 8px 16px;
        font-size: 0.88rem;
    }

    .secondary-link {
        font-size: 0.72rem;
    }

    .choice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .choice-media {
        min-height: 120px;
        border-radius: 16px;
    }

    .recent-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .icon-button,
    .generate-button {
        flex: 1;
    }

    .login-panel-header,
    .login-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 769px) {
    body .app-shell--home {
        width: min(1440px, max(1040px, 70vw), calc(100vw - 64px));
    }

    body .app-shell--home .home-hero,
    body .app-shell--home .launcher-grid {
        width: min(760px, 100%);
        align-self: center;
    }

    body .app-shell--home .home-template-section {
        width: 100%;
        align-self: center;
    }

    body .app-shell--home .home-templates-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
        gap: 18px;
    }

    body .app-shell--home .templates-card {
        max-width: 280px;
    }

    body .app-shell.templates-shell,
    body .app-shell.template-detail-shell {
        width: min(1440px, max(1040px, 70vw), calc(100vw - 64px));
    }

    body .template-detail-shell {
        padding-bottom: 48px;
    }

    body .template-detail-shell .template-detail-panel {
        width: min(1180px, 100%);
        margin: 24px auto 0;
        padding: 28px;
        border-radius: 30px;
    }

    body .template-detail-shell .template-detail {
        grid-template-columns: minmax(420px, 560px) minmax(360px, 520px);
        grid-template-rows: auto auto 1fr;
        gap: 24px 42px;
        max-width: none;
        align-items: start;
        justify-content: center;
    }

    body .template-detail-shell .template-detail-media {
        grid-row: 1 / span 3;
        aspect-ratio: 16 / 10;
        width: 100%;
        min-height: 0;
        max-height: none;
        border-radius: 24px;
    }

    body .template-detail-shell .template-detail-media h1 {
        max-width: 12ch;
        font-size: clamp(2.45rem, 3.2vw, 4.1rem);
    }

    body .template-detail-shell .template-detail-section {
        min-width: 0;
    }

    body .template-detail-shell .template-detail-section h2 {
        font-size: 1.45rem;
    }

    body .template-detail-shell .template-detail-section p,
    body .template-detail-shell .template-prompt-box {
        font-size: 1rem;
    }

    body .template-detail-shell .template-prompt-box {
        max-height: 260px;
        overflow: auto;
    }

    body .template-detail-action {
        position: static;
        display: flex;
        justify-content: center;
        width: auto;
        margin: -4px 0 0;
        padding: 0 0 0 602px;
        border-top: 0;
        background: transparent;
        backdrop-filter: none;
    }

    body .template-detail-action .template-use-button {
        width: min(420px, 100%);
        min-height: 54px;
        border-radius: 16px;
        font-size: 1rem;
    }
}

body .templates-shell .templates-hero {
    width: min(860px, 100%);
    max-width: none;
}

body .templates-shell .templates-hero h1 {
    max-width: none;
    text-transform: none;
    font-size: clamp(2rem, 3vw, 3.1rem);
    line-height: 1.05;
}

/* ── Home dashboard MVP ── */

.home-dashboard-hero {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

.home-dashboard-hero p {
    margin: 0;
    color: rgba(245, 241, 234, 0.68);
    font-size: 0.98rem;
    line-height: 1.45;
}

.home-dashboard-top {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

.home-dashboard-panel {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
        rgba(12, 10, 21, 0.62);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.home-workflows-panel {
    padding: 16px;
}

.home-dashboard-heading,
.home-dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-dashboard-heading h2,
.home-dashboard-section-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    color: rgba(245, 241, 234, 0.96);
    font-size: 1rem;
    line-height: 1.15;
    letter-spacing: 0;
}

.home-dashboard-section-heading a {
    color: #c99cff;
    font-size: 0.86rem;
    font-weight: 780;
    text-decoration: none;
}

.home-workflow-grid {
    display: grid;
    gap: 10px;
}

.home-workflow-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(184, 111, 255, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.home-workflow-card:hover,
.home-workflow-card:focus-visible {
    border-color: rgba(184, 111, 255, 0.5);
    background: rgba(255, 255, 255, 0.075);
    outline: none;
    transform: translateY(-1px);
}

.home-workflow-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(180deg, rgba(174, 119, 255, 0.9), rgba(96, 62, 205, 0.9));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.home-workflow-icon svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-workflow-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.home-workflow-copy strong {
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.15;
}

.home-workflow-copy small {
    overflow: hidden;
    color: rgba(245, 241, 234, 0.62);
    font-size: 0.78rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-workflow-arrow {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.2rem;
}

.home-featured-workflow {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.home-featured-kicker {
    margin: -2px 0 0;
    color: rgba(245, 241, 234, 0.86);
    font-weight: 780;
}

.home-featured-media {
    position: relative;
    display: block;
    width: min(180px, 72%);
    aspect-ratio: 1;
    justify-self: center;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    text-decoration: none;
}

.home-featured-media img,
.home-featured-media video,
.home-recent-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-featured-play {
    position: absolute;
    inset: 50% auto auto 50%;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    transform: translate(-50%, -50%);
}

.home-featured-workflow h3 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.2;
}

.home-featured-copy {
    display: grid;
    gap: 10px;
}

.home-featured-workflow p {
    margin: 0;
    color: rgba(245, 241, 234, 0.68);
    font-size: 0.86rem;
    line-height: 1.4;
}

.home-featured-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-featured-tags span {
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(245, 241, 234, 0.8);
    font-size: 0.76rem;
    font-weight: 720;
}

.home-featured-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    border-radius: 13px;
    background: linear-gradient(90deg, #d44edc, #7f5cff);
    color: #fff;
    font-weight: 850;
    text-decoration: none;
}

.home-dashboard-section {
    margin-top: 28px;
}

.home-recent-grid,
.home-inspiration-chips {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.home-recent-grid::-webkit-scrollbar,
.home-inspiration-chips::-webkit-scrollbar {
    display: none;
}

.home-recent-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
    text-decoration: none;
}

.home-recent-media {
    display: block;
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.055);
}

.home-recent-copy {
    display: grid;
    gap: 4px;
    padding: 10px;
}

.home-recent-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-recent-copy small {
    color: rgba(245, 241, 234, 0.58);
    font-size: 0.74rem;
}

.home-inspiration-chips {
    grid-auto-columns: max-content;
}

.home-inspiration-chips a {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(245, 241, 234, 0.9);
    font-size: 0.86rem;
    font-weight: 760;
    text-decoration: none;
}

@media (min-width: 769px) {
    body .app-shell--home {
        width: min(1360px, calc(100vw - 64px));
    }

    body .app-shell--home .home-dashboard-hero {
        width: min(860px, 100%);
    }

    body .app-shell--home .home-dashboard-top {
        grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
        align-items: stretch;
    }

    body .app-shell--home .home-workflow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .app-shell--home .home-template-section,
    body .app-shell--home .home-dashboard-top,
    body .app-shell--home .home-dashboard-section {
        width: min(1120px, 100%);
        align-self: center;
    }

    body .app-shell--home .home-templates-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body .app-shell--home .templates-card {
        max-width: none;
    }

    body .app-shell--home .home-recent-grid {
        grid-auto-flow: initial;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .home-dashboard-hero {
        margin-top: 26px;
    }

    .home-dashboard-top {
        margin-top: 18px;
    }

    .home-workflows-panel,
    .home-featured-workflow {
        padding: 10px;
    }

    .home-featured-workflow {
        grid-template-columns: 132px minmax(0, 1fr);
        align-items: start;
    }

    .home-featured-workflow .home-dashboard-heading,
    .home-featured-kicker,
    .home-featured-cta {
        grid-column: 1 / -1;
    }

    .home-featured-media {
        width: 100%;
        justify-self: stretch;
    }
}

.start-body.start-funnel-body {
    background:
        radial-gradient(circle at 18% 12%, rgba(125, 82, 255, 0.28), transparent 30%),
        radial-gradient(circle at 82% 88%, rgba(219, 77, 186, 0.18), transparent 30%),
        radial-gradient(circle at 68% 22%, rgba(97, 74, 255, 0.12), transparent 26%),
        linear-gradient(180deg, #110d1f 0%, #090711 54%, #06050a 100%);
}

.start-shell.start-funnel-shell {
    width: min(1120px, 100%);
    padding: 18px 24px 54px;
}

.start-funnel-step--hero.is-active {
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 380px);
    gap: clamp(28px, 6vw, 68px);
}

.start-funnel-copy {
    max-width: 640px;
}

.start-funnel-copy h1 {
    max-width: 680px;
    font-size: clamp(2.4rem, 3.45vw, 3.35rem);
    font-weight: 850;
    line-height: 1.04;
    text-wrap: pretty;
}

.start-funnel-copy p:not(.eyebrow) {
    max-width: 48ch;
    font-size: 1rem;
}

.start-funnel-step--hero .start-media-panel {
    width: min(100%, 360px);
    justify-self: center;
}

.start-login-card .start-provider span:not(.start-provider-icon-slot) {
    width: auto;
    height: auto;
}

.start-login-card .start-provider .start-provider-icon-slot {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
}

.start-login-card .start-provider-icon-slot img {
    width: 26px;
    height: 26px;
}

@media (max-width: 840px) {
    .start-shell.start-funnel-shell {
        padding: 16px 16px 32px;
    }

    .start-funnel-step--hero.is-active {
        grid-template-columns: 1fr;
        gap: 22px;
        align-content: start;
        padding-bottom: 112px;
    }

    .start-funnel-step--hero .start-funnel-copy {
        order: 2;
    }

    .start-funnel-copy h1 {
        max-width: 100%;
        font-size: clamp(2rem, 8vw, 2.45rem);
        line-height: 1.06;
    }

    .start-funnel-step--hero .start-media-panel {
        order: 1;
        width: min(100%, 360px);
        max-height: 280px;
        aspect-ratio: 16 / 10;
        justify-self: center;
    }

    .start-funnel-step--hero .start-media-panel video {
        object-fit: cover;
    }

    .start-funnel-paywall {
        gap: 20px;
    }

    .start-funnel-paywall .start-paywall-main {
        text-align: left;
    }

    .start-funnel-paywall .start-result-copy {
        margin-inline: 0;
    }

    .start-funnel-paywall .start-plan-grid,
    .start-paywall-benefits .start-paywall-features {
        grid-template-columns: 1fr;
    }

    .start-funnel-paywall .start-plan-card {
        min-height: 0;
    }

    .start-funnel-step--hero .start-actions {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: max(14px, env(safe-area-inset-bottom));
        z-index: 20;
        display: grid;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        background: rgba(9, 7, 17, 0.88);
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(18px);
    }

    .start-funnel-step--hero .start-actions .start-primary {
        width: 100%;
    }

    .start-funnel-step[data-step="image"].is-active {
        align-content: start;
        padding-bottom: 112px;
    }

    .start-upload-row {
        gap: 10px;
    }

    .start-upload-card {
        min-height: 88px;
    }

    .start-funnel-step[data-step="image"] .start-sample-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .start-sample-card {
        min-height: 116px;
        padding: 12px 8px;
    }

    .start-sample-thumb {
        width: 58px;
        height: 58px;
        font-size: 1.2rem;
    }

    .start-step-actions {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: max(14px, env(safe-area-inset-bottom));
        z-index: 20;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        background: rgba(9, 7, 17, 0.88);
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(18px);
    }

    .start-step-actions .start-primary {
        width: 100%;
    }
}

/* Final /start paywall layout overrides legacy start styles above. */
.start-paywall.start-funnel-paywall {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 24px;
    width: 100%;
}

.start-paywall.start-funnel-paywall .start-paywall-main {
    max-width: 720px;
    justify-self: center;
    text-align: center;
}

.start-paywall.start-funnel-paywall .start-result-copy {
    margin-inline: auto;
}

.start-paywall.start-funnel-paywall .start-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(100%, 860px);
    justify-self: center;
}

.start-paywall.start-funnel-paywall .start-plan-card {
    min-width: 0;
    min-height: 300px;
    align-self: stretch;
    padding: 24px;
}

.start-plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    color: #fff;
}

.start-plan-price strong {
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1;
}

.start-plan-price span,
.start-billing-label {
    color: rgba(245, 241, 234, 0.62);
    font-size: 0.9rem;
    font-weight: 720;
}

.start-paywall.start-funnel-paywall .start-plan-note {
    grid-column: 1 / -1;
}

.start-paywall.start-funnel-paywall .start-paywall-benefits {
    width: min(100%, 860px);
    justify-self: center;
}

@media (max-width: 840px) {
    .start-paywall.start-funnel-paywall .start-paywall-main {
        justify-self: stretch;
        text-align: left;
    }

    .start-paywall.start-funnel-paywall .start-result-copy {
        margin-inline: 0;
    }

    .start-paywall.start-funnel-paywall .start-plan-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .start-paywall.start-funnel-paywall .start-plan-card {
        min-height: 0;
        padding: 20px;
    }
}
