:root {
    --workspace-viewport-block: 100vh;
    --workspace-header-offset: 88px;
    --workspace-mobile-stage-top: 38px;
    --workspace-bg: #17171b;
    --workspace-panel: rgba(31, 31, 36, 0.98);
    --workspace-panel-strong: rgba(36, 36, 42, 0.99);
    --workspace-surface-2: #2a2a30;
    --workspace-surface-3: #202025;
    --workspace-soft: rgba(255, 255, 255, 0.06);
    --workspace-border: rgba(255, 255, 255, 0.12);
    --workspace-border-strong: rgba(239, 251, 83, 0.34);
    --workspace-text: rgba(255, 255, 255, 0.96);
    --workspace-muted: rgba(226, 226, 231, 0.72);
    --workspace-subtle: rgba(226, 226, 231, 0.48);
    --workspace-accent: var(--theme);
    --workspace-accent-strong: #f5ff9f;
    --workspace-danger: #ff8f79;
    --workspace-shadow: 0 24px 56px rgba(0, 0, 0, 0.24);
}

@supports (height: 100dvh) {
    :root {
        --workspace-viewport-block: 100dvh;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.workspace-body {
    min-height: var(--workspace-viewport-block);
    height: var(--workspace-viewport-block);
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(239, 251, 83, 0.04), transparent 20%),
        linear-gradient(180deg, #18181c 0%, #1c1c21 100%);
}

.workspace-body #back-top {
    display: none !important;
}

.workspace-body .mfp-bg {
    z-index: 1400;
}

.workspace-body .mfp-wrap {
    z-index: 1410;
}

.workspace-main-shell {
    box-sizing: border-box;
    min-height: var(--workspace-viewport-block);
    height: var(--workspace-viewport-block);
    padding-top: var(--workspace-header-offset);
}

.workspace-app,
.workspace-app button,
.workspace-app input,
.workspace-app textarea {
    font-family: "Satoshi Variable", sans-serif;
}

.workspace-app {
    display: grid;
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    position: relative;
    isolation: isolate;
    min-height: 100%;
    height: 100%;
}

.workspace-sidebar,
.workspace-main {
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.workspace-sidebar {
    position: relative;
    background: transparent;
}

.workspace-sidebar::after {
    display: none;
}

.workspace-sidebar-inner,
.workspace-main {
    position: relative;
    z-index: 1;
}

.workspace-sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    height: 100%;
    padding: 18px 20px 20px;
    overflow: hidden;
}

.workspace-stage-meta strong,
.workspace-history-head h2,
.workspace-modal-head h3 {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0;
}

.workspace-panel,
.workspace-stage,
.workspace-history,
.workspace-modal {
    border: 1px solid var(--workspace-border);
    background:
        linear-gradient(180deg, rgba(35, 35, 40, 0.98), rgba(29, 29, 34, 0.99));
    box-shadow: var(--workspace-shadow);
}

.workspace-panel,
.workspace-stage,
.workspace-history {
    border-radius: 20px;
}

.workspace-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin-top: 0;
}

.workspace-panel:has(.workspace-aspect-ratio-field .tool-dropdown.is-open),
.workspace-panel:has(.workspace-aspect-ratio-field .tool-dropdown.is-open) .workspace-panel-body {
    overflow: visible;
}

.workspace-panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 18px 0;
}

.workspace-panel-body::-webkit-scrollbar {
    width: 8px;
}

.workspace-panel-body::-webkit-scrollbar-thumb {
    background: rgba(220, 244, 103, 0.18);
    border-radius: 999px;
}

.workspace-panel-headline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.workspace-panel-headline h2 {
    margin: 0;
    color: var(--workspace-text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.workspace-panel-headline p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: 14px;
    line-height: 1.55;
}

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

.workspace-field label {
    color: var(--workspace-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.workspace-generation-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 5px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(14, 16, 18, 0.42);
}

.workspace-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.workspace-mode-tab i {
    font-size: 17px;
}

.workspace-mode-tab:hover:not(:disabled):not(.active) {
    background: rgba(255, 255, 255, 0.04);
    color: var(--workspace-accent);
}

.workspace-mode-tab.active {
    background: var(--workspace-accent);
    color: #11150f;
    box-shadow: 0 0 0 1px rgba(239, 251, 83, 0.28), 0 10px 22px rgba(239, 251, 83, 0.14);
}

.workspace-mode-tab.active i {
    color: inherit;
}

.workspace-mode-tab:disabled {
    opacity: 0.56;
    cursor: default;
}

.workspace-panel .image-upload-area {
    min-height: 164px;
    border-radius: 14px;
}

.workspace-panel .image-upload-area.compact {
    min-height: 164px;
    border-radius: 14px;
}

.workspace-panel .upload-placeholder {
    padding: 20px 15px;
}

.workspace-panel .upload-placeholder i {
    font-size: 2.5rem;
}


.workspace-panel .upload-preview {
    min-height: 164px;
    padding: 10px;
}

.workspace-panel .upload-preview img,
.workspace-panel .image-upload-area.compact .upload-preview img {
    max-height: 110px;
}

.workspace-aspect-ratio-field {
    gap: 12px;
    position: relative;
    z-index: 80;
    isolation: isolate;
}

.workspace-aspect-ratio-field .aspect-ratio-dropdown-wrap {
    display: block;
    margin-bottom: 0;
    position: relative;
    z-index: 80;
}

.workspace-aspect-ratio-field .tool-dropdown {
    position: relative;
    z-index: 80;
}

.workspace-aspect-ratio-field .tool-dropdown-menu {
    top: auto;
    bottom: calc(100% + 8px);
    z-index: 120;
    max-height: min(320px, calc(var(--workspace-viewport-block) - 220px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.workspace-aspect-ratio-selector {
    display: none;
}

.workspace-panel .aspect-ratio-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.workspace-panel .aspect-ratio-option input[type="radio"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.workspace-panel .aspect-ratio-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 76px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid rgba(207, 208, 212, 0.18);
    background: #222226;
    transition: 0.2s ease;
}

.workspace-panel .aspect-ratio-option:hover .aspect-ratio-button {
    border-color: rgba(239, 251, 83, 0.28);
    background: rgba(239, 251, 83, 0.08);
}

.workspace-panel .aspect-ratio-option.active .aspect-ratio-button {
    border-color: rgba(239, 251, 83, 0.34);
    background: var(--workspace-accent);
    box-shadow: 0 8px 18px rgba(239, 251, 83, 0.16);
}

.aspect-ratio-auto-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px dashed rgba(239, 251, 83, 0.35);
    background: rgba(239, 251, 83, 0.08);
}

.aspect-ratio-auto-note-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #effb53;
    background: rgba(239, 251, 83, 0.14);
    flex-shrink: 0;
    font-size: 0.75rem;
}

.aspect-ratio-auto-note-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.aspect-ratio-auto-note-content strong {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(239, 251, 83, 0.95);
    font-weight: 700;
}

.aspect-ratio-auto-note-content small {
    font-size: 0.78rem;
    color: rgba(205, 205, 205, 0.86);
}

.workspace-panel .aspect-label {
    color: var(--workspace-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.workspace-panel .aspect-ratio-option.active .aspect-label {
    color: #11150f;
}

.workspace-panel .aspect-ratio-option.active .aspect-shape {
    background: rgba(17, 21, 15, 0.88);
    border-color: rgba(17, 21, 15, 0.88);
}

.workspace-upload-dropzone {
    position: relative;
    width: 100%;
    min-height: 166px;
    padding: 0;
    border-radius: 14px;
    border: 2px dashed rgba(239, 251, 83, 0.3);
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-upload-dropzone--compact {
    min-height: 166px;
}

.workspace-upload-dropzone:hover {
    border-color: rgba(239, 251, 83, 0.5);
    background: rgba(239, 251, 83, 0.05);
}

.workspace-upload-dropzone.is-dragover {
    border-color: #effb53;
    background: rgba(239, 251, 83, 0.08);
}

.workspace-upload-placeholder {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 18px;
    text-align: center;
}

.workspace-upload-placeholder .upload-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.workspace-upload-placeholder .upload-text span {
    color: var(--workspace-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.workspace-upload-placeholder i {
    color: var(--workspace-accent);
    font-size: 2.5rem;
}

.workspace-upload-placeholder strong,
.workspace-upload-preview-copy strong,
.workspace-history-copy strong {
    color: var(--workspace-text);
    font-size: 1rem;
}

.workspace-upload-preview-copy span,
.workspace-upload-placeholder span,
.workspace-history-copy span {
    color: var(--workspace-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.workspace-upload-placeholder small {
    display: block;
    font-size: 0.8rem;
    color: rgba(205, 205, 205, 0.7);
    font-weight: 400;
    line-height: 1.4;
}

.workspace-upload-placeholder small.max-size {
    font-size: 0.75rem;
    color: rgba(205, 205, 205, 0.5);
}

.workspace-upload-preview {
    position: relative;
    height: 100%;
    width: 100%;
    min-height: 166px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    overflow: hidden;
}

.workspace-upload-preview-media {
    width: 104px;
    height: 104px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.workspace-upload-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.workspace-upload-preview-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.workspace-upload-preview-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workspace-upload-preview .remove-image-btn {
    top: 10px;
    right: 10px;
}

.workspace-inline-error {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 142, 122, 0.26);
    background: rgba(255, 142, 122, 0.08);
    color: #ffd6ce;
    font-size: 13px;
    line-height: 1.55;
}

.workspace-stage-inline-error {
    margin: 0 0 16px;
}

.workspace-modal > .workspace-inline-error {
    margin-bottom: 16px;
}

.workspace-field textarea,
.workspace-overlay-prompt input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 13, 15, 0.82);
    color: var(--workspace-text);
    font-size: 15px;
    line-height: 1.55;
}

.workspace-field textarea {
    min-height: 80px;
    padding: 14px 16px;
    resize: vertical;
}

.workspace-field textarea:focus,
.workspace-overlay-prompt input:focus {
    outline: none;
    border-color: rgba(220, 244, 103, 0.44);
    box-shadow: 0 0 0 3px rgba(220, 244, 103, 0.1);
}

.workspace-choice-grid,
.workspace-toggle-row {
    display: grid;
    gap: 10px;
}

.workspace-choice-grid--models {
    grid-template-columns: 1fr;
}

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

.workspace-choice-btn,
.workspace-toggle-btn,
.workspace-action-chip,
.workspace-history-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--workspace-surface-2);
    color: var(--workspace-text);
    transition: 0.2s ease;
}

.workspace-choice-btn,
.workspace-toggle-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    padding: 12px 13px;
    border-radius: 16px;
    text-align: left;
}

.workspace-choice-btn:hover,
.workspace-choice-btn.is-active,
.workspace-toggle-btn:hover,
.workspace-toggle-btn.is-active {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
}

.workspace-choice-btn.is-active,
.workspace-toggle-btn.is-active {
    border-color: rgba(239, 251, 83, 0.28);
    background: rgba(239, 251, 83, 0.08);
}

.workspace-choice-btn strong,
.workspace-toggle-btn strong {
    color: var(--workspace-text);
    font-size: 13px;
}

.workspace-choice-btn span,
.workspace-toggle-btn span {
    color: var(--workspace-muted);
    font-size: 12px;
    line-height: 1.45;
}

.workspace-primary-btn,
.workspace-ghost-btn,
.workspace-action-chip,
.workspace-history-card {
    appearance: none;
    cursor: pointer;
}

.workspace-primary-btn,
.workspace-ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: 0.2s ease;
}

.workspace-primary-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    min-height: 54px;
    padding: 0 18px;
    border-radius: 30px;
    justify-content: space-between;
    background: var(--workspace-surface-2);
    color: var(--workspace-accent);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: none;
}

.workspace-primary-btn:hover:not(:disabled) {
    background: var(--workspace-accent);
    color: var(--header);
}

.workspace-button-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(239, 251, 83, 0.08);
    color: inherit;
    font-size: 12px;
    font-weight: 700;
}

.workspace-button-pill--light {
    background: rgba(255, 255, 255, 0.08);
}

.workspace-submit-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 56px;
    padding: 0 14px 0 22px;
    border: 1px solid rgba(207, 208, 212, 0.2);
    border-radius: 10px;
    background: var(--workspace-accent);
    color: var(--header);
    cursor: pointer;
    overflow: hidden;
    box-shadow: none;
    transition: 0.5s ease-in-out;
    z-index: 1;
}

.workspace-submit-action::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #1D1D21;
    clip-path: circle(0% at 50% 50%);
    transition: all cubic-bezier(0, 0.96, 0.58, 1.1) 0.8s;
    z-index: 0;
}

.workspace-submit-action:hover:not(:disabled) {
    color: var(--white);
}

.workspace-submit-action:hover:not(:disabled)::after {
    clip-path: circle(100% at 50% 50%);
    transition: all cubic-bezier(0, 0.96, 0.58, 1.1) 4s;
}

.workspace-submit-action:disabled {
    opacity: 0.56;
    cursor: default;
    transform: none;
}

.workspace-submit-sticky {
    flex-shrink: 0;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.workspace-submit-sticky .workspace-submit-action {
    display: inline-flex;
}

.workspace-submit-action-copy {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.workspace-submit-action .workspace-button-pill {
    position: relative;
    z-index: 1;
    min-height: 36px;
    background: rgba(17, 21, 15, 0.12);
    color: inherit;
}

.workspace-ghost-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--workspace-surface-2);
    color: var(--workspace-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.workspace-ghost-btn:hover {
    color: var(--workspace-text);
    border-color: rgba(220, 244, 103, 0.22);
    background: rgba(220, 244, 103, 0.09);
}

.workspace-modal-close:hover,
.workspace-modal-close:focus {
    color: #fff;
    background: transparent;
}

.workspace-download-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 30px;
    border: 1px solid rgba(207, 208, 212, 0.2);
    background: #1D1D21;
    color: var(--workspace-accent);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    overflow: hidden;
    box-shadow: none;
    transition: 0.5s ease-in-out;
    z-index: 1;
}

.workspace-download-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--theme);
    clip-path: circle(0% at 50% 50%);
    transition: all cubic-bezier(0, 0.96, 0.58, 1.1) 0.8s;
    z-index: 0;
}

.workspace-download-btn i,
.workspace-download-btn span {
    position: relative;
    z-index: 1;
}

.workspace-download-btn:hover:not(:disabled) {
    color: var(--header);
}

.workspace-download-btn:hover:not(:disabled)::after {
    clip-path: circle(100% at 50% 50%);
    transition: all cubic-bezier(0, 0.96, 0.58, 1.1) 4s;
}

.workspace-primary-btn:disabled,
.workspace-ghost-btn:disabled,
.workspace-download-btn:disabled,
.workspace-action-chip:disabled {
    opacity: 0.56;
    cursor: default;
    transform: none;
}

.workspace-main {
    height: 100%;
    padding: 18px 20px 20px 0;
}

.workspace-stage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
}

.workspace-stage {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    padding: 18px;
}

.workspace-stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.workspace-stage-close {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(207, 208, 212, 0.18);
    background: #222226;
    color: var(--workspace-text);
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

.workspace-stage-close:hover {
    color: var(--workspace-text);
    border-color: rgba(220, 244, 103, 0.22);
    background: rgba(220, 244, 103, 0.09);
}

.workspace-stage-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.workspace-stage-meta strong {
    color: var(--workspace-text);
    font-size: 28px;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.workspace-stage-meta span:last-child {
    color: var(--workspace-muted);
    font-size: 14px;
    line-height: 1.4;
}

.workspace-canvas-board {
    position: relative;
    flex: 1 1 auto;
    min-height: clamp(320px, 50vh, 680px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(43, 43, 49, 0.98), rgba(31, 31, 36, 0.99));
}

.workspace-canvas-board.is-empty {
    cursor: pointer;
    border-color: rgba(239, 251, 83, 0.18);
}

.workspace-canvas-image-shell,
.workspace-canvas-empty,
.workspace-canvas-loading,
.workspace-canvas-failed {
    position: absolute;
    inset: 0;
}

.workspace-canvas-empty {
    z-index: 1;
    display: flex;
    padding: 22px;
    pointer-events: none;
}

.workspace-canvas-dropzone {
    width: 100%;
    min-height: 100%;
    border-width: 2px;
    border-color: rgba(239, 251, 83, 0.24);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.16);
    pointer-events: none;
}

.workspace-canvas-dropzone .upload-placeholder {
    max-width: 460px;
    margin: 0 auto;
    pointer-events: none;
}

.workspace-canvas-dropzone .upload-placeholder i {
    font-size: 3rem;
    margin-bottom: 14px;
}

.workspace-canvas-dropzone .upload-placeholder span {
    font-size: clamp(0.85rem, 1.7vw, 1rem);
    line-height: 1.3;
    white-space: nowrap;
}

.workspace-canvas-dropzone .upload-placeholder small {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.86rem;
    line-height: 1.55;
}

.workspace-canvas-dropzone .workspace-canvas-upload-note {
    max-width: 360px;
    margin-top: 2px;
    margin-bottom: 8px;
    color: rgba(221, 224, 234, 0.74);
}

.workspace-canvas-board.is-empty:hover .workspace-canvas-dropzone,
.workspace-canvas-board.is-empty:focus-visible .workspace-canvas-dropzone {
    border-color: rgba(239, 251, 83, 0.38);
    background: rgba(239, 251, 83, 0.04);
}

.workspace-canvas-board.is-empty.is-dragover .workspace-canvas-dropzone {
    border-color: #effb53;
    background: rgba(239, 251, 83, 0.08);
}

.workspace-canvas-image-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
}

.workspace-canvas-image-shell img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 30px 64px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.04);
    cursor: zoom-in;
}

.workspace-canvas-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(5, 8, 9, 0.72);
    backdrop-filter: blur(10px);
}

.workspace-canvas-loading-spinner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid rgba(220, 244, 103, 0.16);
    border-top-color: var(--workspace-accent);
    animation: workspace-spin 0.9s linear infinite;
}

.workspace-canvas-loading strong {
    color: var(--workspace-text);
    font-size: 18px;
}

.workspace-canvas-loading span {
    display: block;
    width: min(100%, 420px);
    max-width: 420px;
    color: var(--workspace-muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    overflow-wrap: anywhere;
}

.workspace-canvas-failed {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    z-index: 2;
    background:
        radial-gradient(circle at center, rgba(255, 122, 104, 0.1), transparent 32%),
        rgba(5, 8, 9, 0.78);
    backdrop-filter: blur(10px);
    text-align: center;
    overflow: hidden;
}

.workspace-canvas-failed-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.workspace-canvas-failed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 143, 121, 0.12);
    color: var(--workspace-danger);
    box-shadow: inset 0 0 0 1px rgba(255, 143, 121, 0.16);
}

.workspace-canvas-failed-icon i {
    font-size: 28px;
}

.workspace-canvas-failed strong {
    color: var(--workspace-text);
    font-size: 20px;
    line-height: 1.15;
}

.workspace-canvas-failed span {
    display: block;
    width: min(100%, 520px);
    color: var(--workspace-muted);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

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

.workspace-overlay-prompt {
    position: absolute;
    top: 22px;
    left: 22px;
    right: 22px;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(32, 32, 37, 0.94);
    box-shadow: none;
}

.workspace-overlay-prompt input {
    min-height: 48px;
    padding: 0 16px;
}

.workspace-overlay-prompt button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 16px;
    background: var(--workspace-accent);
    color: #11150f;
    font-weight: 800;
    white-space: nowrap;
}

.workspace-overlay-prompt button .workspace-button-pill {
    min-height: 34px;
    background: rgba(17, 21, 15, 0.12);
    color: inherit;
}

.workspace-quick-edit-btn-copy,
#workspace-action-submit-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.workspace-action-strip {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.workspace-action-strip-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.workspace-action-strip-scroll::-webkit-scrollbar,
.workspace-history-list::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.workspace-action-strip-scroll::-webkit-scrollbar-thumb,
.workspace-history-list::-webkit-scrollbar-thumb {
    background: rgba(220, 244, 103, 0.18);
    border-radius: 999px;
}

.workspace-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}

.workspace-action-chip:hover:not(:disabled),
.workspace-action-chip:focus-visible:not(:disabled) {
    color: var(--workspace-text);
    border-color: rgba(220, 244, 103, 0.22);
    background: rgba(220, 244, 103, 0.09);
}

.workspace-action-chip.is-active {
    border-color: rgba(239, 251, 83, 0.3);
    background: rgba(239, 251, 83, 0.08);
    color: var(--workspace-accent);
}

.workspace-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 18px;
}

.workspace-history-head h2 {
    margin: 0;
    color: var(--workspace-text);
    font-size: 24px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-transform: none;
}

.workspace-history-head p {
    margin: 4px 0 0;
    color: var(--workspace-muted);
    font-size: 13px;
    line-height: 1.5;
}

.workspace-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.workspace-history-card {
    appearance: none;
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    padding: 0;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    overflow: hidden;
    text-align: left;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.workspace-history-card.is-active {
    border-color: #effb53;
    background: rgba(239, 251, 83, 0.06);
    box-shadow:
        inset 0 0 0 1px rgba(239, 251, 83, 0.34),
        0 0 0 1px rgba(239, 251, 83, 0.14),
        0 12px 24px rgba(0, 0, 0, 0.18);
}

.workspace-history-card.is-active .workspace-history-thumb {
    box-shadow: inset 0 0 0 2px rgba(239, 251, 83, 0.74);
}

.workspace-history-card.is-active .workspace-history-badge {
    border-color: rgba(239, 251, 83, 0.48);
    background: var(--workspace-accent);
    color: #11150f;
}

.workspace-history-card.is-active .workspace-history-foot {
    background: linear-gradient(to top, rgba(8, 10, 8, 0.96) 0%, rgba(8, 10, 8, 0.62) 56%, transparent 100%);
}

.workspace-history-card.is-active .workspace-history-copy strong {
    color: #ffffff;
}

.workspace-history-card.is-active .workspace-history-copy span {
    color: rgba(255, 255, 255, 0.82);
}

.workspace-history-card.is-pending {
    background: rgba(239, 251, 83, 0.05);
    box-shadow: inset 0 0 0 1px rgba(239, 251, 83, 0.24);
}

.workspace-history-card.is-active.is-pending {
    box-shadow:
        inset 0 0 0 1px rgba(239, 251, 83, 0.46),
        0 0 0 1px rgba(239, 251, 83, 0.18),
        0 12px 24px rgba(0, 0, 0, 0.18);
}

.workspace-history-card.is-pending .workspace-history-badge {
    border-color: rgba(239, 251, 83, 0.22);
    background: rgba(239, 251, 83, 0.14);
    color: var(--workspace-accent);
}

.workspace-history-card.is-pending .workspace-history-thumb img {
    opacity: 0.38;
    filter: saturate(0.7) brightness(0.74);
    transform: scale(1.02);
}

.workspace-history-card.is-disabled {
    opacity: 0.56;
    cursor: default;
    transform: none;
}

.workspace-history-card:focus-visible {
    outline: 2px solid #effb53;
    outline-offset: 2px;
}

.workspace-history-card:hover:not(.is-disabled) {
    border-color: #effb53;
    background: rgba(255, 255, 255, 0.03);
}

.workspace-history-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.workspace-history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.workspace-history-pending-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 14px 56px;
    color: #fff;
    background:
        radial-gradient(circle at center, rgba(239, 251, 83, 0.14), transparent 30%),
        linear-gradient(to top, rgba(7, 8, 10, 0.68) 0%, rgba(7, 8, 10, 0.32) 58%, rgba(7, 8, 10, 0.22) 100%);
    pointer-events: none;
}

.workspace-history-status-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.workspace-history-status-overlay .workspace-history-placeholder {
    background:
        radial-gradient(circle at center, rgba(255, 122, 104, 0.14), transparent 30%),
        linear-gradient(to top, rgba(7, 8, 10, 0.74) 0%, rgba(7, 8, 10, 0.44) 58%, rgba(7, 8, 10, 0.28) 100%);
}

.workspace-history-pending-overlay .workspace-canvas-loading-spinner {
    width: 34px;
    height: 34px;
    border-width: 3px;
}

.workspace-history-pending-overlay span:last-child {
    max-width: 100%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-history-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--workspace-muted);
    background:
        radial-gradient(circle at center, rgba(220, 244, 103, 0.08), transparent 28%),
        rgba(255, 255, 255, 0.03);
}

.workspace-history-placeholder.is-generating,
.workspace-history-placeholder.is-processing,
.workspace-history-placeholder.is-queued {
    color: var(--workspace-accent);
    background:
        radial-gradient(circle at center, rgba(239, 251, 83, 0.18), transparent 38%),
        linear-gradient(180deg, rgba(239, 251, 83, 0.08), rgba(255, 255, 255, 0.03));
}

.workspace-history-placeholder .workspace-canvas-loading-spinner {
    width: 34px;
    height: 34px;
    border-width: 3px;
}

.workspace-history-placeholder i {
    font-size: 22px;
}

.workspace-history-placeholder.is-generating i,
.workspace-history-placeholder.is-processing i,
.workspace-history-placeholder.is-queued i {
    color: var(--workspace-accent);
}

.workspace-history-placeholder span,
.workspace-history-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.workspace-history-placeholder span {
    max-width: calc(100% - 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-history-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(26, 26, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.workspace-history-foot {
    position: absolute;
    inset: auto 0 0;
    padding: 54px 14px 14px;
    background: linear-gradient(to top, rgba(7, 8, 10, 0.96) 0%, rgba(7, 8, 10, 0.68) 52%, transparent 100%);
}

.workspace-history-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workspace-history-copy strong {
    font-size: 15px;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-history-copy span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.35;
}

.workspace-stage-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--workspace-muted);
    font-size: 12px;
    line-height: 1.35;
}

.workspace-stage-meta-text,
.workspace-stage-meta-separator {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.workspace-stage-meta-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #effb53;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
}

.workspace-stage-meta-link:hover {
    color: #f5ff9f;
}

.workspace-stage-meta-link:focus-visible {
    outline: 2px solid rgba(239, 251, 83, 0.9);
    outline-offset: 2px;
    border-radius: 4px;
}

.workspace-history-empty {
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    padding: 18px;
    color: var(--workspace-muted);
    font-size: 13px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.02);
}

.workspace-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 7, 8, 0.74);
    backdrop-filter: blur(10px);
}

.info-modal-backdrop[hidden] {
    display: none;
}

.info-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 7, 8, 0.74);
    backdrop-filter: blur(10px);
}

.info-modal {
    position: relative;
    width: min(100%, 420px);
    padding: 24px;
    border: 1px solid var(--workspace-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(35, 35, 40, 0.99), rgba(24, 24, 29, 0.99));
    box-shadow: var(--workspace-shadow);
}

.info-modal-title {
    margin: 0 28px 16px 0;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.34);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.info-modal-close:hover {
    color: #fff;
}

.info-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.info-row.image-row {
    align-items: flex-start;
}

.info-row-label {
    width: 110px;
    flex-shrink: 0;
    color: var(--workspace-subtle);
}

.info-row-value {
    color: var(--workspace-text);
    word-break: break-word;
}

.info-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: capitalize;
}

.info-status-badge.completed {
    background: rgba(76, 175, 80, 0.15);
    color: #66bb6a;
}

.info-status-badge.failed,
.info-status-badge.unprocessable {
    background: rgba(229, 57, 53, 0.15);
    color: #ef5350;
}

.info-status-badge.pending,
.info-status-badge.processing,
.info-status-badge.generating {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
}

.info-modal-image-link {
    display: inline-block;
    width: 120px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

.info-modal-image-link:hover {
    border-color: rgba(239, 251, 83, 0.65);
}

.info-modal-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.03);
}

.workspace-modal {
    position: relative;
    width: min(560px, 100%);
    padding: 30px 28px 26px;
    border-radius: 20px;
    background: #1a1a1e;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.workspace-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.workspace-modal-head {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

.workspace-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #effb53 0%, #c5d93d 100%);
    color: #151518;
    font-size: 24px;
}

.workspace-modal-head h3 {
    margin: 0 0 4px;
    color: var(--workspace-text);
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: none;
}

.workspace-modal-head p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: 14px;
    line-height: 1.5;
}

.workspace-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.workspace-modal .workspace-field {
    gap: 10px;
}

.workspace-modal .workspace-field + .workspace-field {
    margin-top: 8px;
}

.workspace-modal .workspace-toggle-row {
    gap: 8px;
    padding: 5px;
    border-radius: 14px;
    border: 1px solid rgba(207, 208, 212, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.workspace-toggle-btn {
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #cdcdcd;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.workspace-modal .workspace-toggle-btn:hover:not(.is-active) {
    background: rgba(239, 251, 83, 0.08);
    color: var(--workspace-accent);
}

.workspace-modal .workspace-toggle-btn.is-active {
    background: var(--theme);
    color: var(--header);
    box-shadow: 0 4px 18px rgba(239, 251, 83, 0.24);
}

.workspace-modal .workspace-primary-btn {
    min-height: 50px;
    padding: 0 18px;
    border-color: rgba(239, 251, 83, 0.24);
    background: var(--workspace-accent);
    color: #11150f;
}

.workspace-modal .workspace-primary-btn:hover:not(:disabled) {
    background: var(--workspace-accent-strong);
    color: #11150f;
}

.workspace-modal .workspace-primary-btn .workspace-button-pill {
    background: rgba(17, 21, 15, 0.12);
}

.workspace-modal .workspace-ghost-btn {
    min-height: 50px;
    padding: 0 18px;
}

#workspace-action-reference-replace-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 1399.98px) {
    .workspace-stage-layout {
        grid-template-columns: minmax(0, 1fr) 230px;
    }
}

@media (max-width: 1199.98px) {
    :root {
        --workspace-header-offset: 80px;
    }

    .workspace-body {
        min-height: auto;
        height: auto;
        overflow: auto;
    }

    .workspace-main-shell,
    .workspace-app,
    .workspace-sidebar,
    .workspace-main {
        min-height: auto;
        height: auto;
    }

    .workspace-main-shell {
        padding-top: var(--workspace-header-offset);
    }

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

    .workspace-sidebar {
        order: 1;
    }

    .workspace-sidebar-inner {
        height: auto;
        padding: 20px 12px 0;
        overflow: visible;
    }

    .workspace-main {
        order: 2;
        padding: 20px 12px;
    }

    .workspace-stage-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .workspace-history {
        min-height: 0;
        min-width: 0;
    }

    .workspace-history-list {
        display: flex;
        flex-direction: row;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }

    .workspace-history-card {
        flex: 0 0 180px;
    }

    .workspace-panel {
        overflow: visible;
    }

    .workspace-panel-body {
        overflow: visible;
        padding: 16px;
    }

    .workspace-submit-sticky {
        position: static;
        margin-top: 0;
        padding: 0 16px 16px;
        border-top: 0;
        background: transparent;
    }
}

@media (min-width: 1200px) {
    .workspace-submit-sticky {
        position: relative;
        background: linear-gradient(180deg, rgba(29, 29, 34, 0) 0%, rgba(29, 29, 34, 0.88) 22%, rgba(29, 29, 34, 0.98) 100%);
    }
}

@media (max-width: 767.98px) {
    :root {
        --workspace-header-offset: 76px;
    }

    .workspace-main-shell {
        padding-top: var(--workspace-header-offset);
    }

    .workspace-sidebar-inner {
        padding: 12px 12px 0;
    }

    .workspace-sidebar {
        position: relative;
        z-index: 4;
    }

    .workspace-main {
        position: relative;
        z-index: 1;
        padding: 0 12px 12px;
    }

    .workspace-aspect-ratio-field {
        position: relative;
        z-index: 120;
    }

    .workspace-aspect-ratio-field .tool-dropdown {
        z-index: 120;
    }

    .workspace-aspect-ratio-field .tool-dropdown-menu {
        top: auto;
        bottom: calc(100% + 8px);
        z-index: 140;
        transform: translateY(4px);
    }

    .workspace-aspect-ratio-field .tool-dropdown.is-open {
        margin-bottom: 0;
    }

    .workspace-aspect-ratio-field .tool-dropdown.is-open .tool-dropdown-menu {
        transform: translateY(0);
    }

    .workspace-panel,
    .workspace-history {
        border-radius: 18px;
    }

    .workspace-panel {
        position: relative;
        z-index: 3;
    }

    .workspace-history {
        margin-top: 14px;
    }

    .workspace-body.workspace-stage-open {
        overflow: hidden;
    }

    .workspace-body.workspace-stage-open .workspace-sidebar {
        z-index: 1;
        pointer-events: none;
    }

    .workspace-body.workspace-stage-open .workspace-main {
        z-index: 6;
    }

    .workspace-stage {
        display: none;
        gap: 12px;
    }

    .workspace-stage.is-mobile-overlay {
        position: fixed;
        top: var(--workspace-mobile-stage-top);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1100;
        display: flex;
        min-height: 0;
        overflow: hidden;
        padding:
            calc(8px + env(safe-area-inset-top, 0px))
            8px
            calc(8px + env(safe-area-inset-bottom, 0px));
        border: 0;
        border-radius: 0;
        background:
            linear-gradient(180deg, rgba(21, 21, 24, 0.99) 0%, rgba(26, 26, 30, 0.99) 100%);
    }

    .workspace-stage.is-mobile-overlay .workspace-stage-close {
        display: inline-flex;
    }

    .workspace-stage.is-mobile-overlay .workspace-stage-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .workspace-stage.is-mobile-overlay .workspace-stage-meta {
        flex: 1 1 100%;
        order: 3;
        gap: 2px;
    }

    .workspace-stage.is-mobile-overlay .workspace-download-btn {
        margin-left: auto;
    }

    .workspace-stage.is-mobile-overlay .workspace-canvas-board {
        flex: 1 1 auto;
        min-height: 0;
    }

    .workspace-canvas-board {
        min-height: clamp(300px, 50vh, 480px);
    }

    .workspace-overlay-prompt {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .workspace-canvas-image-shell {
        padding: 22px 16px;
    }

    .workspace-stage.is-mobile-overlay .workspace-canvas-image-shell {
        padding: 12px;
    }

    .workspace-stage.is-mobile-overlay .workspace-canvas-image-shell img {
        max-height: 100%;
        border-radius: 14px;
    }

    .workspace-stage.is-mobile-overlay .workspace-action-strip {
        gap: 8px;
    }

    .workspace-stage.is-mobile-overlay .workspace-action-strip-scroll {
        gap: 8px;
        padding-bottom: 0;
    }

    .workspace-stage-meta strong,
    .workspace-history-head h2,
    .workspace-modal-head h3 {
        font-size: 24px;
    }

    .workspace-stage.is-mobile-overlay .workspace-stage-meta strong {
        font-size: 20px;
        line-height: 1.04;
    }

    .workspace-stage.is-mobile-overlay .workspace-stage-meta span:last-child {
        font-size: 13px;
        line-height: 1.3;
    }

    .workspace-stage.is-mobile-overlay .workspace-stage-close,
    .workspace-stage.is-mobile-overlay .workspace-download-btn {
        min-height: 40px;
        padding: 0 14px;
    }

    .workspace-history-card {
        flex-basis: 150px;
    }

    .workspace-submit-action {
        min-height: 54px;
        padding: 0 10px 0 16px;
    }

    .workspace-action-chip {
        min-height: 44px;
        padding: 0 14px;
        font-size: 14px;
    }

    .workspace-modal {
        padding: 18px;
    }

    .workspace-modal-actions {
        flex-direction: column-reverse;
    }

    .workspace-modal-actions .workspace-primary-btn,
    .workspace-modal-actions .workspace-ghost-btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    :root {
        --workspace-header-offset: 68px;
    }
}
