:root {
    --bg-primary: var(--octap-bg, #0b0e13);
    --panel-bg: var(--octap-panel-bg, rgba(16, 20, 25, 0.9));
    --panel-line: var(--octap-panel-line, rgba(255, 255, 255, 0.05));
    --panel-hover: var(--octap-panel-hover, rgba(255, 255, 255, 0.08));
    --text-primary: var(--octap-text, #f5f6fe);
    --text-secondary: var(--octap-muted, #a9abb2);
    --text-tertiary: var(--octap-faint, #777d87);
    --accent: var(--octap-accent, #ffa84f);
    --accent-strong: var(--octap-accent-strong, #ff9500);
    --accent-soft: var(--octap-accent-soft, rgba(255, 168, 79, 0.14));
    --node-port-border: var(--octap-node-port-border, rgba(255, 168, 79, 0.28));
    --node-port-bg: var(--octap-node-port-bg, rgba(255, 168, 79, 0.12));
    --node-port-fg: var(--octap-node-port-fg, rgba(255, 205, 142, 0.72));
    --node-port-hover-border: var(--octap-node-port-hover-border, rgba(255, 179, 71, 0.8));
    --node-port-hover-bg: var(--octap-node-port-hover-bg, rgba(255, 168, 79, 0.2));
    --node-port-hover-fg: var(--octap-node-port-hover-fg, rgba(255, 255, 255, 0.95));
    --node-port-halo: var(--octap-node-port-halo, rgba(255, 179, 71, 0.12));
    --node-port-glow: var(--octap-node-port-glow, rgba(255, 168, 79, 0.36));
    --gradient-primary: var(--octap-gradient-primary, linear-gradient(135deg, #ffb347 0%, #ff9500 100%));
    --node-bg: color-mix(in srgb, var(--octap-surface, rgba(18, 22, 28, 0.82)) 90%, transparent);
    --node-border: var(--octap-accent-line, rgba(255, 168, 79, 0.16));
    --grid-dot: var(--octap-grid-dot, rgba(140, 168, 210, 0.1));
    --sidebar-bg: var(--octap-panel-bg, rgba(16, 20, 25, 0.9));
    --sidebar-line: var(--octap-panel-line, rgba(255, 255, 255, 0.05));
    --sidebar-muted: rgba(255, 255, 255, 0.22);
    --sidebar-shadow: var(--octap-shadow-sidebar, 0 0 40px rgba(255, 168, 79, 0.05), 0 8px 32px rgba(0, 0, 0, 0.4));
    --action-bg: var(--octap-action-bg, rgba(255, 255, 255, 0.04));
    --action-border: var(--octap-action-border, rgba(255, 255, 255, 0.08));
    --action-hover-bg: var(--octap-action-hover-bg, rgba(255, 255, 255, 0.08));
    --action-shadow: none;
    --action-hover-shadow: 0 0 20px rgba(255, 168, 79, 0.08);
    --shadow-lg: var(--octap-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.48));
    --radius-md: var(--octap-radius-lg, 12px);
    --radius-sm: var(--octap-radius-md, 10px);
    --grid-spacing: var(--octap-grid-spacing, 24px);
    --grid-dot-size: var(--octap-grid-dot-size, 1px);
    --selection-bg: var(--octap-selection-bg, rgba(0, 95, 215, 0.78));
    --selection-fg: var(--octap-selection-fg, #ffffff);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--octap-font-family-ui, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
    font-feature-settings: "kern" 1;
    font-size: var(--octap-font-14, 14px);
    font-weight: var(--octap-weight-regular, 400);
    letter-spacing: 0;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

::selection,
*::selection {
    background: var(--selection-bg);
    color: var(--selection-fg);
}

button {
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

body[data-theme="light"] {
    --bg-primary: var(--octap-bg, #ffffff);
    --panel-bg: var(--octap-panel-bg, rgba(255, 255, 255, 0.96));
    --panel-line: var(--octap-panel-line, rgba(18, 24, 35, 0.1));
    --panel-hover: var(--octap-panel-hover, rgba(18, 24, 35, 0.06));
    --text-primary: var(--octap-text, #171a20);
    --text-secondary: var(--octap-muted, #4f5968);
    --text-tertiary: var(--octap-faint, #7b8493);
    --accent: var(--octap-accent, #e68c0f);
    --accent-strong: var(--octap-accent-strong, #f5a02a);
    --accent-soft: var(--octap-accent-soft, rgba(230, 140, 15, 0.11));
    --node-port-border: var(--octap-node-port-border, rgba(230, 140, 15, 0.34));
    --node-port-bg: var(--octap-node-port-bg, rgba(230, 140, 15, 0.12));
    --node-port-fg: var(--octap-node-port-fg, rgba(176, 91, 5, 0.76));
    --node-port-hover-border: var(--octap-node-port-hover-border, rgba(230, 140, 15, 0.82));
    --node-port-hover-bg: var(--octap-node-port-hover-bg, rgba(230, 140, 15, 0.2));
    --node-port-hover-fg: var(--octap-node-port-hover-fg, rgba(71, 39, 3, 0.95));
    --node-port-halo: var(--octap-node-port-halo, rgba(230, 140, 15, 0.12));
    --node-port-glow: var(--octap-node-port-glow, rgba(230, 140, 15, 0.28));
    --gradient-primary: var(--octap-gradient-primary, linear-gradient(135deg, #f5a02a 0%, #e68c0f 100%));
    --node-bg: var(--octap-surface, rgba(255, 255, 255, 0.94));
    --node-border: var(--octap-accent-line, rgba(230, 140, 15, 0.18));
    --grid-dot: var(--octap-grid-dot, rgba(18, 24, 35, 0.07));
    --sidebar-bg: var(--octap-panel-bg, rgba(255, 255, 255, 0.96));
    --sidebar-line: var(--octap-panel-line, rgba(18, 24, 35, 0.08));
    --sidebar-muted: rgba(18, 24, 35, 0.24);
    --sidebar-shadow: var(--octap-shadow-sidebar, 0 12px 34px rgba(18, 24, 35, 0.12));
    --action-bg: var(--octap-action-bg, rgba(255, 255, 255, 0.98));
    --action-border: var(--octap-action-border, rgba(18, 24, 35, 0.11));
    --action-hover-bg: var(--octap-action-hover-bg, rgba(255, 255, 255, 1));
    --action-shadow: 0 1px 2px rgba(18, 24, 35, 0.05);
    --action-hover-shadow: 0 5px 16px rgba(18, 24, 35, 0.08);
    --shadow-lg: var(--octap-shadow-lg, 0 20px 54px rgba(18, 24, 35, 0.1));
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    min-height: 100vh;
    background: var(--bg-primary);
}

.top-bar {
    position: fixed;
    inset: 0 0 auto;
    height: 60px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    pointer-events: none;
}

.top-bar:has(.top-menu-trigger.open) {
    z-index: 1305;
}

.top-left,
.top-center-nav,
.top-right {
    pointer-events: auto;
}

.top-left,
.logo-group,
.top-center-nav,
.top-right,
.canvas-toolbar-shell,
.canvas-toolbar-items,
.top-global-actions,
.top-credit-group {
    display: flex;
    align-items: center;
}

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

.logo-group {
    gap: 11px;
}

.logo {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 4px 14px rgba(255, 149, 0, 0.38));
}

.logo img {
    display: block;
    width: auto;
    height: 36px;
    max-width: 36px;
    object-fit: contain;
}

.title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 760;
    line-height: 1;
}

.title b {
    color: var(--accent);
}

.top-menu-group {
    position: relative;
    display: grid;
    place-items: center;
}

.top-menu-trigger {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.top-menu-trigger:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.top-menu-trigger.open {
    color: var(--text-primary);
    background: var(--panel-hover);
    transform: rotate(180deg);
}

.top-menu-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    z-index: 220;
    min-width: 232px;
    padding: 7px;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: rgba(14, 17, 23, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    color: var(--text-primary);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
    backdrop-filter: blur(18px);
}

.top-menu-dropdown.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

.top-menu-item,
.top-menu-project-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    font-size: 13px;
    font-weight: 460;
    letter-spacing: 0;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.top-menu-item {
    min-height: 36px;
    padding: 0 11px;
}

.top-menu-item:hover,
.top-menu-project-row:hover,
.top-menu-has-sub:focus-visible {
    color: var(--text-primary);
    background: var(--accent-soft);
}

.top-menu-danger {
    color: rgba(255, 129, 129, 0.86);
}

.top-menu-danger:hover {
    color: #ffd6d6;
    background: rgba(255, 94, 94, 0.12);
}

.top-menu-item svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: currentColor;
    opacity: 0.84;
}

.top-menu-shortcut,
.top-menu-sub-arrow {
    margin-left: auto;
    color: var(--text-tertiary);
}

.top-menu-shortcut {
    font-size: 11px;
    font-weight: 420;
}

.top-menu-divider {
    height: 1px;
    margin: 5px 8px;
    background: var(--panel-line);
}

.top-menu-has-sub {
    position: relative;
    cursor: default;
}

.top-menu-sub {
    position: absolute;
    top: -7px;
    left: calc(100% + 6px);
    display: none;
    min-width: 250px;
    max-width: 300px;
    max-height: min(380px, calc(100vh - 84px));
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 14px;
    background: rgba(12, 15, 20, 0.97);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
}

.top-menu-has-sub:hover .top-menu-sub,
.top-menu-has-sub:focus-within .top-menu-sub {
    display: block;
}

.top-menu-project-empty {
    padding: 10px 11px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.top-menu-project-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.018);
    cursor: pointer;
}

.top-menu-project-row:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
}

.top-menu-project-row:focus-visible {
    outline: none;
    border-color: rgba(255, 170, 65, 0.48);
    box-shadow: 0 0 0 2px rgba(255, 170, 65, 0.12);
}

.top-menu-project-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.top-menu-project-inline-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 560;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-menu-project-inline-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid rgba(255, 170, 65, 0.36);
    border-radius: 999px;
    background: rgba(255, 170, 65, 0.14);
    color: #ffad3d;
    font-size: 10px;
    font-weight: 760;
}

.top-menu-project-inline-meta {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-theme="light"] .top-menu-dropdown,
body[data-theme="light"] .top-menu-sub {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(18, 24, 35, 0.12);
}

.project-title-root {
    display: flex;
    align-items: center;
    min-width: 0;
}

.project-title-button,
.project-title-input {
    width: auto;
    max-width: min(240px, 28vw);
    height: 30px;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
}

.project-title-button {
    display: block;
    min-width: 68px;
    overflow: hidden;
    padding: 0 10px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-color: transparent;
    background: transparent;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.project-title-button:hover {
    border-color: transparent;
    background: var(--panel-hover);
}

.project-title-input {
    min-width: 126px;
    padding: 0 10px;
    outline: none;
    user-select: text;
}

.project-title-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

body[data-theme="light"] .project-title-button {
    background: transparent;
}

body[data-theme="light"] .project-title-input {
    background: rgba(255, 255, 255, 0.9);
}

.top-center-nav {
    position: absolute;
    left: min(50%, calc(100% - 720px));
    top: 50%;
    gap: 16px;
    transform: translate(-50%, -50%);
}

.top-center-nav-item {
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 2px;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.top-center-nav-item:hover {
    color: var(--text-primary);
}

.top-center-nav-item.active {
    color: var(--accent);
    font-weight: 400;
}

.top-center-nav-item.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.top-right {
    gap: 10px;
    min-width: 0;
}

.canvas-toolbar-shell {
    gap: 4px;
    padding: 4px 6px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: var(--panel-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(20px);
}

.canvas-toolbar-items {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.canvas-toolbar-shell.is-collapsed .canvas-toolbar-items {
    display: none;
}

.canvas-toolbar-shell.is-collapsed #collapseToolbarBtn svg {
    transform: rotate(180deg);
}

.top-bar-btn {
    min-width: var(--octap-control-md, 34px);
    height: var(--octap-control-xs, 28px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    border-radius: var(--octap-radius-sm, 8px);
    background: transparent;
    color: var(--text-primary);
    font-size: var(--octap-font-12, 12px);
    font-weight: var(--octap-weight-regular, 400);
    letter-spacing: 0;
    transition: background 0.18s ease, color 0.18s ease;
}

.top-bar-btn.icon-only {
    padding: 0;
}

.canvas-toolbar-shell .top-bar-btn {
    color: var(--text-secondary);
}

body[data-theme="light"] .canvas-toolbar-shell .top-bar-btn {
    color: var(--text-primary);
}

.top-bar-btn:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.canvas-toolbar-shell .top-bar-btn:hover {
    color: var(--text-primary);
}

.top-bar-btn.is-active,
.top-bar-btn[aria-pressed="true"]:not(.theme-toggle) {
    color: var(--text-primary);
    background: transparent;
}

.canvas-toolbar-shell .top-bar-btn.is-active,
.canvas-toolbar-shell .top-bar-btn[aria-pressed="true"]:not(.theme-toggle) {
    color: var(--text-secondary);
    background: transparent;
}

body[data-theme="light"] .canvas-toolbar-shell .top-bar-btn.is-active,
body[data-theme="light"] .canvas-toolbar-shell .top-bar-btn[aria-pressed="true"]:not(.theme-toggle) {
    color: var(--text-primary);
}

.top-bar-btn svg,
.tool-btn svg,
.action-btn svg {
    pointer-events: none;
}

.canvas-toolbar-shell .top-bar-btn.icon-only svg {
    width: var(--octap-icon-sm, 15px);
    height: var(--octap-icon-sm, 15px);
    stroke-width: 1.75;
    opacity: 0.82;
}

.canvas-toolbar-shell #clearCanvasBtn svg,
.canvas-toolbar-shell #gridBtn svg,
.canvas-toolbar-shell #minimapBtn svg,
.canvas-toolbar-shell #gridDisplayBtn svg {
    width: var(--octap-icon-toolbar, 17px);
    height: var(--octap-icon-toolbar, 17px);
    stroke-width: 1.55;
}

@media (max-width: 640px) {
    .canvas-toolbar-shell .top-bar-btn.icon-only {
        min-width: 29px;
    }

    .canvas-toolbar-shell #clearCanvasBtn svg,
    .canvas-toolbar-shell #gridBtn svg,
    .canvas-toolbar-shell #minimapBtn svg,
    .canvas-toolbar-shell #gridDisplayBtn svg {
        width: 16px;
        height: 16px;
    }
}

.canvas-toolbar-shell .top-bar-btn.icon-only:hover svg,
.canvas-toolbar-shell .top-bar-btn.icon-only.is-active svg,
.canvas-toolbar-shell .top-bar-btn.icon-only[aria-pressed="true"] svg {
    opacity: 0.96;
}

.zoom-display {
    min-width: 48px;
    padding: 0 11px;
    color: var(--text-secondary);
    font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
}

.zoom-display span {
    font-weight: 400;
}

.theme-toggle .theme-icon {
    display: none;
}

body[data-theme="dark"] .theme-icon-moon,
body:not([data-theme]) .theme-icon-moon,
body[data-theme="light"] .theme-icon-sun {
    display: block;
}

.top-global-actions {
    gap: 10px;
    flex: 0 0 auto;
}

.top-credit-group {
    gap: 8px;
}

.top-credit-button,
.top-icon-button {
    height: 36px;
    border: 1px solid var(--panel-line);
    background: var(--panel-bg);
    color: var(--text-secondary);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.top-credit-button:hover,
.top-icon-button:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.top-credit-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.top-credit-button svg {
    color: var(--accent);
}

.top-icon-button {
    position: relative;
    width: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.top-icon-button svg {
    width: 17px;
    height: 17px;
}

.top-icon-dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
}

.top-icon-button.is-notification-open,
.octap-icon-button.is-notification-open {
    color: var(--text-primary);
    border-color: rgba(255, 168, 79, 0.34);
    background: var(--accent-soft);
}

.notification-popover {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1260;
    width: min(344px, calc(100vw - 20px));
    max-height: min(464px, calc(100vh - 72px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--panel-line);
    border-radius: 13px;
    background: rgba(15, 18, 23, 0.97);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
    opacity: 1;
    overflow: auto;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.16s ease;
    backdrop-filter: blur(18px);
    scrollbar-width: thin;
    scrollbar-color: rgba(154, 161, 174, 0.42) transparent;
}

.notification-popover.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

.notification-popover::-webkit-scrollbar {
    width: 8px;
}

.notification-popover::-webkit-scrollbar-track {
    background: transparent;
}

.notification-popover::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(154, 161, 174, 0.42);
    background-clip: padding-box;
}

.notification-popover::-webkit-scrollbar-thumb:hover {
    background: rgba(188, 195, 207, 0.52);
    background-clip: padding-box;
}

.notification-popover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.notification-popover h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.notification-popover p {
    margin: 3px 0 0;
    color: var(--text-tertiary);
    font-size: 11px;
    line-height: 1.35;
}

.notification-mark-read,
.notification-view-all {
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 560;
    white-space: nowrap;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-mark-read {
    padding: 0 11px;
}

.notification-view-all {
    width: 100%;
    height: 34px;
    min-height: 34px;
    margin-top: 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    font-size: 12px;
}

.notification-mark-read:hover,
.notification-mark-read:focus-visible,
.notification-view-all:hover,
.notification-view-all:focus-visible {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 168, 79, 0.26);
    background: var(--accent-soft);
}

.notification-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-section-title {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 560;
    line-height: 1.2;
}

.notification-section-divider {
    height: 1px;
    background: var(--panel-line);
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-row {
    position: relative;
    width: 100%;
    min-height: 54px;
    display: grid;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-personal-row {
    grid-template-columns: 6px minmax(0, 1fr) auto auto;
}

.notification-platform-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.notification-row:hover,
.notification-row:focus-visible {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.07);
}

.notification-row-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-row-title {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 560;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-row-body {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 430;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-row-meta {
    color: var(--text-tertiary);
    font-size: 10px;
    line-height: 1.2;
}

.notification-row-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
}

.notification-row.is-unread .notification-row-dot,
.notification-platform-row.is-unread::before {
    background: var(--accent);
}

.notification-platform-row.is-unread::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.notification-row-value {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.notification-row-status {
    min-width: 48px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.075);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.notification-tag {
    min-width: 38px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 168, 79, 0.24);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: 560;
    white-space: nowrap;
}

.notification-row-arrow {
    color: var(--text-tertiary);
    font-size: 15px;
    line-height: 1;
}

.notification-center {
    position: fixed;
    inset: 0;
    z-index: 1265;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.16s ease;
}

.notification-center.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.notification-center-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(5px);
}

.notification-center-card {
    position: relative;
    width: min(720px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 36px));
    display: flex;
    flex-direction: column;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: rgba(15, 18, 23, 0.98);
    color: var(--text-primary);
    box-shadow: 0 26px 68px rgba(0, 0, 0, 0.46);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.notification-center-card:focus {
    outline: none;
}

.notification-center-head {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--panel-line);
}

.notification-center-head h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.notification-center-head p {
    margin: 4px 0 0;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.35;
}

.notification-center-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notification-center-read,
.notification-center-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--panel-line);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-center-read {
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 560;
}

.notification-center-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 19px;
    line-height: 1;
}

.notification-center-read:hover,
.notification-center-read:focus-visible,
.notification-center-close:hover,
.notification-center-close:focus-visible {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.notification-center-body {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
}

.notification-center-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-right: 1px solid var(--panel-line);
    background: rgba(255, 255, 255, 0.018);
}

.notification-center-filter {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-center-filter strong {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
}

.notification-center-filter:hover,
.notification-center-filter:focus-visible,
.notification-center-filter.is-active {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 168, 79, 0.24);
    background: var(--accent-soft);
}

.notification-center-filter.is-active strong {
    color: var(--accent);
}

.notification-center-list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(154, 161, 174, 0.42) transparent;
}

.notification-center-list::-webkit-scrollbar {
    width: 8px;
}

.notification-center-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-center-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(154, 161, 174, 0.42);
    background-clip: padding-box;
}

.notification-center-group-title {
    margin: 4px 0 0;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 560;
    line-height: 1.2;
}

.notification-center-row {
    position: relative;
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-center-row:hover,
.notification-center-row:focus-visible {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.068);
}

.notification-center-row-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
}

.notification-center-row.is-unread .notification-center-row-dot {
    background: var(--accent);
}

.notification-center-row-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-center-row-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 560;
    line-height: 1.2;
}

.notification-center-row-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 560;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-center-row-body {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-center-row-meta {
    color: var(--text-tertiary);
    font-size: 11px;
    line-height: 1.25;
}

.notification-center-row-accent {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.notification-center-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.notification-detail {
    position: fixed;
    inset: 0;
    z-index: 1270;
    display: grid;
    place-items: center;
    padding: 16px;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.16s ease;
}

.notification-detail.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.notification-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(4px);
}

.notification-detail-card {
    position: relative;
    width: min(360px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: rgba(15, 18, 23, 0.98);
    color: var(--text-primary);
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(18px);
}

.notification-detail-card:focus {
    outline: none;
}

.notification-detail-close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-detail-close:hover,
.notification-detail-close:focus-visible {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.09);
}

.notification-detail-badge {
    align-self: flex-start;
    height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid rgba(255, 168, 79, 0.24);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: 560;
}

.notification-detail-card h3 {
    margin: 0;
    padding-right: 28px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.notification-detail-body {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
}

.notification-detail-meta {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--panel-line);
    border-bottom: 1px solid var(--panel-line);
    color: var(--text-tertiary);
    font-size: 11px;
}

.notification-detail-meta strong {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 560;
    white-space: nowrap;
}

.notification-detail-primary {
    align-self: flex-end;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid rgba(255, 168, 79, 0.28);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 560;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.notification-detail-primary:hover,
.notification-detail-primary:focus-visible {
    outline: none;
    color: var(--text-primary);
    border-color: rgba(255, 168, 79, 0.42);
    background: rgba(255, 168, 79, 0.16);
}

body[data-theme="light"] .notification-popover,
body[data-theme="light"] .notification-center-card,
body[data-theme="light"] .notification-detail-card {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 58px rgba(18, 24, 35, 0.16);
}

body[data-theme="light"] .notification-row,
body[data-theme="light"] .notification-mark-read,
body[data-theme="light"] .notification-view-all,
body[data-theme="light"] .notification-center-row,
body[data-theme="light"] .notification-center-read,
body[data-theme="light"] .notification-center-close,
body[data-theme="light"] .notification-detail-close {
    background: rgba(18, 24, 35, 0.035);
}

body[data-theme="light"] .notification-row:hover,
body[data-theme="light"] .notification-row:focus-visible {
    background: rgba(18, 24, 35, 0.055);
    border-color: rgba(18, 24, 35, 0.08);
}

@media (max-width: 560px) {
    .notification-popover {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 76px);
        padding: 14px;
    }

    .notification-personal-row {
        grid-template-columns: 8px minmax(0, 1fr) auto;
    }

    .notification-personal-row .notification-row-status {
        grid-column: 2 / 4;
        justify-self: start;
    }

    .notification-center {
        padding: 12px;
    }

    .notification-center-card {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
    }

    .notification-center-head {
        align-items: flex-start;
        min-height: 76px;
        padding: 12px;
    }

    .notification-center-read {
        display: none;
    }

    .notification-center-body {
        grid-template-columns: 1fr;
    }

    .notification-center-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--panel-line);
        scrollbar-width: none;
    }

    .notification-center-sidebar::-webkit-scrollbar {
        display: none;
    }

    .notification-center-filter {
        flex: 0 0 auto;
        width: auto;
        min-width: 84px;
    }

    .notification-center-list {
        padding: 12px;
    }

    .notification-center-row {
        grid-template-columns: 7px minmax(0, 1fr);
    }

    .notification-center-row-accent {
        grid-column: 2;
        justify-self: start;
    }
}

.top-user-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #1a1206;
    font-size: 14px;
    font-weight: 780;
}

.canvas-minimap {
    position: fixed;
    left: 16px;
    right: auto;
    bottom: 16px;
    top: auto;
    z-index: 180;
    width: 184px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(17, 20, 25, 0.94);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    color: var(--text-primary);
    backdrop-filter: blur(18px);
    cursor: grab;
}

.canvas-minimap.is-dragging {
    cursor: grabbing;
}

.canvas-minimap.hidden {
    display: none;
}

.canvas-minimap-title {
    display: none;
}

.canvas-minimap-stage {
    position: relative;
    width: 164px;
    height: 96px;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: inherit;
    touch-action: none;
}

.canvas-minimap-stage.is-dragging {
    cursor: grabbing;
}

.canvas-minimap-node,
.canvas-minimap-viewport {
    position: absolute;
    border-radius: 3px;
}

.canvas-minimap-node {
    min-width: 3px;
    min-height: 3px;
    background: rgba(162, 165, 171, 0.52);
}

.canvas-minimap-viewport {
    border: 1px solid rgba(235, 238, 245, 0.42);
    background: rgba(235, 238, 245, 0.15);
}

body[data-theme="light"] .canvas-minimap {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 42px rgba(18, 24, 35, 0.12);
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 240;
    max-width: min(460px, calc(100vw - 32px));
    padding: 9px 13px;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: rgba(14, 17, 23, 0.92);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 460;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    backdrop-filter: blur(16px);
}

.app-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

body[data-theme="light"] .app-toast {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(18, 24, 35, 0.12);
}

.generation-history-panel {
    position: fixed;
    left: 84px;
    top: 96px;
    z-index: 1180;
    width: 380px;
    min-width: 280px;
    height: 350px;
    min-height: 200px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: rgba(14, 17, 23, 0.96);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
    color: var(--text-primary);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.generation-history-panel.hidden {
    display: none;
}

.generation-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--panel-line);
    flex-shrink: 0;
}

.generation-history-expand,
.generation-history-fav,
.generation-history-download-selected,
.generation-history-sort,
.generation-history-float-close {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.generation-history-expand:hover,
.generation-history-fav:hover,
.generation-history-download-selected:hover,
.generation-history-sort:hover,
.generation-history-float-close:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.generation-history-expand:hover,
.generation-history-expand:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.generation-history-expand svg,
.generation-history-fav svg,
.generation-history-download-selected svg,
.generation-history-sort svg,
.generation-history-float-close svg {
    width: 15px;
    height: 15px;
}

.generation-history-tabs {
    display: flex;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.generation-history-tab,
.generation-history-float-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 560;
    white-space: nowrap;
}

.generation-history-tab {
    flex: 1 1 0;
    min-width: 0;
}

.generation-history-tab.active,
.generation-history-float-nav.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.generation-history-tab span,
.generation-history-float-nav span {
    color: var(--text-tertiary);
    font-size: 11px;
}

.generation-history-body {
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.generation-history-body::-webkit-scrollbar,
.generation-history-float-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.generation-history-body::-webkit-scrollbar-track,
.generation-history-float-body::-webkit-scrollbar-track {
    background: transparent;
}

.generation-history-body::-webkit-scrollbar-thumb,
.generation-history-float-body::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    background-clip: content-box;
}

.generation-history-body::-webkit-scrollbar-thumb:hover,
.generation-history-float-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
    background-clip: content-box;
}

.generation-history-body::-webkit-scrollbar-button,
.generation-history-float-body::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.generation-history-body::-webkit-scrollbar-corner,
.generation-history-float-body::-webkit-scrollbar-corner {
    background: transparent;
}

.generation-history-empty {
    min-height: 200px;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.generation-history-date-label {
    padding: 8px 4px 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 620;
}

.generation-history-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.generation-history-grid.side {
    gap: 8px;
}

.generation-history-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

.generation-history-tile[draggable="true"] {
    cursor: grab;
}

.generation-history-tile.is-history-dragging {
    cursor: grabbing;
    opacity: 0.62;
    transform: scale(0.97);
}

.generation-history-tile:hover {
    border-color: rgba(255, 168, 79, 0.32);
    transform: scale(1.018);
}

.generation-history-tile.selected,
.generation-history-tile.history-selected {
    border-color: rgba(255, 168, 79, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.72);
}

.generation-history-thumb {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

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

.generation-history-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
}

.generation-history-fav {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    color: rgba(255, 255, 255, 0.68);
    opacity: 0;
    backdrop-filter: blur(8px);
}

.generation-history-tile:hover .generation-history-fav,
.generation-history-tile.is-favorite .generation-history-fav {
    opacity: 1;
}

.generation-history-tile.is-favorite .generation-history-fav {
    color: #fbbf24;
}

.generation-history-floating {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(7px);
}

.generation-history-floating.hidden {
    display: none;
}

.generation-history-float-wrapper {
    display: flex;
    width: 80vw;
    max-width: 1100px;
    min-width: 500px;
    height: 75vh;
    max-height: 800px;
    min-height: 350px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 16px;
    background: rgba(15, 18, 23, 0.98);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
}

.generation-history-float-sidebar {
    width: 180px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 16px 0 0 16px;
    background: rgba(10, 12, 16, 0.98);
    flex-shrink: 0;
}

.generation-history-float-sidebar-title {
    padding: 8px 16px 12px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 620;
}

.generation-history-float-nav {
    position: relative;
    gap: 8px;
    justify-content: flex-start;
    width: 100%;
    height: 38px;
    padding: 0 16px 0 18px;
    border-radius: 0;
    text-align: left;
    color: var(--text-secondary);
}

.generation-history-float-nav span {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-tertiary);
}

.generation-history-float-nav svg,
.generation-history-float-icon svg {
    flex: 0 0 auto;
}

.generation-history-float-nav.active {
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-primary);
}

.generation-history-float-nav.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 999px;
    background: var(--accent);
}

.generation-history-float-nav.active span {
    background: rgba(255, 168, 79, 0.14);
    color: var(--accent);
}

.generation-history-float-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: none;
    border-radius: 0 16px 16px 0;
    background: rgba(15, 18, 23, 0.98);
}

.generation-history-float-toolbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    background: rgba(10, 12, 16, 0.82);
}

.generation-history-float-title,
.generation-history-float-controls,
.generation-history-zoom {
    display: inline-flex;
    align-items: center;
}

.generation-history-float-title {
    gap: 9px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 650;
}

.generation-history-float-icon {
    color: var(--text-secondary);
}

.generation-history-float-controls {
    gap: 8px;
}

.generation-history-zoom {
    gap: 7px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.generation-history-zoom-slider {
    appearance: none;
    -webkit-appearance: none;
    width: 82px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    outline: none;
}

.generation-history-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.26);
}

.generation-history-zoom-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.generation-history-zoom-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
}

.generation-history-sort.is-ascending svg {
    transform: rotate(180deg);
}

.generation-history-float-body {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding: 14px 16px 18px;
    user-select: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.generation-history-selection-box {
    position: fixed;
    z-index: 21050;
    pointer-events: none;
    border: 1px solid rgba(255, 168, 79, 0.72);
    border-radius: 6px;
    background: rgba(255, 168, 79, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.16);
}

body.is-generation-history-selecting {
    user-select: none;
    cursor: crosshair;
}

.generation-history-context-menu {
    position: fixed;
    z-index: 21000;
    min-width: 176px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(11, 15, 21, 0.98);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.generation-history-context-menu.hidden {
    display: none;
}

.generation-history-context-item {
    appearance: none;
    width: 100%;
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
}

.generation-history-context-item:hover {
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-primary);
}

.generation-history-context-divider {
    height: 1px;
    margin: 5px 7px;
    background: rgba(255, 255, 255, 0.08);
}

.generation-history-context-item.danger {
    color: #ff6f7a;
}

.generation-history-context-item.danger:hover {
    background: rgba(255, 111, 122, 0.1);
    color: #ff6f7a;
}

.generation-history-preview {
    position: fixed;
    inset: 0;
    z-index: 20500;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.88);
}

.generation-history-preview.hidden {
    display: none;
}

.generation-history-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
}

.generation-history-preview-media {
    display: block;
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    background: #05070a;
}

.generation-history-preview-close {
    position: absolute;
    right: 0;
    top: -38px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 19px;
}

body[data-theme="light"] .generation-history-panel {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 22px 54px rgba(18, 24, 35, 0.14);
}

.help-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(5, 8, 13, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.help-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.help-modal-card {
    width: min(760px, calc(100vw - 40px));
    max-height: min(720px, calc(100vh - 64px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 18px;
    background: rgba(14, 17, 23, 0.97);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.18s ease;
}

.help-modal.show .help-modal-card {
    transform: translateY(0) scale(1);
}

.help-modal-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px 0 22px;
    border-bottom: 1px solid var(--panel-line);
}

.help-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 650;
}

.help-modal-title svg {
    flex: 0 0 auto;
    color: var(--accent);
}

.help-modal-close {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    transition: background 0.15s ease, color 0.15s ease;
}

.help-modal-close:hover,
.help-modal-close:focus-visible {
    outline: none;
    background: var(--panel-hover);
    color: var(--text-primary);
}

.help-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: auto;
    padding: 22px;
}

.help-tip-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 168, 79, 0.18);
    border-radius: 8px;
    background: rgba(255, 168, 79, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
}

.help-tip-banner strong {
    flex: 0 0 auto;
    color: var(--accent);
}

.help-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-section h2 {
    margin: 0;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
}

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

.help-card,
.help-shortcut-row {
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.help-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px;
}

.help-card strong {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
}

.help-card span,
.help-note {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
}

.help-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.help-shortcut-row span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.help-shortcut-row kbd {
    min-width: 24px;
    padding: 3px 7px;
    border: 1px solid var(--panel-line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font: 650 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    text-align: center;
}

.help-shortcut-row b {
    color: var(--text-tertiary);
    font-size: 11px;
}

.help-note {
    margin: 0;
    padding: 13px;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

body[data-theme="light"] .help-modal {
    background: rgba(245, 245, 245, 0.72);
}

body[data-theme="light"] .help-modal-card {
    background: rgba(255, 255, 255, 0.98);
}

@media (max-width: 760px) {
    .help-modal {
        padding: 20px;
    }

    .help-card-grid,
    .help-shortcut-grid {
        grid-template-columns: 1fr;
    }
}

.modal-overlay#helpModal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(5, 8, 13, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.modal-overlay#helpModal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay#helpModal .modal-container {
    width: min(760px, calc(100vw - 40px));
    max-height: min(720px, calc(100vh - 64px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 18px;
    background: rgba(14, 17, 23, 0.97);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.18s ease;
}

.modal-overlay#helpModal.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-overlay#helpModal .modal-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px 0 22px;
    border-bottom: 1px solid var(--panel-line);
}

.modal-overlay#helpModal .modal-close-btn {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    transition: background 0.15s ease, color 0.15s ease;
}

.modal-overlay#helpModal .modal-close-btn:hover,
.modal-overlay#helpModal .modal-close-btn:focus-visible {
    outline: none;
    background: var(--panel-hover);
    color: var(--text-primary);
}

.modal-overlay#helpModal .modal-body {
    overflow: auto;
    scrollbar-color: rgba(83, 91, 102, 0.64) rgba(11, 14, 19, 0.78);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.modal-overlay#helpModal .modal-body::-webkit-scrollbar {
    width: 9px;
}

.modal-overlay#helpModal .modal-body::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.78);
}

.modal-overlay#helpModal .modal-body::-webkit-scrollbar-thumb {
    border: 2px solid rgba(10, 13, 18, 0.78);
    border-radius: 999px;
    background: rgba(82, 90, 102, 0.72);
}

.modal-overlay#helpModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(112, 122, 136, 0.78);
}

.modal-overlay#helpModal .help-modal-body {
    padding: 24px !important;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-overlay#helpModal .help-tip-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 168, 79, 0.18);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.08), rgba(255, 149, 0, 0.04));
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
}

.modal-overlay#helpModal .help-tip-banner svg,
.modal-overlay#helpModal .help-tip-banner b,
.modal-overlay#helpModal .help-section-title,
.modal-overlay#helpModal .modal-title svg,
.modal-overlay#helpModal .help-shortcut-key.is-action {
    color: var(--accent);
}

.modal-overlay#helpModal .help-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-overlay#helpModal .help-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.modal-overlay#helpModal .help-section-title-meta {
    margin-left: 4px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
}

.modal-overlay#helpModal .help-card-grid,
.modal-overlay#helpModal .help-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-overlay#helpModal .help-card-grid {
    gap: 12px;
}

.modal-overlay#helpModal .help-shortcut-grid {
    gap: 8px;
}

.modal-overlay#helpModal .help-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.modal-overlay#helpModal .help-card:hover {
    border-color: rgba(255, 168, 79, 0.28);
    background: rgba(255, 168, 79, 0.04);
    box-shadow: 0 0 22px rgba(255, 168, 79, 0.06);
}

.modal-overlay#helpModal .help-card-icon {
    width: 32px;
    height: 32px;
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 168, 79, 0.1);
    color: var(--accent);
}

.modal-overlay#helpModal .help-card-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.modal-overlay#helpModal .help-card-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.modal-overlay#helpModal .help-card-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.modal-overlay#helpModal .help-card-desc {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.modal-overlay#helpModal .help-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    transition: background 0.12s, border-color 0.12s;
}

.modal-overlay#helpModal .help-shortcut-row:hover {
    border-color: rgba(255, 168, 79, 0.14);
    background: rgba(255, 168, 79, 0.06);
}

.modal-overlay#helpModal .help-shortcut-label {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-overlay#helpModal .help-shortcut-keys {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

.modal-overlay#helpModal .help-shortcut-key {
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: "Manrope", "Inter", monospace;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.modal-overlay#helpModal .help-shortcut-key.is-action {
    border-color: rgba(255, 168, 79, 0.18);
    background: rgba(255, 168, 79, 0.1);
    font-weight: 500;
}

.modal-overlay#helpModal .help-shortcut-plus {
    color: var(--text-tertiary);
    font-size: 11px;
}

body[data-theme="light"] .modal-overlay#helpModal {
    background: rgba(245, 245, 245, 0.72);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-container {
    background: rgba(255, 255, 255, 0.98);
}

@media (max-width: 760px) {
    .modal-overlay#helpModal {
        padding: 20px;
    }

    .modal-overlay#helpModal .help-card-grid,
    .modal-overlay#helpModal .help-shortcut-grid {
        grid-template-columns: 1fr;
    }
}

.modal-overlay#helpModal {
    align-items: flex-end;
    justify-content: center;
    padding: 0 32px 56px;
    background: color-mix(in srgb, var(--octap-modal-backdrop, #05080d) 34%, transparent);
}

.modal-overlay#helpModal .help-shortcut-sheet {
    width: min(1152px, calc(100vw - 96px));
    max-height: min(438px, calc(100vh - 96px));
    border-color: var(--panel-line);
    border-radius: 8px;
    background: var(--octap-modal-panel, #11161c);
    box-shadow: var(--shadow-lg);
    transform: translateY(10px);
}

.modal-overlay#helpModal.active .help-shortcut-sheet {
    transform: translateY(0);
}

.modal-overlay#helpModal .help-shortcut-header {
    min-height: 56px;
    padding: 0 16px 0 24px;
    border-bottom-color: var(--panel-line);
}

.modal-overlay#helpModal .help-shortcut-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.modal-overlay#helpModal .modal-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0;
}

.modal-overlay#helpModal .help-shortcut-subtitle {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-overlay#helpModal .modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    color: var(--text-tertiary);
}

.modal-overlay#helpModal .modal-close-btn:hover,
.modal-overlay#helpModal .modal-close-btn:focus-visible {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.modal-overlay#helpModal .help-shortcut-body {
    padding: 0 !important;
}

.modal-overlay#helpModal .help-shortcut-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 0;
}

.modal-overlay#helpModal .help-shortcut-section {
    min-width: 0;
    padding: 20px 24px 22px;
}

.modal-overlay#helpModal .help-shortcut-section + .help-shortcut-section {
    border-left: 1px solid var(--panel-line);
}

.modal-overlay#helpModal .help-shortcut-section-title {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

.modal-overlay#helpModal .help-shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-overlay#helpModal .help-shortcut-row {
    min-height: 24px;
    display: grid;
    align-items: center;
    grid-template-columns: minmax(88px, 1fr) auto;
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    transition: none;
}

.modal-overlay#helpModal .help-shortcut-row:hover {
    border-color: transparent;
    background: transparent;
}

.modal-overlay#helpModal .help-shortcut-label {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-overlay#helpModal .help-shortcut-keys {
    display: inline-flex;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.modal-overlay#helpModal .help-shortcut-key {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border: 1px solid var(--action-border);
    border-radius: 6px;
    background: var(--action-bg);
    color: var(--text-primary);
    font: 650 12px/1 "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
    letter-spacing: 0;
    white-space: nowrap;
}

.modal-overlay#helpModal .help-shortcut-key.is-action {
    border-color: var(--action-border);
    background: var(--action-bg);
    color: var(--text-primary);
    font-weight: 650;
}

.modal-overlay#helpModal .help-shortcut-separator {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

body[data-theme="light"] .modal-overlay#helpModal {
    background: color-mix(in srgb, var(--octap-modal-backdrop, #f5f7fa) 54%, transparent);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-sheet {
    border-color: var(--panel-line);
    background: var(--octap-modal-panel, #ffffff);
    box-shadow: var(--shadow-lg);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-header {
    border-bottom-color: var(--panel-line);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-title {
    color: var(--text-primary);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-subtitle,
body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-label {
    color: var(--text-secondary);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-section + .help-shortcut-section {
    border-left-color: var(--panel-line);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-close-btn {
    color: var(--text-tertiary);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-close-btn:hover,
body[data-theme="light"] .modal-overlay#helpModal .modal-close-btn:focus-visible {
    background: var(--panel-hover);
    color: var(--text-primary);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-key {
    border-color: var(--action-border);
    background: var(--action-bg);
    color: var(--text-primary);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-key.is-action {
    border-color: var(--action-border);
    background: var(--action-bg);
    color: var(--text-primary);
}

body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-separator {
    color: var(--text-tertiary);
}

@media (max-width: 980px) {
    .modal-overlay#helpModal {
        padding: 0 24px 40px;
    }

    .modal-overlay#helpModal .help-shortcut-sheet {
        width: min(720px, calc(100vw - 48px));
        max-height: min(640px, calc(100vh - 80px));
    }

    .modal-overlay#helpModal .help-shortcut-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-overlay#helpModal .help-shortcut-section:nth-child(odd) {
        border-left: 0;
    }

    .modal-overlay#helpModal .help-shortcut-section:nth-child(n+3) {
        border-top: 1px solid var(--panel-line);
    }

    body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-section:nth-child(n+3) {
        border-top-color: var(--panel-line);
    }
}

@media (max-width: 640px) {
    .modal-overlay#helpModal {
        padding: 0 12px 20px;
    }

    .modal-overlay#helpModal .help-shortcut-sheet {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 40px);
    }

    .modal-overlay#helpModal .help-shortcut-header {
        padding-left: 16px;
    }

    .modal-overlay#helpModal .help-shortcut-columns {
        grid-template-columns: 1fr;
    }

    .modal-overlay#helpModal .help-shortcut-section,
    .modal-overlay#helpModal .help-shortcut-section + .help-shortcut-section,
    .modal-overlay#helpModal .help-shortcut-section:nth-child(n+3) {
        border-left: 0;
        border-top: 1px solid var(--panel-line);
    }

    .modal-overlay#helpModal .help-shortcut-section:first-child {
        border-top: 0;
    }

    .modal-overlay#helpModal .help-shortcut-keys {
        flex-wrap: wrap;
    }

    body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-section,
    body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-section + .help-shortcut-section,
    body[data-theme="light"] .modal-overlay#helpModal .help-shortcut-section:nth-child(n+3) {
        border-top-color: var(--panel-line);
    }
}

.main-container {
    width: 100vw;
    height: 100vh;
    padding-top: 56px;
}

.left-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    z-index: 80;
    width: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 20px;
    background: var(--sidebar-bg);
    box-shadow: var(--sidebar-shadow);
    transform: translateY(-50%);
    transition: left 0.2s ease, transform 0.2s ease, background 0.18s ease, border-color 0.18s ease;
    backdrop-filter: blur(20px);
}

body.project-board-drawer-open .left-sidebar {
    left: 360px;
}

.left-sidebar-drag-handle {
    width: 100%;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--sidebar-muted);
}

.left-sidebar-tools {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 4px 0 8px;
}

.left-sidebar-divider {
    width: 32px;
    height: 1px;
    margin: 6px 0;
    background: var(--sidebar-line);
}

.tool-btn,
.sidebar-toggle-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.tool-btn:hover,
.sidebar-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.tool-btn.open {
    color: var(--text-primary);
    background: rgba(255, 168, 79, 0.11);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.2), 0 0 18px rgba(255, 168, 79, 0.08);
}

.sidebar-toggle-btn.open {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

.tool-btn.highlight {
    background: var(--gradient-primary);
    color: #111418;
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.3);
}

.tool-btn.highlight:hover {
    transform: scale(1.05);
}

.add-node-tool-btn,
.add-node-tool-btn:hover,
.add-node-tool-btn.is-add-node-open {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.32);
}

.add-node-tool-icon {
    transform-origin: center;
    transition: transform 0.16s ease;
}

body[data-theme="light"] .add-node-tool-btn,
body[data-theme="light"] .add-node-tool-btn:hover,
body[data-theme="light"] .add-node-tool-btn.is-add-node-open {
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(230, 140, 15, 0.24);
}

.add-node-tool-btn.is-add-node-open .add-node-tool-icon {
    transform: rotate(45deg);
}

.sidebar-toggle-btn {
    width: 100%;
    height: 48px;
    border-top: 1px solid var(--sidebar-line);
    border-radius: 0;
}

.sidebar-toggle-btn svg {
    transition: transform 0.18s ease;
}

.sidebar-toggle-btn.open svg {
    transform: rotate(180deg);
}

.project-board-panel {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    z-index: 980;
    width: 344px;
    max-width: calc(100vw - 88px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-left: 0;
    border-radius: 0 16px 16px 0;
    background: rgba(10, 12, 16, 0.96);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    transition: left 0.2s ease, top 0.2s ease, bottom 0.2s ease, border-radius 0.2s ease;
    backdrop-filter: blur(22px);
}

.project-board-panel[data-layout="float"] {
    left: 96px;
    top: 72px;
    bottom: auto;
    height: min(640px, calc(100vh - 96px));
    max-height: calc(100vh - 96px);
    border-left: 1px solid var(--panel-line);
    border-radius: 14px;
    overflow: visible;
}

.project-board-panel[data-layout="float"].is-dragging,
.project-board-panel[data-layout="float"].is-resizing {
    transition: none;
    user-select: none;
}

.project-board-panel.hidden {
    display: none;
}

.project-board-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.project-board-panel[data-layout="float"] .project-board-panel-header {
    cursor: move;
}

.project-board-panel[data-layout="float"] .project-board-panel-header button {
    cursor: pointer;
}

.project-board-floating-resize {
    position: absolute;
    z-index: 6;
    display: none;
    background: transparent;
    touch-action: none;
}

.project-board-panel[data-layout="float"] .project-board-floating-resize {
    display: block;
}

.project-board-floating-resize-bottom {
    left: 58px;
    right: 58px;
    bottom: -12px;
    height: 20px;
    cursor: ns-resize;
}

.project-board-floating-resize-bottom-left,
.project-board-floating-resize-bottom-right {
    bottom: -16px;
    width: 34px;
    height: 34px;
}

.project-board-floating-resize-bottom-left {
    left: -16px;
    cursor: nesw-resize;
}

.project-board-floating-resize-bottom-right {
    right: -16px;
    cursor: nwse-resize;
}

.project-board-floating-resize::after {
    content: "";
    position: absolute;
    opacity: 0;
    transition: opacity 0.16s ease, background 0.16s ease;
}

.project-board-floating-resize-bottom::after {
    left: 50%;
    bottom: 8px;
    width: 66px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
}

.project-board-floating-resize-bottom-left::after,
.project-board-floating-resize-bottom-right::after {
    bottom: 10px;
    width: 11px;
    height: 11px;
    border-radius: 0 0 8px 0;
    border-right: 2px solid rgba(148, 163, 184, 0.28);
    border-bottom: 2px solid rgba(148, 163, 184, 0.28);
}

.project-board-floating-resize-bottom-left::after {
    left: 12px;
    transform: rotate(90deg);
}

.project-board-floating-resize-bottom-right::after {
    right: 12px;
}

.project-board-floating-resize:hover::after,
.project-board-panel.is-resizing .project-board-floating-resize::after {
    opacity: 1;
}

.project-board-panel-tabs {
    display: flex;
    gap: 5px;
    min-width: 0;
}

.project-board-panel-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.project-board-tab,
.project-board-layout-toggle,
.project-board-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.project-board-tab {
    height: 32px;
    gap: 4px;
    padding: 0 5px;
    font-size: 12px;
    font-weight: 600;
}

.project-board-tab:hover,
.project-board-tab.is-active {
    border-color: rgba(255, 168, 79, 0.24);
    background: rgba(255, 168, 79, 0.1);
    color: var(--accent);
}

.project-board-tab svg {
    width: 14px;
    height: 14px;
}

.project-board-panel-close {
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
}

.project-board-layout-toggle {
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.06);
}

.project-board-layout-toggle svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.75;
}

.project-board-layout-toggle:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.085);
    color: var(--text-primary);
}

.project-board-layout-toggle.is-active {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.085);
    color: var(--text-primary);
}

.project-board-panel-close:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.project-board-panel-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.project-board-panel[data-mode="assets"] .project-board-panel-body,
.project-board-panel[data-mode="styles"] .project-board-panel-body {
    padding: 0;
    overflow: hidden;
}

.project-board-assets-host,
.project-board-styles-host {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
}

.project-board-skills-placeholder {
    min-height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    color: var(--text-secondary);
}

.project-board-skills-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 168, 79, 0.28);
    background: rgba(255, 168, 79, 0.1);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-board-skills-icon svg {
    width: 20px;
    height: 20px;
}

.project-board-skills-placeholder h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
}

.project-board-skills-placeholder p {
    margin: 0;
    font-size: 12px;
    line-height: 1.65;
}

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

.project-board-panel-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    background-clip: content-box;
}

.project-board-panel-body::-webkit-scrollbar-button {
    width: 0;
    height: 0;
}

.project-board-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.project-board-primary,
.project-board-secondary {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 650;
}

.project-board-secondary {
    color: var(--text-secondary);
}

.project-board-primary:hover,
.project-board-secondary:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.075);
    color: var(--text-primary);
}

.project-board-section {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.project-board-section h2 {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.project-board-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 84px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    cursor: grab;
    outline: none;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.project-board-card:active {
    cursor: grabbing;
}

.project-board-card:hover,
.project-board-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.055);
}

.project-board-card.is-active {
    border-color: rgba(255, 168, 79, 0.48);
    background: rgba(255, 168, 79, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.08);
}

.project-board-card.is-dragging {
    opacity: 0.55;
}

.project-board-card.is-drop-before::before,
.project-board-card.is-drop-after::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 168, 79, 0.44);
}

.project-board-card.is-drop-before::before {
    top: -5px;
}

.project-board-card.is-drop-after::after {
    bottom: -5px;
}

.project-board-card-main {
    min-width: 0;
    display: grid;
    gap: 8px;
    flex: 1 1 auto;
}

.project-board-card-main strong,
.project-board-card-main small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-board-card-main strong {
    display: inline-block;
    width: fit-content;
    max-width: min(220px, 100%);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 700;
    cursor: text;
}

.project-board-card-main small {
    color: var(--text-tertiary);
    font-size: 11.5px;
}

.project-board-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.project-board-card-quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
}

.project-board-card-tool,
.project-board-more {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
}

.project-board-card-tool {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    opacity: 0.78;
}

.project-board-pin {
    color: var(--text-tertiary);
}

.project-board-card-tool.project-board-pin.is-active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    opacity: 1;
}

.project-board-card-tool:hover,
.project-board-more:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
    opacity: 1;
}

.project-board-card-tool.is-danger:hover {
    background: rgba(255, 99, 99, 0.1);
    color: #ffb2b2;
}

.project-board-rename-input {
    width: 52%;
    max-width: 220px;
    height: 30px;
    min-width: 112px;
    border: 1px solid rgba(255, 168, 79, 0.42);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.26);
    color: var(--text-primary);
    padding: 0 9px;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.project-board-empty {
    padding: 18px 0;
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
}

.project-board-context-menu {
    position: fixed;
    z-index: 1300;
    min-width: 172px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(14, 17, 22, 0.98);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.project-board-context-menu button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    padding: 0 10px;
    font-size: 12px;
    text-align: left;
}

.project-board-context-menu button:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.project-board-context-menu button.is-danger {
    color: #ff9b9b;
}

.project-board-context-menu button.is-danger:hover {
    background: rgba(255, 99, 99, 0.1);
    color: #ffb2b2;
}

.project-board-batch-overlay {
    position: fixed;
    inset: 0;
    z-index: 1360;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(3, 6, 10, 0.58);
    color: var(--text-primary);
    backdrop-filter: blur(14px);
}

.project-board-batch-overlay.hidden {
    display: none;
}

.project-board-batch-dialog {
    width: min(1120px, calc(100vw - 64px));
    height: min(760px, calc(100vh - 64px));
    min-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(10, 13, 18, 0.98);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.project-board-batch-header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.project-board-batch-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.project-board-batch-title strong {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 720;
}

.project-board-batch-title span {
    color: var(--text-tertiary);
    font-size: 12px;
}

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

.project-board-batch-tool,
.project-board-batch-close {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-secondary);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 620;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.project-board-batch-tool:hover,
.project-board-batch-close:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.085);
    color: var(--text-primary);
}

.project-board-batch-tool.is-primary {
    border-color: rgba(255, 168, 79, 0.28);
    background: rgba(255, 168, 79, 0.12);
    color: var(--accent);
}

.project-board-batch-close {
    width: 32px;
    min-width: 32px;
    padding: 0;
    color: var(--text-tertiary);
    font-size: 20px;
    line-height: 1;
}

.project-board-batch-body {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr);
}

.project-board-batch-sidebar {
    min-width: 0;
    padding: 16px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.065);
    background: rgba(0, 0, 0, 0.12);
}

.project-board-batch-filter-caption {
    margin: 0 10px 8px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 650;
}

.project-board-batch-filter {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 620;
}

.project-board-batch-filter:hover,
.project-board-batch-filter.is-active {
    background: rgba(255, 168, 79, 0.1);
    color: var(--text-primary);
}

.project-board-batch-filter.is-drop-target {
    background: rgba(255, 168, 79, 0.16);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px rgba(255, 194, 102, 0.32), 0 8px 20px rgba(255, 168, 79, 0.08);
}

.project-board-batch-filter b {
    min-width: 22px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.075);
    color: var(--text-tertiary);
    font-size: 11px;
}

.project-board-batch-filter.is-active b {
    background: rgba(255, 168, 79, 0.22);
    color: #ffd69a;
}

.project-board-batch-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-board-batch-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
}

.project-board-batch-search {
    height: 34px;
    flex: 1 1 auto;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-tertiary);
    padding: 0 10px;
}

.project-board-batch-search input {
    min-width: 0;
    flex: 1 1 auto;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
}

.project-board-batch-search input::placeholder {
    color: var(--text-tertiary);
}

.project-board-batch-sort {
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(18, 21, 27, 0.98);
    color: var(--text-secondary);
    padding: 0 30px 0 10px;
    font-size: 12px;
    font-weight: 620;
}

.project-board-batch-grid {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-content: start;
    gap: 18px;
    overflow: auto;
    padding: 0 16px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.project-board-batch-grid.is-marquee-selecting {
    cursor: crosshair;
    user-select: none;
}

.project-board-batch-grid.is-marquee-selecting .project-board-batch-card {
    cursor: crosshair;
}

.project-board-batch-grid::-webkit-scrollbar {
    width: 8px;
}

.project-board-batch-grid::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    background-clip: content-box;
}

.project-board-batch-card {
    position: relative;
    min-width: 0;
    min-height: 204px;
    display: flex;
    flex-direction: column;
    padding: 9px 9px 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 12px;
    background: var(--home-card, rgba(255, 255, 255, 0.038));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 40px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.project-board-batch-card:hover,
.project-board-batch-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.14);
    background: var(--home-card-hover, rgba(255, 255, 255, 0.055));
    transform: translateY(-2px);
}

.project-board-batch-card.is-selected {
    border-color: var(--home-accent-line, rgba(255, 168, 79, 0.44));
    background: var(--home-card, rgba(255, 255, 255, 0.038));
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.18), 0 18px 40px rgba(0, 0, 0, 0.18);
    transform: none;
}

.project-board-batch-card.is-selected:hover,
.project-board-batch-card.is-selected:focus-visible {
    transform: none;
}

.project-board-batch-card.is-favorite {
    border-color: rgba(255, 194, 102, 0.18);
}

.project-board-batch-card.is-dragging {
    opacity: 0.58;
    transform: scale(0.965);
    box-shadow: inset 0 0 0 1px rgba(255, 194, 102, 0.16), 0 14px 30px rgba(0, 0, 0, 0.2);
}

.project-board-batch-card.is-drop-before {
    box-shadow: inset 3px 0 0 var(--accent), 0 18px 40px rgba(0, 0, 0, 0.18);
}

.project-board-batch-card.is-drop-after {
    box-shadow: inset -3px 0 0 var(--accent), 0 18px 40px rgba(0, 0, 0, 0.18);
}

.project-board-batch-more {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(9, 12, 17, 0.62);
    color: rgba(235, 239, 245, 0.78);
    opacity: 0;
    transition: opacity 0.16s ease, color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.project-board-batch-card:hover .project-board-batch-more,
.project-board-batch-more:focus-visible {
    opacity: 1;
}

.project-board-batch-more:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(9, 12, 17, 0.86);
    color: var(--text-primary);
}

.project-board-batch-favorite {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 3;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 194, 102, 0.22);
    border-radius: 8px;
    background: rgba(9, 12, 17, 0.68);
    color: rgba(255, 194, 102, 0.92);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.project-board-batch-thumb {
    position: relative;
    height: 136px;
    flex: 0 0 136px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    background: var(--home-thumb, rgba(31, 36, 43, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.032), inset 0 -1px 0 rgba(0, 0, 0, 0.16);
}

.project-board-batch-thumb-canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: rgba(26, 31, 38, 0.98);
}

.project-board-batch-thumb-canvas.has-content::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 28%;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, -50%);
}

.project-board-batch-thumb-canvas.has-content::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: 25%;
    height: 1px;
    background: rgba(255, 255, 255, 0.055);
}

.project-board-batch-thumb-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    color: var(--text-tertiary);
    font-size: 11px;
    transform: translate(-50%, -50%);
}

.project-board-batch-marquee {
    position: fixed;
    z-index: 92;
    pointer-events: none;
    border: 1px solid rgba(255, 168, 79, 0.58);
    border-radius: 8px;
    background: rgba(255, 168, 79, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.project-board-batch-marquee.hidden {
    display: none;
}

.project-board-batch-card-body {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 12px 2px 0;
}

.project-board-batch-name {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-board-batch-name-input {
    width: 100%;
    height: 25px;
    min-width: 0;
    padding: 0 7px;
    border: 1px solid var(--home-accent-line, rgba(255, 168, 79, 0.44));
    border-radius: 7px;
    outline: none;
    background: rgba(5, 8, 11, 0.72);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.project-board-batch-meta {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-board-batch-meta em {
    margin-left: 6px;
    color: var(--accent);
    font-style: normal;
    font-weight: 720;
}

.project-board-batch-empty {
    grid-column: 1 / -1;
    padding: 58px 0;
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
}

.project-board-batch-context-menu {
    position: fixed;
    z-index: 1375;
    min-width: 172px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(14, 17, 22, 0.98);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.project-board-batch-context-menu.hidden {
    display: none;
}

.project-board-batch-context-menu button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(235, 239, 245, 0.9);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 620;
    text-align: left;
}

.project-board-batch-menu-summary {
    min-height: 28px;
    display: flex;
    align-items: center;
    padding: 0 10px 4px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 650;
}

.project-board-batch-context-menu button:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.project-board-batch-context-menu button.is-danger {
    color: #ff9b9b;
}

.project-board-batch-context-menu button.is-danger:hover {
    background: rgba(255, 99, 99, 0.1);
    color: #ffb2b2;
}

@media (max-width: 760px) {
    .project-board-batch-overlay {
        padding: 12px;
    }

    .project-board-batch-dialog {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
        min-height: 0;
    }

    .project-board-batch-header {
        height: auto;
        min-height: 52px;
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .project-board-batch-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .project-board-batch-sidebar {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.065);
        padding: 10px 12px;
    }

    .project-board-batch-filter-caption {
        display: none;
    }

    .project-board-batch-filter {
        width: auto;
        flex: 0 0 auto;
        gap: 8px;
    }

    .project-board-batch-controls {
        flex-wrap: wrap;
        padding: 12px;
    }

    .project-board-batch-sort {
        width: 100%;
    }

    .project-board-batch-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 12px 14px;
    }

    .project-board-batch-card {
        min-height: 220px;
    }

    .project-board-batch-card.is-drop-before {
        box-shadow: inset 0 3px 0 var(--accent), 0 18px 40px rgba(0, 0, 0, 0.18);
    }

    .project-board-batch-card.is-drop-after {
        box-shadow: inset 0 -3px 0 var(--accent), 0 18px 40px rgba(0, 0, 0, 0.18);
    }
}

@media (max-width: 420px) {
    .project-board-actions {
        grid-template-columns: 1fr;
    }
}

body[data-theme="light"] .project-board-panel {
    background: rgba(255, 255, 255, 0.96);
}

body[data-theme="light"] .project-board-panel-header {
    border-bottom-color: rgba(18, 24, 35, 0.08);
}

body[data-theme="light"] .project-board-card {
    border-color: rgba(18, 24, 35, 0.08);
    background: rgba(18, 24, 35, 0.035);
}

body[data-theme="light"] .project-board-card:hover,
body[data-theme="light"] .project-board-card:focus-visible {
    border-color: rgba(18, 24, 35, 0.14);
    background: rgba(18, 24, 35, 0.055);
}

body[data-theme="light"] .project-board-card.is-active {
    border-color: rgba(230, 140, 15, 0.38);
    background: rgba(255, 168, 79, 0.12);
}

body[data-theme="light"] .project-board-layout-toggle {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(18, 24, 35, 0.04);
}

body[data-theme="light"] .project-board-layout-toggle:hover {
    border-color: rgba(18, 24, 35, 0.18);
    background: rgba(18, 24, 35, 0.07);
}

body[data-theme="light"] .project-board-context-menu {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(255, 255, 255, 0.98);
}

.sidebar-add-node-menu {
    position: fixed;
    z-index: 240;
    width: 244px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(16, 20, 25, 0.72);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.14s ease, transform 0.14s ease;
    backdrop-filter: blur(22px) saturate(1.12);
}

.sidebar-add-node-menu.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
}

.sidebar-add-node-title,
.sidebar-add-node-section {
    padding: 4px 2px 9px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 520;
    letter-spacing: 0;
}

.sidebar-add-node-section {
    padding-top: 12px;
    padding-bottom: 8px;
}

.sidebar-add-node-list {
    display: grid;
    gap: 6px;
}

.sidebar-add-node-item {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 10px;
    border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.sidebar-add-node-item:hover,
.sidebar-add-node-item:focus-visible {
    outline: none;
    background: var(--panel-hover);
    color: var(--text-primary);
}

.sidebar-add-node-item:active {
    transform: translateY(1px);
}

.sidebar-add-node-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.sidebar-add-node-item:hover .sidebar-add-node-icon,
.sidebar-add-node-item:focus-visible .sidebar-add-node-icon {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-add-node-icon svg {
    width: 17px;
    height: 17px;
}

.sidebar-add-node-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.sidebar-add-node-copy strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 560;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-add-node-copy small {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 420;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-upload-item {
    min-height: 48px;
}

body[data-theme="light"] .sidebar-add-node-menu {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 20px 50px rgba(20, 28, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] .sidebar-add-node-item:hover,
body[data-theme="light"] .sidebar-add-node-item:focus-visible {
    background: rgba(18, 24, 35, 0.06);
}

body[data-theme="light"] .sidebar-add-node-icon {
    background: rgba(18, 24, 35, 0.06);
}

body[data-theme="light"] .sidebar-add-node-item:hover .sidebar-add-node-icon,
body[data-theme="light"] .sidebar-add-node-item:focus-visible .sidebar-add-node-icon {
    border-color: rgba(230, 140, 15, 0.38);
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-help-menu {
    position: fixed;
    z-index: 230;
    width: 132px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(20, 24, 31, 0.98), rgba(15, 19, 25, 0.98));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.14s ease, transform 0.14s ease;
    backdrop-filter: blur(18px);
}

.sidebar-help-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
}

.sidebar-help-menu-item {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 9px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    letter-spacing: 0;
    transition: background 0.14s ease, color 0.14s ease;
}

.sidebar-help-menu-item:hover,
.sidebar-help-menu-item:focus-visible {
    outline: none;
    background: rgba(255, 168, 79, 0.08);
    color: var(--text-primary);
}

.sidebar-help-menu-item svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: var(--text-primary);
    opacity: 0.96;
}

body[data-theme="light"] .sidebar-help-menu {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 46px rgba(20, 28, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-body {
    scrollbar-color: rgba(126, 135, 148, 0.72) rgba(236, 239, 244, 0.9);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-body::-webkit-scrollbar-track {
    background: rgba(236, 239, 244, 0.9);
}

body[data-theme="light"] .modal-overlay#helpModal .modal-body::-webkit-scrollbar-thumb {
    border-color: rgba(236, 239, 244, 0.9);
    background: rgba(126, 135, 148, 0.72);
}

.canvas-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 56px);
    overflow: hidden;
    cursor: grab;
    isolation: isolate;
}

.canvas-container:active {
    cursor: grabbing;
}

.canvas-container.panning {
    cursor: grabbing;
}

.canvas-container.selecting {
    cursor: crosshair;
}

.canvas-content {
    position: absolute;
    inset: 0;
    min-width: 100%;
    min-height: 100%;
    transform-origin: 0 0;
    will-change: transform;
}

.canvas-content.is-edit-focus-transition {
    transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.22, 1);
}

.dot-grid {
    position: absolute;
    inset: -4000px;
    background-image: radial-gradient(circle, var(--grid-dot) var(--grid-dot-size), transparent var(--grid-dot-size));
    background-size: var(--grid-spacing) var(--grid-spacing);
    pointer-events: none;
}

.canvas-connections-layer {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 3;
    width: 1px;
    height: 1px;
    overflow: visible;
    pointer-events: none;
}

.canvas-connection-path {
    fill: none;
    stroke: rgba(255, 168, 79, 0.46);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px rgba(255, 168, 79, 0.18));
    pointer-events: none;
}

.canvas-connection-path.is-drafting {
    stroke: rgba(255, 179, 71, 0.36);
    stroke-width: 1.6;
    stroke-dasharray: 6 4;
    filter: none;
    animation: canvasConnectionActiveDash 10.8s linear infinite;
}

.canvas-connection-path.is-selected {
    stroke: rgba(255, 156, 56, 0.9);
    stroke-width: 2.05;
    filter: drop-shadow(0 0 6px rgba(255, 128, 34, 0.26));
}

.canvas-connection-runner-glow,
.canvas-connection-runner-core {
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.canvas-connection-runner-glow {
    filter: blur(1.8px) drop-shadow(0 0 5px rgba(255, 128, 34, 0.22));
}

.canvas-connection-runner-core {
    filter: drop-shadow(0 0 4px rgba(255, 156, 54, 0.34));
}

.canvas-connection-scissor {
    position: fixed;
    z-index: 12050;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 154, 54, 0.62);
    border-radius: 999px;
    background: rgba(16, 20, 25, 0.92);
    color: rgba(255, 184, 104, 0.94);
    box-shadow: 0 0 0 3px rgba(255, 132, 36, 0.12), 0 12px 28px rgba(0, 0, 0, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.92);
    transition: opacity 0.14s ease, transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.canvas-connection-scissor.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.canvas-connection-scissor:hover {
    border-color: rgba(255, 170, 66, 0.88);
    background: rgba(28, 24, 20, 0.96);
}

.canvas-connection-scissor svg {
    width: 16px;
    height: 16px;
}

@keyframes canvasConnectionActiveDash {
    from {
        stroke-dashoffset: 100;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.canvas-selection-box {
    position: absolute;
    z-index: 80;
    display: none;
    border: 1px solid rgba(255, 168, 79, 0.88);
    border-radius: 4px;
    background: rgba(255, 168, 79, 0.12);
    box-shadow: 0 0 0 1px rgba(11, 14, 19, 0.34), 0 12px 32px rgba(255, 168, 79, 0.12);
    pointer-events: none;
}

.canvas-selection-box.show {
    display: block;
}

.selection-group {
    position: absolute;
    z-index: 10020;
    color: var(--text-secondary);
    cursor: grab;
    pointer-events: auto;
    overflow: visible;
}

.selection-group.is-dragging {
    cursor: grabbing;
}

.selection-group-frame {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(201, 207, 216, 0.44);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.065);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 18px 44px rgba(0, 0, 0, 0.14);
    cursor: inherit;
}

.selection-group-toolbar,
.canvas-group-toolbar {
    position: absolute;
    left: 50%;
    top: -48px;
    z-index: 24;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(24, 26, 30, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px) saturate(140%);
    transform: translateX(-50%) scale(var(--canvas-inv-scale, 1));
    transform-origin: 50% 100%;
    pointer-events: auto;
    white-space: nowrap;
}

.selection-group-toolbar button,
.canvas-group-toolbar-btn,
.canvas-group-color-dot,
.canvas-group-layout-option {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
}

.selection-group-toolbar button,
.canvas-group-toolbar-btn {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.selection-group-toolbar button:hover,
.canvas-group-toolbar-btn:hover,
.canvas-group-toolbar-btn.is-active,
.canvas-group-layout-option:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.selection-group-toolbar svg,
.canvas-group-toolbar svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.selection-group-port,
.canvas-group-port {
    position: absolute;
    right: -32px;
    top: 50%;
    z-index: 22;
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--node-port-border);
    border-radius: 999px;
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transform: translate(50%, -50%);
    transform-origin: 50% 50%;
}

.selection-group-port:hover,
.canvas-group-port:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.selection-group-toolbar {
    z-index: 10030;
}

.selection-group-fixed-toolbar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147482000;
    transform: scale(var(--selection-toolbar-scale, 1));
    transform-origin: 50% 100%;
}

.selection-group-fixed-toolbar .canvas-group-layout-menu {
    z-index: 2147482001;
}

.selection-group-badge {
    position: absolute;
    left: 8px;
    top: -25px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
}

.canvas-group {
    position: absolute;
    z-index: 5;
    color: var(--text-secondary);
    pointer-events: none;
    overflow: visible;
}

.canvas-group-frame {
    position: absolute;
    inset: 0;
    border: 1px solid var(--canvas-group-border, rgba(255, 168, 79, 0.34));
    border-radius: 14px;
    background: var(--canvas-group-bg, rgba(255, 168, 79, 0.055));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
    cursor: grab;
    pointer-events: auto;
}

.canvas-group.selected .canvas-group-frame,
.canvas-group:hover .canvas-group-frame {
    border-color: var(--canvas-group-border-active, rgba(255, 168, 79, 0.72));
    background: color-mix(in srgb, var(--canvas-group-bg, rgba(255, 168, 79, 0.055)) 78%, rgba(255, 255, 255, 0.06));
}

.canvas-group.is-selection-covered:not(.selected) .canvas-group-frame {
    border-color: color-mix(in srgb, var(--canvas-group-border, rgba(201, 207, 216, 0.34)) 62%, rgba(201, 207, 216, 0.72));
    background: var(--canvas-group-bg, rgba(255, 255, 255, 0.055));
    box-shadow: inset 0 0 0 1px rgba(201, 207, 216, 0.14), 0 0 0 1px rgba(201, 207, 216, 0.12), 0 18px 44px rgba(0, 0, 0, 0.16);
}

.canvas-group.is-selection-covered .canvas-group-header {
    color: var(--text-primary);
}

.canvas-group.is-drop-target .canvas-group-frame {
    border-color: rgba(100, 200, 255, 0.9);
    background: color-mix(in srgb, var(--canvas-group-bg, rgba(255, 168, 79, 0.055)) 82%, rgba(100, 200, 255, 0.12));
    box-shadow: inset 0 0 20px rgba(100, 200, 255, 0.06), 0 0 20px rgba(100, 200, 255, 0.28);
}

.canvas-group-header {
    position: absolute;
    left: 8px;
    top: -25px;
    max-width: calc(100% - 20px);
    height: 18px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: var(--text-primary);
    cursor: grab;
    pointer-events: auto;
    user-select: none;
}

.canvas-group:active .canvas-group-header,
.canvas-group:active .canvas-group-frame {
    cursor: grabbing;
}

.canvas-group-title,
.canvas-group-count {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: 0;
}

.canvas-group-title {
    max-width: 170px;
    color: var(--text-primary);
    font-weight: 500;
    padding: 2px 3px 2px 0;
    border-radius: 5px;
    pointer-events: auto;
    cursor: text;
}

.canvas-group-title:hover {
    background: rgba(255, 255, 255, 0.06);
}

.canvas-group-name-input {
    width: 150px;
    min-width: 70px;
    max-width: 180px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    outline: none;
    background: rgba(9, 12, 16, 0.92);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    padding: 2px 5px;
}

.canvas-group-count {
    color: var(--text-primary);
    font-weight: 500;
}

.canvas-group.is-storyboard-group {
    z-index: 6;
}

.canvas-content.has-selection-group-preview .canvas-group.is-storyboard-group.is-selection-covered {
    z-index: 10019;
}

.canvas-group.is-storyboard-group .canvas-group-frame {
    border-radius: 3px;
    background: #24272c;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.canvas-group.is-storyboard-group.selected .canvas-group-frame,
.canvas-group.is-storyboard-group:hover .canvas-group-frame {
    border-color: rgba(255, 255, 255, 0.18);
    background: #25292f;
    box-shadow: 0 0 0 1px rgba(160, 174, 192, 0.08);
}

.canvas-group.is-storyboard-group.is-selection-covered:not(.selected) .canvas-group-frame {
    border-color: rgba(201, 207, 216, 0.32);
    background: #24272c;
    box-shadow: 0 0 0 1px rgba(201, 207, 216, 0.12);
}

.canvas-group.is-storyboard-group.is-storyboard-editing .canvas-group-frame {
    border-color: rgba(232, 238, 247, 0.26);
    background: #25292f;
    box-shadow: inset 0 0 0 1px rgba(232, 238, 247, 0.08), 0 0 0 1px rgba(232, 238, 247, 0.08);
}

.canvas-group.is-storyboard-group .canvas-group-header {
    left: 0;
    top: -25px;
    color: var(--text-secondary);
}

.canvas-group.is-storyboard-group .canvas-group-title,
.canvas-group.is-storyboard-group .canvas-group-count {
    color: var(--text-secondary);
}

.canvas-group.is-storyboard-group.is-storyboard-editing .canvas-group-title,
.canvas-group.is-storyboard-group.is-storyboard-editing .canvas-group-count {
    color: var(--text-primary);
}

.storyboard-empty-cells {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.storyboard-empty-cell {
    position: absolute;
    display: grid;
    place-items: center;
    border: 1px solid rgba(12, 15, 20, 0.9);
    border-radius: 0;
    background: #24272c;
    color: rgba(185, 196, 210, 0.72);
    font-size: 13px;
    line-height: 1;
    pointer-events: auto;
    cursor: grab;
    user-select: none;
}

.canvas-group.is-storyboard-editing .storyboard-empty-cell {
    cursor: pointer;
}

.canvas-group.is-storyboard-editing .storyboard-empty-cell:hover {
    background: #2a2f36;
    color: rgba(226, 232, 240, 0.9);
    box-shadow: inset 0 0 0 1px rgba(160, 174, 192, 0.14);
}

body[data-theme="light"] .canvas-group-frame {
    border-color: var(--canvas-group-border, rgba(211, 126, 21, 0.38));
    background: var(--canvas-group-bg, rgba(255, 168, 79, 0.08));
}

body[data-theme="light"] .canvas-group.selected .canvas-group-frame,
body[data-theme="light"] .canvas-group:hover .canvas-group-frame {
    border-color: var(--canvas-group-border-active, rgba(211, 126, 21, 0.72));
    background: color-mix(in srgb, var(--canvas-group-bg, rgba(255, 168, 79, 0.08)) 78%, rgba(255, 255, 255, 0.12));
}

body[data-theme="light"] .canvas-group.is-selection-covered:not(.selected) .canvas-group-frame {
    border-color: color-mix(in srgb, var(--canvas-group-border, rgba(100, 116, 139, 0.34)) 60%, rgba(100, 116, 139, 0.62));
    background: var(--canvas-group-bg, rgba(255, 255, 255, 0.06));
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.1), 0 0 0 1px rgba(100, 116, 139, 0.1), 0 16px 36px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .canvas-group.is-drop-target .canvas-group-frame {
    border-color: rgba(14, 165, 233, 0.72);
    background: color-mix(in srgb, var(--canvas-group-bg, rgba(255, 168, 79, 0.08)) 78%, rgba(14, 165, 233, 0.12));
    box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.05), 0 0 18px rgba(14, 165, 233, 0.2);
}

body[data-theme="light"] .canvas-group-header {
    background: transparent;
    box-shadow: none;
}

body[data-theme="light"] .canvas-group-name-input {
    border-color: rgba(18, 24, 35, 0.16);
    background: rgba(255, 255, 255, 0.96);
}

body[data-theme="light"] .canvas-group.is-storyboard-group .canvas-group-frame {
    border-color: rgba(18, 24, 35, 0.12);
    background: #f1f3f5;
}

body[data-theme="light"] .canvas-group.is-storyboard-group.is-selection-covered:not(.selected) .canvas-group-frame {
    border-color: rgba(100, 116, 139, 0.34);
    background: #f1f3f5;
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.12);
}

body[data-theme="light"] .canvas-group.is-storyboard-group.is-storyboard-editing .canvas-group-frame {
    border-color: rgba(18, 24, 35, 0.24);
    background: #eef1f5;
    box-shadow: inset 0 0 0 1px rgba(18, 24, 35, 0.06), 0 0 0 1px rgba(18, 24, 35, 0.06);
}

body[data-theme="light"] .storyboard-empty-cell {
    border-color: rgba(18, 24, 35, 0.1);
    background: #edf0f3;
    color: rgba(47, 63, 82, 0.72);
}

body[data-theme="light"] .canvas-group.is-storyboard-editing .storyboard-empty-cell:hover {
    background: #e2e6eb;
    color: rgba(47, 63, 82, 0.88);
}

.canvas-group-fixed-toolbar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;
    display: inline-flex;
    transform: none;
    transform-origin: 50% 100%;
}

.canvas-group-color-dot {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 999px;
    background: #f5f7fa;
}

.canvas-group-color-wrap {
    position: relative;
    display: inline-flex;
}

.canvas-group-color-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 7px);
    width: 128px;
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(13, 15, 19, 0.98);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
}

.canvas-group-color-wrap.open .canvas-group-color-menu {
    display: flex;
}

.canvas-group-color-option {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
}

.canvas-group-color-option span {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.canvas-group-color-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.canvas-group-color-option.active span {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.78);
}

.canvas-group-toolbar-icon {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
}

.canvas-group-toolbar-label {
    min-width: 0;
}

.canvas-group-toolbar-layout-wrap {
    position: relative;
    display: inline-flex;
}

.canvas-group-layout-toggle .canvas-group-toolbar-label {
    display: none;
}

.canvas-group-layout-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 7px);
    z-index: 10040;
    min-width: 126px;
    display: none;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(13, 15, 19, 0.96);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.canvas-group-toolbar-layout-wrap.open .canvas-group-layout-menu {
    display: flex;
}

.canvas-group-layout-option {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 12px;
    text-align: left;
}

.storyboard-toolbar-menu-wrap {
    position: relative;
    display: inline-flex;
}

.storyboard-toolbar-caret {
    width: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1;
}

.storyboard-toolbar-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 7px);
    z-index: 10040;
    min-width: 116px;
    display: none;
    flex-direction: column;
    gap: 3px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(13, 15, 19, 0.97);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.storyboard-toolbar-menu-wrap.open .storyboard-toolbar-menu {
    display: flex;
}

.storyboard-toolbar-menu-wrap.open .storyboard-toolbar-menu-trigger,
.storyboard-toolbar-menu-trigger:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.storyboard-toolbar-menu-item {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

.storyboard-toolbar-menu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.canvas-group-port {
    opacity: 0;
    transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.canvas-group.selected .canvas-group-port,
.canvas-group:hover .canvas-group-port {
    opacity: 1;
}

.canvas-group-resize-handle {
    position: absolute;
    z-index: 26;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.14s ease;
}

.canvas-group.selected .canvas-group-resize-handle,
.canvas-group:hover .canvas-group-resize-handle,
.canvas-group.is-resizing .canvas-group-resize-handle {
    opacity: 1;
}

.canvas-group-resize-handle:hover {
    background: transparent;
}

.canvas-group-resize-edge {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.canvas-group-resize-edge:hover {
    background: transparent;
}

.canvas-group-resize-edge::after {
    content: "";
    display: block;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.38);
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.canvas-group-resize-edge:hover::after,
.canvas-group.is-resizing .canvas-group-resize-edge::after {
    background: rgba(203, 213, 225, 0.76);
    box-shadow: 0 0 10px rgba(125, 211, 252, 0.24);
}

.canvas-group-resize-corner::after {
    content: "";
    width: 12px;
    height: 12px;
    border-right: 2px solid rgba(148, 163, 184, 0.72);
    border-bottom: 2px solid rgba(148, 163, 184, 0.72);
    border-radius: 0 0 7px 0;
    opacity: 0;
    transition: opacity 0.14s ease, border-color 0.14s ease, filter 0.14s ease;
}

.canvas-group-resize-corner:hover::after,
.canvas-group.is-resizing .canvas-group-resize-corner::after {
    border-color: rgba(203, 213, 225, 0.9);
    filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.34));
    opacity: 1;
}

.canvas-group-resize-nw {
    left: -11px;
    top: -11px;
    cursor: nwse-resize;
}

.canvas-group-resize-ne {
    right: -11px;
    top: -11px;
    cursor: nesw-resize;
}

.canvas-group-resize-sw {
    left: -11px;
    bottom: -11px;
    cursor: nesw-resize;
}

.canvas-group-resize-se {
    right: -11px;
    bottom: -11px;
    cursor: nwse-resize;
}

.canvas-group-resize-n {
    left: 50%;
    top: -9px;
    width: 52px;
    height: 18px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.canvas-group-resize-s {
    left: 50%;
    bottom: -9px;
    width: 52px;
    height: 18px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.canvas-group-resize-w {
    left: -9px;
    top: 50%;
    width: 18px;
    height: 52px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.canvas-group-resize-e {
    right: -9px;
    top: 50%;
    width: 18px;
    height: 52px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.canvas-group-resize-nw::after {
    transform: rotate(180deg);
}

.canvas-group-resize-ne::after {
    transform: rotate(-90deg);
}

.canvas-group-resize-sw::after {
    transform: rotate(90deg);
}

.canvas-group-resize-n::after,
.canvas-group-resize-s::after {
    width: 28px;
    height: 2px;
}

.canvas-group-resize-w::after,
.canvas-group-resize-e::after {
    width: 2px;
    height: 28px;
}

body[data-theme="light"] .selection-group-frame {
    border-color: rgba(18, 24, 35, 0.24);
    background: rgba(18, 24, 35, 0.045);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54), 0 18px 44px rgba(18, 24, 35, 0.08);
}

body[data-theme="light"] .selection-group-toolbar,
body[data-theme="light"] .canvas-group-toolbar,
body[data-theme="light"] .canvas-group-color-menu,
body[data-theme="light"] .canvas-group-layout-menu {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(18, 24, 35, 0.12);
}

body[data-theme="light"] .selection-group-port,
body[data-theme="light"] .canvas-group-port {
    border-color: var(--node-port-border);
    background: var(--node-port-bg);
    color: var(--node-port-fg);
}

body[data-theme="light"] .selection-group-port:hover,
body[data-theme="light"] .canvas-group-port:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
}

.center-prompt {
    position: absolute;
    left: 50%;
    top: 40%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    white-space: nowrap;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.center-prompt.hidden,
.action-buttons.hidden {
    opacity: 0;
    pointer-events: none;
}

.prompt-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--gradient-primary);
    color: #111418;
    box-shadow: 0 0 16px rgba(255, 149, 0, 0.25);
}

.prompt-text {
    font-size: 14px;
    font-weight: 620;
}

.prompt-sub {
    color: var(--text-tertiary);
    font-size: 13px;
}

.action-buttons {
    position: absolute;
    left: 50%;
    top: calc(40% + 50px);
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: min(760px, calc(100vw - 240px));
    transform: translateX(-50%);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--octap-control-lg, 36px);
    padding: 0 16px;
    border: 1px solid var(--action-border);
    border-radius: var(--octap-radius-sm, var(--radius-sm));
    background: var(--action-bg);
    color: var(--text-secondary);
    font-size: var(--octap-font-13, 13px);
    font-weight: var(--octap-weight-medium, 500);
    box-shadow: var(--action-shadow);
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.action-btn:hover {
    color: var(--text-primary);
    background: var(--action-hover-bg);
    box-shadow: var(--action-hover-shadow);
    transform: translateY(-1px);
}

.action-btn svg {
    width: var(--octap-icon-sm, 14px);
    height: var(--octap-icon-sm, 14px);
    flex: 0 0 var(--octap-icon-sm, 14px);
}

.placeholder-node {
    position: absolute;
    width: 220px;
    min-height: 118px;
    z-index: 6;
    border: 1px solid var(--node-border);
    border-radius: 18px;
    background: var(--node-bg);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.placeholder-node.selected {
    border-color: rgba(255, 168, 79, 0.52);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.4);
}

.node-header {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: grab;
}

.node-header strong {
    font-size: 13px;
    font-weight: 600;
}

.node-type {
    color: var(--accent);
    font-size: 11px;
}

.node-body {
    padding: 14px 12px;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.5;
}

.node-port {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(11, 14, 19, 0.95);
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-50%);
}

.node-port.left {
    left: -5px;
}

.node-port.right {
    right: -5px;
}

.text-node-card {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.text-node-card.selected {
    box-shadow: none;
}

.text-node-mini-label {
    position: absolute;
    left: 0;
    top: -24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 520;
    pointer-events: none;
}

.text-node-mini-label svg {
    width: 13px;
    height: 13px;
    opacity: 0.72;
}

.node-minimal-label {
    position: absolute;
    left: 4px;
    top: -28px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 560;
    line-height: 1;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
}

.node-minimal-label svg {
    width: 13px;
    height: 13px;
    opacity: 0.72;
}

.text-node-preview,
.text-node-panel {
    border: 1px solid var(--text-node-border, var(--panel-line));
    background: var(--text-node-surface, var(--node-bg));
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.text-node-floating-toolbar {
    position: absolute;
    left: 50%;
    top: -76px;
    z-index: 45;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 9px;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: rgba(28, 31, 37, 0.94);
    color: var(--text-secondary);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px) scale(var(--canvas-inv-scale, 1));
    transform-origin: bottom center;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
    backdrop-filter: blur(18px) saturate(140%);
    white-space: nowrap;
}

.text-node-card[data-view-state="compact"].selected .text-node-floating-toolbar,
.text-node-card.is-active-area .text-node-floating-toolbar,
.text-node-card:not(.suppress-hover):hover .text-node-floating-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(var(--canvas-inv-scale, 1));
}

.text-node-toolbar-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
}

.text-node-toolbar-btn:hover,
.text-node-toolbar-btn.active {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.text-node-toolbar-btn svg {
    width: 14px;
    height: 14px;
}

.text-node-toolbar-btn sub {
    font-size: 0.65em;
}

.text-node-toolbar-color {
    width: 32px;
}

.toolbar-color-dot {
    width: 20px;
    height: 20px;
    display: block;
    border: 1px solid rgba(255, 168, 79, 0.28);
    border-radius: 50%;
    background: var(--text-node-color-dot, rgba(255, 168, 79, 0.14));
}

.text-node-color-popover {
    position: absolute;
    top: 54px;
    left: 9px;
    width: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border: 1px solid var(--panel-line);
    border-radius: 16px;
    background: rgba(14, 17, 23, 0.96);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.18s ease;
    backdrop-filter: blur(18px) saturate(140%);
}

.text-node-floating-toolbar.is-color-open .text-node-color-popover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.text-node-color-option {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
}

.text-node-color-option span {
    width: 23px;
    height: 23px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.text-node-color-option:hover,
.text-node-color-option.active {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--panel-hover);
}

.text-node-toolbar-divider {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: var(--panel-line);
}

.text-node-toolbar-expand {
    color: var(--text-secondary);
}

body[data-theme="light"] .text-node-floating-toolbar {
    background: rgba(255, 255, 255, 0.96);
}

body[data-theme="light"] .text-node-color-popover {
    background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .text-node-model-menu {
    background: rgba(255, 255, 255, 0.98);
}

.text-node-preview {
    position: relative;
    min-height: 184px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
}

.text-node-card:not([data-view-state="compact"]).selected .text-node-preview,
.text-node-card:not([data-view-state="compact"]).selected .text-node-panel {
    border-color: var(--text-node-border, rgba(255, 168, 79, 0.56));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.34);
}

.text-node-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 16px;
    line-height: 1;
}

.text-node-close:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.text-node-preview-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.04);
}

.text-node-preview-icon svg {
    width: 26px;
    height: 26px;
}

.text-node-try {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    justify-items: center;
}

.text-node-try-label {
    color: var(--text-tertiary);
    font-size: 12px;
}

.text-node-try-item {
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-secondary);
    font-size: 12px;
}

.text-node-try-item:hover {
    color: var(--accent);
    border-color: rgba(255, 168, 79, 0.38);
    background: var(--accent-soft);
}

.text-node-panel {
    position: relative;
    min-height: 138px;
    margin-top: 12px;
    padding: 14px 14px 10px;
    border-radius: 14px;
}

.text-node-expand {
    position: absolute;
    right: 12px;
    top: 10px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: transparent;
    color: var(--text-tertiary);
}

.text-node-expand:hover {
    color: var(--accent);
    background: var(--panel-hover);
}

.text-node-expand svg {
    width: 13px;
    height: 13px;
}

.text-node-input {
    height: 76px;
    min-height: 76px;
    max-height: 76px;
    padding: 4px 14px 8px 0;
    color: var(--text-tertiary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    outline: 0;
    cursor: text;
    user-select: text;
}

.panel-input {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 150, 0.46) transparent;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.panel-input[contenteditable="true"][data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    pointer-events: none;
}

.panel-input[contenteditable="true"][data-placeholder]:focus::before,
.panel-input[contenteditable="true"][data-placeholder].is-placeholder-focused::before {
    content: "";
}

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

.panel-input::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 136, 150, 0.46);
    background-clip: padding-box;
}

.panel-input::-webkit-scrollbar-track {
    background: transparent;
}

.text-node-input.has-text,
.text-node-input:focus {
    color: var(--text-primary);
}

.text-node-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 0;
}

.text-node-model-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.text-node-model,
.text-node-preset,
.text-node-skill,
.text-node-mini-action,
.text-node-energy {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.text-node-model {
    gap: 5px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 0;
}

.text-node-model .model-chip-icon {
    color: var(--accent);
}

.text-node-model-label,
.image-node-model-label,
.video-node-model-label {
    color: var(--text-primary);
}

.text-node-model-label,
.text-node-model-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-node-model-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 42;
    min-width: 220px;
    max-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: var(--panel-bg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.18s ease;
    backdrop-filter: blur(16px) saturate(140%);
}

.text-node-model-wrap.is-open .text-node-model-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.text-node-model-option {
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.text-node-model-option:hover,
.text-node-model-option.active {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.text-node-model-check {
    width: 14px;
    height: 14px;
    display: inline-flex;
    flex: 0 0 14px;
    color: currentColor;
    opacity: 0;
}

.text-node-model-check svg {
    width: 14px;
    height: 14px;
}

.text-node-model-option.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.text-node-model-option.active .text-node-model-check {
    opacity: 1;
}

.text-node-preset,
.text-node-skill {
    gap: 5px;
    padding: 0 10px;
    border: 1px solid var(--panel-line);
    background: rgba(255, 255, 255, 0.025);
}

.text-node-preset svg,
.text-node-skill svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
}

.text-node-spacer {
    flex: 1;
}

.text-node-mini-action {
    width: 26px;
    height: 26px;
    min-height: 26px;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text-tertiary);
    transition: background 0.15s ease, color 0.15s ease;
}

.text-node-mini-action:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.text-node-mini-action svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

.text-node-energy {
    gap: 4px;
    min-height: 28px;
    padding: 2px 4px 2px 8px;
    border: 1px solid var(--panel-line);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.035);
    margin-left: 4px;
}

.text-node-energy .coin {
    gap: 3px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-weight: 600;
    user-select: none;
}

.text-node-energy .coin svg {
    width: 12px;
    height: 12px;
    color: var(--accent);
    fill: var(--accent);
}

.text-node-energy button {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 15px;
    line-height: 1;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body:not([data-theme="light"]) .text-node-energy button {
    border: 1px solid rgba(255, 168, 79, 0.55);
    background: transparent;
    color: var(--accent);
}

.text-node-energy button:hover {
    transform: translateY(-1px);
}

body:not([data-theme="light"]) .text-node-energy button:hover {
    border-color: var(--accent);
    background: rgba(255, 168, 79, 0.12);
    color: #ffb347;
}

.text-node-energy button:active {
    transform: translateY(0);
}

.text-node-energy button svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
}

.text-node-edit-card {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--text-node-border, var(--panel-line));
    border-radius: 16px;
    background: var(--text-node-surface, var(--node-bg));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.text-node-card.selected .text-node-edit-card {
    border-color: var(--text-node-border, rgba(255, 168, 79, 0.56));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.34);
}

.text-node-resize-handle {
    position: absolute;
    z-index: 34;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.14s ease;
}

.text-node-card[data-view-state="content"].selected .text-node-resize-handle,
.text-node-card[data-view-state="content"]:hover .text-node-resize-handle,
.text-node-card[data-view-state="content"].is-resizing .text-node-resize-handle {
    opacity: 1;
}

.text-node-resize-handle:hover {
    background: transparent;
}

.text-node-resize-corner::after {
    content: "";
    width: 12px;
    height: 12px;
    border-right: 2px solid rgba(148, 163, 184, 0.72);
    border-bottom: 2px solid rgba(148, 163, 184, 0.72);
    border-radius: 0 0 7px 0;
    opacity: 0;
    transition: opacity 0.14s ease, border-color 0.14s ease, filter 0.14s ease;
}

.text-node-resize-corner:hover::after,
.text-node-card[data-view-state="content"].is-resizing .text-node-resize-corner::after {
    border-color: rgba(203, 213, 225, 0.9);
    filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.34));
    opacity: 1;
}

.text-node-resize-nw {
    left: -11px;
    top: -11px;
    cursor: nwse-resize;
}

.text-node-resize-ne {
    right: -11px;
    top: -11px;
    cursor: nesw-resize;
}

.text-node-resize-sw {
    left: -11px;
    bottom: -11px;
    cursor: nesw-resize;
}

.text-node-resize-se {
    right: -11px;
    bottom: -11px;
    cursor: nwse-resize;
}

.text-node-resize-nw::after {
    transform: rotate(180deg);
}

.text-node-resize-ne::after {
    transform: rotate(-90deg);
}

.text-node-resize-sw::after {
    transform: rotate(90deg);
}

.text-rich-editor {
    position: relative;
    width: 100%;
    min-height: 100%;
    overflow: hidden;
}

.text-rich-source {
    display: none;
}

.text-rich-surface {
    white-space: normal;
    word-break: break-word;
}

.text-rich-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    font-weight: 400;
    pointer-events: none;
}

.text-rich-surface h1,
.text-rich-surface h2,
.text-rich-surface h3,
.text-rich-surface p,
.text-rich-surface ul,
.text-rich-surface ol {
    margin: 0 0 8px;
}

.text-rich-surface h1,
.text-rich-surface h2,
.text-rich-surface h3 {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.25;
}

.text-rich-surface h1 {
    font-size: 1.58em;
}

.text-rich-surface h2 {
    font-size: 1.34em;
}

.text-rich-surface h3 {
    font-size: 1.12em;
}

.text-rich-surface p {
    min-height: 1.58em;
}

.text-rich-surface ul,
.text-rich-surface ol {
    padding-left: 22px;
}

.text-rich-surface li {
    margin: 0 0 4px;
}

.text-rich-surface hr {
    height: 0;
    margin: 12px 0;
    border: 0;
    border-top: 1px solid var(--panel-line);
}

.text-markdown-preview {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.text-md-line {
    min-height: 1.7em;
}

.text-md-h1,
.text-md-h2,
.text-md-h3 {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
}

.text-md-h1 {
    font-size: 1.58em;
}

.text-md-h2 {
    font-size: 1.34em;
}

.text-md-h3 {
    font-size: 1.12em;
}

.text-md-list {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.text-md-marker {
    min-width: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.text-md-divider {
    min-height: 16px;
    margin: 5px 0 9px;
    border-top: 1px solid var(--panel-line);
}

.text-md-blank {
    min-height: 1.7em;
}

.input-fullscreen-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-tertiary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.text-node-card[data-view-state="content"].is-active-area .input-fullscreen-btn,
.text-node-card[data-view-state="content"]:hover .input-fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

.input-fullscreen-btn:hover {
    color: var(--accent);
    background: var(--panel-hover);
}

.input-fullscreen-btn svg {
    width: 13px;
    height: 13px;
}

.edit-canvas {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 280px;
    display: block;
    overflow-y: auto;
    border: 0;
    border-radius: 16px;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    caret-color: var(--text-primary);
    padding: 28px 44px 32px 32px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    cursor: text;
    user-select: text;
}

.text-rich-surface::selection,
.text-rich-surface *::selection {
    background: var(--selection-bg);
    color: var(--selection-fg);
}

.text-node-edit-card .text-markdown-preview {
    padding: 28px 44px 32px 32px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
}

.text-node-card[data-view-state="compact"] {
    width: 480px;
    height: 280px;
    min-height: 280px;
}

.text-node-split-stack {
    position: relative;
    width: 480px;
    min-height: 280px;
}

.text-node-zoom {
    position: relative;
    width: 280px;
    margin: 0 auto;
}

.text-node-card[data-view-state="compact"] .text-node-mini-label {
    left: 0;
    top: -23px;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.text-node-card[data-view-state="compact"] .text-node-preview {
    width: 280px;
    height: 280px;
    min-height: 0;
    margin: 0 auto;
    display: block;
    border-radius: 14px;
    background: var(--text-node-surface, var(--node-bg));
    border-color: var(--panel-line);
    box-shadow: var(--shadow-lg);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.text-node-card[data-view-state="compact"].selected .text-node-preview,
.text-node-card[data-view-state="compact"].is-active-area .text-node-preview,
.text-node-card[data-view-state="compact"]:not(.suppress-hover):hover .text-node-preview {
    border-color: var(--text-node-border, rgba(255, 168, 79, 0.28));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.34);
}

.text-node-preview-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px 20px;
}

.text-node-edit-hint {
    align-self: center;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    opacity: 0.72;
    pointer-events: none;
}

.text-node-result {
    align-self: stretch;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    overflow: auto;
}

.text-node-result.is-running,
.text-node-result.is-error {
    align-items: center;
    justify-content: center;
}

.text-node-result-status {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    opacity: 0.82;
}

.text-node-result.is-running .text-node-result-status {
    animation: text-node-result-pulse 1.1s ease-in-out infinite;
}

.text-node-result.is-error .text-node-result-status {
    color: var(--danger, #e5544b);
}

.text-node-result-text {
    width: 100%;
    color: var(--text-primary);
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

@keyframes text-node-result-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

.text-node-card[data-view-state="compact"] .text-node-preview-icon {
    align-self: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-tertiary);
    opacity: 0.58;
}

.text-node-card[data-view-state="compact"] .text-node-preview-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.5;
}

.text-node-card[data-view-state="compact"] .text-node-try {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin: 6px 0 0;
}

.text-node-card[data-view-state="compact"] .text-node-try-label {
    margin-bottom: 1px;
    color: var(--text-tertiary);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.text-node-card[data-view-state="compact"] .text-node-try-item {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: 0;
}

.text-node-card[data-view-state="compact"] .text-node-try-item:hover {
    color: var(--accent);
    border-color: transparent;
    background: transparent;
    transform: translateX(2px);
}

.text-node-card[data-view-state="compact"] .try-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: var(--panel-bg);
    color: var(--text-primary);
    opacity: 1;
    box-shadow: none;
}

.text-node-card[data-view-state="compact"] .try-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

.text-node-card[data-view-state="compact"] .text-node-panel {
    position: absolute;
    top: 298px;
    left: 50%;
    width: 560px;
    min-height: 144px;
    margin: 0;
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 14px;
    background: var(--text-node-surface, var(--node-bg));
    border-color: var(--text-node-border, var(--panel-line));
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px) scale(var(--canvas-inv-scale, 1));
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1), border-color 0.18s ease;
    z-index: 5;
}

.text-node-card[data-view-state="compact"].is-input-panel-active .text-node-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(var(--canvas-inv-scale, 1));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.26);
}

.text-node-card[data-view-state="compact"] .text-node-panel::before {
    content: "";
    min-height: 28px;
    flex: 0 0 28px;
    pointer-events: none;
}

.text-node-card[data-view-state="compact"] .text-node-input {
    height: 84px;
    min-height: 84px;
    max-height: 84px;
    padding: 8px 14px 4px 4px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-tertiary);
    letter-spacing: 0;
    word-break: break-word;
}

.text-node-card[data-view-state="compact"] .text-node-input.has-text,
.text-node-card[data-view-state="compact"] .text-node-input:focus {
    color: var(--text-primary);
}

.text-node-card[data-view-state="compact"] .text-node-expand {
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    background: transparent;
}

.text-node-card[data-view-state="compact"] .text-node-expand:hover {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
}

.text-node-card[data-view-state="compact"] .text-node-bottom {
    min-height: 28px;
    gap: 6px;
    padding: 6px 2px 0;
    border-top: 0;
}

.text-node-card[data-view-state="compact"] .text-node-model,
.text-node-card[data-view-state="compact"] .text-node-preset,
.text-node-card[data-view-state="compact"] .text-node-skill,
.text-node-card[data-view-state="compact"] .text-node-mini-action,
.text-node-card[data-view-state="compact"] .text-node-energy {
    min-height: 26px;
    font-size: 11.5px;
    letter-spacing: 0;
}

.text-node-card[data-view-state="compact"] .text-node-model {
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
}

.model-chip-icon,
.coin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.model-chip-icon svg,
.coin svg {
    width: 12px;
    height: 12px;
    color: var(--accent);
}

.text-node-card[data-view-state="compact"] .text-node-panel:not(.expanded) .text-node-preset,
.text-node-card[data-view-state="compact"] .text-node-panel:not(.expanded) .text-node-skill {
    position: absolute;
    top: 10px;
    z-index: 2;
    gap: 5px;
    padding: 4px 9px 5px;
    border-radius: 7px;
}

.text-node-card[data-view-state="compact"] .text-node-panel:not(.expanded) .text-node-preset {
    left: 12px;
}

.text-node-card[data-view-state="compact"] .text-node-panel:not(.expanded) .text-node-skill {
    left: 84px;
}

.text-node-card[data-view-state="compact"] .text-node-preset svg,
.text-node-card[data-view-state="compact"] .text-node-skill svg {
    width: 12px;
    height: 12px;
}

.text-node-card[data-view-state="compact"] .text-node-mini-action {
    width: 26px;
    border: 0;
}

.text-node-card[data-view-state="compact"] .text-node-mini-action svg {
    width: 13px;
    height: 13px;
}

.text-node-card[data-view-state="compact"] .text-node-energy {
    gap: 4px;
    padding: 2px 4px 2px 8px;
    border-radius: 999px;
}

.text-node-card[data-view-state="compact"] .text-node-energy button {
    width: 24px;
    height: 24px;
}

.text-node-card[data-view-state="compact"] .text-node-energy button svg {
    width: 12px;
    height: 12px;
}

.text-node-card .node-port {
    opacity: 0;
    pointer-events: none;
    border-color: var(--node-port-border);
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    cursor: crosshair;
    z-index: 20;
}

.text-node-card[data-view-state="compact"].selected .node-port,
.text-node-card[data-view-state="compact"].is-active-area .node-port,
.text-node-card[data-view-state="compact"]:not(.suppress-hover):hover .node-port,
.text-node-card[data-view-state="content"].is-active-area .node-port,
.text-node-card[data-view-state="content"]:hover .node-port {
    opacity: 1;
    pointer-events: auto;
}

.text-node-card[data-view-state="compact"] .node-port {
    top: 140px;
}

.text-node-card[data-view-state="compact"] .node-port.left {
    left: 68px;
    width: 16px;
    height: 16px;
    border-width: 1.5px;
}

.text-node-card .node-port.left:hover,
.text-node-card .node-port.left.snap,
.text-node-card .node-port.left.snap-target {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 12px var(--node-port-glow);
}

.text-node-card .node-port.right {
    width: 45px;
    height: 45px;
    border: 1.5px solid var(--node-port-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.text-node-card .node-port.right::after {
    content: "+";
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}

.text-node-card[data-view-state="compact"] .node-port.right {
    right: 42px;
}

.text-node-card .node-port.right:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
    transform: translateY(-50%) scale(1.08);
}

.image-node-card {
    width: var(--image-node-frame-width, 480px);
    height: var(--image-node-frame-height, 270px);
    min-height: var(--image-node-frame-height, 270px);
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.image-node-card.selected {
    box-shadow: none;
}

.image-node-split-stack {
    position: relative;
    width: var(--image-node-frame-width, 480px);
    min-height: var(--image-node-frame-height, 270px);
}

.image-node-zoom {
    position: relative;
    width: var(--image-node-frame-width, 480px);
}

.image-node-mini-label {
    position: absolute;
    left: 0;
    top: -23px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.image-node-mini-label svg {
    width: 13px;
    height: 13px;
    opacity: 0.72;
}

.image-node-resolution-readout {
    position: absolute;
    right: 0;
    top: -23px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 520;
    line-height: 1;
    pointer-events: none;
}

.image-node-preview,
.image-node-panel {
    border: 1px solid var(--panel-line);
    background: var(--node-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.image-node-preview {
    position: relative;
    width: var(--image-node-frame-width, 480px);
    height: var(--image-node-frame-height, 270px);
    aspect-ratio: var(--image-node-aspect-ratio, 16 / 9);
    min-height: 0;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.image-node-card.selected .image-node-preview,
.image-node-card.is-active-area .image-node-preview,
.image-node-card:hover .image-node-preview {
    border-color: rgba(255, 168, 79, 0.28);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.34);
}

body.is-reference-drag-hover-suppressed .image-node-card:not(.selected):hover .image-node-preview,
body.is-reference-drag-hover-suppressed .video-node-card:not(.selected):hover .image-node-preview {
    border-color: var(--panel-line);
    box-shadow: var(--shadow-lg);
}

.image-node-preview-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px 20px;
}

.image-node-preview-content.has-upload {
    padding: 0;
    display: block;
}

.image-node-preview-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.image-node-preview-image.image-node-preview-image-contain {
    object-fit: contain;
    background: rgba(9, 11, 15, 0.82);
}

.image-node-preview.is-transparent-media,
.image-node-content-media.is-transparent-media,
.image-node-preview-content.is-transparent-media {
    background-color: #1a1d23;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%);
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.is-transparent-media .image-node-preview-image.image-node-preview-image-contain {
    background: transparent;
}

body[data-theme="light"] .image-node-preview.is-transparent-media,
body[data-theme="light"] .image-node-content-media.is-transparent-media,
body[data-theme="light"] .image-node-preview-content.is-transparent-media {
    background-color: #eef1f5;
    background-image:
        linear-gradient(45deg, rgba(20, 24, 31, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(20, 24, 31, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(20, 24, 31, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(20, 24, 31, 0.1) 75%);
}

.image-node-upload-hint {
    align-self: center;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    opacity: 0.72;
    pointer-events: none;
}

.image-node-preview-icon {
    align-self: center;
    width: 36px;
    height: 36px;
    color: var(--text-tertiary);
    opacity: 0.62;
}

.image-node-preview-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 1.5;
}

.image-node-try {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.image-node-try-label {
    margin-bottom: 1px;
    color: var(--text-tertiary);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.image-node-try-item {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: 0;
}

.image-node-try-item:hover {
    color: var(--accent);
    transform: translateX(2px);
}

body.is-reference-drag-hover-suppressed .image-node-try-item:hover {
    color: var(--text-primary);
    transform: none;
}

.image-node-try-item .try-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: var(--panel-bg);
    color: var(--text-primary);
}

.image-node-try-item .try-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

.image-node-upload {
    position: absolute;
    top: -52px;
    left: 50%;
    z-index: 30;
    width: auto;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: var(--node-bg);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease, border-color 0.15s ease;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px) saturate(140%);
}

body[data-theme="light"] .image-node-upload {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(18, 24, 35, 0.12);
    color: var(--text-primary);
}

.image-node-card.selected .image-node-upload,
.image-node-card.is-active-area .image-node-upload,
.image-node-card:hover .image-node-upload {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.image-node-upload:hover {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
    color: var(--accent);
}

.image-node-upload svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
}

.image-node-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.image-node-content-wrap {
    position: relative;
    width: var(--image-node-frame-width, 480px);
    height: var(--image-node-frame-height, 270px);
}

.image-node-content-wrap::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -36px;
    width: min(780px, max(100%, 640px));
    max-width: calc(100vw - 36px);
    height: 38px;
    transform: translateX(-50%);
    background: transparent;
    pointer-events: none;
}

.image-node-card[data-view-state="content"].is-active-area .image-node-content-wrap::before,
.image-node-card[data-view-state="content"]:hover .image-node-content-wrap::before,
.image-node-card.has-open-image-menu .image-node-content-wrap::before {
    pointer-events: auto;
}

.image-node-render-toolbar {
    position: absolute;
    left: 50%;
    top: -78px;
    z-index: 46;
    min-height: 48px;
    width: max-content;
    max-width: min(780px, calc(100vw - 36px));
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    background: rgba(13, 17, 22, 0.96);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(5px);
    transition: opacity 0.16s ease, transform 0.18s ease, border-color 0.16s ease;
}

body[data-theme="light"] .image-node-render-toolbar {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(252, 253, 255, 0.96);
    color: rgba(28, 34, 45, 0.9);
    box-shadow: 0 18px 42px rgba(20, 25, 34, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.image-node-card[data-view-state="content"].is-active-area .image-node-render-toolbar,
.image-node-card[data-view-state="content"]:hover .image-node-render-toolbar,
.image-node-card[data-view-state="compact"].is-active-area .image-node-render-toolbar,
.image-node-card[data-view-state="compact"]:hover .image-node-render-toolbar,
.image-node-card.has-open-image-menu .image-node-render-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.image-node-card.has-multi-angle-editor .image-node-render-toolbar {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(5px);
}

.image-node-card.has-multi-angle-editor .image-node-content-wrap::before,
.image-node-card.has-multi-angle-editor .node-port,
.image-node-card.has-multi-angle-editor .image-node-upload,
.image-node-card.has-multi-angle-editor .image-node-panel {
    opacity: 0 !important;
    pointer-events: none !important;
}

.image-node-render-toolbar.has-open-menu,
.image-node-content-wrap.has-open-image-menu .image-node-render-toolbar {
    z-index: 10060;
    border-color: rgba(255, 255, 255, 0.14);
}

.image-node-render-btn {
    position: relative;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease;
}

.image-node-render-btn:hover,
.image-node-render-btn.is-open,
.image-node-render-menu-toggle.hover-open > .image-node-render-toolbar-trigger {
    background: rgba(255, 255, 255, 0.085);
    color: #ffffff;
}

.image-node-render-icon-only {
    width: 32px;
    padding: 0;
}

body[data-theme="light"] .image-node-render-btn:hover,
body[data-theme="light"] .image-node-render-btn.is-open,
body[data-theme="light"] .image-node-render-menu-toggle.hover-open > .image-node-render-toolbar-trigger {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

.image-node-render-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 15px;
}

.image-node-render-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

.image-node-render-hd-icon {
    width: 17px;
    height: 15px;
    min-width: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 4px;
    color: currentColor;
    font-size: 7.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

body[data-theme="light"] .image-node-render-hd-icon {
    border-color: rgba(18, 24, 35, 0.5);
}

.image-node-render-label {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-node-render-badge {
    height: 18px;
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(44, 173, 196, 0.34);
    color: #7ee7fb;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.image-node-render-divider {
    width: 1px;
    height: 22px;
    margin: 0 5px;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .image-node-render-divider {
    background: rgba(18, 24, 35, 0.12);
}

.image-node-render-menu-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.image-node-render-hover-bridge {
    position: absolute;
    top: 100%;
    left: -8px;
    z-index: 10064;
    display: block;
    height: 14px;
    pointer-events: none;
}

.image-node-render-menu-toggle.hover-open .image-node-render-hover-bridge,
.image-node-render-menu-toggle.open .image-node-render-hover-bridge {
    pointer-events: auto;
}

.image-node-render-hd-toggle .image-node-render-hover-bridge {
    width: 138px;
}

.image-node-render-grid-toggle .image-node-render-hover-bridge {
    width: 178px;
}

.image-node-render-caret {
    width: 18px;
    height: 24px;
    margin-right: -5px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.58);
    transition: transform 0.16s ease;
}

body[data-theme="light"] .image-node-render-caret {
    color: rgba(18, 24, 35, 0.46);
}

.image-node-render-caret svg {
    width: 9px;
    height: 9px;
}

.image-node-render-menu-toggle.open .image-node-render-caret {
    transform: rotate(180deg);
}

.image-node-render-hd-toggle.hover-open .image-node-render-caret,
.image-node-render-grid-toggle.hover-open .image-node-render-caret {
    transform: rotate(180deg);
}

.image-node-render-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 10065;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 11px;
    background: rgba(16, 20, 25, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(14px) saturate(135%);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

body[data-theme="light"] .image-node-render-menu {
    border-color: rgba(18, 24, 35, 0.12);
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(20, 25, 34, 0.16);
}

.image-node-render-menu-toggle.open .image-node-render-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.image-node-render-hd-toggle.hover-open .image-node-render-menu,
.image-node-render-grid-toggle.hover-open .image-node-render-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.image-node-render-hd-menu {
    min-width: 118px;
}

.image-node-render-grid-menu {
    min-width: 158px;
}

.image-node-render-panorama-menu {
    min-width: 136px;
}

.image-node-render-option {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    font-weight: 620;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
}

.image-node-render-option-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.image-node-render-option-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    color: rgba(255, 255, 255, 0.62);
}

.image-node-render-option-icon svg {
    width: 15px;
    height: 15px;
}

.image-node-render-option-icon .image-node-render-hd-icon {
    width: 16px;
    height: 14px;
    min-width: 16px;
    font-size: 7px;
}

body[data-theme="light"] .image-node-render-option {
    color: rgba(18, 24, 35, 0.78);
}

body[data-theme="light"] .image-node-render-option-icon {
    color: rgba(18, 24, 35, 0.5);
}

.image-node-render-option:hover {
    background: rgba(255, 255, 255, 0.075);
    color: #ffffff;
}

.image-node-render-option:hover .image-node-render-option-icon,
.image-node-render-option.active .image-node-render-option-icon {
    color: currentColor;
}

body[data-theme="light"] .image-node-render-option:hover {
    background: rgba(18, 24, 35, 0.07);
    color: rgba(18, 24, 35, 0.94);
}

.image-node-render-option.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

body[data-theme="light"] .image-node-render-option.active {
    background: rgba(18, 24, 35, 0.1);
    color: rgba(18, 24, 35, 0.96);
}

.image-node-render-option.active .image-node-model-check {
    opacity: 1;
}

.image-node-render-option-hint {
    color: rgba(255, 255, 255, 0.44);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

body[data-theme="light"] .image-node-render-option-hint {
    color: rgba(18, 24, 35, 0.42);
}

.image-node-render-grid-custom {
    margin-top: 5px;
    padding: 9px 8px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .image-node-render-grid-custom {
    border-top-color: rgba(18, 24, 35, 0.1);
}

.image-node-render-grid-custom-title {
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.54);
    font-size: 11px;
    font-weight: 620;
}

body[data-theme="light"] .image-node-render-grid-custom-title {
    color: rgba(18, 24, 35, 0.52);
}

.image-node-render-grid-cells {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    touch-action: none;
}

.image-node-render-grid-cell {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.image-node-render-grid-cell:hover,
.image-node-render-grid-cell.active {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.image-node-render-grid-cells.is-selecting .image-node-render-grid-cell.active {
    background: rgba(255, 255, 255, 0.32);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42);
}

body[data-theme="light"] .image-node-render-grid-cell {
    background: rgba(18, 24, 35, 0.12);
}

body[data-theme="light"] .image-node-render-grid-cell:hover,
body[data-theme="light"] .image-node-render-grid-cell.active {
    background: rgba(18, 24, 35, 0.24);
    box-shadow: 0 0 0 1px rgba(18, 24, 35, 0.28);
}

.storyboard-sequence-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 5;
    min-width: 18px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border-radius: 3px;
    background: rgba(6, 10, 14, 0.72);
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.storyboard-node-card.image-node-card {
    overflow: visible;
}

.storyboard-node-card.placeholder-node,
.storyboard-node-card.placeholder-node.selected {
    border-color: rgba(255, 255, 255, 0.09);
    background: transparent;
    box-shadow: none;
}

.storyboard-node-card .image-node-split-stack,
.storyboard-node-card .image-node-zoom,
.storyboard-node-card .image-node-content-wrap,
.storyboard-node-card .image-node-content-media {
    width: 100%;
    height: 100%;
}

.storyboard-node-card .image-node-split-stack {
    min-height: 0;
}

.storyboard-node-card .image-node-mini-label,
.storyboard-node-card .image-node-resolution-readout,
.storyboard-node-card .image-node-render-toolbar,
.storyboard-node-card .image-node-upload,
.storyboard-node-card .image-node-inline-upload {
    display: none !important;
}

.storyboard-node-card .node-port,
.storyboard-node-card.selected .node-port,
.storyboard-node-card.is-active-area .node-port,
.storyboard-node-card:hover .node-port,
.storyboard-node-card.connection-source .node-port,
.canvas-content.is-connecting .storyboard-node-card .node-port {
    opacity: 0 !important;
    pointer-events: none !important;
}

.storyboard-node-card .image-node-content-media {
    border-radius: 0;
    border-color: rgba(12, 15, 20, 0.9);
    background: #24272c;
    box-shadow: none;
    backdrop-filter: none;
}

.storyboard-node-card[data-view-state="content"].selected .image-node-content-media,
.storyboard-node-card[data-view-state="content"]:hover .image-node-content-media {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.storyboard-node-card .image-node-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.storyboard-node-card .image-node-upload-hint {
    font-size: 12px;
    color: rgba(196, 204, 216, 0.72);
}

.storyboard-node-card .image-node-preview-icon {
    color: rgba(145, 155, 170, 0.66);
    opacity: 0.76;
}

.storyboard-slot-menu {
    position: fixed;
    z-index: 2147482100;
    width: 204px;
    display: grid;
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(20, 22, 26, 0.98);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.storyboard-slot-menu button {
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(216, 224, 235, 0.88);
    font-size: 12px;
    text-align: left;
}

.storyboard-slot-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.storyboard-slot-menu span {
    width: 16px;
    flex: 0 0 16px;
    display: grid;
    place-items: center;
    color: rgba(196, 204, 216, 0.8);
    font-size: 13px;
}

.storyboard-slot-menu strong {
    font-size: 12px;
    font-weight: 600;
}

body[data-theme="light"] .storyboard-slot-menu {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 32px rgba(18, 24, 35, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .storyboard-slot-menu span {
    color: rgba(47, 63, 82, 0.86);
}

.image-node-content-media {
    position: relative;
    width: var(--image-node-frame-width, 480px);
    height: var(--image-node-frame-height, 270px);
    aspect-ratio: var(--image-node-aspect-ratio, 16 / 9);
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: var(--node-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.placeholder-node.is-image-transform-editing .image-node-render-toolbar,
.image-node-card.is-image-transform-editing .image-node-render-toolbar {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none !important;
}

.placeholder-node.is-image-transform-editing .image-node-content-media,
.image-node-card.is-image-transform-editing .image-node-content-media {
    opacity: 0;
}

.image-transform-editor {
    position: absolute;
    inset: 0;
    --image-transform-preview-width: 480px;
    --image-transform-preview-height: 270px;
    z-index: 72;
    pointer-events: none;
}

.image-transform-toolbar {
    position: absolute;
    left: 50%;
    top: -64px;
    z-index: 76;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 11px;
    background: rgba(16, 18, 22, 0.97);
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transform: translateX(-50%);
    pointer-events: auto;
    backdrop-filter: blur(16px) saturate(130%);
}

body[data-theme="light"] .image-transform-toolbar {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 24, 31, 0.93);
    box-shadow: 0 18px 42px rgba(20, 25, 34, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.image-transform-title-btn,
.image-transform-icon-btn,
.image-transform-rotate-btn,
.image-transform-save-btn {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.image-transform-title-btn {
    gap: 6px;
    padding: 0 8px;
}

.image-transform-title-btn strong {
    font-size: 12px;
    font-weight: 700;
}

.image-transform-icon-btn {
    width: 32px;
    padding: 0;
}

.image-transform-rotate-btn {
    gap: 9px;
    min-width: 68px;
    padding: 0 10px;
}

.image-transform-save-btn {
    padding: 0 15px;
    background: #f8fafc;
    color: #12151b;
}

.image-transform-title-btn:hover,
.image-transform-icon-btn:hover,
.image-transform-rotate-btn:hover,
.image-transform-icon-btn.is-active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-transform-save-btn:hover {
    background: #ffffff;
}

body[data-theme="light"] .image-transform-title-btn:hover,
body[data-theme="light"] .image-transform-icon-btn:hover,
body[data-theme="light"] .image-transform-rotate-btn:hover,
body[data-theme="light"] .image-transform-icon-btn.is-active {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.94);
}

.image-transform-icon-btn svg,
.image-transform-rotate-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.image-transform-angle {
    min-width: 34px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 760;
    text-align: center;
}

body[data-theme="light"] .image-transform-angle {
    color: rgba(18, 24, 35, 0.9);
}

.image-transform-divider {
    width: 1px;
    height: 22px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.1);
}

body[data-theme="light"] .image-transform-divider {
    background: rgba(18, 24, 35, 0.12);
}

.image-transform-preview {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 73;
    width: var(--image-transform-preview-width);
    height: var(--image-transform-preview-height);
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(9, 11, 15, 0.82);
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

body[data-theme="light"] .image-transform-preview {
    background: rgba(245, 247, 250, 0.86);
}

.image-transform-preview-canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.14s ease;
}

.image-transform-editor.is-ready .image-transform-preview-canvas {
    opacity: 1;
}

.image-transform-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

body[data-theme="light"] .image-transform-loading {
    color: rgba(18, 24, 35, 0.62);
}

.image-transform-editor.is-ready .image-transform-loading {
    display: none;
}

.image-transform-editor.is-saving .image-transform-save-btn {
    opacity: 0.72;
    pointer-events: none;
}

.image-node-card[data-view-state="content"].selected .image-node-content-media,
.image-node-card[data-view-state="content"]:hover .image-node-content-media {
    border-color: rgba(255, 168, 79, 0.28);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.34);
}

.image-node-card.storyboard-node-card[data-view-state="content"].selected .image-node-content-media,
.image-node-card.storyboard-node-card[data-view-state="content"]:hover .image-node-content-media,
.image-node-card.storyboard-node-card .image-node-content-media {
    border-color: rgba(12, 15, 20, 0.9);
    box-shadow: none;
}

.image-node-inline-upload {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(28, 31, 37, 0.7);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease, border-color 0.15s ease;
    backdrop-filter: blur(12px) saturate(140%);
}

body[data-theme="light"] .image-node-inline-upload {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary);
}

.image-panorama-overlay {
    position: fixed;
    inset: 0;
    z-index: 420;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(5, 7, 10, 0.94);
    color: rgba(255, 255, 255, 0.92);
}

.image-panorama-dialog {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.image-panorama-toolbar {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 22px;
    z-index: 4;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    background: rgba(13, 17, 22, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform: translateX(-50%);
    backdrop-filter: blur(16px) saturate(130%);
    transition: top 0.16s ease, bottom 0.16s ease;
}

.image-panorama-toolbar button {
    width: auto;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    transition: background 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

.image-panorama-toolbar button span {
    color: currentColor;
    font-size: 12px;
    font-weight: 620;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
}

.image-panorama-toolbar button:hover,
.image-panorama-toolbar button.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.image-panorama-toolbar button:disabled {
    opacity: 0.46;
}

.image-panorama-toolbar svg {
    width: 17px;
    height: 17px;
}

.image-panorama-toolbar-divider {
    width: 1px;
    height: 24px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.12);
}

.image-panorama-ratio-wrap {
    position: relative;
    display: inline-flex;
}

.image-panorama-ratio-menu {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 5;
    min-width: 118px;
    display: grid;
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 9px;
    background: rgba(19, 22, 27, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(5px);
    transition: opacity 0.14s ease, transform 0.14s ease;
    backdrop-filter: blur(16px) saturate(135%);
}

.image-panorama-ratio-wrap.is-open .image-panorama-ratio-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.image-panorama-node-toolbar-wrap .image-panorama-ratio-menu,
.image-panorama-overlay .image-panorama-ratio-menu {
    top: calc(100% + 10px);
    bottom: auto;
    transform: translateX(-50%) translateY(-5px);
}

.image-panorama-node-toolbar-wrap .image-panorama-ratio-wrap.is-open .image-panorama-ratio-menu,
.image-panorama-overlay .image-panorama-ratio-wrap.is-open .image-panorama-ratio-menu {
    transform: translateX(-50%) translateY(0);
}

.image-panorama-overlay .image-panorama-toolbar {
    top: 32px;
    bottom: auto;
}

.image-panorama-toolbar .image-panorama-ratio-option {
    width: 100%;
    justify-content: flex-start;
}

.image-panorama-toolbar .image-panorama-ratio-option.is-active {
    background: rgba(255, 255, 255, 0.12);
}

.image-panorama-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: grab;
    background: #06080d;
}

.image-panorama-overlay.is-dragging .image-panorama-stage,
.image-panorama-inline-root.is-dragging .image-panorama-stage {
    cursor: grabbing;
}

.image-panorama-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.image-panorama-guide {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.image-panorama-overlay.show-guides .image-panorama-guide,
.image-panorama-inline-root.show-guides .image-panorama-guide {
    opacity: 1;
    background:
        linear-gradient(to right, transparent 33.333%, rgba(255, 255, 255, 0.2) 33.333%, rgba(255, 255, 255, 0.2) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255, 255, 255, 0.2) 66.666%, rgba(255, 255, 255, 0.2) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
        linear-gradient(to bottom, transparent 33.333%, rgba(255, 255, 255, 0.2) 33.333%, rgba(255, 255, 255, 0.2) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255, 255, 255, 0.2) 66.666%, rgba(255, 255, 255, 0.2) calc(66.666% + 1px), transparent calc(66.666% + 1px));
}

.image-panorama-matte {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.image-panorama-matte.is-visible {
    opacity: 1;
}

.image-panorama-matte-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--panorama-matte-width, 100%);
    height: var(--panorama-matte-height, 100%);
    border: 1px solid rgba(228, 237, 244, 0.46);
    border-radius: 2px;
    box-shadow: 0 0 0 9999px rgba(4, 8, 13, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: translate(-50%, -50%);
}

.image-panorama-matte-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(to bottom, rgba(228, 237, 244, 0.34) 0 4px, transparent 4px 8px),
        repeating-linear-gradient(to bottom, rgba(228, 237, 244, 0.34) 0 4px, transparent 4px 8px),
        repeating-linear-gradient(to right, rgba(228, 237, 244, 0.34) 0 4px, transparent 4px 8px),
        repeating-linear-gradient(to right, rgba(228, 237, 244, 0.34) 0 4px, transparent 4px 8px);
    background-position: 33.333% 0, 66.666% 0, 0 33.333%, 0 66.666%;
    background-repeat: no-repeat;
    background-size: 1px 100%, 1px 100%, 100% 1px, 100% 1px;
}

.image-panorama-hud {
    position: absolute;
    right: 24px;
    bottom: 24px;
    z-index: 4;
    min-width: 138px;
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(16, 20, 25, 0.86);
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px) saturate(130%);
}

.image-panorama-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 5;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(13, 17, 22, 0.86);
    color: rgba(255, 255, 255, 0.84);
    font-size: 13px;
    font-weight: 650;
    transform: translate(-50%, -50%);
}

.image-panorama-overlay.is-ready .image-panorama-loading {
    display: none;
}

.image-node-content-wrap.has-panorama-inline .image-node-render-toolbar {
    display: none;
}

.image-node-content-media.is-panorama-inline {
    background: #06080d;
}

.image-panorama-inline-root {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    background: #06080d;
}

.image-panorama-inline-root.is-ready .image-panorama-loading {
    display: none;
}

.image-panorama-node-toolbar-wrap {
    position: absolute;
    left: 50%;
    top: -60px;
    bottom: auto;
    z-index: 72;
    transform: translateX(-50%);
}

.image-panorama-node-toolbar-wrap .image-panorama-toolbar {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: min(var(--image-node-frame-width, 760px), calc(100vw - 72px));
    max-width: min(var(--image-node-frame-width, 760px), calc(100vw - 72px));
    overflow: visible;
    transform: none;
    scrollbar-width: none;
}

.image-panorama-node-toolbar-wrap .image-panorama-toolbar::-webkit-scrollbar {
    display: none;
}

.image-panorama-inline-root .image-panorama-hud {
    right: 10px;
    bottom: 10px;
    min-width: 96px;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 10px;
}

.image-panorama-inline-root .image-panorama-hud span {
    line-height: 1.25;
}

@media (max-width: 760px) {
    .image-panorama-toolbar {
        bottom: 12px;
        max-width: calc(100vw - 24px);
        overflow-x: auto;
    }

    .image-panorama-node-toolbar-wrap .image-panorama-toolbar {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .image-panorama-hud {
        right: 14px;
        bottom: 14px;
    }
}

.image-crop-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(4, 7, 11, 0.66);
    backdrop-filter: blur(18px) saturate(125%);
}

.image-crop-modal {
    width: min(1080px, calc(100vw - 56px));
    height: min(720px, calc(100vh - 56px));
    display: grid;
    grid-template-rows: auto 1fr auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(15, 18, 23, 0.98);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    overflow: hidden;
}

body[data-theme="light"] .image-crop-modal {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(255, 255, 255, 0.98);
    color: rgba(18, 24, 35, 0.9);
}

.image-crop-modal-header,
.image-crop-modal-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.image-crop-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0;
}

body[data-theme="light"] .image-crop-modal-header,
body[data-theme="light"] .image-crop-modal-footer {
    border-color: rgba(18, 24, 35, 0.1);
}

.image-crop-modal-header strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 720;
}

.image-crop-modal-header span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
}

body[data-theme="light"] .image-crop-modal-header span {
    color: rgba(18, 24, 35, 0.52);
}

.image-crop-modal-header button,
.image-crop-footer-actions button,
.image-crop-delete,
.image-crop-ratios button {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: inherit;
    font-size: 12px;
    font-weight: 650;
}

.image-crop-modal-header button {
    width: 32px;
    padding: 0;
    font-size: 18px;
}

.image-crop-modal-body {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 220px;
}

.image-crop-stage {
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #0a0d11;
    overflow: auto;
}

body[data-theme="light"] .image-crop-stage {
    background: #f4f6f8;
}

.image-crop-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
}

.image-crop-source {
    display: block;
    max-width: min(760px, calc(100vw - 360px));
    max-height: min(540px, calc(100vh - 230px));
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
}

.image-crop-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
}

.image-crop-region {
    position: absolute;
    display: block;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.image-crop-region.selected {
    border-color: #ffb45f;
    background: rgba(255, 180, 95, 0.12);
}

.image-crop-region span {
    position: absolute;
    left: 4px;
    bottom: 4px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.image-crop-region i {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffb45f;
    box-shadow: 0 0 0 2px rgba(6, 10, 14, 0.8);
    cursor: nwse-resize;
}

.image-crop-sidebar {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

body[data-theme="light"] .image-crop-sidebar {
    border-left-color: rgba(18, 24, 35, 0.1);
    background: rgba(18, 24, 35, 0.025);
}

.image-crop-sidebar-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 700;
}

.image-crop-region-list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: auto;
}

.image-crop-region-list-item,
.image-crop-region-empty {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    text-align: left;
}

.image-crop-region-list-item.active {
    border-color: rgba(255, 180, 95, 0.5);
    background: rgba(255, 180, 95, 0.12);
    color: #ffffff;
}

.image-crop-region-empty {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.44);
}

.image-crop-delete {
    width: 100%;
}

.image-crop-ratios,
.image-crop-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.image-crop-ratios button,
.image-crop-footer-actions button {
    padding: 0 11px;
}

.image-crop-ratios button.active,
.image-crop-footer-actions button.primary {
    border-color: rgba(255, 180, 95, 0.56);
    background: rgba(255, 180, 95, 0.14);
    color: #ffffff;
}

body[data-theme="light"] .image-crop-modal-header button,
body[data-theme="light"] .image-crop-footer-actions button,
body[data-theme="light"] .image-crop-delete,
body[data-theme="light"] .image-crop-ratios button,
body[data-theme="light"] .image-crop-region-list-item,
body[data-theme="light"] .image-crop-region-empty {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(18, 24, 35, 0.045);
    color: rgba(18, 24, 35, 0.76);
}

body[data-theme="light"] .image-crop-ratios button.active,
body[data-theme="light"] .image-crop-footer-actions button.primary,
body[data-theme="light"] .image-crop-region-list-item.active {
    border-color: rgba(198, 115, 40, 0.48);
    background: rgba(198, 115, 40, 0.12);
    color: rgba(18, 24, 35, 0.96);
}

.image-node-card[data-view-state="content"].selected .image-node-inline-upload,
.image-node-card[data-view-state="content"]:hover .image-node-inline-upload {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.image-node-preview.has-upload,
.image-node-content-media.has-upload .image-node-preview-image {
    cursor: zoom-in;
}

.image-node-preview:not(.has-upload) .image-node-preview-content,
.image-node-preview:not(.has-upload) .image-node-preview-icon,
.image-node-content-media:not(.has-upload) .image-node-preview-content,
.image-node-content-media:not(.has-upload) .image-node-preview-icon {
    cursor: pointer;
}

.image-node-preview:not(.has-upload) .image-node-try,
.image-node-preview:not(.has-upload) .image-node-try * {
    cursor: auto;
}

.image-annotation-overlay {
    position: fixed;
    inset: 0;
    z-index: 21000;
    display: grid;
    place-items: center;
    padding: 96px 24px 42px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.image-annotation-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.image-annotation-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
}

.image-annotation-toolbar {
    position: fixed;
    left: 50%;
    top: 48px;
    z-index: 21002;
    min-height: 50px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(18, 22, 28, 0.96);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateX(-50%);
}

.image-annotation-exit,
.image-annotation-tool,
.image-annotation-color-trigger {
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    transition: background 0.14s ease, color 0.14s ease;
}

.image-annotation-exit {
    gap: 6px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 680;
}

.image-annotation-tool svg,
.image-annotation-exit svg {
    width: 16px;
    height: 16px;
}

.image-annotation-tool:hover,
.image-annotation-tool.active,
.image-annotation-exit:hover,
.image-annotation-color-trigger:hover,
.image-annotation-color-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-annotation-tool:disabled {
    opacity: 0.36;
    pointer-events: none;
}

.image-annotation-divider {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.1);
}

.image-annotation-color-trigger span,
.image-annotation-color-option span {
    width: 17px;
    height: 17px;
    display: block;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.image-annotation-color-wrap {
    position: relative;
    display: inline-flex;
}

.image-annotation-color-menu {
    position: absolute;
    left: 50%;
    top: 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(18, 22, 28, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    transform: translateX(-50%);
}

.image-annotation-color-menu[hidden] {
    display: none;
}

.image-annotation-color-option {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
}

.image-annotation-color-option.active {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.08);
}

.image-annotation-size {
    width: 96px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-annotation-size-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.84);
}

.image-annotation-size-icon svg {
    width: 21px;
    height: 21px;
    display: block;
}

.image-annotation-size input {
    width: 68px;
    accent-color: #28d7f2;
}

.image-annotation-save {
    height: 34px;
    min-width: 64px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #13161b;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0;
}

.image-annotation-stage-wrap {
    position: relative;
    z-index: 21001;
    max-width: min(88vw, 1240px);
    max-height: min(76vh, 820px);
    display: grid;
    place-items: center;
}

.image-annotation-stage {
    position: relative;
    display: inline-grid;
    place-items: center;
    max-width: inherit;
    max-height: inherit;
}

.image-annotation-base {
    display: block;
    width: min(82vw, 980px);
    height: auto;
    max-width: min(88vw, 1240px);
    max-height: min(76vh, 820px);
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
}

.image-annotation-canvas {
    position: absolute;
    cursor: crosshair;
    touch-action: none;
}

.image-annotation-text-input {
    position: absolute;
    z-index: 2;
    min-width: 120px;
    max-width: min(320px, 52vw);
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.58);
    font-size: 18px;
    font-weight: 760;
    outline: none;
}

body[data-theme="light"] .image-annotation-toolbar,
body[data-theme="light"] .image-annotation-color-menu {
    border-color: rgba(18, 24, 35, 0.13);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 25, 34, 0.9);
    box-shadow: 0 20px 54px rgba(20, 25, 34, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .image-annotation-tool:hover,
body[data-theme="light"] .image-annotation-tool.active,
body[data-theme="light"] .image-annotation-exit:hover,
body[data-theme="light"] .image-annotation-color-trigger:hover,
body[data-theme="light"] .image-annotation-color-trigger[aria-expanded="true"] {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

body[data-theme="light"] .image-annotation-size-icon {
    color: rgba(18, 24, 35, 0.78);
}

.image-crop-overlay.octap-node-crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 21100;
    display: grid;
    place-items: center;
    padding: 96px 24px 42px;
    opacity: 0;
    pointer-events: none;
    outline: none;
    transition: opacity 0.16s ease;
}

.image-crop-overlay.octap-node-crop-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.image-crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(1.5px);
}

.image-crop-toolbar {
    position: fixed;
    left: 50%;
    top: 48px;
    z-index: 21103;
    min-height: 48px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(20, 23, 28, 0.97);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateX(-50%);
}

.image-crop-close,
.image-crop-ratio-trigger {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    transition: background 0.14s ease, color 0.14s ease;
}

.image-crop-close {
    width: 34px;
}

.image-crop-close svg,
.image-crop-ratio-icon svg,
.image-crop-ratio-caret svg {
    width: 15px;
    height: 15px;
}

.image-crop-close:hover,
.image-crop-ratio-trigger:hover,
.image-crop-ratio-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-crop-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.image-crop-ratio-wrap {
    position: relative;
    display: inline-flex;
}

.image-crop-ratio-trigger {
    gap: 7px;
    min-width: 104px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 680;
    letter-spacing: 0;
}

.image-crop-ratio-icon,
.image-crop-ratio-caret {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 16px;
}

.image-crop-ratio-caret {
    width: 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.16s ease;
}

.image-crop-ratio-trigger[aria-expanded="true"] .image-crop-ratio-caret {
    transform: rotate(180deg);
}

.image-crop-ratio-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-crop-ratio-menu {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    bottom: auto;
    z-index: 21104;
    min-width: 102px;
    display: grid;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 11px;
    background: rgba(27, 30, 35, 0.98);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform: translateX(-50%);
}

.image-crop-ratio-menu[hidden] {
    display: none;
}

.image-crop-ratio-option {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 620;
    letter-spacing: 0;
    white-space: nowrap;
}

.image-crop-ratio-option:hover,
.image-crop-ratio-option.active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-crop-confirm {
    height: 34px;
    min-width: 64px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #13161b;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0;
}

.image-crop-stage-wrap {
    position: relative;
    z-index: 21101;
    max-width: min(88vw, 1240px);
    max-height: min(76vh, 820px);
    display: grid;
    place-items: center;
}

.octap-node-crop-overlay .image-crop-stage {
    position: relative;
    display: inline-grid;
    place-items: center;
    max-width: inherit;
    max-height: inherit;
}

.image-crop-base {
    display: block;
    width: min(82vw, 980px);
    height: auto;
    max-width: min(88vw, 1240px);
    max-height: min(76vh, 820px);
    object-fit: contain;
    border-radius: 7px;
    user-select: none;
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
}

.image-crop-layer {
    position: absolute;
    overflow: hidden;
    touch-action: none;
}

.image-crop-selection {
    position: absolute;
    min-width: 22px;
    min-height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.28);
    cursor: move;
    touch-action: none;
}

.image-crop-grid {
    position: absolute;
    display: block;
    background: rgba(255, 255, 255, 0.42);
    pointer-events: none;
}

.image-crop-grid-v1,
.image-crop-grid-v2 {
    top: 0;
    bottom: 0;
    width: 1px;
}

.image-crop-grid-v1 {
    left: 33.333%;
}

.image-crop-grid-v2 {
    left: 66.666%;
}

.image-crop-grid-h1,
.image-crop-grid-h2 {
    left: 0;
    right: 0;
    height: 1px;
}

.image-crop-grid-h1 {
    top: 33.333%;
}

.image-crop-grid-h2 {
    top: 66.666%;
}

.image-crop-handle {
    position: absolute;
    z-index: 2;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    padding: 0;
    touch-action: none;
}

.image-crop-handle-nw,
.image-crop-handle-ne,
.image-crop-handle-sw,
.image-crop-handle-se {
    width: 22px;
    height: 22px;
}

.image-crop-handle-nw {
    left: -4px;
    top: -4px;
    cursor: nwse-resize;
}

.image-crop-handle-ne {
    right: -4px;
    top: -4px;
    cursor: nesw-resize;
}

.image-crop-handle-sw {
    left: -4px;
    bottom: -4px;
    cursor: nesw-resize;
}

.image-crop-handle-se {
    right: -4px;
    bottom: -4px;
    cursor: nwse-resize;
}

.image-crop-handle-n,
.image-crop-handle-s {
    left: 50%;
    width: 34px;
    height: 4px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.image-crop-handle-n {
    top: -4px;
}

.image-crop-handle-s {
    bottom: -4px;
}

.image-crop-handle-e,
.image-crop-handle-w {
    top: 50%;
    width: 4px;
    height: 34px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.image-crop-handle-e {
    right: -4px;
}

.image-crop-handle-w {
    left: -4px;
}

.image-crop-overlay.octap-node-crop-overlay.is-cropping .image-crop-selection {
    transition: none;
}

body[data-theme="light"] .image-crop-toolbar,
body[data-theme="light"] .image-crop-ratio-menu {
    border-color: rgba(18, 24, 35, 0.13);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 25, 34, 0.9);
    box-shadow: 0 20px 54px rgba(20, 25, 34, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .image-crop-close:hover,
body[data-theme="light"] .image-crop-ratio-trigger:hover,
body[data-theme="light"] .image-crop-ratio-trigger[aria-expanded="true"],
body[data-theme="light"] .image-crop-ratio-option:hover,
body[data-theme="light"] .image-crop-ratio-option.active {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

@media (max-width: 760px) {
    .image-annotation-overlay,
    .image-crop-overlay.octap-node-crop-overlay {
        padding: 86px 12px 24px;
    }

    .image-annotation-toolbar,
    .image-crop-toolbar {
        top: 14px;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .image-annotation-toolbar::-webkit-scrollbar,
    .image-crop-toolbar::-webkit-scrollbar {
        display: none;
    }

    .image-annotation-size {
        width: 82px;
    }

    .image-annotation-size input {
        width: 56px;
    }

    .image-crop-ratio-menu {
        bottom: auto;
        top: calc(100% + 8px);
    }
}

.image-erase-overlay {
    position: fixed;
    inset: 0;
    z-index: 21100;
    display: grid;
    place-items: center;
    padding: 96px 24px 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.image-erase-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.image-erase-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
}

.image-erase-toolbar {
    position: fixed;
    left: 50%;
    top: 48px;
    z-index: 21102;
    min-height: 50px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(18, 22, 28, 0.96);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateX(-50%);
}

.image-erase-exit,
.image-erase-tool {
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    transition: background 0.14s ease, color 0.14s ease;
}

.image-erase-exit {
    gap: 6px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 680;
}

.image-erase-tool svg,
.image-erase-exit svg {
    width: 16px;
    height: 16px;
}

.image-erase-tool:hover,
.image-erase-tool.active,
.image-erase-exit:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-erase-divider {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.1);
}

.image-erase-size {
    width: 122px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-erase-size-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.84);
}

.image-erase-size-icon svg {
    width: 21px;
    height: 21px;
    display: block;
}

.image-erase-size input {
    width: 92px;
    accent-color: #28d7f2;
}

.image-erase-stage-wrap {
    position: relative;
    z-index: 21101;
    max-width: min(88vw, 1240px);
    max-height: min(74vh, 800px);
    display: grid;
    place-items: center;
    gap: 12px;
}

.image-erase-stage {
    position: relative;
    display: inline-grid;
    place-items: center;
    max-width: inherit;
    max-height: inherit;
}

.image-erase-base {
    display: block;
    width: min(82vw, 980px);
    height: auto;
    max-width: min(88vw, 1240px);
    max-height: min(68vh, 740px);
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
}

.image-erase-canvas {
    position: absolute;
    cursor: crosshair;
    touch-action: none;
}

.image-erase-runbar {
    position: relative;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(18, 22, 28, 0.96);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.image-erase-chip,
.image-erase-param-toggle {
    height: 32px;
    min-width: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.image-erase-chip:hover,
.image-erase-param-wrap.open .image-erase-param-toggle {
    background: rgba(255, 255, 255, 0.09);
}

.image-erase-model {
    min-width: 56px;
    color: rgba(255, 255, 255, 0.9);
}

.image-erase-ratio-icon svg,
.image-erase-bolt svg,
.image-erase-caret svg {
    display: block;
}

.image-erase-ratio-icon svg {
    width: 15px;
    height: 15px;
}

.image-erase-caret svg {
    width: 12px;
    height: 12px;
}

.image-erase-param-wrap {
    position: relative;
    display: inline-flex;
}

.image-erase-param-menu {
    position: absolute;
    left: 50%;
    bottom: 42px;
    min-width: 70px;
    display: none;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(18, 22, 28, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    transform: translateX(-50%);
}

.image-erase-ratio-menu {
    min-width: 180px;
    grid-template-columns: repeat(3, minmax(48px, 1fr));
}

.image-erase-param-wrap.open .image-erase-param-menu {
    display: grid;
}

.image-erase-param-option {
    height: 30px;
    min-width: 58px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.image-erase-param-option:hover,
.image-erase-param-option.active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-erase-energy {
    height: 34px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.image-erase-bolt {
    color: rgba(255, 184, 96, 0.86);
}

.image-erase-bolt svg {
    width: 12px;
    height: 12px;
}

.image-erase-run {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #ffffff;
    color: #14171d;
}

.image-erase-run svg {
    width: 20px;
    height: 20px;
}

.image-erase-run:disabled {
    opacity: 0.58;
    cursor: default;
}

body[data-theme="light"] .image-erase-toolbar,
body[data-theme="light"] .image-erase-runbar,
body[data-theme="light"] .image-erase-param-menu {
    border-color: rgba(18, 24, 35, 0.13);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 25, 34, 0.9);
    box-shadow: 0 20px 54px rgba(20, 25, 34, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .image-erase-tool:hover,
body[data-theme="light"] .image-erase-tool.active,
body[data-theme="light"] .image-erase-exit:hover,
body[data-theme="light"] .image-erase-chip:hover,
body[data-theme="light"] .image-erase-param-wrap.open .image-erase-param-toggle,
body[data-theme="light"] .image-erase-param-option:hover,
body[data-theme="light"] .image-erase-param-option.active {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

body[data-theme="light"] .image-erase-size-icon,
body[data-theme="light"] .image-erase-energy {
    color: rgba(18, 24, 35, 0.72);
}

@media (max-width: 760px) {
    .image-erase-overlay {
        padding: 86px 12px 92px;
    }

    .image-erase-toolbar {
        top: 14px;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .image-erase-toolbar::-webkit-scrollbar {
        display: none;
    }

    .image-erase-size {
        width: 96px;
    }

    .image-erase-size input {
        width: 64px;
    }

    .image-erase-runbar {
        max-width: calc(100vw - 24px);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .image-erase-runbar::-webkit-scrollbar {
        display: none;
    }
}

.is-image-outpaint-editing .image-node-render-toolbar {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none !important;
}

.is-image-outpaint-editing .image-node-content-media,
.is-image-outpaint-editing .image-node-preview {
    opacity: 0 !important;
}

.is-image-outpaint-editing .image-node-panel {
    display: none !important;
}

.is-image-outpaint-editing .node-port,
.is-image-outpaint-editing .image-node-mini-label,
.is-image-outpaint-editing .image-node-resolution,
.is-image-outpaint-editing .image-node-generation-badge {
    opacity: 0 !important;
    pointer-events: none !important;
}

.image-outpaint-editor {
    position: fixed;
    inset: 0;
    z-index: 21100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.image-outpaint-editor:not(.show) {
    display: none;
}

.image-outpaint-editor.show {
    opacity: 1;
}

.image-outpaint-frame {
    position: absolute;
    pointer-events: auto;
    border: 1px solid rgba(226, 232, 240, 0.34);
    border-radius: 3px;
    background-color: rgba(14, 16, 20, 0.72);
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.045) 75%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.045) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), 0 24px 60px rgba(0, 0, 0, 0.42);
}

.image-outpaint-img {
    position: absolute;
    display: block;
    object-fit: fill;
    user-select: none;
    cursor: move;
    touch-action: none;
}

.image-outpaint-editor.is-running .image-outpaint-img,
.image-outpaint-editor.is-running .image-outpaint-handle {
    pointer-events: none;
}

.image-outpaint-handle {
    position: absolute;
    z-index: 2;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    box-shadow: none;
    touch-action: none;
}

.image-outpaint-handle::after {
    content: "";
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255, 168, 79, 0.82);
    border-radius: 2px;
    background: rgba(15, 18, 23, 0.94);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 10px rgba(255, 168, 79, 0.16);
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.image-outpaint-handle:hover::after {
    transform: scale(1.12);
    border-color: rgba(255, 184, 96, 0.98);
    background: rgba(40, 31, 22, 0.96);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 168, 79, 0.28);
}

.image-outpaint-handle-n { top: -9px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.image-outpaint-handle-s { bottom: -9px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.image-outpaint-handle-w { left: -9px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.image-outpaint-handle-e { right: -9px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.image-outpaint-handle-nw { top: -9px; left: -9px; cursor: nwse-resize; }
.image-outpaint-handle-ne { top: -9px; right: -9px; cursor: nesw-resize; }
.image-outpaint-handle-sw { bottom: -9px; left: -9px; cursor: nesw-resize; }
.image-outpaint-handle-se { bottom: -9px; right: -9px; cursor: nwse-resize; }

.image-outpaint-runbar {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 11px;
    background: rgba(16, 18, 22, 0.97);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(16px) saturate(130%);
}

.image-outpaint-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    transition: background 0.14s ease, color 0.14s ease;
}

.image-outpaint-close svg {
    width: 16px;
    height: 16px;
}

.image-outpaint-close:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-outpaint-chip,
.image-outpaint-param-toggle {
    height: 32px;
    min-width: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.image-outpaint-chip:hover,
.image-outpaint-param-wrap.open .image-outpaint-param-toggle {
    background: rgba(255, 255, 255, 0.09);
}

.image-outpaint-model {
    min-width: 56px;
    color: rgba(255, 255, 255, 0.9);
}

.image-outpaint-ratio-icon svg,
.image-outpaint-bolt svg,
.image-outpaint-caret svg {
    display: block;
}

.image-outpaint-ratio-icon svg {
    width: 15px;
    height: 15px;
}

.image-outpaint-caret svg {
    width: 12px;
    height: 12px;
}

.image-outpaint-param-wrap {
    position: relative;
    display: inline-flex;
}

.image-outpaint-param-menu {
    position: absolute;
    left: 50%;
    bottom: 42px;
    min-width: 70px;
    display: none;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(18, 22, 28, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    transform: translateX(-50%);
}

.image-outpaint-ratio-menu {
    min-width: 180px;
    grid-template-columns: repeat(3, minmax(48px, 1fr));
}

.image-outpaint-param-wrap.open .image-outpaint-param-menu {
    display: grid;
}

.image-outpaint-param-option {
    height: 30px;
    min-width: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.image-outpaint-param-option:hover,
.image-outpaint-param-option.active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-outpaint-energy.text-node-energy {
    margin-left: 2px;
}

body[data-theme="light"] .image-outpaint-runbar,
body[data-theme="light"] .image-outpaint-param-menu {
    border-color: rgba(18, 24, 35, 0.13);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 25, 34, 0.9);
    box-shadow: 0 20px 54px rgba(20, 25, 34, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .image-outpaint-close:hover,
body[data-theme="light"] .image-outpaint-chip:hover,
body[data-theme="light"] .image-outpaint-param-wrap.open .image-outpaint-param-toggle,
body[data-theme="light"] .image-outpaint-param-option:hover,
body[data-theme="light"] .image-outpaint-param-option.active {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

body[data-theme="light"] .image-outpaint-frame {
    border-color: rgba(18, 24, 35, 0.3);
    background-color: rgba(228, 232, 238, 0.72);
}

body[data-theme="light"] .image-outpaint-handle::after {
    background: rgba(252, 253, 255, 0.96);
    box-shadow: 0 0 0 1px rgba(18, 24, 35, 0.14), 0 0 10px rgba(255, 168, 79, 0.16);
}

.image-redraw-overlay {
    position: fixed;
    inset: 0;
    z-index: 21100;
    display: grid;
    place-items: center;
    padding: 96px 24px 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.image-redraw-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.image-redraw-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
}

.image-redraw-toolbar {
    position: fixed;
    left: 50%;
    top: 48px;
    z-index: 21102;
    min-height: 50px;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(18, 22, 28, 0.96);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateX(-50%);
}

.image-redraw-exit,
.image-redraw-tool {
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    transition: background 0.14s ease, color 0.14s ease;
}

.image-redraw-exit {
    gap: 6px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 680;
}

.image-redraw-tool svg,
.image-redraw-exit svg {
    width: 16px;
    height: 16px;
}

.image-redraw-tool:hover,
.image-redraw-tool.active,
.image-redraw-exit:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-redraw-divider {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.1);
}

.image-redraw-size {
    width: 122px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-redraw-size-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.84);
}

.image-redraw-size-icon svg {
    width: 21px;
    height: 21px;
    display: block;
}

.image-redraw-size input {
    width: 92px;
    accent-color: #28d7f2;
}

.image-redraw-stage-wrap {
    position: relative;
    z-index: 21101;
    max-width: min(88vw, 1240px);
    max-height: min(74vh, 800px);
    display: grid;
    place-items: center;
    gap: 12px;
}

.image-redraw-stage {
    position: relative;
    display: inline-grid;
    place-items: center;
    max-width: inherit;
    max-height: inherit;
}

.image-redraw-base {
    display: block;
    width: min(82vw, 980px);
    height: auto;
    max-width: min(88vw, 1240px);
    max-height: min(68vh, 740px);
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
}

.image-redraw-canvas {
    position: absolute;
    cursor: crosshair;
    touch-action: none;
}

.image-redraw-runbar {
    position: relative;
    width: min(82vw, 620px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(18, 22, 28, 0.96);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.image-redraw-prompt {
    width: 100%;
    min-height: 30px;
    max-height: 132px;
    resize: none;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 13px;
    line-height: 1.5;
    font-family: inherit;
    outline: none;
}

.image-redraw-prompt::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.image-redraw-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-redraw-chip,
.image-redraw-param-toggle {
    height: 32px;
    min-width: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.image-redraw-chip:hover,
.image-redraw-param-wrap.open .image-redraw-param-toggle {
    background: rgba(255, 255, 255, 0.09);
}

.image-redraw-model {
    min-width: 56px;
    color: rgba(255, 255, 255, 0.9);
}

.image-redraw-ratio-icon svg,
.image-redraw-bolt svg,
.image-redraw-caret svg {
    display: block;
}

.image-redraw-ratio-icon svg {
    width: 15px;
    height: 15px;
}

.image-redraw-caret svg {
    width: 12px;
    height: 12px;
}

.image-redraw-param-wrap {
    position: relative;
    display: inline-flex;
}

.image-redraw-param-menu {
    position: absolute;
    left: 50%;
    bottom: 42px;
    min-width: 70px;
    display: none;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(18, 22, 28, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    transform: translateX(-50%);
}

.image-redraw-ratio-menu {
    min-width: 180px;
    grid-template-columns: repeat(3, minmax(48px, 1fr));
}

.image-redraw-param-wrap.open .image-redraw-param-menu {
    display: grid;
}

.image-redraw-param-option {
    height: 30px;
    min-width: 58px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.image-redraw-param-option:hover,
.image-redraw-param-option.active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.image-redraw-controls .image-redraw-energy {
    margin-left: auto;
    padding: 2px 4px 2px 10px;
}

.image-redraw-controls .image-redraw-energy .coin {
    font-variant-numeric: tabular-nums;
}

.image-redraw-run:disabled {
    opacity: 0.58;
    cursor: default;
}

body[data-theme="light"] .image-redraw-toolbar,
body[data-theme="light"] .image-redraw-runbar,
body[data-theme="light"] .image-redraw-param-menu {
    border-color: rgba(18, 24, 35, 0.13);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 25, 34, 0.9);
    box-shadow: 0 20px 54px rgba(20, 25, 34, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .image-redraw-tool:hover,
body[data-theme="light"] .image-redraw-tool.active,
body[data-theme="light"] .image-redraw-exit:hover,
body[data-theme="light"] .image-redraw-chip:hover,
body[data-theme="light"] .image-redraw-param-wrap.open .image-redraw-param-toggle,
body[data-theme="light"] .image-redraw-param-option:hover,
body[data-theme="light"] .image-redraw-param-option.active {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

body[data-theme="light"] .image-redraw-size-icon,
body[data-theme="light"] .image-redraw-energy {
    color: rgba(18, 24, 35, 0.72);
}

body[data-theme="light"] .image-redraw-prompt::placeholder {
    color: rgba(18, 24, 35, 0.4);
}

@media (max-width: 760px) {
    .image-redraw-overlay {
        padding: 86px 12px 92px;
    }

    .image-redraw-toolbar {
        top: 14px;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .image-redraw-toolbar::-webkit-scrollbar {
        display: none;
    }

    .image-redraw-size {
        width: 96px;
    }

    .image-redraw-size input {
        width: 64px;
    }

    .image-redraw-runbar {
        width: calc(100vw - 24px);
    }

    .image-redraw-controls {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .image-redraw-controls::-webkit-scrollbar {
        display: none;
    }
}

.video-subtitle-selection-overlay {
    position: fixed;
    inset: 0;
    z-index: 21120;
    display: grid;
    place-items: center;
    padding: 48px 24px 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.video-subtitle-selection-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.video-subtitle-selection-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

.video-subtitle-selection-exit,
.video-subtitle-selection-tool,
.video-subtitle-selection-run {
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 680;
    transition: background 0.14s ease, color 0.14s ease;
}

.video-subtitle-selection-exit {
    padding: 0 10px;
}

.video-subtitle-selection-exit span {
    white-space: nowrap;
}

.video-subtitle-selection-run {
    padding: 0 12px;
    background: rgba(245, 158, 11, 0.16);
    color: #fff7ed;
    justify-self: end;
}

.video-subtitle-selection-exit svg,
.video-subtitle-selection-tool svg,
.video-subtitle-selection-run svg {
    width: 16px;
    height: 16px;
}

.video-subtitle-selection-exit:hover,
.video-subtitle-selection-tool:hover,
.video-subtitle-selection-run:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.video-subtitle-selection-run:disabled {
    opacity: 0.58;
    cursor: default;
}

.video-subtitle-selection-divider {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.1);
}

.video-subtitle-selection-stage-wrap {
    position: relative;
    z-index: 21121;
    max-width: min(88vw, 1240px);
    max-height: min(74vh, 800px);
    display: grid;
    place-items: center;
    gap: 12px;
}

.video-subtitle-selection-stage {
    position: relative;
    display: inline-grid;
    place-items: center;
    max-width: inherit;
    max-height: inherit;
}

.video-subtitle-selection-base {
    display: block;
    width: min(82vw, 980px);
    height: auto;
    max-width: min(88vw, 1240px);
    max-height: min(68vh, 740px);
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
}

.video-subtitle-selection-layer {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    touch-action: none;
}

.video-subtitle-selection-region {
    position: absolute;
    border: 2px solid rgba(245, 158, 11, 0.96);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.18);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28), 0 0 22px rgba(245, 158, 11, 0.26);
}

.video-subtitle-selection-runbar {
    position: relative;
    width: min(84vw, 760px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(18, 22, 28, 0.96);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.video-subtitle-selection-summary {
    min-width: 0;
    justify-self: start;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    font-weight: 520;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-subtitle-selection-controls {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 5px;
    min-width: 0;
}

body[data-theme="light"] .video-subtitle-selection-runbar {
    border-color: rgba(18, 24, 35, 0.13);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(20, 25, 34, 0.9);
    box-shadow: 0 20px 54px rgba(20, 25, 34, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .video-subtitle-selection-exit:hover,
body[data-theme="light"] .video-subtitle-selection-tool:hover,
body[data-theme="light"] .video-subtitle-selection-run:hover {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

body[data-theme="light"] .video-subtitle-selection-summary {
    color: rgba(18, 24, 35, 0.62);
}

@media (max-width: 760px) {
    .video-subtitle-selection-overlay {
        padding: 24px 12px 92px;
    }

    .video-subtitle-selection-runbar {
        width: calc(100vw - 24px);
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
    }

    .video-subtitle-selection-controls {
        grid-column: 2 / 4;
        grid-row: 2;
        width: auto;
        justify-self: end;
        justify-content: flex-end;
    }
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0;
    background: rgba(0, 0, 0, 0.88);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.image-preview-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.image-preview-container {
    position: relative;
    width: min(70vw, 1120px);
    max-height: 68vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-media-wrap {
    max-width: 100%;
    max-height: 68vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-img {
    display: block;
    max-width: 100%;
    max-height: 66vh;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.18s ease;
    cursor: grab;
    user-select: none;
}

.media-preview-layout {
    width: min(92vw, 1420px);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}

.image-preview-layout .image-preview-container {
    width: min(58vw, 1040px);
    min-width: min(58vw, 320px);
    flex: 0 0 min(58vw, 1040px);
}

.image-preview-layout .image-preview-container,
.video-preview-layout .video-preview-shell {
    z-index: 3;
}

.media-preview-side-panel {
    position: fixed;
    top: clamp(92px, 15vh, 160px);
    right: clamp(48px, 4.2vw, 88px);
    z-index: 2;
    width: min(320px, calc(100vw - 64px));
    height: min(660px, calc(100vh - 180px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(26, 27, 28, 0.76), rgba(9, 10, 11, 0.70)),
        rgba(11, 12, 13, 0.54);
    box-shadow: 0 28px 86px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.052);
    backdrop-filter: blur(24px) saturate(106%);
    color: rgba(255, 255, 255, 0.92);
    overflow: auto;
    scrollbar-color: rgba(83, 91, 102, 0.64) rgba(11, 14, 19, 0.78);
    scrollbar-width: thin;
    scrollbar-gutter: stable;
}

.media-preview-side-panel::-webkit-scrollbar,
.media-preview-prompt::-webkit-scrollbar {
    width: 9px;
}

.media-preview-side-panel::-webkit-scrollbar-track,
.media-preview-prompt::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.78);
}

.media-preview-side-panel::-webkit-scrollbar-thumb,
.media-preview-prompt::-webkit-scrollbar-thumb {
    border: 2px solid rgba(10, 13, 18, 0.78);
    border-radius: 999px;
    background: rgba(82, 90, 102, 0.72);
}

.media-preview-side-panel::-webkit-scrollbar-thumb:hover,
.media-preview-prompt::-webkit-scrollbar-thumb:hover {
    background: rgba(112, 122, 136, 0.78);
}

.media-preview-side-title {
    padding-bottom: 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    font-weight: 520;
}

.media-preview-side-title-spaced {
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
}

.media-preview-media-title {
    margin-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.media-preview-details,
.media-preview-media-details {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.media-preview-detail-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.media-preview-detail-row span,
.media-preview-detail-section-label {
    color: rgba(255, 255, 255, 0.44);
    font-size: 12px;
    font-weight: 500;
}

.media-preview-detail-row strong {
    color: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    font-weight: 430;
    line-height: 1.35;
    word-break: break-word;
}

.media-preview-detail-stat-row {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.media-preview-detail-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.media-preview-detail-stat span {
    color: rgba(255, 255, 255, 0.44);
    font-size: 12px;
    font-weight: 500;
}

.media-preview-detail-stat strong {
    color: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    font-weight: 430;
    line-height: 1.35;
    white-space: nowrap;
}

.media-preview-time-row {
    padding-bottom: 14px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.media-preview-prompt-wrap {
    position: relative;
}

.media-preview-prompt-label {
    margin-top: 2px;
}

.media-preview-prompt-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.media-preview-use-prompt,
.media-preview-copy-prompt {
    border: 0;
    color: rgba(255, 255, 255, 0.86);
    background: transparent;
    font-size: 12px;
    font-weight: 620;
}

.media-preview-use-prompt {
    min-width: 54px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 7px;
    border-radius: 6px;
}

.media-preview-copy-prompt {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.52);
}

.media-preview-use-prompt svg,
.media-preview-copy-prompt svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-preview-use-prompt svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
}

.media-preview-use-prompt:hover,
.media-preview-copy-prompt:hover {
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.96);
}

.media-preview-use-prompt:disabled,
.media-preview-copy-prompt:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.media-preview-prompt {
    max-height: 96px;
    padding: 11px 12px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.45;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(83, 91, 102, 0.64) rgba(11, 14, 19, 0.78);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.media-preview-prompt:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}

.media-preview-empty {
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.38);
    font-size: 12px;
}

.media-preview-download {
    width: 100%;
    height: 38px;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.018);
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.media-preview-download::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v9l3.5-3.5 1.4 1.4L12 15.8 6.1 9.9l1.4-1.4L11 12V3Zm-6 15h14v2H5v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v9l3.5-3.5 1.4 1.4L12 15.8 6.1 9.9l1.4-1.4L11 12V3Zm-6 15h14v2H5v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.media-preview-download:hover {
    border-color: rgba(255, 168, 79, 0.34);
    background: rgba(255, 168, 79, 0.055);
    color: #fff;
    transform: translateY(-1px);
}

.media-preview-versions {
    position: fixed;
    left: 50%;
    bottom: 36px;
    z-index: 20002;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
    width: min(56vw, 1088px);
    max-width: calc(100vw - 320px);
}

.media-preview-version-scroll {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 42px;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0) 24px, #000 108px, #000 calc(100% - 108px), rgba(0, 0, 0, 0) calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0) 24px, #000 108px, #000 calc(100% - 108px), rgba(0, 0, 0, 0) calc(100% - 24px), transparent 100%);
    clip-path: inset(0);
}

.media-preview-version-scroll::-webkit-scrollbar {
    display: none;
}

.media-preview-version-list {
    width: max-content;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.media-preview-version {
    width: 148px;
    height: 72px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
    opacity: 0.82;
    transition: border-color 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.media-preview-version img,
.media-preview-version span {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.media-preview-version .media-preview-version-video-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(13, 36, 56, 0.96), rgba(19, 152, 210, 0.82));
    color: rgba(255, 255, 255, 0.9);
}

.media-preview-version .media-preview-version-video-fallback svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28));
}

.media-preview-version.active {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 2px rgba(255, 168, 79, 0.42);
}

.media-preview-version.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 980px) {
    .media-preview-layout {
        width: min(94vw, 1120px);
        gap: 24px;
    }

    .image-preview-layout .image-preview-container {
        width: min(72vw, 820px);
        min-width: min(72vw, 320px);
        flex-basis: min(72vw, 820px);
    }

    .media-preview-side-panel {
        left: 24px;
        right: 24px;
        top: auto;
        bottom: 24px;
        width: auto;
        height: min(46vh, 520px);
    }

    .media-preview-versions {
        left: 50%;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }

    .media-preview-version-scroll {
        max-width: calc(100vw - 24px);
    }
}

.image-preview-modal.is-panning .image-preview-img {
    cursor: grabbing;
    transition: none;
}

.image-preview-close {
    position: fixed;
    top: 56px;
    right: 20px;
}

.image-preview-toolbar-right {
    position: fixed;
    top: 56px;
    right: 60px;
    display: flex;
    gap: 8px;
}

.image-preview-close,
.image-preview-tool-btn {
    z-index: 20001;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    padding: 0;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.image-preview-tool-btn svg {
    width: 14px;
    height: 14px;
}

.image-preview-close:hover,
.image-preview-tool-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.image-node-inline-upload:hover {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
    color: var(--accent);
}

.image-node-inline-upload svg {
    width: 15px;
    height: 15px;
}

.image-node-panel {
    position: absolute;
    top: calc(var(--image-node-frame-height, 270px) + 18px);
    left: 50%;
    width: 560px;
    min-height: 154px;
    margin: 0;
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px) scale(var(--canvas-inv-scale, 1));
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1), border-color 0.18s ease;
    z-index: 5;
}

.image-node-card.is-input-panel-active .image-node-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(var(--canvas-inv-scale, 1));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.26);
}

.image-node-card.is-asset-reference-drag-preserved .image-node-panel,
.video-node-card.is-asset-reference-drag-preserved .image-node-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(var(--canvas-inv-scale, 1));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.26);
}

.image-node-card.has-open-image-menu .image-node-panel {
    z-index: 36;
}

.image-node-card.has-open-image-menu .node-port.right {
    z-index: 4;
}

.image-node-generation-status {
    align-self: flex-start;
    max-width: calc(100% - 38px);
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.image-node-generation-status[data-status="running"] {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

.image-node-generation-status[data-status="success"] {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.image-node-generation-status[data-status="error"] {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.image-node-generation-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 3;
    max-width: calc(100% - 24px);
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 650;
    backdrop-filter: blur(10px);
}

.image-node-generation-badge[data-status="running"] {
    color: #bfdbfe;
}

.image-node-generation-badge[data-status="success"] {
    color: #bbf7d0;
}

.image-node-generation-badge[data-status="error"] {
    color: #fecaca;
}

.image-node-preview-count-badge {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 4;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(12, 14, 16, 0.58);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 560;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    backdrop-filter: blur(14px);
}

.image-node-preview-count-badge svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.85;
    opacity: 0.82;
}

.image-node-card:hover .image-node-preview-count-badge,
.video-node-card:hover .video-node-preview-count-badge {
    border-color: rgba(255, 168, 79, 0.24);
    background: rgba(18, 20, 22, 0.68);
    opacity: 1;
    transform: translateY(0);
}

.image-node-card.node-status-running .image-node-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.16) 42%, transparent 72%);
    transform: translateX(-100%);
    animation: image-generation-sweep 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes image-generation-sweep {
    to {
        transform: translateX(100%);
    }
}

.image-node-quick {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 2px 34px 2px 2px;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

.image-node-quick.is-asset-reference-drop-target {
    border-radius: 10px;
    background: rgba(255, 168, 79, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.3), 0 0 0 2px rgba(255, 168, 79, 0.08);
}

body.is-reference-drag-hover-suppressed .image-node-quick.is-asset-reference-drop-target {
    background: transparent;
    box-shadow: none;
}

.image-node-quick-chip,
.params-chip,
.count-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.image-node-quick-chip {
    gap: 5px;
    padding: 0 9px;
    border: 1px solid var(--panel-line);
    background: rgba(255, 255, 255, 0.025);
}

.image-node-quick-chip.icon-only {
    width: 26px;
    justify-content: center;
    padding: 0;
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
}

.image-node-quick-chip:hover,
.params-chip:hover,
.count-chip:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.image-node-quick-chip svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
}

.image-node-reference-strip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
}

.image-node-reference-chip {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    cursor: grab;
    padding: 0;
    transition: border-color .16s ease, background .16s ease, color .16s ease, opacity .16s ease, transform .16s ease, box-shadow .16s ease;
}

.image-node-reference-chip:hover,
.image-node-reference-chip.is-reference-drop-target {
    border-color: rgba(255, 168, 79, 0.34);
    background: rgba(255, 168, 79, 0.1);
    color: var(--text-primary);
}

.image-node-reference-chip.is-reference-drop-target {
    box-shadow: 0 0 0 2px rgba(255, 168, 79, 0.2);
    transform: translateY(-2px);
}

.image-node-reference-strip.is-reference-hover-suppressed .image-node-reference-chip:hover,
body.is-reference-drag-hover-suppressed .image-node-reference-chip:hover,
.image-node-reference-chip.is-reference-hover-suppressed:hover,
.image-node-reference-chip.is-reference-hover-suppressed.is-reference-drop-target {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    box-shadow: none;
    transform: none;
}

.image-node-reference-chip.is-reference-dragging {
    cursor: grabbing;
    opacity: .42;
    transform: scale(.94);
}

.image-node-reference-strip.is-reference-drag-active .image-node-reference-chip:not(.is-reference-dragging) {
    cursor: grabbing;
}

.image-node-reference-chip > img,
.image-node-reference-video,
.image-node-reference-icon {
    position: absolute;
    inset: 0;
}

.image-node-reference-chip > img,
.image-node-reference-video img,
.image-node-reference-video video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 7px;
}

.image-node-reference-remove {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;
    width: 12px;
    height: 12px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    appearance: none;
    background: transparent;
    color: rgba(232, 237, 245, 0.88);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.86);
    cursor: pointer;
    font: 800 12px/1 var(--font-ui);
    opacity: .86;
    transform: none;
    transition: color .14s ease, opacity .14s ease, text-shadow .14s ease, transform .14s ease;
}

.image-node-reference-remove:hover,
.image-node-reference-remove:focus-visible {
    color: #fff4e2;
    opacity: 1;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95), 0 0 8px rgba(255, 168, 79, 0.32);
    transform: scale(1.08);
    outline: 0;
}

.image-node-reference-chip.is-reference-hover-suppressed .image-node-reference-remove,
.image-node-reference-strip.is-reference-hover-suppressed .image-node-reference-remove,
body.is-reference-drag-hover-suppressed .image-node-reference-remove {
    opacity: 0;
    pointer-events: none;
    text-shadow: none;
    transform: none;
}

.image-node-reference-video,
.image-node-reference-video img,
.image-node-reference-video video {
    width: 100%;
    height: 100%;
    display: block;
}

.image-node-reference-video {
    overflow: hidden;
    border-radius: 7px;
}

.image-node-reference-icon {
    display: grid;
    place-items: center;
}

.image-node-reference-chip[data-ref-type="music"] .image-node-reference-icon {
    background: rgba(255, 168, 79, 0.1);
    color: rgba(251, 191, 92, 0.92);
}

.image-node-reference-video::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

.image-node-reference-play-indicator {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    padding-left: 1px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: rgba(9, 13, 18, 0.88);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.image-node-reference-play-indicator svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
    stroke-width: 0;
}

.image-node-reference-icon svg {
    width: 18px;
    height: 18px;
}

.image-node-reference-count {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.86);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.video-node-reference-strip.has-video-frame-swap {
    gap: 8px;
}

.video-node-reference-frame-pair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.video-node-frame-reference-chip {
    width: 40px;
    height: 40px;
    border-radius: 7px;
}

.video-node-reference-swap {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
}

.video-node-reference-swap:hover:not(:disabled) {
    border-color: rgba(255, 168, 79, 0.38);
    background: rgba(255, 168, 79, 0.12);
    color: var(--text-primary);
}

.video-node-reference-swap:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.image-node-input {
    height: 74px;
    min-height: 74px;
    max-height: 74px;
    padding: 8px 14px 4px 4px;
    color: var(--text-tertiary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    word-break: break-word;
    outline: 0;
}

.image-node-input.has-text,
.image-node-input:focus {
    color: var(--text-primary);
}

.image-node-card .octap-reference-mention-menu,
.image-node-panel .octap-reference-mention-menu,
.video-node-card .octap-reference-mention-menu,
.video-node-panel .octap-reference-mention-menu,
.agent-node-card .octap-reference-mention-menu,
.agent-fs-card .octap-reference-mention-menu {
    z-index: 48;
    width: auto;
    min-width: 104px;
    max-width: 152px;
    gap: 3px;
    padding: 4px;
    border-radius: 8px;
}

.image-node-card .octap-reference-mention-option,
.image-node-panel .octap-reference-mention-option,
.video-node-card .octap-reference-mention-option,
.video-node-panel .octap-reference-mention-option,
.agent-node-card .octap-reference-mention-option,
.agent-fs-card .octap-reference-mention-option {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 7px;
    border-radius: 6px;
}

.image-node-card .octap-reference-mention-preview,
.image-node-panel .octap-reference-mention-preview,
.video-node-card .octap-reference-mention-preview,
.video-node-panel .octap-reference-mention-preview,
.agent-node-card .octap-reference-mention-preview,
.agent-fs-card .octap-reference-mention-preview {
    width: 20px;
    height: 20px;
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    border-radius: 5px;
}

.image-node-card .octap-reference-mention-title,
.image-node-panel .octap-reference-mention-title,
.video-node-card .octap-reference-mention-title,
.video-node-panel .octap-reference-mention-title,
.agent-node-card .octap-reference-mention-title,
.agent-fs-card .octap-reference-mention-title {
    display: none;
}

.image-node-card .octap-reference-mention-label,
.image-node-panel .octap-reference-mention-label,
.video-node-card .octap-reference-mention-label,
.video-node-panel .octap-reference-mention-label,
.agent-node-card .octap-reference-mention-label,
.agent-fs-card .octap-reference-mention-label {
    font-size: 12px;
    line-height: 1;
}

.image-node-input .octap-composer-reference-token,
.video-node-input .octap-composer-reference-token,
.agent-node-input .octap-composer-reference-token,
.agent-fs-textarea .octap-composer-reference-token {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.octap-skill-token {
    max-width: 160px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 2px;
    padding: 0 8px 0 6px;
    border: 1px solid rgba(72, 180, 164, 0.46);
    border-radius: 999px;
    background: rgba(72, 180, 164, 0.13);
    color: rgba(222, 255, 248, 0.96);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    vertical-align: -4px;
    white-space: nowrap;
    user-select: none;
}

.octap-skill-token::before {
    content: "";
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 4px;
    background:
        linear-gradient(135deg, rgba(255, 184, 102, 0.98), rgba(72, 180, 164, 0.9));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.octap-skill-token-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-node-input .octap-skill-token,
.video-node-input .octap-skill-token {
    max-width: 132px;
}

.agent-node-input .octap-skill-token {
    max-width: 180px;
}

.text-node-input .octap-skill-token,
.octap-composer-input .octap-skill-token {
    max-width: 156px;
}

.ai-v4-input-shell .octap-skill-token {
    max-width: 164px;
}

.ai-v4-bubble .octap-message-skill-token,
.octap-fs-message-body .octap-message-skill-token {
    max-width: min(180px, 100%);
    vertical-align: -5px;
}

body[data-theme="light"] .octap-skill-token {
    border-color: rgba(35, 129, 116, 0.32);
    background: rgba(35, 129, 116, 0.1);
    color: rgba(22, 88, 80, 0.96);
}

.octap-node-skill-menu {
    position: fixed;
    z-index: 12060;
    display: none;
    width: min(292px, calc(100vw - 24px));
    max-height: min(360px, calc(100vh - 28px));
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(17, 22, 30, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px) saturate(150%);
}

.octap-node-skill-menu.is-open {
    display: block;
}

.octap-node-skill-menu .ai-v4-skill-list {
    max-height: min(360px, calc(100vh - 28px));
}

.octap-node-skill-menu .ai-v4-skill-row {
    min-height: 42px;
}

.octap-node-skill-menu .ai-v4-skill-row.is-active {
    border-color: rgba(72, 180, 164, 0.44);
    background: rgba(72, 180, 164, 0.12);
}

body[data-theme="light"] .octap-node-skill-menu {
    border-color: rgba(20, 29, 42, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(24, 31, 42, 0.18);
}

.image-node-input .octap-composer-reference-token.is-style,
.text-node-input .octap-composer-reference-token.is-style,
.video-node-input .octap-composer-reference-token.is-style,
.agent-node-input .octap-composer-reference-token.is-style {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    border-color: rgba(255, 170, 82, 0.32);
    background: rgba(255, 170, 82, 0.08);
}

.image-node-input .octap-composer-reference-token.is-style .octap-composer-reference-token-preview,
.text-node-input .octap-composer-reference-token.is-style .octap-composer-reference-token-preview,
.video-node-input .octap-composer-reference-token.is-style .octap-composer-reference-token-preview,
.agent-node-input .octap-composer-reference-token.is-style .octap-composer-reference-token-preview {
    background: rgba(255, 170, 82, 0.14);
    color: #ffb15f;
}

.octap-reference-token-preview-popover {
    position: fixed;
    z-index: 12042;
    display: none;
    width: 88px;
    height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(18, 22, 29, 0.98) center / cover no-repeat;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.octap-reference-token-preview-popover.is-open {
    display: block;
}

.image-node-bottom {
    min-height: 28px;
    gap: 6px;
    padding: 6px 2px 0;
    border-top: 0;
}

.image-node-model {
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-weight: 500;
}

.image-node-model-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.image-node-model-toggle.open,
.image-node-params-toggle.open,
.image-node-count-toggle.open {
    z-index: 42;
}

.image-node-model-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 192px;
    padding: 5px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: var(--panel-bg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px) saturate(145%);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.image-node-model-toggle.open .image-node-model-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.image-node-model-option {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
}

.image-node-model-option:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.image-node-model-option.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.image-node-model-option strong,
.image-node-model-option small {
    display: block;
    line-height: 1.25;
}

.image-node-model-option strong {
    font-size: 12px;
    font-weight: 500;
}

.image-node-model-option small {
    margin-top: 2px;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 500;
}

.image-node-model-check {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    opacity: 0;
}

.image-node-model-check svg {
    width: 14px;
    height: 14px;
}

.image-node-model-option.active .image-node-model-check {
    opacity: 1;
}

.v-divider {
    width: 1px;
    height: 14px;
    flex: 0 0 auto;
    background: var(--panel-line);
}

.params-chip,
.count-chip {
    padding: 0 7px;
    border: 0;
    background: transparent;
}

.image-node-count-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.image-node-count-toggle.open .image-node-chip-caret {
    transform: rotate(180deg);
}

.image-node-params-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.image-node-params {
    gap: 5px;
    max-width: 152px;
    white-space: nowrap;
}

.image-node-param-mini-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    flex: 0 0 18px;
}

.image-node-params-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-node-chip-caret {
    width: 10px;
    height: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 10px;
    color: var(--text-tertiary);
    transition: transform 0.16s ease;
}

.image-node-chip-caret svg {
    width: 10px;
    height: 10px;
}

.image-node-params-toggle.open .image-node-chip-caret {
    transform: rotate(180deg);
}

.image-node-ratio-icon {
    width: var(--ratio-w);
    height: var(--ratio-h);
    display: inline-block;
    border: 1.4px solid currentColor;
    border-radius: 2px;
    opacity: 0.78;
}

.image-node-ratio-icon[data-ratio-icon="auto"] {
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
}

.image-node-params-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    width: 244px;
    padding: 9px;
    border: 1px solid var(--panel-line);
    border-radius: 11px;
    background: #11151b;
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

body[data-theme="light"] .image-node-params-menu {
    background: #ffffff;
}

.image-node-params-toggle.open .image-node-params-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.image-node-param-section + .image-node-param-section {
    margin-top: 8px;
}

.image-node-param-title {
    margin-bottom: 6px;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 650;
}

.image-node-resolution-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.image-node-resolution-option,
.image-node-ratio-option {
    border: 1px solid var(--panel-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 650;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.image-node-resolution-option {
    height: 27px;
    font-size: 11px;
}

.image-node-ratio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.image-node-ratio-option {
    height: 46px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    font-size: 10.5px;
}

.image-node-resolution-option:hover,
.image-node-ratio-option:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.22);
    background: var(--panel-hover);
}

.image-node-resolution-option.active,
.image-node-ratio-option.active {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.08);
}

.image-node-count {
    gap: 4px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.image-node-count-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 76px;
    padding: 5px;
    border: 1px solid var(--panel-line);
    border-radius: 11px;
    background: var(--panel-bg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px) saturate(145%);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.image-node-count-toggle.open .image-node-count-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.image-node-count-option {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.image-node-count-option:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.image-node-count-option.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.image-node-count-option.active .image-node-model-check {
    opacity: 1;
}

.image-node-energy {
    gap: 4px;
    padding: 2px 4px 2px 8px;
}

.image-node-card .node-port {
    opacity: 0;
    pointer-events: none;
    border-color: var(--node-port-border);
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    cursor: crosshair;
    z-index: 20;
}

.image-node-card.selected .node-port,
.image-node-card.is-active-area .node-port,
.image-node-card:hover .node-port {
    opacity: 1;
    pointer-events: auto;
}

.image-node-card .node-port {
    top: calc(var(--image-node-frame-height, 270px) / 2);
}

.image-node-card .node-port.left {
    left: -40px;
    width: 16px;
    height: 16px;
    border-width: 1.5px;
}

.image-node-card .node-port.left::after {
    display: none;
}

.image-node-card .node-port.left:hover,
.image-node-card .node-port.left.snap,
.image-node-card .node-port.left.snap-target {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 12px var(--node-port-glow);
}

.image-node-card .node-port.right {
    right: -58px;
    width: 45px;
    height: 45px;
    border: 1.5px solid var(--node-port-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.image-node-card .node-port.right::after {
    content: "+";
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}

.image-node-card .node-port.right:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
    transform: translateY(-50%) scale(1.08);
}

.upscale-node-card {
    width: 260px;
    height: 260px;
    min-height: 260px;
}

.upscale-node-split-stack,
.upscale-node-zoom,
.upscale-node-preview {
    width: 260px;
}

.upscale-node-split-stack {
    position: relative;
    min-height: 260px;
}

.upscale-node-preview {
    aspect-ratio: 1 / 1;
    border-color: rgba(201, 207, 216, 0.34);
    border-radius: 8px;
    background: rgba(15, 19, 23, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 42px rgba(0, 0, 0, 0.26);
}

.upscale-node-card.selected .upscale-node-preview,
.upscale-node-card.is-active-area .upscale-node-preview,
.upscale-node-card:hover .upscale-node-preview {
    border-color: rgba(218, 224, 232, 0.48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 18px 42px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.upscale-node-preview-content {
    align-items: center;
    gap: 0;
    padding: 0 20px;
}

.upscale-node-preview-copy {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

.upscale-node-mini-label {
    color: var(--text-primary);
}

.upscale-node-panel {
    top: 278px;
    width: 420px;
    min-height: 210px;
    gap: 14px;
    padding: 17px 16px 14px;
    border-radius: 8px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(13, 17, 22, 0.96);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.upscale-node-card.selected .upscale-node-panel {
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.upscale-node-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
}

.upscale-node-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 650;
}

.upscale-node-provider,
.upscale-node-model-toggle {
    width: 100%;
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: #101419;
    color: var(--text-primary);
    font: 600 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.upscale-node-provider svg {
    width: 15px;
    height: 15px;
}

.upscale-node-model-wrap {
    position: relative;
    min-width: 0;
}

.upscale-node-model-toggle {
    justify-content: space-between;
    cursor: pointer;
}

.upscale-node-model-toggle:hover,
.upscale-node-model-wrap.open .upscale-node-model-toggle {
    border-color: rgba(255, 255, 255, 0.2);
    background: #12171d;
    box-shadow: none;
}

.upscale-node-model-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upscale-node-model-caret {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.upscale-node-model-caret svg {
    width: 14px;
    height: 14px;
}

.upscale-node-model-menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    display: none;
    padding: 5px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: #101419;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.upscale-node-model-wrap.open .upscale-node-model-menu {
    display: grid;
    gap: 4px;
}

.upscale-node-model-option {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
}

.upscale-node-model-option::after {
    content: "";
    width: 8px;
    height: 5px;
    flex: 0 0 auto;
    border-left: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    opacity: 0;
    transform: rotate(-45deg) translateY(-1px);
}

.upscale-node-model-option strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.upscale-node-model-option:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.upscale-node-model-option.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.upscale-node-model-option.active::after {
    opacity: 1;
}

.upscale-node-scale-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.upscale-node-scale-option {
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
}

.upscale-node-scale-option.active {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.075);
}

.upscale-node-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.upscale-node-card .node-port {
    top: 130px;
}

.upscale-node-card .node-port.left {
    left: -40px;
}

.upscale-node-card .node-port.right {
    right: -58px;
}

.agent-node-card {
    width: 600px;
    min-height: 860px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.agent-node-card.selected {
    box-shadow: none;
}

.agent-node-shell {
    position: relative;
    width: 600px;
    min-height: 860px;
    overflow: visible;
    border: 1px solid var(--panel-line);
    border-radius: 18px;
    background: var(--node-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.agent-node-label {
    left: 4px;
    top: -26px;
}

.agent-node-card.selected .agent-node-shell,
.agent-node-card:hover .agent-node-shell,
.agent-node-card.has-open-agent-menu .agent-node-shell {
    border-color: rgba(255, 168, 79, 0.34);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.38);
}

.agent-node-head {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid var(--panel-line);
}

.agent-node-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.agent-node-title strong {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}

.agent-node-status {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #5feba5;
    box-shadow: 0 0 0 3px rgba(95, 235, 165, 0.16);
}

.agent-node-id {
    display: none;
}

.agent-node-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px 14px;
}

.agent-node-top-actions {
    position: absolute;
    top: 11px;
    right: 16px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-node-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.agent-node-section-head {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.agent-node-section-head::before {
    content: none;
    display: none;
}

.agent-node-section-head > span:first-child {
    margin-right: auto;
    min-width: 64px;
}

.agent-node-reference-host:empty {
    display: none;
}

.agent-node-reference-host {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 0 0 3px;
    overflow: hidden;
}

.agent-node-reference-host .agent-node-reference-strip {
    width: 100%;
    min-height: 34px;
    max-width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 0;
    padding: 3px 5px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    background: rgba(6, 11, 17, 0.26);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.agent-node-reference-host .agent-node-reference-strip.is-reference-empty {
    border-style: dashed;
}

.agent-node-reference-host .agent-node-reference-strip.is-reference-asset-drag-over {
    border-color: rgba(255, 168, 79, 0.62);
    background: rgba(255, 168, 79, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.18);
}

.agent-node-reference-action {
    flex: 0 0 auto;
    cursor: pointer;
}

.agent-node-reference-action:hover {
    border-color: var(--panel-line);
}

.agent-node-reference-action svg {
    width: 12px;
    height: 12px;
}

.agent-node-reference-host .image-node-reference-empty-space {
    min-width: 1px;
    flex: 1 1 8px;
    align-self: stretch;
}

.agent-node-reference-host .agent-node-reference-chip {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.agent-node-reference-host .agent-node-reference-chip > img,
.agent-node-reference-host .agent-node-reference-chip .image-node-reference-video,
.agent-node-reference-host .agent-node-reference-chip .image-node-reference-video img,
.agent-node-reference-host .agent-node-reference-chip .image-node-reference-video video {
    border-radius: 6px;
}

.agent-node-reference-host .image-node-reference-icon svg {
    width: 15px;
    height: 15px;
}

.agent-node-chip {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-secondary);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.agent-node-model-chip {
    width: 132px;
    max-width: 132px;
    justify-content: space-between;
    overflow: hidden;
    text-transform: none;
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 11px;
    letter-spacing: 0;
}

.agent-node-preset-chip {
    color: rgba(188, 196, 208, 0.92);
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.agent-node-model-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-node-chip:hover,
.agent-node-model-toggle.open .agent-node-chip,
.agent-node-preset-toggle.open .agent-node-chip {
    color: var(--text-primary);
    background: var(--panel-hover);
    border-color: rgba(255, 168, 79, 0.38);
}

.agent-node-chip svg {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    color: var(--text-tertiary);
    transition: transform 0.16s ease;
}

.agent-node-chip .agent-node-chip-icon {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    color: rgba(188, 196, 208, 0.86);
}

.agent-node-model-toggle,
.agent-node-preset-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.agent-node-model-toggle.open,
.agent-node-preset-toggle.open {
    z-index: 46;
}

.agent-node-model-toggle.open .agent-node-chip-chevron,
.agent-node-preset-toggle.open .agent-node-chip-chevron {
    transform: rotate(180deg);
}

.agent-node-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    min-width: 208px;
    max-width: 300px;
    padding: 5px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: #11151b;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.agent-node-footer .agent-node-model-toggle .agent-node-menu {
    top: auto;
    right: auto;
    bottom: calc(100% + 7px);
    left: 0;
}

body[data-theme="light"] .agent-node-menu {
    background: #ffffff;
}

.agent-node-model-toggle.open .agent-node-menu,
.agent-node-preset-toggle.open .agent-node-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.agent-node-model-option {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
}

.agent-node-model-option:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.agent-node-model-option.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.agent-node-menu-check {
    width: 14px;
    height: 14px;
    opacity: 0;
}

.agent-node-menu-check svg {
    width: 14px;
    height: 14px;
}

.agent-node-model-option.active .agent-node-menu-check {
    opacity: 1;
}

.agent-preset-modal {
    position: fixed;
    inset: 0;
    z-index: 1220;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 6vw;
    background: rgba(11, 14, 19, 0.58);
    backdrop-filter: blur(12px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.agent-preset-modal.show {
    opacity: 1;
    pointer-events: auto;
}

body[data-theme="light"] .agent-preset-modal {
    background: rgba(232, 232, 232, 0.74);
}

.agent-preset-card {
    width: min(680px, 92vw);
    max-height: min(520px, 82vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 16px;
    background: var(--node-bg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.98) translateY(8px);
    transition: transform 0.2s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.agent-preset-modal.show .agent-preset-card {
    transform: scale(1) translateY(0);
}

body[data-theme="light"] .agent-preset-card {
    background: #ffffff;
}

.agent-preset-head {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--panel-line);
}

.agent-preset-head {
    min-height: 56px;
    padding: 0 22px;
}

.agent-preset-tab,
.agent-preset-close {
    min-height: 32px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 650;
}

.agent-preset-tab {
    align-self: stretch;
    padding: 0 12px;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
}

.agent-preset-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.agent-preset-close {
    width: 32px;
    margin-left: auto;
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 18px;
}

.agent-preset-close:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.agent-preset-body {
    flex: 1;
    min-height: 280px;
    overflow-y: auto;
    padding: 20px 22px;
}

.agent-preset-list {
    display: grid;
    gap: 12px;
}

.agent-preset-item {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
}

.agent-preset-item:hover,
.agent-preset-item.selected {
    border-color: rgba(255, 168, 79, 0.52);
    background: var(--accent-soft);
}

.agent-preset-item-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
}

.agent-preset-item-icon svg {
    width: 14px;
    height: 14px;
}

.agent-preset-item-copy {
    min-width: 0;
}

.agent-preset-item-copy strong,
.agent-preset-item-copy small {
    display: block;
    line-height: 1.28;
}

.agent-preset-item-copy strong {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
}

.agent-preset-item-copy small {
    margin-top: 2px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
}

.agent-preset-custom-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1fr);
    align-items: start;
    gap: 12px;
}

.agent-preset-new-card {
    width: 150px;
    min-height: 106px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text-primary);
}

.agent-preset-new-thumb {
    width: 150px;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    border: 1.5px dashed var(--panel-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-tertiary);
    font-size: 28px;
    font-weight: 300;
}

.agent-preset-new-card:hover .agent-preset-new-thumb {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.agent-preset-new-card strong {
    font-size: 12.5px;
    font-weight: 650;
}

.agent-preset-custom-item {
    max-width: 100%;
}

.agent-preset-custom-form {
    max-width: 520px;
    display: grid;
    gap: 12px;
}

.agent-preset-form-field {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
}

.agent-preset-form-field input,
.agent-preset-form-field textarea {
    width: 100%;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    outline: 0;
    background: var(--panel-bg);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
}

.agent-preset-form-field input {
    height: 36px;
    padding: 0 11px;
}

.agent-preset-form-field textarea {
    min-height: 140px;
    resize: vertical;
    padding: 10px 11px;
    line-height: 1.55;
}

.agent-preset-form-field input:focus,
.agent-preset-form-field textarea:focus {
    border-color: rgba(255, 168, 79, 0.5);
    background: rgba(255, 255, 255, 0.035);
}

body[data-theme="light"] .agent-preset-form-field input:focus,
body[data-theme="light"] .agent-preset-form-field textarea:focus {
    background: rgba(255, 255, 255, 0.92);
}

.agent-preset-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.agent-preset-form-cancel,
.agent-preset-form-save {
    min-height: 32px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
}

.agent-preset-form-cancel {
    background: var(--panel-hover);
}

.agent-preset-form-save {
    background: rgba(255, 168, 79, 0.72);
    color: #201407;
}

.agent-preset-empty {
    padding: 36px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.agent-node-input-wrap {
    position: relative;
}

.agent-node-rich-editor {
    position: relative;
}

.agent-node-input {
    height: 172px;
    min-height: 0;
    padding: 13px 44px 13px 14px;
    border: 1px solid rgba(125, 136, 153, 0.24);
    border-radius: 8px;
    outline: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 150, 0.46) transparent;
    background: rgba(18, 23, 30, 0.96);
    color: rgba(143, 151, 163, 0.86);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.agent-node-section[data-agent-field="metaPrompt"] .agent-node-input,
.agent-node-section[data-agent-field="userInput"] .agent-node-input {
    height: 128px;
}

.agent-node-input::-webkit-scrollbar {
    width: 8px;
}

.agent-node-input::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 136, 150, 0.46);
    background-clip: padding-box;
}

.agent-node-input::-webkit-scrollbar-track {
    background: transparent;
}

.agent-node-input.text-rich-surface h1,
.agent-node-input.text-rich-surface h2,
.agent-node-input.text-rich-surface h3,
.agent-node-input.text-rich-surface p,
.agent-node-input.text-rich-surface ul,
.agent-node-input.text-rich-surface ol {
    margin: 0 0 6px;
}

.agent-node-input.text-rich-surface h1 {
    font-size: 1.42em;
}

.agent-node-input.text-rich-surface h2 {
    font-size: 1.24em;
}

.agent-node-input.text-rich-surface h3 {
    font-size: 1.1em;
}

.agent-node-input.text-rich-surface ul,
.agent-node-input.text-rich-surface ol {
    padding-left: 20px;
}

.agent-node-input.text-rich-surface li {
    margin: 0 0 3px;
}

.agent-node-input.text-rich-surface hr {
    margin: 9px 0;
}

.agent-node-input.is-output {
    height: 340px;
}

.agent-node-input.has-text,
.agent-node-input:focus {
    color: rgba(218, 223, 232, 0.94);
}

.agent-node-input:focus {
    border-color: rgba(149, 160, 176, 0.42);
    background: rgba(20, 25, 32, 0.98);
}

.agent-node-input::selection,
.agent-node-input *::selection {
    background: var(--selection-bg);
    color: var(--selection-fg);
}

body[data-theme="light"] .agent-node-input {
    background: rgba(255, 255, 255, 0.9);
    color: #7a8190;
    border-color: rgba(33, 39, 52, 0.16);
}

body[data-theme="light"] .agent-node-input:focus {
    background: rgba(255, 255, 255, 0.96);
}

.agent-node-fullscreen {
    position: absolute;
    right: 11.6px;
    top: 10.6px;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(125, 136, 153, 0.22);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-tertiary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.agent-node-input-wrap:hover .agent-node-fullscreen,
.agent-node-rich-editor:focus-within + .agent-node-fullscreen,
.agent-node-fullscreen:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.agent-node-fullscreen:hover {
    opacity: 1;
    border-color: rgba(255, 168, 79, 0.52);
    background: rgba(255, 168, 79, 0.13);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.08);
    color: var(--accent);
}

.agent-node-fullscreen svg {
    width: 12px;
    height: 12px;
}

.agent-node-section-port {
    position: absolute;
    left: -38px;
    top: 4px;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--node-port-border);
    border-radius: 999px;
    background: var(--node-port-bg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    opacity: 0;
    pointer-events: none;
    cursor: crosshair;
    transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.agent-node-card.selected .agent-node-section-port,
.agent-node-card:hover .agent-node-section-port,
.agent-node-card.has-open-agent-menu .agent-node-section-port {
    opacity: 1;
    pointer-events: auto;
}

.agent-node-section-port:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 12px var(--node-port-glow);
    transform: scale(1.12);
}

.agent-node-action-row {
    display: flex;
    flex: 0 0 154px;
    flex-direction: column;
    gap: 0;
    margin-left: auto;
    margin-top: 0;
}

.agent-node-run {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 20px 9px;
    border: 1.5px solid var(--panel-line);
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.agent-node-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}

.agent-node-control-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-node-run:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.agent-node-run:active {
    transform: scale(0.997);
}

.agent-node-run .run-coin {
    min-height: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(238, 242, 248, 0.96);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11.5px;
    font-weight: 600;
}

.agent-node-run .run-coin svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.agent-node-run .run-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0;
}

.agent-node-run .run-label svg {
    width: 12px;
    height: 12px;
    transition: transform 0.15s ease;
}

.agent-node-run:hover .run-label {
    color: var(--accent);
}

.agent-node-run:hover .run-label svg {
    transform: translateX(2px);
}

.agent-node-card .node-port {
    top: 430px;
    opacity: 0;
    pointer-events: none;
    border-color: var(--node-port-border);
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    cursor: crosshair;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    z-index: 20;
}

.agent-node-card.selected .node-port,
.agent-node-card:hover .node-port,
.agent-node-card.has-open-agent-menu .node-port {
    opacity: 1;
    pointer-events: auto;
}

.agent-node-card .node-port.right {
    right: -58px;
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--node-port-border);
    border-radius: 50%;
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.agent-node-card .node-port.right::after {
    content: "+";
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}

.agent-node-card .node-port.right:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
    transform: translateY(-50%) scale(1.08);
}

.canvas-content.has-group-selection .placeholder-node .node-port,
.canvas-content.has-multi-node-selection .placeholder-node .node-port,
.canvas-content.has-selection-group-preview .placeholder-node .node-port,
.canvas-content.has-group-selection .agent-node-section-port,
.canvas-content.has-multi-node-selection .agent-node-section-port,
.canvas-content.has-selection-group-preview .agent-node-section-port,
.canvas-content.has-group-selection .image-node-upload,
.canvas-content.has-multi-node-selection .image-node-upload,
.canvas-content.has-selection-group-preview .image-node-upload,
.canvas-content.has-group-selection .video-node-upload,
.canvas-content.has-multi-node-selection .video-node-upload,
.canvas-content.has-selection-group-preview .video-node-upload,
.canvas-content.has-group-selection .video-node-content-upload,
.canvas-content.has-multi-node-selection .video-node-content-upload,
.canvas-content.has-selection-group-preview .video-node-content-upload,
.canvas-content.has-group-selection .image-node-render-toolbar,
.canvas-content.has-multi-node-selection .image-node-render-toolbar,
.canvas-content.has-selection-group-preview .image-node-render-toolbar,
.canvas-content.has-group-selection .image-node-content-wrap::before,
.canvas-content.has-multi-node-selection .image-node-content-wrap::before,
.canvas-content.has-selection-group-preview .image-node-content-wrap::before,
.canvas-content.has-group-selection .video-node-hover-toolbar,
.canvas-content.has-multi-node-selection .video-node-hover-toolbar,
.canvas-content.has-selection-group-preview .video-node-hover-toolbar,
.canvas-content.has-group-selection .video-inline-trim,
.canvas-content.has-multi-node-selection .video-inline-trim,
.canvas-content.has-selection-group-preview .video-inline-trim {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
}

.canvas-content.has-group-selection .text-node-card[data-view-state="compact"] .text-node-panel,
.canvas-content.has-multi-node-selection .text-node-card[data-view-state="compact"] .text-node-panel,
.canvas-content.has-selection-group-preview .text-node-card[data-view-state="compact"] .text-node-panel,
.canvas-content.has-group-selection .image-node-card .image-node-panel,
.canvas-content.has-multi-node-selection .image-node-card .image-node-panel,
.canvas-content.has-selection-group-preview .image-node-card .image-node-panel,
.canvas-content.has-group-selection .video-node-card .image-node-panel,
.canvas-content.has-multi-node-selection .video-node-card .image-node-panel,
.canvas-content.has-selection-group-preview .video-node-card .image-node-panel {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(-6px) scale(var(--canvas-inv-scale, 1)) !important;
    transition: none !important;
}

.canvas-content.has-group-selection .text-node-card[data-view-state="compact"] .text-node-floating-toolbar,
.canvas-content.has-multi-node-selection .text-node-card[data-view-state="compact"] .text-node-floating-toolbar,
.canvas-content.has-selection-group-preview .text-node-card[data-view-state="compact"] .text-node-floating-toolbar {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
}

.audio-node-card {
    width: 260px;
    height: 98px;
    min-height: 98px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.audio-node-card.selected {
    border-color: transparent;
    box-shadow: none;
}

.audio-node-card .node-port {
    top: 50%;
    opacity: 0;
    pointer-events: none;
    border-color: var(--node-port-border);
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    cursor: crosshair;
    z-index: 20;
}

.audio-node-card.selected .node-port,
.audio-node-card.is-active-area .node-port,
.audio-node-card.connection-source .node-port,
.audio-node-card:hover .node-port {
    opacity: 1;
    pointer-events: auto;
}

.audio-node-card .node-port.left {
    left: -24px;
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.audio-node-card .node-port.left::after {
    display: none;
}

.audio-node-card .node-port.left:hover,
.audio-node-card .node-port.left.snap {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 12px var(--node-port-glow);
}

.audio-node-card .node-port.right {
    right: -44px;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--node-port-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.audio-node-card .node-port.right::after {
    content: "+";
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.audio-node-card .node-port.right:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.audio-node-shell {
    position: relative;
    height: 98px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: #232426;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.audio-node-card.selected .audio-node-shell,
.audio-node-card:hover .audio-node-shell {
    border-color: rgba(255, 168, 79, 0.36);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 168, 79, 0.22);
}

.audio-node-title {
    min-height: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(232, 235, 241, 0.84);
    font-size: 12px;
    line-height: 1;
}

.audio-node-title span {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    color: rgba(251, 191, 92, 0.86);
}

.audio-node-title svg {
    width: 13px;
    height: 13px;
}

.audio-node-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

.audio-node-waveform {
    position: relative;
    height: 43px;
    overflow: hidden;
    border-radius: 5px;
    background: #333437;
}

.audio-node-bars {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 26px 0 10px;
}

.audio-node-wave-bar {
    width: 2px;
    max-height: 36px;
    border-radius: 999px;
    background: rgba(113, 116, 122, 0.82);
}

.audio-node-playhead {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 10px;
    z-index: 2;
    width: 2px;
    border-radius: 999px;
    background: #ff4f66;
}

.audio-node-download {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 3;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(18, 19, 21, 0.68);
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.audio-node-download:hover {
    color: #ffd099;
    border-color: rgba(255, 168, 79, 0.38);
}

.audio-node-download svg {
    width: 12px;
    height: 12px;
}

.audio-node-footer {
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: rgba(238, 241, 248, 0.72);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.audio-node-time {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-node-play {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    margin-top: -2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(14, 16, 20, 0.58);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

.audio-node-play:hover,
.audio-node-play.is-playing {
    color: #ffc46f;
    border-color: rgba(255, 168, 79, 0.42);
}

.audio-node-play svg {
    width: 11px;
    height: 11px;
}

.audio-node-player {
    display: none;
}

.audio-node-empty {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

body[data-theme="light"] .audio-node-shell {
    border-color: rgba(17, 24, 39, 0.1);
    background: #f6f7f9;
    color: rgba(17, 24, 39, 0.9);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .audio-node-title {
    color: rgba(17, 24, 39, 0.78);
}

body[data-theme="light"] .audio-node-waveform {
    background: #e2e5ea;
}

body[data-theme="light"] .audio-node-wave-bar {
    background: rgba(101, 107, 116, 0.72);
}

body[data-theme="light"] .audio-node-footer {
    color: rgba(17, 24, 39, 0.64);
}

body[data-theme="light"] .audio-node-download,
body[data-theme="light"] .audio-node-play {
    border-color: rgba(17, 24, 39, 0.12);
    background: rgba(255, 255, 255, 0.76);
    color: rgba(17, 24, 39, 0.72);
}

.video-node-card {
    width: var(--image-node-frame-width, 480px);
    height: var(--image-node-frame-height, 270px);
    min-height: var(--image-node-frame-height, 270px);
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.video-node-card.selected {
    border-color: rgba(255, 168, 79, 0.52);
    box-shadow: none;
}

.video-node-card.selected .image-node-preview,
.video-node-card.is-active-area .image-node-preview,
.video-node-card:hover .image-node-preview {
    border-color: rgba(255, 168, 79, 0.28);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.34);
}

.video-node-card.is-input-panel-active .image-node-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(var(--canvas-inv-scale, 1));
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.26);
}

.video-node-card.has-open-image-menu .image-node-panel {
    z-index: 36;
}

.video-node-card.has-open-image-menu .node-port.right {
    z-index: 4;
}

.video-node-upload-pill {
    position: absolute;
    top: -52px;
    left: 50%;
    z-index: 30;
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: var(--node-bg);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 650;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
    box-shadow: var(--shadow-lg);
}

.video-node-upload-pill svg {
    width: 13px;
    height: 13px;
}

.video-node-card.selected .video-node-upload-pill,
.video-node-card.is-active-area .video-node-upload-pill,
.video-node-card:hover .video-node-upload-pill {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.video-node-upload-pill:hover {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
    color: var(--accent);
}

.video-node-hover-toolbar {
    position: absolute;
    top: -78px;
    left: 50%;
    z-index: 46;
    min-height: 48px;
    width: max-content;
    max-width: min(780px, calc(100vw - 36px));
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    background: rgba(13, 17, 22, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.92);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(5px);
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.16s ease;
    white-space: nowrap;
}

.video-node-card.is-active-area .video-node-hover-toolbar,
.video-node-card:hover .video-node-hover-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.video-node-card.is-active-area .video-node-hover-toolbar,
.video-node-card:hover .video-node-hover-toolbar {
    border-color: rgba(255, 255, 255, 0.14);
}

.video-node-toolbar-btn {
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.video-node-toolbar-btn.icon-only {
    width: 32px;
    padding: 0;
}

.video-node-toolbar-btn:hover,
.video-node-toolbar-menu-group.open > .video-node-toolbar-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.video-node-toolbar-icon {
    width: 15px;
    height: 15px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 15px;
}

.video-node-toolbar-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

.video-node-toolbar-label {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-node-toolbar-caret {
    width: 9px;
    height: 9px;
    display: inline-grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.52);
    transition: transform 0.16s ease, color 0.16s ease;
}

.video-node-toolbar-caret svg {
    width: 9px;
    height: 9px;
}

.video-node-toolbar-menu-group.open .video-node-toolbar-caret {
    color: rgba(255, 255, 255, 0.82);
    transform: rotate(180deg);
}

.video-node-toolbar-divider {
    width: 1px;
    height: 22px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.08);
}

.video-node-toolbar-menu-group {
    position: relative;
    display: inline-flex;
}

.video-node-toolbar-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 64;
    min-width: 124px;
    display: grid;
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 11px;
    background: rgba(16, 20, 25, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(14px) saturate(135%);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.video-node-toolbar-menu-group.open .video-node-toolbar-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.video-node-toolbar-menu-item {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    font-weight: 620;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.video-node-toolbar-menu-item:hover {
    background: rgba(255, 168, 79, 0.16);
    color: #ffd4a3;
}

body[data-theme="light"] .video-node-hover-toolbar {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(252, 253, 255, 0.96);
    color: rgba(28, 34, 45, 0.9);
    box-shadow: 0 18px 42px rgba(20, 25, 34, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .video-node-toolbar-btn:hover,
body[data-theme="light"] .video-node-toolbar-menu-group.open > .video-node-toolbar-btn {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.95);
}

body[data-theme="light"] .video-node-toolbar-caret {
    color: rgba(18, 24, 35, 0.46);
}

body[data-theme="light"] .video-node-toolbar-divider {
    background: rgba(18, 24, 35, 0.12);
}

body[data-theme="light"] .video-node-toolbar-menu {
    border-color: rgba(18, 24, 35, 0.12);
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(20, 25, 34, 0.16);
}

body[data-theme="light"] .video-node-toolbar-menu-item {
    color: rgba(28, 34, 45, 0.84);
}

.video-node-card.has-video-content .video-node-upload-pill {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.video-node-card.has-video-content .video-node-panel {
    display: none !important;
}

.video-node-preview .image-node-preview-icon {
    width: 36px;
    height: 36px;
}

.video-node-preview .image-node-preview-icon svg {
    width: 36px;
    height: 36px;
    opacity: 0.62;
}

.video-node-media {
    position: absolute;
    inset: 0;
    display: grid;
    background: #05070a;
    overflow: hidden;
    border-radius: inherit;
}

.video-node-media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    height: 74px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.58) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.video-node-media:hover::after,
.video-node-media.is-controls-active::after {
    opacity: 1;
}

.video-node-player {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #05070a;
    cursor: grab;
    touch-action: none;
}

.video-node-preview-hitbox {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 54px;
    left: 0;
    z-index: 2;
    cursor: grab;
    touch-action: none;
}

.video-node-card:active .video-node-player,
.video-node-card:active .video-node-preview-hitbox {
    cursor: grabbing;
}

.video-node-clip-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 4;
    max-width: calc(100% - 20px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 168, 79, 0.34);
    border-radius: 8px;
    background: rgba(10, 13, 18, 0.76);
    color: rgba(255, 244, 226, 0.94);
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.video-node-clip-badge strong {
    min-width: 0;
    overflow: hidden;
    color: #ffcf95;
    font-size: 10.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-node-card.has-video-inline-trim {
    z-index: 90;
}

.video-inline-trim {
    position: fixed;
    inset: 0;
    z-index: 26000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(0, 0, 0, 0.58);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
}

.video-inline-trim-shell {
    position: relative;
    width: min(840px, calc(100vw - 80px));
    max-height: calc(100vh - 64px);
    display: grid;
    justify-items: center;
    gap: 14px;
}

.video-inline-trim-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.video-inline-trim-close:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.video-inline-trim-stage {
    position: relative;
    min-height: 0;
    width: min(720px, calc(100vw - 176px));
    max-height: calc(100vh - 210px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #05070a;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.video-inline-trim-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.video-inline-trim-toolbar {
    position: relative;
    width: min(820px, calc(100vw - 112px));
    height: 56px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    background: rgba(18, 22, 28, 0.95);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(16px);
}

.video-inline-trim-divider {
    flex: 0 0 auto;
    width: 1px;
    height: 26px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.11);
}

.video-inline-trim-tool {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.video-inline-trim-snap {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

.video-inline-trim-tool svg {
    width: 18px;
    height: 18px;
}

.video-inline-trim-snap svg {
    width: 20px;
    height: 20px;
}

.video-inline-trim-tool:hover,
.video-inline-trim.show-shortcuts [data-video-trim-shortcuts-button],
.video-inline-trim-tool.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.video-inline-trim-snap:hover,
.video-inline-trim-snap.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.video-inline-trim-track {
    position: relative;
    flex: 1 1 auto;
    min-width: 260px;
    height: 40px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.video-inline-trim-strip {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 7px;
    background: #101216;
    cursor: crosshair;
    outline: none;
    touch-action: none;
}

.video-inline-trim-strip:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.34);
}

.video-inline-trim-ruler {
    display: none;
}

.video-inline-trim-ruler span {
    position: absolute;
    top: 0;
    height: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    transform: translateX(-1px);
}

.video-inline-trim-ruler i {
    display: block;
    width: 1px;
    height: 5px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.18);
}

.video-inline-trim-ruler b {
    display: block;
    transform: translateX(-50%);
    font-style: normal;
    font-weight: 600;
}

.video-inline-trim-ruler span:first-child b {
    transform: none;
}

.video-inline-trim-ruler span:last-child b {
    transform: translateX(-100%);
}

.video-inline-trim-thumbs {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    background: #0c1014;
}

.video-inline-trim-thumb {
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.045);
    background: linear-gradient(135deg, rgba(255, 168, 79, 0.11), rgba(52, 170, 255, 0.1));
}

.video-inline-trim-thumb:last-child {
    border-right: 0;
}

.video-inline-trim-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0.5;
}

.video-inline-trim-thumb.is-empty {
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, rgba(255, 168, 79, 0.18), rgba(52, 170, 255, 0.14));
    background-size: 24px 100%, 100% 100%;
}

.video-inline-trim-selection,
.video-inline-trim-shade {
    position: absolute;
    top: 0;
    bottom: 0;
}

.video-inline-trim-shade {
    pointer-events: none;
}

.video-inline-trim-selection {
    z-index: 7;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-right-color: rgba(255, 255, 255, 0.58);
    border-left-color: rgba(255, 255, 255, 0.58);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(12, 14, 17, 0.16);
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.video-inline-trim-shade {
    z-index: 6;
    background: rgba(0, 0, 0, 0.52);
}

.video-inline-trim-selection.is-active,
.video-inline-trim.is-moving-selection .video-inline-trim-selection {
    cursor: grabbing;
}

.video-inline-trim-selection span {
    max-width: calc(100% - 20px);
    overflow: hidden;
    min-width: 52px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(23, 24, 28, 0.96);
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
    pointer-events: none;
}

.video-inline-trim-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 9;
    width: 16px;
    margin-left: -8px;
    border: 0;
    background: transparent;
    cursor: ew-resize;
    outline: none;
    touch-action: none;
}

.video-inline-trim-handle::before {
    display: none;
    content: none;
}

.video-inline-trim-handle::after {
    display: none;
    content: none;
}

.video-inline-trim-handle:hover::before,
.video-inline-trim-handle.is-active::before,
.video-inline-trim-handle:focus-visible::before {
    display: none;
}

.video-inline-trim-error {
    position: absolute;
    right: 18px;
    bottom: -18px;
    min-height: 14px;
    color: #ff9b9b;
    font-size: 11px;
    font-weight: 650;
}

.video-inline-trim-timebar {
    display: none;
}

.video-inline-trim-confirm {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    color: rgba(16, 18, 22, 0.92);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
    transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.video-inline-trim-confirm svg {
    width: 18px;
    height: 18px;
}

.video-inline-trim-confirm:hover {
    background: #f4f4f4;
    color: #111111;
    transform: translateY(-1px);
}

.video-inline-trim-shortcuts {
    position: absolute;
    bottom: 78px;
    left: 18px;
    z-index: 12;
    width: min(560px, calc(100vw - 96px));
    padding: 18px 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    background: rgba(39, 39, 39, 0.98);
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.44);
}

.video-inline-trim-shortcuts[hidden] {
    display: none;
}

.video-inline-trim-shortcuts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.video-inline-trim-shortcuts-head strong {
    font-size: 15px;
    font-weight: 720;
}

.video-inline-trim-shortcuts-head button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.video-inline-trim-shortcuts-head button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.video-inline-trim-shortcuts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.video-inline-trim-shortcuts-col {
    display: grid;
    gap: 10px;
}

.video-inline-trim-shortcuts-rule {
    width: 1px;
    height: 100%;
    min-height: 142px;
    background: rgba(255, 255, 255, 0.09);
}

.video-inline-trim-shortcut-row {
    min-height: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.video-inline-trim-shortcut-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-inline-trim-shortcut-keys {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.video-inline-trim-shortcuts-grid kbd,
.video-inline-trim-shortcuts-grid em {
    min-width: 34px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.88);
    font-family: inherit;
    font-size: 12px;
    font-style: normal;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
}

body[data-theme="light"] .video-node-clip-badge {
    border-color: rgba(211, 117, 28, 0.28);
    background: rgba(255, 250, 244, 0.9);
    color: rgba(58, 36, 18, 0.9);
    box-shadow: 0 10px 24px rgba(40, 26, 12, 0.12);
}

body[data-theme="light"] .video-node-clip-badge strong {
    color: #b86215;
}

body[data-theme="light"] .video-inline-trim {
    background: rgba(10, 15, 22, 0.28);
    color: rgba(24, 30, 40, 0.92);
}

body[data-theme="light"] .video-inline-trim-toolbar,
body[data-theme="light"] .video-inline-trim-shortcuts {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(28, 30, 34, 0.96);
}

body[data-theme="light"] .video-inline-trim-close {
    color: rgba(255, 255, 255, 0.84);
}

body[data-theme="light"] .video-inline-trim-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body[data-theme="light"] .video-inline-trim-confirm:hover {
    color: #171008;
}

body[data-theme="light"] .video-inline-trim-strip {
    background: rgba(14, 16, 18, 0.94);
}

body[data-theme="light"] .video-inline-trim-timebar {
    color: rgba(255, 255, 255, 0.58);
}

body[data-theme="light"] .video-inline-trim-ruler span {
    color: rgba(255, 255, 255, 0.48);
}

body[data-theme="light"] .video-inline-trim-shade {
    background: rgba(0, 0, 0, 0.42);
}

@media (max-width: 760px) {
    .video-inline-trim {
        padding: 12px;
    }

    .video-inline-trim-shell {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        gap: 12px;
    }

    .video-inline-trim-stage {
        width: calc(100vw - 48px);
        max-height: calc(100vh - 190px);
    }

    .video-inline-trim-toolbar {
        width: calc(100vw - 24px);
        height: auto;
        min-height: 56px;
        gap: 6px;
        padding: 8px;
    }

    .video-inline-trim-track {
        min-width: 96px;
    }

    .video-inline-trim-divider {
        display: none;
    }

    .video-inline-trim-close,
    .video-inline-trim-tool {
        width: 36px;
        height: 36px;
    }

    .video-inline-trim-snap {
        width: 38px;
        height: 38px;
    }

    .video-inline-trim-confirm {
        width: 44px;
        height: 44px;
    }

    .video-inline-trim-shortcuts {
        left: 0;
        width: calc(100vw - 24px);
    }

    .video-inline-trim-shortcuts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .video-inline-trim-shortcuts-rule {
        display: none;
    }
}

.video-node-content-upload {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(18, 22, 28, 0.74);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 0.18s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.video-node-content-upload svg {
    width: 15px;
    height: 15px;
}

.video-node-card.selected .video-node-content-upload,
.video-node-card.is-active-area .video-node-content-upload,
.video-node-card:hover .video-node-content-upload {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.video-node-content-upload:hover {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent);
    color: #0b0e13;
    transform: translateY(-1px);
}

.video-frame-capture-overlay {
    position: fixed;
    inset: 0;
    z-index: 22400;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 44px;
    color: rgba(255, 255, 255, 0.92);
}

.video-frame-capture-overlay.show {
    display: flex;
}

.video-frame-capture-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.video-frame-capture-timeline {
    position: relative;
    z-index: 1;
    width: min(960px, 82vw);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(13, 17, 22, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    min-height: 58px;
    padding: 7px 10px;
    border-radius: 12px;
}

.video-frame-capture-title,
.video-frame-capture-confirm,
.video-frame-capture-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.video-frame-capture-title {
    gap: 7px;
    min-width: 72px;
    height: 40px;
    padding-left: 3px;
    border-left: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.video-frame-capture-title svg,
.video-frame-capture-confirm svg,
.video-frame-capture-close svg {
    width: 15px;
    height: 15px;
}

.video-frame-capture-close,
.video-frame-capture-confirm {
    height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.video-frame-capture-close {
    width: 40px;
    flex: 0 0 40px;
}

.video-frame-capture-confirm {
    flex: 0 0 auto;
    gap: 6px;
    padding: 0 13px;
    border: 1px solid rgba(255, 168, 79, 0.28);
    color: #ffd6a3;
    font-size: 12px;
    font-weight: 700;
}

.video-frame-capture-close:hover,
.video-frame-capture-confirm:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.video-frame-capture-confirm:disabled {
    opacity: 0.48;
    cursor: wait;
}

.video-frame-capture-stage {
    position: relative;
    z-index: 1;
    width: min(864px, 72vw);
    max-height: 66vh;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #05070a;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.video-frame-capture-video {
    width: 100%;
    max-height: 66vh;
    display: block;
    object-fit: contain;
    background: #05070a;
}

.video-frame-capture-error {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    max-width: calc(100% - 36px);
    padding: 7px 10px;
    border: 1px solid rgba(255, 168, 79, 0.3);
    border-radius: 8px;
    background: rgba(13, 17, 22, 0.88);
    color: rgba(255, 214, 163, 0.95);
    font-size: 12px;
    font-weight: 650;
}

.video-frame-capture-track {
    flex: 1 1 auto;
    min-width: 180px;
    display: flex;
    align-items: stretch;
}

.video-frame-capture-filmstrip {
    position: relative;
    width: 100%;
    height: 38px;
    border: 1px solid rgba(42, 169, 255, 0.9);
    border-radius: 8px;
    background: #05070a;
    box-shadow: 0 0 0 1px rgba(42, 169, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.video-frame-capture-thumbs {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
}

.video-frame-capture-thumb {
    min-width: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.48);
    background-color: #0e1724;
    background-position: center;
    background-size: cover;
    filter: saturate(0.92) brightness(0.92);
}

.video-frame-capture-thumb:last-child {
    border-right: 0;
}

.video-frame-capture-thumb.is-empty {
    background:
        linear-gradient(135deg, rgba(42, 169, 255, 0.22), rgba(255, 168, 79, 0.12)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 8px, transparent 8px 16px);
}

.video-frame-capture-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    width: 0;
    pointer-events: none;
    transform: translateX(-1px);
}

.video-frame-capture-playhead::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    border-radius: 999px;
    background: #23a9ff;
    box-shadow: 0 0 0 1px rgba(35, 169, 255, 0.36), 0 0 12px rgba(35, 169, 255, 0.48);
}

.video-frame-capture-playhead span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 28px;
    border-radius: 999px;
    background: #23a9ff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px rgba(35, 169, 255, 0.42);
}

.video-frame-capture-playhead strong {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 48px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(13, 17, 22, 0.86);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.video-frame-capture-range {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    -webkit-appearance: none;
    appearance: none;
}

.video-frame-capture-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1px;
    height: 38px;
}

.video-frame-capture-range::-webkit-slider-runnable-track {
    height: 38px;
}

body[data-theme="light"] .video-frame-capture-backdrop {
    background: rgba(8, 10, 14, 0.74);
}

body[data-theme="light"] .video-frame-capture-timeline {
    border-color: rgba(15, 23, 42, 0.13);
    background: rgba(255, 255, 255, 0.96);
    color: rgba(15, 23, 42, 0.86);
}

body[data-theme="light"] .video-frame-capture-stage,
body[data-theme="light"] .video-frame-capture-video {
    background: #111827;
}

body[data-theme="light"] .video-frame-capture-title {
    border-left-color: rgba(15, 23, 42, 0.11);
}

body[data-theme="light"] .video-frame-capture-filmstrip {
    background: #e5eaf2;
    box-shadow: 0 0 0 1px rgba(42, 169, 255, 0.16), inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .video-frame-capture-playhead strong {
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
}

@media (max-width: 720px) {
    .video-frame-capture-timeline {
        width: min(960px, 96vw);
        gap: 8px;
        padding: 7px;
    }

    .video-frame-capture-title {
        min-width: 34px;
        padding-left: 0;
        border-left: 0;
    }

    .video-frame-capture-title span,
    .video-frame-capture-confirm span {
        display: none;
    }

    .video-frame-capture-confirm {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .video-frame-capture-track {
        min-width: 0;
    }
}

.video-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 22000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 44px;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: none;
}

.video-preview-overlay.show {
    display: flex;
}

.video-preview-shell {
    position: relative;
    width: min(864px, 70vw);
    max-height: 68vh;
    display: grid;
    place-items: center;
}

.video-preview-layout .video-preview-shell {
    flex: 0 1 min(864px, 62vw);
}

.video-preview-player {
    width: 100%;
    max-height: 66vh;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    background: #05070a;
    box-shadow: var(--shadow-lg);
    transition: transform 0.18s ease;
    cursor: grab;
    touch-action: none;
}

.video-preview-player.is-dragging {
    cursor: grabbing;
    transition: none;
}

.video-preview-close {
    position: fixed;
    top: 56px;
    right: 20px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.video-preview-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.video-preview-toolbar-right {
    position: fixed;
    top: 56px;
    right: 60px;
    z-index: 1;
    display: flex;
    gap: 8px;
}

.video-preview-tool-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.video-preview-tool-btn svg {
    width: 14px;
    height: 14px;
}

.video-preview-tool-btn:hover,
.video-preview-tool-btn[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.video-node-params {
    width: 224px;
    max-width: 224px;
    min-width: 224px;
    flex: 0 0 224px;
}

.video-node-params-label {
    min-width: 0;
    flex: 1 1 auto;
}

.video-node-audio-state {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    color: var(--text-secondary);
}

.video-node-audio-state svg {
    width: 14px;
    height: 14px;
}

.video-node-params:hover .video-node-audio-state {
    color: var(--text-primary);
}

.video-node-model {
    width: 142px;
    flex: 0 0 142px;
    justify-content: flex-start;
}

.video-node-model-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-node-model-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    z-index: 70;
    width: 190px;
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(16, 20, 25, 0.98);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    backdrop-filter: blur(12px);
}

body[data-theme="light"] .video-node-model-menu {
    background: #ffffff;
    border-color: rgba(19, 24, 32, 0.12);
    box-shadow: 0 12px 32px rgba(18, 24, 32, 0.14);
}

.video-node-model-toggle.open .video-node-model-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.video-node-model-option {
    width: 100%;
    display: flex;
    min-height: 34px;
    padding: 0 10px;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 550;
    text-align: left;
}

.video-node-panel {
    width: clamp(360px, calc(var(--image-node-frame-width, 480px) + 80px), 560px);
}

.video-node-model-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.video-node-model-option.active,
.video-node-model-option.is-active {
    background: rgba(255, 168, 79, 0.18);
    color: var(--accent);
}

.video-workflow-model-option-main {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: inherit;
}

.video-workflow-model-caret {
    display: inline-grid;
    place-items: center;
    width: 10px;
    height: 10px;
    color: var(--text-tertiary);
    font-size: 10px;
    line-height: 1;
    transition: transform 0.16s ease;
}

.video-node-model-toggle.open .video-workflow-model-caret {
    transform: rotate(180deg);
}

.video-node-params-menu {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 22000;
    width: 254px;
    max-height: none;
    overflow: visible;
    padding: 10px;
    border: 1px solid var(--panel-line);
    border-radius: 11px;
    background: #11151b;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    backdrop-filter: none;
}

body[data-theme="light"] .video-node-params-menu {
    background: #ffffff;
    border-color: rgba(19, 24, 32, 0.12);
    box-shadow: 0 18px 42px rgba(18, 24, 32, 0.16);
}

.video-node-params-toggle.open .video-node-params-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.video-workflow-config-section + .video-workflow-config-section {
    margin-top: 8px;
}

.video-workflow-config-title {
    margin-bottom: 6px;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 650;
}

.video-workflow-config-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.video-node-mode-row,
.video-node-resolution-row,
.video-node-audio-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-node-mode-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-node-audio-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-node-count-row {
    display: flex;
}

.video-node-duration-row {
    width: 100%;
    height: 31px;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    cursor: grab;
    touch-action: pan-x;
    user-select: none;
    padding: 2px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.video-node-duration-row::-webkit-scrollbar {
    display: none;
}

.video-node-duration-row.is-dragging {
    cursor: grabbing;
}

.video-node-duration-row:not(.can-scroll-left) {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
}

.video-node-duration-row:not(.can-scroll-right) {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 100%);
}

.video-node-duration-row:not(.can-scroll-left):not(.can-scroll-right) {
    -webkit-mask-image: none;
    mask-image: none;
}

.video-node-duration-row .video-node-param-option {
    flex: 0 0 41px;
    min-width: 41px;
    height: 25px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(243, 245, 250, 0.58);
}

.video-node-duration-row .video-node-param-option:hover,
.video-node-duration-row .video-node-param-option.active,
.video-node-duration-row .video-node-param-option.is-active {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.video-node-expanded-config {
    display: none;
}

.video-node-ratio-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.video-node-param-option {
    min-width: 0;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid var(--panel-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 650;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.video-node-param-option:hover,
.video-node-param-option.active,
.video-node-param-option.is-active {
    border-color: rgba(255, 168, 79, 0.4);
    background: rgba(255, 168, 79, 0.16);
    color: #fff;
}

body[data-theme="light"] .video-node-param-option {
    border-color: rgba(19, 24, 32, 0.08);
    background: rgba(19, 24, 32, 0.04);
    color: var(--text-primary);
}

body[data-theme="light"] .video-node-param-option:hover,
body[data-theme="light"] .video-node-param-option.active,
body[data-theme="light"] .video-node-param-option.is-active {
    border-color: rgba(255, 168, 79, 0.48);
    background: rgba(255, 168, 79, 0.18);
    color: var(--text-primary);
}

.video-node-count {
    height: 24px;
    gap: 4px;
    padding: 0 7px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: 0;
}

.video-node-count:hover,
.video-node-count.is-open {
    background: transparent;
    color: var(--text-primary);
}

.video-node-count-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.video-node-count-toggle.open {
    z-index: 70;
}

.video-node-count-label {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

.video-node-count-caret {
    width: 9px;
    height: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: transform 0.16s ease;
}

.video-node-count-caret svg {
    width: 9px;
    height: 9px;
}

.video-node-count-toggle.open .video-node-count-caret {
    transform: rotate(180deg);
}

.video-node-count-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 80;
    width: 76px;
    padding: 5px;
    border: 1px solid var(--panel-line);
    border-radius: 11px;
    background: #11151b;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.video-node-count-toggle.open .video-node-count-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.video-node-count-menu .video-node-count-option {
    width: 100%;
    height: 28px;
    min-width: 0;
    font-size: 11px;
    font-weight: 500;
}

.video-node-count-menu .video-node-count-option.active,
.video-node-count-menu .video-node-count-option.is-active {
    border-color: var(--panel-line);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body[data-theme="light"] .video-node-count-menu {
    background: #ffffff;
    border-color: rgba(19, 24, 32, 0.12);
    box-shadow: 0 18px 42px rgba(18, 24, 32, 0.16);
}

.video-node-card .node-port {
    opacity: 0;
    pointer-events: none;
    border-color: var(--node-port-border);
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    cursor: crosshair;
    z-index: 20;
}

.video-node-card.selected .node-port,
.video-node-card.is-active-area .node-port,
.video-node-card:hover .node-port {
    opacity: 1;
    pointer-events: auto;
}

.video-node-card .node-port {
    top: calc(var(--image-node-frame-height, 270px) / 2);
}

.video-node-card .node-port.left {
    left: -40px;
    width: 16px;
    height: 16px;
    border-width: 1.5px;
}

.video-node-card .node-port.left::after {
    display: none;
}

.video-node-card .node-port.left:hover,
.video-node-card .node-port.left.snap {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 12px var(--node-port-glow);
}

.video-node-card .node-port.right {
    right: -58px;
    width: 45px;
    height: 45px;
    border: 1.5px solid var(--node-port-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--node-port-bg);
    color: var(--node-port-fg);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(255, 168, 79, 0.14), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.video-node-card .node-port.right::after {
    content: "+";
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}

.video-node-card .node-port.right:hover {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
    transform: translateY(-50%) scale(1.08);
}

.video-node-card.selected .node-port.right:hover {
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.placeholder-node .node-port.right {
    --port-follow-x: 0px;
    --port-follow-y: 0px;
    transform: translate(var(--port-follow-x), calc(-50% + var(--port-follow-y)));
}

.placeholder-node .node-port.right:hover,
.placeholder-node .node-port.right.is-following {
    transform: translate(var(--port-follow-x), calc(-50% + var(--port-follow-y))) scale(1.08);
}

.placeholder-node.connection-target-highlight .node-port.left,
.placeholder-node.connection-target-highlight .agent-node-section-port,
.placeholder-node .node-port.left.snap-target,
.placeholder-node .agent-node-section-port.snap-target {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 12px var(--node-port-glow);
}

.placeholder-node.connection-source .node-port.right,
.canvas-content.is-connecting .placeholder-node .node-port.right.is-following {
    border-color: var(--node-port-hover-border);
    background: var(--node-port-hover-bg);
    color: var(--node-port-hover-fg);
    box-shadow: 0 0 0 3px var(--node-port-halo), 0 0 22px var(--node-port-glow), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.canvas-content.is-connecting .placeholder-node .node-port.left,
.canvas-content.is-connecting .placeholder-node .agent-node-section-port {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.text-node-panel.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: min(960px, 92vw) !important;
    height: min(640px, 86vh);
    max-width: 960px;
    margin: 0 !important;
    padding: 16px 20px 14px !important;
    display: flex !important;
    flex-direction: column;
    gap: 8px !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1001;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: var(--node-bg);
    border-color: var(--panel-line);
    box-shadow: var(--shadow-lg);
}

.text-node-panel.expanded .text-node-input {
    flex: 1;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.65;
    padding: 4px 42px 8px 4px;
}

.text-node-panel.expanded .image-node-quick {
    min-height: 32px;
    padding: 2px 48px 4px 2px;
    row-gap: 8px;
}

.text-node-panel.expanded .image-node-reference-strip {
    min-height: 44px;
    align-items: center;
    row-gap: 8px;
}

.text-node-panel.expanded .text-node-bottom {
    margin-top: auto;
    min-height: 32px;
    gap: 8px;
    padding: 8px 2px 0;
    border-top: 0;
    align-items: center;
}

.text-node-panel.expanded .text-node-model {
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
}

.text-node-panel.expanded .text-node-model .model-chip-icon {
    color: var(--accent);
}

.text-node-panel.expanded .text-node-model-menu {
    min-width: 220px;
}

.text-node-panel.expanded .text-node-preset,
.text-node-panel.expanded .text-node-skill {
    min-width: 64px;
    height: 28px;
    gap: 5px;
    padding: 0 11px;
    justify-content: center;
    border-radius: 8px;
}

.text-node-panel.expanded .text-node-mini-action {
    width: 26px;
    height: 26px;
    justify-content: center;
}

.text-node-panel.expanded .text-node-energy {
    height: auto;
    min-height: 28px;
    gap: 4px;
    padding: 2px 4px 2px 8px;
}

.text-node-panel.expanded .text-node-energy button {
    width: 24px;
    height: 24px;
}

.text-node-panel.expanded .text-node-expand {
    top: 14px;
    right: 14px;
}

.text-node-panel.expanded .text-node-expand svg {
    transform: rotate(180deg);
}

.video-node-panel.expanded .video-node-input {
    flex: 1;
    height: auto;
    min-height: 120px;
    max-height: none;
}

.video-node-panel.expanded .video-node-expanded-config {
    width: min(254px, 100%);
    display: none;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    padding: 10px;
    border: 1px solid var(--panel-line);
    border-radius: 11px;
    background: #11151b;
    box-shadow: none;
}

.video-node-panel.expanded.show-expanded-config .video-node-expanded-config {
    display: block;
}

.video-node-panel.expanded .video-node-bottom {
    position: relative;
    z-index: 2;
}

.video-node-panel.expanded .video-node-model-toggle.open,
.video-node-panel.expanded .video-node-count-toggle.open {
    z-index: 80;
}

.video-node-panel.expanded .video-workflow-config-section + .video-workflow-config-section {
    margin-top: 10px;
}

.video-node-panel.expanded .video-workflow-config-title {
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.video-node-panel.expanded .video-node-mode-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-node-panel.expanded .video-node-duration-row {
    width: 100%;
}

.video-node-panel.expanded .video-node-count {
    min-width: 0;
    height: 24px;
    font-size: 11.5px;
    font-weight: 500;
}

body[data-theme="light"] .video-node-panel.expanded .video-node-expanded-config {
    background: #ffffff;
}

.text-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(11, 14, 19, 0.55);
    backdrop-filter: blur(10px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.text-panel-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

body[data-theme="light"] .text-panel-backdrop {
    background: rgba(245, 245, 245, 0.7);
}

.text-node-card[data-view-state="content"] {
    width: 440px;
    min-height: 280px;
}

.text-node-card[data-view-state="content"] .node-minimal-label {
    left: 4px;
    top: -28px;
}

.text-node-card[data-view-state="content"] .text-node-edit-card {
    height: 100%;
    min-height: 0;
    border-radius: 18px;
}

.text-node-card[data-view-state="content"] .text-rich-editor {
    height: 100%;
    min-height: 0;
}

.text-node-card[data-view-state="content"] .edit-canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 28px 32px 32px 32px;
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 15.5px;
    line-height: 1.58;
    font-weight: 500;
    letter-spacing: 0;
}

.text-node-card[data-view-state="content"] .text-markdown-preview {
    padding: 28px 32px 32px 32px;
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 15.5px;
    line-height: 1.58;
    font-weight: 500;
    letter-spacing: 0;
}

.text-node-card[data-view-state="content"]:not(.is-input-active) .edit-canvas {
    cursor: grab;
    caret-color: transparent;
    user-select: none;
}

.text-node-card[data-view-state="content"].is-input-active .edit-canvas {
    cursor: text;
    caret-color: var(--text-primary);
    user-select: text;
}

.text-node-card[data-view-state="content"] .node-port.left {
    left: -40px;
    width: 14px;
    height: 14px;
}

.text-node-card[data-view-state="content"] .node-port.right {
    right: -58px;
}

.text-fs-modal,
.agent-fs-modal,
.text-preset-modal,
.text-custom-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 6vw;
    background: rgba(11, 14, 19, 0.55);
    backdrop-filter: blur(12px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.text-fs-modal.show,
.agent-fs-modal.show,
.text-preset-modal.show,
.text-custom-modal.show {
    opacity: 1;
    pointer-events: auto;
}

body[data-theme="light"] .text-fs-modal,
body[data-theme="light"] .agent-fs-modal,
body[data-theme="light"] .text-preset-modal,
body[data-theme="light"] .text-custom-modal {
    background: rgba(245, 245, 245, 0.7);
}

.text-fs-card {
    width: min(920px, 100%);
    height: min(720px, 100%);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--panel-line);
    border-radius: 18px;
    background: var(--node-bg);
    transform: scale(0.97) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.text-fs-modal.show .text-fs-card,
.agent-fs-modal.show .text-fs-card {
    transform: scale(1) translateY(0);
}

.text-fs-head {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.text-fs-toolbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.text-fs-close {
    position: absolute;
    right: 14px;
    top: 12px;
}

.text-fs-tool,
.text-fs-close {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 650;
}

.text-fs-tool:hover,
.text-fs-tool.active,
.text-fs-close:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.text-fs-tool svg,
.text-fs-close svg {
    width: 14px;
    height: 14px;
}

.text-fs-tool sub {
    font-size: 0.65em;
}

.text-fs-divider {
    width: 1px;
    height: 14px;
    margin: 0 6px;
    background: var(--panel-line);
}

.text-fs-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 22px;
}

.text-fs-editor {
    flex: 1;
    min-height: 100%;
}

.text-fs-editor .text-markdown-preview {
    padding: 4px 4px 24px;
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

.text-fs-textarea {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    min-height: 100%;
    display: block;
    overflow-y: auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    caret-color: var(--text-primary);
    padding: 4px 4px 24px;
    font-family: "Manrope", "Inter var", "Inter", sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

.text-preset-card {
    width: min(680px, 92vw);
    max-height: min(640px, 82vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 18px;
    background: var(--node-bg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.97) translateY(6px);
    transition: transform 0.22s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.image-preset-card {
    width: min(720px, calc(100vw - 72px));
    min-height: min(520px, calc(100vh - 96px));
    max-height: min(760px, calc(100vh - 72px));
}

.text-preset-modal.show .text-preset-card,
.text-custom-modal.show .text-custom-card {
    transform: scale(1) translateY(0);
}

.text-preset-head,
.text-preset-foot {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 18px 22px 0;
    border-bottom: 1px solid var(--panel-line);
}

.text-preset-foot {
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--panel-line);
    border-bottom: 0;
}

.text-preset-foot[hidden] {
    display: none;
}

.text-preset-tab,
.text-preset-close,
.text-preset-cancel,
.text-preset-apply {
    min-height: 32px;
    border-radius: 999px;
    padding: 0 14px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 650;
}

.text-preset-tab {
    min-height: 38px;
    padding: 0 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
}

.text-preset-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.text-preset-close {
    margin-left: auto;
    width: 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 18px;
}

.text-preset-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}

.text-preset-grid {
    display: grid;
    gap: 12px;
}

.text-preset-item {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.text-preset-item:hover,
.text-preset-item.selected {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
}

.preset-item-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    flex: 0 0 auto;
}

.preset-item-icon svg {
    width: 14px;
    height: 14px;
}

.text-preset-item strong,
.text-preset-item small {
    display: block;
}

.preset-item-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.text-preset-item small {
    margin-top: 2px;
    color: var(--text-tertiary);
    font-size: 11px;
}

.text-preset-favorite,
.text-preset-delete {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-tertiary);
}

.text-preset-favorite:hover,
.text-preset-favorite.is-active {
    border-color: rgba(255, 168, 79, 0.32);
    background: var(--accent-soft);
    color: var(--accent);
}

.text-preset-delete:hover {
    border-color: rgba(255, 99, 99, 0.34);
    background: rgba(255, 99, 99, 0.1);
    color: #ff8f8f;
}

.text-preset-favorite svg,
.text-preset-delete svg {
    width: 13px;
    height: 13px;
}

.text-preset-favorite svg,
.text-preset-favorite svg path,
.image-preset-favorite svg,
.image-preset-favorite svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.text-preset-custom-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    align-items: start;
}

.text-preset-custom-grid .text-preset-item {
    grid-column: 1 / -1;
}

.text-preset-card-button {
    min-height: 114px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    background: transparent;
    color: var(--text-primary);
    text-align: center;
}

.text-preset-new-thumb {
    width: 150px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    border: 1.5px dashed var(--panel-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-tertiary);
    font-size: 28px;
    font-weight: 300;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.text-preset-new-card:hover .text-preset-new-thumb {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.text-preset-card-button strong {
    font-size: 12.5px;
    font-weight: 650;
}

.text-preset-empty {
    padding: 32px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.image-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    gap: 14px;
}

.image-preset-item {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: center;
}

.image-style-item {
    cursor: pointer;
}

.image-preset-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--panel-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-tertiary);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.image-style-thumb {
    min-height: 88px;
    background-size: cover;
    background-position: center;
}

.image-style-thumb.has-cover {
    border-style: solid;
}

.image-preset-thumb svg {
    width: 28px;
    height: 28px;
    opacity: 0.42;
}

.image-preset-item:hover .image-preset-thumb,
.image-preset-item.selected .image-preset-thumb {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.6);
    background: var(--accent-soft);
}

.image-preset-favorite {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(7, 10, 15, 0.46);
    color: rgba(255, 255, 255, 0.82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.image-preset-favorite:hover,
.image-preset-favorite.is-active {
    color: #fbbf24;
    background: rgba(7, 10, 15, 0.74);
}

.image-preset-favorite svg {
    width: 13px;
    height: 13px;
}

.image-preset-context-menu {
    position: fixed;
    z-index: 1300;
    min-width: 156px;
    display: grid;
    gap: 2px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(14, 17, 22, 0.98);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
}

.image-preset-context-menu.hidden {
    display: none;
}

.image-preset-context-menu button {
    width: 100%;
    min-height: 30px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(235, 239, 245, 0.9);
    font-size: 12px;
    font-weight: 620;
    text-align: left;
}

.image-preset-context-menu button:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.image-preset-context-menu button:disabled {
    color: rgba(148, 158, 172, 0.5);
    cursor: not-allowed;
}

.image-preset-context-menu button:disabled:hover {
    background: transparent;
    color: rgba(148, 158, 172, 0.5);
}

.image-preset-context-menu button.is-danger {
    color: #ffb4b4;
}

.image-preset-context-menu button.is-danger:hover {
    background: rgba(255, 99, 99, 0.12);
    color: #ffd0d0;
}

.image-preset-context-menu button.is-danger:disabled {
    color: rgba(255, 180, 180, 0.38);
}

.image-preset-item strong,
.image-preset-item small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preset-item strong {
    font-size: 12px;
    font-weight: 650;
}

.image-preset-item small {
    margin-top: -3px;
    color: var(--text-tertiary);
    font-size: 11px;
}

.image-preset-check {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 168, 79, 0.18);
    opacity: 0;
}

.image-preset-check svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    opacity: 1;
}

.image-preset-item.selected .image-preset-check {
    opacity: 1;
}

.image-preset-new-card .image-preset-thumb {
    border-style: dashed;
    font-size: 26px;
    font-weight: 300;
}

.text-preset-apply {
    background: var(--gradient-primary);
    color: #111418;
}

.text-preset-apply:disabled {
    opacity: 0.42;
}

.text-custom-card {
    width: min(560px, 94vw);
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 16px;
    background: var(--node-bg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.97);
    transition: transform 0.2s cubic-bezier(0.34, 1.5, 0.64, 1);
}

.text-custom-head,
.text-custom-foot {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-line);
}

.text-custom-head strong {
    flex: 1;
    font-size: 14.5px;
}

.text-custom-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 18px;
}

.text-custom-close:hover {
    background: var(--panel-hover);
    color: var(--text-primary);
}

.text-custom-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    padding: 20px;
}

.text-custom-label,
.text-custom-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 650;
}

.text-custom-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.5px dashed var(--panel-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-tertiary);
}

.text-custom-thumb:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.text-custom-thumb.has-cover {
    border-style: solid;
    background-size: cover;
    background-position: center;
}

.text-custom-thumb.has-cover svg,
.text-custom-thumb.has-cover span {
    opacity: 0;
}

.text-custom-thumb svg {
    width: 24px;
    height: 24px;
}

.text-custom-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.text-custom-name,
.text-custom-prompt {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--panel-line);
    border-radius: 9px;
    outline: 0;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    padding: 9px 12px 10px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
}

.text-custom-name:focus,
.text-custom-prompt:focus {
    border-color: rgba(255, 168, 79, 0.56);
}

.text-custom-prompt {
    min-height: 100px;
    resize: none;
    line-height: 1.55;
}

.text-custom-foot {
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--panel-line);
    border-bottom: 0;
    padding: 14px 20px 18px;
}

.text-custom-cancel,
.text-custom-save {
    min-height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--text-primary);
}

.text-custom-cancel {
    background: var(--panel-hover);
}

.text-custom-save {
    background: var(--gradient-primary);
    color: #111418;
    font-weight: 700;
}

.create-menu,
.node-context-menu {
    position: fixed;
    z-index: 11000;
    min-width: 244px;
    padding: 8px;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: rgba(14, 17, 23, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
    color: var(--text-primary);
    backdrop-filter: blur(18px);
}

.create-menu-title,
.node-context-menu-title {
    padding: 7px 10px 8px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
}

.create-menu-item,
.node-context-menu-item {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    font-size: 13px;
    font-weight: 500;
}

.create-menu-item:hover,
.node-context-menu-item:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.create-menu-icon,
.node-context-menu-icon {
    width: 33px;
    height: 33px;
    flex: 0 0 33px;
    display: grid;
    place-items: center;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-secondary);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.create-menu-icon svg,
.node-context-menu-icon svg {
    width: 15px;
    height: 15px;
}

.create-menu-content,
.node-context-menu-content {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.create-menu-label,
.node-context-menu-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.create-menu-key,
.node-context-menu-key {
    flex: 0 0 auto;
    min-width: 42px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 11px;
}

.create-menu-item:hover .create-menu-icon,
.create-menu-item:focus-visible .create-menu-icon {
    border-color: rgba(255, 168, 79, 0.5);
    background: var(--accent-soft);
    color: var(--accent);
}

.node-context-menu-item:hover .node-context-menu-icon {
    border-color: var(--accent);
    background: var(--accent);
    color: #111418;
}

.node-context-menu {
    min-width: 186px;
    padding: 7px;
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(11, 15, 21, 0.98);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.node-context-menu-title {
    padding: 6px 8px 7px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 650;
}

.node-context-menu-item {
    height: 32px;
    gap: 8px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
}

.node-context-menu-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
}

.node-context-menu-icon svg {
    width: 14px;
    height: 14px;
}

.node-context-menu-key {
    min-width: 0;
    height: auto;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 10px;
}

.node-context-menu-divider {
    height: 1px;
    margin: 5px 7px;
    background: rgba(255, 255, 255, 0.08);
}

.node-context-menu-item.is-danger {
    color: #ff6f7a;
}

.node-context-menu-item:hover .node-context-menu-icon {
    border-color: transparent;
    background: transparent;
    color: inherit;
}

.node-context-menu-item:hover {
    background: rgba(255, 255, 255, 0.055);
}

.node-context-menu-item.is-danger:hover {
    background: rgba(255, 111, 122, 0.1);
}

.image-preview-modal.show ~ .node-context-menu,
.video-preview-overlay.show ~ .node-context-menu {
    z-index: 23000;
}

.connection-drop-menu {
    z-index: 12040;
    min-width: 190px;
}

.connection-drop-menu .create-menu-title {
    color: var(--text-secondary);
    font-size: 12px;
}

.connection-drop-menu .create-menu-item {
    height: 42px;
}

.connection-drop-menu .create-menu-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

body[data-theme="light"] .create-menu,
body[data-theme="light"] .node-context-menu {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(18, 24, 35, 0.12);
}

.chat-float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: #111418;
    box-shadow: none;
    isolation: isolate;
    cursor: grab;
    touch-action: manipulation;
    transition: transform 0.18s ease;
}

.chat-float::before {
    content: "";
    position: absolute;
    inset: 7px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 58%, rgba(255, 168, 20, 0.42), rgba(255, 149, 0, 0.14) 54%, transparent 72%);
    filter: blur(7px);
}

.chat-float:hover {
    transform: translateY(-1px) scale(1.04);
}

.chat-float:active {
    cursor: grabbing;
    transform: translateY(0) scale(0.98);
}

.chat-float.is-user-positioned:hover,
.chat-float.is-user-positioned:active {
    transform: none;
}

.chat-float.is-dragging,
.chat-float.is-dragging:hover,
.chat-float.is-dragging:active {
    cursor: grabbing;
    transform: none;
    transition: none;
}

.assistant-mascot,
.assistant-mascot * {
    pointer-events: none;
}

.assistant-mascot {
    position: relative;
    display: block;
    width: 54px;
    height: 54px;
    overflow: visible;
    filter: drop-shadow(0 0 14px rgba(255, 168, 20, 0.58)) drop-shadow(0 7px 18px rgba(0, 0, 0, 0.34));
}

.assistant-mascot::before {
    content: "";
    position: absolute;
    inset: 2px;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 64%, rgba(255, 159, 10, 0.34) 0%, rgba(255, 175, 32, 0.16) 46%, rgba(255, 175, 32, 0) 72%);
    filter: blur(9px);
}

.assistant-mascot-body,
.assistant-mascot-eyes,
.assistant-mascot-closed-eyes {
    position: absolute;
    inset: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    object-fit: contain;
}

.assistant-mascot-body {
    z-index: 1;
    filter: saturate(0.98) contrast(0.99);
}

.assistant-mascot-eyes {
    z-index: 2;
    opacity: 1;
    animation: assistantMascotOpenEyes 9.2s ease-in-out infinite;
}

.assistant-mascot-closed-eyes {
    z-index: 3;
    opacity: 0;
    animation: assistantMascotClosedEyes 9.2s ease-in-out infinite;
}

.chat-float.is-click-blinking .assistant-mascot-eyes {
    animation: none;
    opacity: 0;
    transition: opacity 0.06s ease;
}

.chat-float.is-click-blinking .assistant-mascot-closed-eyes {
    animation: none;
    opacity: 1;
    transition: opacity 0.06s ease;
}

@keyframes assistantMascotOpenEyes {
    0%,
    14%,
    18%,
    38%,
    42%,
    62%,
    66%,
    82%,
    97%,
    100% {
        opacity: 1;
    }

    16%,
    17%,
    40%,
    41%,
    64%,
    65%,
    84%,
    95% {
        opacity: 0;
    }
}

@keyframes assistantMascotClosedEyes {
    0%,
    14%,
    18%,
    38%,
    42%,
    62%,
    66%,
    82%,
    97%,
    100% {
        opacity: 0;
    }

    16%,
    17%,
    40%,
    41%,
    64%,
    65%,
    84%,
    95% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .assistant-mascot-eyes,
    .assistant-mascot-closed-eyes {
        animation: none;
    }

    .assistant-mascot-eyes {
        opacity: 1;
    }

    .assistant-mascot-closed-eyes {
        opacity: 0;
    }
}

.placeholder-node.connection-target-highlight .text-node-preview,
.placeholder-node.connection-target-highlight .text-node-edit-card,
.placeholder-node.connection-target-highlight .image-node-preview,
.placeholder-node.connection-target-highlight .image-node-content-media,
.placeholder-node.connection-target-highlight .agent-node-shell {
    border-color: rgba(255, 190, 112, 0.72) !important;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.52), 0 0 34px rgba(255, 168, 79, 0.2) !important;
    animation: canvasConnectionTargetGlow 1.1s ease-in-out infinite;
}

@keyframes canvasConnectionTargetGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(255, 168, 79, 0));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(255, 168, 79, 0.28));
    }
}

@media (max-width: 980px) {
    .top-bar {
        padding: 0 16px;
    }

    .top-center-nav {
        gap: 18px;
    }

    .top-right {
        gap: 6px;
    }

    .top-global-actions,
    .top-credit-group {
        gap: 6px;
    }

    .top-credit-button {
        width: 36px;
        padding: 0;
        justify-content: center;
    }

    .top-credit-button span {
        display: none;
    }
}

@media (max-width: 720px) {
    .top-center-nav {
        display: none;
    }

    .top-right {
        gap: 5px;
    }

    .left-sidebar {
        left: 12px;
        width: 58px;
    }

    .tool-btn {
        width: 38px;
        height: 38px;
    }

    .center-prompt {
        top: 34%;
        width: calc(100vw - 80px);
        justify-content: center;
        white-space: normal;
    }

    .prompt-sub {
        display: none;
    }

    .action-buttons {
        top: calc(34% + 52px);
        width: calc(100vw - 96px);
    }
}

.multi-angle-editor-host {
    position: absolute;
    left: 50%;
    top: calc(100% + 22px);
    z-index: 74;
    width: min(760px, calc(100vw - 48px));
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px) scale(var(--canvas-inv-scale, 1));
    transform-origin: top center;
    transition: opacity 0.16s ease, transform 0.18s ease;
}

.multi-angle-editor-host.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(var(--canvas-inv-scale, 1));
}

.image-node-card.has-multi-angle-editor .image-node-preview,
.image-node-card.has-multi-angle-editor .image-node-content-media {
    border-color: rgba(255, 168, 79, 0.3);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 168, 79, 0.28);
}

.multi-angle-editor {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(13, 17, 22, 0.97);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px) saturate(135%);
}

body[data-theme="light"] .multi-angle-editor {
    border-color: rgba(18, 24, 35, 0.12);
    background: rgba(252, 253, 255, 0.97);
    color: rgba(18, 24, 35, 0.9);
    box-shadow: 0 18px 42px rgba(20, 25, 34, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.multi-angle-header {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.multi-angle-header h2 {
    margin: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 780;
    letter-spacing: 0;
    line-height: 1;
}

.multi-angle-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.56);
    font-size: 28px;
    line-height: 1;
}

.multi-angle-close:hover,
.multi-angle-close:focus-visible {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

body[data-theme="light"] .multi-angle-close {
    color: rgba(18, 24, 35, 0.52);
}

body[data-theme="light"] .multi-angle-close:hover,
body[data-theme="light"] .multi-angle-close:focus-visible {
    background: rgba(18, 24, 35, 0.08);
    color: rgba(18, 24, 35, 0.92);
}

.multi-angle-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.multi-angle-presets::-webkit-scrollbar {
    display: none;
}

.multi-angle-preset {
    height: 30px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    white-space: nowrap;
}

.multi-angle-preset:hover,
.multi-angle-preset.active {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body[data-theme="light"] .multi-angle-preset {
    border-color: rgba(18, 24, 35, 0.1);
    background: rgba(18, 24, 35, 0.03);
    color: rgba(18, 24, 35, 0.62);
}

body[data-theme="light"] .multi-angle-preset:hover,
body[data-theme="light"] .multi-angle-preset.active {
    border-color: rgba(18, 24, 35, 0.2);
    background: rgba(18, 24, 35, 0.1);
    color: rgba(18, 24, 35, 0.92);
}

.multi-angle-body {
    min-height: 232px;
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(260px, 1fr);
    gap: 16px;
}

.multi-angle-preview {
    min-height: 232px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    overflow: hidden;
}

body[data-theme="light"] .multi-angle-preview {
    background: rgba(18, 24, 35, 0.06);
}

.multi-angle-orbit {
    position: relative;
    width: min(210px, 74vw);
    aspect-ratio: 1;
    cursor: default;
    user-select: none;
}

.multi-angle-orbit-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 1.2;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.16s ease;
    z-index: 1;
}

body[data-theme="light"] .multi-angle-orbit-grid {
    stroke: rgba(18, 24, 35, 0.22);
}

.multi-angle-orbit.is-dragging .multi-angle-orbit-grid {
    transition: none;
}

.multi-angle-orbit-line {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.multi-angle-orbit-line line {
    stroke: rgba(255, 255, 255, 0.82);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 5 4;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.46));
}

body[data-theme="light"] .multi-angle-orbit-line line {
    stroke: rgba(18, 24, 35, 0.58);
    filter: none;
}

.multi-angle-orbit-arrow {
    position: absolute;
    color: rgba(255, 255, 255, 0.48);
    font-size: 19px;
    line-height: 1;
}

.multi-angle-orbit-arrow.top {
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
}

.multi-angle-orbit-arrow.right {
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
}

.multi-angle-orbit-arrow.bottom {
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
}

.multi-angle-orbit-arrow.left {
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
}

body[data-theme="light"] .multi-angle-orbit-arrow {
    color: rgba(18, 24, 35, 0.42);
}

.multi-angle-thumb {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 168, 79, 0.48);
    border-radius: 5px;
    background: rgba(10, 14, 18, 0.54);
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.multi-angle-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.multi-angle-preview-empty {
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    font-weight: 760;
}

.multi-angle-camera {
    position: absolute;
    z-index: 4;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 5px;
    background: rgba(25, 29, 33, 0.96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
    cursor: grab;
    touch-action: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.multi-angle-camera:hover,
.multi-angle-orbit.is-dragging .multi-angle-camera {
    border-color: rgba(255, 255, 255, 0.62);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), 0 0 0 3px rgba(255, 168, 79, 0.12);
}

.multi-angle-orbit.is-dragging,
.multi-angle-orbit.is-dragging .multi-angle-camera {
    cursor: grabbing;
}

.multi-angle-camera::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 7px;
    width: 10px;
    height: 16px;
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    background: rgba(255, 255, 255, 0.18);
}

.multi-angle-camera-lens {
    position: absolute;
    right: 5px;
    top: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff7a2f;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28) inset;
}

.multi-angle-controls {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
}

.multi-angle-range-row {
    display: grid;
    grid-template-columns: 76px minmax(120px, 1fr) 48px;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 13px;
    font-weight: 500;
}

.multi-angle-range {
    width: 100%;
    accent-color: var(--accent);
}

.multi-angle-range-value {
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    font-weight: 500;
    text-align: right;
}

body[data-theme="light"] .multi-angle-range-row {
    color: rgba(18, 24, 35, 0.62);
}

body[data-theme="light"] .multi-angle-range-value {
    color: rgba(18, 24, 35, 0.9);
}

.multi-angle-switch-row {
    display: grid;
    grid-template-columns: 76px 34px;
    align-items: center;
    gap: 10px;
    width: fit-content;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.66);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
}

.multi-angle-switch {
    position: relative;
    width: 30px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.multi-angle-switch::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.14s ease;
}

.multi-angle-switch-row[aria-pressed="true"] .multi-angle-switch {
    background: rgba(255, 168, 79, 0.82);
}

.multi-angle-switch-row[aria-pressed="true"] .multi-angle-switch::after {
    transform: translateX(14px);
}

.multi-angle-switch-row:focus-visible {
    outline: none;
}

.multi-angle-switch-row:focus-visible .multi-angle-switch {
    box-shadow: 0 0 0 3px rgba(255, 168, 79, 0.14);
}

body[data-theme="light"] .multi-angle-switch-row {
    color: rgba(18, 24, 35, 0.62);
}

.multi-angle-prompt {
    display: none;
    min-height: 80px;
    resize: vertical;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.16);
    color: rgba(255, 255, 255, 0.9);
    font: 500 13px/1.45 inherit;
    outline: none;
}

.multi-angle-editor.is-prompt-open .multi-angle-prompt {
    display: block;
}

.multi-angle-prompt:focus {
    border-color: rgba(255, 168, 79, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 168, 79, 0.1);
}

body[data-theme="light"] .multi-angle-prompt {
    border-color: rgba(18, 24, 35, 0.11);
    background: rgba(18, 24, 35, 0.04);
    color: rgba(18, 24, 35, 0.9);
}

.multi-angle-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 2px;
}

.multi-angle-reset {
    height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
    font-weight: 650;
}

.multi-angle-reset:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

body[data-theme="light"] .multi-angle-reset {
    color: rgba(18, 24, 35, 0.55);
}

body[data-theme="light"] .multi-angle-reset:hover {
    background: rgba(18, 24, 35, 0.07);
    color: rgba(18, 24, 35, 0.9);
}

.multi-angle-submit:disabled {
    opacity: 0.55;
    transform: none;
}

@media (max-width: 740px) {
    .multi-angle-editor-host {
        width: min(560px, calc(100vw - 36px));
    }

    .multi-angle-editor {
        max-height: min(680px, calc(100vh - 76px));
        overflow: auto;
    }

    .multi-angle-body {
        grid-template-columns: 1fr;
    }

    .multi-angle-preview {
        min-height: 210px;
    }
}
