﻿:root {
  color-scheme: dark;
  --bg: #101115;
  --panel: #181a20;
  --panel-2: #20232b;
  --text: #f3f4f6;
  --muted: #9aa3b2;
  --line: #2d323c;
  --accent: #4cc9a7;
  --accent-2: #66a7ff;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  display: grid;
  grid-template-columns: 260px 1fr;
  letter-spacing: 0;
}

body.entry-active {
  overflow: hidden;
}

.entry-cover {
  position: fixed;
  inset: 0;
  z-index: 4900;
  display: none;
  overflow: auto;
  background: #080a0f;
  color: #f8fafc;
}

.entry-cover.visible {
  display: block;
}

.announcement-banner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid #2c665d;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #12211f;
  color: #e8fffa;
  padding: 12px 14px;
  box-sizing: border-box;
}

.announcement-banner[hidden] {
  display: none;
}

.announcement-title {
  color: var(--accent);
  font-size: 14px;
  line-height: 1.55;
}

.announcement-body {
  min-width: 0;
  color: #d8e7e4;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.entry-announcement {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 45;
  width: min(760px, calc(100vw - 40px));
  transform: translateX(-50%);
  background: rgba(12, 27, 25, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.entry-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.entry-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0 5%, transparent 18% 80%, rgba(0, 0, 0, 0.94) 96% 100%),
    radial-gradient(circle at 50% 50%, transparent 0 32%, rgba(0, 0, 0, 0.42) 68%, rgba(0, 0, 0, 0.86) 100%);
  pointer-events: none;
}

.entry-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(8, 10, 15, 0.08), rgba(8, 10, 15, 0.48) 58%, rgba(8, 10, 15, 0.86) 100%),
    linear-gradient(180deg, rgba(8, 10, 15, 0.1), rgba(8, 10, 15, 0.82));
  pointer-events: none;
}

.entry-cinema-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #070a10;
  pointer-events: none;
}

.entry-cinema-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, transparent 0 48%, rgba(255, 255, 255, 0.07) 49%, transparent 51%);
  background-size: 3px 100%, 100% 180px;
  opacity: 0.26;
  mix-blend-mode: screen;
  animation: entry-projector 8s linear infinite;
  pointer-events: none;
}

.entry-cinema-video,
.entry-video-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.entry-cinema-video {
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  filter: saturate(0.92) contrast(1.1) brightness(0.74);
  transition: opacity 900ms ease;
}

.entry-cinema-video.ready {
  opacity: 1;
}

.entry-video-fallback {
  z-index: 0;
}

.entry-shot {
  position: absolute;
  inset: -4%;
  opacity: 0;
  transform: scale(1.08);
  animation: entry-shot-cycle 24s infinite;
  pointer-events: none;
}

.entry-shot::before,
.entry-shot::after {
  content: "";
  position: absolute;
  inset: 0;
}

.entry-shot span {
  display: none;
}

.entry-shot-1 {
  animation-delay: 0s;
  background:
    radial-gradient(ellipse at 52% 54%, rgba(255, 255, 255, 0.18) 0 2%, transparent 10%),
    linear-gradient(115deg, transparent 0 46%, rgba(97, 232, 211, 0.28) 47% 48%, transparent 50%),
    repeating-linear-gradient(102deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 18px),
    linear-gradient(135deg, #040711 0%, #0c1d2d 45%, #10141c 100%);
}

.entry-shot-1::before {
  background:
    radial-gradient(circle at 70% 38%, rgba(145, 206, 255, 0.44) 0 2%, transparent 15%),
    linear-gradient(90deg, rgba(4, 8, 14, 0.7) 0 18%, transparent 38% 62%, rgba(4, 8, 14, 0.76) 82% 100%),
    linear-gradient(90deg, transparent 0 60%, rgba(8, 10, 15, 0.72) 74% 100%);
}

.entry-shot-2 {
  animation-delay: 6s;
  background:
    linear-gradient(0deg, rgba(8, 10, 15, 0.96) 0 23%, transparent 24%),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(245, 197, 66, 0.25) 59px 60px, transparent 61px 140px),
    radial-gradient(ellipse at 70% 42%, rgba(255, 238, 181, 0.28), transparent 26%),
    linear-gradient(115deg, #0a1020 0%, #203044 45%, #6a4b31 100%);
}

.entry-shot-2::before {
  clip-path: polygon(0 66%, 100% 42%, 100% 64%, 0 88%);
  background: rgba(245, 197, 66, 0.2);
  filter: blur(22px);
}

.entry-shot-3 {
  animation-delay: 12s;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 12%, transparent 12% 18%, rgba(255, 255, 255, 0.08) 18% 30%, transparent 30%),
    radial-gradient(ellipse at 42% 50%, rgba(209, 226, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #070910 0%, #1b1f2c 44%, #293238 100%);
}

.entry-shot-3::before {
  clip-path: polygon(68% 0, 100% 0, 86% 100%, 48% 100%);
  background: rgba(196, 224, 255, 0.18);
  filter: blur(16px);
}

.entry-shot-4 {
  animation-delay: 18s;
  background:
    radial-gradient(circle at 76% 44%, rgba(255, 255, 255, 0.52) 0 2%, rgba(245, 197, 66, 0.32) 4%, transparent 19%),
    radial-gradient(ellipse at 50% 72%, rgba(23, 37, 84, 0.4), transparent 28%),
    linear-gradient(155deg, #05070d 0%, #132032 52%, #2d1f19 100%);
}

.entry-shot-4::before {
  clip-path: polygon(58% 0, 100% 0, 100% 100%, 72% 100%);
  background: rgba(245, 197, 66, 0.16);
  filter: blur(30px);
}

.entry-film-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, 0.04) 3px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  animation: entry-grain 1.4s steps(2) infinite;
  pointer-events: none;
}

@keyframes entry-shot-cycle {
  0% {
    opacity: 0;
    transform: scale(1.08) translateX(0);
  }
  8%,
  25% {
    opacity: 1;
  }
  33% {
    opacity: 0;
    transform: scale(1.02) translateX(-2%);
  }
  100% {
    opacity: 0;
    transform: scale(1.08) translateX(0);
  }
}

@keyframes entry-grain {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-1%, 1%);
  }
}

@keyframes entry-projector {
  0% {
    transform: translateY(-4%);
  }
  100% {
    transform: translateY(4%);
  }
}

.entry-nav,
.entry-hero,
.entry-login-card {
  position: relative;
  z-index: 10;
}

.entry-nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 30;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.1);
  background: rgba(6, 8, 12, 0.42);
  backdrop-filter: blur(12px);
}

.entry-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-brand img,
.entry-login-mark img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.entry-brand strong,
.entry-login-card h2 {
  display: block;
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.entry-brand span,
.entry-login-card p,
.entry-node small {
  color: #aab6c8;
}

.entry-nav-button,
.entry-primary,
.entry-secondary {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  color: #f8fafc;
  background: rgba(20, 24, 33, 0.78);
  cursor: pointer;
}

.entry-primary {
  border-color: rgba(76, 201, 167, 0.72);
  background: #4cc9a7;
  color: #06120f;
  font-weight: 800;
}

.entry-secondary:hover,
.entry-nav-button:hover {
  border-color: rgba(102, 167, 255, 0.64);
  color: #dbeafe;
}

.entry-hero {
  min-height: 100vh;
  display: flex;
  place-items: center;
  justify-content: center;
  align-items: center;
  padding: 92px clamp(22px, 5vw, 84px) 76px;
  text-align: center;
}

.entry-copy {
  max-width: 860px;
  margin: 0 auto;
}

.entry-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(76, 201, 167, 0.28);
  border-radius: 999px;
  color: #8ee8cd;
  background: rgba(76, 201, 167, 0.1);
  font-size: 13px;
}

.entry-copy h1 {
  margin: 22px 0 12px;
  font-size: clamp(72px, 9vw, 138px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 18px 70px rgba(0, 0, 0, 0.62);
}

.entry-copy p {
  margin: 0;
  color: rgba(241, 245, 249, 0.86);
  font-size: clamp(18px, 1.55vw, 24px);
  line-height: 1.75;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.58);
}

.entry-actions,
.entry-login-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.entry-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 50%;
  color: rgba(248, 250, 252, 0.86);
  background: rgba(8, 10, 15, 0.36);
  transform: translateX(-50%);
  animation: entry-cue 1.8s ease-in-out infinite;
}

@keyframes entry-cue {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(7px);
  }
}

.entry-login-screen {
  display: grid;
  place-items: center;
  padding: 32px;
}

.entry-login-card {
  width: min(620px, 100%);
  padding: 34px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(18, 23, 32, 0.92);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.entry-login-mark {
  margin-bottom: 16px;
}

.entry-login-card h2 {
  margin-top: 16px;
  font-size: 36px;
}

.entry-login-card p {
  margin: 12px 0 0;
  line-height: 1.7;
}

.entry-login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.entry-login-field {
  display: grid;
  gap: 8px;
  color: #aab6c8;
}

.entry-login-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  padding: 12px 14px;
  outline: none;
}

.entry-login-input:focus {
  border-color: rgba(76, 201, 167, 0.78);
  box-shadow: 0 0 0 3px rgba(76, 201, 167, 0.12);
}

.entry-remember-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #cbd5e1;
  user-select: none;
}

.entry-remember-row input {
  width: 16px;
  height: 16px;
  accent-color: #4cc9a7;
}

.entry-login-form .entry-login-actions {
  margin-top: 6px;
}

.entry-login-message {
  min-height: 20px;
  color: #8ee8cd;
  font-size: 13px;
}

.entry-login-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.entry-login-status div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: #111827;
}

.entry-login-status span {
  display: block;
  color: #8fa1b8;
  font-size: 13px;
}

.entry-login-status strong {
  display: block;
  margin-top: 10px;
  color: #f8fafc;
  word-break: break-all;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  background: #14161b;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #07110e;
  font-weight: 800;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p,
.topbar p,
small {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.local-badge {
  margin-top: auto;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  border: 1px solid rgba(76, 201, 167, 0.22);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.local-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.main {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.main-announcement {
  margin: -2px 0 16px;
}

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  padding: 10px 14px;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #07110e;
  border-color: transparent;
  font-weight: 700;
}

.button.ghost:hover,
.button.primary:hover {
  filter: brightness(1.08);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.pill {
  border: 1px solid rgba(76, 201, 167, 0.3);
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.pill.muted {
  color: var(--muted);
  border-color: var(--line);
  background: #15171c;
}

.pill.status-completed {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.1);
}

.pill.status-submitted,
.pill.status-running,
.pill.status-queued {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.34);
  background: rgba(59, 130, 246, 0.1);
}

.pill.status-failed {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.12);
}

.pill.status-cloud_pending {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(245, 158, 11, 0.12);
}

.backend-status,
.compact-grid {
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.backend-status strong {
  color: var(--text);
}

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

.preset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #13151a;
  cursor: pointer;
  text-align: left;
}

.preset.selected {
  border-color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
}

.preset span {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

body.canvas-mode .status-grid {
  display: none;
}

body.canvas-mode .main {
  padding: 18px;
}

body.canvas-mode .topbar {
  margin-bottom: 12px;
}

.canvas-shell {
  min-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121821;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: 58px 1fr;
}

.canvas-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #1b2330;
}

.canvas-project,
.canvas-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-project span,
.zoom-value {
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.danger-icon {
  color: #fda4a4;
}

.danger-icon:hover {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.canvas-stage {
  position: relative;
  min-height: calc(100vh - 170px);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  background-color: #0d1422;
  background-image:
    radial-gradient(circle, rgba(139, 157, 184, 0.32) 1px, transparent 1px),
    linear-gradient(rgba(102, 167, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 167, 255, 0.04) 1px, transparent 1px);
  background-size: 18px 18px, 90px 90px, 90px 90px;
}

.canvas-pagebar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  width: min(840px, calc(100% - 360px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(51, 65, 86, 0.82);
  border-radius: 8px;
  background: rgba(17, 24, 35, 0.88);
  box-shadow: var(--shadow);
}

.canvas-page-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.canvas-page-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 180px;
  border: 1px solid rgba(51, 65, 86, 0.95);
  border-radius: 999px;
  background: #111823;
}

.canvas-page-tab-item.active {
  border-color: transparent;
  background: var(--accent);
}

.canvas-page-tab {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: 7px 8px 7px 11px;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-page-tab.active {
  color: #06130f;
  background: transparent;
  font-weight: 700;
}

.canvas-page-close {
  width: 24px;
  height: 24px;
  margin-right: 5px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 999px;
  color: #fda4a4;
  background: rgba(248, 113, 113, 0.08);
  line-height: 1;
  cursor: pointer;
  font-weight: 800;
}

.canvas-page-tab-item.active .canvas-page-close {
  color: #7f1d1d;
  background: rgba(255, 255, 255, 0.44);
}

.canvas-page-close:hover {
  color: #ffffff;
  background: rgba(248, 113, 113, 0.72);
}

.prompt-library-list,
.style-library-list,
.prompts-layout {
  display: grid;
  gap: 16px;
}

.prompts-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.prompt-library-list {
  max-height: 680px;
  overflow: auto;
}

.prompt-template-grid,
.style-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.style-preview {
  width: 100%;
  height: 118px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: block;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.82);
}

.style-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.style-preview img[data-style-id="painted-modern-realistic-sketch"] {
  filter: grayscale(0.5) sepia(0.12) saturate(0.82) contrast(1.12) brightness(1.04);
}

.prompt-template-card.selected,
.style-card.selected {
  border-color: var(--accent);
  background: rgba(76, 201, 167, 0.12);
}

.style-card em {
  width: fit-content;
  display: inline-flex;
  margin-top: 2px;
  border: 1px solid rgba(102, 167, 255, 0.28);
  border-radius: 999px;
  color: #9bd7ff;
  background: rgba(102, 167, 255, 0.09);
  padding: 3px 8px;
  font-size: 11px;
  font-style: normal;
}

.prompt-preview-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(51, 65, 86, 0.9);
  border-radius: 8px;
  padding: 12px;
  background: #111823;
}

.prompt-preview-card p,
.prompt-preview-card small {
  margin: 0;
  color: var(--muted);
}

.prompt-preview-block textarea {
  min-height: 100px;
  resize: vertical;
}

.prompt-preview-block .button-row {
  display: flex;
  flex-wrap: wrap;
}

.prompt-preview-block .button-row .button {
  flex: 1 1 180px;
}

.resource-link-tip {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(76, 201, 167, 0.35);
  border-radius: 8px;
  background: rgba(76, 201, 167, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.prompt-node-head,
.prompt-node-tools,
.node-inline-actions,
.generation-panel-head .heading-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.prompt-node-tools {
  flex-wrap: wrap;
  justify-content: stretch;
}

.node-generation-panel .prompt-node-tools {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(11, 15, 22, 0.34);
  padding: 8px;
}

.node-prompt-template {
  min-width: 0;
  flex: 1 1 180px;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11px;
}

.camera-motion-panel {
  display: grid;
  gap: 8px;
}

.camera-motion-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.camera-motion-select {
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11px;
}

.camera-motion-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.node-resource-button,
.node-open-style-hub,
.node-open-prompt-hub,
.role-lock-apply,
.role-lock-use-manual,
.node-apply-prompt-template,
.camera-motion-infer,
.director-board-infer,
.panorama360-infer {
  border: 1px solid rgba(76, 201, 167, 0.35);
  border-radius: 7px;
  padding: 5px 10px;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  cursor: pointer;
  font-size: 12px;
}

.node-open-prompt-hub,
.role-lock-apply,
.role-lock-use-manual,
.node-apply-prompt-template,
.camera-motion-infer,
.director-board-infer,
.panorama360-infer {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.node-apply-prompt-template,
.camera-motion-infer,
.director-board-infer,
.panorama360-infer {
  color: #07110e;
  border-color: transparent;
  background: var(--accent);
  font-weight: 700;
}

.node-apply-prompt-template.primary-template-action {
  flex: 0 0 auto;
  min-width: 96px;
  box-shadow: 0 0 0 1px rgba(76, 201, 167, 0.18), 0 8px 18px rgba(76, 201, 167, 0.12);
}

.node-resource-button:hover,
.node-open-style-hub:hover,
.node-open-prompt-hub:hover,
.role-lock-apply:hover,
.role-lock-use-manual:hover,
.node-apply-prompt-template:hover,
.camera-motion-infer:hover,
.director-board-infer:hover,
.panorama360-infer:hover {
  filter: brightness(1.08);
}

.director-board-panel,
.panorama360-panel {
  display: grid;
  gap: 10px;
}

.director-board-tools,
.panorama360-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 7px;
  align-items: center;
}

.director-control,
.panorama360-control,
.director-actor-field,
.director-scene-input {
  min-width: 0;
  min-height: 30px;
  border: 1px solid #334156;
  border-radius: 7px;
  color: var(--text);
  background: #111823;
  padding: 6px 8px;
  font-size: 11px;
}

.director-stage {
  position: relative;
  height: 130px;
  overflow: hidden;
  border: 1px solid rgba(102, 167, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 20, 32, 0.88), rgba(20, 33, 49, 0.86)),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(148, 163, 184, 0.08) 49px 50px);
}

.director-stage::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 28px;
  height: 1px;
  background: rgba(148, 163, 184, 0.24);
}

.director-axis-line {
  position: absolute;
  left: 50%;
  top: 14px;
  bottom: 20px;
  border-left: 1px dashed rgba(96, 165, 250, 0.42);
}

.director-actor-chip {
  position: absolute;
  width: 92px;
  min-height: 42px;
  display: grid;
  gap: 2px;
  place-items: center;
  border: 1px solid rgba(76, 201, 167, 0.38);
  border-radius: 8px;
  background: rgba(76, 201, 167, 0.11);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  padding: 6px;
  text-align: center;
}

.director-actor-chip b,
.director-actor-chip small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.director-actor-chip b {
  color: #ecfff9;
  font-size: 12px;
}

.director-actor-chip small {
  color: #a9bad4;
  font-size: 9px;
}

.director-actor-chip.position-1 { left: 48%; top: 44%; transform: translate(-50%, -50%); }
.director-actor-chip.position-2 { left: 18%; top: 48%; transform: translate(-50%, -50%); }
.director-actor-chip.position-3 { left: 78%; top: 48%; transform: translate(-50%, -50%); }
.director-actor-chip.position-4 { left: 32%; top: 74%; transform: translate(-50%, -50%); }
.director-actor-chip.position-5 { left: 66%; top: 74%; transform: translate(-50%, -50%); }
.director-actor-chip.position-6 { left: 50%; top: 20%; transform: translate(-50%, -50%); }

.director-actor-list {
  display: grid;
  gap: 7px;
}

.director-actor-row {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 0.72fr);
  gap: 6px;
}

.director-actor-row .wide {
  grid-column: 1 / -1;
}

.director-board-body {
  min-height: 126px;
  max-height: 220px;
}

.director-ref-options .director-ref-option {
  cursor: default;
}

.panorama360-orbit {
  position: relative;
  height: 116px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 58%, rgba(76, 201, 167, 0.18), rgba(13, 20, 32, 0.94) 58%);
}

.panorama360-orbit span {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 78%;
  height: 34px;
  border: 1px dashed rgba(96, 165, 250, 0.42);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--orbit-rotate, 0deg));
}

.panorama360-orbit span:nth-child(2) {
  --orbit-rotate: 60deg;
}

.panorama360-orbit span:nth-child(3) {
  --orbit-rotate: -60deg;
}

.panorama360-orbit b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ecfff9;
  font-size: 18px;
  letter-spacing: 0;
}

.panorama360-body {
  min-height: 126px;
  max-height: 220px;
}

.canvas-stage.linking {
  cursor: crosshair;
}

.canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 2200px;
  height: 1100px;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-links {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: auto;
  z-index: 0;
}

.canvas-scheduler-guide {
  fill: none;
  stroke: rgba(245, 158, 11, 0.48);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 8 12;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.2));
}

.canvas-scheduler-guide.completed {
  stroke: rgba(76, 201, 167, 0.62);
}

.canvas-scheduler-guide.failed {
  stroke: rgba(248, 113, 113, 0.72);
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.38));
}

.canvas-scheduler-guide.running {
  stroke: url(#scheduler-guide-gradient);
  stroke-width: 3.2;
  stroke-dasharray: 10 14;
  animation: scheduler-guide-dash 0.7s linear infinite;
  filter: drop-shadow(0 0 9px rgba(125, 211, 252, 0.7));
}

.canvas-scheduler-flow {
  fill: none;
  stroke: url(#scheduler-flow-gradient);
  stroke-width: 5.2;
  stroke-linecap: round;
  stroke-dasharray: 20 42;
  animation: scheduler-flow 0.58s linear infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 11px rgba(251, 191, 36, 0.95));
}

@keyframes scheduler-guide-dash {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes scheduler-flow {
  to {
    stroke-dashoffset: -62;
  }
}

.canvas-link-hit {
  fill: none;
  stroke: rgba(255, 255, 255, 0);
  stroke-width: 18;
  pointer-events: stroke;
  cursor: pointer;
}

.canvas-link {
  fill: none;
  stroke: rgba(102, 167, 255, 0.78);
  stroke-width: 2;
  pointer-events: stroke;
  cursor: pointer;
}

.canvas-link:hover,
.canvas-link.selected {
  stroke: var(--accent);
  stroke-width: 3;
}

.canvas-link.running {
  stroke: #4cc9a7;
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(76, 201, 167, 0.55));
}

.canvas-link.running.selected {
  stroke: #7dd3fc;
  stroke-width: 3.5;
  filter: drop-shadow(0 0 9px rgba(125, 211, 252, 0.88));
}

.canvas-link-flow {
  fill: none;
  stroke: #d9fff4;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 18 34;
  stroke-dashoffset: 0;
  pointer-events: none;
  animation: canvas-link-flow 0.72s linear infinite;
  filter: drop-shadow(0 0 9px rgba(104, 255, 210, 0.96));
}

.canvas-link-flow.selected {
  stroke: #f0fbff;
  stroke-width: 5;
}

.canvas-link-pin {
  pointer-events: auto;
  cursor: grab;
}

.canvas-link-pin:active {
  cursor: grabbing;
}

.canvas-link-pin-hit {
  fill: rgba(0, 0, 0, 0);
}

.canvas-link-pin-dot {
  fill: #101827;
  stroke: #4cc9a7;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 7px rgba(76, 201, 167, 0.72));
}

.canvas-link-pin-mark {
  fill: none;
  stroke: #d9fff4;
  stroke-width: 1.4;
  stroke-linecap: round;
  pointer-events: none;
}

.canvas-link-pin.selected .canvas-link-pin-dot,
.canvas-link-pin:hover .canvas-link-pin-dot {
  fill: #15382f;
  stroke: #facc15;
  filter: drop-shadow(0 0 9px rgba(250, 204, 21, 0.78));
}

@keyframes canvas-link-flow {
  to {
    stroke-dashoffset: -52;
  }
}

.canvas-link.draft {
  stroke: rgba(76, 201, 167, 0.86);
  stroke-dasharray: 8 8;
  pointer-events: none;
}

.canvas-node {
  position: absolute;
  z-index: 1;
  width: 238px;
  min-height: 118px;
  display: grid;
  gap: 9px;
  border: 1px solid #334156;
  border-radius: 8px;
  padding: 11px;
  background: #202b3b;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  cursor: move;
}

.canvas-node[data-node-type="imageTxt2Img"],
.canvas-node[data-node-type="imageRef2Img"],
.canvas-node[data-node-type="videoTxt2Video"],
.canvas-node[data-node-type="videoImg2Video"],
.canvas-node[data-node-type="generate"] {
  width: 390px;
}

.canvas-node[data-node-type="reference"] {
  width: 356px;
}

.canvas-node[data-node-type="directorBoard"] {
  width: 470px;
}

.canvas-node[data-node-type="panorama360"] {
  width: 390px;
}

.canvas-node[data-node-type="role"] {
  width: 380px;
}

.canvas-node[data-node-type="storyboardLock"] {
  width: 420px;
}

.canvas-node[data-node-type="storyboardScheduler"] {
  width: 440px;
}

.canvas-node[data-node-locked="true"] {
  border-color: rgba(76, 201, 167, 0.44);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(76, 201, 167, 0.08);
}

.canvas-node.selected-node {
  z-index: 8;
  border-color: rgba(96, 165, 250, 0.86);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.22), 0 16px 38px rgba(0, 0, 0, 0.28);
}

.canvas-node:hover {
  z-index: 9;
}

.node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.node-head span {
  color: var(--muted);
  font-size: 11px;
}

.node-title-input {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 3px 4px;
  font-size: 12px;
  font-weight: 700;
}

.node-title-input:focus {
  border-color: rgba(102, 167, 255, 0.65);
  background: #111823;
}

.node-body {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: center;
  min-height: 58px;
}

.node-body-input {
  min-height: 62px;
  max-height: 142px;
  resize: vertical;
  border-color: rgba(51, 65, 86, 0.72);
  border-radius: 7px;
  background: #1a2432;
  color: #d9e2ee;
  padding: 7px;
  font-size: 11px;
  line-height: 1.55;
  overflow: auto;
}

.node-body-input:focus {
  border-color: rgba(102, 167, 255, 0.7);
  background: #111823;
}

.node-media-preview {
  width: 100%;
  max-height: 156px;
  display: block;
  border: 1px solid rgba(51, 65, 86, 0.78);
  border-radius: 8px;
  background: #111823;
  object-fit: cover;
}

video.node-media-preview {
  aspect-ratio: 16 / 9;
}

.result-node-shell {
  display: grid;
  gap: 9px;
  min-width: 240px;
}

.result-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-node-head strong {
  color: #dce7f5;
  font-size: 12px;
}

.result-node-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-node-empty {
  display: grid;
  gap: 5px;
  border: 1px dashed rgba(102, 167, 255, 0.36);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(17, 24, 35, 0.62);
  padding: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.result-node-empty strong {
  color: #dce7f5;
  font-size: 12px;
}

.result-node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.result-preview-button {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  border: 1px solid rgba(102, 167, 255, 0.32);
  border-radius: 8px;
  color: #e5eefb;
  background: #111823;
  padding: 0;
  cursor: zoom-in;
}

.result-preview-button:hover {
  border-color: rgba(76, 201, 167, 0.78);
}

.result-node-media {
  width: 100%;
  height: 100%;
  min-height: 92px;
  display: block;
  object-fit: cover;
  background: #070b12;
}

.result-preview-button span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border-radius: 999px;
  color: #07110e;
  background: rgba(76, 201, 167, 0.92);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
}

.result-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-download-link {
  border: 1px solid rgba(76, 201, 167, 0.32);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  padding: 5px 8px;
  font-size: 11px;
  text-decoration: none;
}

.canvas-node[data-node-type="result"] {
  width: 320px;
}

.node-audio-preview {
  width: 100%;
  height: 34px;
}

.node-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.node-generation-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 8px;
  padding: 9px;
  background: rgba(17, 24, 35, 0.72);
}

.generation-panel-head,
.compact-generation-panel {
  grid-column: 1 / -1;
}

.generation-panel-head,
.compact-generation-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.generation-panel-head strong,
.generation-summary strong {
  color: #dce7f5;
  font-size: 12px;
}

.generation-summary {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.generation-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-panel-toggle {
  border: 1px solid rgba(51, 65, 86, 0.9);
  border-radius: 7px;
  color: #dce7f5;
  background: #111823;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
}

.node-panel-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.compact-generation-panel {
  grid-template-columns: none;
  min-width: 260px;
}

.node-generation-panel label {
  gap: 4px;
  font-size: 10px;
}

.node-generation-panel .wide {
  grid-column: span 2;
}

.node-generation-panel select {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 11px;
}

.generation-warning {
  grid-column: 1 / -1;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 7px;
  color: #f8d485;
  background: rgba(251, 191, 36, 0.08);
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.5;
}

.generation-channel-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(76, 201, 167, 0.24);
  border-radius: 8px;
  color: #b9fff0;
  background: rgba(76, 201, 167, 0.07);
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.45;
}

.generation-channel-note.warning {
  border-color: rgba(251, 191, 36, 0.34);
  color: #f8d485;
  background: rgba(251, 191, 36, 0.08);
}

.node-generate-button {
  align-self: end;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #06130f;
  background: var(--accent);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.node-generate-button:hover {
  filter: brightness(1.08);
}

.node-generate-button:disabled {
  color: #8f98a7;
  background: #2a3442;
  cursor: not-allowed;
  filter: none;
}

.canvas-node[data-node-type="imageTxt2Img"],
.canvas-node[data-node-type="imageRef2Img"],
.canvas-node[data-node-type="videoTxt2Video"],
.canvas-node[data-node-type="videoImg2Video"],
.canvas-node[data-node-type="generate"] {
  width: 540px;
}

.node-generation-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border-color: rgba(76, 201, 167, 0.24);
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(39, 45, 56, 0.96), rgba(25, 29, 36, 0.97)),
    rgba(17, 24, 35, 0.92);
  cursor: default;
}

.node-generation-panel.compact-generation-panel {
  min-width: 260px;
}

.generation-prompt-preview {
  min-height: 48px;
  max-height: 78px;
  overflow: hidden;
  border-radius: 9px;
  color: #eef5ff;
  background: rgba(12, 17, 24, 0.42);
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.55;
}

.generation-prompt-editor {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(12, 17, 24, 0.42);
  padding: 9px;
}

.generation-prompt-editor label {
  display: grid;
  gap: 6px;
}

.generation-prompt-editor label span {
  color: #9bd7ff;
  font-size: 11px;
  font-weight: 700;
}

.generation-prompt-editor textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  line-height: 1.5;
}

.generation-prompt-editor small {
  color: var(--muted);
  line-height: 1.45;
}

.generation-material-bar {
  border: 1px solid rgba(76, 201, 167, 0.34);
  border-radius: 9px;
  color: #c6fff0;
  background: rgba(76, 201, 167, 0.1);
  padding: 8px 10px;
  font-size: 12px;
}

.generation-control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.generation-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: #e6edf6;
  background: rgba(15, 18, 24, 0.74);
  padding: 7px 10px;
  cursor: pointer;
}

.generation-pill.style-pill {
  min-width: 174px;
  max-width: 228px;
  justify-content: flex-start;
  padding: 5px 9px 5px 6px;
}

.generation-pill:hover,
.generation-pill.active {
  border-color: rgba(102, 167, 255, 0.62);
  background: rgba(55, 73, 101, 0.76);
}

.generation-pill .generation-pill-text {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.generation-pill .generation-pill-text > span {
  color: #9bd7ff;
}

.generation-pill strong {
  font-size: 11px;
}

.generation-pill em {
  max-width: 132px;
  overflow: hidden;
  color: #dfe9f8;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-pill-thumb {
  width: 36px;
  height: 26px;
  flex: 0 0 36px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  display: block;
  background: rgba(15, 23, 42, 0.8);
}

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

.generation-control-row .node-generate-button,
.node-generation-panel > .node-generate-button {
  justify-self: start;
  min-width: 126px;
}

#generation-picker-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

#generation-picker-layer[hidden] {
  display: none;
}

#generation-picker-layer .generation-picker {
  position: fixed;
  bottom: auto;
  z-index: 81;
  pointer-events: auto;
}

#generation-picker-layer.closing {
  pointer-events: none;
}

#generation-picker-layer.closing .generation-picker {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.generation-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% - 4px);
  z-index: 20;
  width: 100%;
  min-width: 100%;
  max-width: min(760px, 86vw);
  box-sizing: border-box;
  border: 1px solid rgba(66, 77, 93, 0.92);
  border-radius: 14px;
  background: rgba(36, 40, 49, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  padding: 10px;
}

.generation-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.generation-picker-head strong {
  font-size: 14px;
}

.generation-picker-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.generation-picker-compact {
  display: grid;
  gap: 4px;
}

.generation-choice {
  border: 0;
  border-radius: 9px;
  color: #f1f5f9;
  background: transparent;
  padding: 9px 14px;
  text-align: left;
  cursor: pointer;
}

.generation-choice:hover,
.generation-choice.selected {
  background: rgba(102, 167, 255, 0.22);
}

.generation-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.generation-option-grid.duration-grid {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
}

.duration-grid .generation-option-card {
  min-height: 54px;
  justify-content: center;
  padding: 8px 6px;
  text-align: center;
}

.duration-grid .generation-option-card small {
  margin-top: 2px;
  white-space: nowrap;
}

.generation-option-grid.count-grid {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.generation-option-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  color: #f1f5f9;
  background: rgba(15, 18, 24, 0.68);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.generation-option-card:hover,
.generation-option-card.selected {
  border-color: rgba(102, 167, 255, 0.72);
  background: rgba(49, 64, 88, 0.76);
}

.generation-option-card strong,
.generation-option-card small {
  display: block;
}

.generation-option-card strong {
  font-size: 13px;
}

.generation-option-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.generation-option-card em {
  flex: 0 0 auto;
  border-radius: 999px;
  color: #8ef6c0;
  background: rgba(76, 201, 167, 0.15);
  padding: 4px 7px;
  font-size: 10px;
  font-style: normal;
}

.generation-style-picker {
  max-height: min(760px, 84vh);
  overflow: hidden;
  padding-bottom: 12px;
}

.generation-style-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.generation-style-categories button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  padding: 7px 12px;
  cursor: pointer;
}

.generation-style-categories button.selected {
  color: #06130f;
  background: var(--accent);
}

.generation-style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-height: min(610px, 66vh);
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.generation-style-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #f8fafc;
  background: rgba(15, 18, 24, 0.76);
  padding: 0 0 10px;
  text-align: left;
  cursor: default;
  min-height: 286px;
}

.generation-style-card:hover,
.generation-style-card.selected {
  border-color: rgba(76, 201, 167, 0.78);
}

.generation-style-card .style-preview {
  width: 100%;
  height: 150px;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  border-radius: 10px 10px 0 0;
}

.generation-style-card .style-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.generation-style-card .style-preview::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px 999px 12px 12px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.72) 0 10px, transparent 11px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.12));
  opacity: 0.34;
}

.style-preview-image:not(.style-preview-missing)::before {
  content: none;
}

.style-preview-missing::after {
  content: "展示图未加载";
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  color: #d8fff4;
  background: rgba(6, 19, 15, 0.62);
  padding: 4px 8px;
  font-size: 11px;
}

.generation-style-card strong,
.generation-style-card small {
  display: block;
  margin: 7px 10px 0;
}

.generation-style-card strong {
  min-height: 40px;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.35;
}

.generation-style-card small {
  color: var(--muted);
}

.generation-style-card .style-card-meta {
  color: #7dd3fc;
  font-size: 11px;
}

.generation-style-card .style-card-desc {
  min-height: 36px;
  max-height: 36px;
  overflow: hidden;
  line-height: 1.35;
  white-space: normal;
}

.style-card-pick {
  width: 100%;
  display: block;
  border: 0;
  color: inherit;
  background: transparent;
  padding: 0 0 8px;
  text-align: left;
  cursor: pointer;
}

.style-card-pick:focus-visible {
  outline: 2px solid rgba(102, 167, 255, 0.9);
  outline-offset: -2px;
}

@media (max-width: 1180px) {
  .generation-style-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .generation-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generation-style-card .style-preview {
    height: 132px;
  }
}

.generation-style-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(15, 18, 24, 0.54);
  padding: 26px;
  text-align: center;
}

.generation-model-picker {
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.generation-model-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #f8fafc;
  background: rgba(15, 18, 24, 0.62);
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.generation-model-card:hover,
.generation-model-card.selected {
  border-color: rgba(102, 167, 255, 0.7);
  background: rgba(49, 64, 88, 0.72);
}

.generation-model-card.missing-channel {
  border-color: rgba(251, 191, 36, 0.22);
}

.model-spark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #eaf6ff;
  background: rgba(255, 255, 255, 0.08);
}

.generation-model-card strong,
.generation-model-card small {
  display: block;
}

.generation-model-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.model-tags em {
  border-radius: 999px;
  color: #9bd7ff;
  background: rgba(102, 167, 255, 0.14);
  padding: 3px 7px;
  font-size: 10px;
  font-style: normal;
}

.model-tags em.ready {
  color: #8ef6c0;
  background: rgba(76, 201, 167, 0.16);
}

.model-tags em.missing {
  color: #facc15;
  background: rgba(251, 191, 36, 0.14);
}

.generation-empty {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  color: var(--muted);
  padding: 14px;
  font-size: 12px;
}

.node-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.node-badges span {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(102, 167, 255, 0.22);
  border-radius: 999px;
  color: #cfe0f5;
  background: rgba(102, 167, 255, 0.09);
  padding: 3px 7px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(76, 201, 167, 0.28);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
}

.node-file-row input {
  max-width: 94px;
  color: var(--muted);
  font-size: 10px;
}

.node-file-name {
  min-width: 0;
  overflow: hidden;
  color: #c9d5e4;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-file-name.muted {
  color: var(--muted);
}

.node-port-stack {
  display: grid;
  align-content: center;
  gap: 9px;
  min-height: 42px;
}

.node-port-stack.empty {
  min-height: 1px;
}

.port-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
  border-radius: 999px;
  color: var(--muted);
  cursor: crosshair;
  font-size: 10px;
  padding: 2px;
  white-space: nowrap;
}

.port-row.input {
  justify-content: start;
  margin-left: -20px;
}

.port-row.output {
  justify-content: end;
  margin-right: -20px;
}

.node-port {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid #111823;
  border-radius: 50%;
  padding: 0;
  cursor: crosshair;
  box-shadow: 0 0 0 1px rgba(102, 167, 255, 0.42);
}

.node-port.input {
  background: #66a7ff;
}

.node-port.output {
  background: var(--accent);
}

.node-port:hover {
  filter: brightness(1.22);
  box-shadow: 0 0 0 3px rgba(76, 201, 167, 0.18);
}

.port-row:hover,
.port-row.active {
  color: #eaf5ff;
  background: rgba(102, 167, 255, 0.12);
}

.port-row.active .node-port {
  box-shadow: 0 0 0 4px rgba(76, 201, 167, 0.24);
}

.node-action {
  justify-self: start;
  border: 1px solid rgba(76, 201, 167, 0.35);
  border-radius: 6px;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.node-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.node-remove-button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(239, 68, 68, 0.48);
  border-radius: 7px;
  color: #fda4a4;
  background: rgba(239, 68, 68, 0.14);
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  font-weight: 800;
  opacity: 0.92;
}

.node-remove-button:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.28);
  opacity: 1;
}

.node-fixed-badge {
  border: 1px solid rgba(76, 201, 167, 0.35);
  border-radius: 999px;
  color: #bff5e6 !important;
  background: rgba(76, 201, 167, 0.1);
  padding: 3px 7px;
  font-size: 10px !important;
  font-weight: 700;
}

.node-shot-badge {
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  color: #cfe0ff !important;
  background: rgba(96, 165, 250, 0.1);
  padding: 3px 7px;
  font-size: 10px !important;
  font-weight: 700;
  white-space: nowrap;
}

.canvas-toolbar {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 7;
  transform: translateY(-50%);
  display: grid;
  gap: 12px;
  padding: 10px;
  border: 1px solid #334156;
  border-radius: 8px;
  background: rgba(28, 37, 51, 0.94);
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  -webkit-touch-callout: none;
}

.canvas-stage input,
.canvas-stage select,
.canvas-stage textarea {
  user-select: text;
  -webkit-user-select: text;
}

.canvas-toolbar *,
.tool-button {
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

.canvas-context-menu {
  position: fixed;
  z-index: 120;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid rgba(76, 201, 167, 0.32);
  border-radius: 8px;
  background: rgba(17, 24, 35, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  padding: 6px;
}

.canvas-context-menu[hidden] {
  display: none;
}

.canvas-context-title {
  max-width: 230px;
  overflow: hidden;
  color: var(--muted);
  padding: 6px 8px 8px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  color: #e5eefb;
  background: transparent;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.canvas-context-menu button:hover {
  color: #07110e;
  background: var(--accent);
}

.canvas-context-menu button.danger {
  color: #fda4a4;
}

.canvas-context-menu button.danger:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.78);
}

.canvas-context-note {
  border: 1px solid rgba(76, 201, 167, 0.22);
  border-radius: 7px;
  color: #bfeadb;
  background: rgba(76, 201, 167, 0.08);
  padding: 8px 10px;
  font-size: 12px;
}

.canvas-toolbar ::selection,
.tool-button::selection {
  background: transparent;
}

.tool-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.tool-button.active {
  color: #06130f;
  background: var(--accent);
}

.tool-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.tool-button:active,
.tool-button:focus-visible {
  outline: 1px solid rgba(76, 201, 167, 0.26);
  background: rgba(76, 201, 167, 0.08);
}

.tool-button:focus:not(:focus-visible) {
  outline: 0;
  background: transparent;
}

.tool-button.muted {
  color: #5d6878;
}

.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.canvas-library {
  position: absolute;
  left: 92px;
  top: 18px;
  z-index: 9;
  width: min(560px, calc(100% - 130px));
  max-height: calc(100% - 46px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #334156;
  border-radius: 8px;
  background: rgba(20, 27, 38, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.canvas-library[hidden] {
  display: none;
}

.library-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(51, 65, 86, 0.72);
  padding: 16px;
}

.library-head h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.library-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.library-content {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 16px;
}

.library-section {
  display: grid;
  gap: 10px;
}

.library-section h4 {
  margin: 0;
  color: #dce7f5;
  font-size: 13px;
}

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

.library-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(51, 65, 86, 0.9);
  border-radius: 8px;
  color: var(--text);
  background: #111823;
  padding: 12px;
  text-align: left;
}

button.library-card {
  cursor: pointer;
}

.library-card:hover {
  border-color: rgba(76, 201, 167, 0.62);
  background: #152030;
}

.library-card strong {
  font-size: 14px;
}

.library-card span,
.library-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.template-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.template-card {
  padding: 0;
  overflow: hidden;
}

.template-load {
  display: grid;
  gap: 7px;
  border: 0;
  color: inherit;
  background: transparent;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.template-delete {
  border: 0;
  border-top: 1px solid rgba(51, 65, 86, 0.9);
  color: #f59e9e;
  background: rgba(239, 68, 68, 0.07);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
}

.canvas-form {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.canvas-inspector,
.canvas-composer {
  pointer-events: auto;
}

.canvas-inspector {
  position: absolute;
  left: 92px;
  top: 18px;
  width: 340px;
  display: grid;
  gap: 12px;
  border: 1px solid #334156;
  border-radius: 8px;
  padding: 14px;
  background: rgba(20, 27, 38, 0.94);
  box-shadow: var(--shadow);
}

.canvas-inspector.collapsed {
  width: 154px;
  padding: 10px 12px;
  gap: 0;
}

.canvas-inspector.collapsed .panel-heading {
  margin-bottom: 0;
}

.canvas-inspector.collapsed .panel-heading h3 {
  font-size: 15px;
  white-space: nowrap;
}

.canvas-inspector.collapsed .pill,
.canvas-inspector.collapsed .inspector-body {
  display: none;
}

.inspector-toggle {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #111823;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}

.inspector-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.inspector-body {
  display: grid;
  gap: 12px;
}

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

.inspector-grid label:nth-child(1),
.inspector-grid label:nth-child(2),
.inspector-grid .wide {
  grid-column: 1 / -1;
}

.canvas-composer {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: min(740px, calc(100% - 420px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  border: 1px solid #334156;
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 22, 34, 0.96);
  box-shadow: var(--shadow);
}

.composer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.65fr);
  gap: 10px;
}

.composer-main .submit-progress {
  grid-column: 1 / -1;
}

.canvas-composer textarea {
  min-height: 48px;
  max-height: 120px;
}

.send-button {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
}

.canvas-queue {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 5;
  width: 300px;
  max-height: 184px;
  overflow: auto;
}

.canvas-queue.collapsed {
  width: 188px;
  max-height: none;
  overflow: hidden;
}

.canvas-queue.collapsed #jobs {
  display: none;
}

.job-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(51, 65, 86, 0.82);
  border-radius: 8px;
  padding: 12px;
  background: rgba(17, 24, 35, 0.74);
}

.job-card + .job-card {
  margin-top: 10px;
}

.job-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.job-card-head strong,
.job-card p,
.job-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.job-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}

.job-card small {
  color: var(--muted);
  line-height: 1.45;
}

.job-cloud-link {
  width: fit-content;
  color: #fbbf24;
  font-size: 12px;
  text-decoration: none;
}

.job-cloud-link:hover {
  text-decoration: underline;
}

.progress-line {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #0f1724;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #66a7ff);
}

.job-attempts {
  margin-top: 8px;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 7px;
  background: rgba(10, 15, 23, 0.42);
  padding: 7px 8px;
}

.job-attempts summary {
  color: #c7d8ef;
  cursor: pointer;
  font-size: 12px;
}

.job-attempt-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.job-attempt {
  display: grid;
  gap: 3px;
  border-left: 2px solid #ef6b6b;
  padding-left: 7px;
}

.job-attempt.ok {
  border-left-color: var(--accent);
}

.job-attempt strong,
.job-attempt span,
.job-attempt small {
  overflow-wrap: anywhere;
}

.job-attempt strong {
  font-size: 12px;
}

.job-attempt span,
.job-attempt small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.resource-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-tab {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  padding: 7px 9px;
  font-size: 12px;
  cursor: pointer;
}

.resource-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.asset-upload {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 8px;
  padding: 10px;
  background: rgba(17, 24, 35, 0.72);
}

.asset-upload[hidden] {
  display: none;
}

.two-col.compact {
  gap: 8px;
}

.two-col.compact input {
  padding: 8px;
  font-size: 12px;
}

.resource-list {
  display: grid;
  gap: 12px;
}

#resources .resource-page {
  display: grid;
  gap: 16px;
}

#resources .resource-page-shell {
  display: grid;
  gap: 16px;
}

#resources .resource-list {
  min-height: 320px;
}

.resource-day {
  display: grid;
  gap: 8px;
}

.resource-groups {
  display: grid;
  gap: 18px;
}

.resource-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 12px;
}

.resource-day-head span {
  color: var(--muted);
}

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

.resource-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(51, 65, 86, 0.9);
  border-radius: 8px;
  background: #131923;
  padding: 8px;
}

.resource-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 7px;
  background: #20252d;
}

.resource-preview-button {
  width: 100%;
  display: block;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.resource-preview-button:hover {
  outline: 1px solid rgba(76, 201, 167, 0.72);
}

.resource-preview.video {
  aspect-ratio: 16 / 9;
}

.resource-preview img,
.resource-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.resource-preview-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--muted);
  background: #20252d;
  padding: 10px;
  font-size: 12px;
  text-align: center;
}

.resource-preview.preview-failed img,
.resource-preview.preview-failed video {
  display: none;
}

.resource-preview.preview-failed .resource-preview-fallback,
.resource-preview-fallback.always {
  display: grid;
}

.resource-preview-link {
  margin-top: 8px;
}

.resource-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.resource-meta strong,
.resource-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meta strong {
  font-size: 12px;
}

.resource-kind-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.12);
  border: 1px solid rgba(76, 201, 167, 0.28);
  font-size: 11px;
}

.resource-meta span {
  color: var(--muted);
  font-size: 11px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-actions .button,
.resource-download {
  justify-content: center;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11px;
  text-decoration: none;
}

.resource-kind-move-wrap {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(102, 167, 255, 0.24);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(10, 16, 26, 0.58);
  padding: 3px 6px;
  font-size: 11px;
}

.resource-kind-move-wrap span {
  white-space: nowrap;
}

.resource-kind-move {
  max-width: 86px;
  border: 0;
  color: #dce7f5;
  background: transparent;
  font-size: 11px;
  outline: none;
}

.resource-error {
  color: #fca5a5;
  font-size: 11px;
  line-height: 1.4;
}

.resource-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 12, 0.62);
  padding: 28px;
}

.resource-preview-modal[hidden] {
  display: none;
}

.resource-preview-dialog {
  width: min(860px, calc(100vw - 360px));
  max-height: min(760px, calc(100vh - 210px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid #334156;
  border-radius: 8px;
  background: #111823;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.resource-preview-head,
.resource-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(51, 65, 86, 0.76);
}

.resource-preview-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.resource-preview-head p {
  max-width: 680px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-preview-media {
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #070b12;
}

.resource-preview-media img,
.resource-preview-media video {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

.resource-preview-actions {
  justify-content: flex-end;
  border-top: 1px solid rgba(51, 65, 86, 0.76);
  border-bottom: 0;
}

#reference-slot-actions[hidden] {
  display: none !important;
}

.node-text-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 12, 0.66);
  padding: 28px;
}

.node-text-editor-modal[hidden] {
  display: none;
}

.node-text-editor-dialog {
  width: min(880px, calc(100vw - 120px));
  max-height: min(760px, calc(100vh - 120px));
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  border: 1px solid #334156;
  border-radius: 8px;
  background: #111823;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.node-text-editor-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto;
  background: #070b12;
}

.node-text-editor-head,
.node-text-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(51, 65, 86, 0.76);
}

.node-text-editor-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.node-text-editor-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

#node-text-editor-input {
  width: 100%;
  min-height: 320px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #070b12;
  color: #edf5ff;
  padding: 18px;
  resize: none;
  font-size: 14px;
  line-height: 1.72;
}

.node-text-editor-role-refs {
  border-top: 1px solid rgba(51, 65, 86, 0.76);
  padding: 10px 14px 12px;
  background: #0b111b;
}

.node-text-editor-actions {
  justify-content: flex-end;
  border-top: 1px solid rgba(51, 65, 86, 0.76);
  border-bottom: 0;
}

.node-reference-shell {
  display: grid;
  gap: 8px;
  min-width: 270px;
}

.node-reference-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.reference-entity-panel {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(76, 201, 167, 0.2);
  border-radius: 8px;
  background: rgba(76, 201, 167, 0.06);
  padding: 8px;
}

.reference-entity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.reference-entity-head strong {
  color: #dce7f5;
  font-size: 12px;
}

.reference-entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reference-entity-chip,
.reference-entity-empty {
  border: 1px solid rgba(102, 167, 255, 0.24);
  border-radius: 999px;
  color: #cfe0f5;
  background: rgba(102, 167, 255, 0.08);
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1.2;
}

.reference-entity-chip.person {
  border-color: rgba(96, 165, 250, 0.42);
}

.reference-entity-chip.scene {
  border-color: rgba(76, 201, 167, 0.42);
}

.reference-entity-chip.item {
  border-color: rgba(245, 158, 11, 0.42);
}

.role-lock-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.07);
  padding: 10px;
}

.role-lock-editor-shell {
  position: relative;
  min-width: 0;
}

.role-lock-editor-shell .role-lock-body-input {
  padding-right: 38px;
}

.role-lock-expand-button {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 7px;
  color: #dce7f5;
  background: rgba(8, 13, 22, 0.76);
  cursor: pointer;
  font-size: 13px;
}

.role-lock-expand-button:hover {
  border-color: rgba(76, 201, 167, 0.5);
  color: var(--accent);
}

.role-lock-head,
.role-lock-target,
.role-lock-manual,
.role-lock-ref-head,
.role-lock-ref-list {
  display: flex;
  gap: 8px;
}

.role-lock-head {
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.role-lock-head strong {
  color: #dce7f5;
  font-size: 12px;
}

.role-lock-target {
  align-items: stretch;
}

.role-lock-preview {
  width: 72px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  overflow: hidden;
  border: 1px solid rgba(102, 167, 255, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(8, 13, 22, 0.55);
  font-size: 11px;
  text-align: center;
}

.role-lock-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.role-lock-target-meta {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 7px;
}

.role-lock-target-meta select {
  min-width: 0;
  width: 100%;
}

.role-lock-apply {
  justify-self: start;
  width: auto;
  white-space: nowrap;
}

.role-lock-manual {
  align-items: center;
}

.role-lock-manual span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.role-lock-manual select {
  flex: 0 0 72px;
  min-width: 72px;
}

.role-lock-manual input {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 7px;
  background: rgba(10, 15, 24, 0.62);
  color: var(--text);
  padding: 6px 8px;
  font-size: 11px;
}

.role-lock-use-manual {
  flex: 0 0 auto;
  white-space: nowrap;
}

.role-lock-selected-line {
  min-height: 34px;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.role-lock-selected-line b {
  color: #dce7f5;
  font-size: 12px;
}

.role-lock-ref-list {
  flex-wrap: wrap;
  align-items: center;
}

.role-lock-thumb-strip,
.node-text-editor-role-refs {
  display: grid;
  gap: 8px;
}

.role-lock-ref-head {
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.role-lock-ref-label {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #e7eef9;
  background: rgba(148, 163, 184, 0.1);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.role-lock-ref-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 62px;
}

.role-lock-ref-option {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(8, 13, 22, 0.8);
  color: #fff;
  padding: 0;
  cursor: pointer;
}

.role-lock-ref-option.selected {
  border-color: var(--role-chip-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--role-chip-color) 48%, transparent);
}

.role-lock-ref-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.role-lock-chip-index {
  position: absolute;
  left: 3px;
  top: 3px;
  z-index: 1;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--role-chip-color);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.role-lock-ref-option small {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  z-index: 1;
  overflow: hidden;
  border-radius: 5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  padding: 2px 3px;
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-lock-ref-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}

.role-lock-ref-chip,
.role-lock-muted {
  border: 1px solid rgba(76, 201, 167, 0.26);
  border-radius: 999px;
  color: #bfeadb;
  background: rgba(76, 201, 167, 0.08);
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1.2;
}

.role-lock-muted {
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--muted);
  background: rgba(148, 163, 184, 0.06);
}

.role-lock-rule {
  color: #9fb1c8;
  line-height: 1.35;
}

.role-lock-body-input {
  min-height: 104px;
  max-height: 190px;
}

.storyboard-lock-body-input {
  min-height: 150px;
  max-height: 240px;
}

.storyboard-ref-options {
  min-height: 68px;
}

.storyboard-scheduler-panel {
  display: grid;
  gap: 10px;
}

.storyboard-scheduler-body {
  min-height: 76px;
  max-height: 130px;
}

.storyboard-scheduler-summary,
.storyboard-scheduler-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.storyboard-scheduler-summary span {
  border: 1px solid rgba(76, 201, 167, 0.25);
  border-radius: 999px;
  color: #bff5e6;
  background: rgba(76, 201, 167, 0.08);
  padding: 4px 8px;
  font-size: 11px;
}

.storyboard-shot-list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.storyboard-shot-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
  border: 1px solid rgba(102, 167, 255, 0.22);
  border-radius: 8px;
  color: #dce7f5;
  background: rgba(10, 16, 26, 0.54);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.storyboard-shot-row:hover {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(96, 165, 250, 0.1);
}

.storyboard-shot-row b {
  color: #cfe0ff;
  font-size: 12px;
}

.storyboard-shot-row span {
  min-width: 0;
  overflow: hidden;
  color: #eef5ff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyboard-shot-row small {
  grid-column: 1 / 3;
  color: var(--muted);
  font-size: 10px;
}

.storyboard-score-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px auto;
  gap: 6px;
  align-items: center;
  color: #a9bad4;
  font-size: 10px;
}

.storyboard-score-row span {
  color: #c9d8eb;
  font-size: 10px;
  white-space: nowrap;
}

.storyboard-score-row i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(51, 65, 86, 0.82);
}

.storyboard-score-row b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #4cc9a7);
}

.storyboard-score-row em {
  color: #9ff0d9;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.storyboard-score-row.failed b {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.storyboard-score-row.failed em {
  color: #fda4a4;
}

.storyboard-status {
  grid-row: 1 / 3;
  grid-column: 3;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  color: #cfe0f5;
  padding: 3px 7px;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.storyboard-status.completed {
  border-color: rgba(76, 201, 167, 0.45);
  color: #9ff0d9;
}

.storyboard-status.running,
.storyboard-status.queued,
.storyboard-status.submitted,
.storyboard-status.scoring,
.storyboard-status.retrying {
  border-color: rgba(96, 165, 250, 0.48);
  color: #b7d4ff;
}

.storyboard-status.failed {
  border-color: rgba(239, 68, 68, 0.48);
  color: #fda4a4;
}

.storyboard-status.waiting {
  border-color: rgba(245, 158, 11, 0.5);
  color: #f8d58b;
}

.storyboard-run-all,
.storyboard-clear-selection {
  border: 1px solid rgba(76, 201, 167, 0.32);
  border-radius: 8px;
  color: #07110e;
  background: var(--accent);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.storyboard-clear-selection {
  color: #dce7f5;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.28);
}

.storyboard-run-all:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.storyboard-scheduler-empty {
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
  font-size: 12px;
}

.node-reference-expand {
  border: 1px solid rgba(76, 201, 167, 0.28);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  padding: 4px 7px;
  font-size: 11px;
  cursor: pointer;
}

.node-reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 78px);
  gap: 10px;
  align-items: start;
}

.reference-slot-cell {
  width: 78px;
  display: grid;
  gap: 5px;
}

.node-reference-slot {
  position: relative;
  width: 78px;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(102, 167, 255, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(10, 16, 26, 0.82);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.node-reference-slot:hover {
  border-color: rgba(76, 201, 167, 0.55);
  color: #fff;
}

.node-reference-slot.filled {
  background: rgba(13, 20, 30, 0.96);
}

.node-reference-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.node-reference-slot span {
  text-align: center;
  font-size: 10px;
  line-height: 1.2;
  color: inherit;
}

.node-reference-slot .reference-slot-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 4px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.node-reference-slot:hover .reference-slot-caption {
  opacity: 1;
  transform: translateY(0);
}

.node-reference-slot em {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #08110f;
  background: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.reference-slot-binding {
  position: absolute;
  right: 4px;
  top: 4px;
  max-width: 54px;
  overflow: hidden;
  border-radius: 999px;
  color: #07110e;
  background: rgba(76, 201, 167, 0.94);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}

.reference-binding-select {
  width: 78px;
  min-height: 26px;
  border: 1px solid rgba(51, 65, 86, 0.8);
  border-radius: 7px;
  color: #d9e2ee;
  background: #111823;
  padding: 3px 5px;
  font-size: 10px;
}

.node-reference-shell.expanded {
  min-width: 440px;
}

.node-reference-shell.expanded .node-reference-grid {
  grid-template-columns: repeat(3, 128px);
  gap: 12px;
}

.node-reference-shell.expanded .node-reference-slot {
  width: 128px;
  border-radius: 12px;
}

.node-reference-shell.expanded .reference-slot-cell,
.node-reference-shell.expanded .reference-binding-select {
  width: 128px;
}

.node-reference-shell.expanded .reference-slot-binding {
  max-width: 94px;
}

.canvas-node:has(.node-reference-shell.expanded) {
  width: 500px;
}

.button.danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fda4a4;
  background: rgba(239, 68, 68, 0.08);
}

.mini-map {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  width: 190px;
  height: 126px;
  border: 8px solid rgba(255, 255, 255, 0.92);
  background: #eef1f5;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.mini-node {
  position: absolute;
  width: 36px;
  height: 18px;
  background: #c7ccd4;
  left: 36px;
  top: 36px;
}

.mini-node.wide {
  width: 58px;
  top: 22px;
}

.mini-node.tall {
  width: 30px;
  height: 50px;
  left: 104px;
  top: 28px;
}

.mini-viewport {
  position: absolute;
  left: 18px;
  top: 16px;
  width: 92px;
  height: 62px;
  border: 2px solid rgba(76, 201, 167, 0.85);
  background: rgba(76, 201, 167, 0.08);
}

.workspace,
.providers-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
  align-items: start;
}

#providers .providers-layout {
  grid-template-columns: minmax(520px, 1fr);
}

.provider-form-hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.generator,
.settings-panel {
  display: grid;
  gap: 13px;
}

.desktop-startup-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 2px 0;
}

.desktop-startup-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.desktop-startup-copy strong {
  color: var(--text);
}

.toggle-control {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-control span {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111318;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.toggle-control span::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  border-radius: 50%;
  background: #aeb9c9;
  transition: transform 160ms ease, background-color 160ms ease;
}

.toggle-control input:checked + span {
  border-color: var(--accent);
  background: rgba(76, 201, 167, 0.25);
}

.toggle-control input:checked + span::after {
  transform: translateX(20px);
  background: var(--accent);
}

.toggle-control input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.toggle-control input:disabled + span {
  cursor: not-allowed;
  opacity: 0.48;
}

.toggle-control:has(input:disabled) {
  cursor: not-allowed;
}

.settings-update-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(76, 201, 167, 0.32);
  border-radius: 8px;
  padding: 13px;
  background: rgba(76, 201, 167, 0.08);
}

.settings-update-panel[hidden] {
  display: none;
}

.settings-update-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-update-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.update-auto-check-control {
  border-top: 1px solid rgba(135, 150, 176, 0.18);
  padding-top: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
}

.key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.masked-secret {
  -webkit-text-security: disc;
  text-security: disc;
}

.masked-secret.revealed {
  -webkit-text-security: none;
  text-security: none;
}

.api-preview {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 8px;
  padding: 10px;
  background: rgba(17, 19, 24, 0.72);
}

.api-template-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 10px;
  padding: 11px;
  background: rgba(17, 19, 24, 0.48);
}

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

.api-template-card {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: rgba(15, 18, 24, 0.75);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.api-template-card:hover,
.api-template-card.selected {
  border-color: rgba(76, 201, 167, 0.72);
  background: rgba(76, 201, 167, 0.1);
}

.api-template-card strong {
  font-size: 13px;
}

.api-template-card span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.two-col.compact {
  gap: 8px;
}

.model-channel-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(51, 65, 86, 0.72);
  border-radius: 8px;
  padding: 10px;
  background: rgba(17, 19, 24, 0.42);
}

.compact-heading {
  margin-bottom: 0;
}

.compact-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.channel-list {
  display: grid;
  gap: 8px;
}

.channel-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #13151a;
}

.channel-card.primary-channel {
  border-color: rgba(76, 201, 167, 0.55);
  background: rgba(76, 201, 167, 0.08);
}

.channel-card p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.channel-card small {
  color: var(--muted);
}

.compact-buttons .button {
  padding: 6px 9px;
  font-size: 12px;
}

.size-summary {
  color: var(--accent);
  background: rgba(76, 201, 167, 0.08);
  border: 1px solid rgba(76, 201, 167, 0.22);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 13px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: end;
}

.checkline input {
  width: auto;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jobs-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.job,
.provider-card {
  border: 1px solid var(--line);
  background: #13151a;
  border-radius: 8px;
  padding: 13px;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.job-top,
.provider-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job p,
.provider-card p,
.workflow-card p {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.progress-row {
  display: grid;
  gap: 7px;
}

.submit-progress {
  display: grid;
  gap: 7px;
}

.submit-progress[hidden] {
  display: none;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress-label strong {
  color: var(--accent);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #0d0f13;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  background: #0d0f13;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: #d8dee9;
  white-space: pre-wrap;
}

.provider-list {
  display: grid;
  gap: 10px;
}

.model-pool {
  display: grid;
  gap: 16px;
}

.model-list {
  display: grid;
  gap: 10px;
}

.model-card {
  border: 1px solid var(--line);
  background: #13151a;
  border-radius: 8px;
  padding: 13px;
  display: grid;
  gap: 8px;
}

.model-bucket {
  box-shadow: none;
}

.provider-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.workflow-grid,
.workflow-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.workflow-section {
  display: grid;
  gap: 12px;
}

.workflow-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.workflow-card {
  min-height: 170px;
  display: grid;
  align-content: start;
  gap: 10px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.workflow-card:hover {
  border-color: rgba(76, 201, 167, 0.62);
  background: #1c2028;
}

.workflow-card small {
  color: var(--accent);
}

.template-workflow-card {
  background: #141922;
}

.workflow-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.license-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 13, 0.72);
  backdrop-filter: blur(8px);
}

.license-gate.visible {
  display: flex;
}

.license-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(92vh, 820px);
  overflow: auto;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 23, 33, 0.98), rgba(12, 15, 22, 0.98));
  border: 1px solid rgba(117, 167, 255, 0.24);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  padding: 22px;
  color: var(--text);
}

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

.license-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
}

.license-head h3 {
  margin: 0;
  font-size: 24px;
}

.license-status {
  margin: 14px 0 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.license-label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
}

.license-input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #131923;
  color: var(--text);
  padding: 10px 12px;
}

.license-input:focus {
  outline: none;
  border-color: rgba(76, 201, 167, 0.7);
  box-shadow: 0 0 0 3px rgba(76, 201, 167, 0.12);
}

.license-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.license-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.license-purchase {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.license-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.license-section-head strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.license-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.license-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.license-file-field {
  margin-bottom: 0;
}

.license-order-result {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.payment-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 6200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(3, 7, 12, 0.78);
  backdrop-filter: blur(10px);
}

.payment-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: min(92vh, 840px);
  overflow: auto;
  border: 1px solid rgba(76, 201, 167, 0.32);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 24, 35, 0.98), rgba(10, 14, 21, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding: 22px;
}

.payment-modal-head,
.payment-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-modal-head h3 {
  margin: 0;
  font-size: 24px;
}

.payment-order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.payment-order-meta div {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.52);
  padding: 10px;
}

.payment-order-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.payment-order-meta strong {
  overflow-wrap: anywhere;
}

.payment-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 1px solid rgba(76, 201, 167, 0.26);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
}

.payment-qr img {
  display: block;
  width: min(360px, 100%);
  height: auto;
  border-radius: 8px;
}

.payment-qr-empty {
  color: #111827;
  font-weight: 700;
}

.payment-note,
.payment-warning {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.payment-warning {
  color: #fbbf24;
}

.payment-modal-actions {
  margin-top: 18px;
  flex-wrap: wrap;
}

.license-auth-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin: 0 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}

.license-auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.license-auth-tab.active {
  color: #06120f;
  background: var(--accent);
}

.license-auth-panel[hidden] {
  display: none;
}

.account-view {
  display: grid;
  gap: 18px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.account-card {
  min-height: 0;
}

.account-empty {
  max-width: 720px;
}

.account-wide {
  grid-column: 1 / -1;
}

.account-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.account-info div,
.order-row,
.license-key-row,
.notice-row {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.42);
  padding: 12px;
}

.account-info span,
.order-row span,
.license-key-row span,
.notice-row span,
.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.account-info strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

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

.plan-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(76, 201, 167, 0.24);
  border-radius: 14px;
  background: rgba(20, 184, 166, 0.06);
  padding: 14px;
}

.plan-card b {
  font-size: 28px;
}

.order-list,
.license-key-list,
.notice-list {
  display: grid;
  gap: 10px;
}

.order-row,
.license-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.license-key-row code {
  display: block;
  margin: 6px 0;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.notice-row p {
  margin: 6px 0;
  color: var(--text);
}

.pill.warning {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.pill.success {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.1);
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .status-grid,
  .workspace,
  .providers-layout,
  .workflow-grid,
  .prompts-layout {
    grid-template-columns: 1fr;
  }

  .canvas-shell {
    min-height: 760px;
  }

  .canvas-stage {
    min-height: 700px;
  }

  .canvas-inspector {
    left: 76px;
    right: 14px;
    width: auto;
  }

  .inspector-grid,
  .composer-main {
    grid-template-columns: 1fr;
  }

  .inspector-grid .wide {
    grid-column: auto;
  }

  .canvas-composer {
    left: 76px;
    right: 14px;
    bottom: 16px;
    width: auto;
    transform: none;
  }

  .canvas-queue,
  .mini-map {
    display: none;
  }
}

@media (max-width: 720px) {
  .announcement-banner {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .entry-announcement {
    top: 76px;
    width: calc(100vw - 24px);
  }

  .entry-nav {
    height: auto;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .entry-hero {
    min-height: 100vh;
    padding: 118px 22px 80px;
  }

  .entry-copy h1 {
    font-size: 56px;
  }

  .entry-copy p {
    font-size: 16px;
  }

  .entry-login-status {
    grid-template-columns: 1fr;
  }

  .entry-login-card {
    padding: 24px;
  }

  .license-form-grid {
    grid-template-columns: 1fr;
  }

  .prompt-template-grid,
  .style-grid {
    grid-template-columns: 1fr;
  }
}

