@charset "UTF-8";

/*
 * 706 AI Image Studio — community theme bridge
 * Loaded after style.css.  The rules are deliberately scoped to the active
 * image workspace so the rest of the application keeps its existing skin.
 */

body.create-page-active {
    --studio-bg: #f4f4f4;
    --studio-surface: #ffffff;
    --studio-surface-soft: #fafafa;
    --studio-surface-muted: #f0f0f0;
    --studio-line: #e6e6e6;
    --studio-line-strong: #d7d7d7;
    --studio-text: #111111;
    --studio-text-body: #666666;
    --studio-text-muted: #858585;
    --studio-accent: #4f46e5;
    --studio-accent-hover: #4338ca;
    --studio-accent-soft: #eef2ff;
    --studio-accent-ink: #ffffff;
    --studio-primary: #111111;
    --studio-primary-hover: #2b2b2b;
    --studio-primary-ink: #ffffff;
    --studio-danger: #d94a4a;
    --studio-success: #17843c;
    --studio-focus: #111111;
    --studio-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --studio-shadow-sm: 0 7px 22px rgba(0, 0, 0, 0.07);
    --studio-shadow-md: 0 16px 38px rgba(0, 0, 0, 0.12);
    --studio-radius: 10px;
    --studio-radius-sm: 8px;

    /* Map the legacy component tokens onto the homepage palette. */
    --bg-body: var(--studio-bg);
    --bg-surface: var(--studio-surface);
    --bg-surface-hover: var(--studio-surface-soft);
    --bg-element: var(--studio-surface-muted);
    --bg-element-hover: #ebebeb;
    --border: var(--studio-line);
    --border-subtle: var(--studio-line);
    --border-strong: var(--studio-line-strong);
    --border-glow: var(--studio-accent);
    --text-title: var(--studio-text);
    --text-body: var(--studio-text-body);
    --text-muted: var(--studio-text-muted);
    --brand-primary: var(--studio-text);
    --brand-accent: var(--studio-accent);
    --shadow-subtle: var(--studio-shadow-xs);

    background-color: var(--studio-bg);
    background-image: none;
    color: var(--studio-text);
}

/* Keep the legacy theme switch working, and also understand the homepage's
   html[data-theme="dark"] convention. */
body.create-page-active:not(.light-mode),
html[data-theme="dark"] body.create-page-active {
    color-scheme: dark;
    --studio-bg: #151515;
    --studio-surface: #202020;
    --studio-surface-soft: #252525;
    --studio-surface-muted: #2b2b2b;
    --studio-line: #343434;
    --studio-line-strong: #484848;
    --studio-text: #f4f4f4;
    --studio-text-body: #b5b5b5;
    --studio-text-muted: #9b9b9b;
    --studio-accent: #6366f1;
    --studio-accent-hover: #818cf8;
    --studio-accent-soft: rgba(99, 102, 241, 0.18);
    --studio-accent-ink: #ffffff;
    --studio-primary: #6366f1;
    --studio-primary-hover: #818cf8;
    --studio-primary-ink: #ffffff;
    --studio-success: #65c881;
    --studio-focus: #ffffff;
    --studio-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
    --studio-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
    --studio-shadow-md: 0 18px 42px rgba(0, 0, 0, 0.4);
    --bg-element-hover: #323232;
}

body.create-page-active :where(button, input, textarea, select, [tabindex]):focus-visible {
    outline: 2px solid var(--studio-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--studio-accent) !important;
}

body.create-page-active ::-webkit-scrollbar-thumb {
    background: var(--studio-line-strong);
}

/* --------------------------------------------------------------------------
   Global bar: compact, quiet and consistent with the community homepage
   -------------------------------------------------------------------------- */

body.create-page-active #main-header {
    height: 50px;
    min-height: 50px;
    margin: 8px 16px 0;
    padding: 0 12px 0 14px;
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-radius);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-xs);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.create-page-active #main-header .logo-area {
    min-width: 0;
    gap: 9px;
    color: var(--studio-text);
    font-size: 14px;
    font-weight: 850;
}

body.create-page-active #main-header .logo-area img {
    max-width: 150px;
    object-fit: contain;
}

body.create-page-active #main-header .logo-svg {
    width: 30px;
    height: 30px;
    padding: 6px;
    border-radius: var(--studio-radius-sm);
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
    stroke: currentColor;
}

body.create-page-active #main-header .header-actions {
    flex: 0 0 auto;
    gap: 8px;
}

body.create-page-active #main-header .icon-btn {
    width: 32px;
    height: 32px;
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface);
    color: var(--studio-text-body);
}

body.create-page-active #main-header .icon-btn:hover {
    border-color: var(--studio-line-strong);
    background: var(--studio-accent-soft);
    color: var(--studio-text);
}

body.create-page-active #main-header .notification-badge {
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
    box-shadow: 0 0 0 2px var(--studio-surface);
}

body.create-page-active #main-container {
    padding: 10px 16px 16px;
}

/* --------------------------------------------------------------------------
   Studio sub-navigation
   -------------------------------------------------------------------------- */

#create-page.active-page {
    --ai-image-panel: var(--studio-surface);
    --ai-image-panel-strong: var(--studio-surface-soft);
    --ai-image-panel-soft: var(--studio-surface-muted);
    --ai-image-line: var(--studio-line);
    --ai-image-accent: var(--studio-accent);
    --ai-image-success: var(--studio-success);
    gap: 10px;
}

#create-page.active-page .create-studio-intro {
    min-width: 0;
    min-height: 68px;
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 18px;
    overflow: hidden;
    border: 1px solid var(--studio-line);
    border-radius: 16px;
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-xs);
}

#create-page.active-page .create-studio-intro-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

#create-page.active-page .create-studio-kicker {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--studio-accent-soft);
    color: var(--studio-accent);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

#create-page.active-page .create-studio-intro h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--studio-text);
    font-size: clamp(21px, 2.15vw, 28px);
    font-weight: 950;
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#create-page.active-page .create-studio-intro p {
    min-width: 240px;
    max-width: 520px;
    margin: 0;
    color: var(--studio-text-body);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.55;
    text-align: right;
}

#create-page.active-page .create-studio-bar {
    min-height: 54px;
    padding: 6px 8px;
    grid-template-columns: minmax(190px, 0.55fr) minmax(280px, 1.45fr) auto;
    gap: 10px;
    overflow: hidden;
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-radius);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-xs);
}

body.light-mode #create-page.active-page .create-studio-bar,
html[data-theme="dark"] #create-page.active-page .create-studio-bar {
    background: var(--studio-surface);
}

#create-page.active-page .create-studio-brand {
    gap: 9px;
    padding-left: 1px;
}

#create-page.active-page .create-studio-mark {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--studio-radius-sm);
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.light-mode #create-page.active-page .create-studio-mark,
html[data-theme="dark"] #create-page.active-page .create-studio-mark {
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
}

#create-page.active-page .create-studio-brand strong {
    color: var(--studio-text);
    font-size: 14px;
    font-weight: 900;
}

#create-page.active-page .create-studio-brand em {
    color: var(--studio-text-muted);
    font-size: 10px;
    font-weight: 700;
}

#create-page.active-page .create-mode-tabs {
    width: 100%;
    min-width: 0;
    height: 40px;
    gap: 2px;
    padding: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-muted);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

#create-page.active-page .create-mode-tabs::-webkit-scrollbar {
    display: none;
}

#create-page.active-page .create-mode-tabs button,
#create-page.active-page .create-studio-actions button {
    flex: 0 0 auto;
    height: 32px;
    min-width: max-content;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--studio-text-body);
    font-size: 12px;
    font-weight: 800;
}

#create-page.active-page .create-mode-tabs button:hover,
#create-page.active-page .create-studio-actions button:hover {
    background: var(--studio-surface);
    color: var(--studio-text);
}

#create-page.active-page .create-mode-tabs button.active,
body.light-mode #create-page.active-page .create-mode-tabs button.active {
    border-color: var(--studio-accent);
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
    box-shadow: none;
}

#create-page.active-page .create-studio-actions {
    min-width: max-content;
    gap: 6px;
}

#create-page.active-page .create-studio-actions button {
    border-color: transparent;
}

#create-page.active-page .create-studio-actions span {
    height: 32px;
    gap: 5px;
    padding: 0 10px;
    border-color: rgba(79, 70, 229, 0.58);
    border-radius: 6px;
    background: var(--studio-accent-soft);
    color: var(--studio-text-body);
}

#create-page.active-page .create-studio-actions strong {
    color: var(--studio-text);
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Panels, fields and selectable controls
   -------------------------------------------------------------------------- */

#create-page.active-page .glass-card {
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-radius);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-xs);
}

body.light-mode #create-page.active-page .glass-card,
html[data-theme="dark"] #create-page.active-page .glass-card {
    box-shadow: var(--studio-shadow-xs);
}

#create-page.active-page .bento-hover:hover {
    border-color: var(--studio-line-strong);
    box-shadow: var(--studio-shadow-sm);
}

#create-page.active-page .bento-card {
    padding: 13px;
    gap: 11px;
}

#create-page.active-page .section-title {
    color: var(--studio-text);
    font-size: 12px;
    font-weight: 850;
}

#create-page.active-page .section-title svg {
    color: var(--studio-text-body);
    stroke: currentColor;
}

#create-page.active-page .create-limit-text,
#create-page.active-page .section-header > span {
    color: var(--studio-text-muted) !important;
}

#create-page.active-page textarea,
#create-page.active-page select,
#create-page.active-page input:not([type="checkbox"]):not([type="file"]) {
    border: 1px solid var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
    color: var(--studio-text);
    caret-color: var(--studio-text);
}

#create-page.active-page textarea::placeholder,
#create-page.active-page input::placeholder {
    color: var(--studio-text-muted);
}

#create-page.active-page textarea:hover,
#create-page.active-page select:hover,
#create-page.active-page input:not([type="checkbox"]):not([type="file"]):hover {
    border-color: var(--studio-line-strong);
}

#create-page.active-page textarea:focus,
#create-page.active-page select:focus,
#create-page.active-page input:not([type="checkbox"]):not([type="file"]):focus {
    border-color: var(--studio-accent);
    background: var(--studio-surface);
    box-shadow: 0 0 0 3px var(--studio-accent-soft);
}

#create-page.active-page #prompt {
    min-height: 124px;
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
}

#create-page.active-page .create-text-action {
    border-color: var(--studio-line);
    border-radius: 6px;
    background: var(--studio-surface);
    color: var(--studio-text-muted);
}

#create-page.active-page .create-text-action:hover {
    border-color: var(--studio-line-strong);
    background: var(--studio-surface-muted);
    color: var(--studio-text);
}

#create-page.active-page .prompt-optimize-main,
#create-page.active-page .prompt-optimize-actions button,
body.light-mode #create-page.active-page .prompt-optimize-main,
body.light-mode #create-page.active-page .prompt-optimize-actions button {
    min-height: 36px;
    border-color: var(--studio-accent);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
    box-shadow: none;
}

#create-page.active-page .prompt-optimize-main:hover,
#create-page.active-page .prompt-optimize-actions button:hover,
body.light-mode #create-page.active-page .prompt-optimize-main:hover,
body.light-mode #create-page.active-page .prompt-optimize-actions button:hover {
    border-color: var(--studio-accent-hover);
    background: var(--studio-accent-hover);
    color: var(--studio-accent-ink);
    transform: none;
}

#create-page.active-page .prompt-optimize-actions button:not(:first-child) {
    border-color: var(--studio-line);
    background: var(--studio-surface);
    color: var(--studio-text);
}

#create-page.active-page .prompt-optimize-result,
body.light-mode #create-page.active-page .prompt-optimize-result {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-sm);
}

#create-page.active-page .prompt-optimize-preview,
body.light-mode #create-page.active-page .prompt-optimize-preview {
    color: var(--studio-text);
}

#create-page.active-page .prompt-draft-bar {
    border-color: rgba(79, 70, 229, 0.55);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-accent-soft);
    color: var(--studio-text-body);
}

#create-page.active-page .prompt-draft-bar button {
    border-color: var(--studio-accent);
    background: var(--studio-accent);
    color: var(--studio-accent-ink);
}

#create-page.active-page .create-advanced-box {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
}

#create-page.active-page .create-advanced-box summary {
    color: var(--studio-text-body);
}

#create-page.active-page .create-advanced-box summary::after,
#create-page.active-page .create-advanced-box summary em {
    color: var(--studio-text-muted);
}

#create-page.active-page .model-select-card {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
    box-shadow: none;
}

#create-page.active-page .model-select-head span {
    color: var(--studio-text);
}

#create-page.active-page .model-select-head em {
    background: var(--studio-accent-soft);
    color: var(--studio-text);
}

#create-page.active-page .model-select-control::after {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--studio-accent);
    box-shadow: none;
}

#create-page.active-page .model-select-control::before {
    border-color: var(--studio-accent-ink);
}

#create-page.active-page #model-select {
    border-color: var(--studio-line);
    background: var(--studio-surface);
    color: var(--studio-text);
}

#create-page.active-page #model-select:hover,
#create-page.active-page #model-select:focus {
    border-color: var(--studio-accent);
    background: var(--studio-surface);
    box-shadow: 0 0 0 3px var(--studio-accent-soft);
}

#create-page.active-page .batch-count-btn,
#create-page.active-page .create-size-btn,
#create-page.active-page .ratio-btn,
#create-page.active-page .ref-source-btn,
#create-page.active-page .ref-upload-btn,
#create-page.active-page .ref-selected-area,
#create-page.active-page .ref-picker-panel {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
    color: var(--studio-text-body);
    box-shadow: none;
}

#create-page.active-page :is(.batch-count-btn, .create-size-btn, .ratio-btn, .ref-source-btn, .ref-upload-btn):hover {
    border-color: var(--studio-line-strong);
    background: var(--studio-surface-muted);
    color: var(--studio-text);
}

#create-page.active-page :is(.batch-count-btn, .create-size-btn, .ratio-btn).active,
body.light-mode #create-page.active-page :is(.batch-count-btn, .create-size-btn, .ratio-btn).active {
    border-color: var(--studio-accent);
    background: var(--studio-accent-soft);
    color: var(--studio-text);
    box-shadow: inset 0 0 0 1px var(--studio-accent);
}

#create-page.active-page .create-size-btn.active span,
body.light-mode #create-page.active-page .batch-count-btn.active {
    color: var(--studio-text);
}

#create-page.active-page .ratio-icon {
    color: currentColor;
}

#create-page.active-page .ref-upload-btn {
    border-style: dashed;
}

#create-page.active-page .ref-empty-state,
#create-page.active-page .ref-picker-empty {
    color: var(--studio-text-muted);
}

#create-page.active-page .ref-picker-head {
    color: var(--studio-text);
}

#create-page.active-page .ref-picker-head button {
    border-color: var(--studio-line);
    background: var(--studio-surface);
    color: var(--studio-text-body);
}

#create-page.active-page .ref-picker-item {
    border-color: var(--studio-line);
    background: var(--studio-surface-muted);
}

#create-page.active-page .ref-clear-btn {
    background: var(--studio-primary);
    color: var(--studio-primary-ink);
}

/* --------------------------------------------------------------------------
   Cost dock and progress
   -------------------------------------------------------------------------- */

#create-page.active-page .create-cost-dock,
body.light-mode #create-page.active-page .create-cost-dock {
    padding: 11px;
    border-color: var(--studio-line);
    background: color-mix(in srgb, var(--studio-surface) 96%, transparent);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#create-page.active-page .cost-box {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
    color: var(--studio-text-body);
}

#create-page.active-page .cost-box #cost-preview {
    color: var(--studio-text);
}

#create-page.active-page .cost-box #balance-preview {
    color: var(--studio-success);
}

#create-page.active-page .create-cost-dock .create-run-btn,
body.light-mode #create-page.active-page .create-cost-dock .create-run-btn {
    min-height: 48px;
    border: 1px solid var(--studio-primary);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-primary);
    color: var(--studio-primary-ink);
    box-shadow: none;
}

#create-page.active-page .create-cost-dock .create-run-btn:hover {
    border-color: var(--studio-primary-hover);
    background: var(--studio-primary-hover);
}

#create-page.active-page .create-cost-dock .create-run-btn svg,
body.light-mode #create-page.active-page .create-cost-dock .create-run-btn svg {
    stroke: currentColor;
}

#create-page.active-page .generation-progress {
    border-color: rgba(79, 70, 229, 0.5);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-accent-soft);
}

#create-page.active-page .generation-progress-head span {
    color: var(--studio-text);
}

#create-page.active-page .generation-progress-bar {
    background: var(--studio-line);
}

#create-page.active-page .generation-progress-bar span {
    background: var(--studio-accent);
}

/* --------------------------------------------------------------------------
   Output canvas, switches and toolbar
   -------------------------------------------------------------------------- */

#create-page.active-page .workspace-canvas,
body.light-mode #create-page.active-page .workspace-canvas {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-xs);
}

#create-page.active-page .workspace-canvas-header {
    min-height: 54px;
    padding: 8px 12px;
    border-color: var(--studio-line);
    background: var(--studio-surface);
}

#create-page.active-page .canvas-header-controls {
    min-width: 0;
}

#create-page.active-page .canvas-mode-toggle,
body.light-mode #create-page.active-page .canvas-mode-toggle {
    min-height: 38px;
    padding: 5px 10px 5px 6px;
    border-color: var(--studio-line);
    border-radius: 999px;
    background: var(--studio-surface-soft);
    color: var(--studio-text);
    box-shadow: none;
}

#create-page.active-page .canvas-mode-toggle:hover {
    border-color: var(--studio-line-strong);
    transform: none;
}

#create-page.active-page .canvas-mode-switch {
    width: 46px;
    height: 26px;
    border-color: var(--studio-line-strong);
    background: var(--studio-surface-muted);
}

#create-page.active-page .canvas-mode-switch::after {
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--studio-surface);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
}

#create-page.active-page .canvas-mode-copy strong,
body.light-mode #create-page.active-page .canvas-mode-copy strong {
    color: var(--studio-text);
}

#create-page.active-page .canvas-mode-copy em,
body.light-mode #create-page.active-page .canvas-mode-copy em {
    color: var(--studio-text-muted);
}

#create-page.active-page .canvas-mode-toggle input:checked + .canvas-mode-switch {
    border-color: var(--studio-accent);
    background: var(--studio-accent);
    box-shadow: none;
}

#create-page.active-page .canvas-mode-toggle input:checked + .canvas-mode-switch::after {
    transform: translateX(20px);
}

#create-page.active-page .canvas-mode-toggle:has(input:checked),
body.light-mode #create-page.active-page .canvas-mode-toggle:has(input:checked) {
    border-color: var(--studio-accent);
    background: var(--studio-accent-soft);
}

#create-page.active-page .canvas-mode-toggle:has(input:checked) .canvas-mode-copy strong,
#create-page.active-page .canvas-mode-toggle:has(input:checked) .canvas-mode-copy em,
body.light-mode #create-page.active-page .canvas-mode-toggle:has(input:checked) .canvas-mode-copy strong,
body.light-mode #create-page.active-page .canvas-mode-toggle:has(input:checked) .canvas-mode-copy em {
    color: var(--studio-text);
}

#create-page.active-page .canvas-project-select {
    border-color: var(--studio-line);
    background: var(--studio-surface-soft);
    color: var(--studio-text-body);
}

/* Inline styles in the legacy toolbar need an explicit skin override.  Display
   is intentionally untouched so selected-action visibility keeps working. */
#create-page.active-page #workspace-actions > button {
    border: 1px solid var(--studio-line) !important;
    border-radius: 6px !important;
    background: var(--studio-surface-soft) !important;
    color: var(--studio-text-body) !important;
    box-shadow: none !important;
}

#create-page.active-page #workspace-actions > button:hover {
    border-color: var(--studio-line-strong) !important;
    background: var(--studio-surface-muted) !important;
    color: var(--studio-text) !important;
}

#create-page.active-page #workspace-actions > button:is([onclick="toggleCanvasVersions()"], [onclick="addPromptNode()"], [onclick="addRefImageNode()"], [onclick="addGenerateNode()"], [onclick="publishGallery()"]),
#create-page.active-page #workspace-actions > button[onclick="toggleCanvasVersions(false)"] {
    border-color: var(--studio-accent) !important;
    background: var(--studio-accent-soft) !important;
    color: var(--studio-text) !important;
}

#create-page.active-page #workspace-actions > button[onclick="publishGallery()"] {
    background: var(--studio-accent) !important;
    color: var(--studio-accent-ink) !important;
}

#create-page.active-page #workspace-actions > button svg {
    stroke: currentColor;
}

#create-page.active-page .infinite-canvas-shell,
body.light-mode #create-page.active-page .infinite-canvas-shell {
    background-color: var(--studio-surface-soft);
    background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--studio-text-muted) 22%, transparent) 1px, transparent 0);
    background-size: 26px 26px;
}

#create-page.active-page .canvas-empty-state,
#create-page.active-page .mobile-output-empty {
    color: var(--studio-text-muted);
}

#create-page.active-page .canvas-empty-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--studio-line-strong);
    border-radius: var(--studio-radius);
    background: var(--studio-accent-soft);
    color: var(--studio-text-body);
}

#create-page.active-page .canvas-empty-icon svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
}

#create-page.active-page .canvas-empty-title {
    color: var(--studio-text);
}

#create-page.active-page .canvas-empty-desc,
#create-page.active-page .canvas-hint,
#create-page.active-page .canvas-version-subtitle,
#create-page.active-page .canvas-version-empty {
    color: var(--studio-text-muted);
}

#create-page.active-page .canvas-hint,
body.light-mode #create-page.active-page .canvas-hint {
    border-color: var(--studio-line);
    background: color-mix(in srgb, var(--studio-surface) 90%, transparent);
    color: var(--studio-text-muted);
}

#create-page.active-page .canvas-loading-overlay,
body.light-mode #create-page.active-page .canvas-loading-overlay {
    background: color-mix(in srgb, var(--studio-surface) 62%, transparent);
}

#create-page.active-page .canvas-loading-spinner {
    border-color: var(--studio-line);
    border-top-color: var(--studio-accent);
}

#create-page.active-page .canvas-load-error {
    border-color: color-mix(in srgb, var(--studio-danger) 42%, transparent);
    background: color-mix(in srgb, var(--studio-danger) 12%, var(--studio-surface));
    color: var(--studio-danger);
}

#create-page.active-page .canvas-version-panel,
body.light-mode #create-page.active-page .canvas-version-panel {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius);
    background: color-mix(in srgb, var(--studio-surface) 94%, transparent);
    box-shadow: var(--studio-shadow-md);
}

#create-page.active-page .canvas-version-title {
    color: var(--studio-text);
}

#create-page.active-page .canvas-version-close {
    border-color: var(--studio-line);
    background: var(--studio-surface-muted);
    color: var(--studio-text-body);
}

#create-page.active-page .canvas-version-item {
    border-color: var(--studio-line);
    background: var(--studio-surface-soft);
}

#create-page.active-page .canvas-version-item:hover {
    border-color: var(--studio-accent);
    background: var(--studio-accent-soft);
    transform: none;
}

#create-page.active-page .canvas-version-badge {
    border-color: var(--studio-accent);
    background: var(--studio-accent-soft);
    color: var(--studio-text);
}

#create-page.active-page .canvas-card {
    border-color: var(--studio-line);
    background: var(--studio-surface-muted);
}

#create-page.active-page .canvas-card:hover {
    border-color: var(--studio-line-strong);
    box-shadow: var(--studio-shadow-sm);
}

#create-page.active-page .canvas-action-btn.regenerate-btn {
    border-color: rgba(79, 70, 229, 0.62);
    background: rgba(79, 70, 229, 0.9);
    color: var(--studio-accent-ink);
}

/* --------------------------------------------------------------------------
   Right-side helper cards and result collections
   -------------------------------------------------------------------------- */

#create-page.active-page .create-assist-panel {
    gap: 10px;
}

#create-page.active-page .create-quick-actions {
    gap: 7px;
}

#create-page.active-page .create-quick-actions button,
#create-page.active-page .prompt-history-item,
#create-page.active-page .prompt-template-item {
    border-color: var(--studio-line);
    border-radius: var(--studio-radius-sm);
    background: var(--studio-surface-soft);
    color: var(--studio-text);
}

#create-page.active-page .create-quick-actions button:hover,
#create-page.active-page .prompt-history-item:hover,
#create-page.active-page .prompt-template-item:hover {
    border-color: var(--studio-line-strong);
    background: var(--studio-surface-muted);
    transform: none;
}

#create-page.active-page .create-quick-actions em,
#create-page.active-page .prompt-history-main span,
#create-page.active-page .prompt-history-main em,
#create-page.active-page .prompt-template-item span,
#create-page.active-page .prompt-template-item em {
    color: var(--studio-text-muted);
}

#create-page.active-page .prompt-history-actions button,
#create-page.active-page .prompt-template-tab {
    border-color: var(--studio-line);
    background: var(--studio-surface);
    color: var(--studio-text-body);
}

#create-page.active-page .prompt-history-actions button:hover,
#create-page.active-page .prompt-template-tab:hover,
#create-page.active-page .prompt-template-tab.active {
    border-color: var(--studio-accent);
    background: var(--studio-accent-soft);
    color: var(--studio-text);
}

#create-page.active-page .prompt-history-empty,
#create-page.active-page .prompt-template-empty {
    border-color: var(--studio-line);
    color: var(--studio-text-muted);
}

#create-page.active-page .recent-output-section,
#create-page.active-page .recent-output-card {
    border-color: var(--studio-line);
    background: var(--studio-surface);
    box-shadow: var(--studio-shadow-xs);
}

#create-page.active-page .recent-output-loading {
    border-color: var(--studio-line);
    background: var(--studio-surface-soft);
    color: var(--studio-text-muted);
}

#create-page.active-page .recent-reverse-card,
body.light-mode #create-page.active-page .recent-reverse-card {
    border-color: var(--studio-line);
    background: var(--studio-surface-soft);
}

#create-page.active-page .recent-output-tags i,
body.light-mode #create-page.active-page .recent-output-tags i {
    background: var(--studio-accent-soft);
    color: var(--studio-text);
}

#create-page.active-page .recent-output-actions button,
#create-page.active-page .recent-output-view-all {
    border-color: var(--studio-line);
    background: var(--studio-surface-soft);
    color: var(--studio-text-body);
}

#create-page.active-page .recent-output-actions button:hover,
#create-page.active-page .recent-output-view-all:hover {
    border-color: var(--studio-accent);
    background: var(--studio-accent-soft);
    color: var(--studio-text);
}

#create-page.active-page .recent-reverse-card .recent-output-actions button:first-child {
    border-color: var(--studio-primary);
    background: var(--studio-primary);
    color: var(--studio-primary-ink);
}

/* Mobile application dock uses the same neutral surface and brand accent cue. */
body.create-page-active .frontend-mobile-nav,
body.create-page-active.light-mode .frontend-mobile-nav,
html[data-theme="dark"] body.create-page-active .frontend-mobile-nav {
    border-color: var(--studio-line);
    background: color-mix(in srgb, var(--studio-surface) 94%, transparent);
}

body.create-page-active .frontend-mobile-nav-item {
    color: var(--studio-text-muted);
}

body.create-page-active .frontend-mobile-nav-item.is-active {
    background: var(--studio-accent-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--studio-accent) 14%, transparent);
    color: var(--studio-accent);
}

body.create-page-active .frontend-mobile-nav-item.is-active svg {
    stroke: currentColor;
}

/* --------------------------------------------------------------------------
   Responsive distribution
   -------------------------------------------------------------------------- */

@media (min-width: 1101px) {
    #create-page.active-page {
        grid-template-columns: minmax(300px, 336px) minmax(480px, 1fr) minmax(260px, 300px);
        grid-template-rows: auto minmax(0, 1fr);
    }
}

@media (max-width: 1100px) and (min-width: 769px) {
    body.create-page-active #main-container {
        overflow: auto;
    }

    #create-page.active-page {
        display: grid !important;
        grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
        grid-template-rows: auto minmax(540px, 1fr) auto;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    #create-page.active-page .create-studio-bar {
        grid-column: 1 / -1;
        grid-row: 1;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "tabs tabs";
    }

    #create-page.active-page .create-studio-brand {
        grid-area: brand;
    }

    #create-page.active-page .create-mode-tabs {
        grid-area: tabs;
    }

    #create-page.active-page .create-studio-actions {
        grid-area: actions;
    }

    #create-page.active-page .create-cost-dock {
        position: relative;
        bottom: auto;
    }

    #create-page.active-page #create-sidebar {
        grid-column: 1;
        grid-row: 2;
        width: auto;
        min-height: 540px;
    }

    #create-page.active-page .workspace-canvas {
        grid-column: 2;
        grid-row: 2;
        min-height: 540px;
    }

    #create-page.active-page .create-assist-panel {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        overflow: visible;
        padding: 0;
    }

    #create-page.active-page .create-assist-panel .glass-card {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    body.create-page-active {
        background: var(--studio-bg);
    }

    body.create-page-active #main-header {
        height: 48px;
        min-height: 48px;
        margin: 8px 10px 0;
        padding: 0 10px;
    }

    body.create-page-active #main-header .logo-area {
        max-width: calc(100vw - 118px);
    }

    body.create-page-active #main-header #site-title-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.create-page-active #main-container {
        padding: 8px 10px 18px;
    }

    #create-page.active-page {
        gap: 10px;
    }

    #create-page.active-page .create-studio-intro {
        min-height: 0;
        display: block;
        padding: 15px 14px;
        border-radius: 13px;
    }

    #create-page.active-page .create-studio-intro-main {
        align-items: flex-start;
        gap: 9px;
    }

    #create-page.active-page .create-studio-intro h1 {
        overflow: visible;
        font-size: 21px;
        line-height: 1.2;
        text-overflow: clip;
        white-space: normal;
    }

    #create-page.active-page .create-studio-intro p {
        min-width: 0;
        max-width: none;
        margin-top: 9px;
        font-size: 12px;
        text-align: left;
    }

    #create-page.active-page .create-studio-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "tabs tabs";
        gap: 7px 8px;
        padding: 7px;
    }

    #create-page.active-page .create-studio-brand {
        grid-area: brand;
    }

    #create-page.active-page .create-mode-tabs {
        grid-area: tabs;
        height: 38px;
    }

    #create-page.active-page .create-studio-actions {
        grid-area: actions;
        justify-content: flex-end;
    }

    #create-page.active-page .create-mode-tabs button,
    #create-page.active-page .create-studio-actions button {
        height: 30px;
        padding: 0 10px;
    }

    #create-page.active-page #create-sidebar,
    #create-page.active-page .create-assist-panel {
        gap: 10px;
    }

    #create-page.active-page .create-parameter-scroll {
        gap: 10px;
    }

    #create-page.active-page .bento-card {
        padding: 12px;
    }

    #create-page.active-page .workspace-canvas {
        min-height: min(68vh, 580px);
    }

    #create-page.active-page .workspace-canvas-header {
        min-height: 46px;
        padding: 10px 12px;
    }

    #create-page.active-page .mobile-output-grid {
        background: var(--studio-surface-soft);
    }

    #create-page.active-page .create-cost-dock {
        bottom: calc(66px + env(safe-area-inset-bottom));
        border-color: var(--studio-line);
    }
}

@media (max-width: 520px) {
    body.create-page-active #main-header {
        margin-inline: 8px;
    }

    body.create-page-active #main-header .logo-svg {
        width: 28px;
        height: 28px;
    }

    body.create-page-active #main-header .header-actions {
        gap: 5px;
    }

    body.create-page-active #main-header .icon-btn {
        width: 30px;
        height: 30px;
    }

    body.create-page-active #main-container {
        padding-inline: 8px;
    }

    #create-page.active-page .create-studio-brand em {
        display: none;
    }

    #create-page.active-page .create-studio-brand strong {
        font-size: 13px;
    }

    #create-page.active-page .create-studio-mark {
        width: 32px;
        height: 32px;
    }

    #create-page.active-page .create-studio-actions span {
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #create-page.active-page .ratio-preset-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    #create-page.active-page .ratio-btn {
        min-height: 48px;
    }

    #create-page.active-page .creative-tool-grid {
        grid-template-columns: 1fr 1fr;
    }

    #create-page.active-page .canvas-empty-icon {
        width: 64px;
        height: 64px;
    }

    body.create-page-active .frontend-mobile-nav {
        padding-left: max(6px, env(safe-area-inset-left));
        padding-right: max(6px, env(safe-area-inset-right));
    }

    body.create-page-active .frontend-mobile-nav-item {
        min-width: 44px;
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #create-page.active-page *,
    #create-page.active-page *::before,
    #create-page.active-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
