/* ===== Root Variables ===== */
:root {
    --bg: #05070c;
    --bg-2: #0a1018;
    --surface: #111a26;
    --surface-2: #162231;
    --surface-3: #1b2a3c;
    --border: #243449;
    --border-light: #36516f;
    --text: #edf3ff;
    --text-2: #a8b8cf;
    --text-3: #6d7b93;
    --accent: #e63946;
    --accent-2: #ff6b7a;
    --accent-glow: rgba(230, 57, 70, 0.24);
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.12);
    --orange: #ffc83d;
    --orange-bg: rgba(255, 200, 61, 0.18);
    --blue: #58b7ff;
    --blue-bg: rgba(88, 183, 255, 0.14);
    --purple: #7ab0ff;
    --purple-bg: rgba(122, 176, 255, 0.14);
    --red-bg: rgba(230, 57, 70, 0.12);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
    --panel-bg: linear-gradient(180deg, rgba(20, 29, 42, 0.96), rgba(10, 15, 23, 0.98));
    --panel-bg-soft: linear-gradient(180deg, rgba(22, 32, 46, 0.86), rgba(13, 18, 28, 0.94));
    --field-bg: linear-gradient(180deg, rgba(8, 12, 19, 0.95), rgba(13, 19, 29, 0.96));
    --field-bg-hover: linear-gradient(180deg, rgba(11, 16, 25, 0.98), rgba(17, 24, 36, 0.98));
    --ring: 0 0 0 3px rgba(230, 57, 70, 0.18);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.24);
    --shadow-panel: 0 12px 28px rgba(2, 8, 18, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    color-scheme: dark;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(circle at 14% 0%, rgba(88, 183, 255, 0.12), transparent 24%),
        radial-gradient(circle at 88% 12%, rgba(230, 57, 70, 0.14), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(122, 176, 255, 0.12), transparent 34%),
        repeating-linear-gradient(90deg, transparent 0 118px, rgba(132, 155, 188, 0.035) 118px 119px),
        repeating-linear-gradient(180deg, transparent 0 118px, rgba(132, 155, 188, 0.03) 118px 119px),
        linear-gradient(180deg, #060a11 0%, #06090f 45%, #04070b 100%);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
    letter-spacing: 0.01em;
}

button,
input,
select,
textarea {
    font: inherit;
}

::selection {
    background: rgba(88, 183, 255, 0.24);
    color: var(--text);
}

:where(button, [role="button"], input, select, textarea, a):focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.logo h1,
.panel-header h3,
.results-header h3,
.workspace-model-info h3,
.task-center-header h2,
.batch-panel-header h2,
.admin-panel-header h2,
.placeholder h2 {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

.app-icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: middle;
    flex: 0 0 auto;
}

.app-icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

.app-icon-xl {
    width: 2.5rem;
    height: 2.5rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== Header ===== */
.header {
    height: 56px;
    background: linear-gradient(180deg, rgba(17, 26, 38, 0.84), rgba(9, 14, 22, 0.94));
    border-bottom: 1px solid rgba(54, 81, 111, 0.42);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(88, 183, 255, 0.8), rgba(230, 57, 70, 0.85), transparent);
    opacity: 0.6;
}

.header-left,
.logo {
    display: flex;
    align-items: center;
}

.logo {
    gap: 10px;
}

.logo h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.logo h1 span {
    color: var(--accent-2);
}

.badge-version {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    background: linear-gradient(180deg, rgba(230, 57, 70, 0.18), rgba(230, 57, 70, 0.08));
    color: var(--accent-2);
    border-radius: 20px;
    border: 1px solid rgba(230, 57, 70, 0.22);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(54, 81, 111, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.lang-option {
    border: 0;
    background: transparent;
    color: var(--text-2);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.lang-option:hover {
    color: var(--text);
}

.lang-option.active {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.22), rgba(88, 183, 255, 0.14));
    color: var(--accent-2);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(54, 81, 111, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-3);
    transition: var(--transition);
}

.connection-status.connected .status-dot {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.connection-status.connected .status-text {
    color: var(--green);
}

.connection-status.connected {
    border-color: rgba(16, 185, 129, 0.3);
}

/* ===== Layout ===== */
.main {
    display: flex;
    height: calc(100vh - 56px - 28px);
}

.sidebar {
    width: 300px;
    min-width: 300px;
    background:
        linear-gradient(180deg, rgba(10, 16, 24, 0.94), rgba(8, 12, 18, 0.98)),
        radial-gradient(circle at top right, rgba(88, 183, 255, 0.06), transparent 28%);
    border-right: 1px solid rgba(54, 81, 111, 0.34);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(8, 12, 18, 0.6), rgba(5, 7, 12, 0.92));
}

/* ===== Panels ===== */
.panel {
    position: relative;
    background: var(--panel-bg);
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-panel);
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    pointer-events: none;
}

.panel-attention {
    animation: panel-attention-pulse 1.2s ease;
}

.panel-title-with-icon,
.task-lookup-title,
.workspace-title-row,
.admin-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.panel-title-with-icon .app-icon,
.task-lookup-title .app-icon,
.workspace-title-row .app-icon,
.admin-hint .app-icon,
.results-header h3 .app-icon {
    color: var(--accent-2);
}

.model-panel-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    overflow: hidden;
}

/* ===== Collapsible Panel ===== */
.panel-collapsible .panel-toggle {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.panel-collapsible .panel-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

.panel-chevron {
    transition: transform 0.25s ease;
    color: var(--text-3);
    flex-shrink: 0;
}

.panel-collapsible.collapsed .panel-chevron {
    transform: rotate(-90deg);
}

.panel-collapse {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
}

.panel-collapsible.collapsed .panel-collapse {
    max-height: 0;
    opacity: 0;
}

.panel-header {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
}

.panel-header h3 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.panel-body {
    padding: 12px;
}

.panel-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

@keyframes panel-attention-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
        border-color: var(--border);
    }
    30% {
        box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.14);
        border-color: rgba(230, 57, 70, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
        border-color: var(--border);
    }
}

/* ===== Model Filter Bar ===== */
.model-filter-bar {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: linear-gradient(180deg, rgba(22, 32, 46, 0.76), rgba(14, 20, 31, 0.9));
}

.input-sm {
    height: 32px;
    font-size: 12px;
    padding: 4px 10px;
    line-height: 1.4;
}

select.input {
    line-height: 1.4;
    padding-top: 6px;
    padding-bottom: 6px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-tab {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    color: var(--text-3);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    border-color: var(--border-light);
    color: var(--text-2);
}

.filter-tab.active {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(88, 183, 255, 0.12));
    border-color: rgba(230, 57, 70, 0.34);
    color: var(--accent-2);
}

.model-count {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}

/* ===== Forms ===== */
label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.input {
    width: 100%;
    background: var(--field-bg);
    border: 1px solid rgba(54, 81, 111, 0.44);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.input:hover {
    background: var(--field-bg-hover);
    border-color: var(--border-light);
}

.input:focus {
    border-color: var(--accent);
    background: var(--field-bg-hover);
    box-shadow: var(--ring);
}

.input::placeholder {
    color: var(--text-3);
}

.input-group {
    display: flex;
    gap: 6px;
}

.input-group .input {
    flex: 1;
}

.form-group {
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #ff7584, var(--accent) 42%, #c92f3c);
    color: #fff;
    box-shadow: 0 12px 24px rgba(230, 57, 70, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff8b98, var(--accent-2), var(--accent));
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(230, 57, 70, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.trial-entry {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.trial-status-card {
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 232, 199, 0.14), rgba(255, 213, 128, 0.07));
    border: 1px solid rgba(255, 190, 92, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 244, 220, 0.08);
}

.trial-status-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffd18a;
    letter-spacing: 0.01em;
}

.trial-status-note {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.45;
}

.btn-ghost {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(54, 81, 111, 0.38);
    color: var(--text-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border-color: var(--border-light);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius);
    color: var(--text-2);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    color: var(--text);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.btn-icon.btn-xs {
    width: 26px;
    height: 26px;
    font-size: 11px;
}

/* ===== Generate Button ===== */
.btn-generate {
    padding: 0 32px;
    height: 48px;
    background: linear-gradient(135deg, #ff4a5d, var(--accent) 42%, #c92f3c);
    color: #fff;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: none;
    box-shadow: 0 14px 30px rgba(230, 57, 70, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
    font-family: var(--font-display);
}

.btn-generate-glow {
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, #ff4444, #e53935, #c62828, #ff4444);
    background-size: 300% 300%;
    animation: glowShift 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    filter: blur(8px);
}

.btn-generate:hover:not(:disabled) .btn-generate-glow {
    opacity: 0.6;
}

@keyframes glowShift {

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

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

.btn-generate-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.btn-generate:hover:not(:disabled) .btn-generate-icon {
    transform: translateY(-2px);
}

.btn-generate-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s;
}

.btn-generate:hover:not(:disabled) .btn-generate-arrow {
    opacity: 1;
    transform: translateX(0);
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: none;
}

.btn-generate:hover:not(:disabled)::before {
    animation: btnShimmer 1.5s ease;
}

@keyframes btnShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(230, 57, 70, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-generate:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-generate:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: grayscale(0.8) brightness(0.7);
    background: linear-gradient(135deg, #666, #555, #444);
    pointer-events: auto;
}

/* ===== Stats ===== */
.stats-mini {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-3);
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
}

.stat-value.accent {
    color: var(--accent-2);
}

.progress-bar-wrap {
    margin-top: 10px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 5px;
}

.progress-bar {
    height: 5px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s;
}

/* Key Detail Link */
.btn-key-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-key-detail:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
    color: var(--accent-2);
    border-color: rgba(230, 57, 70, 0.28);
    transform: translateY(-1px);
}

/* ===== Model List ===== */
.model-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.model-card {
    padding: 9px 11px;
    background: linear-gradient(180deg, rgba(20, 29, 43, 0.9), rgba(14, 21, 32, 0.98));
    border: 1px solid rgba(54, 81, 111, 0.34);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.model-card:hover {
    background: linear-gradient(180deg, rgba(24, 35, 50, 0.98), rgba(16, 24, 36, 1));
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.model-card.active {
    background: linear-gradient(180deg, rgba(28, 39, 56, 0.98), rgba(18, 25, 36, 1));
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(230, 57, 70, 0.18), 0 14px 28px rgba(0, 0, 0, 0.24);
}

.model-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.model-vendor {
    font-size: 10px;
    color: var(--text-3);
    margin-bottom: 4px;
}

.model-desc-short {
    font-size: 10px;
    color: var(--text-3);
    line-height: 1.4;
    margin-bottom: 5px;
}

#modelList .model-desc-short,
#workspaceMeta,
#workspaceDesc {
    display: none !important;
}

.model-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.model-cost {
    font-size: 11px;
    color: var(--orange);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 200, 61, 0.22);
}

.model-type-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.type-text-to-image {
    background: var(--blue-bg);
    color: var(--blue);
}

.type-image-to-video {
    background: var(--purple-bg);
    color: var(--purple);
}

.type-text-to-video {
    background: var(--green-bg);
    color: var(--green);
}

.type-video-to-video {
    background: var(--orange-bg);
    color: var(--orange);
}

.model-no-results {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-3);
}

/* ===== Placeholder ===== */
.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 48px 40px 56px;
    background:
        radial-gradient(circle at 18% 12%, rgba(88, 183, 255, 0.11), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(230, 57, 70, 0.14), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(122, 176, 255, 0.08), transparent 30%);
}

.placeholder-shell {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 0.88fr) minmax(420px, 1.02fr);
    gap: 38px;
    align-items: center;
}

.placeholder-copy {
    max-width: 460px;
    text-align: left;
}

.placeholder-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.14), rgba(88, 183, 255, 0.08));
    border: 1px solid rgba(230, 57, 70, 0.2);
    color: var(--accent-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.placeholder-icon {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(230, 57, 70, 0.18), rgba(88, 183, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: float 3s ease-in-out infinite;
}

.placeholder-icon .app-icon {
    width: 40px;
    height: 40px;
}

.placeholder-icon-emoji {
    font-size: 38px;
    line-height: 1;
    transform: translateY(-1px);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.placeholder h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.04em;
}

.placeholder p {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 36px;
    max-width: 560px;
    line-height: 1.7;
}

.placeholder-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.placeholder-note {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-2);
    max-width: 420px;
    margin-bottom: 22px;
}

.placeholder-steps {
    display: grid;
    gap: 12px;
}

.placeholder-step {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: start;
    padding-top: 12px;
    border-top: 1px solid rgba(54, 81, 111, 0.42);
}

.placeholder-step-index {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
}

.placeholder-step-copy strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.placeholder-step-copy p {
    margin: 0;
    max-width: none;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-3);
}

.placeholder-feature-cluster {
    display: flex;
    justify-content: flex-end;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 620px;
    width: 100%;
}

.feature-card {
    background: linear-gradient(180deg, rgba(17, 26, 38, 0.78), rgba(11, 16, 24, 0.92));
    border: 1px solid rgba(54, 81, 111, 0.42);
    border-radius: 18px;
    padding: 18px 18px 16px;
    text-align: left;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
    min-height: 144px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.feature-card:hover {
    background: linear-gradient(180deg, rgba(23, 35, 51, 0.96), rgba(13, 18, 28, 1));
    border-color: rgba(88, 183, 255, 0.28);
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

.feature-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
}

.feature-desc {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

/* ===== Workspace ===== */
.workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.prompt-section {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(54, 81, 111, 0.34);
    background:
        radial-gradient(circle at top right, rgba(230, 57, 70, 0.1), transparent 22%),
        radial-gradient(circle at top left, rgba(88, 183, 255, 0.08), transparent 18%),
        linear-gradient(180deg, rgba(13, 19, 29, 0.98), rgba(8, 11, 18, 0.98));
    position: relative;
    overflow: visible;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

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

.workspace-model-info {
    flex: 1;
    min-width: 0;
}

.workspace-model-info h3 {
    font-size: 16px;
    font-weight: 700;
}

.workspace-title-row {
    margin-bottom: 4px;
}

.workspace-title-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(230, 57, 70, 0.16), rgba(88, 183, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.workspace-desc {
    font-size: 11px;
    color: var(--text-2);
    display: block;
    line-height: 1.55;
    max-width: 500px;
}

.workspace-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.workspace-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(88, 183, 255, 0.18);
    background: linear-gradient(180deg, rgba(20, 29, 42, 0.8), rgba(11, 16, 24, 0.82));
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.cost-badge {
    font-size: 12px;
    color: var(--text-2);
    padding: 7px 12px;
    background: linear-gradient(180deg, rgba(20, 29, 42, 0.84), rgba(11, 16, 24, 0.9));
    border-radius: 999px;
    border: 1px solid rgba(54, 81, 111, 0.38);
    white-space: nowrap;
    flex-shrink: 0;
}

.cost-badge strong {
    color: var(--orange);
    text-shadow: 0 0 10px rgba(255, 200, 61, 0.2);
}

.workspace.use-schema .prompt-header {
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(42, 54, 86, 0.58);
}

/* ===== Global Drop Overlay ===== */
.global-drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 13, 0.85);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-lg);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.global-drop-overlay.active {
    display: flex;
}

.global-drop-inner {
    text-align: center;
    color: var(--accent-2);
}

.global-drop-icon {
    margin-bottom: 10px;
    animation: float 2s ease-in-out infinite;
}

.global-drop-icon .app-icon {
    width: 52px;
    height: 52px;
}

/* ===== Textarea ===== */
.textarea {
    width: 100%;
    background: var(--field-bg);
    border: 1px solid rgba(54, 81, 111, 0.44);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 12px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: var(--transition);
    line-height: 1.6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.textarea:hover {
    background: var(--field-bg-hover);
    border-color: var(--border-light);
}

.textarea:focus {
    border-color: var(--accent);
    background: var(--field-bg-hover);
    box-shadow: var(--ring);
}

.textarea::placeholder {
    color: var(--text-3);
}

.prompt-char-count {
    text-align: right;
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

/* ===== Workspace Body Layout ===== */
.workspace-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Text-only mode: prompt LEFT, params RIGHT */
.workspace-body.layout-text-only {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.workspace-body.layout-text-only .prompt-area {
    display: flex;
    flex-direction: column;
}

.workspace-body.layout-text-only .prompt-area .textarea {
    flex: 1;
    min-height: 200px;
    resize: none;
}

.workspace-body.layout-text-only .params-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 0;
}

.workspace-body.layout-text-only .params-media {
    display: none;
}

.workspace-body.layout-text-only .params-controls {
    grid-column: 1 / -1;
}

/* ===== Params Layout (2-column: media left, controls right) ===== */
.params-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    margin-top: 14px;
    align-items: start;
}

.params-media {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Frames row: start + swap + end frame side by side on desktop */
.frames-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: stretch;
}

.frames-row .frame-item {
    min-width: 0;
}

/* Frames swap button */
.frames-swap-btn-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    /* offset for label height */
}

.frames-swap-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(54, 81, 111, 0.38);
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.frames-swap-btn:hover {
    background: linear-gradient(180deg, rgba(230, 57, 70, 0.18), rgba(88, 183, 255, 0.08));
    border-color: var(--accent);
    color: var(--accent-2);
    transform: scale(1.1);
}

.frames-swap-btn:active {
    transform: scale(0.95);
}

.frames-swap-btn.swapping {
    animation: swapRotate 0.4s ease;
}

@keyframes swapRotate {
    0% {
        transform: rotate(0deg) scale(1.1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

.params-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* When no media dropzone is visible, controls take full width */
.params-media:empty+.params-controls,
.params-layout:has(.params-media:empty) .params-controls {
    grid-column: 1 / -1;
}

.param-field {
    margin-bottom: 0;
}

.param-hint {
    font-size: 10px;
    color: var(--text-3);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

.param-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.param-label-row label {
    margin-bottom: 0;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.radio-card {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(180deg, rgba(8, 12, 19, 0.92), rgba(13, 19, 29, 0.96));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    transition: var(--transition);
    user-select: none;
    text-transform: none;
    letter-spacing: 0;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card:hover {
    border-color: var(--border-light);
    color: var(--text);
    background: linear-gradient(180deg, rgba(12, 17, 25, 0.96), rgba(18, 25, 36, 0.98));
}

.radio-card.active {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.18), rgba(88, 183, 255, 0.08));
    border-color: var(--accent);
    color: var(--accent-2);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ratio-group {
    flex-wrap: wrap;
    gap: 5px;
}

.ratio-group .radio-card {
    padding: 5px 9px;
    font-size: 11px;
    min-width: auto;
}

/* ===== Slider ===== */
.slider-val {
    color: var(--accent-2);
    font-weight: 700;
    margin-left: 6px;
    font-size: 14px;
}

.slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(88, 183, 255, 0.12));
    outline: none;
    margin: 8px 0 4px;
    cursor: pointer;
    transition: var(--transition);
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--accent-glow);
    transition: var(--transition);
}

.slider-input::-webkit-slider-thumb:hover {
    background: var(--accent-2);
    box-shadow: 0 0 0 5px var(--accent-glow);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-3);
    text-transform: none;
    letter-spacing: 0;
}

/* ===== Dropzone ===== */
.dropzone {
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 12, 19, 0.94), rgba(14, 20, 31, 0.96));
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dropzone.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.14), 0 18px 30px rgba(0, 0, 0, 0.2);
    background: linear-gradient(180deg, rgba(22, 32, 46, 0.98), rgba(16, 24, 36, 0.98));
}

.dropzone-inner {
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-inner:hover {
    background: rgba(255, 255, 255, 0.025);
}

.dropzone.has-preview .dropzone-inner {
    padding: 0;
    min-height: 240px;
    background: linear-gradient(180deg, rgba(19, 28, 41, 0.98), rgba(14, 20, 31, 1));
}

.dropzone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-size: 12px;
    pointer-events: none;
}

.dropzone.has-preview .dropzone-placeholder {
    opacity: 0;
    visibility: hidden;
}

.dropzone-svg-icon {
    width: 42px;
    height: 42px;
    color: var(--text-3);
    opacity: 0.56;
    transition: var(--transition);
    margin-bottom: 4px;
}

.dropzone:hover .dropzone-svg-icon,
.dropzone.drag-over .dropzone-svg-icon {
    opacity: 0.85;
    color: var(--accent-2);
}

.dropzone-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

.dropzone-or {
    font-size: 11px;
    color: var(--text-3);
}

.dropzone-browse {
    color: var(--blue);
    cursor: pointer;
    text-decoration: underline;
    pointer-events: all;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone.has-preview .file-input {
    pointer-events: none;
}

.dropzone-url {
    border-top: 1px solid var(--border);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    font-size: 12px;
    padding: 8px 12px;
}

.dropzone-url:focus {
    border-color: var(--accent);
    border-radius: 0;
    box-shadow: none;
}

.dropzone-preview {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 17, 28, 0.98), rgba(17, 25, 38, 0.98));
    z-index: 1;
}

.dropzone-preview [data-preview-body] {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.dropzone-preview img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.dropzone-preview img:hover {
    opacity: 0.9;
}

.dropzone-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(10, 15, 30, 0.82);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 3;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.dropzone-remove:hover {
    background: var(--accent);
}

.dropzone-remove .app-icon,
.btn-remove-slot .app-icon,
.batch-asset-remove .app-icon,
.batch-draft-remove .app-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.upload-progress {
    height: 4px;
    background: var(--surface-3);
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ===== Image URLs (multi-slot) ===== */
.image-urls-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.image-url-slot {
    display: flex;
    gap: 6px;
    align-items: center;
    animation: slideUp 0.2s ease;
}

.image-url-slot .input {
    flex: 1;
    font-size: 11px;
    padding: 6px 9px;
}

.slot-preview {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    position: relative;
    transition: var(--transition);
}

.slot-preview:hover {
    border-color: var(--accent);
    background: var(--surface-3);
}

.slot-preview-icon {
    width: 32px;
    height: 32px;
    opacity: 0.45;
    transition: var(--transition);
}

.slot-preview:hover .slot-preview-icon {
    opacity: 0.75;
    color: var(--accent-2);
}

.slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slot-preview input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.btn-remove-slot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: var(--transition);
}

.btn-remove-slot:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== Prompt Actions ===== */
.prompt-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.prompt-actions.prompt-actions-inline {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(54, 81, 111, 0.42);
    justify-content: stretch;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
}

.prompt-actions.prompt-actions-pane {
    margin-top: 16px;
    justify-content: flex-end;
}

.schema-controls-action-slot {
    margin-top: auto;
    padding-top: 2px;
}

.schema-controls-action-slot:empty {
    display: none;
}

.shortcut-hint {
    font-size: 11px;
    color: var(--text-3);
}

.prompt-actions.prompt-actions-inline .shortcut-hint {
    order: 2;
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
    padding: 0 4px;
    color: rgba(198, 210, 234, 0.62);
}

.prompt-actions.prompt-actions-inline .btn-generate {
    width: 100%;
    min-width: 0;
    justify-content: center;
    border-radius: 18px;
    height: 50px;
    letter-spacing: 0.02em;
}

/* ===== Results Section ===== */
.results-section {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px 26px;
    background:
        linear-gradient(180deg, rgba(6, 9, 14, 0.3), rgba(5, 7, 12, 0.88)),
        radial-gradient(circle at top right, rgba(88, 183, 255, 0.05), transparent 20%);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.results-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-count {
    font-size: 10px;
    color: var(--text-3);
    background: linear-gradient(180deg, rgba(20, 29, 42, 0.86), rgba(11, 16, 24, 0.9));
    border: 1px solid rgba(54, 81, 111, 0.36);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
}

.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
}

.results-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-3);
    grid-column: 1 / -1;
}

.empty-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    animation: float 3s ease-in-out infinite;
}

.empty-icon .app-icon {
    width: 28px;
    height: 28px;
}

.results-empty p {
    font-size: 14px;
    font-weight: 500;
}

/* ===== Result Card ===== */
.result-card {
    background: linear-gradient(180deg, rgba(18, 27, 40, 0.96), rgba(10, 15, 23, 1));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
}

.result-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.32);
}

.result-card::before,
.tc-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(92, 158, 255, 0), rgba(92, 158, 255, 0.82), rgba(92, 158, 255, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.result-card:hover::before,
.tc-card:hover::before,
.result-card.card-completed::before,
.tc-card.tc-completed::before {
    opacity: 1;
}

.result-card.card-completed {
    border-color: rgba(16, 185, 129, 0.3);
}

.result-card.card-completed:hover {
    border-color: rgba(16, 185, 129, 0.6);
}

.result-card.result-card-group {
    overflow: visible;
}

.result-card.card-failed {
    border-color: rgba(230, 57, 70, 0.3);
}

/* Card Media Header */
.result-media-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(180deg, rgba(18, 27, 40, 1), rgba(14, 20, 31, 1));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding: 16px;
}

.result-media-placeholder.pulsing {
    background: linear-gradient(-45deg, var(--surface-2), var(--surface-3), var(--surface-2));
    background-size: 200% 200%;
    animation: placeholderShimmer 2s ease infinite;
    color: var(--blue);
    border-bottom-color: rgba(59, 130, 246, 0.2);
}

@keyframes placeholderShimmer {
    0% {
        background-position: 0% 50%;
    }

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

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

.failed-placeholder {
    background: var(--red-bg);
    color: var(--accent);
    border-bottom-color: rgba(230, 57, 70, 0.2);
}

.result-media-gallery {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.output-media-item {
    position: relative;
    width: 100%;
    background: #000;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.output-media-item video,
.output-media-item img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

/* ===== Lazy Image Placeholder ===== */
.lazy-img {
    background: linear-gradient(-45deg, var(--surface-2), var(--surface-3), var(--surface-2));
    background-size: 200% 200%;
    animation: placeholderShimmer 2s ease infinite;
    min-height: 120px;
}

/* ===== Video Poster Overlay (Lazy Video) ===== */
.video-poster-wrap {
    position: relative;
    width: 100%;
    min-height: 140px;
    background: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-poster-thumb {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.video-poster-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
    pointer-events: auto;
}

.video-poster-wrap:hover .video-poster-play {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1;
}

/* Smaller variant for task center */
.video-poster-wrap-sm {
    min-height: 80px;
}

.video-poster-wrap-sm .video-poster-thumb {
    max-height: 160px;
}

.video-poster-play-sm {
    opacity: 0.8;
}

/* Task center: static video placeholder (no <video> element, zero download) */
.tc-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tc-video-placeholder:hover {
    background: linear-gradient(135deg, #1f1f3a 0%, #1b2848 100%);
}

.tc-video-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
}

/* Task center thumbnail image */
.tc-thumb-img {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.tc-thumb-img:hover {
    opacity: 0.85;
}

.output-hover-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
}

.output-media-item:hover .output-hover-actions,
.output-hover-actions:hover {
    opacity: 1;
}

.output-hover-actions .btn-icon {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.output-hover-actions .btn-icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

.output-hover-actions .btn-icon:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.05);
}

/* Card Content Body */
.result-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

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

.result-output-tile {
    background: linear-gradient(180deg, rgba(10, 14, 22, 0.98), rgba(13, 18, 29, 0.98));
    border: 1px solid rgba(36, 49, 80, 0.9);
    border-radius: calc(var(--radius-lg) - 2px);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.result-output-tile .output-media-item {
    border-bottom: 1px solid rgba(36, 49, 80, 0.9);
}

.result-output-tile .output-media-item img,
.result-output-tile .output-media-item video {
    max-height: 300px;
}

.result-output-tile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px 12px;
}

.result-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.result-model {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.result-card-chips,
.tc-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.result-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(42, 54, 86, 0.8);
    background: rgba(15, 20, 32, 0.82);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tc-meta-chip {
    min-height: 22px;
    padding: 3px 8px;
}

.result-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

.status-pending {
    background: var(--orange-bg);
    color: var(--orange);
}

.status-polling {
    background: var(--blue-bg);
    color: var(--blue);
}

.status-completed {
    background: var(--green-bg);
    color: var(--green);
}

.status-failed {
    background: var(--red-bg);
    color: var(--accent);
}

.result-prompt {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.5;
    background: linear-gradient(180deg, rgba(8, 11, 18, 0.82), rgba(13, 17, 27, 0.92));
    padding: 11px 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(54, 81, 111, 0.38);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}

.result-meta span,
.tc-card-meta span:not(.tc-card-id),
.admin-model-required {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Delete task button in result card */
.result-card-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(54, 81, 111, 0.28);
    margin-top: 2px;
}

.btn-reuse-task,
.btn-delete-task {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.86;
}

.result-card:hover .btn-reuse-task,
.result-card:hover .btn-delete-task {
    opacity: 1;
}

.btn-reuse-task:hover {
    color: var(--blue);
    background: var(--blue-bg);
    border-color: rgba(59, 130, 246, 0.25);
}

.btn-delete-task:hover {
    color: var(--accent);
    background: var(--red-bg);
    border-color: rgba(230, 57, 70, 0.25);
}

.btn-reuse-task svg,
.btn-delete-task svg {
    flex-shrink: 0;
}

/* ===== Scrolling Notice Banner ===== */
.notice-banner {
    width: 100%;
    background: linear-gradient(90deg, rgba(18, 27, 40, 0.95), rgba(11, 16, 24, 0.98), rgba(18, 27, 40, 0.95));
    border-bottom: 1px solid rgba(54, 81, 111, 0.36);
    overflow: hidden;
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.notice-banner::before,
.notice-banner::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 1;
    pointer-events: none;
}

.notice-banner::before {
    left: 0;
    background: linear-gradient(90deg, rgba(18, 27, 40, 0.98), transparent);
}

.notice-banner::after {
    right: 0;
    background: linear-gradient(-90deg, rgba(18, 27, 40, 0.98), transparent);
}

.notice-banner-track {
    display: flex;
    animation: marqueeScroll 25s linear infinite;
    white-space: nowrap;
}

.notice-banner-track:hover {
    animation-play-state: paused;
}

.notice-banner-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 60px;
    font-size: 12px;
    font-weight: 600;
    color: #ffc83d;
    letter-spacing: 0.04em;
    text-shadow: 0 0 12px rgba(255, 200, 61, 0.18);
}

.notice-banner-content svg {
    flex-shrink: 0;
    opacity: 1;
    color: #ffbf24;
    filter: drop-shadow(0 0 6px rgba(255, 191, 36, 0.22));
}

.notice-banner-content span {
    white-space: nowrap;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.notice-banner-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-3);
    transition: all 0.2s ease;
    padding: 0;
}

.notice-banner-close:hover {
    background: var(--red-bg);
    color: var(--accent);
    border-color: rgba(230, 57, 70, 0.28);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* ===== Polling Indicator ===== */
.pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
    margin-bottom: 8px;
    animation: pulseDot 1.4s ease-in-out infinite;
    box-shadow: 0 0 10px var(--blue);
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.6);
        box-shadow: 0 0 2px var(--blue);
    }
}

/* ===== Spinner ===== */
.spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===== Toast ===== */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow);
    max-width: 360px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toast-success {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.88), rgba(10, 126, 88, 0.94));
    color: #f6fffb;
}

.toast-error {
    background: linear-gradient(180deg, rgba(230, 57, 70, 0.9), rgba(195, 42, 56, 0.94));
    color: #fff7f5;
}

.toast-info {
    background: linear-gradient(180deg, rgba(88, 183, 255, 0.88), rgba(52, 136, 223, 0.94));
    color: #f5fbff;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

/* ===== Drawer Toggle (hidden on desktop) ===== */
.drawer-toggle {
    display: none;
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius);
    color: var(--text-2);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    padding: 0;
    margin-right: 8px;
}

.drawer-toggle svg {
    width: 18px;
    height: 18px;
}

.drawer-toggle:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
    color: var(--text);
}

.drawer-backdrop {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header {
        padding: 0 10px;
        gap: 8px;
    }

    .header-left {
        min-width: 0;
        gap: 8px;
    }

    .logo {
        gap: 8px;
        min-width: 0;
    }

    .logo svg {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
    }

    .logo h1 {
        font-size: 15px;
        min-width: 0;
    }

    .logo h1 span {
        display: none;
    }

    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }

    .lang-switch {
        padding: 3px;
        gap: 2px;
    }

    .lang-option {
        padding: 5px 8px;
        font-size: 11px;
    }

    .header-task-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        gap: 0;
        justify-content: center;
    }

    .header-task-btn > span:not(.task-center-badge) {
        display: none;
    }

    .connection-status {
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        border-radius: 10px;
    }

    .connection-status .status-text {
        display: none;
    }

    .task-center-badge {
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        top: -3px;
        right: -3px;
        font-size: 9px;
    }

    .drawer-toggle {
        display: flex;
    }

    .drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .drawer-open .drawer-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .main {
        flex-direction: column;
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        min-width: auto;
        max-height: none;
        z-index: 100;
        border-right: 1px solid var(--border);
        border-bottom: none;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        padding-top: 16px;
    }

    .drawer-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .params-layout {
        grid-template-columns: 1fr;
    }

    .workspace-body.layout-text-only {
        grid-template-columns: 1fr;
    }

    .frames-row {
        grid-template-columns: 1fr;
    }

    .frames-swap-btn-wrap {
        padding-top: 0;
        padding-bottom: 0;
    }

    .frames-swap-btn svg {
        transform: rotate(90deg);
    }

    .btn-generate {
        padding: 0 24px;
        height: 44px;
        font-size: 14px;
    }

    .prompt-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== Image Preview Modal ===== */
.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.preview-modal.active {
    display: flex;
}

.preview-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.preview-modal-content img,
.preview-modal-content video {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

.preview-modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    color: var(--text);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.preview-modal-close:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Clickable preview images — main styles are above in .dropzone-preview img */

.output-media-item img,
.output-media-item video {
    cursor: zoom-in;
}

/* ===== Header Task Center Button ===== */
.header-task-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-task-btn.is-active,
.header-task-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(88, 183, 255, 0.08));
    border-color: rgba(230, 57, 70, 0.32);
    color: var(--accent-2);
    box-shadow: 0 0 0 1px rgba(230, 57, 70, 0.08);
}

.header-task-btn.is-active svg,
.header-task-btn[aria-pressed="true"] svg {
    color: var(--accent-2);
}

.task-center-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s ease;
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Task Management Center ===== */
.task-center-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.task-center-overlay.active {
    opacity: 1;
    visibility: visible;
}

.task-center {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 440px;
    max-width: 92vw;
    background: linear-gradient(180deg, rgba(12, 18, 28, 0.98), rgba(8, 12, 19, 1));
    border-left: 1px solid rgba(54, 81, 111, 0.36);
    z-index: 950;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.task-center.active {
    transform: translateX(0);
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.42);
}

.task-center-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(20, 29, 42, 0.92), rgba(13, 19, 29, 0.98));
    flex-shrink: 0;
}

.task-center-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.task-center-header h2,
.batch-panel-header h2,
.admin-panel-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.panel-title-icon {
    flex-shrink: 0;
    color: currentColor;
}

/* Lookup section */
.task-center-lookup {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.task-lookup-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.task-lookup-row {
    display: flex;
    gap: 8px;
}

.task-lookup-row .input {
    flex: 1;
    font-size: 12px;
}

.task-lookup-result {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(8, 12, 19, 0.94), rgba(13, 19, 29, 0.96));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.6;
    animation: slideUp 0.2s ease;
    overflow: auto;
    max-height: 220px;
}

.task-lookup-result .lookup-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.task-lookup-result .lookup-label {
    color: var(--text-3);
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    min-width: 70px;
}

.task-lookup-result .lookup-row {
    margin-bottom: 6px;
}

.task-lookup-result .lookup-media {
    margin-top: 8px;
}

.task-lookup-result .lookup-media.lookup-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.task-lookup-result .lookup-media img,
.task-lookup-result .lookup-media video {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius);
    background: #000;
    cursor: zoom-in;
}

.task-lookup-result .lookup-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.task-lookup-result .lookup-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-center-queue {
    padding: 14px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20, 26, 40, 0.96), rgba(14, 19, 30, 0.96));
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.task-center-queue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.task-center-queue-toggle {
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.task-center-queue-head-main {
    min-width: 0;
    flex: 1;
}

.task-center-queue-head-main .task-lookup-title {
    margin-bottom: 4px;
}

.task-center-queue-head-side {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tc-queue-compact {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.4;
}

.tc-queue-chevron {
    color: var(--text-3);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.task-center-queue.collapsed .tc-queue-chevron {
    transform: rotate(-90deg);
}

.task-center-queue-details {
    max-height: 240px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.28s ease, opacity 0.2s ease;
}

.task-center-queue.collapsed .task-center-queue-details {
    max-height: 0;
    opacity: 0;
}

.tc-queue-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}

.tc-queue-state.is-running {
    color: var(--blue);
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.12);
}

.tc-queue-state.is-idle {
    color: var(--text-2);
}

.tc-queue-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tc-queue-stat {
    padding: 10px 8px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    text-align: center;
}

.tc-queue-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.tc-queue-label {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: var(--text-3);
    letter-spacing: 0.25px;
}

.tc-queue-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tc-queue-config {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
}

.tc-queue-config .input {
    width: 72px;
    min-width: 72px;
    height: 30px;
    padding: 4px 8px;
    font-size: 12px;
}

.tc-queue-hint {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.5;
}

/* Task Center Stats */
.task-center-stats {
    display: flex;
    padding: 14px 20px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.tc-stat {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.tc-stat:hover {
    border-color: var(--border-light);
}

.tc-stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.tc-stat-label {
    display: block;
    font-size: 10px;
    color: var(--text-3);
    margin-top: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tc-stat-pending .tc-stat-num {
    color: var(--blue);
}

.tc-stat-completed .tc-stat-num {
    color: var(--green);
}

.tc-stat-failed .tc-stat-num {
    color: var(--accent);
}

/* Task Center Filters */
.task-center-filters {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tc-filter {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-3);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.tc-filter:hover {
    border-color: var(--border-light);
    color: var(--text-2);
}

.tc-filter.active {
    background: var(--accent-glow);
    border-color: rgba(230, 57, 70, 0.4);
    color: var(--accent-2);
    font-weight: 600;
}

/* Task Center List */
.task-center-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-center-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-3);
    font-size: 13px;
}

/* Task Center Card */
.tc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: var(--transition);
    animation: slideUp 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 9px;
    position: relative;
}

.tc-card:hover {
    border-color: var(--border-light);
    background: var(--surface-2);
}

.tc-card.tc-completed {
    border-left: 3px solid var(--green);
}

.tc-card.tc-failed {
    border-left: 3px solid var(--accent);
}

.tc-card.tc-active {
    border-left: 3px solid var(--blue);
}

.tc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tc-card-model {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-card-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

.tc-card-prompt {
    font-size: 11px;
    color: var(--text-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 11, 18, 0.8), rgba(13, 17, 27, 0.9));
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tc-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-3);
    gap: 8px;
}

.tc-card-id {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 10px;
    color: var(--text-3);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-card-id:hover {
    color: var(--accent-2);
    border-color: var(--accent);
}

.tc-card-actions {
    display: flex;
    gap: 7px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.tc-card-actions .btn-sm {
    font-size: 11px;
    padding: 4px 10px;
}

/* Task center media preview */
.tc-card-preview {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    max-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-card-preview img,
.tc-card-preview video {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    cursor: zoom-in;
}

/* ===== New Model Type Badges ===== */
.type-image-to-image {
    background: rgba(88, 183, 255, 0.14);
    color: #7ecaff;
}

.type-image-to-3d {
    background: rgba(16, 185, 129, 0.14);
    color: #38d39f;
}

.type-text-to-audio {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

/* ===== Audio Player ===== */
.audio-player-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    border-radius: var(--radius);
    min-height: 100px;
}

.audio-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-2);
    animation: float 3s ease-in-out infinite;
}

.audio-icon .app-icon {
    width: 28px;
    height: 28px;
}

.audio-player-wrap audio {
    width: 100%;
    max-width: 300px;
    height: 36px;
    border-radius: 18px;
}

/* ===== Batch Panel ===== */
.batch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.batch-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.batch-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(660px, 94vw);
    height: 100vh;
    background: linear-gradient(180deg, rgba(12, 18, 28, 0.98), rgba(8, 12, 19, 1));
    border-left: 1px solid rgba(54, 81, 111, 0.36);
    box-shadow: -20px 0 48px rgba(0, 0, 0, 0.42);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.batch-panel.active {
    transform: translateX(0);
}

.batch-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(54, 81, 111, 0.3);
    background: linear-gradient(180deg, rgba(20, 29, 42, 0.92), rgba(12, 18, 28, 0.98));
}

.batch-panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.batch-panel-header p {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

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

.batch-section {
    background: linear-gradient(180deg, rgba(18, 27, 40, 0.96), rgba(10, 15, 23, 1));
    border: 1px solid rgba(54, 81, 111, 0.38);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.batch-section-flex {
    flex: 1 0 auto;
    min-height: clamp(420px, 52vh, 720px);
    overflow: hidden;
}

.batch-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.batch-section-head h3 {
    font-size: 13px;
    font-weight: 700;
}

.batch-stats-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
}

.batch-upload-actions,
.batch-default-actions,
.batch-submit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-dropzone {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    background: radial-gradient(circle at top, rgba(230, 57, 70, 0.1), transparent 48%), var(--bg);
    padding: 24px 16px;
    text-align: center;
    transition: var(--transition);
}

.batch-dropzone.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: radial-gradient(circle at top, rgba(230, 57, 70, 0.16), transparent 52%), var(--surface-2);
}

.batch-dropzone-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 8px;
    border-radius: 18px;
    background: rgba(230, 57, 70, 0.1);
    color: var(--accent-2);
}

.batch-dropzone-icon .app-icon {
    width: 28px;
    height: 28px;
}

.batch-dropzone-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.batch-dropzone-subtitle,
.batch-upload-hint {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

.batch-asset-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
    padding-right: 2px;
}

.batch-default-fields {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
}

.batch-asset-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.batch-asset-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}

.batch-asset-meta {
    flex: 1;
    min-width: 0;
}

.batch-asset-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.batch-asset-url {
    font-size: 10px;
    color: var(--text-3);
    line-height: 1.4;
    word-break: break-all;
}

.batch-empty-state {
    padding: 22px 16px;
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(10, 14, 23, 0.45);
}

.batch-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.batch-fields-grid-default {
    grid-template-columns: 1fr;
}

.batch-field,
.batch-checkbox-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.batch-field-full {
    grid-column: 1 / -1;
}

.batch-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
}

.batch-field-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.batch-field-inline .input {
    flex: 1;
    min-width: 0;
}

.batch-field-inline-btn {
    flex-shrink: 0;
}

.batch-field-textarea {
    min-height: 88px;
    resize: vertical;
}

.batch-list-textarea {
    min-height: 92px;
}

.batch-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 2px;
    color: var(--text-2);
    font-size: 12px;
}

.batch-summary {
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.5;
}

.batch-summary-info {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.batch-summary-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.batch-submit-btn {
    margin-left: auto;
}

.batch-queue-config {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
}

.batch-queue-config .input {
    width: 70px;
    min-width: 70px;
    height: 30px;
    padding: 4px 8px;
    font-size: 12px;
}

.batch-draft-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    align-items: stretch;
    padding-right: 2px;
}

.batch-draft-card {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    flex-shrink: 0;
}

.batch-draft-card.is-open {
    border-color: var(--border-light);
}

.batch-draft-card.is-error {
    border-color: rgba(230, 57, 70, 0.42);
    box-shadow: 0 0 0 1px rgba(230, 57, 70, 0.12);
}

.batch-draft-card.is-submitting {
    border-color: rgba(59, 130, 246, 0.34);
}

.batch-draft-card.is-completed {
    border-color: rgba(16, 185, 129, 0.3);
}

.batch-draft-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    min-height: 84px;
}

.batch-draft-toggle {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    padding: 0;
}

.batch-draft-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg);
    flex-shrink: 0;
}

.batch-draft-meta {
    flex: 1;
    min-width: 0;
}

.batch-draft-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.batch-draft-subtitle {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.batch-draft-head-actions {
    display: flex;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.batch-draft-status {
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 8px;
}

.batch-draft-status-draft {
    background: var(--surface-3);
    color: var(--text-2);
}

.batch-draft-status-submitting {
    background: var(--blue-bg);
    color: var(--blue);
}

.batch-draft-status-queued,
.batch-draft-status-running {
    background: var(--blue-bg);
    color: var(--blue);
}

.batch-draft-status-error {
    background: var(--red-bg);
    color: var(--accent);
}

.batch-draft-status-completed {
    background: var(--green-bg);
    color: var(--green);
}

.batch-draft-body {
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-draft-error {
    background: var(--red-bg);
    color: var(--accent);
    border: 1px solid rgba(230, 57, 70, 0.24);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
}

.batch-source-chip {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-3);
    padding: 8px 10px;
    border-radius: var(--radius);
    background: rgba(10, 14, 23, 0.45);
    border: 1px solid var(--border);
}

.batch-source-chip span {
    font-weight: 600;
    color: var(--text-2);
}

.batch-source-chip a {
    color: var(--blue);
    text-decoration: none;
    word-break: break-all;
}

.batch-request-preview {
    background: rgba(10, 14, 23, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-request-preview-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
}

.batch-request-preview code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-2);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* ===== Admin Panel ===== */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.admin-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.admin-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 92vw;
    height: 100vh;
    background: linear-gradient(180deg, rgba(12, 18, 28, 0.98), rgba(8, 12, 19, 1));
    border-left: 1px solid rgba(54, 81, 111, 0.36);
    box-shadow: -16px 0 42px rgba(0, 0, 0, 0.44);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-panel.active {
    right: 0;
}

.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20, 29, 42, 0.92), rgba(13, 19, 29, 0.98));
}

.admin-panel-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-panel-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.admin-panel-toolbar .input {
    flex: 1;
}

.admin-stats {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    white-space: nowrap;
    padding: 4px 10px;
    background: var(--green-bg);
    border-radius: 20px;
}

.admin-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.admin-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.admin-hint {
    font-size: 11px;
    color: var(--text-3);
}

.admin-empty {
    text-align: center;
    padding: 30px;
    font-size: 13px;
    color: var(--text-3);
}

/* Admin Model Row */
.admin-model-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 5px;
    transition: var(--transition);
}

.admin-model-row:hover {
    border-color: var(--border-light);
    background: var(--surface-2);
}

.admin-model-row.admin-disabled {
    opacity: 0.45;
}

.admin-model-row.admin-disabled:hover {
    opacity: 0.65;
}

.admin-model-info {
    flex: 1;
    min-width: 0;
}

.admin-model-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-model-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-model-cost {
    font-size: 10px;
    color: var(--orange);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 200, 61, 0.22);
}

.admin-model-required {
    font-size: 9px;
    color: var(--text-3);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-model-required .app-icon {
    width: 0.85rem;
    height: 0.85rem;
    color: var(--accent-2);
}

/* Toggle Switch */
.admin-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.admin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--surface-3);
    border-radius: 20px;
    transition: background 0.25s ease;
    border: 1px solid var(--border);
}

.admin-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-3);
    border-radius: 50%;
    transition: all 0.25s ease;
}

.admin-toggle input:checked+.admin-toggle-slider {
    background: var(--green);
    border-color: var(--green);
}

.admin-toggle input:checked+.admin-toggle-slider::before {
    background: #fff;
    transform: translateX(18px);
}

/* ===== Mobile Admin ===== */
@media (max-width: 768px) {
    .task-center {
        width: 100vw;
        max-width: 100vw;
        right: 0;
    }

    .tc-queue-stats {
        grid-template-columns: 1fr;
    }

    .tc-queue-controls {
        align-items: stretch;
    }

    .tc-queue-config {
        width: 100%;
        justify-content: space-between;
    }

    .task-center-queue-head,
    .task-center-queue-head-side {
        align-items: flex-start;
    }

    .batch-panel {
        width: 100vw;
        max-width: 100vw;
    }

    .batch-panel-body {
        padding: 14px;
        overflow-y: auto;
    }

    .batch-fields-grid {
        grid-template-columns: 1fr;
    }

    .batch-section-flex {
        min-height: 320px;
    }

    .batch-asset-list,
    .batch-default-fields {
        max-height: none;
    }

    .admin-panel {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }
}

/* ===== Schema Driven Studio ===== */
.workspace.use-schema .prompt-area,
.workspace.use-schema .params-layout {
    display: none;
}

.schema-generation-pane {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.schema-legacy-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.schema-workbench-top {
    display: block;
}

.schema-workbench-dual {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
    gap: 18px;
    align-items: start;
}

.schema-workbench-prompt-column,
.schema-workbench-rail {
    min-width: 0;
}

.schema-workbench-rail {
    display: grid;
    gap: 16px;
    align-content: start;
}

.schema-workbench-top .schema-prompt-field {
    gap: 10px;
}

.schema-workbench-top .schema-prompt-area {
    padding: 18px;
    border-radius: 20px;
}

.schema-workbench-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
    gap: 18px;
    align-items: start;
}

.schema-legacy-form-prompt .schema-prompt-area .textarea {
    min-height: 220px;
}

.schema-legacy-form-motion .schema-workbench-lower {
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
}

.schema-legacy-form-motion .schema-workbench-panel-media {
    min-height: 300px;
}

.schema-legacy-form-reference .schema-workbench-lower {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.schema-legacy-form-reference .schema-workbench-panel-media {
    min-height: 320px;
}

.schema-legacy-form-spatial .schema-workbench-lower {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.schema-legacy-form-spatial .schema-workbench-panel-media {
    min-height: 340px;
}

.schema-legacy-form.no-media-layout .schema-prompt-area .textarea {
    min-height: 320px;
}

.schema-panel-shell {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.schema-workbench-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid rgba(42, 54, 86, 0.75);
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(9, 12, 18, 0.74), rgba(12, 15, 24, 0.84));
}

.schema-workbench-panel-media {
    min-height: 250px;
}

.schema-workspace-empty {
    min-height: 320px;
    display: grid;
    place-items: center;
    padding: 28px;
    border: 1px dashed rgba(92, 158, 255, 0.18);
    border-radius: 22px;
    background:
        radial-gradient(circle at top, rgba(230, 57, 70, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(9, 12, 18, 0.74), rgba(12, 15, 24, 0.82));
    text-align: center;
}

.schema-workspace-empty-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 22px;
    color: var(--accent-2);
    background: rgba(230, 57, 70, 0.12);
    border: 1px solid rgba(230, 57, 70, 0.22);
}

.schema-workspace-empty-copy {
    max-width: 520px;
}

.schema-workspace-empty-copy h4 {
    font-size: 22px;
    line-height: 1.15;
    margin-bottom: 10px;
}

.schema-workspace-empty-copy p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 10px;
}

.schema-workspace-empty-copy span {
    display: inline-block;
    font-size: 12px;
    color: var(--text-3);
}

.schema-prompt-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(42, 54, 86, 0.75);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(6, 9, 15, 0.86), rgba(10, 13, 20, 0.92));
}

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

.schema-prompt-field > .studio-label {
    margin-bottom: 0;
}

.schema-prompt-area.is-disabled,
.studio-field.is-disabled {
    opacity: 0.62;
}

.schema-prompt-area.is-disabled .textarea,
.studio-field.is-disabled .studio-input,
.studio-field.is-disabled .studio-textarea,
.studio-field.is-disabled .studio-add-btn,
.studio-field.is-disabled .studio-remove-btn,
.studio-field.is-disabled .studio-upload-btn,
.studio-field.is-disabled .studio-range,
.studio-field.is-disabled .schema-range {
    cursor: not-allowed;
}

.schema-prompt-area[data-disabled-note]::after,
.studio-field[data-disabled-note]::after {
    content: attr(data-disabled-note);
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
}

.schema-prompt-field > .studio-label,
.schema-params-layout .form-group > label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    display: block;
}

.schema-prompt-editor-shell {
    position: relative;
}

.schema-prompt-editor-visual {
    position: absolute;
    inset: 1px;
    padding: 12px;
    border-radius: calc(var(--radius) - 1px);
    pointer-events: none;
    overflow: hidden;
}

.schema-prompt-editor-visual-content {
    min-height: 100%;
    color: var(--text);
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: break-word;
    will-change: transform;
}

.schema-prompt-editor-input {
    position: relative;
    z-index: 1;
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: var(--text);
}

.schema-prompt-editor-input:hover,
.schema-prompt-editor-input:focus {
    background: transparent;
}

.schema-prompt-editor-input::placeholder {
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.schema-prompt-visual-placeholder {
    color: var(--text-3);
}

.schema-prompt-token-chip {
    position: relative;
    display: inline-block;
    margin: 0;
    line-height: inherit;
    vertical-align: baseline;
}

.schema-prompt-token-measure {
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.schema-prompt-token-visual {
    position: absolute;
    left: 0;
    top: 50%;
    display: inline-flex;
    align-items: center;
    transform: translateY(-50%);
    pointer-events: none;
}

.schema-prompt-token-chip .schema-prompt-media-thumb {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.schema-prompt-token-index {
    position: absolute;
    left: 34px;
    bottom: -1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(6, 9, 15, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.schema-prompt-media-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.schema-prompt-media-thumb.is-compact {
    width: 18px;
    height: 18px;
    border-radius: 999px;
}

.schema-prompt-media-thumb.is-inline {
    width: 42px;
    height: 1.15em;
    border-radius: 7px;
}

.schema-prompt-media-thumb img,
.schema-prompt-media-thumb video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
}

.schema-prompt-media-thumb.is-fallback .app-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-2);
}

.schema-prompt-media-thumb.is-inline.is-fallback .app-icon {
    width: 10px;
    height: 10px;
}

.schema-prompt-media-thumb.is-compact.is-fallback .app-icon {
    width: 11px;
    height: 11px;
}

.schema-prompt-media-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(6, 9, 15, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
}

.schema-prompt-media-badge .app-icon {
    width: 10px;
    height: 10px;
}

.schema-prompt-media-thumb.is-inline .schema-prompt-media-badge {
    right: 2px;
    bottom: 2px;
    width: 11px;
    height: 11px;
}

.schema-prompt-media-thumb.is-inline .schema-prompt-media-badge .app-icon {
    width: 7px;
    height: 7px;
}

.schema-prompt-mention-menu {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(92, 158, 255, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(13, 18, 28, 0.96), rgba(8, 11, 18, 0.96));
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.schema-prompt-mention-menu[hidden] {
    display: none;
}

.schema-prompt-mention-item {
    width: 100%;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.schema-prompt-mention-item:hover,
.schema-prompt-mention-item.is-active {
    border-color: rgba(230, 57, 70, 0.26);
    background: rgba(230, 57, 70, 0.08);
    transform: translateY(-1px);
}

.schema-prompt-mention-preview,
.schema-prompt-mention-copy {
    min-width: 0;
}

.schema-prompt-mention-copy {
    display: grid;
    gap: 6px;
}

.schema-prompt-mention-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.schema-prompt-mention-kind,
.schema-prompt-mention-token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.schema-prompt-mention-kind {
    font-size: 13px;
    font-weight: 600;
}

.schema-prompt-mention-kind .app-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-2);
    flex-shrink: 0;
}

.schema-prompt-mention-token {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(92, 158, 255, 0.12);
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 700;
}

.schema-prompt-mention-summary {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schema-prompt-mention-empty,
.schema-prompt-mention-hint {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-2);
}

.schema-prompt-mention-empty {
    padding: 4px 2px;
}

.schema-legacy-form.text-only .schema-prompt-area .textarea {
    min-height: 180px;
    resize: none;
}

.schema-params-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 16px;
    align-items: start;
    margin-top: 2px;
}

.schema-params-layout.no-media {
    grid-template-columns: 1fr;
}

.schema-params-media,
.schema-params-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid rgba(42, 54, 86, 0.75);
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(9, 12, 18, 0.7), rgba(12, 15, 24, 0.82));
}

@media (min-width: 1180px) {
    .schema-workbench-rail {
        position: sticky;
        top: 18px;
    }
}

.schema-panel-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.schema-panel-label.is-compact {
    align-items: center;
}

.schema-panel-label-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(230, 57, 70, 0.12);
    color: var(--accent-2);
    border: 1px solid rgba(230, 57, 70, 0.2);
    flex-shrink: 0;
}

.schema-panel-label-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.schema-panel-label-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.schema-panel-label-note {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-3);
}

.schema-workbench-panel .studio-empty {
    min-height: 110px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px dashed rgba(92, 158, 255, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    padding: 18px;
}

.schema-frames-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

.schema-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
    min-height: 38px;
}

.schema-size-custom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.schema-advanced-panel-inline {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(42, 54, 86, 0.58);
}

.schema-advanced-panel {
    display: grid;
    gap: 8px;
    border: 0;
    background: transparent;
    overflow: visible;
}

.schema-panel-label-summary {
    list-style: none;
    cursor: pointer;
}

.schema-panel-label-summary::-webkit-details-marker {
    display: none;
}

.schema-advanced-body {
    border: 1px solid rgba(42, 54, 86, 0.66);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    padding: 14px;
}

.schema-advanced-group + .schema-advanced-group {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(42, 54, 86, 0.46);
}

.schema-advanced-group-head {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.schema-advanced-group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.schema-advanced-group-note {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-3);
}

.schema-advanced-group-grid {
    display: grid;
    gap: 12px;
}

.studio-range-wrap {
    display: grid;
    gap: 8px;
}

.studio-range-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-2);
}

.studio-range-value {
    font-size: 12px;
    color: var(--text);
    font-weight: 700;
}

.studio-range-bound {
    opacity: 0.8;
}

.studio-range,
.schema-range {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

.studio-range-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.studio-range-preset {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.studio-range-preset.active,
.studio-range-preset:hover {
    border-color: var(--accent);
    color: var(--accent-2);
    background: rgba(92, 158, 255, 0.12);
}

.studio-fixed-range .studio-range-preset[disabled] {
    opacity: 1;
    cursor: default;
    border-color: var(--accent);
    color: var(--accent-2);
    background: rgba(92, 158, 255, 0.12);
}

.schema-advanced-grid {
    margin-top: 4px;
}

.dropzone-preview video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    max-height: none;
    object-fit: contain;
    display: block;
    background: transparent;
}

.schema-dropzone-file {
    min-height: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    background: var(--surface-2);
}

.schema-dropzone-file-icon {
    width: 38px;
    height: 38px;
    margin: 0 auto;
    color: var(--accent-2);
}

.schema-dropzone-file-icon .app-icon {
    width: 100%;
    height: 100%;
}

.schema-dropzone-file-text {
    font-size: 13px;
    color: var(--text-2);
}

.schema-dropzone-file a {
    color: var(--blue);
    text-decoration: underline;
    font-size: 12px;
}

.schema-slot-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.schema-slot-preview-body {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
}

.schema-slot-preview-body img,
.schema-slot-preview-body video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.schema-slot-preview-body .schema-dropzone-file {
    min-height: 100%;
    width: 100%;
    padding: 8px;
}

.workspace.mode-llm .schema-generation-pane,
.workspace.mode-llm #generationActions,
.workspace.mode-llm #generationResultsSection {
    display: none;
}

.workspace.mode-generation #llmWorkspace {
    display: none !important;
}

.studio-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.studio-field {
    border: 1px solid rgba(42, 54, 86, 0.75);
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(16, 21, 33, 0.78), rgba(8, 11, 18, 0.72));
}

.studio-field-nested {
    background: rgba(255, 255, 255, 0.02);
}

.studio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    max-width: 100%;
    position: relative;
}

.studio-label-text {
    display: inline;
    min-width: 0;
}

.studio-label-help {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(92, 158, 255, 0.22);
    background: rgba(92, 158, 255, 0.1);
    color: var(--accent-2);
    flex-shrink: 0;
}

.studio-label-help .app-icon {
    width: 11px;
    height: 11px;
}

.studio-label-with-help::before,
.studio-label-with-help::after {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    transform: translateY(4px);
}

.studio-label-with-help::before {
    content: '';
    position: absolute;
    left: 18px;
    top: calc(100% + 4px);
    border: 6px solid transparent;
    border-bottom-color: rgba(8, 11, 18, 0.98);
    z-index: 5;
}

.studio-label-with-help::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: calc(100% + 14px);
    width: min(320px, calc(100vw - 72px));
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(8, 11, 18, 0.98);
    border: 1px solid rgba(42, 54, 86, 0.88);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    z-index: 4;
    white-space: normal;
}

.studio-label-with-help:hover::before,
.studio-label-with-help:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.studio-input,
.studio-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
}

.studio-textarea {
    min-height: 112px;
    resize: vertical;
}

.studio-field-hint,
.studio-field-default,
.studio-empty {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
    margin-top: 8px;
}

.studio-input-row,
.studio-array-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.studio-input-row .studio-input,
.studio-array-item .studio-input,
.studio-array-item .studio-textarea {
    flex: 1;
}

.studio-array-list,
.studio-object-fields {
    display: grid;
    gap: 8px;
}

.studio-array-actions {
    margin-top: 8px;
}

.studio-upload-btn,
.studio-add-btn,
.studio-remove-btn {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.studio-upload-btn:hover,
.studio-add-btn:hover,
.studio-remove-btn:hover {
    border-color: var(--accent);
    color: var(--accent-2);
}

.studio-radio-group {
    display: grid;
    gap: 8px;
}

.studio-radio-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.studio-switch {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

@media (max-width: 960px) {
    .schema-workbench-lower,
    .schema-workbench-dual,
    .schema-legacy-form-motion .schema-workbench-lower,
    .schema-legacy-form-reference .schema-workbench-lower,
    .schema-legacy-form-spatial .schema-workbench-lower,
    .schema-params-layout,
    .schema-params-layout.no-media {
        grid-template-columns: 1fr;
    }

    .schema-frames-row {
        grid-template-columns: 1fr;
    }

    .schema-legacy-form-motion .schema-workbench-panel-media,
    .schema-legacy-form-reference .schema-workbench-panel-media,
    .schema-legacy-form-spatial .schema-workbench-panel-media {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .schema-legacy-form {
        gap: 14px;
    }

    .schema-workbench-top .schema-prompt-area,
    .schema-workbench-panel,
    .schema-params-media,
    .schema-params-controls {
        padding: 14px;
        border-radius: 16px;
    }

    .schema-workbench-top .schema-prompt-area {
        padding: 14px;
    }

    .schema-legacy-form-prompt .schema-prompt-area .textarea,
    .schema-legacy-form.text-only .schema-prompt-area .textarea {
        min-height: 180px;
    }

    .schema-workbench-panel,
    .schema-params-media,
    .schema-params-controls {
        gap: 12px;
    }

    .schema-workbench-panel-media,
    .schema-workspace-empty {
        min-height: 0;
    }

    .schema-workspace-empty {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .schema-panel-label {
        gap: 8px;
    }

    .schema-panel-label-icon {
        width: 26px;
        height: 26px;
        border-radius: 9px;
    }

    .schema-panel-label-title {
        font-size: 13px;
    }

    .schema-panel-label-note {
        font-size: 11px;
        line-height: 1.45;
    }

    .dropzone-inner {
        min-height: 118px;
        padding: 22px 14px;
    }

    .dropzone-text {
        font-size: 12px;
    }

    .dropzone-preview img,
    .dropzone-preview video {
        height: auto;
        max-height: 220px;
    }

    .studio-input-row,
    .studio-array-item,
    .image-url-slot {
        flex-direction: column;
        align-items: stretch;
    }

    .studio-input-row .studio-input,
    .studio-array-item .studio-input,
    .studio-array-item .studio-textarea,
    .image-url-slot .input {
        width: 100%;
    }

    .studio-upload-btn,
    .studio-add-btn,
    .studio-remove-btn,
    .image-url-slot .btn-remove-slot {
        width: 100%;
        justify-content: center;
    }

    .slot-preview {
        width: 100%;
        height: 132px;
    }

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

    .studio-range-meta {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 4px;
    }

    .studio-range-value {
        width: 100%;
        text-align: center;
        order: -1;
    }

    .schema-controls-action-slot {
        padding-top: 6px;
    }

    .prompt-actions.prompt-actions-inline {
        padding-top: 12px;
        gap: 8px;
    }

    .prompt-actions.prompt-actions-inline .btn-generate {
        height: 48px;
        border-radius: 16px;
    }

    .result-output-grid {
        grid-template-columns: 1fr;
    }
}

.llm-workspace {
    display: grid;
    gap: 14px;
}

.llm-messages {
    min-height: 340px;
    max-height: 56vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(230, 57, 70, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(6,8,13,0.82));
    padding: 16px;
    display: grid;
    gap: 12px;
}

.llm-empty-state {
    color: var(--text-2);
    text-align: center;
    padding: 44px 20px;
}

.llm-message {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.llm-message.user {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.24);
}

.llm-message.assistant {
    background: rgba(255, 255, 255, 0.02);
}

.llm-message.system,
.llm-message.tool {
    background: rgba(247, 178, 103, 0.08);
    border-color: rgba(247, 178, 103, 0.22);
}

.llm-message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-2);
    font-size: 12px;
}

.llm-message-role {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.llm-message-content {
    white-space: pre-wrap;
    line-height: 1.65;
    word-break: break-word;
}

.llm-raw-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.llm-raw-block summary {
    cursor: pointer;
    padding: 10px 12px;
    color: var(--text-2);
}

.llm-raw-block pre {
    margin: 0;
    padding: 12px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.55;
    color: #d6e4ff;
}

.llm-advanced-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
}

.llm-advanced-panel summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.llm-composer {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    padding: 14px;
    display: grid;
    gap: 12px;
}

.llm-textarea {
    min-height: 140px;
}

.llm-composer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.llm-stream-toggle {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--text-2);
    margin-right: auto;
}

.result-file-card {
    min-height: 180px;
    border-radius: 14px;
    border: 1px dashed var(--border-light);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(11, 14, 22, 0.9));
    padding: 18px 14px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
}

.result-file-ext {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-2);
    letter-spacing: 0.06em;
}

.result-file-name {
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}

.result-file-desc {
    color: var(--text-2);
    font-size: 12px;
}

@media (max-width: 900px) {
    .llm-messages {
        min-height: 280px;
        max-height: 48vh;
    }

    .llm-composer-actions {
        justify-content: stretch;
    }

    .llm-composer-actions .btn {
        flex: 1 1 auto;
    }
}

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