:root {
  --bg: #070605;
  --ink: #f8f3ea;
  --ink-strong: #fffaf1;
  --muted: #aaa096;
  --soft: #f4f1ea;
  --soft-2: #ece7dc;
  --line: rgba(255, 244, 230, 0.14);
  --line-dark: rgba(40, 30, 22, 0.1);
  --panel: rgba(17, 15, 13, 0.82);
  --panel-strong: rgba(28, 25, 22, 0.94);
  --glass: rgba(255, 246, 235, 0.08);
  --accent: #f06a33;
  --accent-deep: #bf4c2e;
  --accent-soft: #efb29b;
  --gold: #f4be68;
  --cool: #cfeaf4;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --workbench-width: 1916px;
  --workbench-height: 928px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: var(--workbench-width);
  height: var(--workbench-height);
  min-width: var(--workbench-width);
  min-height: var(--workbench-height);
}

body {
  margin: 0;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: flex;
  width: var(--workbench-width);
  height: var(--workbench-height);
  min-height: var(--workbench-height);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 119, 39, 0.1), transparent 36%),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  width: 92px;
  height: var(--workbench-height);
  flex: 0 0 92px;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  border-right: 1px solid rgba(255, 149, 78, 0.24);
  background:
    radial-gradient(130px 260px at 46px 30px, rgba(255, 126, 40, 0.32), transparent 68%),
    linear-gradient(180deg, rgba(255, 218, 163, 0.08), transparent 28%),
    linear-gradient(180deg, #100906 0%, #050403 46%, #080504 100%);
  color: rgba(255, 239, 222, 0.72);
  box-shadow:
    12px 0 42px rgba(0, 0, 0, 0.52),
    inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
  content: "";
}

.sidebar::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 143, 70, 0.7), transparent);
  content: "";
}

.brand {
  display: grid;
  width: 72px;
  height: 88px;
  margin-top: 14px;
  place-items: center;
}

.brand img {
  width: 66px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(255, 101, 31, 0.36));
}

.primary-nav {
  display: grid;
  width: 100%;
  gap: 10px;
  margin-top: 14px;
  padding: 0 12px;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 66px;
  place-items: center;
  gap: 3px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 238, 221, 0.7);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-item::before {
  position: absolute;
  left: -12px;
  top: 12px;
  width: 3px;
  height: 42px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  box-shadow: none;
  content: "";
}

.nav-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 178, 120, 0.2);
  background: rgba(255, 143, 70, 0.1);
  color: rgba(255, 248, 240, 0.92);
}

.nav-item.active {
  border-color: rgba(255, 177, 116, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 184, 122, 0.2), rgba(234, 86, 41, 0.13)),
    rgba(255, 245, 232, 0.06);
  color: #ffd0b7;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(240, 89, 38, 0.14);
}

.nav-item.active::before {
  background: linear-gradient(180deg, #ffd08e, #ff6c32 62%, #a92819);
  box-shadow: 0 0 18px rgba(255, 111, 43, 0.78);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.nav-item span:last-child {
  font-size: 13px;
}

.sidebar-bottom {
  display: grid;
  gap: 12px;
  margin-top: auto;
  margin-bottom: 18px;
  place-items: center;
}

.mini-dot,
.theme-dot {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 214, 178, 0.12);
  background: rgba(255, 238, 219, 0.06);
  color: rgba(255, 238, 221, 0.74);
}

.mini-dot span {
  position: absolute;
  right: 2px;
  top: 3px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb06a, #d65133);
  color: white;
  font-size: 10px;
  box-shadow: 0 0 14px rgba(255, 101, 31, 0.46);
}

.buddy-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 213, 173, 0.26);
  background:
    linear-gradient(135deg, #ffb160 0%, #ff7432 48%, #7f1c16 100%);
  color: white;
  font-weight: 900;
  box-shadow:
    0 12px 28px rgba(240, 87, 36, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.workspace {
  position: relative;
  flex: 1;
  min-width: 0;
  height: var(--workbench-height);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 124, 36, 0.13), transparent 22%),
    linear-gradient(160deg, #090807 0%, #12100e 42%, #090807 100%);
}

.workspace::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.74) 100%);
  background-size: 34px 34px, 34px 34px, 100% 100%;
  opacity: 0.56;
  content: "";
}

.view {
  position: relative;
  z-index: 1;
  display: none;
  min-height: var(--workbench-height);
  padding: 24px 36px 46px;
}

.view.active {
  display: block;
}

.home-hero {
  position: relative;
  min-height: 426px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 8, 7, 0.18), rgba(8, 7, 6, 0.9)),
    url("./assets/hero-glow.jpg") center 8% / cover no-repeat;
  box-shadow: var(--shadow);
}

.home-hero::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), transparent 33%, rgba(0, 0, 0, 0.52)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.92), transparent 58%);
  content: "";
}

.hero-backdrop {
  position: absolute;
  right: 5%;
  top: 5%;
  width: min(38vw, 560px);
  height: 88%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 68%),
    linear-gradient(180deg, rgba(244, 190, 104, 0.12), rgba(224, 81, 42, 0.1));
  clip-path: polygon(12% 0, 100% 20%, 78% 100%, 0 70%);
  filter: blur(8px);
  opacity: 0.82;
}

.top-title {
  position: relative;
  z-index: 80;
  display: grid;
  justify-items: center;
  padding: 42px 20px 0;
  text-align: center;
}

.top-title p {
  margin: 0 0 8px;
  color: rgba(255, 244, 230, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.top-title h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 18px;
  margin: 0;
  color: var(--ink-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 4.2vw, 64px);
  line-height: 1.05;
  text-shadow: 0 18px 70px rgba(240, 106, 51, 0.26);
}

.mode-picker {
  position: relative;
  z-index: 1000;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
}

.mode-trigger {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  background: transparent;
  color: #ffad72;
  font: inherit;
  font-family: inherit;
  font-size: 0.62em;
  line-height: 1;
  text-shadow: 0 8px 28px rgba(255, 126, 58, 0.24);
  transition: color 180ms ease, text-shadow 180ms ease;
}

.mode-trigger:hover,
.mode-picker.open .mode-trigger {
  color: #ffc18f;
  text-shadow: 0 8px 32px rgba(255, 145, 74, 0.34);
}

.mode-label {
  white-space: nowrap;
}

.mode-caret {
  display: inline-block;
  font-size: 0.56em;
  transform: translateY(-2px);
  transition: transform 180ms ease;
}

.mode-picker.open .mode-caret {
  transform: translateY(-2px) rotate(180deg);
}

.mode-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 9999;
  display: grid;
  min-width: 174px;
  padding: 11px;
  border: 1px solid rgba(255, 181, 113, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 124, 36, 0.28), transparent 68%),
    linear-gradient(180deg, rgba(47, 35, 27, 0.96), rgba(12, 9, 7, 0.98));
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.5),
    0 0 34px rgba(240, 91, 36, 0.22),
    inset 0 1px 0 rgba(255, 238, 213, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.mode-picker.open .mode-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.mode-menu button {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 238, 221, 0.76);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.mode-menu button.active,
.mode-menu button:hover {
  color: #ffd7bd;
}

.mode-menu button.active {
  background:
    linear-gradient(135deg, rgba(255, 151, 80, 0.22), rgba(191, 53, 28, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 190, 132, 0.2);
}

.mode-menu button:hover {
  background: rgba(255, 130, 58, 0.12);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.hero-stats span {
  border: 1px solid rgba(255, 238, 222, 0.2);
  border-radius: 8px;
  padding: 7px 12px;
  background: rgba(20, 17, 15, 0.44);
  color: rgba(255, 245, 235, 0.78);
  font-size: 13px;
}

.agent-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(520px, 760px);
  justify-content: center;
  align-items: center;
  max-width: 880px;
  margin: 62px auto 0;
  padding: 0 24px 32px;
}

.visual-orbit {
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 230, 0.18);
  border-radius: 8px;
  background: #050505;
  box-shadow: inset 0 0 60px rgba(240, 106, 51, 0.22);
}

.visual-orbit img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  mix-blend-mode: screen;
}

.composer-card,
.floating-composer {
  overflow: visible;
  border: 1px solid rgba(255, 242, 228, 0.18);
  border-radius: 8px;
  background: rgba(245, 238, 229, 0.1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.composer-card {
  display: grid;
  height: 178px;
  min-height: 178px;
  grid-template-columns: 84px 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
}

.composer-card.has-references {
  grid-template-columns: 1fr;
  gap: 12px;
}

.reference-uploader {
  display: flex;
  min-width: 64px;
  max-width: 100%;
  align-items: flex-start;
  gap: 8px;
}

.composer-card.has-references .reference-uploader {
  grid-column: 1 / -1;
  width: 100%;
}

.composer-card.has-references .prompt-line {
  grid-column: 1 / -1;
  min-height: 54px;
  padding: 0;
}

.floating-composer.has-references .reference-uploader {
  width: 100%;
  padding: 14px 18px 0;
}

.reference-uploader.compact.has-references .upload-tile.small {
  margin: 0;
}

.reference-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.reference-thumb {
  position: relative;
  width: 64px;
  height: 84px;
  border: 1px solid rgba(255, 221, 185, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 244, 229, 0.08), rgba(255, 128, 51, 0.05)),
    rgba(13, 11, 10, 0.72);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.reference-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.reference-thumb:hover,
.reference-thumb.selected,
.reference-thumb:focus-visible {
  border-color: rgba(255, 181, 113, 0.48);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(240, 106, 51, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px) rotate(-1deg);
}

.reference-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 230, 205, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 242, 220, 0.22), transparent 50%),
    rgba(24, 20, 18, 0.94);
  color: rgba(255, 239, 226, 0.9);
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.88);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.reference-thumb:hover .reference-remove,
.reference-thumb.selected .reference-remove,
.reference-thumb:focus-within .reference-remove {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.reference-remove:hover {
  background:
    linear-gradient(135deg, #ffb15f, #f06a33 56%, #8d2319);
  color: white;
}

.upload-tile {
  position: relative;
  display: grid;
  width: 64px;
  height: 84px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 230, 0.14);
  border-radius: 8px;
  background: rgba(255, 246, 235, 0.1);
  color: rgba(255, 245, 235, 0.78);
  cursor: pointer;
  font-size: 24px;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.upload-tile[hidden] {
  display: none;
}

.upload-tile:hover {
  border-color: rgba(255, 181, 113, 0.34);
  background: rgba(255, 133, 54, 0.14);
  transform: translateY(-1px);
}

.upload-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-tile.has-upload {
  padding: 0;
  border-color: rgba(255, 181, 113, 0.38);
  background: rgba(9, 8, 7, 0.48);
}

.upload-tile.has-upload span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border: 1px solid rgba(255, 232, 206, 0.18);
  border-radius: 6px;
  padding: 3px 7px;
  background: rgba(11, 8, 6, 0.72);
  color: #fff2e2;
  font-size: 11px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.image-upload-input {
  display: none;
}

.upload-tile.small {
  width: 64px;
  height: 84px;
  margin: 18px 0 0 18px;
}

.prompt-line {
  height: 86px;
  min-height: 86px;
  max-height: 86px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 0;
  color: rgba(255, 248, 240, 0.92);
  font-size: clamp(15px, 1vw, 18px);
  line-height: 1.42;
  outline: none;
  scrollbar-gutter: stable;
}

.composer-toolbar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
}

.composer-toolbar button,
.chip-row span,
.page-actions button,
.tabs button,
.filter-row button,
.filters button,
.library-tools button,
.asset-filters button,
.search-box,
.search-lite,
.rail-action,
.rail-thread,
.segmented button,
.dark-pill,
.white-pill,
.round-btn,
.primary-small {
  min-height: 38px;
  border: 1px solid rgba(255, 244, 230, 0.13);
  border-radius: 8px;
  background: rgba(255, 246, 235, 0.08);
  color: inherit;
}

.composer-toolbar button {
  padding: 0 14px;
  color: rgba(255, 245, 236, 0.86);
}

.toolbar-picker {
  position: relative;
  z-index: 1;
}

.toolbar-picker.open {
  z-index: 120;
}

.toolbar-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toolbar-caret {
  color: rgba(255, 179, 139, 0.78);
  font-size: 11px;
  transition: transform 160ms ease;
}

.toolbar-picker.open .toolbar-caret {
  transform: rotate(180deg);
}

.tool-menu,
.tool-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 10000;
  border: 1px solid rgba(255, 181, 113, 0.3);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 139, 64, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(48, 35, 27, 0.98), rgba(12, 9, 7, 0.98));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(240, 93, 40, 0.2),
    inset 0 1px 0 rgba(255, 240, 219, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toolbar-picker.open .tool-menu,
.toolbar-picker.open .tool-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-composer .tool-menu,
.floating-composer .tool-panel {
  top: auto;
  bottom: calc(100% + 10px);
  transform: translateY(6px);
}

/* On the empty generation page, settings follow the toolbar and open below it. */
.generate-page[data-generate-state="compose"] .floating-composer .tool-menu,
.generate-page[data-generate-state="compose"] .floating-composer .tool-panel {
  top: calc(100% + 10px);
  bottom: auto;
  transform: translateY(-6px);
}

.generate-page[data-generate-state="compose"] .floating-composer .toolbar-picker.open .tool-menu,
.generate-page[data-generate-state="compose"] .floating-composer .toolbar-picker.open .tool-panel {
  transform: translateY(0);
}

.floating-composer .toolbar-picker.open .tool-menu,
.floating-composer .toolbar-picker.open .tool-panel {
  transform: translateY(0);
}

.mode-tool-menu {
  display: grid;
  width: 250px;
  padding: 12px;
  gap: 4px;
}

.mode-tool-menu button {
  display: grid;
  min-height: 58px;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(255, 239, 224, 0.9);
  text-align: left;
}

.mode-tool-menu button strong {
  color: inherit;
  font-size: 14px;
}

.mode-tool-menu button span {
  color: rgba(255, 221, 193, 0.56);
  font-size: 12px;
}

.mode-tool-menu button:hover,
.mode-tool-menu button.active {
  border-color: rgba(255, 181, 113, 0.28);
  background:
    linear-gradient(135deg, rgba(240, 106, 51, 0.24), rgba(244, 190, 104, 0.08));
  color: #ffd4ba;
}

.generate-page .mode-tool-menu button.active {
  border-color: rgba(255, 151, 80, 0.68);
  background:
    linear-gradient(135deg, rgba(255, 126, 62, 0.34), rgba(191, 53, 28, 0.2));
  color: #ffe0cb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 190, 132, 0.22),
    0 8px 22px rgba(197, 70, 30, 0.18);
}

.generate-page .mode-tool-menu button.active span {
  color: rgba(255, 214, 183, 0.76);
}

.image-settings-tool {
  transition: opacity 160ms ease, transform 160ms ease;
}

.composer-toolbar:not(.image-mode) .image-settings-tool {
  display: none;
}

.video-settings-tool {
  display: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.composer-toolbar.video-mode .video-settings-tool {
  display: block;
}

.image-settings-panel {
  width: min(356px, calc(100vw - 32px));
  max-height: min(430px, calc(100vh - 210px));
  overflow: auto;
  padding: 14px;
  color: rgba(255, 238, 219, 0.86);
  scrollbar-color: rgba(255, 160, 92, 0.4) rgba(255, 246, 235, 0.06);
  scrollbar-width: thin;
}

.image-settings-panel section {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.image-settings-panel p {
  margin: 0;
  color: rgba(255, 225, 196, 0.72);
  font-size: 12px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-model-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.model-grid button,
.option-grid button {
  border: 1px solid rgba(255, 230, 205, 0.16);
  border-radius: 8px;
  background: rgba(255, 246, 235, 0.07);
  color: rgba(255, 241, 228, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.image-settings-panel .model-grid button {
  display: grid;
  min-height: 62px;
  gap: 5px;
  border-radius: 10px;
  padding: 10px 11px;
  text-align: left;
}

.image-model-grid button:first-child {
  grid-column: auto;
}

.image-settings-panel .model-grid button strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-settings-panel .model-grid button span {
  color: rgba(255, 220, 190, 0.56);
  font-size: 11px;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.option-grid button {
  min-height: 26px;
  padding: 0 7px;
  font-size: 12px;
}

.compact-options button {
  min-width: 42px;
}

.image-settings-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.model-grid button:hover,
.model-grid button.active,
.option-grid button:hover,
.option-grid button.active {
  border-color: rgba(255, 126, 69, 0.62);
  background:
    linear-gradient(135deg, rgba(240, 106, 51, 0.22), rgba(244, 190, 104, 0.08));
  color: #ffd5bd;
}

.video-settings-panel {
  width: 356px;
  max-height: min(520px, calc(100vh - 210px));
  overflow: auto;
  padding: 14px;
  color: rgba(255, 238, 219, 0.86);
  scrollbar-color: rgba(255, 160, 92, 0.4) rgba(255, 246, 235, 0.06);
  scrollbar-width: thin;
}

/* Match the image settings placement while keeping the popover in view. */
.generate-page[data-generate-state="compose"] .floating-composer .video-settings-tool.open .video-settings-panel,
.generate-page .floating-composer .video-settings-tool.open .video-settings-panel {
  top: calc(100% + 10px);
  bottom: auto;
  max-height: min(430px, calc(50vh - 58px));
}

.video-settings-panel section {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.video-settings-panel p {
  margin: 0;
  color: rgba(255, 225, 196, 0.72);
  font-size: 12px;
}

.video-settings-panel p b {
  color: #ff9b66;
  font-weight: 600;
}

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

.video-model-grid button {
  display: grid;
  min-height: 62px;
  gap: 5px;
  border: 1px solid rgba(255, 230, 205, 0.16);
  border-radius: 10px;
  padding: 10px 11px;
  background: rgba(255, 246, 235, 0.07);
  color: rgba(255, 241, 228, 0.86);
  text-align: left;
}

.video-model-grid button strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-model-grid button span {
  color: rgba(255, 220, 190, 0.56);
  font-size: 11px;
}

.video-model-grid button:hover,
.video-model-grid button.active {
  border-color: rgba(255, 126, 69, 0.62);
  background: linear-gradient(135deg, rgba(240, 106, 51, 0.22), rgba(244, 190, 104, 0.08));
  color: #ffd5bd;
}

.video-settings-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.video-duration-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: rgba(255, 220, 190, 0.56);
  font-size: 11px;
}

.video-duration-control input {
  width: 100%;
  accent-color: #ef783f;
}

.video-audio-option {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -2px 0 14px;
  color: rgba(255, 238, 219, 0.78);
  font-size: 12px;
}

.video-audio-option input {
  accent-color: #ef783f;
}

.video-settings-panel footer {
  border-top: 1px solid rgba(255, 226, 195, 0.12);
  padding-top: 12px;
  color: rgba(255, 221, 193, 0.52);
  font-size: 12px;
}

.generate-page .model-grid button,
.generate-page .option-grid button,
.generate-page .video-model-grid button {
  position: relative;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.generate-page .model-grid button:hover,
.generate-page .option-grid button:hover,
.generate-page .video-model-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 178, 112, 0.42);
  background: rgba(255, 130, 58, 0.12);
}

.generate-page .model-grid button.active,
.generate-page .option-grid button.active,
.generate-page .video-model-grid button.active {
  border-color: rgba(255, 151, 80, 0.54);
  background: linear-gradient(135deg, rgba(255, 151, 80, 0.22), rgba(191, 53, 28, 0.16));
  color: #ffd7bd;
  box-shadow: inset 0 0 0 1px rgba(255, 190, 132, 0.2), 0 8px 22px rgba(197, 70, 30, 0.14);
}

.generate-page .model-grid button.active::after,
.generate-page .option-grid button.active::after,
.generate-page .video-settings-panel .video-model-grid button.active::after,
.generate-page .video-settings-panel .option-grid button.active::after {
  content: none;
}

.image-settings-panel footer {
  border-top: 1px solid rgba(255, 226, 195, 0.12);
  margin: 0;
  padding-top: 12px;
  color: rgba(255, 221, 193, 0.52);
  font-size: 12px;
}

.composer-toolbar .send {
  margin-left: auto;
  min-width: 42px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.composer-toolbar .send:disabled,
.canvas-generate:disabled {
  cursor: progress;
  opacity: 0.72;
}

.generated-output {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

.generated-output article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 195, 0.16);
  border-radius: 8px;
  background: rgba(255, 246, 235, 0.07);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.generated-output img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.generated-output a {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(255, 232, 206, 0.18);
  border-radius: 7px;
  padding: 5px 9px;
  background: rgba(10, 8, 7, 0.72);
  color: #fff2e2;
  font-size: 12px;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.generated-meta {
  grid-column: 1 / -1;
  color: rgba(255, 221, 193, 0.58);
  font-size: 12px;
}

.shortcut-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0 34px;
}

.shortcut-row button {
  display: grid;
  min-height: 88px;
  grid-template-columns: 44px 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 246, 235, 0.08);
  color: var(--ink);
  text-align: left;
  backdrop-filter: blur(16px);
}

.shortcut-row button span {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff4df, #ff7c35 55%, #421915);
  color: #fffaf2;
  font-size: 22px;
}

.shortcut-row strong {
  align-self: end;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-bar,
.skill-heading,
.library-head,
.asset-head,
.asset-filters,
.studio-tabs,
.page-actions,
.library-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#inspire .content-bar {
  margin-bottom: 24px;
}

.tabs,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs button,
.filter-row button {
  padding: 0 18px;
}

.tabs button.active,
.filter-row button.active,
.filters button.active,
.asset-filters button.active,
.segmented button.active {
  border-color: rgba(240, 106, 51, 0.42);
  background: rgba(240, 106, 51, 0.18);
  color: #ffd3c3;
  font-weight: 700;
}

.search-box,
.search-lite {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--muted);
}

.search-box {
  width: min(320px, 42vw);
}

.search-box.compact {
  width: min(260px, 38vw);
}

.search-lite {
  min-width: 160px;
}

.search-box input,
.search-lite input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.inspire-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.image-card,
.material-grid article,
.skill-card,
.canvas-cards article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 246, 235, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.image-card {
  position: relative;
  min-height: 260px;
  aspect-ratio: 1 / 1.22;
}

.image-card img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  transition: transform 260ms ease;
}

.image-card:hover img {
  transform: scale(1.035);
}

.image-card div {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(7, 6, 5, 0.54);
  backdrop-filter: blur(18px);
}

.image-card strong,
.material-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card span,
.material-grid span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 243, 233, 0.74);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.two-column {
  display: grid;
  min-height: calc(var(--workbench-height) - 48px);
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 241, 232, 0.95);
  color: #201a15;
  box-shadow: var(--shadow);
  transition: grid-template-columns 220ms ease;
}

.generate-layout.subrail-collapsed,
.skills-layout.subrail-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.generate-layout .generate-subrail,
.skills-layout .skills-subrail {
  min-width: 0;
  transition: padding 220ms ease;
}

.generate-layout.subrail-collapsed .generate-subrail,
.skills-layout.subrail-collapsed .skills-subrail {
  z-index: 30;
  align-items: center;
  width: 0;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.generate-layout.subrail-collapsed .generate-subrail header,
.skills-layout.subrail-collapsed .skills-subrail header {
  position: absolute;
  top: 24px;
  left: 14px;
  width: auto;
  justify-content: flex-start;
}

.generate-layout.subrail-collapsed .generate-subrail h2,
.generate-layout.subrail-collapsed .generate-subrail > p,
.generate-layout.subrail-collapsed .generate-subrail > .rail-action,
.generate-layout.subrail-collapsed .generate-subrail > .rail-thread,
.skills-layout.subrail-collapsed .skills-subrail h2,
.skills-layout.subrail-collapsed .skills-subrail > p,
.skills-layout.subrail-collapsed .skills-subrail > .rail-action,
.skills-layout.subrail-collapsed .skills-subrail > .rail-thread {
  display: none;
}

.generate-layout.subrail-collapsed .subrail-toggle,
.skills-layout.subrail-collapsed .subrail-toggle {
  width: 34px;
  height: 34px;
  transform: rotate(180deg);
  border-color: rgba(255, 151, 80, 0.28);
  background: rgba(29, 20, 15, 0.88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.skills-layout.subrail-collapsed .skills-subrail header {
  top: 24px;
  left: 16px;
}

.skills-layout.subrail-collapsed .panel-page {
  padding-left: 72px;
}

.generate-filter-picker {
  position: relative;
}

.generate-time-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 80;
  display: grid;
  width: 116px;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 181, 113, 0.28);
  border-radius: 9px;
  background: rgba(20, 14, 11, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -5px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.generate-filter-picker.open .generate-time-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.generate-time-menu button {
  width: 100%;
  min-height: 34px;
  border-radius: 7px;
  text-align: center;
}

.generate-time-menu button:hover,
.generate-time-menu button.active {
  background: linear-gradient(135deg, rgba(255, 151, 80, 0.22), rgba(191, 53, 28, 0.16));
  color: #ffd7bd;
}

.generate-search {
  display: inline-flex;
  width: 228px;
  align-items: center;
  overflow: hidden;
  transition: width 180ms ease, border-color 180ms ease, background 180ms ease;
}

.generate-search.collapsed {
  width: 28px;
  border-color: transparent;
  background: transparent;
}

.generate-search.collapsed .generate-search-input {
  display: none;
}

.generate-search-toggle {
  flex: 0 0 28px;
  min-width: 28px;
  min-height: 28px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-align: center;
}

.generate-search-toggle:hover {
  color: #ff9a5f !important;
}

.generate-search-input {
  width: 178px;
  min-width: 178px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.generation-session.filter-empty::after {
  display: block;
  margin: 56px auto;
  color: rgba(255, 225, 196, 0.52);
  text-align: center;
  content: "没有符合筛选条件的生成记录";
}

.generation-history-list {
  display: grid;
  gap: 24px;
  margin-top: 38px;
}

.generate-page[data-generate-state] .floating-composer .send {
  border-color: rgba(255, 166, 102, 0.38) !important;
  background: linear-gradient(135deg, #8f4423, #d66a35) !important;
  color: #fff4e9 !important;
  box-shadow: inset 0 1px 0 rgba(255, 239, 222, 0.16), 0 8px 20px rgba(165, 67, 28, 0.22);
}

.generate-page[data-generate-state] .floating-composer .send:hover:not(:disabled) {
  background: linear-gradient(135deg, #a65027, #ef7a3d) !important;
  color: #fff !important;
}

.subrail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 14px;
  border-right: 1px solid rgba(56, 43, 32, 0.12);
  background: #fbfaf5;
}

.subrail header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subrail h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.subrail p {
  margin: 12px 0 0;
  color: #7d746b;
  font-size: 13px;
}

.subrail button {
  color: inherit;
  text-align: left;
}

.rail-action,
.rail-thread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
}

.rail-action.active,
.rail-thread.active {
  background: #eee9dd;
  font-weight: 700;
}

.rail-thread {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-thread span {
  flex: 0 0 auto;
  margin-left: 8px;
  color: #938b82;
  font-size: 11px;
}

.panel-page {
  min-width: 0;
  padding: 24px 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(239, 234, 224, 0.8)),
    #f5f2eb;
}

.page-actions {
  justify-content: flex-end;
  margin-bottom: 28px;
  color: #342b24;
}

.page-actions button,
.search-lite {
  border-color: rgba(52, 42, 34, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.generate-page[data-generate-state] .page-actions button:not(.solid-light),
.generate-page[data-generate-state] .load-older {
  border: 0;
  box-shadow: none;
}

.solid-light {
  background: #fffaf2 !important;
}

.strip-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  max-width: 800px;
  margin: 0 auto;
}

.strip-gallery img,
.result-grid img {
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.strip-gallery img {
  aspect-ratio: 1 / 1.06;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 800px;
  margin: 14px auto 18px;
}

.chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  border-color: rgba(52, 42, 34, 0.08);
  background: rgba(255, 255, 255, 0.66);
  color: #5c5149;
  font-size: 12px;
}

.prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  max-width: 800px;
  margin: 0 auto 16px;
  color: #655d54;
  font-size: 13px;
}

.prompt-meta strong {
  min-width: 240px;
  max-width: 430px;
  overflow: hidden;
  color: #201a15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  max-width: 808px;
  margin: 0 auto;
}

.result-grid article {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.result-grid img {
  aspect-ratio: 3 / 4;
}

.hover-tools {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(8, 7, 6, 0.58);
  color: white;
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.floating-composer {
  max-width: 860px;
  min-height: 168px;
  margin: 28px auto 0;
  border-color: rgba(41, 31, 23, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.floating-composer .composer-toolbar {
  padding: 14px 18px;
}

.floating-composer button,
.floating-composer .composer-toolbar button {
  border-color: rgba(45, 33, 24, 0.08);
  background: #f5f1ea;
  color: #473d35;
}

.floating-composer .send {
  background: #ebe6df !important;
  color: #a69c92 !important;
}

.generate-page {
  position: relative;
}

.generate-page[data-generate-state] .strip-gallery,
.generate-page[data-generate-state] .chip-row,
.generate-page[data-generate-state] > .prompt-meta,
.generate-page[data-generate-state] > .result-grid {
  display: none;
}

.generate-empty-title {
  display: none;
  margin: clamp(90px, 17vh, 160px) auto 28px;
  color: #201a15;
  font-size: 28px;
  font-weight: 500;
  text-align: center;
}

.generate-page[data-generate-state="compose"] .generate-empty-title {
  display: block;
}

.generation-session[hidden] {
  display: none;
}

.generate-page[data-generate-state] .floating-composer {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px 14px;
  padding: 18px;
}

.generate-page[data-generate-state="compose"] .floating-composer {
  max-width: 880px;
  min-height: 210px;
  margin: 0 auto;
}

.generate-page[data-generate-state="history"] {
  padding-bottom: 220px;
}

.generate-page[data-generate-state="history"] .floating-composer {
  position: absolute;
  right: 36px;
  bottom: 28px;
  left: 36px;
  max-width: 860px;
  min-height: 150px;
  margin: 0 auto;
}

.generate-page[data-generate-state] .reference-uploader.compact {
  grid-column: 1;
  padding: 0;
}

.generate-page[data-generate-state] .upload-tile.small {
  margin: 0;
}

.generate-page[data-generate-state] .generate-prompt {
  grid-column: 2;
  min-height: 96px;
  max-height: 210px;
  overflow: auto;
  padding: 8px 0;
  color: #1f1914;
  font-size: 15px;
}

.generate-page[data-generate-state="history"] .generate-prompt {
  min-height: 54px;
}

.generate-prompt:empty::before {
  color: #9a9389;
  content: attr(data-placeholder);
}

.generate-page[data-generate-state] .floating-composer .composer-toolbar {
  grid-column: 1 / -1;
  padding: 0;
}

.generation-session {
  max-width: 900px;
  margin: 18px auto 0;
}

.load-older {
  display: block;
  min-height: 34px;
  margin: 0 auto 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.68);
  color: #5e554d;
  box-shadow: none;
}

.generation-day h2 {
  margin: 0 0 18px;
  color: #17130f;
  font-size: 28px;
  font-weight: 500;
}

.generation-record {
  display: grid;
  gap: 14px;
}

.generation-status {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(240, 106, 51, 0.28);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 238, 229, 0.78);
  color: #cc5036;
}

.generation-status.running {
  border-color: rgba(225, 145, 65, 0.28);
  background: rgba(255, 244, 225, 0.72);
  color: #9b6127;
}

.generation-status.success {
  border-color: rgba(85, 152, 99, 0.28);
  background: rgba(234, 250, 238, 0.72);
  color: #37784d;
}

.generation-retry {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.86);
  color: #5f5046;
}

.prompt-detail-trigger {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.prompt-detail-trigger:hover,
.prompt-detail-trigger[aria-expanded="true"] {
  color: #f06a33;
}

.generation-cost {
  color: #8b5a2f;
}

.prompt-detail-panel {
  max-width: 900px;
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(238, 233, 220, 0.9);
  color: #1f1913;
}

.prompt-detail-panel[hidden] {
  display: none;
}

.prompt-detail-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.prompt-detail-panel footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  color: rgba(85, 72, 60, 0.68);
  font-size: 12px;
}

.generation-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.generation-results article {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.generation-image-tools {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.generation-image-card:hover .generation-image-tools,
.generation-image-card:focus-within .generation-image-tools {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.generation-image-action {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  padding: 0;
  color: #fff7ef;
  background: rgba(22, 17, 14, 0.78);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.generation-image-action:hover {
  border-color: rgba(255, 177, 112, 0.68);
  background: rgba(101, 53, 28, 0.94);
}

.generation-image-action:disabled {
  opacity: 0.42;
  cursor: default;
}

.generation-image-upscale.is-loading {
  animation: generation-tool-pulse 850ms ease-in-out infinite alternate;
}

@keyframes generation-tool-pulse {
  to { color: #ffb477; box-shadow: 0 0 0 5px rgba(239, 120, 57, 0.12); }
}

.generation-results img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 180ms ease, filter 180ms ease;
}

.generation-results article:hover img,
.generation-results img:focus-visible {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.generation-results img:focus-visible {
  outline: 2px solid #e9783f;
  outline-offset: -3px;
}

.generation-video-results {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.generation-video-card {
  border: 1px solid rgba(255, 168, 103, 0.22);
  background: rgba(10, 8, 7, 0.68);
}

.generation-video-card video {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #080706;
  object-fit: contain;
}

.generation-video-download {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(255, 199, 154, 0.26);
  border-radius: 8px;
  padding: 8px 11px;
  background: rgba(24, 17, 13, 0.82);
  color: #ffe0c8;
  font-size: 12px;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

body.generation-preview-open {
  overflow: hidden;
}

.generation-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(5, 3, 2, 0.92);
  backdrop-filter: blur(16px);
}

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

.generation-preview-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: min(1120px, 94vw);
  height: min(850px, 90vh);
  border: 1px solid rgba(232, 120, 63, 0.28);
  border-radius: 20px;
  background: radial-gradient(circle at 50% 10%, rgba(137, 67, 30, 0.22), transparent 42%), #0d0a08;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.generation-preview-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  justify-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 46px 90px 54px;
  overflow: hidden;
  touch-action: pan-y;
}

.generation-preview-viewport {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.generation-preview-viewport img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  transform: scale(1);
  transform-origin: center;
  transition: transform 100ms ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.generation-preview-stage figcaption {
  display: flex;
  gap: 12px;
  color: rgba(255, 230, 210, 0.55);
  font-size: 12px;
}

.generation-preview-count {
  color: #f2a170;
  font-weight: 700;
}

.generation-preview-zoom {
  min-width: 42px;
  color: rgba(255, 230, 210, 0.72);
  text-align: right;
}

.generation-upscale-results {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 203, 164, 0.13);
}

.generation-upscale-item {
  display: grid;
  gap: 10px;
}

.generation-upscale-item > header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: rgba(255, 235, 220, 0.68);
  font-size: 12px;
}

.generation-upscale-item > header strong {
  color: #f0a36f;
  font-size: 13px;
}

.generation-upscale-item.is-running > header::before {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(238, 151, 92, 0.25);
  border-top-color: #ee975c;
  border-radius: 50%;
  content: "";
  animation: generation-upscale-spin 800ms linear infinite;
}

.generation-upscale-item.is-error > header strong,
.generation-upscale-item.is-error > header span {
  color: #ff9f8d;
}

.generation-upscale-item > .generation-image-card {
  position: relative;
  width: min(280px, 100%);
  overflow: hidden;
  border-radius: 8px;
}

.generation-upscale-item > .generation-image-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  cursor: zoom-in;
}

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

.generation-preview-close,
.generation-preview-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 220, 195, 0.18);
  color: #ffe8d7;
  background: rgba(30, 21, 16, 0.82);
  backdrop-filter: blur(10px);
}

.generation-preview-close {
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
}

.generation-preview-nav {
  top: 50%;
  width: 48px;
  height: 64px;
  border-radius: 14px;
  transform: translateY(-50%);
  font-size: 40px;
}

.generation-preview-prev { left: 20px; }
.generation-preview-next { right: 20px; }

.generation-preview-close:hover,
.generation-preview-nav:hover {
  border-color: rgba(232, 120, 63, 0.75);
  background: rgba(104, 47, 23, 0.9);
}

.generation-preview-download {
  position: absolute;
  right: 22px;
  bottom: 20px;
  padding: 10px 16px;
  border: 1px solid rgba(232, 120, 63, 0.46);
  border-radius: 10px;
  color: #fff0e4;
  background: linear-gradient(135deg, #8f4423, #d66a35);
  text-decoration: none;
  font-size: 13px;
}

@media (max-width: 720px) {
  .generation-preview-modal { padding: 0; }
  .generation-preview-shell { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .generation-preview-stage { padding: 64px 18px 84px; }
  .generation-preview-nav { width: 42px; height: 54px; opacity: 0.84; }
  .generation-preview-prev { left: 8px; }
  .generation-preview-next { right: 8px; }
  .generation-preview-download { right: 16px; bottom: 18px; }
}

.hover-tools a {
  color: white;
  text-decoration: none;
}

.skill-heading {
  margin-bottom: 18px;
}

.skill-heading .tabs button,
.filter-row button,
.filters button,
.asset-filters button {
  border-color: rgba(42, 32, 24, 0.1);
  background: rgba(255, 255, 255, 0.66);
  color: #2e2721;
}

.skill-heading .tabs button.active,
.filter-row button.active,
.filters button.active,
.asset-filters button.active {
  color: #ba4e32;
}

.library-page .tabs button.active,
.assets-page .tabs button.active,
.studio-tabs button.active {
  border-color: rgba(240, 106, 51, 0.42);
  background: #fff0e8;
  color: #ba4e32;
}

.skill-heading b {
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: #cf6344;
  color: white;
  font-size: 11px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.skill-card {
  position: relative;
  display: grid;
  min-height: 132px;
  gap: 10px;
  padding: 18px 42px 18px 18px;
  border-color: rgba(41, 31, 23, 0.09);
  background: rgba(255, 255, 255, 0.62);
  color: #231c17;
}

.skill-card button {
  position: absolute;
  right: 14px;
  top: 16px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: #e8e3da;
  color: #746d64;
}

.skill-card.featured button {
  background: #fae8dd;
  color: #ce5b3b;
}

.skill-card h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: #64584f;
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.skill-card small {
  color: #8a8178;
}

.studio-page,
.library-page,
.assets-page {
  min-height: calc(var(--workbench-height) - 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(242, 238, 229, 0.96)),
    #f5f2eb;
  color: #201a15;
  box-shadow: var(--shadow);
}

.studio-page {
  padding: 20px 36px 34px;
}

.studio-tabs {
  min-height: 48px;
  margin-bottom: 18px;
}

.studio-tabs span {
  margin-left: auto;
  color: #7c746c;
  font-size: 13px;
}

.studio-layout {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 28px;
}

.form-panel {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(42, 32, 24, 0.09);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.segmented {
  display: flex;
  gap: 8px;
}

.segmented button {
  flex: 1;
  color: #433a33;
}

.upload-group {
  display: grid;
  gap: 8px;
}

.upload-group header {
  display: flex;
  justify-content: space-between;
}

.upload-group p {
  margin: 0;
  color: #746b62;
  font-size: 12px;
}

.dropzone {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 1px dashed rgba(44, 34, 26, 0.14);
  border-radius: 8px;
  background: #faf8f3;
  color: #7d766e;
}

.dropzone span {
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.settings-grid label,
.notes {
  display: grid;
  gap: 8px;
  color: #201a15;
  font-size: 13px;
}

.settings-grid select,
.notes textarea {
  width: 100%;
  border: 1px solid rgba(42, 32, 24, 0.11);
  border-radius: 8px;
  background: #fffdf8;
  color: #1d1712;
}

.settings-grid select {
  min-height: 38px;
  padding: 0 12px;
}

.notes textarea {
  min-height: 90px;
  resize: vertical;
  padding: 14px;
}

.primary-action,
.primary-small {
  border-radius: 8px;
  background: linear-gradient(135deg, #efb29b, #d05d3f);
  color: white;
  font-weight: 700;
}

.primary-action {
  min-height: 50px;
}

.primary-small {
  min-height: 38px;
  padding: 0 18px;
}

.studio-canvas {
  display: grid;
  min-height: 660px;
  align-content: center;
  border-top: 1px solid rgba(42, 32, 24, 0.08);
  background:
    linear-gradient(90deg, transparent, rgba(240, 106, 51, 0.04), transparent),
    linear-gradient(rgba(40, 33, 27, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 33, 27, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
}

.empty-state,
.history-line {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: #655b52;
}

.empty-state span {
  color: #dd9c84;
  font-size: 36px;
}

.history-line {
  align-self: end;
  margin-top: 120px;
  padding-top: 22px;
  border-top: 1px solid rgba(42, 32, 24, 0.08);
}

.canvas-page {
  position: relative;
  min-height: calc(var(--workbench-height) - 48px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #070707, #020202);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 36px;
}

.canvas-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.round-btn,
.dark-pill,
.white-pill {
  min-height: 44px;
  padding: 0 18px;
}

.round-btn {
  width: 44px;
  border-radius: 50%;
  background: #242424;
  color: white;
}

.dark-pill {
  background: #242424;
  color: #f6f0e8;
}

.white-pill {
  background: #f9f6f1;
  color: #1e1a16;
  font-weight: 700;
}

.canvas-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1104px;
  margin: 10px auto;
}

.canvas-card,
.canvas-cards article {
  display: grid;
  min-height: 176px;
  align-content: space-between;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(38, 38, 38, 0.84);
  color: #f6f0e8;
  padding: 22px;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.canvas-card:hover {
  border-color: rgba(255, 181, 113, 0.34);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.36),
    0 0 30px rgba(240, 106, 51, 0.14);
  transform: translateY(-2px);
}

.canvas-cards label {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 23px;
  font-weight: 800;
}

.canvas-cards input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.canvas-cards p {
  margin: 0 0 30px 28px;
  color: #b8b3ad;
}

.canvas-cards footer {
  display: flex;
  justify-content: space-between;
  color: #8f8a84;
  font-size: 13px;
}

.canvas-card-actions {
  display: inline-flex;
  gap: 8px;
}

.canvas-card-actions button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 246, 235, 0.07);
  color: inherit;
}

.canvas-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed rgba(255, 220, 184, 0.18);
  border-radius: 8px;
  color: rgba(255, 229, 205, 0.58);
}

.canvas-workspace {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 48px 1fr;
  background:
    linear-gradient(rgba(255, 255, 255, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.048) 1px, transparent 1px),
    linear-gradient(180deg, #151412, #0d0c0b);
  background-size: 46px 46px, 46px 46px, 100% 100%;
}

.canvas-workspace[hidden] {
  display: none;
}

.canvas-workbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 230, 205, 0.1);
  padding: 0 22px;
  background: rgba(18, 15, 13, 0.9);
  color: rgba(255, 238, 222, 0.82);
  backdrop-filter: blur(18px);
}

.canvas-workbar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-current-title {
  font-size: 15px;
}

.canvas-board {
  position: relative;
  min-height: 0;
}

.canvas-focus-node {
  position: absolute;
  left: 50%;
  top: 25%;
  display: grid;
  width: 310px;
  height: 218px;
  place-items: center;
  border: 2px solid #2777f8;
  background: rgba(47, 43, 40, 0.86);
  color: rgba(255, 238, 222, 0.42);
  transform: translateX(-50%);
}

.node-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 246, 235, 0.08);
  color: rgba(255, 238, 222, 0.42);
  font-size: 24px;
}

.node-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: #262320;
  transform: translateY(-50%);
}

.node-handle.left {
  left: -8px;
}

.node-handle.right {
  right: -8px;
}

.canvas-focus-node.has-image {
  overflow: clip;
  overscroll-behavior: none;
  background: rgba(10, 8, 7, 0.9);
}

.canvas-focus-node.has-image .node-icon,
.canvas-focus-node.has-image > span:not(.node-handle) {
  opacity: 0;
}

.canvas-node-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.node-handle {
  z-index: 2;
}

.canvas-prompt-card {
  position: absolute;
  left: 50%;
  top: calc(25% + 232px);
  display: grid;
  width: 454px;
  border: 1px solid rgba(255, 230, 205, 0.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(31, 28, 25, 0.9);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateX(-50%);
}

.canvas-prompt-card textarea {
  min-height: 126px;
  resize: none;
  border: 1px solid rgba(56, 104, 190, 0.44);
  border-radius: 12px;
  padding: 14px;
  outline: none;
  background: rgba(23, 21, 20, 0.74);
  color: #fff4e8;
}

.canvas-prompt-card textarea::placeholder {
  color: rgba(255, 232, 206, 0.34);
}

.canvas-prompt-tools,
.canvas-zoom,
.canvas-tool-dock {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-prompt-tools {
  padding-top: 10px;
}

.canvas-prompt-tools button,
.canvas-zoom button,
.canvas-tool-dock button {
  min-height: 34px;
  border: 1px solid rgba(255, 230, 205, 0.13);
  border-radius: 9px;
  padding: 0 12px;
  background: rgba(255, 246, 235, 0.08);
  color: rgba(255, 238, 222, 0.78);
}

.canvas-generate {
  margin-left: auto;
  color: rgba(255, 220, 186, 0.46) !important;
}

.canvas-zoom {
  position: absolute;
  left: 20px;
  bottom: 26px;
  min-height: 42px;
  border: 1px solid rgba(255, 230, 205, 0.12);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(27, 24, 22, 0.82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.canvas-zoom input {
  width: 96px;
  accent-color: #fff2df;
}

.canvas-zoom span {
  min-width: 42px;
  color: rgba(255, 238, 222, 0.78);
  font-size: 12px;
}

.canvas-tool-dock {
  position: absolute;
  left: 50%;
  bottom: 26px;
  min-height: 42px;
  border: 1px solid rgba(255, 230, 205, 0.12);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(27, 24, 22, 0.82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.canvas-tool-dock button {
  width: 30px;
  padding: 0;
  background: transparent;
}

.canvas-tool-dock .danger {
  color: #ff6f61;
}

.library-page,
.assets-page {
  padding: 22px 36px 40px;
}

.library-head,
.asset-head {
  margin-bottom: 18px;
}

.filters {
  display: grid;
  grid-template-columns: 72px repeat(8, max-content);
  gap: 10px 8px;
  align-items: center;
  max-width: 1280px;
}

.filters span {
  color: #756c64;
  font-size: 13px;
}

.filters button {
  padding: 0 14px;
}

.library-tools {
  margin: 18px 0;
  color: #756c64;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.material-grid article {
  display: grid;
  gap: 8px;
  border-color: rgba(40, 30, 22, 0.08);
  background: rgba(255, 255, 255, 0.7);
  padding-bottom: 10px;
}

.material-grid img {
  width: 100%;
  aspect-ratio: 0.86 / 1;
  object-fit: cover;
}

.material-grid strong,
.material-grid span {
  padding: 0 10px;
  color: #1f1914;
}

.material-grid span {
  color: #83786f;
}

.asset-filters {
  justify-content: flex-start;
  margin-bottom: 24px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(116px, 1fr));
  gap: 12px;
}

.asset-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(40, 30, 22, 0.08);
  border-radius: 8px;
  background: #fff;
}

.asset-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.asset-card::after {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(8, 7, 6, 0.5);
  color: white;
  content: "↗";
  opacity: 0;
  transition: opacity 160ms ease;
}

.asset-card:hover::after {
  opacity: 1;
}

.load-more {
  display: block;
  min-height: 38px;
  margin: 22px auto 0;
  border: 1px solid rgba(40, 30, 22, 0.11);
  border-radius: 8px;
  padding: 0 18px;
  background: #f6f1e8;
  color: #4d443c;
}

.two-column,
.studio-page,
.library-page,
.assets-page {
  position: relative;
  isolation: isolate;
  border-color: rgba(255, 174, 103, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 140, 54, 0.13), transparent 30%),
    linear-gradient(112deg, rgba(255, 229, 181, 0.07), transparent 28%, rgba(7, 6, 5, 0.36) 72%),
    linear-gradient(180deg, rgba(28, 23, 18, 0.9), rgba(8, 7, 6, 0.98));
  color: var(--ink);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.two-column::before,
.studio-page::before,
.library-page::before,
.assets-page::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 245, 231, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 245, 231, 0.024) 1px, transparent 1px),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.54));
  background-size: 30px 30px, 30px 30px, 100% 100%;
  opacity: 0.58;
  content: "";
}

.two-column > *,
.studio-page > *,
.library-page > *,
.assets-page > * {
  position: relative;
  z-index: 1;
}

.subrail {
  border-right-color: rgba(255, 181, 113, 0.17);
  background:
    linear-gradient(180deg, rgba(255, 211, 156, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(16, 12, 9, 0.82), rgba(8, 7, 6, 0.92));
  color: rgba(255, 240, 222, 0.82);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.035);
}

.subrail h2 {
  color: var(--ink-strong);
}

.subrail p,
.rail-thread span {
  color: rgba(255, 224, 193, 0.54);
}

.rail-action,
.rail-thread {
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 242, 230, 0.74);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.rail-action:hover,
.rail-thread:hover {
  border-color: rgba(255, 184, 122, 0.18);
  background: rgba(255, 126, 48, 0.09);
  color: rgba(255, 250, 242, 0.92);
  transform: translateX(1px);
}

.rail-action.active,
.rail-thread.active {
  border-color: rgba(255, 181, 113, 0.26);
  background:
    linear-gradient(135deg, rgba(240, 106, 51, 0.28), rgba(255, 224, 180, 0.08));
  color: #fff5ea;
  box-shadow:
    0 12px 26px rgba(240, 92, 40, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.panel-page {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 244, 228, 0.06), rgba(255, 130, 54, 0.04) 46%, rgba(7, 6, 5, 0.22));
}

.page-actions,
.library-tools,
.studio-tabs span,
.filters span,
.asset-filters {
  color: rgba(255, 227, 203, 0.62);
}

.page-actions button,
.search-lite,
.search-box,
.chip-row span,
.skill-heading .tabs button,
.filter-row button,
.filters button,
.asset-filters button,
.studio-tabs button,
.segmented button,
.library-tools button,
.load-more {
  border-color: rgba(255, 226, 195, 0.14);
  background: rgba(10, 8, 7, 0.46);
  color: rgba(255, 244, 232, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
}

.page-actions button:hover,
.search-lite:hover,
.search-box:hover,
.chip-row span:hover,
.skill-heading .tabs button:hover,
.filter-row button:hover,
.filters button:hover,
.asset-filters button:hover,
.studio-tabs button:hover,
.segmented button:hover,
.library-tools button:hover,
.load-more:hover {
  border-color: rgba(255, 178, 112, 0.28);
  background: rgba(255, 133, 54, 0.12);
  color: #fff7ee;
}

.panel-page.generate-page[data-generate-state] .page-actions button:not(.solid-light) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: rgba(255, 232, 210, 0.84);
}

.panel-page.generate-page[data-generate-state] .page-actions button:not(.solid-light):hover {
  border-color: transparent;
  background: transparent;
  color: #ffbd8f;
}

.tabs button.active,
.filter-row button.active,
.filters button.active,
.asset-filters button.active,
.segmented button.active,
.library-page .tabs button.active,
.assets-page .tabs button.active,
.studio-tabs button.active {
  border-color: rgba(255, 173, 100, 0.38);
  background:
    linear-gradient(135deg, rgba(240, 106, 51, 0.32), rgba(244, 190, 104, 0.1));
  color: #ffcfaf;
  box-shadow:
    0 12px 28px rgba(234, 87, 35, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.solid-light,
.primary-small {
  border-color: rgba(255, 198, 132, 0.34) !important;
  background: linear-gradient(135deg, #ffb15f, #f06a33 54%, #8d2319) !important;
  color: #fffaf3 !important;
  box-shadow: 0 14px 28px rgba(240, 93, 40, 0.24);
}

.search-box input,
.search-lite input {
  color: #fff4e8;
}

.search-box input::placeholder,
.search-lite input::placeholder,
.notes textarea::placeholder {
  color: rgba(255, 232, 206, 0.46);
}

.strip-gallery img,
.result-grid article,
.material-grid article,
.asset-card {
  border: 1px solid rgba(255, 216, 174, 0.16);
  background: rgba(255, 246, 235, 0.06);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.strip-gallery img,
.result-grid img,
.material-grid img,
.asset-card img {
  filter: saturate(1.04) contrast(1.02);
}

.prompt-meta {
  border: 1px solid rgba(255, 222, 185, 0.14);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(10, 8, 7, 0.34);
  color: rgba(255, 229, 205, 0.66);
  backdrop-filter: blur(14px);
}

.prompt-meta strong {
  color: #fff6ec;
}

.panel-page.generate-page[data-generate-state] .generation-record .prompt-meta,
.panel-page.generate-page[data-generate-state] > .prompt-meta {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.panel-page.generate-page[data-generate-state] .prompt-detail-trigger {
  color: rgba(255, 230, 207, 0.72);
}

.panel-page.generate-page[data-generate-state] .prompt-detail-trigger:hover,
.panel-page.generate-page[data-generate-state] .prompt-detail-trigger[aria-expanded="true"] {
  color: #ffb37f;
}

.panel-page.generate-page[data-generate-state] .generation-cost {
  color: #ffd0ab;
}

.panel-page.generate-page[data-generate-state] .prompt-detail-panel {
  background:
    linear-gradient(180deg, rgba(255, 246, 235, 0.12), rgba(255, 128, 54, 0.07)),
    rgba(11, 8, 6, 0.58);
  color: rgba(255, 242, 229, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel-page.generate-page[data-generate-state] .prompt-detail-panel footer {
  color: rgba(255, 218, 187, 0.56);
}

.floating-composer {
  border-color: rgba(255, 219, 183, 0.17);
  background:
    linear-gradient(180deg, rgba(255, 242, 224, 0.12), rgba(255, 126, 48, 0.08)),
    rgba(8, 7, 6, 0.76);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.floating-composer button,
.floating-composer .composer-toolbar button {
  border-color: rgba(255, 226, 195, 0.14);
  background: rgba(255, 246, 235, 0.08);
  color: rgba(255, 240, 224, 0.86);
}

.floating-composer .send {
  background: rgba(244, 190, 104, 0.12) !important;
  color: rgba(255, 225, 190, 0.72) !important;
}

.panel-page.generate-page[data-generate-state] {
  min-height: calc(var(--workbench-height) - 48px);
}

.panel-page.generate-page[data-generate-state="compose"] .floating-composer,
.panel-page.generate-page[data-generate-state="history"] .floating-composer {
  border-color: rgba(255, 219, 183, 0.17);
  background:
    linear-gradient(180deg, rgba(255, 242, 224, 0.12), rgba(255, 126, 48, 0.08)),
    rgba(8, 7, 6, 0.76);
}

.panel-page.generate-page[data-generate-state] .generate-prompt {
  color: rgba(255, 248, 240, 0.92);
}

.panel-page.generate-page[data-generate-state] .generate-prompt:empty::before {
  color: rgba(255, 232, 206, 0.48);
}

.panel-page.generate-page[data-generate-state] .generate-empty-title,
.panel-page.generate-page[data-generate-state] .generation-day h2 {
  color: #fff6ed;
}

.panel-page.generate-page[data-generate-state] .load-older {
  border: 0;
  background: rgba(10, 8, 7, 0.46);
  color: rgba(255, 244, 232, 0.82);
  box-shadow: none;
}

.panel-page.generate-page[data-generate-state] .generation-status {
  border-color: rgba(255, 120, 86, 0.36);
  background: rgba(83, 30, 22, 0.52);
  color: #ffb2a0;
}

.panel-page.generate-page[data-generate-state] .generation-status.running {
  border-color: rgba(255, 181, 113, 0.3);
  background: rgba(89, 55, 24, 0.46);
  color: #ffd7ab;
}

.panel-page.generate-page[data-generate-state] .generation-status.success {
  border-color: rgba(137, 210, 142, 0.25);
  background: rgba(23, 75, 42, 0.4);
  color: #bdf2c1;
}

.panel-page.generate-page[data-generate-state] .generation-retry {
  background: rgba(255, 246, 235, 0.12);
  color: rgba(255, 245, 236, 0.9);
}

.skill-card {
  border-color: rgba(255, 218, 181, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 246, 235, 0.085), rgba(255, 138, 62, 0.045)),
    rgba(12, 10, 9, 0.72);
  color: var(--ink);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.skill-card:hover {
  border-color: rgba(255, 173, 100, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 246, 235, 0.11), rgba(255, 117, 43, 0.08)),
    rgba(13, 10, 8, 0.78);
  transform: translateY(-1px);
}

.skill-card button,
.skill-card.featured button {
  background: rgba(255, 226, 190, 0.12);
  color: #ffc29a;
}

.skill-card h3 {
  color: #fff7ed;
}

.skill-card p {
  color: rgba(255, 231, 210, 0.68);
}

.skill-card small {
  color: rgba(255, 219, 190, 0.52);
}

.skill-heading b {
  background: linear-gradient(135deg, #ffaf62, #d75935);
  color: #fff7ef;
}

.form-panel {
  border-color: rgba(255, 218, 182, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 246, 235, 0.09), rgba(255, 126, 48, 0.045)),
    rgba(10, 8, 7, 0.66);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.upload-group header,
.settings-grid label,
.notes {
  color: rgba(255, 242, 228, 0.9);
}

.upload-group p {
  color: rgba(255, 225, 197, 0.58);
}

.dropzone {
  border-color: rgba(255, 215, 176, 0.2);
  background: rgba(255, 246, 235, 0.06);
  color: rgba(255, 232, 208, 0.72);
}

.settings-grid select,
.notes textarea {
  border-color: rgba(255, 219, 183, 0.15);
  background: rgba(7, 6, 5, 0.56);
  color: #fff4e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.primary-action {
  background: linear-gradient(135deg, #ffb46a, #f06a33 56%, #8b2218);
  box-shadow: 0 16px 34px rgba(240, 92, 40, 0.28);
}

.studio-canvas {
  border: 1px solid rgba(255, 219, 180, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255, 219, 162, 0.045), transparent 30%, rgba(240, 106, 51, 0.055) 72%, transparent),
    linear-gradient(rgba(255, 245, 231, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 245, 231, 0.022) 1px, transparent 1px),
    rgba(5, 5, 5, 0.52);
  background-size: 100% 100%, 34px 34px, 34px 34px, 100% 100%;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.32);
}

.empty-state,
.history-line {
  color: rgba(255, 229, 206, 0.65);
}

.empty-state span {
  color: #f4be68;
  text-shadow: 0 0 24px rgba(240, 106, 51, 0.58);
}

.history-line {
  border-top-color: rgba(255, 220, 183, 0.13);
}

.material-grid article {
  background:
    linear-gradient(180deg, rgba(255, 246, 235, 0.08), rgba(9, 8, 7, 0.74)),
    rgba(10, 8, 7, 0.72);
  padding-bottom: 12px;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.material-grid article:hover,
.asset-card:hover {
  border-color: rgba(255, 174, 103, 0.34);
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.42),
    0 0 32px rgba(240, 106, 51, 0.1);
  transform: translateY(-2px);
}

.material-grid strong,
.material-grid span {
  color: #fff4e8;
}

.material-grid span {
  color: rgba(255, 226, 200, 0.58);
}

.asset-card {
  background: rgba(8, 7, 6, 0.68);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.asset-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 64%, rgba(7, 6, 5, 0.26));
  content: "";
}

.asset-card::after {
  border: 1px solid rgba(255, 231, 205, 0.18);
  background: rgba(9, 7, 6, 0.66);
  color: #ffd1ad;
}

.load-more {
  color: rgba(255, 235, 216, 0.82);
}

* {
  scrollbar-color: rgba(240, 106, 51, 0.48) rgba(6, 5, 4, 0.9);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(6, 5, 4, 0.92);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(6, 5, 4, 0.92);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 178, 104, 0.7), rgba(240, 106, 51, 0.52));
}

.subrail header button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 226, 195, 0.14);
  border-radius: 6px;
  background: rgba(255, 246, 235, 0.08);
  color: rgba(255, 226, 204, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.subrail header button:hover {
  border-color: rgba(255, 178, 112, 0.28);
  background: rgba(255, 133, 54, 0.12);
  color: #fff7ee;
}

.home-hero,
.two-column,
.studio-page,
.library-page,
.assets-page {
  border: 0;
  box-shadow: none;
}

.two-column,
.studio-page,
.library-page,
.assets-page {
  background:
    linear-gradient(180deg, rgba(255, 140, 54, 0.12), transparent 30%),
    linear-gradient(112deg, rgba(255, 229, 181, 0.06), transparent 28%, rgba(7, 6, 5, 0.32) 72%),
    linear-gradient(180deg, rgba(28, 23, 18, 0.82), rgba(8, 7, 6, 0.94));
}

.subrail {
  border-right: 0;
  box-shadow: none;
}

body[data-theme="light"] {
  --bg: #fff5e3;
  --ink: #2f261e;
  --ink-strong: #17110c;
  --muted: #786a60;
  --line: rgba(167, 92, 35, 0.18);
  --panel: rgba(255, 251, 243, 0.8);
  --panel-strong: rgba(255, 247, 234, 0.96);
  --glass: rgba(255, 255, 255, 0.58);
  --accent: #f06a33;
  --accent-deep: #bd4c2d;
  --accent-soft: #d95d3d;
  --gold: #f5a83f;
  --shadow: 0 18px 44px rgba(163, 84, 28, 0.16);
  color: var(--ink);
  background: #fff5e3;
}

body[data-theme="light"] .app-shell {
  background:
    radial-gradient(520px 420px at 76% 14%, rgba(255, 168, 48, 0.5), transparent 64%),
    radial-gradient(620px 360px at 18% 12%, rgba(255, 232, 177, 0.72), transparent 68%),
    linear-gradient(180deg, #fff9ed 0%, #fff1db 42%, #f8e7cc 100%);
}

body[data-theme="light"] .sidebar {
  border-right-color: rgba(205, 116, 45, 0.2);
  background:
    radial-gradient(120px 240px at 45px 34px, rgba(255, 143, 48, 0.34), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 244, 225, 0.72)),
    #fff8ec;
  color: rgba(73, 55, 42, 0.76);
  box-shadow:
    12px 0 38px rgba(178, 96, 34, 0.16),
    inset -1px 0 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .sidebar::before {
  background:
    linear-gradient(rgba(194, 112, 45, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(194, 112, 45, 0.07) 1px, transparent 1px);
}

body[data-theme="light"] .nav-item,
body[data-theme="light"] .mini-dot,
body[data-theme="light"] .theme-dot {
  border-color: rgba(181, 103, 45, 0.14);
  background: rgba(255, 255, 255, 0.56);
  color: rgba(61, 45, 33, 0.82);
}

body[data-theme="light"] .nav-item.active {
  border-color: rgba(240, 106, 51, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 149, 62, 0.24), rgba(255, 255, 255, 0.56));
  color: #c74f2f;
  box-shadow:
    0 12px 26px rgba(240, 106, 51, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-theme="light"] .theme-dot[aria-pressed="true"] {
  border-color: rgba(240, 106, 51, 0.38);
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 180, 67, 0.55), transparent 48%),
    #fff2df;
  color: #bd4c2d;
}

body[data-theme="light"] .buddy-mark {
  border-color: rgba(240, 106, 51, 0.2);
  background: linear-gradient(135deg, #fff8e8, #ffb35c 50%, #ff6d31);
  color: #a43e24;
}

body[data-theme="light"] .workspace {
  background:
    radial-gradient(560px 360px at 72% 0%, rgba(255, 160, 38, 0.34), transparent 70%),
    radial-gradient(460px 280px at 18% 8%, rgba(255, 230, 176, 0.72), transparent 72%),
    linear-gradient(180deg, #fff8ec 0%, #fff0dd 48%, #f8e7cf 100%);
}

body[data-theme="light"] .workspace::before,
body[data-theme="light"] .two-column::before,
body[data-theme="light"] .studio-page::before,
body[data-theme="light"] .library-page::before,
body[data-theme="light"] .assets-page::before {
  background:
    linear-gradient(rgba(137, 83, 38, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(137, 83, 38, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, transparent 0%, rgba(255, 235, 205, 0.58) 100%);
  opacity: 0.72;
}

body[data-theme="light"] .home-hero {
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 173, 47, 0.48), transparent 50%),
    radial-gradient(circle at 22% 28%, rgba(255, 246, 220, 0.96), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 246, 0.92), rgba(255, 177, 65, 0.3) 58%, rgba(255, 248, 235, 0.96)),
    url("./assets/hero-glow.jpg") center 8% / cover no-repeat;
  color: var(--ink);
}

body[data-theme="light"] .home-hero::after {
  background:
    linear-gradient(90deg, rgba(255, 250, 238, 0.82), transparent 46%, rgba(255, 239, 211, 0.42)),
    linear-gradient(0deg, rgba(255, 248, 233, 0.9), transparent 58%);
}

body[data-theme="light"] .hero-backdrop {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), transparent 68%),
    linear-gradient(180deg, rgba(255, 164, 45, 0.28), rgba(255, 222, 150, 0.18));
  opacity: 0.72;
}

body[data-theme="light"] .top-title p,
body[data-theme="light"] .hero-stats span {
  color: rgba(83, 61, 43, 0.66);
}

body[data-theme="light"] .top-title h1 {
  color: #24170f;
  text-shadow: 0 18px 55px rgba(255, 140, 42, 0.28);
}

body[data-theme="light"] .mode-trigger {
  color: #ffad72;
  text-shadow: 0 8px 28px rgba(255, 126, 58, 0.24);
}

body[data-theme="light"] .mode-trigger:hover,
body[data-theme="light"] .mode-picker.open .mode-trigger {
  color: #ffc18f;
}

body[data-theme="light"] .hero-stats span,
body[data-theme="light"] .composer-card,
body[data-theme="light"] .floating-composer,
body[data-theme="light"] .shortcut-row button,
body[data-theme="light"] .image-card,
body[data-theme="light"] .skill-card,
body[data-theme="light"] .material-grid article,
body[data-theme="light"] .canvas-cards article,
body[data-theme="light"] .form-panel,
body[data-theme="light"] .prompt-meta {
  border-color: rgba(170, 96, 42, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 245, 229, 0.62));
  color: var(--ink);
  box-shadow:
    0 16px 40px rgba(165, 90, 28, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .prompt-line,
body[data-theme="light"] .prompt-meta strong,
body[data-theme="light"] .shortcut-row strong,
body[data-theme="light"] .image-card strong,
body[data-theme="light"] .skill-card h3,
body[data-theme="light"] .material-grid strong,
body[data-theme="light"] .canvas-cards label {
  color: #24170f;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-record .prompt-meta,
body[data-theme="light"] .panel-page.generate-page[data-generate-state] > .prompt-meta {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .prompt-detail-trigger {
  color: rgba(92, 73, 58, 0.72);
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .prompt-detail-trigger:hover,
body[data-theme="light"] .panel-page.generate-page[data-generate-state] .prompt-detail-trigger[aria-expanded="true"] {
  color: #bd4c2d;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-cost {
  color: #98633a;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .prompt-detail-panel {
  background: rgba(235, 231, 218, 0.96);
  color: #1f1913;
  box-shadow: none;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .prompt-detail-panel footer {
  color: rgba(85, 72, 60, 0.68);
}

body[data-theme="light"] .shortcut-row small,
body[data-theme="light"] .image-card span,
body[data-theme="light"] .skill-card p,
body[data-theme="light"] .skill-card small,
body[data-theme="light"] .material-grid span,
body[data-theme="light"] .prompt-meta,
body[data-theme="light"] .canvas-cards p,
body[data-theme="light"] .canvas-cards footer {
  color: rgba(92, 73, 58, 0.68);
}

body[data-theme="light"] .shortcut-row button span,
body[data-theme="light"] .upload-tile {
  border-color: rgba(255, 146, 58, 0.24);
  background: linear-gradient(135deg, #fff5df, #ff9f43 58%, #f06a33);
  color: #fffaf0;
}

body[data-theme="light"] .reference-thumb {
  border-color: rgba(172, 97, 43, 0.18);
  background: rgba(255, 248, 235, 0.86);
}

body[data-theme="light"] .reference-remove {
  border-color: rgba(151, 81, 35, 0.18);
  background: rgba(255, 251, 242, 0.92);
  color: #b94b2d;
}

body[data-theme="light"] .composer-toolbar button,
body[data-theme="light"] .page-actions button,
body[data-theme="light"] .search-lite,
body[data-theme="light"] .search-box,
body[data-theme="light"] .chip-row span,
body[data-theme="light"] .skill-heading .tabs button,
body[data-theme="light"] .tabs button,
body[data-theme="light"] .filter-row button,
body[data-theme="light"] .filters button,
body[data-theme="light"] .asset-filters button,
body[data-theme="light"] .studio-tabs button,
body[data-theme="light"] .segmented button,
body[data-theme="light"] .library-tools button,
body[data-theme="light"] .load-more,
body[data-theme="light"] .rail-action,
body[data-theme="light"] .rail-thread {
  border-color: rgba(167, 92, 35, 0.15);
  background: rgba(255, 255, 255, 0.66);
  color: rgba(52, 40, 31, 0.82);
  box-shadow:
    0 8px 20px rgba(166, 86, 26, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .composer-toolbar button:hover,
body[data-theme="light"] .page-actions button:hover,
body[data-theme="light"] .search-lite:hover,
body[data-theme="light"] .search-box:hover,
body[data-theme="light"] .chip-row span:hover,
body[data-theme="light"] .skill-heading .tabs button:hover,
body[data-theme="light"] .tabs button:hover,
body[data-theme="light"] .filter-row button:hover,
body[data-theme="light"] .filters button:hover,
body[data-theme="light"] .asset-filters button:hover,
body[data-theme="light"] .studio-tabs button:hover,
body[data-theme="light"] .segmented button:hover,
body[data-theme="light"] .library-tools button:hover,
body[data-theme="light"] .rail-action:hover,
body[data-theme="light"] .rail-thread:hover {
  border-color: rgba(240, 106, 51, 0.32);
  background: rgba(255, 241, 219, 0.82);
  color: #bd4c2d;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .page-actions button:not(.solid-light) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: rgba(63, 45, 30, 0.78);
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .page-actions button:not(.solid-light):hover {
  border-color: transparent;
  background: transparent;
  color: #bd4c2d;
}

body[data-theme="light"] .tabs button.active,
body[data-theme="light"] .filter-row button.active,
body[data-theme="light"] .filters button.active,
body[data-theme="light"] .asset-filters button.active,
body[data-theme="light"] .segmented button.active,
body[data-theme="light"] .library-page .tabs button.active,
body[data-theme="light"] .assets-page .tabs button.active,
body[data-theme="light"] .studio-tabs button.active,
body[data-theme="light"] .rail-action.active,
body[data-theme="light"] .rail-thread.active {
  border-color: rgba(240, 106, 51, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 146, 57, 0.26), rgba(255, 255, 255, 0.72));
  color: #bd4c2d;
  box-shadow:
    0 12px 26px rgba(240, 106, 51, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] .mode-menu,
body[data-theme="light"] .tool-menu,
body[data-theme="light"] .tool-panel {
  border-color: rgba(194, 104, 43, 0.18);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 173, 47, 0.28), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 250, 0.98), rgba(255, 241, 219, 0.96));
  color: #2c2118;
  box-shadow:
    0 24px 60px rgba(160, 86, 24, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

body[data-theme="light"] .mode-menu button,
body[data-theme="light"] .mode-tool-menu button,
body[data-theme="light"] .model-grid button,
body[data-theme="light"] .option-grid button {
  border-color: rgba(167, 92, 35, 0.13);
  background: rgba(255, 255, 255, 0.6);
  color: rgba(42, 31, 22, 0.84);
}

body[data-theme="light"] .mode-menu button.active,
body[data-theme="light"] .mode-menu button:hover,
body[data-theme="light"] .mode-tool-menu button.active,
body[data-theme="light"] .mode-tool-menu button:hover,
body[data-theme="light"] .model-grid button.active,
body[data-theme="light"] .model-grid button:hover,
body[data-theme="light"] .option-grid button.active,
body[data-theme="light"] .option-grid button:hover {
  border-color: rgba(240, 106, 51, 0.42);
  background: rgba(255, 236, 211, 0.86);
  color: #c64f31;
}

body[data-theme="light"] .mode-tool-menu button span,
body[data-theme="light"] .model-grid button span,
body[data-theme="light"] .image-settings-panel p,
body[data-theme="light"] .image-settings-panel footer {
  color: rgba(105, 79, 59, 0.62);
}

body[data-theme="light"] .image-settings-panel footer {
  background: rgba(255, 247, 234, 0.96);
}

body[data-theme="light"] .two-column,
body[data-theme="light"] .studio-page,
body[data-theme="light"] .library-page,
body[data-theme="light"] .assets-page {
  background:
    linear-gradient(180deg, rgba(255, 178, 61, 0.16), transparent 34%),
    linear-gradient(112deg, rgba(255, 255, 246, 0.74), transparent 30%, rgba(255, 229, 190, 0.42) 72%),
    linear-gradient(180deg, rgba(255, 249, 237, 0.94), rgba(255, 239, 215, 0.92));
  color: var(--ink);
}

body[data-theme="light"] .subrail,
body[data-theme="light"] .panel-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 250, 0.76), rgba(255, 238, 211, 0.64));
  color: var(--ink);
}

body[data-theme="light"] .subrail h2,
body[data-theme="light"] .form-panel header,
body[data-theme="light"] .settings-grid label,
body[data-theme="light"] .notes {
  color: #261910;
}

body[data-theme="light"] .subrail p,
body[data-theme="light"] .rail-thread span,
body[data-theme="light"] .studio-tabs span,
body[data-theme="light"] .filters span,
body[data-theme="light"] .asset-filters,
body[data-theme="light"] .library-tools,
body[data-theme="light"] .upload-group p {
  color: rgba(91, 70, 54, 0.62);
}

body[data-theme="light"] .dropzone,
body[data-theme="light"] .settings-grid select,
body[data-theme="light"] .notes textarea {
  border-color: rgba(167, 92, 35, 0.14);
  background: rgba(255, 255, 255, 0.66);
  color: #2b2119;
}

body[data-theme="light"] .canvas-page {
  border-color: rgba(167, 92, 35, 0.16);
  background:
    linear-gradient(rgba(134, 83, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134, 83, 42, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #fff8ed, #ffeccf);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

body[data-theme="light"] .round-btn,
body[data-theme="light"] .dark-pill,
body[data-theme="light"] .white-pill {
  background: rgba(255, 255, 255, 0.7);
  color: #2d2118;
}

body[data-theme="light"] .asset-card {
  border-color: rgba(167, 92, 35, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme="light"] .search-box input,
body[data-theme="light"] .search-lite input {
  color: #2d2118;
}

body[data-theme="light"] .search-box input::placeholder,
body[data-theme="light"] .search-lite input::placeholder,
body[data-theme="light"] .notes textarea::placeholder {
  color: rgba(96, 72, 54, 0.48);
}

body[data-theme="light"] .toast {
  border-color: rgba(199, 105, 40, 0.22);
  background: rgba(255, 249, 238, 0.94);
  color: #342418;
  box-shadow: 0 18px 42px rgba(160, 86, 24, 0.18);
}

body[data-theme="light"] .generated-output article {
  border-color: rgba(173, 101, 40, 0.16);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(181, 92, 20, 0.16);
}

body[data-theme="light"] .generated-output a {
  background: rgba(255, 250, 241, 0.86);
  color: #372518;
}

body[data-theme="light"] .generated-meta {
  color: rgba(92, 66, 45, 0.58);
}

body[data-theme="light"] .canvas-focus-node.has-image {
  background: rgba(255, 248, 235, 0.9);
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .floating-composer {
  border-color: rgba(173, 101, 40, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 48px rgba(180, 98, 27, 0.12);
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generate-prompt {
  color: #1f1914;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generate-prompt:empty::before {
  color: #9a9389;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generate-empty-title,
body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-day h2 {
  color: #17130f;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .load-older {
  border: 0;
  background: rgba(255, 255, 255, 0.68);
  color: #5e554d;
  box-shadow: none;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-status {
  border-color: rgba(240, 106, 51, 0.28);
  background: rgba(255, 238, 229, 0.78);
  color: #cc5036;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-status.running {
  border-color: rgba(225, 145, 65, 0.28);
  background: rgba(255, 244, 225, 0.72);
  color: #9b6127;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-status.success {
  border-color: rgba(85, 152, 99, 0.28);
  background: rgba(234, 250, 238, 0.72);
  color: #37784d;
}

body[data-theme="light"] .panel-page.generate-page[data-generate-state] .generation-retry {
  background: rgba(255, 255, 255, 0.86);
  color: #5f5046;
}

body[data-theme="light"] .canvas-card,
body[data-theme="light"] .canvas-cards article {
  border-color: rgba(173, 101, 40, 0.18);
  background: rgba(255, 248, 235, 0.72);
  color: #2e2017;
  box-shadow: 0 18px 50px rgba(188, 105, 31, 0.14);
}

body[data-theme="light"] .canvas-cards p,
body[data-theme="light"] .canvas-cards footer {
  color: rgba(92, 66, 45, 0.64);
}

body[data-theme="light"] .canvas-card-actions button {
  border-color: rgba(173, 101, 40, 0.14);
  background: rgba(255, 255, 255, 0.56);
  color: rgba(82, 57, 39, 0.72);
}

body[data-theme="light"] .canvas-empty {
  border-color: rgba(190, 104, 33, 0.2);
  color: rgba(92, 66, 45, 0.58);
}

body[data-theme="light"] .canvas-workspace {
  background:
    linear-gradient(rgba(132, 84, 41, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 84, 41, 0.052) 1px, transparent 1px),
    radial-gradient(circle at 66% 18%, rgba(255, 164, 47, 0.26), transparent 32%),
    linear-gradient(180deg, #fff8eb, #ffe6bf);
  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%;
}

body[data-theme="light"] .canvas-workbar,
body[data-theme="light"] .canvas-zoom,
body[data-theme="light"] .canvas-tool-dock,
body[data-theme="light"] .canvas-prompt-card {
  border-color: rgba(170, 96, 38, 0.18);
  background: rgba(255, 250, 241, 0.82);
  color: #2f2118;
  box-shadow: 0 18px 46px rgba(182, 94, 22, 0.14);
}

body[data-theme="light"] .canvas-workbar {
  border-bottom-color: rgba(170, 96, 38, 0.14);
}

body[data-theme="light"] .canvas-focus-node {
  background: rgba(255, 245, 230, 0.86);
  color: rgba(88, 63, 45, 0.46);
}

body[data-theme="light"] .node-icon {
  background: rgba(232, 128, 43, 0.1);
  color: rgba(91, 66, 49, 0.45);
}

body[data-theme="light"] .node-handle {
  border-color: #2777f8;
  background: #fffaf0;
}

body[data-theme="light"] .canvas-prompt-card textarea {
  border-color: rgba(39, 119, 248, 0.32);
  background: rgba(255, 255, 255, 0.58);
  color: #2d2118;
}

body[data-theme="light"] .canvas-prompt-card textarea::placeholder {
  color: rgba(92, 66, 45, 0.44);
}

body[data-theme="light"] .canvas-prompt-tools button,
body[data-theme="light"] .canvas-zoom button,
body[data-theme="light"] .canvas-tool-dock button {
  border-color: rgba(170, 96, 38, 0.14);
  background: rgba(255, 255, 255, 0.56);
  color: rgba(54, 39, 28, 0.78);
}

body[data-theme="light"] .canvas-tool-dock button {
  background: transparent;
}

/* HaiBuddy Motion Lab — connected video canvas */
.nav-camera-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 15px;
  border: 1.6px solid currentColor;
  border-radius: 5px;
}

.nav-camera-icon::before {
  position: absolute;
  left: 5px;
  top: 3px;
  width: 6px;
  height: 6px;
  border: 1.4px solid currentColor;
  border-radius: 50%;
  content: "";
}

.nav-camera-icon::after {
  position: absolute;
  right: -5px;
  top: 4px;
  width: 5px;
  height: 7px;
  border-radius: 0 3px 3px 0;
  background: currentColor;
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 82%);
  content: "";
}

.video-studio {
  height: calc(var(--workbench-height) - 48px);
  min-height: 720px;
  color: #fff5e9;
  background:
    radial-gradient(850px 520px at 74% 8%, rgba(237, 112, 44, 0.1), transparent 70%),
    linear-gradient(180deg, #0b0908 0%, #070605 100%);
}

.canvas-library-toolbar {
  max-width: 1420px;
  margin: 0 auto;
  padding: 38px 46px 22px;
  align-items: flex-end;
}

.canvas-library-heading {
  display: block !important;
}

.library-kicker,
.project-eyebrow {
  display: block;
  margin-bottom: 9px;
  color: rgba(246, 170, 102, 0.64);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.canvas-library-heading h2 {
  margin: 0;
  color: #fff8ef;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3vw, 52px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.canvas-library-heading p {
  margin: 10px 0 0;
  color: rgba(255, 232, 210, 0.48);
  font-size: 14px;
}

.canvas-library-actions {
  align-items: center;
}

.canvas-library-actions .dark-pill,
.canvas-library-actions .white-pill,
.canvas-workbar-actions .dark-pill {
  border: 1px solid rgba(255, 225, 198, 0.12);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.canvas-library-actions button:hover,
.canvas-workbar-actions button:hover {
  border-color: rgba(248, 150, 74, 0.38);
  background: rgba(240, 106, 51, 0.13);
  transform: translateY(-1px);
}

.canvas-library-actions .white-pill {
  border-color: rgba(255, 175, 96, 0.26);
  background: linear-gradient(135deg, #ffd3a5, #f48743 60%, #cb4e2e);
  color: #24130c;
  box-shadow: 0 14px 32px rgba(232, 92, 36, 0.2);
}

.canvas-cards {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
  width: calc(100% - 92px);
  max-width: 1420px;
  margin: 18px auto 60px;
}

.canvas-card.project-card {
  display: block;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 196, 0.105);
  border-radius: 16px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    rgba(19, 16, 14, 0.9);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.canvas-card.project-card:hover {
  border-color: rgba(247, 153, 83, 0.28);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.4),
    0 0 44px rgba(219, 85, 35, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.project-card-preview,
.project-card-empty {
  position: relative;
  display: grid;
  height: 190px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    radial-gradient(circle at 70% 20%, rgba(239, 101, 38, 0.2), transparent 48%),
    #0a0908;
  background-size: 26px 26px, 26px 26px, 100% 100%, 100% 100%;
}

.project-card-preview {
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.project-card-preview img,
.project-card-preview .preview-video {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
}

.project-card-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 54%, rgba(8, 6, 5, 0.8));
  pointer-events: none;
  content: "";
}

.preview-video,
.project-card-empty {
  place-items: center;
  color: #f5a168;
}

.preview-video span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 235, 214, 0.22);
  border-radius: 50%;
  background: rgba(9, 7, 6, 0.68);
}

.project-card-empty {
  align-content: center;
  gap: 8px;
}

.project-card-empty span {
  font-size: 26px;
  text-shadow: 0 0 30px rgba(240, 106, 51, 0.65);
}

.project-card-empty b {
  color: rgba(255, 231, 207, 0.5);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.project-card-copy {
  padding: 22px;
}

.project-card-copy h3 {
  margin: 0 0 9px;
  color: #fff5ea;
  font-size: 19px;
  line-height: 1.25;
}

.project-card-copy p {
  margin: 0 0 22px;
  color: rgba(255, 230, 207, 0.42);
  font-size: 12px;
}

.project-card-copy footer {
  align-items: center;
  color: rgba(255, 230, 207, 0.34);
}

.canvas-card-actions button {
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 225, 198, 0.1);
  color: rgba(255, 230, 207, 0.55);
}

.canvas-card-actions button:hover {
  border-color: rgba(247, 151, 80, 0.3);
  background: rgba(240, 106, 51, 0.12);
  color: #ffc79b;
}

.canvas-empty {
  min-height: 360px;
  align-content: center;
  gap: 10px;
  border-radius: 16px;
  background: rgba(17, 14, 12, 0.46);
  text-align: center;
}

.canvas-empty > span {
  color: #f29455;
  font-size: 30px;
}

.canvas-empty > strong {
  color: #fff3e6;
  font-size: 20px;
}

.canvas-empty > p {
  margin: 0;
  color: rgba(255, 232, 210, 0.46);
}

.canvas-empty > button {
  min-height: 40px;
  margin-top: 12px;
  border-radius: 10px;
  padding: 0 18px;
  background: linear-gradient(135deg, #f7b16f, #e96835);
  color: #24130c;
  font-weight: 800;
}

.canvas-workspace {
  grid-template-rows: 58px 1fr;
  isolation: isolate;
  background: #090807;
}

.canvas-workbar {
  z-index: 30;
  min-width: 0;
  border-bottom-color: rgba(255, 222, 193, 0.09);
  padding: 0 16px;
  background: rgba(12, 10, 9, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
}

.canvas-workbar-main,
.canvas-workbar-actions {
  min-width: 0;
}

.canvas-workbar .round-btn {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 226, 201, 0.12);
  background: rgba(255, 245, 234, 0.06);
}

.canvas-title-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 241, 228, 0.86);
}

.canvas-title-edit:hover {
  background: rgba(255, 245, 234, 0.06);
}

.canvas-title-edit strong {
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-title-edit span {
  color: rgba(247, 164, 100, 0.48);
  font-size: 11px;
}

.canvas-save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 230, 209, 0.36);
  font-size: 11px;
  white-space: nowrap;
}

.canvas-save-state i,
.provider-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #72b98b;
  box-shadow: 0 0 10px rgba(83, 188, 118, 0.42);
}

.canvas-save-state[data-state="saving"] i {
  background: #e8a65d;
  box-shadow: 0 0 10px rgba(232, 166, 93, 0.45);
}

.canvas-save-state[data-state="local"] i {
  background: #c8a37a;
}

.canvas-provider-state {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 222, 193, 0.09);
  border-radius: 20px;
  padding: 7px 12px;
  background: rgba(255, 245, 234, 0.035);
  color: rgba(255, 234, 214, 0.52);
  font-size: 10px;
}

.canvas-provider-state strong {
  color: rgba(255, 242, 229, 0.8);
  font-size: 11px;
}

.canvas-provider-state .provider-copy {
  color: rgba(255, 230, 207, 0.34);
}

.canvas-workbar-actions .dark-pill {
  min-height: 32px;
  padding: 0 11px;
  background: rgba(255, 245, 234, 0.045);
  color: rgba(255, 238, 222, 0.62);
  font-size: 11px;
}

.canvas-editor-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 286px;
  min-height: 0;
  overflow: hidden;
}

.video-node-palette,
.canvas-inspector {
  position: relative;
  z-index: 20;
  overflow: auto;
  border-color: rgba(255, 225, 198, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 26%),
    rgba(14, 12, 10, 0.96);
  color: rgba(255, 239, 224, 0.78);
  backdrop-filter: blur(18px);
}

.video-node-palette {
  border-right: 1px solid rgba(255, 225, 198, 0.09);
  padding: 18px 12px;
}

.palette-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 0 6px 12px;
  border-bottom: 1px solid rgba(255, 226, 200, 0.08);
  color: rgba(255, 242, 229, 0.74);
  font-size: 12px;
}

.palette-brand span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #ef9d5f, #d65b31);
  color: #20120c;
  font-size: 15px;
  font-weight: 900;
}

.video-node-palette > button {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 9px;
  width: 100%;
  margin: 5px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 9px;
  background: transparent;
  color: rgba(255, 239, 224, 0.7);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.video-node-palette > button:hover {
  border-color: rgba(246, 151, 80, 0.2);
  background: rgba(240, 106, 51, 0.08);
  transform: translateX(2px);
}

.video-node-palette > button > span {
  grid-row: 1 / 3;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 227, 203, 0.12);
  border-radius: 9px;
  background: rgba(255, 246, 235, 0.05);
  color: #f3a269;
  font-size: 11px;
  font-weight: 800;
}

.video-node-palette > button b {
  align-self: end;
  color: rgba(255, 241, 228, 0.8);
  font-size: 12px;
}

.video-node-palette > button small {
  color: rgba(255, 227, 203, 0.34);
  font-size: 9px;
}

.palette-tip {
  display: grid;
  gap: 7px;
  margin-top: 20px;
  border: 1px dashed rgba(255, 223, 194, 0.1);
  border-radius: 10px;
  padding: 12px;
  color: rgba(255, 230, 207, 0.33);
  font-size: 10px;
  line-height: 1.45;
}

.palette-tip kbd {
  width: max-content;
  border: 1px solid rgba(255, 225, 199, 0.14);
  border-radius: 5px;
  padding: 3px 6px;
  background: rgba(255, 245, 234, 0.05);
  color: rgba(255, 238, 220, 0.62);
  font-family: inherit;
}

.canvas-board {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  outline: none;
  background:
    linear-gradient(rgba(255, 239, 220, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 239, 220, 0.032) 1px, transparent 1px),
    radial-gradient(circle at 65% 20%, rgba(228, 93, 33, 0.09), transparent 44%),
    #080706;
  background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%;
  cursor: default;
}

.canvas-board::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 38%, rgba(0, 0, 0, 0.34) 100%);
  content: "";
}

.canvas-viewport {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  transform-origin: 0 0;
  will-change: transform;
}

.canvas-world,
.canvas-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.canvas-world {
  z-index: 2;
}

.canvas-wires {
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.canvas-wires path {
  fill: none;
  stroke: rgba(229, 119, 63, 0.58);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(222, 90, 36, 0.28));
}

.workflow-node {
  position: absolute;
  width: 328px;
  min-height: 184px;
  overflow: visible;
  border: 1px solid rgba(255, 224, 196, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 40%),
    rgba(22, 18, 15, 0.96);
  color: rgba(255, 242, 230, 0.78);
  box-shadow:
    0 24px 55px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.workflow-node.selected {
  border-color: rgba(245, 139, 71, 0.76);
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.44),
    0 0 0 2px rgba(232, 92, 38, 0.14),
    0 0 36px rgba(225, 86, 33, 0.16);
}

.workflow-node.is-running {
  border-color: rgba(246, 164, 96, 0.5);
}

.workflow-node.is-running::after {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(245, 159, 89, 0.34);
  border-radius: inherit;
  pointer-events: none;
  animation: nodePulse 1.6s ease-in-out infinite;
  content: "";
}

@keyframes nodePulse {
  50% { opacity: 0.25; transform: scale(1.012); }
}

.workflow-node > header {
  display: grid;
  grid-template-columns: 34px 1fr 30px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid rgba(255, 225, 199, 0.08);
  padding: 9px 10px 9px 12px;
  cursor: grab;
  user-select: none;
}

.workflow-node > header:active {
  cursor: grabbing;
}

.node-type-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(251, 173, 111, 0.22);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(238, 137, 75, 0.17), rgba(202, 72, 37, 0.08));
  color: #f3a369;
  font-size: 11px;
  font-weight: 900;
}

.workflow-node header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workflow-node header small {
  color: rgba(255, 226, 201, 0.32);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workflow-node header strong {
  overflow: hidden;
  color: rgba(255, 244, 234, 0.86);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-more {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 231, 208, 0.38);
  letter-spacing: 0.1em;
}

.node-more:hover {
  background: rgba(255, 245, 234, 0.06);
  color: #f8b483;
}

.workflow-node-body {
  min-height: 88px;
  padding: 12px;
}

.workflow-node > footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 225, 199, 0.07);
  padding: 7px 12px;
  color: rgba(255, 227, 203, 0.25);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.node-text-preview,
.generator-summary p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: rgba(255, 237, 220, 0.64);
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.generator-summary {
  display: grid;
  gap: 12px;
}

.generator-summary > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.generator-summary > div span {
  border: 1px solid rgba(255, 225, 199, 0.09);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(255, 245, 234, 0.035);
  color: rgba(255, 228, 205, 0.36);
  font-size: 8px;
}

.node-generate-button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
  border: 1px solid rgba(244, 148, 78, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 133, 71, 0.16), rgba(214, 73, 38, 0.08));
  color: #efad7f;
  font-size: 10px;
  font-weight: 800;
}

.node-generate-button:hover:not(:disabled) {
  border-color: rgba(246, 155, 87, 0.4);
  background: linear-gradient(135deg, rgba(239, 133, 71, 0.25), rgba(214, 73, 38, 0.14));
}

.node-generate-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.node-generate-button:disabled span,
.task-spinner {
  animation: nodeSpin 1s linear infinite;
}

@keyframes nodeSpin {
  to { transform: rotate(360deg); }
}

.node-media {
  height: 168px;
  overflow: hidden;
  border-radius: 9px;
  background: #050403;
}

.node-media img,
.node-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.node-drop-placeholder {
  display: grid;
  min-height: 130px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px dashed rgba(255, 224, 196, 0.14);
  border-radius: 9px;
  color: rgba(255, 229, 206, 0.34);
  text-align: center;
}

.node-drop-placeholder span {
  color: #ec9b65;
  font-size: 20px;
}

.node-drop-placeholder b {
  color: rgba(255, 238, 222, 0.56);
  font-size: 10px;
}

.node-drop-placeholder small {
  font-size: 8px;
}

.node-result .workflow-node-body,
.node-material .workflow-node-body {
  padding: 8px;
}

.node-port {
  position: absolute;
  top: 86px;
  z-index: 5;
  width: 14px;
  height: 14px;
  min-height: 0;
  border: 2px solid #e99256;
  border-radius: 50%;
  padding: 0;
  background: #17110e;
  box-shadow: 0 0 0 3px rgba(222, 91, 37, 0.12);
  transform: translateY(-50%);
}

.node-port:hover {
  background: #f3a167;
  box-shadow: 0 0 0 5px rgba(222, 91, 37, 0.2);
}

.node-port-input { left: -8px; }
.node-port-output { right: -8px; }

.canvas-inspector {
  border-left: 1px solid rgba(255, 225, 198, 0.09);
}

.inspector-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 230px;
  padding: 26px;
  text-align: center;
}

.inspector-empty > span {
  color: #e9935a;
  font-size: 26px;
  text-shadow: 0 0 30px rgba(232, 97, 39, 0.5);
}

.inspector-empty strong {
  color: rgba(255, 243, 232, 0.72);
  font-size: 13px;
}

.inspector-empty p {
  max-width: 210px;
  margin: 0;
  color: rgba(255, 229, 205, 0.33);
  font-size: 10px;
  line-height: 1.6;
}

.inspector-help {
  display: grid;
  gap: 9px;
  margin: 0 18px;
  border-top: 1px solid rgba(255, 225, 199, 0.08);
  padding-top: 18px;
  color: rgba(255, 229, 205, 0.32);
  font-size: 9px;
}

.inspector-help b {
  color: rgba(255, 239, 224, 0.58);
  font-size: 10px;
}

.inspector-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 225, 199, 0.08);
  padding: 8px 13px;
}

.inspector-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.inspector-head > div > div {
  display: grid;
  gap: 2px;
}

.inspector-head small {
  color: rgba(255, 228, 205, 0.3);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.inspector-head strong {
  color: rgba(255, 242, 230, 0.76);
  font-size: 12px;
}

.inspector-head > button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 245, 234, 0.04);
  color: rgba(255, 232, 211, 0.42);
}

.inspector-scroll {
  display: grid;
  gap: 13px;
  padding: 16px 14px 30px;
}

.inspector-field {
  display: grid;
  gap: 7px;
}

.inspector-field > span,
.reference-summary > span {
  color: rgba(255, 233, 213, 0.42);
  font-size: 9px;
  font-weight: 700;
}

.inspector-field input,
.inspector-field textarea,
.inspector-field select {
  width: 100%;
  border: 1px solid rgba(255, 225, 199, 0.11);
  border-radius: 8px;
  padding: 9px 10px;
  outline: none;
  background: rgba(255, 246, 235, 0.04);
  color: rgba(255, 241, 228, 0.72);
  font: inherit;
  font-size: 10px;
}

.inspector-field textarea {
  resize: vertical;
  line-height: 1.55;
}

.inspector-field input:focus,
.inspector-field textarea:focus,
.inspector-field select:focus {
  border-color: rgba(244, 142, 72, 0.48);
  box-shadow: 0 0 0 3px rgba(225, 85, 32, 0.08);
}

.inspector-field select option {
  background: #17120f;
  color: #fce7d4;
}

.inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.reference-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 8px;
  border: 1px solid rgba(255, 225, 199, 0.09);
  border-radius: 9px;
  padding: 10px;
  background: rgba(255, 245, 234, 0.025);
}

.reference-summary strong {
  color: #e99b65;
  font-size: 9px;
}

.reference-summary small {
  grid-column: 1 / -1;
  color: rgba(255, 229, 205, 0.28);
  font-size: 8px;
}

.inspector-generate {
  min-height: 40px;
  border: 1px solid rgba(245, 153, 84, 0.26);
  border-radius: 9px;
  background: linear-gradient(135deg, #efad73, #df6b38 62%, #b83e29);
  color: #24120b;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(213, 75, 31, 0.18);
}

.inspector-generate:disabled {
  filter: saturate(0.45);
  cursor: wait;
}

.inspector-media-card {
  display: grid;
  gap: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 225, 199, 0.1);
  border-radius: 9px;
  padding: 6px;
  background: rgba(6, 5, 4, 0.5);
}

.inspector-media-card img,
.inspector-media-card video {
  width: 100%;
  max-height: 250px;
  border-radius: 6px;
  object-fit: cover;
}

.inspector-media-card small {
  overflow: hidden;
  padding: 2px 4px 4px;
  color: rgba(255, 229, 205, 0.32);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-result-actions,
.inspector-danger-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inspector-result-actions a,
.inspector-result-actions button,
.inspector-danger-row button {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 225, 199, 0.11);
  border-radius: 8px;
  background: rgba(255, 245, 234, 0.04);
  color: rgba(255, 236, 217, 0.56);
  font-size: 9px;
  text-decoration: none;
}

.inspector-result-actions a:hover,
.inspector-result-actions button:hover,
.inspector-danger-row button:hover {
  border-color: rgba(244, 145, 76, 0.28);
  color: #efaa7b;
}

.inspector-danger-row {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 225, 199, 0.08);
}

.inspector-danger-row button:last-child {
  color: rgba(255, 130, 111, 0.62);
}

.canvas-empty-guide {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 8px;
  color: rgba(255, 232, 211, 0.42);
  text-align: center;
  transform: translate(-50%, -50%);
}

.canvas-empty-guide[hidden] { display: none; }

.guide-orbit {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(245, 151, 82, 0.2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 92, 36, 0.18), transparent 68%);
  color: #ed9a62;
  font-size: 22px;
  box-shadow: 0 0 45px rgba(222, 85, 31, 0.12);
}

.canvas-empty-guide strong {
  margin-top: 5px;
  color: rgba(255, 244, 232, 0.72);
  font-size: 17px;
}

.canvas-empty-guide p {
  margin: 0;
  color: rgba(255, 230, 207, 0.34);
  font-size: 10px;
}

.canvas-empty-guide button {
  min-height: 35px;
  margin-top: 8px;
  border: 1px solid rgba(246, 151, 80, 0.24);
  border-radius: 9px;
  padding: 0 14px;
  background: rgba(238, 119, 61, 0.12);
  color: #f0ad7e;
  font-size: 10px;
}

.canvas-quick-add {
  position: absolute;
  z-index: 40;
  display: grid;
  width: 210px;
  gap: 3px;
  border: 1px solid rgba(255, 222, 193, 0.15);
  border-radius: 12px;
  padding: 7px;
  background: rgba(22, 17, 14, 0.97);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(20px);
}

.canvas-quick-add[hidden] { display: none; }

.canvas-quick-add button {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 0 9px;
  background: transparent;
  color: rgba(255, 238, 220, 0.64);
  font-size: 10px;
  text-align: left;
}

.canvas-quick-add button:hover {
  background: rgba(238, 112, 54, 0.1);
  color: #f2b184;
}

.canvas-quick-add button span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(244, 151, 82, 0.18);
  border-radius: 7px;
  color: #e9945d;
}

.canvas-zoom,
.canvas-tool-dock {
  z-index: 20;
  border-color: rgba(255, 224, 197, 0.11);
  background: rgba(16, 13, 11, 0.86);
  backdrop-filter: blur(18px);
}

.canvas-zoom {
  left: 16px;
  bottom: 16px;
}

.canvas-tool-dock {
  bottom: 16px;
}

.canvas-tool-dock i {
  width: 1px;
  height: 20px;
  background: rgba(255, 226, 201, 0.09);
}

.canvas-zoom button,
.canvas-tool-dock button {
  border-color: rgba(255, 225, 199, 0.09);
  background: transparent;
  color: rgba(255, 235, 216, 0.54);
}

.canvas-zoom button:hover,
.canvas-tool-dock button:hover {
  border-color: rgba(244, 145, 76, 0.28);
  background: rgba(239, 110, 52, 0.08);
  color: #efaa7b;
}

.canvas-task-tray {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 22;
  display: grid;
  width: 250px;
  gap: 6px;
}

.canvas-task-tray[hidden] { display: none; }

.canvas-task-tray article {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(244, 151, 82, 0.18);
  border-radius: 11px;
  padding: 10px;
  background: rgba(20, 15, 12, 0.92);
  color: rgba(255, 239, 224, 0.66);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px);
}

.task-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(244, 153, 84, 0.18);
  border-top-color: #ed9b63;
  border-radius: 50%;
}

.canvas-task-tray article div {
  display: grid;
  gap: 2px;
}

.canvas-task-tray strong { font-size: 9px; }
.canvas-task-tray small { color: rgba(255, 229, 205, 0.3); font-size: 8px; }
.canvas-task-tray b { color: #e99c68; font-size: 9px; }

.canvas-connection-hint {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 30;
  border: 1px solid rgba(245, 153, 84, 0.2);
  border-radius: 18px;
  padding: 8px 13px;
  background: rgba(28, 19, 14, 0.9);
  color: #efad80;
  font-size: 9px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
}

.canvas-connection-hint[hidden] { display: none; }

.canvas-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 3, 3, 0.72);
  backdrop-filter: blur(12px);
}

.canvas-modal-card {
  width: min(500px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 223, 195, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 0%, rgba(233, 102, 40, 0.15), transparent 46%),
    #15110e;
  color: rgba(255, 240, 226, 0.74);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.62);
}

.canvas-modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 225, 199, 0.09);
  padding: 18px 20px;
}

.canvas-modal-card header div { display: grid; gap: 4px; }
.canvas-modal-card header small { color: #d78853; font-size: 8px; letter-spacing: 0.16em; }
.canvas-modal-card header strong { color: #fff1e4; font-size: 17px; }
.canvas-modal-card header button { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,0.05); color: #e8b18b; }
.canvas-modal-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 18px 20px 22px; }
.canvas-modal-card dl div { display: grid; gap: 4px; border: 1px solid rgba(255,225,199,0.08); border-radius: 9px; padding: 10px; background: rgba(255,255,255,0.025); }
.canvas-modal-card dt { color: #efad7d; font-size: 10px; }
.canvas-modal-card dd { margin: 0; color: rgba(255,230,208,0.34); font-size: 9px; }

body[data-theme="light"] .video-studio,
body[data-theme="light"] .canvas-workspace {
  color: #2e2118;
  background: #f7ead5;
}

body[data-theme="light"] .canvas-library-heading h2,
body[data-theme="light"] .project-card-copy h3 {
  color: #281b13;
}

body[data-theme="light"] .canvas-library-heading p,
body[data-theme="light"] .project-card-copy p,
body[data-theme="light"] .project-card-copy footer {
  color: rgba(78, 53, 37, 0.48);
}

body[data-theme="light"] .canvas-card.project-card {
  border-color: rgba(148, 82, 37, 0.14);
  background: rgba(255, 250, 241, 0.8);
}

body[data-theme="light"] .canvas-workbar,
body[data-theme="light"] .video-node-palette,
body[data-theme="light"] .canvas-inspector {
  border-color: rgba(145, 81, 37, 0.14);
  background: rgba(255, 247, 234, 0.9);
  color: rgba(53, 37, 26, 0.78);
}

body[data-theme="light"] .canvas-board {
  background:
    linear-gradient(rgba(132, 84, 41, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 84, 41, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 66% 18%, rgba(255, 164, 47, 0.2), transparent 42%),
    #f7ead5;
  background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%;
}

body[data-theme="light"] .workflow-node {
  border-color: rgba(144, 80, 37, 0.18);
  background: rgba(255, 250, 241, 0.94);
  color: #38271c;
  box-shadow: 0 22px 48px rgba(132, 72, 28, 0.16);
}

body[data-theme="light"] .workflow-node.selected {
  border-color: rgba(220, 94, 39, 0.65);
}

body[data-theme="light"] .workflow-node header strong,
body[data-theme="light"] .inspector-head strong,
body[data-theme="light"] .inspector-empty strong,
body[data-theme="light"] .video-node-palette > button b {
  color: #35251a;
}

body[data-theme="light"] .node-text-preview,
body[data-theme="light"] .generator-summary p {
  color: rgba(57, 40, 28, 0.66);
}

body[data-theme="light"] .inspector-field input,
body[data-theme="light"] .inspector-field textarea,
body[data-theme="light"] .inspector-field select {
  border-color: rgba(142, 80, 38, 0.14);
  background: rgba(255, 255, 255, 0.58);
  color: #35251a;
}

body[data-theme="light"] .inspector-field select option { background: #fff7ea; color: #35251a; }
body[data-theme="light"] .canvas-zoom,
body[data-theme="light"] .canvas-tool-dock,
body[data-theme="light"] .canvas-quick-add,
body[data-theme="light"] .canvas-task-tray article {
  border-color: rgba(142, 80, 38, 0.16);
  background: rgba(255, 250, 241, 0.9);
  color: #3a291d;
}

@media (max-width: 1220px) {
  .canvas-editor-shell { grid-template-columns: 176px minmax(0, 1fr) 250px; }
  .canvas-provider-state .provider-copy { display: none; }
  .canvas-workbar-actions .dark-pill { padding: 0 8px; }
  .canvas-cards { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
}

@media (max-width: 900px) {
  .video-studio { height: auto; min-height: calc(100vh - 28px); }
  .canvas-cards { grid-template-columns: 1fr; width: calc(100% - 32px); }
  .canvas-library-toolbar { align-items: flex-start; flex-direction: column; padding: 28px 16px 14px; }
  .canvas-editor-shell { grid-template-columns: 62px minmax(0, 1fr); }
  .video-node-palette { padding: 12px 8px; }
  .palette-brand strong,
  .video-node-palette > button b,
  .video-node-palette > button small,
  .palette-tip { display: none; }
  .video-node-palette > button { display: grid; grid-template-columns: 1fr; place-items: center; padding: 7px; }
  .video-node-palette > button > span { grid-row: auto; }
  .canvas-inspector { position: absolute; right: 0; top: 0; bottom: 0; width: 270px; box-shadow: -20px 0 50px rgba(0,0,0,0.34); }
  .canvas-workbar { gap: 8px; }
  .canvas-provider-state,
  .canvas-workbar-actions .canvas-shortcuts,
  .canvas-save-state { display: none !important; }
}

/* Scale the original fixed mockup to the live application viewport. */
html,
body {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  min-height: 720px;
}

.sidebar,
.workspace {
  height: 100vh;
}

.view {
  min-height: 100vh;
}

.video-studio {
  height: calc(100vh - 70px);
  min-height: 0;
}

/* Motion Lab canvas: compact TapNow-inspired tool rail with floating controls. */
.canvas-editor-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.video-node-palette {
  overflow: visible;
  padding: 12px 8px;
}

.palette-brand {
  justify-content: center;
  margin-bottom: 10px;
  padding: 0 0 10px;
}

.palette-brand strong,
.video-node-palette > button small,
.palette-tip {
  display: none;
}

.video-node-palette > button {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 34px auto;
  place-items: center;
  gap: 5px;
  min-height: 58px;
  margin: 4px 0;
  padding: 6px 3px;
  text-align: center;
  transform: none;
}

.video-node-palette > button:hover {
  transform: none;
}

.video-node-palette > button > span {
  grid-row: auto;
  width: 34px;
  height: 34px;
}

.video-node-palette > button b {
  align-self: start;
  color: rgba(255, 239, 224, 0.54);
  font-size: 9px;
  font-weight: 650;
}

.canvas-inspector {
  position: absolute;
  right: 14px;
  top: 14px;
  bottom: 14px;
  z-index: 35;
  width: min(320px, calc(100% - 104px));
  border: 1px solid rgba(255, 225, 198, 0.12);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  box-shadow: -24px 24px 70px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(100% + 28px));
  transition: opacity 160ms ease, transform 180ms ease;
}

.canvas-inspector.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.canvas-editor-shell.inspector-open .canvas-task-tray {
  right: 350px;
}

.generator-summary {
  gap: 10px;
}

.node-inline-controls {
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(76px, 0.8fr);
  gap: 7px !important;
}

.node-inline-controls label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.node-inline-controls label > span {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 226, 201, 0.3);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-inline-controls select {
  width: 100%;
  min-width: 0;
  height: 29px;
  border: 1px solid rgba(255, 225, 199, 0.11);
  border-radius: 7px;
  padding: 0 24px 0 7px;
  outline: none;
  background: rgba(255, 245, 234, 0.04);
  color: rgba(255, 235, 217, 0.56);
  font: inherit;
  font-size: 8px;
}

.node-inline-controls select:focus {
  border-color: rgba(244, 142, 72, 0.5);
}

.node-inline-controls option {
  background: #17120f;
  color: #fce7d4;
}

.node-port-output {
  right: -11px;
  width: 22px;
  height: 22px;
  border-width: 1px;
}

.node-port-output span {
  display: grid;
  place-items: center;
  color: #f3a167;
  font-size: 13px;
  line-height: 1;
}

.node-port-output:hover span {
  color: #23120b;
}

.canvas-quick-add {
  width: 220px;
}

.canvas-quick-add > header {
  display: grid;
  gap: 3px;
  margin: -1px -1px 4px;
  border-bottom: 1px solid rgba(255, 225, 199, 0.09);
  padding: 8px 9px 10px;
}

.canvas-quick-add > header strong {
  color: rgba(255, 242, 230, 0.82);
  font-size: 11px;
}

.canvas-quick-add > header small {
  color: rgba(255, 228, 205, 0.32);
  font-size: 8px;
}

.canvas-quick-add.is-chain {
  border-color: rgba(244, 145, 76, 0.28);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.56), 0 0 0 2px rgba(223, 91, 37, 0.08);
}

body[data-theme="light"] .canvas-inspector {
  border-color: rgba(145, 81, 37, 0.16);
  background: rgba(255, 247, 234, 0.96);
}

body[data-theme="light"] .node-inline-controls select {
  border-color: rgba(142, 80, 38, 0.14);
  background: rgba(255, 255, 255, 0.58);
  color: #35251a;
}

@media (max-width: 680px) {
  .canvas-workbar-actions .canvas-export { display: none; }
  .canvas-inspector { right: 8px; top: 8px; bottom: 8px; width: calc(100% - 92px); }
  .canvas-editor-shell.inspector-open .canvas-task-tray { right: 12px; bottom: 12px; }
  .workflow-node { width: 304px; }
}

/* Generated asset library */
.assets-page {
  min-height: calc(100vh - 94px);
  padding: 28px 34px 56px;
}

.asset-head {
  margin-bottom: 16px;
}

.asset-filters {
  position: sticky;
  top: -1px;
  z-index: 8;
  gap: 8px;
  margin: 0 -8px 20px;
  padding: 8px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.asset-filters .search-box {
  width: min(300px, 32vw);
  min-height: 38px;
}

.asset-filters button {
  min-height: 38px;
}

.asset-filters [data-asset-sort] {
  margin-left: auto;
  color: rgba(255, 224, 198, 0.48);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 14px;
}

.asset-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(255, 220, 191, 0.11);
  border-radius: 13px;
  outline: none;
  background: #100d0b;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transform: translateZ(0);
  transition: border-color 160ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.asset-card::after {
  display: none;
}

.asset-card:hover,
.asset-card:focus-visible {
  border-color: rgba(245, 146, 78, 0.54);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38), 0 0 0 2px rgba(225, 86, 33, 0.09);
  transform: translateY(-3px);
}

.asset-media,
.asset-media img,
.asset-media video {
  width: 100%;
  height: 100%;
}

.asset-media img,
.asset-media video {
  display: block;
  object-fit: cover;
  transition: transform 350ms ease, filter 240ms ease;
}

.asset-card:hover .asset-media img,
.asset-card:hover .asset-media video {
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.035);
}

.asset-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 44px 12px 11px;
  background: linear-gradient(180deg, transparent 30%, rgba(7, 5, 4, 0.12) 46%, rgba(7, 5, 4, 0.94) 100%);
  color: #fff7ed;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(5px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 0s linear 160ms;
}

.asset-card:hover .asset-hover,
.asset-card:focus-visible .asset-hover,
.asset-card:focus-within .asset-hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.asset-hover p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.asset-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 30px;
}

.asset-card-footer b {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 8px;
  padding: 0 7px;
  background: rgba(10, 8, 7, 0.56);
  color: rgba(255, 244, 232, 0.92);
  font-size: 9px;
  backdrop-filter: blur(10px);
}

.asset-quick-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.asset-card:hover .asset-quick-actions,
.asset-card:focus-within .asset-quick-actions {
  opacity: 1;
  transform: translateY(0);
}

.asset-quick-actions a,
.asset-quick-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  place-items: center;
  border: 1px solid rgba(255, 244, 232, 0.24);
  border-radius: 8px;
  padding: 0;
  background: rgba(12, 9, 7, 0.58);
  color: #fff5e9;
  font-size: 15px;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.asset-quick-actions a:hover,
.asset-quick-actions button:hover {
  border-color: rgba(245, 153, 84, 0.64);
  background: rgba(224, 93, 40, 0.42);
}

.asset-video-badge {
  position: absolute;
  left: 11px;
  top: 11px;
  border: 1px solid rgba(255, 241, 227, 0.18);
  border-radius: 10px;
  padding: 5px 8px;
  background: rgba(10, 8, 7, 0.56);
  color: #fff0e0;
  font-size: 9px;
  backdrop-filter: blur(10px);
}

.asset-empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(255, 222, 193, 0.12);
  border-radius: 16px;
  background: rgba(12, 10, 8, 0.45);
  color: rgba(255, 234, 215, 0.42);
  text-align: center;
}

.asset-empty-state span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(245, 151, 82, 0.22);
  border-radius: 14px;
  background: rgba(225, 87, 34, 0.1);
  color: #ee9b62;
  font-size: 16px;
}

.asset-empty-state strong {
  color: rgba(255, 242, 230, 0.76);
  font-size: 15px;
}

.asset-empty-state p {
  max-width: 360px;
  margin: 0;
  font-size: 10px;
}

#assets .load-more[hidden] {
  display: none;
}

body.asset-detail-open {
  overflow: hidden;
}

.asset-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 4, 3, 0.92);
  backdrop-filter: blur(18px);
}

.asset-detail-modal[hidden] {
  display: none;
}

.asset-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 38% 16%, rgba(226, 93, 36, 0.08), transparent 42%),
    #090807;
}

.asset-detail-preview {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 42px 74px;
  overflow: hidden;
}

.asset-detail-media {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.asset-detail-media img,
.asset-detail-media video {
  display: block;
  min-width: min(66vw, 560px);
  max-width: 100%;
  max-height: calc(100vh - 84px);
  border: 1px solid rgba(255, 224, 197, 0.12);
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.55);
}

.asset-detail-close,
.asset-detail-nav {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 225, 199, 0.12);
  background: rgba(20, 16, 13, 0.76);
  color: rgba(255, 238, 221, 0.62);
  backdrop-filter: blur(14px);
}

.asset-detail-close {
  right: 20px;
  top: 20px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 20px;
}

.asset-detail-nav {
  top: 50%;
  width: 40px;
  height: 58px;
  border-radius: 12px;
  font-size: 25px;
  transform: translateY(-50%);
}

.asset-detail-prev { left: 18px; }
.asset-detail-next { right: 18px; }

.asset-detail-close:hover,
.asset-detail-nav:hover {
  border-color: rgba(245, 150, 82, 0.45);
  background: rgba(225, 89, 36, 0.24);
  color: #ffc397;
}

.asset-detail-info {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 22px;
  overflow: auto;
  border-left: 1px solid rgba(255, 225, 199, 0.1);
  padding: 30px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 22%),
    rgba(16, 13, 11, 0.97);
  color: rgba(255, 240, 226, 0.72);
}

.asset-creator {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 225, 199, 0.09);
}

.asset-creator > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(248, 166, 101, 0.28);
  border-radius: 50%;
  background: linear-gradient(135deg, #cc5730, #5d281b);
  color: #fff1e4;
  font-size: 12px;
  font-weight: 800;
}

.asset-creator div {
  display: grid;
  gap: 4px;
}

.asset-creator strong {
  color: rgba(255, 244, 233, 0.9);
  font-size: 13px;
}

.asset-creator small {
  color: rgba(255, 228, 204, 0.32);
  font-size: 9px;
}

.asset-prompt-full {
  display: grid;
  gap: 10px;
}

.asset-prompt-full small {
  color: #e99b64;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.asset-prompt-full p {
  margin: 0;
  color: rgba(255, 240, 226, 0.74);
  font-size: 11px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.asset-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.asset-meta-list div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255, 225, 199, 0.09);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 247, 237, 0.025);
}

.asset-meta-list dt {
  color: rgba(255, 228, 204, 0.28);
  font-size: 8px;
}

.asset-meta-list dd {
  overflow: hidden;
  margin: 0;
  color: rgba(255, 241, 228, 0.72);
  font-size: 10px;
  text-overflow: ellipsis;
}

.asset-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 225, 199, 0.09);
}

.asset-detail-actions button,
.asset-detail-actions a {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 225, 199, 0.12);
  border-radius: 10px;
  background: rgba(255, 247, 237, 0.04);
  color: rgba(255, 239, 223, 0.66);
  font-size: 10px;
  text-decoration: none;
}

.asset-detail-actions button:hover,
.asset-detail-actions a:hover {
  border-color: rgba(244, 147, 78, 0.42);
  background: rgba(225, 88, 35, 0.12);
  color: #f5b587;
}

.asset-detail-actions a:nth-child(2) {
  border-color: rgba(245, 153, 84, 0.3);
  background: linear-gradient(135deg, rgba(239, 133, 71, 0.22), rgba(211, 67, 35, 0.1));
}

body[data-theme="light"] .asset-filters {
  background: transparent;
}

body[data-theme="light"] .asset-card {
  border-color: rgba(122, 72, 39, 0.12);
  background: #f5eee3;
  box-shadow: 0 14px 32px rgba(105, 62, 30, 0.12);
}

body[data-theme="light"] .asset-detail-shell {
  background: #f4f0e8;
}

body[data-theme="light"] .asset-detail-info {
  border-color: rgba(101, 70, 46, 0.12);
  background: #faf6ef;
  color: #31261d;
}

body[data-theme="light"] .asset-creator strong,
body[data-theme="light"] .asset-prompt-full p,
body[data-theme="light"] .asset-meta-list dd {
  color: #2d241d;
}

body[data-theme="light"] .asset-creator small,
body[data-theme="light"] .asset-meta-list dt {
  color: rgba(65, 48, 35, 0.46);
}

body[data-theme="light"] .asset-detail-actions button,
body[data-theme="light"] .asset-detail-actions a,
body[data-theme="light"] .asset-meta-list div {
  border-color: rgba(103, 72, 48, 0.13);
  background: rgba(255, 255, 255, 0.52);
  color: #554131;
}

@media (max-width: 1040px) {
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .asset-detail-shell { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 760px) {
  .assets-page { padding: 20px 16px 44px; }
  .asset-filters { align-items: stretch; flex-wrap: wrap; }
  .asset-filters .search-box { width: 100%; }
  .asset-filters [data-asset-sort] { margin-left: 0; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .asset-detail-shell { grid-template-columns: 1fr; grid-template-rows: minmax(42vh, 1fr) minmax(0, 52vh); }
  .asset-detail-preview { padding: 56px 44px 20px; }
  .asset-detail-media img,
  .asset-detail-media video { min-width: 0; max-height: 46vh; }
  .asset-detail-info { border-top: 1px solid rgba(255, 225, 199, 0.1); border-left: 0; padding: 22px 18px; }
  .asset-detail-close { right: 12px; top: 12px; }
  .asset-detail-prev { left: 8px; }
  .asset-detail-next { right: 8px; }
}

/* Premium warm-light theme — inspired by the desktop light-mode references. */
body[data-theme="light"] {
  --bg: #f7f5f1;
  --ink: #211b18;
  --ink-strong: #171311;
  --muted: #786d66;
  --soft: #fffdf9;
  --soft-2: #f4eee8;
  --line: rgba(65, 43, 31, 0.11);
  --line-dark: rgba(50, 34, 25, 0.1);
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 253, 249, 0.94);
  --glass: rgba(255, 255, 255, 0.62);
  --accent: #f15b2a;
  --accent-deep: #d9471e;
  --accent-soft: #ffb18c;
  --gold: #e89a4b;
  --shadow: 0 22px 60px rgba(102, 62, 37, 0.1);
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 118, 63, 0.17), transparent 30%),
    radial-gradient(circle at 8% 92%, rgba(255, 188, 145, 0.12), transparent 28%),
    #f7f5f1;
}

body[data-theme="light"] .app-shell {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 244, 0.72)),
    #f7f5f1;
}

body[data-theme="light"] .workspace {
  background:
    radial-gradient(circle at 94% 2%, rgba(255, 107, 54, 0.14), transparent 31%),
    radial-gradient(circle at 78% 88%, rgba(255, 183, 137, 0.11), transparent 27%),
    linear-gradient(145deg, #faf9f6 0%, #ffffff 48%, #fff6ef 100%);
}

body[data-theme="light"] .sidebar {
  border-right-color: rgba(72, 45, 30, 0.1);
  background: rgba(255, 253, 249, 0.88);
  box-shadow: 14px 0 44px rgba(75, 48, 32, 0.07);
  backdrop-filter: blur(24px) saturate(125%);
}

body[data-theme="light"] .nav-item {
  color: #70665f;
}

body[data-theme="light"] .nav-item:hover {
  background: rgba(255, 109, 55, 0.07);
  color: #302621;
}

body[data-theme="light"] .nav-item.active {
  border-color: rgba(232, 83, 35, 0.26);
  background: linear-gradient(145deg, rgba(255, 247, 241, 0.98), rgba(255, 224, 207, 0.76));
  color: #d94b22;
  box-shadow: 0 10px 26px rgba(223, 76, 29, 0.12);
}

body[data-theme="light"] :is(.home-hero, .panel-page, .assets-page, .materials-page, .canvas-page) {
  color: #211b18;
}

body[data-theme="light"] .home-hero {
  border-color: rgba(71, 45, 31, 0.1);
  background:
    radial-gradient(circle at 76% 12%, rgba(255, 126, 65, 0.2), transparent 33%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 235, 0.88));
  box-shadow: 0 28px 70px rgba(102, 61, 34, 0.11);
}

body[data-theme="light"] :is(.composer-card, .floating-composer, .shortcut-row > button, .content-bar, .asset-filters, .generation-record, .generation-status, .subrail, .tool-panel, .tool-menu) {
  border-color: rgba(68, 44, 30, 0.11);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 48px rgba(91, 56, 34, 0.08);
  backdrop-filter: blur(20px) saturate(125%);
}

body[data-theme="light"] :is(.composer-card, .floating-composer) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 241, 0.82));
}

body[data-theme="light"] :is(.composer-card textarea, .floating-composer textarea, input, select, textarea) {
  color: #241d19;
}

body[data-theme="light"] :is(.composer-card textarea, .floating-composer textarea, input, textarea)::placeholder {
  color: rgba(73, 59, 51, 0.46);
}

body[data-theme="light"] :is(.tabs button, .filters button, .asset-filters button, .composer-toolbar button, .toolbar-picker > button, .page-actions button, .solid-light) {
  border-color: rgba(70, 45, 31, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #514640;
  box-shadow: 0 5px 16px rgba(82, 50, 30, 0.04);
}

body[data-theme="light"] :is(.tabs button, .filters button, .asset-filters button, .composer-toolbar button, .toolbar-picker > button, .page-actions button):hover {
  border-color: rgba(238, 87, 38, 0.28);
  background: #fff8f3;
  color: #d94b22;
}

body[data-theme="light"] :is(.tabs button.active, .filters button.active, .asset-filters button.active, .composer-toolbar button.active, .toolbar-picker > button.active, button[aria-pressed="true"]) {
  border-color: rgba(236, 82, 31, 0.34);
  background: linear-gradient(145deg, #fff7f1, #ffe4d5);
  color: #d9471e;
  box-shadow: 0 8px 22px rgba(222, 72, 24, 0.11);
}

body[data-theme="light"] :is(.send, .primary-action, .solid-light) {
  border-color: rgba(222, 68, 22, 0.16);
  background: linear-gradient(145deg, #ff7545, #e74a20);
  color: #fff;
  box-shadow: 0 12px 28px rgba(226, 70, 25, 0.22);
}

body[data-theme="light"] :is(.asset-card, .shortcut-row > button) {
  border-color: rgba(67, 43, 30, 0.09);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 38px rgba(92, 56, 33, 0.08);
}

body[data-theme="light"] .asset-card:hover,
body[data-theme="light"] .shortcut-row > button:hover {
  border-color: rgba(239, 88, 39, 0.24);
  box-shadow: 0 22px 50px rgba(112, 63, 34, 0.13);
  transform: translateY(-2px);
}

body[data-theme="light"] :is(.tool-panel, .tool-menu) {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 118, 62, 0.12), transparent 34%),
    rgba(255, 253, 249, 0.96);
}

body[data-theme="light"] :is(.tool-panel button, .tool-menu button) {
  border-color: rgba(66, 42, 29, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: #332924;
}

body[data-theme="light"] :is(.tool-panel button:hover, .tool-menu button:hover, .tool-panel button.active, .tool-menu button.active) {
  border-color: rgba(238, 86, 35, 0.34);
  background: linear-gradient(145deg, #fff7f1, #ffe4d4);
  color: #d84820;
}

body[data-theme="light"] :is(h1, h2, h3) {
  color: #211916;
}

body[data-theme="light"] :is(.eyebrow, .section-label, small, .meta, .hint) {
  color: #81736b;
}

body[data-theme="light"] ::selection {
  background: rgba(241, 91, 42, 0.22);
  color: #271b16;
}

body[data-theme="light"] .asset-filters {
  padding-inline: 0;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body[data-theme="light"] .assets-page {
  border-color: rgba(68, 43, 30, 0.08);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 112, 61, 0.11), transparent 29%),
    radial-gradient(circle at 4% 96%, rgba(255, 176, 132, 0.08), transparent 26%),
    linear-gradient(145deg, #fffdfb 0%, #ffffff 52%, #fbf7f3 100%);
  box-shadow: 0 24px 64px rgba(91, 55, 33, 0.07);
}

body[data-theme="light"] .assets-page::before {
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.48), transparent 42%),
    radial-gradient(circle at 78% 18%, rgba(255, 145, 96, 0.05), transparent 34%);
  opacity: 1;
}

body[data-theme="light"] .library-page {
  overflow: hidden;
  border: 1px solid rgba(68, 43, 30, 0.08);
  border-radius: 18px;
  background:
    radial-gradient(circle at 91% 1%, rgba(255, 112, 61, 0.11), transparent 30%),
    radial-gradient(circle at 7% 94%, rgba(255, 178, 135, 0.08), transparent 27%),
    linear-gradient(145deg, #fffdfb 0%, #ffffff 50%, #fbf7f3 100%);
  box-shadow: 0 24px 64px rgba(91, 55, 33, 0.07);
}

body[data-theme="light"] .library-page::before {
  border-radius: inherit;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.5), transparent 43%),
    radial-gradient(circle at 76% 16%, rgba(255, 145, 96, 0.05), transparent 35%);
  opacity: 1;
}

body[data-theme="light"] .canvas-page.video-studio {
  overflow: hidden;
  border: 1px solid rgba(68, 43, 30, 0.08);
  border-radius: 18px;
  color: #211a17;
  background:
    radial-gradient(circle at 91% 2%, rgba(255, 110, 58, 0.11), transparent 30%),
    radial-gradient(circle at 8% 94%, rgba(255, 177, 133, 0.08), transparent 27%),
    linear-gradient(145deg, #fffdfb 0%, #ffffff 51%, #fbf7f3 100%);
  background-size: auto, auto, auto;
  box-shadow: 0 24px 64px rgba(91, 55, 33, 0.07);
}

body[data-theme="light"] .studio-page {
  overflow: hidden;
  border: 1px solid rgba(68, 43, 30, 0.08);
  border-radius: 18px;
  background:
    radial-gradient(circle at 91% 1%, rgba(255, 111, 60, 0.11), transparent 30%),
    radial-gradient(circle at 7% 95%, rgba(255, 178, 135, 0.08), transparent 27%),
    linear-gradient(145deg, #fffdfb 0%, #ffffff 51%, #fbf7f3 100%);
  box-shadow: 0 24px 64px rgba(91, 55, 33, 0.07);
}

body[data-theme="light"] .studio-page::before {
  border-radius: inherit;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.5), transparent 43%),
    radial-gradient(circle at 77% 15%, rgba(255, 145, 96, 0.05), transparent 35%);
  opacity: 1;
}
