:root {
    color-scheme: dark;
    --bg: #0b0b0d;
    --sidebar: #0f0f12;
    --panel: #17171b;
    --panel-2: #202026;
    --border: #26262d;
    --border-soft: #1d1d22;
    --text: #f5f5f7;
    --text-soft: #c8c8d0;
    --muted: #8d8d97;
    --accent: #542e91;
    --accent-strong: #6a40b1;
    --accent-soft: rgba(84, 46, 145, 0.22);
    --account-surface: rgba(18, 18, 24, 0.72);
    --account-surface-muted: rgba(255, 255, 255, 0.04);
    --account-surface-soft: rgba(255, 255, 255, 0.03);
    --account-surface-border-soft: rgba(255, 255, 255, 0.06);
    --account-accent-surface: rgba(84, 46, 145, 0.24);
    --account-accent-border: rgba(84, 46, 145, 0.42);
    --account-accent-shadow: rgba(84, 46, 145, 0.18);
    --account-accent-text: #f3e8ff;
    --account-success-surface: rgba(34, 197, 94, 0.12);
    --account-success-border: rgba(34, 197, 94, 0.24);
    --account-success-text: #6ee7a2;
    --account-danger-surface: rgba(239, 68, 68, 0.12);
    --account-danger-border: rgba(248, 113, 113, 0.24);
    --account-danger-text: #fca5a5;
    --account-info-surface: rgba(59, 130, 246, 0.16);
    --account-info-text: #93c5fd;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --sidebar: #fbfaff;
    --panel: #ffffff;
    --panel-2: #ffffff;
    --border: #ddd7eb;
    --border-soft: #ebe6f4;
    --text: #120f1b;
    --text-soft: #403850;
    --muted: #625a74;
    --accent-soft: rgba(84, 46, 145, 0.08);
    --account-surface: #ffffff;
    --account-surface-muted: #f6f2fb;
    --account-surface-soft: #fbf8fe;
    --account-surface-border-soft: #ece5f5;
    --account-accent-surface: rgba(84, 46, 145, 0.1);
    --account-accent-border: rgba(84, 46, 145, 0.2);
    --account-accent-shadow: rgba(84, 46, 145, 0.08);
    --account-accent-text: #482673;
    --account-success-surface: #edf9f1;
    --account-success-border: #b8e7c5;
    --account-success-text: #1f7a3d;
    --account-danger-surface: #fdf0f0;
    --account-danger-border: #f1c3c3;
    --account-danger-text: #b53a3a;
    --account-info-surface: #eef5ff;
    --account-info-text: #285ea8;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}

body {
    min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

textarea,
button,
input {
    font: inherit;
}

button,
input,
textarea {
    color: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

.app-shell {
    height: 100vh;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    overflow: hidden;
}

.sidebar {
    width: 200px;
    height: 100vh;
    position: relative;
    z-index: 5;
    border-right: 1px solid var(--border-soft);
    background: var(--sidebar);
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow: visible;
}

.sidebar-brand {
    padding: 6px 10px 14px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.branding-page-shell {
    display: grid;
    align-content: start;
    gap: 20px;
}

.branding-page-header {
    align-items: end;
}

.branding-page-copy {
    max-width: 640px;
    margin: 8px 0 0;
    color: var(--muted);
}

.branding-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.branding-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
}

.branding-summary-card,
.branding-form-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--account-surface);
}

.branding-summary-card {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 20px;
}

.branding-summary-eyebrow {
    color: var(--muted);
    font-size: 0.82rem;
}

.branding-summary-card h2 {
    margin: 0;
    font-size: 1.18rem;
}

.branding-summary-list {
    display: grid;
    gap: 12px;
}

.branding-summary-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--account-surface-muted);
}

.branding-summary-label {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.branding-summary-note {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.branding-form-card {
    padding: 20px;
}

.branding-form-grid {
    display: grid;
    gap: 16px;
}

.branding-field-grid {
    display: grid;
    gap: 16px;
}

.branding-field-grid-double {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.branding-field {
    display: grid;
    gap: 8px;
}

.branding-field span {
    font-size: 0.9rem;
    font-weight: 600;
}

.branding-field input,
.branding-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--account-surface-muted);
    color: var(--text);
}

.branding-field textarea {
    min-height: 112px;
    resize: vertical;
}

.branding-field small {
    color: var(--muted);
}

.branding-form-actions {
    display: flex;
    justify-content: flex-end;
}

.branding-inline-alert {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
}

.branding-inline-alert:empty {
    display: none;
}

.branding-inline-alert-success {
    border-color: var(--account-success-border);
    background: var(--account-success-surface);
    color: var(--account-success-text);
}

.branding-inline-alert-error {
    border-color: var(--account-danger-border);
    background: var(--account-danger-surface);
    color: var(--account-danger-text);
}

.social-inline-alert-muted {
    border-color: var(--account-surface-border-soft);
    background: var(--account-surface-muted);
    color: var(--muted);
}

.social-toggle-list {
    display: grid;
    gap: 12px;
}

.social-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--account-surface-muted);
}

.social-toggle input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-strong);
    flex-shrink: 0;
}

.social-toggle-copy {
    display: grid;
    gap: 4px;
}

.social-toggle-copy strong {
    font-size: 0.92rem;
}

.social-toggle-copy span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.social-toggle-compact {
    padding: 12px 14px;
}

.social-token-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.88rem;
}

.social-inline-code {
    font-family: "Consolas", "SFMono-Regular", ui-monospace, monospace;
    font-size: 0.82rem;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--account-surface-muted);
    color: var(--text-soft);
}

.social-destination-picker {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--account-surface-soft);
}

.social-platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.social-platform-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--account-surface);
}

.social-platform-card-active {
    border-color: var(--account-accent-border);
    box-shadow: inset 0 0 0 1px var(--account-accent-shadow);
}

.social-platform-card h2,
.social-section-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.social-platform-card p,
.social-section-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.social-platform-card-top,
.social-section-header,
.social-connect-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.social-platform-badge,
.social-connection-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.social-platform-badge,
.social-connection-chip-ready {
    color: var(--account-accent-text);
    background: var(--account-accent-surface);
    border: 1px solid var(--account-accent-border);
}

.social-platform-badge-muted,
.social-connection-chip {
    color: var(--text-soft);
    background: var(--account-surface-muted);
    border: 1px solid var(--border);
}

.social-platform-panel {
    padding: 0;
    overflow: hidden;
}

.social-platform-form {
    gap: 0;
}

.social-config-section {
    display: grid;
    gap: 16px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-soft);
}

.social-config-section:last-of-type {
    border-bottom: 0;
}

.social-credential-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.social-connect-row {
    align-items: center;
}

@media (max-width: 1100px) {
    .social-platform-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .social-credential-grid,
    .branding-field-grid-double,
    .branding-layout {
        grid-template-columns: 1fr;
    }

    .social-section-header,
    .social-connect-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.social-destination-list,
.social-history-list {
    display: grid;
    gap: 12px;
}

.social-destination-option,
.social-history-item {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--account-surface-muted);
    border: 1px solid var(--account-surface-border-soft);
}

.social-destination-option {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
}

.social-destination-option input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-strong);
}

.social-destination-option small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.social-history-card {
    margin-top: 18px;
}

.social-history-header h2 {
    margin: 6px 0 0;
    font-size: 1.18rem;
}

.social-history-meta,
.social-history-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.social-history-platform {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.social-history-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--account-surface-muted);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
}

.social-history-status-published {
    background: var(--account-success-surface);
    color: var(--account-success-text);
}

.social-history-status-failed,
.social-history-status-reconnectrequired {
    background: var(--account-danger-surface);
    color: var(--account-danger-text);
}

.social-history-status-publishing,
.social-history-status-queued {
    background: var(--account-info-surface);
    color: var(--account-info-text);
}

.social-history-copy {
    color: var(--text);
    line-height: 1.55;
}

.social-history-destination,
.social-history-footer,
.social-history-error {
    color: var(--muted);
    font-size: 0.88rem;
}

.social-history-footer a {
    color: var(--text);
    text-decoration: none;
}

.social-history-footer a:hover {
    text-decoration: underline;
}

.sidebar-nav,
.sidebar-group {
    display: grid;
    gap: 6px;
}

.sidebar-label {
    padding: 4px 10px 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
    width: 16px;
    font-size: 0.95rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--accent-soft);
    color: var(--text);
}

.sidebar-link.muted {
    color: #b0b0bb;
}

.sidebar-footer {
    margin-top: auto;
    padding: 8px 10px 0;
    display: grid;
    gap: 14px;
}

.sidebar-user {
    display: grid;
    gap: 10px;
}

.sidebar-notification-link {
    margin-top: 4px;
}

.sidebar-status-card {
    display: grid;
    gap: 8px;
    padding: 18px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #111116;
}

.sidebar-status-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-status-copy {
    color: var(--muted);
    font-size: 0.88rem;
}

.sidebar-upgrade-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 14px;
    background: linear-gradient(90deg, #7d57d5 0%, #8d62ea 100%);
    color: #f7f3ff;
    text-decoration: none;
    font-weight: 700;
}

.sidebar-account-shell {
    position: relative;
}

.sidebar-account-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    color: var(--text);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #24242a;
    color: #f5f5f7;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-avatar.large {
    width: 56px;
    height: 56px;
    font-size: 1rem;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-account-copy {
    display: grid;
    gap: 3px;
    text-align: left;
    flex: 1;
}

.sidebar-account-name {
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-account-plan {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.sidebar-account-chevron {
    color: var(--muted);
    transition: transform 0.15s ease;
}

.sidebar-account-toggle[aria-expanded="true"] .sidebar-account-chevron {
    transform: rotate(180deg);
}

.sidebar-account-menu {
    position: absolute;
    left: calc(100% + 22px);
    bottom: -14px;
    width: 430px;
    max-width: min(430px, calc(100vw - 240px));
    padding: 18px;
    border-radius: 22px;
    border: 1px solid #45454f;
    background: #2a2a2f;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    z-index: 20;
}

.sidebar-account-menu[hidden] {
    display: none;
}

.account-menu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.account-menu-identity {
    display: grid;
    gap: 4px;
}

.account-menu-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.account-menu-email {
    color: var(--text-soft);
    font-size: 0.94rem;
    word-break: break-word;
}

.account-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.96rem;
    font-weight: 700;
}

.account-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
    margin-bottom: 16px;
}

.account-progress span {
    display: block;
    width: 88%;
    height: 100%;
    background: #f5f5f7;
}

.account-upgrade-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    border-radius: 14px;
    background: #f4f4f6;
    color: #1b1b1f;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 18px;
}

.account-menu-links {
    display: grid;
    gap: 10px;
}

.account-menu-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e5e5ea;
    text-decoration: none;
    font-size: 0.98rem;
    padding: 4px 0;
}

.account-menu-links a i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.account-menu-links a:hover {
    color: #ffffff;
}

.account-theme-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 6px;
    margin-top: 18px;
    border-radius: 16px;
    background: #202026;
}

.account-theme-button {
    min-height: 42px;
    border-radius: 12px;
    color: var(--text-soft);
}

.account-theme-button.active {
    background: #4b4b55;
    color: var(--text);
}

.account-footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-footer-links > a {
    color: var(--text-soft);
    text-decoration: none;
}

.account-socials {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.account-socials a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 1.1rem;
}

.sidebar-user-name {
    padding: 0 4px;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.sidebar-auth-button {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #15151a;
    color: var(--text-soft);
    font-weight: 600;
    cursor: pointer;
}

.sidebar-auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sidebar-auth-button:hover {
    border-color: var(--accent-strong);
    background: #19181f;
}

html[data-theme="light"] .sidebar-auth-button {
    background: #f4f1fb;
    color: var(--text);
}

html[data-theme="light"] .sidebar-auth-button:hover {
    background: #eee9f8;
}

.page-shell {
    width: min(1240px, calc(100% - 40px));
    min-height: 100%;
    margin: 0 auto;
    padding: 32px 0 42px;
}

.app-shell > .page-shell {
    width: calc(100% - 40px);
    height: 100vh;
    margin: 0 20px;
    max-width: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hero-section {
    display: grid;
    justify-items: center;
    gap: 22px;
    padding: 44px 0 26px;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.45rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.prompt-card {
    width: min(980px, 100%);
    background: linear-gradient(180deg, #212125 0%, #1a1a1f 100%);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
    padding: 18px 18px 14px;
}

.prompt-card textarea {
    width: 100%;
    min-height: 68px;
    resize: none;
    background: transparent;
    border: 0;
    border-radius: 16px;
    outline: none;
    font-size: 1.05rem;
    line-height: 1.5;
    padding: 8px 10px 14px;
}

.prompt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 12px;
}

.prompt-pills,
.prompt-actions,
.feed-toolbar,
.feed-tabs,
.job-card-header,
.job-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt-actions {
    justify-content: flex-end;
    flex: 1;
}

.prompt-inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font-size: 0.9rem;
    white-space: nowrap;
}

.prompt-inline-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-strong);
}

.prompt-status-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: min(100%, 420px);
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.prompt-status-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    flex-shrink: 0;
}

.prompt-status-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.form-message {
    min-height: 20px;
    color: var(--muted);
    font-size: 0.92rem;
    text-align: right;
}

.prompt-status-card .form-message {
    min-height: 0;
    text-align: left;
    color: var(--text-soft);
}

.prompt-status-link {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.prompt-status-link:hover {
    text-decoration: underline;
}

.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1400;
    max-width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(21, 21, 27, 0.92);
    color: #ffffff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tool-pill,
.category-pill,
.feed-tab,
.job-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    white-space: nowrap;
}

.tool-pill {
    font-size: 0.92rem;
    font-weight: 600;
}

.tool-select-shell {
    position: relative;
}

.prompt-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-select {
    display: inline-flex;
    align-items: center;
    min-width: 146px;
    min-height: 40px;
    padding: 0 42px 0 16px;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.03);
    background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 2px), calc(100% - 14px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.tool-select:hover,
.tool-select[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.05);
}

.tool-select:focus,
.tool-select[aria-expanded="true"] {
    border-color: #3a3a44;
    box-shadow: none;
}

.tool-select-style {
    min-width: 194px;
}

.tool-select-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 180px;
    padding: 8px;
    border: 1px solid rgba(106, 64, 177, 0.35);
    border-radius: 16px;
    background: #17171d;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 4px;
    z-index: 10;
}

.tool-select-menu-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.tool-select-menu[hidden] {
    display: none;
}

.tool-option {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--text-soft);
    justify-content: flex-start;
    text-align: left;
    font-size: 0.92rem;
}

.tool-option:hover,
.tool-option.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.button-circle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f7f7f9;
    color: #111114;
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 700;
}

button:disabled {
    opacity: 0.7;
    cursor: progress;
}

.category-strip {
    width: 100%;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 2px;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.category-pill {
    min-height: 54px;
    padding: 0 22px;
    background: transparent;
    border-color: var(--border);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
}

.category-pill.active,
.feed-tab.active {
    border-color: var(--accent-strong);
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.gallery-section {
    display: grid;
    gap: 18px;
}

.feed-toolbar {
    justify-content: flex-end;
    gap: 16px;
    margin-top: 8px;
}

.feed-tabs {
    gap: 8px;
}

.feed-tab {
    min-height: 32px;
    padding: 0 16px;
    font-size: 0.92rem;
    font-weight: 600;
}

.search-shell {
    width: min(340px, 100%);
}

.search-shell input {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    padding: 0 14px;
    outline: none;
}

.search-shell input:focus {
    border-color: var(--accent-strong);
}

.empty-state[hidden] {
    display: none;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-soft);
}

.empty-state-text {
    margin-top: 6px;
}

.gallery-grid {
    column-width: 240px;
    column-gap: 16px;
}

.job-card {
    display: grid;
    gap: 10px;
    background: #121216;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    width: 100%;
    margin: 0 0 16px;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.22s ease;
    transition-delay: var(--card-reveal-delay, 0ms);
}

.job-card[hidden] {
    display: none !important;
}

.job-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.job-card-image-only {
    gap: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.job-card-header {
    justify-content: space-between;
    align-items: flex-start;
}

.job-card-prompt {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.45;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-status {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.job-status.completed {
    background: rgba(84, 46, 145, 0.18);
    border-color: rgba(84, 46, 145, 0.35);
    color: #d3c2f5;
}

.job-status.processing,
.job-status.queued,
.job-status.failed {
    color: var(--text-soft);
}

.job-preview {
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: linear-gradient(180deg, #1a1a20 0%, #131319 100%);
    display: grid;
    place-items: center;
}

.job-preview-image-only {
    aspect-ratio: var(--card-ratio, 4 / 5);
    border: 0;
    border-radius: 16px;
    background: transparent;
    place-items: stretch;
    overflow: hidden;
    position: relative;
}

.job-preview-button {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    position: relative;
}

.job-preview-image-only .job-preview-button {
    height: auto;
    display: block;
    border-radius: 16px;
    overflow: hidden;
}

.job-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.job-preview-image-only img {
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    transition: transform 0.28s ease, filter 0.28s ease;
}

.job-card-image-only:hover .job-preview-image-only img {
    transform: scale(1.04);
    filter: saturate(1.05);
}

.job-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    background: linear-gradient(180deg, rgba(8, 8, 12, 0.1) 0%, rgba(8, 8, 12, 0.72) 100%);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.job-card-image-only:hover .job-card-overlay,
.job-preview-button:focus-visible .job-card-overlay {
    opacity: 1;
}

.job-card-overlay-top,
.job-card-overlay-bottom {
    display: grid;
    gap: 8px;
}

.job-card-badge {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.job-card-overlay-prompt {
    display: -webkit-box;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.job-card-overlay-meta {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
    line-height: 1.35;
}

.job-preview-placeholder {
    padding: 18px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
    font-size: 0.9rem;
}

.job-footer {
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.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;
}

.job-error {
    margin: 0;
    color: #b9b0cb;
    font-size: 0.82rem;
    line-height: 1.5;
}

.error-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.error-card {
    width: min(460px, calc(100% - 32px));
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.error-card h1 {
    margin: 0 0 10px;
}

.error-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

.error-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--accent);
    color: #f7f3ff;
    text-decoration: none;
}

.auth-modal[hidden] {
    display: none;
}

.image-modal[hidden] {
    display: none;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
}

.image-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
}

.image-dialog {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.image-dialog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 0;
    align-items: stretch;
}

.image-stage {
    display: grid;
    min-width: 0;
    padding: 0;
}

.image-stage-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.image-stage-controls-overlay {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 2;
    padding: 8px;
    border-radius: 999px;
    background: rgba(10, 10, 14, 0.58);
    backdrop-filter: blur(10px);
}

.image-control-button {
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 700;
}

.image-control-button-wide {
    min-width: 72px;
}

.image-viewport {
    min-height: calc(100vh - 62px);
    max-height: calc(100vh - 62px);
    border-radius: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
    display: grid;
    place-items: center;
    touch-action: none;
    position: relative;
}

.image-modal-preview {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    display: block;
    object-fit: contain;
    border-radius: 18px;
    transform-origin: center center;
    user-select: none;
    will-change: transform;
}

.image-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1;
    z-index: 2;
}

.image-sidebar {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 56px 18px 18px 12px;
    border-radius: 0;
    border: 0;
    background: transparent;
    min-height: 0;
    overflow: auto;
}

.image-sidebar-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.image-share-shell {
    position: relative;
}

.image-sidebar-button {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #ffffff;
    text-align: left;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.image-sidebar-icon-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.image-sidebar-icon-button i {
    font-size: 0.95rem;
    color: inherit;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.18));
    transition: color 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.image-share-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    z-index: 5;
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(18, 18, 24, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(14px);
}

.image-share-menu[hidden] {
    display: none;
}

.image-share-option {
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    text-align: left;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.image-share-option:hover,
.image-sidebar-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.image-sidebar-button:hover {
    background: linear-gradient(180deg, rgba(118, 76, 204, 0.34) 0%, rgba(71, 43, 126, 0.28) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.image-sidebar-icon-button:hover i,
.image-sidebar-icon-button:focus-visible i {
    color: #f7f0ff;
    filter: drop-shadow(0 2px 8px rgba(169, 118, 255, 0.35));
    transform: scale(1.05);
}

.image-sidebar-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.image-share-option:hover {
    color: #ffffff;
    transform: translateX(2px);
}

.image-share-option:focus-visible,
.image-sidebar-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.28);
    outline-offset: 2px;
}

.image-metadata-grid {
    display: grid;
    gap: 14px;
}

.image-metadata-block {
    display: grid;
    gap: 6px;
}

.image-metadata-block-compact {
    gap: 4px;
}

.image-creator-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 0;
    margin-bottom: 8px;
}

.image-creator-avatar-shell {
    position: relative;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
}

.image-creator-avatar {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 181, 120, 0.95) 0%, rgba(255, 119, 69, 0.92) 100%);
    color: #1e1010;
    font-size: 1.08rem;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.image-creator-avatar-image,
.image-creator-avatar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 999px;
}

.image-creator-avatar-image {
    display: block;
    object-fit: cover;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.image-creator-avatar-image[hidden],
.image-creator-avatar[hidden] {
    display: none;
}

.image-creator-content {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.image-creator-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff;
    font-size: 1.04rem;
    font-weight: 700;
}

.image-creator-meta {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.84rem;
    line-height: 1.35;
}

.image-metadata-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.image-metadata-value {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.image-metadata-prompt {
    color: #ffffff;
    font-size: 0.98rem;
}

@media (max-width: 980px) {
    .image-dialog-layout {
        grid-template-columns: 1fr;
    }

    .image-sidebar {
        max-height: 240px;
        padding-top: 8px;
    }

    .image-stage {
        padding: 0;
    }

    .image-stage-controls-overlay {
        left: 12px;
        bottom: 12px;
    }
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
}

.auth-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100% - 32px));
    padding: 28px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: #212127;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    text-align: center;
}

.auth-dialog h2 {
    margin: 8px 0 10px;
    font-size: 2rem;
    line-height: 1.1;
}

.auth-copy {
    margin: 0 0 24px;
    color: var(--text-soft);
    line-height: 1.6;
}

.auth-error {
    margin: 0 0 16px;
    color: #f0b7b7;
    line-height: 1.5;
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font-size: 1.6rem;
    line-height: 1;
}

.google-auth-button {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #d9d9e0;
    border-radius: 12px;
    background: #ffffff;
    color: #16161a;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.google-mark {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.google-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.legal-shell {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 56px;
}

.legal-header {
    margin-bottom: 24px;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    color: var(--text-soft);
    text-decoration: none;
    margin-bottom: 16px;
}

.legal-eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
}

.legal-header h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.legal-subtitle {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.legal-card {
    display: grid;
    gap: 24px;
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
}

.legal-card section {
    display: grid;
    gap: 10px;
}

.legal-card h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
}

.legal-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.75;
}

.upgrade-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0 72px;
}

.upgrade-hero {
    display: grid;
    justify-items: center;
    text-align: center;
    margin-bottom: 34px;
}

.upgrade-hero h1 {
    margin: 8px 0 12px;
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    line-height: 1.08;
}

.upgrade-hero .legal-back {
    justify-self: start;
    margin-bottom: 28px;
}

.upgrade-hero .legal-subtitle {
    max-width: 520px;
}

.billing-toggle-shell {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 30px;
}

.billing-toggle-copy {
    color: #43b02a;
    font-size: 1rem;
    font-weight: 700;
}

.billing-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: #2a2a31;
    border: 1px solid #3a3a44;
}

.billing-toggle-button {
    min-width: 98px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    color: var(--text-soft);
    font-weight: 700;
}

.billing-toggle-button.active {
    background: #4b4b55;
    color: #ffffff;
}

.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.upgrade-card {
    display: grid;
    grid-template-rows: 48px 126px 50px 1fr;
    gap: 18px;
    position: relative;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: #1a1a1f;
    min-height: 446px;
    align-content: start;
}

.upgrade-card.current {
    border-color: var(--accent-strong);
    box-shadow: 0 18px 40px rgba(84, 46, 145, 0.12);
}

.upgrade-card.popular {
    border-color: #7d57d5;
    box-shadow: 0 18px 40px rgba(84, 46, 145, 0.18);
}

.upgrade-card-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 23px 23px 0 0;
    background: linear-gradient(90deg, #7d57d5 0%, #8d62ea 100%);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
}

.upgrade-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-top: 4px;
    min-height: 40px;
}

.upgrade-card-header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.upgrade-card-copy {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.upgrade-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
}

.upgrade-price-panel {
    min-height: 104px;
    display: flex;
    align-items: flex-end;
    align-self: stretch;
}

.upgrade-price-monthly,
.upgrade-price-annually {
    display: none;
    width: 100%;
}

.upgrade-price-monthly.active,
.upgrade-price-annually.active {
    display: block;
}

.upgrade-price-headline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.upgrade-price-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.upgrade-price-subtitle {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 0.98rem;
    line-height: 1.5;
}

.upgrade-save-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #8bcf52;
    color: #1f3610;
    font-size: 0.8rem;
    font-weight: 700;
}

.upgrade-actions {
    display: grid;
    gap: 12px;
    align-self: start;
}

.upgrade-actions.single {
    grid-template-columns: 1fr;
}

.upgrade-form {
    display: block;
}

.upgrade-button {
    width: 100%;
    min-height: 50px;
    border-radius: 14px;
    border: 1px solid #3a3a44;
    background: transparent;
    color: #ffffff;
    font-weight: 700;
}

.upgrade-button.primary {
    background: #f7f7f9;
    color: #121216;
    border-color: #f7f7f9;
}

.upgrade-button.outline {
    background: transparent;
    border-color: #34343c;
    color: #ffffff;
}

.upgrade-button.secondary {
    background: transparent;
    border-color: #34343c;
    color: #ffffff;
}

.upgrade-button:disabled {
    opacity: 0.65;
    cursor: default;
}

.upgrade-feature-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.upgrade-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #f2f2f5;
    line-height: 1.45;
}

.upgrade-feature-list i {
    margin-top: 2px;
    color: #f2f2f5;
}

.upgrade-message {
    margin: 18px 0 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.upgrade-message.success {
    background: rgba(51, 160, 90, 0.14);
    border-color: rgba(51, 160, 90, 0.28);
    color: #b7e3c6;
}

.upgrade-message.error {
    background: rgba(176, 72, 72, 0.14);
    border-color: rgba(176, 72, 72, 0.28);
    color: #f1c0c0;
}

html[data-theme="light"] .billing-toggle {
    background: #f3eefb;
    border-color: #ddd7eb;
}

html[data-theme="light"] .billing-toggle-button {
    color: #5a536d;
}

html[data-theme="light"] .billing-toggle-button.active {
    background: #ffffff;
    color: #1d172c;
    box-shadow: 0 10px 24px rgba(84, 46, 145, 0.08);
}

html[data-theme="light"] .billing-toggle-copy {
    color: #2b8e1b;
}

html[data-theme="light"] .upgrade-card {
    background: #ffffff;
    border-color: #e2dced;
}

html[data-theme="light"] .upgrade-card.popular {
    border-color: #7d57d5;
}

html[data-theme="light"] .upgrade-card-ribbon {
    color: #ffffff;
}

html[data-theme="light"] .upgrade-button.secondary,
html[data-theme="light"] .upgrade-button.outline {
    border-color: #ddd7eb;
    color: #241d35;
}

html[data-theme="light"] .upgrade-feature-list li,
html[data-theme="light"] .upgrade-feature-list i {
    color: #241d35;
}

html[data-theme="light"] body {
    background: #ffffff;
}

html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #fcfbff 0%, #f7f4fd 100%);
    border-right-color: #e7e1f1;
}

html[data-theme="light"] .sidebar-brand,
html[data-theme="light"] .hero-copy h1,
html[data-theme="light"] .empty-state-title,
html[data-theme="light"] .account-menu-name,
html[data-theme="light"] .account-plan-row,
html[data-theme="light"] .legal-header h1,
html[data-theme="light"] .legal-card h2,
html[data-theme="light"] .auth-dialog h2 {
    color: #1d172c;
}

html[data-theme="light"] .sidebar-label,
html[data-theme="light"] .auth-copy,
html[data-theme="light"] .legal-eyebrow {
    color: #655d79;
}

html[data-theme="light"] .sidebar-link {
    color: #3f3850;
}

html[data-theme="light"] .sidebar-link.muted,
html[data-theme="light"] .sidebar-account-plan,
html[data-theme="light"] .sidebar-account-chevron,
html[data-theme="light"] .sidebar-user-name,
html[data-theme="light"] .account-menu-email,
html[data-theme="light"] .form-message,
html[data-theme="light"] .job-footer,
html[data-theme="light"] .job-preview-placeholder,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .legal-subtitle,
html[data-theme="light"] .legal-card p {
    color: #595168;
}

html[data-theme="light"] .app-toast {
    border-color: rgba(84, 46, 145, 0.14);
    background: rgba(255, 255, 255, 0.96);
    color: #2d243d;
    box-shadow: 0 18px 40px rgba(84, 46, 145, 0.14);
}

html[data-theme="light"] .sidebar-link:hover,
html[data-theme="light"] .sidebar-link.active {
    background: rgba(84, 46, 145, 0.1);
    color: #271f3d;
}

html[data-theme="light"] .sidebar-auth-button {
    background: #f4f1fb;
    color: #231d33;
    border-color: #ddd7eb;
}

html[data-theme="light"] .sidebar-auth-button:hover {
    background: #eee9f8;
}

html[data-theme="light"] .sidebar-avatar {
    background: #ede8f7;
    color: #2b2340;
}

html[data-theme="light"] .prompt-card,
html[data-theme="light"] .job-card,
html[data-theme="light"] .legal-card,
html[data-theme="light"] .error-card,
html[data-theme="light"] .auth-dialog,
html[data-theme="light"] .sidebar-account-menu {
    background: #ffffff;
    border-color: #e2dced;
    box-shadow: 0 22px 55px rgba(84, 46, 145, 0.08);
}

html[data-theme="light"] .prompt-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfbfe 100%);
}

html[data-theme="light"] .job-card-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(34, 20, 60, 0.78) 100%);
}

html[data-theme="light"] .job-card-badge {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .image-creator-name {
    color: #231d33;
}

html[data-theme="light"] .image-creator-meta {
    color: rgba(35, 29, 51, 0.62);
}

html[data-theme="light"] .prompt-card textarea,
html[data-theme="light"] .search-shell input {
    color: #231d33;
}

html[data-theme="light"] .prompt-toolbar {
    border-top-color: #efe9f7;
}

html[data-theme="light"] .tool-select,
html[data-theme="light"] .category-pill,
html[data-theme="light"] .job-status {
    background: #fbf9ff;
    border-color: #ddd7eb;
    color: #3f3850;
}

html[data-theme="light"] .tool-select:hover,
html[data-theme="light"] .tool-select[aria-expanded="true"] {
    background: #f3eefb;
    border-color: #cfc4e3;
}

html[data-theme="light"] .tool-select-menu {
    background: #ffffff;
    border-color: #ddd7eb;
    box-shadow: 0 20px 42px rgba(84, 46, 145, 0.12);
}

html[data-theme="light"] .tool-option:hover,
html[data-theme="light"] .tool-option.active,
html[data-theme="light"] .account-theme-button.active {
    background: #f1ebfa;
    color: #251d39;
}

html[data-theme="light"] .category-pill.active {
    border-color: #b99add;
    background: rgba(84, 46, 145, 0.08);
    color: #2a2140;
}

html[data-theme="light"] .button-circle,
html[data-theme="light"] .sidebar-upgrade-button,
html[data-theme="light"] .account-upgrade-link {
    background: linear-gradient(90deg, #6f43b7 0%, #8359cf 100%);
    color: #ffffff;
}

html[data-theme="light"] .account-menu-links a,
html[data-theme="light"] .account-footer-links > a {
    color: #342d43;
}

html[data-theme="light"] .account-theme-row {
    background: #f6f2fb;
}

html[data-theme="light"] .account-progress {
    background: #ece6f6;
}

html[data-theme="light"] .account-progress span {
    background: #6a40b1;
}

html[data-theme="light"] .account-footer-links {
    border-top-color: #ebe5f5;
}

html[data-theme="light"] .job-preview {
    background: linear-gradient(180deg, #f8f6fc 0%, #f1edf8 100%);
}

html[data-theme="light"] .image-sidebar-button {
    border-color: rgba(18, 15, 27, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 241, 252, 0.96) 100%);
    color: #120f1b;
    box-shadow: 0 10px 26px rgba(84, 46, 145, 0.12);
}

html[data-theme="light"] .image-share-menu {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(18, 15, 27, 0.1);
    box-shadow: 0 18px 44px rgba(18, 15, 27, 0.14);
}

html[data-theme="light"] .image-share-option {
    color: #2d243d;
}

html[data-theme="light"] .image-share-option:hover,
html[data-theme="light"] .image-sidebar-button:hover {
    background: rgba(84, 46, 145, 0.08);
    color: #120f1b;
}

html[data-theme="light"] .image-sidebar-button:hover {
    background: linear-gradient(180deg, rgba(121, 77, 201, 0.16) 0%, rgba(84, 46, 145, 0.12) 100%);
    color: #51278f;
    border-color: rgba(84, 46, 145, 0.16);
    box-shadow: 0 14px 28px rgba(84, 46, 145, 0.16);
}

html[data-theme="light"] .image-sidebar-icon-button:hover,
html[data-theme="light"] .image-sidebar-icon-button:focus-visible,
html[data-theme="light"] .image-sidebar-icon-button[aria-expanded="true"] {
    background: linear-gradient(180deg, #7b4dc9 0%, #5c2ea0 100%);
    color: #ffffff;
    border-color: rgba(84, 46, 145, 0.34);
    box-shadow: 0 16px 30px rgba(84, 46, 145, 0.24);
}

html[data-theme="light"] .image-sidebar-icon-button:hover i,
html[data-theme="light"] .image-sidebar-icon-button:focus-visible i,
html[data-theme="light"] .image-sidebar-icon-button[aria-expanded="true"] i {
    color: #ffffff;
    filter: drop-shadow(0 2px 8px rgba(46, 17, 96, 0.28));
}

html[data-theme="light"] .image-share-option:focus-visible,
html[data-theme="light"] .image-sidebar-button:focus-visible {
    outline-color: rgba(84, 46, 145, 0.28);
}

html[data-theme="light"] .empty-state {
    background: #fcfbff;
    border-color: #e3dff0;
}

html[data-theme="light"] .search-shell input {
    background: #ffffff;
    border-color: #ddd7eb;
}

html[data-theme="light"] .search-shell input:focus {
    border-color: #c6b8e5;
}

html[data-theme="light"] .auth-close {
    color: #5f5873;
}

html[data-theme="light"] .google-auth-button {
    border-color: #d9d3e7;
    box-shadow: 0 8px 22px rgba(84, 46, 145, 0.06);
}

@media (max-width: 1100px) {
    .app-shell {
        height: auto;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .sidebar {
        display: none;
    }

    .upgrade-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 24px, 1240px);
        min-height: auto;
        padding-top: 18px;
    }

    .app-shell > .page-shell {
        width: min(100% - 24px, 1240px);
        height: auto;
        margin: 0 auto;
        overflow: visible;
    }

    .hero-section {
        padding-top: 28px;
    }

    .prompt-toolbar,
    .feed-toolbar,
    .job-card-header,
    .job-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .prompt-actions {
        width: 100%;
        justify-content: space-between;
    }

    .prompt-inline-toggle {
        width: 100%;
        justify-content: flex-start;
        min-height: 42px;
    }

    .prompt-status-card {
        max-width: none;
        flex: 1;
    }

    .form-message {
        text-align: left;
    }

    .search-shell {
        width: 100%;
    }


    .gallery-grid {
        column-width: 180px;
        column-gap: 12px;
    }

    .job-card {
        margin-bottom: 12px;
    }

    .job-card-overlay {
        padding: 12px;
        opacity: 1;
        background: linear-gradient(180deg, rgba(8, 8, 12, 0.04) 0%, rgba(8, 8, 12, 0.6) 100%);
    }

    .job-card-overlay-prompt {
        font-size: 0.88rem;
    }
}
