:root {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: #0f172a;
    background:
        radial-gradient(circle at top left, rgba(127, 104, 255, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(255, 111, 88, 0.18), transparent 22%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 48%, #f8fafc 100%);
}

html.dark body {
    color: #f8fafc;
    background:
        radial-gradient(circle at top left, rgba(127, 104, 255, 0.3), transparent 24%),
        radial-gradient(circle at top right, rgba(255, 111, 88, 0.22), transparent 20%),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
}

a {
    color: inherit;
}

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

.page-with-sidebar {
    padding-left: 288px;
}

#globalTopbarMount + #sidebarBackdrop + .app-sidebar + .page-with-sidebar,
#globalTopbarMount + .page-with-sidebar {
    min-height: calc(100vh - var(--global-topbar-height, 64px));
}

.t2i-shell {
    max-width: 1360px;
    margin: 0 auto;
    padding: 26px 24px 40px;
}

.t2i-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(20px);
    background: rgba(248, 250, 252, 0.78);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

html.dark .t2i-header {
    background: rgba(2, 6, 23, 0.7);
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

.t2i-header__inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.t2i-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.t2i-brand img {
    height: 42px;
    width: auto;
    display: block;
}

.t2i-brand__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.t2i-brand__title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.t2i-brand__subtitle {
    font-size: 0.8rem;
    color: #64748b;
}

html.dark .t2i-brand__subtitle {
    color: rgba(226, 232, 240, 0.72);
}

.t2i-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
}

.t2i-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.t2i-nav__link,
.theme-toggle,
.ghost-link,
.primary-link {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.68);
    color: #334155;
    transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

html.dark .t2i-nav__link,
html.dark .theme-toggle,
html.dark .ghost-link {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(248, 250, 252, 0.92);
    border-color: rgba(148, 163, 184, 0.14);
}

.primary-link {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #7f68ff, #ff6f58);
    box-shadow: 0 12px 30px rgba(127, 104, 255, 0.22);
}

.t2i-nav__link:hover,
.theme-toggle:hover,
.ghost-link:hover,
.primary-link:hover {
    transform: translateY(-1px);
}

.mobile-actions {
    display: none;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: none;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
}

.sidebar-backdrop.is-visible {
    display: block;
}

.app-sidebar {
    position: fixed;
    top: var(--global-topbar-height, 64px);
    left: 0;
    bottom: 0;
    z-index: 50;
    width: 288px;
    padding: 18px 16px 22px;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    transition: transform 0.28s ease;
}

html.dark .app-sidebar {
    background: rgba(2, 6, 23, 0.92);
    border-right-color: rgba(148, 163, 184, 0.1);
}

.app-sidebar__inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.6);
}

html.dark .sidebar-brand {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.1);
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-brand__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-brand__text strong {
    font-size: 0.92rem;
}

.sidebar-brand__text span {
    font-size: 0.78rem;
    color: #64748b;
}

html.dark .sidebar-brand__text span {
    color: rgba(226, 232, 240, 0.68);
}

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

.sidebar-section__title {
    padding: 0 4px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

html.dark .sidebar-section__title {
    color: rgba(226, 232, 240, 0.62);
}

.sidebar-link {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

html.dark .sidebar-link {
    color: rgba(248, 250, 252, 0.92);
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(127, 104, 255, 0.1);
    border-color: rgba(127, 104, 255, 0.18);
    color: #5b21b6;
}

html.dark .sidebar-link:hover,
html.dark .sidebar-link.is-active {
    color: #ddd6fe;
    background: rgba(127, 104, 255, 0.16);
    border-color: rgba(127, 104, 255, 0.22);
}

.sidebar-product-select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.76);
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
}

html.dark .sidebar-product-select {
    background: rgba(15, 23, 42, 0.84);
    border-color: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

.sidebar-product-select:focus {
    border-color: rgba(127, 104, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(127, 104, 255, 0.12);
}

.sidebar-product-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-product-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-product-group[hidden] {
    display: none;
}

.sidebar-product-button {
    min-height: 42px;
    font-size: 0.88rem;
}

.sidebar-user {
    margin-top: auto;
    padding: 18px 16px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(127, 104, 255, 0.12), rgba(255, 111, 88, 0.08));
}

html.dark .sidebar-user {
    border-color: rgba(148, 163, 184, 0.1);
    background: linear-gradient(135deg, rgba(127, 104, 255, 0.18), rgba(255, 111, 88, 0.1));
}

.sidebar-user strong {
    display: block;
    font-size: 1rem;
}

.sidebar-user span {
    display: block;
    margin-top: 6px;
    font-size: 0.84rem;
    color: #475569;
    word-break: break-word;
}

html.dark .sidebar-user span {
    color: rgba(226, 232, 240, 0.74);
}

.sidebar-user__plan {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #6d28d9;
    background: rgba(255, 255, 255, 0.64);
}

html.dark .sidebar-user__plan {
    color: #ddd6fe;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 14px;
    min-height: 46px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7f68ff, #ff6f58);
    box-shadow: 0 12px 28px rgba(127, 104, 255, 0.24);
}

.sidebar-footer {
    padding: 0 4px;
    font-size: 0.78rem;
    color: #94a3b8;
}

html.dark .sidebar-footer {
    color: rgba(148, 163, 184, 0.78);
}

.hero-copy,
.hero-visual {
    border-radius: 30px;
    overflow: hidden;
}

.hero-copy {
    position: relative;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
        radial-gradient(circle at top right, rgba(127, 104, 255, 0.18), transparent 35%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}

html.dark .hero-copy {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.62)),
        radial-gradient(circle at top right, rgba(127, 104, 255, 0.26), transparent 35%);
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: none;
}

.hero-card__eyebrow {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6d28d9;
    background: rgba(109, 40, 217, 0.1);
}

.section-kicker,
.hero-visual__badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #334155;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.hero-visual__badge {
    color: #ffe4f1;
    background: rgba(244, 114, 182, 0.16);
    border-color: rgba(244, 114, 182, 0.28);
}

html.dark .hero-card__eyebrow {
    color: #ddd6fe;
    background: rgba(109, 40, 217, 0.18);
}

html.dark .section-kicker,
html.dark .hero-visual__badge {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark .hero-visual__badge {
    color: #ffd6ea;
    background: rgba(244, 114, 182, 0.18);
    border-color: rgba(244, 114, 182, 0.3);
}

.hero-copy h1 {
    margin: 16px 0 12px;
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
    max-width: 10ch;
}

.hero-copy p {
    margin: 0;
    max-width: 60ch;
    font-size: 1rem;
    line-height: 1.75;
    color: #475569;
}

html.dark .hero-copy p {
    color: rgba(226, 232, 240, 0.76);
}

.hero-copy__slot,
.hero-copy__model-field {
    margin-top: 22px;
    max-width: 360px;
}

.hero-copy__slot-value {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.74);
    font-weight: 700;
    color: #0f172a;
}

html.dark .hero-copy__slot-value {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

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

.hero-point {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

html.dark .hero-point {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.12);
}

.hero-point strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.hero-point span {
    display: block;
    font-size: 0.83rem;
    line-height: 1.6;
    color: #64748b;
}

html.dark .hero-point span {
    color: rgba(226, 232, 240, 0.7);
}

.t2i-panel {
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(20px);
}

html.dark .t2i-panel {
    background: rgba(15, 23, 42, 0.74);
    border-color: rgba(148, 163, 184, 0.1);
    box-shadow: none;
}

.hero-visual {
    position: relative;
    min-height: 320px;
    padding: 0;
}

.hero-visual__frame {
    position: relative;
    z-index: 1;
    border-radius: 26px;
    min-height: 320px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.82));
    color: #f8fafc;
}

.hero-visual__line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.hero-visual__line span {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.76);
}

.hero-visual__line strong {
    font-size: 0.92rem;
}

.hero-visual__note {
    font-size: 0.84rem;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.74);
}

.hero-visual__billing {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-visual__billing-header h3 {
    margin: 10px 0 0;
    font-size: 1.02rem;
    color: #f8fafc;
}

.hero-visual__billing-intro {
    color: rgba(226, 232, 240, 0.74);
}

.hero-visual .billing-preview-card {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.hero-visual .billing-preview-card__section {
    background: rgba(255, 255, 255, 0.05);
}

.hero-visual .billing-preview-card__section--actual {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.24);
}

.hero-visual .billing-preview-card__value {
    background: rgba(255, 255, 255, 0.05);
}

.hero-visual .billing-preview-card__label,
.hero-visual .billing-preview-card__meta,
.hero-visual .billing-preview-card__hint {
    color: rgba(226, 232, 240, 0.72);
}

.hero-card__glow {
    position: absolute;
    right: -90px;
    bottom: -140px;
    width: 340px;
    opacity: 0.42;
    pointer-events: none;
}

.studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.86fr);
    gap: 22px;
    align-items: start;
}

.studio-main,
.studio-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.compose-card,
.side-card,
.result-card {
    border-radius: 30px;
}

.compose-card {
    padding: 28px;
}

.compose-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.compose-card__header h2 {
    margin: 12px 0 8px;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.compose-card__header p {
    margin: 0;
    color: #64748b;
    line-height: 1.65;
}

html.dark .compose-card__header p {
    color: rgba(226, 232, 240, 0.7);
}

.compose-status {
    min-width: 230px;
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(127, 104, 255, 0.14), rgba(255, 111, 88, 0.1));
    border: 1px solid rgba(127, 104, 255, 0.16);
}

.compose-status strong {
    display: block;
    margin-bottom: 7px;
    font-size: 0.86rem;
}

.compose-status span {
    display: block;
    color: #475569;
    font-size: 0.86rem;
    line-height: 1.55;
}

html.dark .compose-status span {
    color: rgba(226, 232, 240, 0.74);
}

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

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

.field--full {
    width: 100%;
}

.field label {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.field textarea,
.field select,
.field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.8);
    color: inherit;
    border-radius: 22px;
    padding: 15px 16px;
    font: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field textarea {
    min-height: 190px;
    resize: vertical;
    line-height: 1.7;
}

html.dark .field textarea,
html.dark .field select,
html.dark .field input[type="text"] {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.12);
}

.field textarea:focus,
.field select:focus,
.field input[type="text"]:focus {
    border-color: rgba(127, 104, 255, 0.42);
    box-shadow: 0 0 0 4px rgba(127, 104, 255, 0.12);
}

.field__hint {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #64748b;
}

html.dark .field__hint {
    color: rgba(226, 232, 240, 0.66);
}

.prompt-presets,
.negative-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-btn,
.negative-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.74);
    color: #334155;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease;
}

html.dark .chip-btn,
html.dark .negative-option {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(248, 250, 252, 0.92);
    border-color: rgba(148, 163, 184, 0.12);
}

.chip-btn:hover,
.negative-option:hover {
    transform: translateY(-1px);
    border-color: rgba(127, 104, 255, 0.34);
}

.negative-option input {
    accent-color: #7f68ff;
}

.billing-preview-card {
    margin: 0;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.58);
}

html.dark .billing-preview-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.12);
}

.billing-preview-card.is-loading {
    border-color: rgba(99, 102, 241, 0.32);
}

.billing-preview-card.is-error {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

.billing-preview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.billing-preview-card__header-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.billing-preview-card__title {
    font-size: 0.98rem;
    font-weight: 700;
}

.billing-preview-card__micro {
    font-size: 0.73rem;
    line-height: 1.35;
    color: #64748b;
}

.billing-preview-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: rgba(127, 104, 255, 0.1);
    color: #6d28d9;
}

html.dark .billing-preview-card__badge {
    background: rgba(127, 104, 255, 0.18);
    color: #ddd6fe;
}

html.dark .billing-preview-card__micro {
    color: rgba(226, 232, 240, 0.68);
}

.billing-preview-card__section {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

html.dark .billing-preview-card__section {
    background: rgba(255, 255, 255, 0.03);
}

.billing-preview-card__section--actual {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(96, 165, 250, 0.18);
}

.billing-preview-card__section-title {
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.billing-preview-card__values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.billing-preview-card__value {
    padding: 12px 13px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
}

html.dark .billing-preview-card__value {
    background: rgba(255, 255, 255, 0.04);
}

.billing-preview-card__label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.74rem;
    color: #64748b;
}

html.dark .billing-preview-card__label {
    color: rgba(226, 232, 240, 0.64);
}

.billing-preview-card__value strong {
    font-size: 1rem;
    line-height: 1.35;
}

.billing-preview-card__meta,
.billing-preview-card__hint {
    font-size: 0.79rem;
    line-height: 1.65;
    color: #64748b;
}

.billing-preview-card__meta {
    padding-top: 2px;
    font-weight: 600;
}

html.dark .billing-preview-card__meta,
html.dark .billing-preview-card__hint {
    color: rgba(226, 232, 240, 0.68);
}

.compose-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
}

.compose-tips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    flex: 1;
}

.compose-tip {
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.58);
}

html.dark .compose-tip {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(148, 163, 184, 0.12);
}

.compose-tip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.compose-tip span {
    display: block;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #64748b;
}

html.dark .compose-tip span {
    color: rgba(226, 232, 240, 0.68);
}

.workspace-actions {
    width: min(300px, 100%);
}

.generate-btn {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 17px 20px;
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #7f68ff, #ff6f58);
    box-shadow: 0 16px 34px rgba(127, 104, 255, 0.28);
    transition: transform 0.15s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(127, 104, 255, 0.32);
}

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

.side-card {
    padding: 22px;
}

.side-card__header h3 {
    margin: 12px 0 0;
    font-size: 1.12rem;
}

.side-card__intro {
    margin: 12px 0 16px;
    font-size: 0.84rem;
    line-height: 1.65;
    color: #64748b;
}

html.dark .side-card__intro {
    color: rgba(226, 232, 240, 0.68);
}

.side-card strong {
    display: block;
    margin: 14px 0 10px;
    font-size: 1.1rem;
}

.side-card p {
    margin: 10px 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: #64748b;
}

html.dark .side-card p {
    color: rgba(226, 232, 240, 0.7);
}

.side-card__plan {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(127, 104, 255, 0.1);
    color: #6d28d9;
}

html.dark .side-card__plan {
    background: rgba(127, 104, 255, 0.18);
    color: #ddd6fe;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.meta-item {
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.58);
}

html.dark .meta-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(148, 163, 184, 0.12);
}

.meta-item strong {
    display: block;
    margin: 0 0 7px;
    font-size: 0.86rem;
}

.meta-item span {
    display: block;
    font-size: 0.8rem;
    line-height: 1.65;
    color: #64748b;
}

html.dark .meta-item span {
    color: rgba(226, 232, 240, 0.68);
}

.result-card {
    padding: 22px;
}

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

.result-card__header h3 {
    margin: 12px 0 0;
    font-size: 1.18rem;
}

.result-card__meta {
    font-size: 0.8rem;
    color: #64748b;
    text-align: right;
}

html.dark .result-card__meta {
    color: rgba(226, 232, 240, 0.68);
}

.result-card.is-hidden,
.sc-error.is-hidden {
    display: none;
}

.sc-loading__container {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 0 6px;
}

.sc-loading__text {
    margin: 0;
    color: #64748b;
}

html.dark .sc-loading__text {
    color: rgba(226, 232, 240, 0.72);
}

.sc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(127, 104, 255, 0.18);
    border-top-color: #7f68ff;
    border-radius: 999px;
    animation: t2i-spin 0.85s linear infinite;
}

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

.sc-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

html.dark .sc-error {
    color: #fecaca;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.result-item {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.62);
}

html.dark .result-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.1);
}

.result-image-container {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.06);
}

.generated-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-actions {
    display: flex;
    gap: 10px;
    padding: 14px;
}

.action-btn {
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    padding: 11px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

html.dark .action-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(248, 250, 252, 0.92);
    border-color: rgba(148, 163, 184, 0.12);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
}

.loading-overlay__card {
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
}

html.dark .loading-overlay__card {
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
}

@media (max-width: 1160px) {
    .studio-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .page-with-sidebar {
        padding-left: 0;
    }

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
    }
}

@media (max-width: 860px) {
    .t2i-shell,
    .global-topbar__container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .t2i-nav {
        display: none;
    }

    .mobile-actions {
        display: flex;
        gap: 10px;
        margin-bottom: 12px;
    }

    .hero-copy,
    .compose-card,
    .side-card,
    .result-card,
    .hero-visual {
        padding: 20px;
    }

    .hero-points,
    .compose-grid,
    .compose-tips,
    .billing-preview-card__values {
        grid-template-columns: 1fr;
    }

    .compose-card__header,
    .compose-footer,
    .result-card__header {
        flex-direction: column;
    }

    .compose-status,
    .workspace-actions {
        width: 100%;
        min-width: 0;
    }

    .hero-copy h1 {
        max-width: none;
        font-size: clamp(1.8rem, 7vw, 2.4rem);
    }
}
