:root {
  color-scheme: dark;
  --bg: #03070b;
  --surface: #0b1018;
  --surface-2: #101722;
  --surface-3: #151d2a;
  --line: #223044;
  --line-soft: rgba(120, 145, 170, 0.18);
  --text: #f3f7ff;
  --muted: #8fa1b7;
  --cyan: #16d9f5;
  --green: #31dfb5;
  --yellow: #f5b832;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
  cursor: pointer;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(22, 217, 245, 0.13), transparent 36%),
    rgba(3, 7, 11, 0.96);
}

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

.auth-card {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 24, 0.96);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-card h1 {
  margin: 0;
  font-size: 32px;
}

.auth-card p {
  margin: 0 0 4px;
  color: #b8c9dc;
  line-height: 1.6;
}

.auth-card label {
  display: grid;
  gap: 7px;
}

.auth-card label span,
.auth-card small {
  color: var(--muted);
  font-size: 13px;
}

.auth-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a1018;
  color: var(--text);
  padding: 0 12px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-admin-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(5, 11, 18, 0.58);
  padding: 12px;
}

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

.auth-admin-result {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.admin-code-box,
.admin-code-row {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(22, 217, 245, 0.18);
  border-radius: 8px;
  background: rgba(9, 16, 24, 0.72);
  padding: 10px;
}

.admin-code-box strong {
  color: var(--yellow);
  overflow-wrap: anywhere;
}

.admin-code-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-code-row span,
.admin-code-box span {
  color: var(--muted);
  font-size: 12px;
}

.admin-code-row button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b111a;
  color: #d8e8f8;
  padding: 0 10px;
}

.auth-signout {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 17, 26, 0.9);
  color: #d8e8f8;
  padding: 0 12px;
}

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

body.auth-locked {
  overflow: hidden;
}

svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.workspace-sidebars-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #090d13;
}

.app-shell.workspace-sidebars-hidden .sidebar {
  overflow: hidden;
  transform: translateX(-100%);
}

.brand {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-icon,
.hero-links span,
.asset-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(22, 217, 245, 0.12);
  color: var(--cyan);
}

.brand-icon {
  width: 34px;
  height: 34px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 4px;
  padding: 16px 10px;
}

.nav-item {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #c4cfdd;
  padding: 0 10px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line-soft);
  background: #0d131d;
  color: var(--text);
}

.nav-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 6px 10px;
  color: var(--muted);
  font-size: 11px;
}

.nav-divider::before,
.nav-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.points {
  margin: 0 10px;
}

.account {
  margin: auto 10px 12px;
  padding: 8px 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-area {
  min-width: 0;
  background:
    radial-gradient(circle at 0 0, rgba(22, 217, 245, 0.12), transparent 24%),
    linear-gradient(180deg, #070b10 0%, #03070b 45%);
}

.page {
  display: none;
  min-height: 100vh;
  padding: 26px clamp(22px, 4vw, 58px) 48px;
}

.page.active {
  display: block;
}

.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero-card,
.brief-card,
.task-card,
.node,
.empty-assets,
.asset-library-grid article,
.placeholder-page,
.project-board,
.project-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 21, 31, 0.86);
  box-shadow: var(--shadow);
}

.project-board {
  max-width: 1328px;
  margin: 0 auto 26px;
  padding: 26px;
}

.workspace-board {
  margin-top: 16px;
}

.project-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.project-board-head h1 {
  margin: 8px 0 8px;
  font-size: 44px;
}

.project-board-head p {
  max-width: 720px;
  margin: 0;
  color: #b8c9dc;
  line-height: 1.7;
}

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

.workspace-project-grid {
  align-items: stretch;
}

.project-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  box-shadow: none;
}

.project-card.active {
  border-color: rgba(22, 217, 245, 0.58);
}

.project-card span {
  color: var(--muted);
  font-size: 13px;
}

.project-card button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b111a;
  color: var(--text);
}

.project-thumb {
  display: grid;
  min-height: 118px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(120, 145, 170, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 217, 245, 0.08), transparent),
    #080d14;
  color: var(--muted);
  font-size: 13px;
}

.project-thumb img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  display: block;
}

.project-thumb.has-image {
  border-color: rgba(22, 217, 245, 0.28);
}

.project-create {
  display: grid;
  width: min(430px, 100%);
  gap: 10px;
}

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

.create-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0f16;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.project-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.folder-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(22, 217, 245, 0.22);
  border-radius: 12px;
  background: rgba(22, 217, 245, 0.12);
  color: var(--cyan);
}

.project-row strong,
.project-row span {
  display: block;
}

.project-name {
  cursor: text;
  line-height: 1.25;
}

.project-name:hover {
  color: var(--cyan);
}

.project-name-input {
  display: block;
  width: min(250px, 100%);
  min-height: 28px;
  border: 1px solid rgba(22, 217, 245, 0.45);
  border-radius: 8px;
  background: #070d14;
  color: var(--text);
  font: inherit;
  font-weight: 900;
  padding: 2px 8px;
  outline: none;
}

.open-canvas {
  border-color: rgba(22, 217, 245, 0.36) !important;
  background: rgba(22, 217, 245, 0.1) !important;
  font-weight: 900;
}

.project-code {
  color: #d7e7f8 !important;
}

#projectCodeInput.invalid {
  border-color: rgba(255, 89, 120, 0.7);
  color: #ffb2c0;
}

.delete-project {
  border-color: rgba(255, 89, 120, 0.26) !important;
  background: rgba(255, 89, 120, 0.08) !important;
  color: #ffb2c0 !important;
}

.legacy-home-section {
  display: none !important;
}

.hero-card {
  max-width: 1328px;
  margin: 0 auto 26px;
  padding: 34px 30px 30px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.hero-card h1 {
  max-width: 860px;
  margin: 22px 0 18px;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-card p,
.brief-info p,
.task-card p,
.assets-header p,
.my-assets p,
.platform-assets p,
.asset-library-grid p,
.placeholder-page p {
  color: #b8c9dc;
  line-height: 1.7;
}

.hero-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.hero-links button {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0f16;
  color: var(--text);
  text-align: left;
}

.hero-links span {
  width: 36px;
  height: 36px;
}

.hero-links strong,
.hero-links small {
  display: block;
}

.hero-links small {
  color: var(--muted);
}

.brief-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1fr);
  max-width: 1328px;
  margin: 0 auto 30px;
  overflow: hidden;
}

.visual-placeholder {
  position: relative;
  min-height: 348px;
  padding: 22px;
  background:
    linear-gradient(100deg, rgba(245, 184, 50, 0.18), rgba(22, 217, 245, 0.08) 42%, transparent),
    #090f15;
}

.tag,
.badge,
.deadline,
.chips span,
.task-meta span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #b8c9dc;
  font-size: 12px;
  font-weight: 800;
}

.tag,
.badge {
  padding: 5px 9px;
}

.badge {
  position: absolute;
  top: 22px;
  right: 22px;
  letter-spacing: 0.14em;
}

.visual-footer {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 10, 15, 0.76);
}

.visual-footer svg {
  width: 32px;
  height: 32px;
  color: var(--cyan);
}

.visual-footer small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.brief-info {
  padding: 30px;
}

.brief-top,
.task-meta,
.section-title,
.assets-header,
.assets-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.deadline,
.task-meta span {
  padding: 5px 9px;
}

.brief-info h2 {
  margin: 16px 0 10px;
  font-size: 28px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.chips span {
  padding: 6px 10px;
  background: rgba(22, 217, 245, 0.08);
}

.reward {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(245, 184, 50, 0.32);
  border-radius: 8px;
  background: rgba(245, 184, 50, 0.1);
  color: var(--yellow);
  font-weight: 900;
}

.yellow-button,
.subtle-button,
.node-head button,
.asset-library-grid button,
.chat-item {
  min-height: 38px;
  border-radius: 8px;
}

.yellow-button {
  border: 0;
  background: var(--yellow);
  color: #1c1300;
  padding: 0 18px;
  font-weight: 900;
}

.subtle-button,
.node-head button,
.asset-library-grid button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 13px;
}

.task-section {
  max-width: 1328px;
  margin: 0 auto;
}

.section-title {
  margin-bottom: 16px;
}

.section-title h2,
.assets-header h1,
.my-assets h2,
.platform-assets h2,
.placeholder-page h1 {
  margin: 8px 0 4px;
}

.task-grid,
.asset-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-card {
  padding: 18px;
  box-shadow: none;
}

.task-card h3 {
  margin: 22px 0 10px;
}

.task-card strong {
  color: var(--yellow);
  font-size: 13px;
}

.workspace-page {
  padding: 0;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100vh;
}

.workspace-layout.sidebars-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.workspace-layout.sidebars-hidden .conversation-panel {
  overflow: hidden;
  transform: translateX(-100%);
}

.workspace-layout.sidebars-hidden .workspace-canvas {
  grid-column: 2;
}

.conversation-panel {
  z-index: 3;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #080c12;
}

.conversation-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.conversation-head h2 {
  margin: 8px 0 6px;
}

.conversation-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.memory-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.memory-composer textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 10px;
  font: inherit;
  line-height: 1.45;
}

.memory-actions {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
}

.memory-actions select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 0 8px;
}

.fixed-api-channel {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05080d;
  color: #cfe4f5;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.chat-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  overflow: auto;
}

.chat-item {
  position: relative;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.chat-item[draggable="true"] {
  cursor: grab;
}

.chat-item[draggable="true"]:active {
  cursor: grabbing;
}

.chat-item:hover,
.chat-item.active {
  border-color: rgba(22, 217, 245, 0.52);
  background: #101923;
}

.chat-item strong {
  font-size: 14px;
}

.chat-item small {
  color: var(--muted);
  line-height: 1.5;
}

.memory-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.memory-delete:hover {
  border-color: rgba(255, 91, 91, 0.55);
  color: #ff8a8a;
}

.workspace-canvas {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  cursor: default;
  background:
    radial-gradient(circle at 20px 20px, rgba(130, 152, 180, 0.18) 1px, transparent 1px),
    #020508;
  background-size: 22px 22px;
}

.workspace-canvas,
.workspace-canvas .canvas-content {
  cursor: default;
}

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

.workspace-canvas.panning .canvas-content {
  cursor: grabbing;
}

.workspace-canvas.drag-over {
  outline: 2px solid rgba(22, 217, 245, 0.72);
  outline-offset: -8px;
  background:
    radial-gradient(circle at 20px 20px, rgba(130, 152, 180, 0.18) 1px, transparent 1px),
    linear-gradient(135deg, rgba(22, 217, 245, 0.12), rgba(255, 194, 69, 0.08)),
    #020508;
}

.folder-exit-top {
  position: absolute;
  z-index: 8;
  top: 18px;
  left: 18px;
  min-height: 38px;
  border: 1px solid rgba(255, 194, 69, 0.45);
  border-radius: 8px;
  background: rgba(11, 17, 26, 0.94);
  color: var(--yellow);
  padding: 0 14px;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.folder-exit-top:hover {
  border-color: rgba(255, 194, 69, 0.75);
  background: rgba(255, 194, 69, 0.12);
}

.workspace-side-toggle {
  position: fixed;
  z-index: 30;
  left: 232px;
  bottom: 28px;
  min-width: 82px;
  width: auto !important;
  border: 1px solid rgba(22, 217, 245, 0.42);
  border-radius: 8px;
  background: rgba(6, 14, 22, 0.92);
  color: var(--text);
  padding: 0 12px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

.workspace-side-toggle.is-hidden-state {
  left: 16px;
}

.workspace-side-toggle:hover {
  border-color: rgba(22, 217, 245, 0.72);
  background: rgba(22, 217, 245, 0.14);
}

.canvas-content {
  position: relative;
  width: 12000px;
  height: 12000px;
  transform-origin: top left;
}

.node {
  position: absolute;
  width: 258px;
  padding: 10px;
  box-shadow: none;
}

.input-node {
  border-color: rgba(22, 217, 245, 0.28);
}

.output-node {
  border-color: rgba(49, 223, 181, 0.34);
}

.node-kind {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.input-node .node-kind {
  background: rgba(22, 217, 245, 0.1);
  color: var(--cyan);
}

.output-node .node-kind {
  background: rgba(49, 223, 181, 0.1);
  color: var(--green);
}

.node-ref {
  left: 92px;
  top: 230px;
}

.node-mid-1 {
  left: 430px;
  top: 140px;
}

.node-mid-2 {
  left: 430px;
  top: 350px;
}

.node-mid-3 {
  left: 430px;
  top: 560px;
}

.node-right-1 {
  left: 750px;
  top: 80px;
}

.node-right-2 {
  left: 750px;
  top: 318px;
}

.node-right-3 {
  left: 750px;
  top: 556px;
}

.conversation-node {
  left: 1030px;
  top: 160px;
  min-height: 210px;
  border-color: rgba(49, 223, 181, 0.45);
}

.node-title,
.node-head {
  display: flex;
  align-items: center;
}

.node-head {
  justify-content: space-between;
  gap: 10px;
}

.node-type-select {
  width: 76px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #252832;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.node-type-select[data-node-type="video-mode"] {
  width: 112px;
  max-width: 42%;
}

.image-role-picker {
  position: relative;
  flex: 0 0 auto;
}

.image-role-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #252832;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.image-role-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  display: none;
  min-width: 116px;
  border: 1px solid rgba(22, 217, 245, 0.28);
  border-radius: 8px;
  background: #0b111a;
  padding: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.image-role-picker.open .image-role-menu {
  display: grid;
}

.image-role-option {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 8px;
  text-align: left;
  cursor: pointer;
}

.image-role-option:hover {
  background: rgba(22, 217, 245, 0.13);
}

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

.node-title span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6d7b8e;
}

.node-title .ok {
  background: var(--green);
}

.node-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-title-input {
  width: min(150px, 100%);
  height: 26px;
  border: 1px solid rgba(22, 217, 245, 0.5);
  border-radius: 6px;
  background: #080d14;
  color: var(--text);
  padding: 0 7px;
  font-weight: 900;
  outline: none;
}

.node-custom-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #2a2b31;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.image-node-shell {
  display: grid;
}

.node.folder-node {
  width: 150px;
  min-height: 120px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.node.folder-node.selected {
  outline: 2px solid rgba(22, 217, 245, 0.68);
  outline-offset: 8px;
}

.folder-canvas-entry {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.folder-title {
  justify-content: center;
  max-width: 150px;
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.folder-title strong {
  overflow-wrap: anywhere;
  cursor: text;
}

.folder-canvas-entry small {
  color: #ffd88a;
  font-size: 13px;
  font-weight: 800;
}

.image-upload-window {
  display: grid;
  min-height: 170px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #1d1d1f;
  cursor: pointer;
}

.image-upload-window:hover {
  border-color: rgba(22, 217, 245, 0.45);
  background: #20232a;
}

.image-upload-window input {
  display: none;
}

.image-upload-window span {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #2a2b31;
  color: var(--text);
  padding: 0 16px;
}

.image-upload-window .upload-name {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-config-panel {
  position: fixed;
  right: 24px;
  bottom: 18px;
  left: 244px;
  z-index: 80;
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 15, 17, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.node-config-panel.show {
  display: grid;
}

.config-tabs {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.config-tab,
.config-icon {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #141417;
  color: var(--text);
  padding: 0 18px;
  font-size: 16px;
}

.config-tab {
  min-width: 200px;
  text-align: left;
}

.config-icon {
  display: grid;
  width: 58px;
  place-items: center;
  color: var(--muted);
}

#imagePromptInput {
  min-height: 150px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f0f11;
  color: var(--text);
  padding: 24px;
  resize: vertical;
  outline: none;
}

.config-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}

.config-footer select,
.config-pill,
.config-submit {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #2a2a2d;
  color: var(--text);
  padding: 0 18px;
}

.config-submit {
  margin-left: auto;
  min-width: 160px;
  background: #3a3a3e;
  color: #bfc3ca;
  font-weight: 900;
}

.config-submit.danger {
  background: #5f2525;
  color: #ffd9d9;
}

.image-options-popover {
  position: fixed;
  left: 244px;
  bottom: 292px;
  z-index: 92;
  display: none;
  width: min(470px, calc(100vw - 280px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: #2e2e31;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.image-options-popover.show {
  display: grid;
  gap: 16px;
}

.option-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.option-group {
  display: grid;
  gap: 10px;
}

.option-group > span {
  color: #b9bac0;
  font-size: 13px;
  font-weight: 800;
}

.option-grid {
  display: grid;
  overflow: hidden;
  border-radius: 14px;
  background: #37373a;
  padding: 5px;
}

.purpose-grid {
  grid-template-columns: repeat(3, 1fr);
}

.purpose-grid button:nth-child(4) {
  grid-column: 1;
}

.quality-grid {
  grid-template-columns: repeat(3, 1fr);
}

.option-grid button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aeb0b7;
  font-weight: 900;
}

.option-grid button.active {
  background: #5a5a5d;
  color: #fff;
}

.reference-picker {
  position: fixed;
  right: 42px;
  bottom: 250px;
  z-index: 95;
  display: none;
  width: min(560px, calc(100vw - 280px));
  max-height: 420px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #1b1b1d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  padding: 28px;
}

.reference-picker.show {
  display: block;
}

.reference-picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.reference-picker-head strong,
.reference-picker-head span {
  display: block;
}

.reference-picker-head strong {
  font-size: 24px;
  margin-bottom: 20px;
}

.reference-picker-head span {
  color: var(--muted);
  line-height: 1.6;
}

.upload-reference-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  border-radius: 10px;
  background: #2a2a2d;
  color: var(--text);
  cursor: pointer;
  padding: 0 22px;
  font-size: 20px;
  font-weight: 900;
}

.reference-list {
  display: grid;
  gap: 14px;
}

.reference-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.reference-thumb {
  grid-row: span 2;
  width: 76px;
  height: 58px;
  border-radius: 8px;
}

.reference-item span {
  font-size: 22px;
  font-weight: 800;
}

.reference-item small,
.reference-empty {
  color: var(--muted);
  font-size: 16px;
}

.reference-item:hover span {
  color: var(--cyan);
}

.node small {
  display: inline-flex;
  margin: 10px 0 8px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #a8c5e5;
  font-size: 12px;
  font-weight: 800;
}

.node p {
  margin: 10px 2px 0;
  color: #c0d0df;
  font-size: 12px;
  line-height: 1.55;
}

.image-slot {
  height: 134px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.text-slot,
.video-slot {
  display: grid;
  min-height: 134px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: #080d14;
}

.text-input,
.mini-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #080d14;
  color: #c8d8e8;
  resize: vertical;
  outline: none;
}

.text-input {
  min-height: 134px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.text-brief-grid {
  display: grid;
  gap: 8px;
}

.text-brief-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.text-brief-field {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #080d14;
  color: #c8d8e8;
  padding: 8px;
  resize: vertical;
  outline: none;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

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

.api-name {
  padding: 8px 9px;
  border: 1px solid rgba(22, 217, 245, 0.22);
  border-radius: 8px;
  background: rgba(22, 217, 245, 0.08);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.api-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.api-panel .upload-control {
  gap: 7px;
}

.node-file-input {
  display: none;
}

.upload-box {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px dashed rgba(22, 217, 245, 0.42);
  border-radius: 8px;
  background: rgba(22, 217, 245, 0.08);
  color: var(--text);
  cursor: pointer;
}

.upload-box strong {
  color: var(--cyan);
  font-size: 12px;
}

.upload-box small {
  overflow: hidden;
  color: #b8c9dc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  overflow: hidden;
  border-radius: 8px;
}

.upload-preview:empty {
  display: none;
}

.upload-preview img,
.upload-preview video {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.24);
  border-radius: 8px;
}

.upload-preview img {
  cursor: zoom-in;
}

.broken-image-placeholder {
  display: grid;
  width: 100%;
  min-height: 112px;
  place-items: center;
  border: 1px dashed rgba(255, 184, 50, 0.42);
  border-radius: 8px;
  background: rgba(245, 184, 50, 0.08);
  color: var(--yellow);
  font-size: 12px;
  text-align: center;
}

.upload-preview.output-preview {
  position: relative;
  display: block;
  overflow: visible;
}

.upload-preview.output-preview > img {
  width: 100%;
}

.output-history-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 30;
  border: 1px solid rgba(22, 217, 245, 0.42);
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(3, 9, 15, 0.86);
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.output-history-popover {
  position: absolute;
  top: 38px;
  right: 8px;
  z-index: 40;
  display: none;
  width: 226px;
  max-height: 280px;
  overflow: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(22, 217, 245, 0.38);
  border-radius: 8px;
  padding: 8px;
  background: rgba(5, 10, 16, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.output-history-popover.show {
  display: grid;
}

.output-history-popover img {
  height: 86px;
}

.generated-placeholder {
  display: grid;
  min-height: 132px;
  place-items: center;
  border: 1px dashed rgba(22, 217, 245, 0.35);
  border-radius: 8px;
  background: rgba(22, 217, 245, 0.08);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background: rgba(1, 8, 16, 0.86);
}

.image-viewer.show {
  display: grid;
}

.image-viewer img {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  transform-origin: center center;
  transition: transform 120ms ease;
  cursor: zoom-in;
}

.image-viewer-toolbar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 501;
  display: flex;
  gap: 8px;
}

.image-viewer-toolbar button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 8px 14px;
  color: #eaf6ff;
  background: rgba(10, 22, 34, 0.9);
  cursor: pointer;
}

.image-viewer-toolbar button:hover {
  border-color: rgba(22, 217, 245, 0.58);
  color: var(--cyan);
}

.image-viewer-nav {
  position: fixed;
  top: 50%;
  z-index: 501;
  width: 46px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 22, 34, 0.78);
  color: #eaf6ff;
  cursor: pointer;
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
}

.image-viewer-nav.prev {
  left: 22px;
}

.image-viewer-nav.next {
  right: 22px;
}

.image-viewer-nav:hover {
  border-color: rgba(22, 217, 245, 0.58);
  color: var(--cyan);
}

.config-input-strip {
  display: grid;
  gap: 8px;
  padding: 10px 14px 0;
}

.config-input-strip-title {
  color: #9fb7cb;
  font-size: 12px;
  font-weight: 800;
}

.config-input-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.config-input-thumb {
  width: 76px;
  border: 1px solid rgba(22, 217, 245, 0.28);
  border-radius: 8px;
  padding: 4px;
  background: rgba(8, 16, 26, 0.92);
  color: #dcecff;
  cursor: zoom-in;
}

.config-input-thumb img,
.config-input-thumb video {
  display: block;
  width: 66px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.32);
}

.config-audio-thumb {
  display: grid;
  width: 66px;
  height: 48px;
  place-items: center;
  border-radius: 6px;
  background: rgba(22, 217, 245, 0.12);
  color: #dcecff;
  font-size: 11px;
  font-weight: 900;
}

.config-input-thumb span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-panel select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080d14;
  color: var(--text);
}

.video-config-hidden {
  display: none !important;
}

.video-settings-panel {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #111114;
  padding: 14px 20px 16px;
}

.video-settings-grid,
.video-upload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.video-settings-grid label,
.video-asset-picker {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #18181b;
  padding: 10px;
}

.video-settings-grid span,
.video-asset-picker span {
  overflow: hidden;
  color: #aeb8c6;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-settings-grid input,
.video-settings-grid select {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #0c0c0f;
  color: var(--text);
  padding: 0 9px;
}

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

.video-toggle-row label {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #242428;
  color: #d5d8df;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.video-asset-picker {
  cursor: pointer;
}

.video-asset-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.video-asset-picker small {
  overflow: hidden;
  margin: 0;
  padding: 0;
  color: #d5d8df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-textarea {
  min-height: 62px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.node-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.node-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b111a;
  color: #b8c9dc;
  font-size: 12px;
}

.node-port {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #9fb2c8;
  border-radius: 999px;
  background: #111a25;
  transform: translateY(-50%);
  z-index: 5;
  cursor: crosshair;
  touch-action: none;
}

.node-port.in {
  left: -10px;
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(22, 217, 245, 0.12);
}

.node-port.out {
  right: -10px;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(49, 223, 181, 0.12);
}

.node-port:hover {
  transform: translateY(-50%) scale(1.18);
  box-shadow: 0 0 0 7px rgba(22, 217, 245, 0.16);
}

.node-port.connect-target {
  transform: translateY(-50%) scale(1.28);
  box-shadow: 0 0 0 8px rgba(245, 184, 50, 0.2);
  border-color: var(--yellow);
}

.node.selected {
  outline: 2px solid rgba(22, 217, 245, 0.58);
  outline-offset: 2px;
}

.selection-box {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  border: 1px solid rgba(22, 217, 245, 0.85);
  background: rgba(22, 217, 245, 0.12);
  box-shadow: 0 0 0 1px rgba(22, 217, 245, 0.18) inset;
}

.node.linking {
  outline: 2px solid rgba(245, 184, 50, 0.75);
  outline-offset: 2px;
}

.node.running {
  border-color: rgba(245, 184, 50, 0.85);
}

.node-status {
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(245, 184, 50, 0.1);
  color: var(--yellow);
  font-size: 11px;
  line-height: 1.4;
}

.text-slot {
  align-content: start;
  padding: 12px;
  color: #c8d8e8;
  font-size: 12px;
  line-height: 1.6;
}

.video-slot {
  position: relative;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(22, 217, 245, 0.12), transparent),
    linear-gradient(315deg, rgba(245, 184, 50, 0.16), transparent),
    #081018;
}

.video-slot span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.video-slot span::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #081018;
}

.video-slot strong {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: #dce9f7;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.pulse {
  animation: pulse-node 0.52s ease-out;
}

@keyframes pulse-node {
  0% {
    box-shadow: 0 0 0 0 rgba(49, 223, 181, 0.46);
  }

  100% {
    box-shadow: 0 0 0 18px rgba(49, 223, 181, 0);
  }
}

.slot-a {
  background: linear-gradient(145deg, #192333, #050709 54%, #364155);
}

.slot-b {
  background: linear-gradient(160deg, #263240, #101824 58%, #c14652 59%, #251012);
}

.slot-c {
  background: linear-gradient(170deg, #1f2c36, #121820 60%, #d05d6a 62%, #15191e);
}

.slot-d {
  background: linear-gradient(150deg, #526171, #1b2632 48%, #80766a 50%, #26313a);
}

.connectors {
  position: absolute;
  left: 0;
  top: 0;
  width: 5000px;
  height: 5000px;
  overflow: visible;
  pointer-events: none;
}

.connectors path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.26);
  stroke-width: 2;
}

.connectors path.temp-wire {
  stroke: var(--yellow);
  stroke-dasharray: 6 5;
}

.canvas-toolbar {
  position: fixed;
  left: calc(220px + 320px + 18px);
  bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b111a;
}

#page-workspace.active .canvas-toolbar {
  display: flex;
}

.canvas-toolbar button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b8c9dc;
}

.canvas-toolbar button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.canvas-toolbar strong {
  min-width: 48px;
  text-align: center;
}

.canvas-toolbar .active {
  background: rgba(22, 217, 245, 0.14);
  color: var(--cyan);
}

.folder-mini-icon,
.folder-large-icon {
  position: relative;
  display: inline-block;
  width: 23px;
  height: 18px;
  border-radius: 2px 2px 3px 3px;
  background: linear-gradient(180deg, #ffc533 0%, #f6a800 62%, #d98900 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.folder-mini-icon::before,
.folder-large-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -4px;
  width: 10px;
  height: 6px;
  border-radius: 2px 2px 0 0;
  background: #ffc533;
}

.folder-mini-icon::after,
.folder-large-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 12px;
  height: 6px;
  border-radius: 1px;
  background: #31a9ff;
}

.folder-large-icon {
  width: 58px;
  height: 45px;
  border-radius: 5px 5px 7px 7px;
}

.folder-large-icon::before {
  top: -9px;
  left: 5px;
  width: 25px;
  height: 13px;
  border-radius: 4px 4px 0 0;
}

.folder-large-icon::after {
  right: 7px;
  bottom: 7px;
  width: 30px;
  height: 14px;
  border-radius: 3px;
}

.context-menu {
  position: fixed;
  z-index: 100;
  display: none;
  min-width: 176px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b111a;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.context-menu.show {
  display: grid;
  gap: 4px;
}

.context-title {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.context-menu button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #d7e7f8;
  padding: 0 9px;
  text-align: left;
}

.context-menu button:hover {
  background: rgba(22, 217, 245, 0.12);
  color: var(--text);
}

.port-connection-menu {
  min-width: 220px;
}

.port-connection-list {
  display: grid;
  gap: 6px;
}

.port-connection-list button {
  display: grid;
  gap: 3px;
  text-align: left;
}

.port-connection-list button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-connection-list button small {
  color: var(--muted);
  font-size: 11px;
}

.port-connection-list button.empty {
  cursor: default;
  opacity: 0.62;
}

.port-connection-list button.empty:hover {
  background: transparent;
  color: #d7e7f8;
}

.assets-header {
  max-width: 1340px;
  margin: 0 auto 26px;
  align-items: start;
}

.assets-header h1 {
  font-size: 44px;
}

.assets-header p {
  max-width: 820px;
}

.assets-actions {
  max-width: 1340px;
  margin: 0 auto 12px;
  justify-content: end;
}

.my-assets,
.platform-assets {
  max-width: 1340px;
  margin: 0 auto 30px;
}

.empty-assets {
  display: grid;
  min-height: 180px;
  place-items: center;
  border-style: dashed;
  box-shadow: none;
}

.empty-assets[hidden] {
  display: none;
}

.empty-assets div {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 24px;
}

.empty-assets span {
  max-width: 460px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.my-assets-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.asset-card {
  min-height: 290px;
}

.template-card {
  min-height: 310px;
}

.template-section {
  max-width: 1340px;
}

.asset-card-actions {
  display: grid;
  gap: 8px;
  align-self: end;
}

.asset-card-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b111a;
  color: #d8e8f8;
  padding: 0 12px;
}

.asset-thumb span {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 14px;
  color: #b8c9dc;
  line-height: 1.6;
  text-align: center;
}

.asset-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: none;
  padding: 28px;
  overflow: auto;
  background: rgba(1, 8, 16, 0.86);
}

.asset-preview-modal.show {
  display: grid;
  place-items: start center;
}

.asset-preview-panel {
  display: grid;
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #09101a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

.asset-preview-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 16, 26, 0.94);
  padding: 14px 16px;
}

.asset-preview-head button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b111a;
  color: #d8e8f8;
  padding: 0 12px;
}

.asset-preview-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.asset-preview-summary,
.asset-preview-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 21, 31, 0.72);
  padding: 16px;
}

.asset-preview-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 16px;
}

.asset-preview-summary small {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.asset-preview-summary h2,
.asset-preview-section h3 {
  margin: 6px 0 10px;
}

.asset-preview-summary p,
.asset-preview-section p {
  margin: 0;
  color: #bfd1e3;
  line-height: 1.7;
}

.asset-preview-summary dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.asset-preview-summary dl div,
.asset-param-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(5, 11, 18, 0.62);
  padding: 10px;
}

.asset-preview-summary dt,
.asset-param-grid span {
  color: #8fa3b8;
  font-size: 12px;
  font-weight: 800;
}

.asset-preview-summary dd,
.asset-param-grid strong {
  margin: 0;
  color: #edf7ff;
  overflow-wrap: anywhere;
}

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

.asset-preview-media-grid img,
.asset-preview-media-grid video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #050b12;
  object-fit: contain;
}

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

.asset-preview-section pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: #050b12;
  color: #d8e8f8;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.asset-library-grid article {
  min-height: 260px;
  padding: 20px;
  box-shadow: none;
}

.asset-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
}

.asset-library-grid small {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bfd1e3;
}

.asset-library-grid h3 {
  margin: 16px 0 10px;
}

.asset-library-grid button {
  margin-top: 16px;
}

.placeholder-page {
  max-width: 920px;
  min-height: auto;
  margin: 30px auto;
  padding: 34px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .account,
  .nav-divider,
  .points {
    display: none;
  }

  .brief-card,
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .conversation-panel {
    max-height: 340px;
  }

  .canvas-toolbar {
    left: 24px;
  }

  .workspace-side-toggle {
    left: 18px;
    top: 18px;
    bottom: auto;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 18px;
  }

  .side-nav,
  .hero-links,
  .task-grid,
  .asset-library-grid {
    grid-template-columns: 1fr;
  }

  .asset-preview-summary,
  .asset-preview-media-grid,
  .asset-param-grid {
    grid-template-columns: 1fr;
  }

  .hero-card h1 {
    font-size: 38px;
  }

  .brief-card {
    display: block;
  }

  .visual-placeholder {
    min-height: 280px;
  }
}
