﻿.selection-box {
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    pointer-events: none;
    z-index: 50;
}

.selection-box.hidden {
    display: none;
}

:root {
    color-scheme: dark;
    --bg: #0b1020;
    --grid-color: rgba(18, 181, 246, 0.08);
    --panel-bg: rgba(16, 22, 40, 0.92);
    --panel-border: rgba(12, 21, 42, 0.6);
    --text-primary: #e8ecf3;
    --text-muted: #94a3c4;
    --accent: #5865f2;
    --accent-soft: rgba(88, 101, 242, 0.2);
    --accent-alt: #12b5f6;
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #ff7b72;
    --shadow-md: 0 32px 70px -42px rgba(8, 14, 24, 0.55);
    --shadow-lg: 0 50px 95px -56px rgba(8, 14, 24, 0.55);
    --toolbar-bg: rgba(10, 16, 28, 0.82);
    --node-border: color-mix(in srgb, var(--accent) 36%, transparent);
    --node-border-hover: color-mix(in srgb, var(--accent) 52%, transparent);
    --node-border-selected: color-mix(in srgb, var(--accent) 70%, transparent);
    --node-border-processing: color-mix(in srgb, var(--accent) 60%, transparent);
    --node-shadow: color-mix(in srgb, var(--accent) 30%, transparent);
    --node-shadow-hover: color-mix(in srgb, var(--accent) 45%, transparent);
    --node-shadow-selected: color-mix(in srgb, var(--accent) 55%, transparent);
    --progress-accent: var(--accent);
}

body[data-theme="starry"] {
    color-scheme: dark;
}

body[data-theme="sunset"] {
    color-scheme: dark;
    --bg: #1f1b24;
    --grid-color: rgba(249, 109, 128, 0.1);
    --panel-bg: rgba(42, 33, 48, 0.94);
    --panel-border: rgba(249, 109, 128, 0.28);
    --text-primary: #f9f3f1;
    --text-muted: #e3cfd6;
    --accent: #f96d80;
    --accent-soft: rgba(249, 109, 128, 0.22);
    --accent-alt: #fad643;
    --success: #6ee7b7;
    --warning: #fad643;
    --danger: #ff7b72;
    --shadow-md: 0 32px 70px -42px rgba(70, 30, 40, 0.6);
    --shadow-lg: 0 50px 95px -56px rgba(70, 30, 40, 0.55);
    --toolbar-bg: rgba(42, 33, 48, 0.9);
}

body[data-theme="industrial"] {
    color-scheme: dark;
    --bg: #1c2128;
    --grid-color: rgba(77, 143, 172, 0.1);
    --panel-bg: rgba(24, 30, 40, 0.94);
    --panel-border: rgba(90, 116, 138, 0.32);
    --text-primary: #e2e8f0;
    --text-muted: #9aa6b7;
    --accent: #4d8fac;
    --accent-soft: rgba(77, 143, 172, 0.2);
    --accent-alt: #7dc4a0;
    --success: #7dc4a0;
    --warning: #fbbf24;
    --danger: #ef6461;
    --shadow-md: 0 28px 70px -40px rgba(10, 16, 26, 0.55);
    --shadow-lg: 0 50px 95px -58px rgba(10, 16, 26, 0.55);
    --toolbar-bg: rgba(24, 30, 40, 0.88);
}

body[data-theme="blackgold"] {
    color-scheme: dark;
    --bg: #090909;
    --grid-color: rgba(212, 175, 55, 0.12);
    --panel-bg: rgba(18, 18, 18, 0.94);
    --panel-border: rgba(212, 175, 55, 0.4);
    --text-primary: #f5f5f5;
    --text-muted: #d1cfc5;
    --accent: #d4af37;
    --accent-soft: rgba(212, 175, 55, 0.22);
    --accent-alt: #6c63ff;
    --success: #6ee7b7;
    --warning: #facc15;
    --danger: #ff6584;
    --shadow-md: 0 32px 70px -42px rgba(10, 10, 10, 0.72);
    --shadow-lg: 0 54px 100px -60px rgba(10, 10, 10, 0.7);
    --toolbar-bg: rgba(18, 18, 18, 0.9);
}

body[data-theme="sunset"],
body[data-theme="industrial"],
body[data-theme="blackgold"] {
    --grid-color: color-mix(in srgb, var(--accent) 14%, transparent);
}
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    overflow: hidden;
}

.app-shell {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.workspace-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: default;
    background: radial-gradient(circle at center, rgba(124, 148, 255, 0.12), transparent 55%), var(--bg);
}

.workspace-stage {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
}

.workspace {
    position: absolute;
    top: 0;
    left: 0;
    width: 20000px;
    height: 20000px;
    background-image:
        linear-gradient(0deg, var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 160px 160px;
}

.workspace.add-image-mode,
.workspace.add-image-mode .image-node {
    cursor: copy;
}

.workspace.material-pick-mode,
.workspace.material-pick-mode .image-node {
    cursor: cell;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.empty-state.hidden {
    display: none;
}

.add-node-button {
    pointer-events: auto;
    width: 220px;
    height: 220px;
    border-radius: 28px;
    border: 1px dashed rgba(124, 148, 255, 0.45);
    background: rgba(124, 148, 255, 0.14);
    color: var(--accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 16px;
    letter-spacing: 0.6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 40px 80px -54px rgba(124, 148, 255, 0.55);
}

.add-node-button .plus {
    font-size: 56px;
    line-height: 1;
}

.add-node-button:hover {
    transform: translateY(-8px);
    background: rgba(124, 148, 255, 0.22);
}

.top-right-dock {
    position: absolute;
    top: 18px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    align-items: flex-end;
}

.dock-button {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--accent);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dock-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 45px -28px rgba(0, 0, 0, 0.55);
    background: rgba(255, 255, 255, 0.18);
}

.dock-pinterest {
    font-weight: 600;
}

.dock-pinterest .dock-icon {
    pointer-events: none;
}

.dock-help {
    font-size: 24px;
    font-weight: 600;
}

.dock-add {
    font-weight: 600;
    font-size: 30px;
}

.bottom-toolbar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 32px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    border-radius: 20px;
    background: var(--toolbar-bg);
    color: #fff;
    box-shadow: 0 34px 80px -52px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    z-index: 9;
}

.function-list {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.function-item {
    width: 110px;
    flex: 0 0 110px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 52%, transparent);
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--accent) 28%, rgba(255, 255, 255, 0.06)) 0%,
        color-mix(in srgb, var(--accent) 8%, rgba(255, 255, 255, 0.02)) 100%);
    color: #fff;
    cursor: grab;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 22px 48px -36px color-mix(in srgb, var(--accent) 55%, transparent);
}

.function-item:active {
    cursor: grabbing;
}

.function-item.dragging,
.function-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 48px -28px color-mix(in srgb, var(--accent) 65%, transparent);
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--accent) 42%, rgba(255, 255, 255, 0.14)) 0%,
        color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.04)) 100%);
}

.function-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: color-mix(in srgb, var(--accent) 65%, var(--text-primary));
}

.function-description {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    opacity: 0;
    max-height: 0;
    transform: translateY(6px);
    transition: opacity 0.22s ease, max-height 0.22s ease, transform 0.22s ease;
}

.function-item:hover .function-description,
.function-item.dragging .function-description {
    opacity: 1;
    max-height: 94px;
    transform: translateY(0);
}

.toolbar-button {
    height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    border: none;
    background: #ffffff;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.toolbar-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.toolbar-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px -24px rgba(255, 255, 255, 0.65);
}

.account-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 260px;
    padding: 20px 18px;
    border-radius: 16px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 12;
}

.account-menu.hidden {
    display: none;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.account-name {
    font-size: 16px;
    font-weight: 600;
}

.account-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-actions button {
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.account-actions button:hover {
    transform: translateY(-2px);
    background: rgba(148, 163, 184, 0.24);
}


.image-node {
    position: absolute;
    width: 280px;
    min-width: 160px;
    border-radius: 16px;
    cursor: grab;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border: 1px solid var(--node-border);
    background: color-mix(in srgb, var(--bg) 86%, var(--accent) 8%);
    box-shadow: 0 52px 126px -58px var(--node-shadow);
    overflow: visible;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}



.image-node.dragging {
    transform: scale(1.03);
}

.image-node:hover {
    transform: translateY(-3px);
    background: color-mix(in srgb, var(--bg) 80%, var(--accent) 15%);
    border-color: var(--node-border-hover);
    box-shadow: 0 52px 126px -58px var(--node-shadow-hover);
}


.image-node.selected {
    border-color: var(--node-border-selected);
    box-shadow: 0 58px 144px -60px var(--node-shadow-selected);
    background: color-mix(in srgb, var(--bg) 78%, var(--accent) 20%);
}


.image-node[data-state="processing"] {
    border-color: var(--node-border-processing);
}


.image-node[data-state="success"] {
    border-color: color-mix(in srgb, var(--success) 70%, transparent);
}


.image-node[data-state="error"] {
    border-color: color-mix(in srgb, var(--danger) 70%, transparent);
}


.image-node .node-image-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 160px;
    aspect-ratio: 2 / 1;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(17, 25, 42, 0.98) 0%, rgba(9, 13, 24, 0.98) 100%);
    border: none;
    box-shadow: inset 0 0 0 1px rgba(12, 18, 32, 0.38), 0 34px 92px -54px rgba(5, 8, 16, 0.62);
}

.image-node.skeleton .node-image {
    opacity: 0;
}

.image-node.skeleton .node-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.16) 40%, rgba(255, 255, 255, 0.04) 80%);
    transform: translateX(-100%);
    animation: nodeSkeleton 1.6s infinite ease;
    pointer-events: none;
}

.node-image-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    isolation: isolate;
}

.node-image {
    width: 100%;
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    transform: translate(var(--image-pan-x, 0px), var(--image-pan-y, 0px)) scale(var(--image-scale, 1));
}

.image-node[data-state="processing"] .node-image {
    filter: blur(3.2px);
    --image-scale: 1.02;
    opacity: 0.75;
}

.node-progress-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: radial-gradient(
        circle at 50% 40%,
        color-mix(in srgb, var(--accent) 32%, rgba(255, 255, 255, 0.14)),
        color-mix(in srgb, var(--bg, #0b1020) 80%, rgba(10, 16, 28, 0.68))
    );
    box-shadow: inset 0 0 40px color-mix(in srgb, var(--accent) 20%, rgba(8, 12, 20, 0.35));
    backdrop-filter: blur(1.6px);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
    z-index: 3;
}

.image-node.processing .node-progress-overlay,
.image-node[data-state="processing"] .node-progress-overlay {
    opacity: 1;
    transform: scale(1);
}

.node-progress-pulse {
    position: absolute;
    inset: 24%;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent) 82%, rgba(255, 255, 255, 0.2));
    opacity: 0;
    transform: scale(0.78);
}

.image-node.processing .node-progress-pulse,
.image-node[data-state="processing"] .node-progress-pulse {
    opacity: 1;
    animation: nodeOverlayPulse 1.9s ease-out infinite;
    border-color: color-mix(in srgb, var(--accent) 90%, rgba(255, 255, 255, 0.22));
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 15%, rgba(255, 255, 255, 0.04)), 0 0 30px -12px var(--progress-accent);
}

.node-progress-content {
    position: relative;
    z-index: 1;
    padding: 10px 22px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent) 12%, rgba(6, 12, 24, 0.55));
    border: 1px solid color-mix(in srgb, var(--accent) 60%, rgba(255, 255, 255, 0.18));
    box-shadow: 0 20px 46px -28px rgba(0, 0, 0, 0.6);
}

.node-progress-number {
    font-size: clamp(22px, 3.4vw, 40px);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.node-overlay {
    position: absolute;
    left: 0;
    right: 0;
    padding: 12px;
    display: flex;
    z-index: 2;
}

.node-overlay-top {
    top: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 14, 26, 0.55), transparent 70%);
}

.node-overlay-bottom {
    bottom: 0;
    align-items: flex-end;
    gap: 12px;
    background: linear-gradient(0deg, rgba(8, 12, 24, 0.78), transparent 68%);
    border-radius: 0 0 18px 18px;
    pointer-events: none;
}

.node-overlay-bottom > * {
    pointer-events: auto;
}

.node-overlay-bottom .node-compare {
    margin-left: auto;
}

@keyframes nodeSkeleton {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes nodeOverlayPulse {
    0% {
        transform: scale(0.75);
        opacity: 0.45;
    }
    55% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.node-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    backdrop-filter: blur(8px);
    letter-spacing: 0.35px;
    white-space: nowrap;
}

.node-badge.node-name {
    font-weight: 600;
}

.node-badge.node-workflow {
    background: rgba(74, 108, 255, 0.88);
    box-shadow: 0 16px 36px -24px rgba(74, 108, 255, 0.6);
}

.image-node[data-state="success"] .node-badge.node-workflow {
    background: color-mix(in srgb, var(--success) 82%, transparent);
    box-shadow: 0 18px 40px -26px color-mix(in srgb, var(--success) 55%, transparent);
}


.image-node[data-state="error"] .node-badge.node-workflow {
    background: color-mix(in srgb, var(--danger) 82%, transparent);
    box-shadow: 0 18px 40px -26px color-mix(in srgb, var(--danger) 55%, transparent);
}


.node-badge.hidden {
    display: none;
}

.node-compare {
    position: static;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.65);
    color: rgba(248, 250, 252, 0.92);
    font-size: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.node-compare .ico {
    font-size: 12px;
    pointer-events: none;
}

.node-compare:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 148, 255, 0.45);
    background: rgba(124, 148, 255, 0.18);
    box-shadow: 0 14px 30px -22px rgba(12, 18, 32, 0.7);
}

.node-compare:focus-visible {
    outline: 2px solid rgba(124, 148, 255, 0.7);
    outline-offset: 2px;
}

.node-compare.hidden {
    display: none;
}

.node-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 14px;
    min-height: 28px;
    border-radius: 0 0 24px 24px;
    background: linear-gradient(180deg, rgba(11, 18, 34, 0.96) 0%, rgba(6, 10, 20, 0.98) 100%);
    border: none;
    border-top: 1px solid rgba(17, 23, 40, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px -28px rgba(4, 6, 14, 0.72);
    line-height: 1.1;
}

.node-footer .node-status-pill {
    flex-shrink: 0;
    justify-self: start;
}

.node-footer .node-status {
    font-size: 9px;
    letter-spacing: 0.04em;
}

.node-footer .node-resolution {
    justify-self: start;
    text-align: left;
    font-size: 9px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.88);
    letter-spacing: 0.08em;
}

.node-variant-switch {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.variant-btn {
    border: none;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(226, 232, 240, 0.68);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.variant-btn:hover:not(.active):not(:disabled) {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.12);
}

.variant-btn:focus-visible {
    outline: 2px solid rgba(124, 148, 255, 0.65);
    outline-offset: 1px;
}

.variant-btn.active {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent) 90%, white 10%),
        color-mix(in srgb, var(--accent) 70%, transparent 30%)
    );
    color: #070b18;
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 75%, transparent);
    transform: translateY(-1px);
}

.variant-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.node-footer .node-compare {
    justify-self: end;
}

.node-edit-button {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    color: rgba(226, 232, 240, 0.86);
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 30px -20px rgba(8, 10, 20, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.node-edit-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px);
    box-shadow: 0 20px 36px -18px rgba(12, 16, 32, 0.9);
}

.node-edit-button.active {
    border-color: color-mix(in srgb, var(--accent) 75%, white 25%);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent) 92%, white 8%),
        color-mix(in srgb, var(--accent) 70%, transparent 30%)
    );
    color: #060916;
    box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.node-edit-icon::before {
    content: '✎';
    font-size: 13px;
    color: currentColor;
}

.node-edit-button.active .node-edit-icon::before {
    color: currentColor;
}

.image-node.editing-active {
    cursor: default;
    border-color: var(--node-border-selected);
    box-shadow: 0 58px 144px -50px var(--node-shadow-selected);
}

.image-node.editing-active .node-resize-handle {
    opacity: 0;
    pointer-events: none;
}

.node-editing-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2;
}

.image-node.editing-active .node-editing-layer,
.node-editing-layer.active {
    pointer-events: auto;
    opacity: 1;
}

.node-editing-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: auto;
    margin: 6px 0 0 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(6, 10, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -32px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    transition: opacity 0.18s ease, transform 0.2s ease;
    z-index: 5;
}

.node-editing-prompt {
    flex: 0 1 45%;
    min-width: 160px;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.node-editing-prompt-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    color: #f7f8fa;
    font-size: 7px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.node-editing-prompt-input::placeholder {
    color: rgba(247, 248, 250, 0.6);
}

.node-editing-prompt-input:focus {
    border-color: rgba(255, 166, 48, 0.65);
    box-shadow: 0 0 0 1px rgba(255, 166, 48, 0.2);
}

.image-node.editing-active .node-editing-panel,
.node-editing-panel.active {
    pointer-events: auto;
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.node-editing-add-image {
    width: auto;
    min-width: 38px;
    height: 38px;
    margin-top: 0;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    flex: 0 0 auto;
    order: 1;
    padding: 0 12px;
}

.node-editing-add-image:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

.node-editing-add-image.active {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
}

.node-editing-add-icon {
    font-size: 20px;
    line-height: 1;
}

.node-editing-delete {
    width: auto;
    min-width: 38px;
    height: 38px;
    margin-top: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(220, 38, 38, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex: 0 0 auto;
    order: 0;
    padding: 0 12px;
}

.node-editing-send {
    width: auto;
    min-width: 48px;
    height: 38px;
    margin-top: 0;
    border-radius: 10px;
    border: 1px solid rgba(74, 108, 255, 0.45);
    background: rgba(74, 108, 255, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex: 0 0 auto;
    order: 3;
    padding: 0 14px;
}

.node-editing-send:hover {
    border-color: rgba(74, 108, 255, 0.7);
    background: rgba(74, 108, 255, 0.3);
}

.node-editing-delete:hover {
    border-color: rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.3);
}

.node-editing-delete-icon {
    font-size: 18px;
    line-height: 1;
}

.node-editing-stage {
    position: absolute;
    inset: 0;
    border-radius: 16px 16px 0 0;
    pointer-events: auto;
    isolation: isolate;
    z-index: 1;
}

.node-editing-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    pointer-events: none;
    transition: border-color 0.2s ease;
}

.node-editing-stage.drop-target::after {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.node-editing-stage.panning-base::after {
    border-color: rgba(255, 255, 255, 0.35);
}

.node-editing-elements {
    position: absolute;
    inset: 0;
}

.node-editing-hint {
    position: absolute;
    inset: auto 16px 16px 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(12, 18, 32, 0.75);
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.node-editing-hint.hidden {
    opacity: 0;
}

.node-editing-toolbar {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    order: 2;
}

.node-editing-toolbar-title {
    display: none;
}

.node-editing-shapes {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.node-editing-shape-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.node-editing-shape-button:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.node-editing-shape-button.dragging {
    opacity: 0.5;
}

.editing-element {
    position: absolute;
    border: none;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    cursor: move;
    transform-origin: 0 0;
}
.editing-element.editing-element-shape {
    z-index: 1;
}
.editing-element.editing-element-image {
    z-index: 2;
}

.editing-element img.editing-element-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.editing-element.selected {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    box-shadow: 0 28px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}

.editing-element.editing-element-shape {
    border: none;
    background: transparent;
    box-shadow: none;
}

.editing-element.editing-element-shape.selected {
    border: none;
    box-shadow: none;
}

.editing-element.rotating {
    border-style: dashed;
}

.editing-element.rotating::after {
    content: '⟳';
    position: absolute;
    top: -14px;
    right: -14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(6, 10, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--accent);
    box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.8);
}

.editing-element-content {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: block;
}

.editing-element-content.editing-shape-square,
.editing-element-content.editing-shape-rect,
.editing-element-content.editing-shape-circle {
    background: #fff;
}

.editing-element-content.editing-shape-circle {
    border-radius: 999px;
}

.editing-resize-handle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #060a14;
    background: var(--accent);
    position: absolute;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.editing-element.selected .editing-resize-handle {
    opacity: 1;
}

.editing-resize-handle.handle-n { top: 0; left: 50%; }
.editing-resize-handle.handle-s { top: 100%; left: 50%; }
.editing-resize-handle.handle-e { top: 50%; left: 100%; }
.editing-resize-handle.handle-w { top: 50%; left: 0; }
.editing-resize-handle.handle-ne { top: 0; left: 100%; }
.editing-resize-handle.handle-nw { top: 0; left: 0; }
.editing-resize-handle.handle-se { top: 100%; left: 100%; }
.editing-resize-handle.handle-sw { top: 100%; left: 0; }

.toolbar-button-wide {
    min-width: 220px;
    justify-content: center;
    font-size: 16px;
}


.node-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.72);
    border: none;
    box-shadow: 0 12px 26px -20px rgba(0, 0, 0, 0.6);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    pointer-events: none;
}

.node-status-pill.hidden {
    display: none;
}

.node-status-pill .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.9);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

.node-status-pill[data-state="processing"] {
    background: rgba(74, 108, 255, 0.92);
    border: none;
    color: #fff;
}

.node-status-pill[data-state="processing"] .status-dot {
    background: #4a6cff;
    box-shadow: 0 0 0 4px rgba(74, 108, 255, 0.24);
}

.node-status-pill[data-state="success"] {
    background: rgba(34, 197, 94, 0.9);
    border: none;
    color: #f0fff5;
}

.node-status-pill[data-state="success"] .status-dot {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.24);
}

.node-status-pill[data-state="error"] {
    background: rgba(240, 67, 92, 0.9);
    border: none;
    color: #ffe5e8;
}

.node-status-pill[data-state="error"] .status-dot {
    background: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.24);
}

.node-status-pill[data-state="idle"] {
    background: rgba(15, 23, 42, 0.68);
    border: none;
    color: rgba(248, 250, 252, 0.85);
}

.node-resizer {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--accent);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize;
    box-shadow: 0 16px 32px -22px rgba(0, 0, 0, 0.65);
    transition: background 0.2s ease, color 0.2s ease;
}

.node-resizer:hover {
    background: rgba(15, 23, 42, 0.85);
}

.node-drop-hint {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translate(-50%, -4px);
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(74, 108, 255, 0.92);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.35px;
    white-space: nowrap;
    display: none;
    pointer-events: none;
    box-shadow: 0 24px 54px -32px rgba(74, 108, 255, 0.65);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.image-node.node-drop-target .node-image-wrapper {
    box-shadow: inset 0 0 0 1px var(--node-border-selected), 0 44px 120px -56px var(--node-shadow-selected);
}


.image-node.node-drop-target .node-drop-hint {
    display: block;
    opacity: 1;
    transform: translate(-50%, 0);
}

body.dragging-workflow .image-node {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

body.dragging-workflow .image-node:not(.node-drop-target) {
    opacity: 0.9;
}

.compare-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 13, 24, 0.72);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.compare-overlay.hidden {
    display: none;
}

.compare-dialog {
    width: min(90vw, 900px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-header h2 {
    margin: 0;
    font-size: 20px;
}

.compare-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: rgba(148, 163, 184, 0.22);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.compare-body {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.68);
}

.compare-pane {
    position: relative;
}

.compare-pane img {
    width: 100%;
    display: block;
    object-fit: contain;
}

.compare-split {
    position: absolute;
    inset: 0;
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.12s ease;
    overflow: hidden;
}

.compare-split::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.compare-split.checkerboard::before {
    opacity: 1;
    background-color: rgba(248, 249, 255, 0.92);
    background-image:
        linear-gradient(45deg, rgba(192, 198, 216, 0.45) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(192, 198, 216, 0.45) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(192, 198, 216, 0.45) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(192, 198, 216, 0.45) 75%);
    background-size: 28px 28px;
    background-position: 0 0, 14px 0, 14px -14px, 0 14px;
}

.compare-split img {
    position: relative;
    z-index: 1;
}

/* Selection group pause control */
.selection-group-pause {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.18);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.selection-group-pause:hover {
    background: rgba(0,0,0,0.28);
    border-color: rgba(255,255,255,0.5);
}

.selection-group-pause:active {
    transform: scale(0.95);
}

.selection-group-container.group-paused {
    border-color: rgba(234, 179, 8, 0.65);
    box-shadow: 0 8px 24px rgba(234, 179, 8, 0.2);
    animation: none;
}

.selection-group-container.group-paused .selection-group-header {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.95), rgba(245, 158, 11, 0.9));
}

.compare-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.72);
    cursor: col-resize;
}

.compare-slider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent);
}

.toast {
    position: fixed;
    top: 28px;
    right: 32px;
    min-width: 220px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(9, 13, 24, 0.85);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 22px 48px -28px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 30;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: rgba(34, 197, 94, 0.88);
}

.toast.error {
    background: rgba(240, 67, 92, 0.9);
}

.trash-zone {
    position: fixed;
    top: 50%;
    left: 40px;
    width: 140px;
    height: 170px;
    border-radius: 24px;
    border: 2px dashed rgba(148, 163, 184, 0.36);
    background: rgba(15, 23, 42, 0.76);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(226, 232, 240, 0.92);
    transform: translateY(-50%) scale(0.94);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 14;
    backdrop-filter: blur(10px);
}

.trash-zone.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.trash-zone.active {
    transform: translateY(-50%) scale(1.06);
    border-color: rgba(240, 67, 92, 0.55);
    background: rgba(240, 67, 92, 0.22);
    box-shadow: 0 26px 60px -28px rgba(240, 67, 92, 0.45);
}

.trash-zone .trash-icon {
    font-size: 42px;
    line-height: 1;
}

.trash-zone .trash-label {
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.2px;
}

.download-zone {
    position: fixed;
    top: 50%;
    right: 40px;
    width: 140px;
    height: 170px;
    border-radius: 24px;
    border: 2px dashed rgba(74, 108, 255, 0.42);
    background: rgba(15, 23, 42, 0.76);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(226, 232, 240, 0.92);
    transform: translateY(-50%) scale(0.94);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 14;
    backdrop-filter: blur(10px);
}

.download-zone.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.download-zone.active {
    transform: translateY(-50%) scale(1.06);
    border-color: rgba(124, 148, 255, 0.6);
    background: rgba(124, 148, 255, 0.24);
    box-shadow: 0 26px 60px -28px rgba(124, 148, 255, 0.45);
}

.download-zone .download-icon {
    font-size: 42px;
    line-height: 1;
}

.download-zone .download-label {
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.2px;
}

.clone-zone {
    position: fixed;
    top: calc(50% + 230px);
    right: 40px;
    width: 140px;
    height: 170px;
    border-radius: 24px;
    border: 2px dashed rgba(34, 197, 94, 0.38);
    background: rgba(15, 23, 42, 0.76);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(226, 232, 240, 0.92);
    transform: translateY(-50%) scale(0.94);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 13;
    backdrop-filter: blur(10px);
}

.clone-zone.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.clone-zone.active {
    transform: translateY(-50%) scale(1.06);
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(34, 197, 94, 0.24);
    box-shadow: 0 26px 60px -28px rgba(34, 197, 94, 0.45);
}

.clone-zone .clone-icon {
    font-size: 38px;
    line-height: 1;
}

.clone-zone .clone-label {
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.2px;
}


@media (max-width: 900px) {
    .bottom-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .function-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .function-item {
        width: auto;
        flex: 1 1 140px;
    }

    .dock-button {
        width: 50px;
        height: 50px;
    }

    .account-menu {
        right: 16px;
    }
}
.theme-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
    z-index: 15;
}

.theme-menu.hidden {
    display: none;
}

.theme-menu-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    z-index: 16;
}

.help-panel.hidden {
    display: none;
}

.help-panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    font-size: 14px;
}

.help-panel-body img {
    width: 160px;
    height: auto;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.5);
}

.help-panel-body p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: border 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.theme-option:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    transform: translateY(-1px);
}

.theme-option.active {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.theme-option-swatches {
    display: flex;
    gap: 4px;
    min-width: 54px;
    justify-content: flex-start;
}

.theme-option-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--swatch-color, var(--accent));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.theme-option-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.theme-option-name {
    font-size: 13px;
    font-weight: 600;
}

.theme-option-desc {
    font-size: 11px;
    color: var(--text-muted);
}







/* Material workflow panel */

.material-overlay {

    position: fixed;

    inset: 0;

    background: transparent;

    z-index: 180;

    pointer-events: none;

}



.material-overlay.hidden {

    opacity: 0;

    visibility: hidden;

}



.material-panel {

    position: absolute;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

    width: auto;

    min-width: 200px;

    max-width: calc(100vw - 48px);

    max-height: calc(100vh - 48px);

    border-radius: 16px;

    border: 1px solid var(--node-border);

    background: color-mix(in srgb, var(--bg) 86%, var(--accent) 8%);

    box-shadow: 0 52px 126px -58px var(--node-shadow);

    padding: 12px 14px 10px;

    display: flex;

    flex-direction: column;

    gap: 10px;

    box-sizing: border-box;

    overflow: hidden;

    pointer-events: auto;

}



.material-panel-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 8px;

}



.material-panel-title {

    font-size: 14px;

    font-weight: 600;

    margin-bottom: 2px;

}



.material-panel-subtitle {

    font-size: 13px;

    color: var(--text-muted);

}



.material-panel-close {

    border: none;

    background: transparent;

    color: var(--text-muted);

    font-size: 16px;

    line-height: 1;

    cursor: pointer;

    padding: 2px 6px;

    border-radius: 10px;

    transition: background 0.2s ease, color 0.2s ease;

}



.material-panel-close:hover {

    background: color-mix(in srgb, var(--accent) 18%, transparent);

    color: var(--text-primary);

}



.material-panel-body {

    display: flex;

    flex-direction: column;

    gap: 8px;

    flex: 1;

    min-height: 0;

    overflow-y: auto;

}



.material-field {

    display: flex;

    flex-direction: column;

    gap: 6px;

}



.material-field-label {

    font-size: 14px;

    font-weight: 600;

}



.material-field textarea {

    width: 100%;

    border-radius: 14px;

    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);

    background: color-mix(in srgb, var(--panel-bg) 80%, rgba(255, 255, 255, 0.02));

    color: var(--text-primary);

    font-size: 12px;

    padding: 8px;

    min-height: 32px;

    resize: none;

}


.material-canvas-section {

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 6px;

}



.material-canvas-slot {

    position: relative;

    flex: 1;

    border-radius: 14px;

    border: 1px dashed color-mix(in srgb, var(--panel-border) 50%, transparent);

    background: color-mix(in srgb, var(--panel-bg) 80%, rgba(255, 255, 255, 0.02));

    overflow: hidden;

    min-height: 120px;

}



.material-canvas-slot.has-image {

    border-style: solid;

    border-color: color-mix(in srgb, var(--accent) 60%, transparent);

}



.material-canvas-slot.picking {

    border-color: var(--accent);

    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);

}

.material-canvas-slot.has-image .material-canvas-trigger {

    opacity: 0;

    pointer-events: none;

    visibility: hidden;

}

.material-canvas-slot.loading::after {

    content: '· · ·';

    position: absolute;

    top: 8px;

    left: 10px;

    font-size: 10px;

    letter-spacing: 4px;

    color: var(--text-muted);

    animation: material-slot-pulse 1.2s ease-in-out infinite;

}

@keyframes material-slot-pulse {

    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }

}



.material-canvas-trigger {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    border: none;

    background: transparent;

    color: var(--text-muted);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 6px;

    font-size: 10px;

    cursor: pointer;

}

.material-canvas-trigger:focus-visible {

    outline: 2px solid color-mix(in srgb, var(--accent) 80%, transparent);

    outline-offset: 4px;

}

.material-canvas-hint {

    color: var(--text-muted);

    font-size: 10px;

}

.material-canvas-slot.picking .material-canvas-hint {

    color: var(--text-primary);

}



.material-canvas-plus {

    font-size: 32px;

    color: var(--accent);

    line-height: 1;

}



.material-canvas-preview {

    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(4, 7, 18, 0.25);

}



.material-canvas-preview.hidden {

    display: none;

}



.material-canvas-preview img {

    width: 100%;

    height: 100%;

    object-fit: contain;

}



.material-canvas-remove {

    position: absolute;

    top: 8px;

    right: 8px;

    border: none;

    border-radius: 50%;

    width: 20px;

    height: 20px;

    background: rgba(6, 9, 20, 0.8);

    color: white;

    font-size: 12px;

    line-height: 1;

    cursor: pointer;

}



.material-canvas-remove:hover {

    background: rgba(8, 12, 24, 0.92);

}



.material-panel-footer {

    display: flex;

    justify-content: flex-end;

    gap: 6px;

}



.material-button {

    border: 1px solid color-mix(in srgb, var(--panel-border) 60%, transparent);

    border-radius: 10px;

    background: transparent;

    color: var(--text-primary);

    padding: 6px 12px;

    cursor: pointer;

    font-size: 12px;

    transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;

}



.material-button.ghost:hover {

    background: color-mix(in srgb, var(--accent) 12%, transparent);

    border-color: color-mix(in srgb, var(--accent) 40%, transparent);

}



.material-button.primary {

    background: var(--accent);

    border-color: var(--accent);

    color: #0b1020;

    font-weight: 600;

}



.material-button.primary:hover {

    background: color-mix(in srgb, var(--accent) 80%, white 20%);

}



/* Pinterest collection panel */

.pinterest-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: clamp(320px, 25vw, 420px);
    background: var(--panel-bg);
    border-left: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    box-shadow: -12px 0 28px rgba(0, 0, 0, 0.28);
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 130;
}

.pinterest-panel.pinterest-open {
    transform: translateX(0);
}

.pinterest-panel.pinterest-hidden {
    pointer-events: none;
}

body.pinterest-panel-open #workspaceWrapper {
    margin-right: clamp(320px, 25vw, 420px);
    transition: margin-right 0.3s ease;
}

.pinterest-panel.is-loading .pinterest-input button span {
    opacity: 0;
}

.pinterest-panel.is-loading .pinterest-input button::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    border-top-color: transparent;
    animation: pinterest-spin 0.8s linear infinite;
}

@keyframes pinterest-spin {
    to {
        transform: rotate(360deg);
    }
}

.pinterest-drawer {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    position: relative;
}

.pinterest-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 12px;
    padding: 20px 20px 16px;
    background: color-mix(in srgb, var(--panel-bg) 70%, var(--toolbar-bg) 30%);
    border-bottom: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
}

.pinterest-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.pinterest-status {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-muted);
}

.pinterest-clear {
    align-self: start;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0 8px;
    height: 28px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.pinterest-clear:hover {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.pinterest-close {
    align-self: start;
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.pinterest-close:hover {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
}

.pinterest-results {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px 12px;
    position: relative;
}

.pinterest-grid {
    position: relative;
    min-height: 160px;
}

.pinterest-panel .pinterest-placeholder {
    padding: 18px;
    margin-top: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--panel-bg) 85%, transparent);
    border: 1px dashed color-mix(in srgb, var(--panel-border) 65%, transparent);
}

.pinterest-panel .pinterest-placeholder.hidden {
    display: none;
}

.pinterest-load-more {
    display: block;
    margin: 16px auto 8px;
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--panel-border) 65%, transparent);
    background: color-mix(in srgb, var(--panel-bg) 85%, transparent);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.pinterest-load-more:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.pinterest-load-more:disabled {
    opacity: 0.6;
    cursor: default;
}

.pinterest-load-more.hidden {
    display: none;
}

.pinterest-card {
    position: absolute;
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel-bg) 90%, transparent);
    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    cursor: grab;
    overflow: visible;
}

.pinterest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.pinterest-card.dragging {
    opacity: 0.78;
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
    cursor: grabbing;
}

.pinterest-card-figure {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel-bg) 75%, transparent);
}

.pinterest-card img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: color-mix(in srgb, var(--panel-bg) 70%, transparent);
    transition: transform 0.2s ease;
}

.pinterest-card:hover img {
    transform: scale(1.01);
}

.pinterest-card-size {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(12, 17, 26, 0.82);
    color: var(--text-primary);
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.2px;
    pointer-events: none;
}

.pinterest-card-badge {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(12, 17, 26, 0.85);
    color: var(--text-primary);
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
}

.pinterest-card-link {
    display: block;
    margin: 10px 12px 12px;
    font-size: 12px;
    color: var(--accent);
    text-align: center;
    text-decoration: none;
    word-break: break-all;
}

.pinterest-card-link:hover {
    text-decoration: underline;
}

.pinterest-card.pinterest-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.pinterest-input {
    display: flex;
    gap: 8px;
    padding: 16px 20px 20px;
    border-top: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    background: color-mix(in srgb, var(--panel-bg) 82%, transparent);
}
.pinterest-limit-group {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    background: color-mix(in srgb, var(--panel-bg) 85%, transparent);
    flex: 0 0 auto;
}

.pinterest-limit-toggle {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    min-width: 60px;
}

.pinterest-limit-toggle:hover,
.pinterest-limit-group.is-open .pinterest-limit-toggle {
    color: var(--accent);
}

.pinterest-limit-group.is-open .pinterest-limit-toggle {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.pinterest-limit-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    background: color-mix(in srgb, var(--panel-bg) 95%, transparent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    min-width: 100%;
    z-index: 20;
}

.pinterest-limit-group.is-open .pinterest-limit-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pinterest-limit-option {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: center;
}

.pinterest-limit-option:hover,
.pinterest-limit-option.is-active {
    background: color-mix(in srgb, var(--accent) 72%, transparent);
    color: #fff;
}

.pinterest-limit-option[hidden] {
    display: none;
}

.pinterest-panel.is-loading .pinterest-limit-toggle,
.pinterest-panel.is-loading .pinterest-limit-option {
    pointer-events: none;
    opacity: 0.6;
}

.pinterest-input input {
    flex: 1 1 auto;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    padding: 10px 14px;
    font-size: 14px;
    background: color-mix(in srgb, var(--panel-bg) 90%, transparent);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pinterest-input input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.pinterest-input button {
    position: relative;
    width: 76px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
}

.pinterest-input button span {
    pointer-events: none;
}

.pinterest-input button:hover {
    background: color-mix(in srgb, var(--accent) 80%, #ffffff 10%);
}

.pinterest-input button.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.pinterest-input button.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    border-top-color: transparent;
    animation: pinterest-spin 0.8s linear infinite;
}

.pinterest-input button.is-loading span {
    opacity: 0;
}

@media (max-width: 960px) {
    .pinterest-panel {
        width: min(85vw, 420px);
    }

    body.pinterest-panel-open #workspaceWrapper {
        margin-right: min(85vw, 420px);
    }

}

.pinterest-card.pinterest-card-disabled:hover {
    transform: none;
    box-shadow: none;
}


.pinterest-input {
    display: flex;
    gap: 8px;
    padding: 12px 18px 18px;
}

.pinterest-input input {
    flex: 1;
    border: 1px solid color-mix(in srgb, var(--panel-border) 70%, transparent);
    background: color-mix(in srgb, var(--panel-bg) 85%, transparent);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
}

.pinterest-input input:focus {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.pinterest-input button {
    border: none;
    background: color-mix(in srgb, var(--accent) 60%, transparent);
    color: #fff;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pinterest-input button:hover {
    opacity: 0.9;
}

.pinterest-input button.is-loading {
    opacity: 0.6;
    cursor: progress;
}

