:root {
  color-scheme: dark;
  --bg: #020303;
  --studio-header-width: 76rem;
  --studio-header-edge-reserve: 104px;
  --surface: #070808;
  --surface-2: #0b0d0c;
  --surface-3: #111413;
  --line: #242a27;
  --text: #f4f1e8;
  --muted: #b8b2a4;
  --soft: #7f8979;
  --accent: #e0b351;
  --accent-2: #77a8a2;
  --danger: #dd6b5d;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.64);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(145deg, rgba(119, 168, 162, 0.025), transparent 32%),
    linear-gradient(315deg, rgba(224, 179, 81, 0.025), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body.app-loading {
  overflow: hidden;
}

body.app-loading .app-shell,
body.app-loading .app-menu,
body.app-loading .assistant-panel {
  visibility: hidden;
}

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: block;
  padding: 0;
  overflow: hidden;
  perspective: 1200px;
  background:
    repeating-linear-gradient(90deg, rgba(119, 168, 162, 0.045) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(0deg, rgba(224, 179, 81, 0.032) 0 1px, transparent 1px 90px),
    linear-gradient(180deg, #000 0%, #020303 48%, #000 100%);
  opacity: 1;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

body:not(.app-loading) .site-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader::before,
.site-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  filter: none;
  pointer-events: none;
}

.site-loader::before {
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(119, 168, 162, 0.07) 16.2%, transparent 16.8% 83.2%, rgba(224, 179, 81, 0.055) 83.8%, transparent 84.4%),
    repeating-linear-gradient(135deg, transparent 0 38px, rgba(244, 241, 232, 0.035) 39px, transparent 40px);
  opacity: 0.72;
}

.site-loader::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.52), transparent 22%, transparent 76%, rgba(0, 0, 0, 0.64)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(244, 241, 232, 0.018) 6px, transparent 7px);
  opacity: 0.9;
}

.site-loader-header {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  width: min(820px, calc(100vw - 40px));
  margin: 0 auto;
  text-align: center;
  z-index: 4;
}

.site-loader-card {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100svh;
  min-height: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.site-loader-react-root,
.site-loader-fallback {
  position: absolute;
  inset: 0;
}

.site-loader-react-root {
  z-index: 2;
}

.site-loader-fallback {
  z-index: 1;
}

body.react-loader-mounted .site-loader-fallback {
  display: none;
}

.site-loader-message {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
  margin: 0;
  transform: translateX(-50%);
  z-index: 8;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(244, 241, 232, 0.92);
  width: min(360px, calc(100vw - 32px));
  font-size: clamp(0.78rem, 2.2vw, 0.95rem);
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  opacity: 1;
  text-shadow: 0 0 22px rgba(119, 168, 162, 0.32), 0 2px 18px rgba(0, 0, 0, 0.88);
  animation: none;
}

.site-loader-circuit-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #010202 0%, #020706 48%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, black 7%, black 93%, transparent 100%);
}

.site-loader-circuit-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(119, 168, 162, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 179, 81, 0.055) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 34px, rgba(244, 241, 232, 0.035) 35px, transparent 36px);
  background-size: 92px 92px, 92px 92px, auto;
  opacity: 0.48;
  pointer-events: none;
}

.site-loader-circuit-field .site-loader-circuit-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  overflow: hidden;
  filter: drop-shadow(0 0 14px rgba(119, 168, 162, 0.22));
  animation: none;
}

.site-loader-circuit-field .circuit-ring {
  opacity: 0;
  animation: siteLoaderRingReveal 3.2s ease-in-out infinite;
}

.site-loader-circuit-field .ring-core {
  animation-delay: 0s;
}

.site-loader-circuit-field .ring-mid {
  animation-delay: 0.48s;
}

.site-loader-circuit-field .ring-outer {
  animation-delay: 0.96s;
}

.site-loader-circuit-field .network-line {
  fill: none;
  stroke: rgba(244, 241, 232, 0.36);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: siteLoaderCircuitSweep 4.2s ease-in-out infinite;
}

.site-loader-circuit-field .ring-core .network-line:nth-of-type(odd),
.site-loader-circuit-field .ring-outer .network-line:nth-of-type(3n) {
  stroke: rgba(224, 179, 81, 0.56);
}

.site-loader-circuit-field .ring-core .network-line:nth-of-type(even),
.site-loader-circuit-field .ring-mid .network-line:nth-of-type(2n),
.site-loader-circuit-field .ring-outer .network-line:nth-of-type(3n + 1) {
  stroke: rgba(119, 168, 162, 0.52);
}

.site-loader-circuit-field .network-node {
  fill: rgba(5, 6, 6, 0.98);
  stroke: rgba(244, 241, 232, 0.72);
  stroke-width: 1.25;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: siteLoaderNodePulse 4.2s ease-in-out infinite;
}

.site-loader-circuit-field .network-node:nth-of-type(2n) {
  stroke: rgba(224, 179, 81, 0.72);
}

.site-loader-circuit-field .network-node:nth-of-type(3n) {
  stroke: rgba(119, 168, 162, 0.72);
}

.site-loader-page-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 46%, rgba(119, 168, 162, 0.08), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    rgba(0, 0, 0, 0.74);
  box-shadow: 0 28px 110px rgba(0, 0, 0, 0.7);
  opacity: 0;
  filter: blur(12px);
  transform: translateY(14px) scale(0.96);
  animation: siteLoaderPageReveal 3.1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.site-loader-nav {
  position: absolute;
  top: 22px;
  left: 26px;
  right: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-loader-nav span {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.14);
}

.site-loader-nav span:first-child {
  width: 104px;
  background: linear-gradient(90deg, rgba(224, 179, 81, 0.84), rgba(119, 168, 162, 0.7));
}

.site-loader-nav span:nth-child(2) {
  margin-left: auto;
  width: 48px;
}

.site-loader-nav span:nth-child(3) {
  width: 72px;
}

.site-loader-grid-lines {
  position: absolute;
  inset: 76px 24px 72px;
  opacity: 0;
  background:
    linear-gradient(rgba(244, 241, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 232, 0.035) 1px, transparent 1px);
  background-size: 54px 44px;
  mask-image: radial-gradient(circle at 50% 46%, black 0, transparent 72%);
  animation: siteLoaderGridReveal 3.1s ease forwards;
}

.site-loader-circuit-network {
  position: absolute;
  inset: 72px 20px 58px;
  width: calc(100% - 40px);
  height: calc(100% - 130px);
  overflow: visible;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(119, 168, 162, 0.18));
  animation: siteLoaderNetworkReveal 3.1s ease forwards;
}

.network-line {
  fill: none;
  stroke: rgba(244, 241, 232, 0.3);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: siteLoaderNetworkTrace 1.3s ease forwards;
}

.network-line.line-one,
.network-line.line-four {
  stroke: rgba(224, 179, 81, 0.58);
}

.network-line.line-two,
.network-line.line-five {
  stroke: rgba(119, 168, 162, 0.52);
}

.network-line.line-three,
.network-line.line-six {
  stroke: rgba(244, 241, 232, 0.34);
}

.network-line.line-one { animation-delay: 1.62s; }
.network-line.line-two { animation-delay: 1.72s; }
.network-line.line-three { animation-delay: 1.82s; }
.network-line.line-four { animation-delay: 1.92s; }
.network-line.line-five { animation-delay: 2.02s; }
.network-line.line-six { animation-delay: 2.12s; }

.network-node {
  fill: rgba(5, 6, 6, 0.98);
  stroke: rgba(244, 241, 232, 0.7);
  stroke-width: 1.25;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: siteLoaderCircuitNode 0.8s ease forwards;
}

.network-node:nth-of-type(1) { animation-delay: 2.02s; }
.network-node:nth-of-type(2) { animation-delay: 2.08s; }
.network-node:nth-of-type(3) { animation-delay: 2.14s; }
.network-node:nth-of-type(4) { animation-delay: 2.2s; }
.network-node:nth-of-type(5) { animation-delay: 2.26s; }
.network-node:nth-of-type(6) { animation-delay: 2.32s; }
.network-node:nth-of-type(7) { animation-delay: 2.38s; }
.network-node:nth-of-type(8) { animation-delay: 2.44s; }

.site-loader-morph {
  display: none;
}

.site-loader-gloss {
  position: absolute;
  inset: -45%;
  background:
    linear-gradient(118deg, transparent 18%, rgba(255, 255, 255, 0.28) 38%, transparent 54%),
    radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 46%);
  transform: translateX(-34%) rotate(8deg);
  animation: siteLoaderGloss 2.9s ease-in-out forwards;
}

.site-loader-graphic {
  position: absolute;
  inset: 20px;
  display: grid;
  place-items: center;
  opacity: 0;
}

.graphic-circuit {
  inset: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  opacity: 1;
  filter: drop-shadow(0 0 16px rgba(119, 168, 162, 0.45));
}

.circuit-line {
  fill: none;
  stroke: rgba(244, 241, 232, 0.74);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: siteLoaderCircuitTrace 1.35s ease forwards;
}

.circuit-line.c1,
.circuit-line.c4 {
  stroke: rgba(224, 179, 81, 0.92);
}

.circuit-line.c2,
.circuit-line.c5 {
  stroke: rgba(119, 168, 162, 0.92);
}

.circuit-line.c1 { animation-delay: 0.08s; }
.circuit-line.c2 { animation-delay: 0.16s; }
.circuit-line.c3 { animation-delay: 0.24s; }
.circuit-line.c4 { animation-delay: 0.32s; }
.circuit-line.c5 { animation-delay: 0.4s; }
.circuit-line.c6 { animation-delay: 0.48s; }

.circuit-node {
  fill: rgba(5, 6, 6, 0.98);
  stroke: rgba(244, 241, 232, 0.86);
  stroke-width: 1.25;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: siteLoaderCircuitNode 0.86s ease forwards;
}

.circuit-node.n1 { animation-delay: 0.18s; }
.circuit-node.n2 { animation-delay: 0.3s; }
.circuit-node.n3 { animation-delay: 0.42s; }
.circuit-node.n4 { animation-delay: 0.26s; }
.circuit-node.n5 { animation-delay: 0.38s; }
.circuit-node.n6 { animation-delay: 0.5s; }
.circuit-node.n7 { animation-delay: 0.62s; }
.circuit-node.n8 { animation-delay: 0.58s; }
.circuit-node.n9 { animation-delay: 0.68s; }
.circuit-node.n10 { animation-delay: 0.74s; }

.graphic-glyph {
  inset: 0;
  color: rgba(244, 241, 232, 0.94);
  font-size: 1.35rem;
  font-weight: 950;
  text-shadow: 0 0 24px rgba(224, 179, 81, 0.42);
  animation: siteLoaderGraphicGlyph 3.1s ease forwards;
}

.site-loader-hero-copy {
  position: absolute;
  inset: 34px;
  display: grid;
  align-content: end;
  gap: 14px;
  opacity: 0;
  filter: blur(8px);
  animation: siteLoaderHeroCopy 3.1s ease forwards;
}

.site-loader-hero-copy span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.site-loader-hero-copy strong {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 4vw, 2.9rem);
  line-height: 1.02;
  max-width: 12ch;
  font-weight: 950;
  letter-spacing: 0;
}

.site-loader-cta-row {
  display: flex;
  gap: 8px;
}

.site-loader-cta-row i {
  width: 82px;
  height: 30px;
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.86);
}

.site-loader-cta-row i + i {
  width: 62px;
  background: rgba(244, 241, 232, 0.16);
}

.site-loader-feature-card,
.site-loader-chart-card,
.site-loader-footer-hint {
  position: absolute;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.26);
  opacity: 0;
  filter: blur(9px);
  transform: translateY(18px) scale(0.92);
  animation: siteLoaderCardPop 3.1s cubic-bezier(0.18, 0.9, 0.24, 1) forwards;
}

.site-loader-feature-card {
  width: 190px;
  height: 118px;
}

.site-loader-feature-card::before,
.site-loader-feature-card::after,
.site-loader-chart-card::before,
.site-loader-chart-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 10px;
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.18);
}

.site-loader-feature-card::before,
.site-loader-chart-card::before {
  top: 20px;
}

.site-loader-feature-card::after,
.site-loader-chart-card::after {
  top: 44px;
  right: 58px;
}

.card-one {
  left: 5%;
  top: 48%;
  animation-delay: 1.72s;
}

.card-two {
  right: 5%;
  top: 55%;
  animation-delay: 1.84s;
}

.site-loader-chart-card {
  right: 8%;
  top: 19%;
  width: 210px;
  height: 144px;
  animation-delay: 1.96s;
}

.site-loader-chart-card span {
  position: absolute;
  bottom: 20px;
  width: 18px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, rgba(224, 179, 81, 0.9), rgba(119, 168, 162, 0.66));
}

.site-loader-chart-card span:first-child {
  left: 28px;
  height: 42px;
}

.site-loader-chart-card span:nth-child(2) {
  left: 64px;
  height: 72px;
}

.site-loader-chart-card span:nth-child(3) {
  left: 100px;
  height: 54px;
}

.site-loader-footer-hint {
  left: 50%;
  bottom: 32px;
  width: min(320px, calc(100% - 48px));
  height: 14px;
  border-radius: 999px;
  transform: translateX(-50%) translateY(18px) scale(0.92);
  animation-delay: 2.08s;
  animation-name: siteLoaderFooterPop;
}

/* Loader timeline:
   Small circuit traces appear in waves across the dark field.
   The circuits stay fixed-size; only the number of visible traces increases. */
@keyframes siteLoaderMorph {
  0% {
    opacity: 0;
    width: 96px;
    height: 96px;
    border-radius: 28px;
    transform: translate(-50%, -50%) scale(0.82) rotate(-6deg) rotateX(10deg);
  }

  9% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg) rotateX(0deg);
  }

  17% {
    width: 96px;
    height: 96px;
    transform: translate(-50%, -50%) scaleX(1.1) scaleY(0.92) rotate(3deg);
  }

  26% {
    transform: translate(-50%, -50%) scaleX(0.96) scaleY(1.08) rotate(-2deg);
  }

  39% {
    width: 320px;
    height: 58px;
    border-radius: 24px;
    transform: translate(-50%, -50%) rotate(0deg);
  }

  56% {
    width: 450px;
    height: 188px;
    border-radius: 30px;
    transform: translate(-50%, -50%) rotateX(5deg);
  }

  74%,
  100% {
    width: 520px;
    height: 322px;
    border-radius: 34px;
    transform: translate(-50%, -50%) rotateX(0deg);
  }
}

@keyframes siteLoaderLivingModule {
  from {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.035) inset,
      0 22px 70px rgba(0, 0, 0, 0.68),
      0 0 38px rgba(119, 168, 162, 0.2);
  }

  to {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.055) inset,
      0 26px 84px rgba(0, 0, 0, 0.72),
      0 0 62px rgba(224, 179, 81, 0.22);
  }
}

@keyframes siteLoaderGloss {
  0% {
    transform: translateX(-38%) rotate(8deg);
    opacity: 0.38;
  }

  100% {
    transform: translateX(32%) rotate(8deg);
    opacity: 0.22;
  }
}

@keyframes siteLoaderCircuitTrace {
  0% {
    opacity: 0;
    stroke-dashoffset: 120;
  }

  72% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  100% {
    opacity: 0.54;
    stroke-dashoffset: 0;
  }
}

@keyframes siteLoaderCircuitNode {
  0% {
    opacity: 0;
    transform: scale(1);
  }

  58% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0.7;
    transform: scale(1);
  }
}

@keyframes siteLoaderNetworkReveal {
  0%,
  50% {
    opacity: 0;
  }

  68%,
  100% {
    opacity: 0.82;
  }
}

@keyframes siteLoaderNetworkTrace {
  0% {
    opacity: 0;
    stroke-dashoffset: 520;
  }

  76% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  100% {
    opacity: 0.52;
    stroke-dashoffset: 0;
  }
}

@keyframes siteLoaderRingReveal {
  0%,
  18% {
    opacity: 0;
  }

  36%,
  76% {
    opacity: 1;
  }

  100% {
    opacity: 0.2;
  }
}

@keyframes siteLoaderCircuitSweep {
  0% {
    opacity: 0;
    stroke-dashoffset: 620;
  }

  46% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  100% {
    opacity: 0.34;
    stroke-dashoffset: 0;
  }
}

@keyframes siteLoaderNodePulse {
  0%,
  22% {
    opacity: 0;
  }

  48% {
    opacity: 1;
  }

  100% {
    opacity: 0.46;
  }
}

@keyframes siteLoaderGraphicGradient {
  0%,
  18% {
    opacity: 1;
    transform: scale(1);
  }

  31%,
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes siteLoaderGraphicOrbits {
  0%,
  16%,
  37%,
  100% {
    opacity: 0;
  }

  20%,
  30% {
    opacity: 1;
  }
}

@keyframes siteLoaderGraphicSpark {
  0%,
  30%,
  50%,
  100% {
    opacity: 0;
    transform: scale(0.78) rotate(0deg);
  }

  34%,
  43% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }
}

@keyframes siteLoaderGraphicChart {
  0%,
  41%,
  61%,
  100% {
    opacity: 0;
    transform: translateY(6px);
  }

  46%,
  55% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes siteLoaderGraphicCursor {
  0%,
  54%,
  72%,
  100% {
    opacity: 0;
    transform: translateX(-12px);
  }

  59%,
  66% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes siteLoaderGraphicGlyph {
  0%,
  62%,
  78%,
  100% {
    opacity: 0;
    transform: scale(0.82);
  }

  67%,
  73% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes siteLoaderOrbitDot {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

@keyframes siteLoaderPageReveal {
  0%,
  56% {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(14px) scale(0.96);
  }

  76%,
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes siteLoaderGridReveal {
  0%,
  54% {
    opacity: 0;
  }

  72%,
  100% {
    opacity: 1;
  }
}

@keyframes siteLoaderCardPop {
  0%,
  62% {
    opacity: 0;
    filter: blur(9px);
    transform: translateY(18px) scale(0.92);
  }

  82%,
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes siteLoaderFooterPop {
  0%,
  62% {
    opacity: 0;
    filter: blur(9px);
    transform: translateX(-50%) translateY(18px) scale(0.92);
  }

  82%,
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes siteLoaderHeroCopy {
  0%,
  68% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(12px);
  }

  86%,
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes siteLoaderMessage {
  0%,
  14% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  25%,
  100% {
    opacity: 0.92;
    transform: translateX(-50%) translateY(0);
  }
}

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

button {
  cursor: pointer;
  position: relative;
  transform-origin: center;
}

button:disabled {
  cursor: not-allowed;
}

button.button-clicked {
  animation: buttonClickPulse 0.46s ease-out;
}

button.button-working {
  pointer-events: none;
}

button.button-working::after {
  content: "";
  width: 0.75em;
  height: 0.75em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  display: inline-block;
  margin-left: 8px;
  vertical-align: -0.12em;
  animation: buttonWorkingSpin 0.75s linear infinite;
}

@keyframes buttonClickPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 179, 81, 0);
  }

  38% {
    transform: scale(0.97);
    box-shadow: 0 0 0 5px rgba(224, 179, 81, 0.18);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 179, 81, 0);
  }
}

@keyframes buttonWorkingSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  button.button-clicked,
  button.button-working::after,
  .site-loader-page-frame,
  .site-loader-grid-lines,
  .site-loader-circuit-network,
  .site-loader-circuit-field .circuit-ring,
  .network-line,
  .network-node,
  .site-loader-morph,
  .site-loader-gloss,
  .site-loader-graphic,
  .circuit-line,
  .circuit-node,
  .site-loader-hero-copy,
  .site-loader-feature-card,
  .site-loader-chart-card,
  .site-loader-footer-hint,
  .site-loader-message {
    animation: none;
  }

  .site-loader-page-frame,
  .site-loader-grid-lines,
  .site-loader-circuit-network,
  .site-loader-circuit-field .circuit-ring,
  .network-line,
  .network-node,
  .graphic-circuit,
  .circuit-line,
  .circuit-node,
  .site-loader-feature-card,
  .site-loader-chart-card,
  .site-loader-footer-hint,
  .site-loader-message {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .site-loader-message {
    transform: translateX(-50%);
  }

  .site-loader-footer-hint {
    transform: translateX(-50%);
  }

  .site-loader-morph {
    width: 520px;
    height: 322px;
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  .site-loader-hero-copy {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .graphic-gradient,
  .graphic-orbits,
  .graphic-spark,
  .graphic-chart,
  .graphic-cursor,
  .graphic-glyph {
    opacity: 0;
  }
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-icon {
  width: 1.08em;
  height: 1.08em;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
}

.icon-only-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-only-btn .app-icon,
.menu-toggle .app-icon,
.icon-upload-btn .app-icon {
  width: 18px;
  height: 18px;
}

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

body.show-assistant .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: 7px;
  background: rgba(7, 8, 8, 0.96);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  position: relative;
  z-index: 340;
}

body.start-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar,
body.start-mode .sidebar,
body.start-mode .assistant-panel {
  display: none;
}

body.start-mode .workspace {
  min-height: 100vh;
}

.app-menu {
  position: fixed;
  top: 70px;
  right: 18px;
  z-index: 330;
  width: min(240px, calc(100vw - 28px));
  max-height: calc(100vh - 86px);
  display: grid;
  gap: 8px;
  border: 1px solid rgba(244, 241, 232, 0.18);
  background: rgba(3, 4, 4, 0.98);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow);
}

.project-banner {
  margin: 0 26px 14px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  background: rgba(7, 8, 8, 0.86);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 750;
  letter-spacing: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.storage-warning {
  margin: 0 26px 14px;
  border: 1px solid rgba(224, 179, 81, 0.34);
  background: rgba(224, 179, 81, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.storage-warning strong {
  flex: 0 0 auto;
  color: #ffe2a0;
}

.storage-warning span {
  color: var(--muted);
}

.storage-warning-panel {
  margin: 0 0 16px;
}

.plotthirst-page-boundary {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18%),
    rgba(7, 8, 8, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.plotthirst-page-boundary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(224, 179, 81, 0.28), transparent 20%) top left / 34% 1px no-repeat,
    linear-gradient(270deg, rgba(119, 168, 162, 0.26), transparent 20%) bottom right / 34% 1px no-repeat;
  opacity: 0.72;
}

.showcase-hero {
  width: min(1800px, calc(100% - 16px));
  min-height: calc(100svh - 76px);
  margin: 8px auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(320px, 1.08fr);
  gap: 30px;
  align-items: center;
  padding: clamp(18px, 4vw, 54px);
}

.showcase-copy {
  display: grid;
  gap: 18px;
  max-width: 680px;
}

.showcase-copy h2 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.showcase-copy p:not(.fine-print) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.showcase-player {
  display: grid;
  align-items: center;
}

.showcase-frame {
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 8px;
  background: #070808;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.showcase-frame-top,
.showcase-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.showcase-frame-top strong {
  color: var(--text);
}

.showcase-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.showcase-category-tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.showcase-category-tab.active {
  border-color: rgba(224, 179, 81, 0.72);
  color: var(--text);
  background: rgba(224, 179, 81, 0.12);
}

.showcase-video-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  padding: 0;
  background:
    radial-gradient(circle at 70% 20%, rgba(224, 179, 81, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(119, 168, 162, 0.12), rgba(6, 7, 7, 0.86) 42%, rgba(224, 179, 81, 0.08)),
    #050606;
}

.showcase-media-shell {
  min-height: min(72vh, 740px);
  max-height: 760px;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.2vw, 22px);
  background: #050606;
  overflow: hidden;
}

.showcase-media {
  width: auto;
  max-width: 100%;
  height: min(68vh, 700px);
  max-height: 700px;
  aspect-ratio: 9 / 16;
  display: block;
  border: 0;
  object-fit: contain;
  background: #050606;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.showcase-embed-shell {
  min-height: min(72vh, 740px);
}

.showcase-embed {
  border: 0;
  overflow: hidden;
  color-scheme: dark;
}

.showcase-external-card {
  width: min(460px, 100%);
  aspect-ratio: 9 / 16;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(5, 6, 6, 0.18), rgba(5, 6, 6, 0.9)),
    radial-gradient(circle at 50% 18%, rgba(224, 179, 81, 0.18), transparent 34%),
    #080908;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.showcase-external-card span,
.showcase-external-card p {
  color: var(--muted);
}

.showcase-external-card strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.showcase-external-card p {
  margin: 0;
  line-height: 1.45;
}

.showcase-motion {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(255,255,255,0.03), rgba(255,255,255,0.16), rgba(255,255,255,0.02));
  background-size: 220% 100%;
  animation: loadingSweep 2.4s infinite linear;
}

.showcase-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: 520px;
  align-self: end;
  margin: 22px;
  padding: 14px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(8, 9, 9, 0.76);
  backdrop-filter: blur(10px);
}

.showcase-info-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #0b0d0c;
}

.showcase-info-copy,
.showcase-info-actions,
.showcase-queue-actions {
  min-width: 0;
  display: flex;
  gap: 8px;
}

.showcase-info-copy {
  flex-direction: column;
}

.showcase-info-bar strong {
  font-size: 0.98rem;
}

.showcase-info-copy > span {
  font-size: 0.84rem;
}

.showcase-info-actions,
.showcase-queue-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.showcase-playback-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.showcase-playback-note span {
  border: 1px solid rgba(119, 168, 162, 0.28);
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--text);
  background: rgba(119, 168, 162, 0.1);
  font-weight: 800;
}

.showcase-video-card strong {
  font-size: 1.25rem;
}

.showcase-video-card span,
.showcase-strip span {
  color: var(--muted);
}

.hidden-file {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.showcase-admin-row {
  align-items: start;
}

.spend-row.showcase-admin-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  min-width: 0;
}

.showcase-admin-row span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.showcase-admin-url {
  overflow-wrap: anywhere;
}

.showcase-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ultimate-easy-page {
  display: grid;
  gap: 16px;
}

.ultimate-easy-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0 4px;
}

.ultimate-easy-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 2vw, 2.1rem);
}

.ultimate-easy-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.ultimate-home-mode-switch,
.stories-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.ultimate-mode-card,
.stories-action-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.ultimate-mode-card:hover,
.ultimate-mode-card.active,
.stories-action-card:hover,
.stories-action-card.active,
.stories-action-card.primary {
  border-color: rgba(248, 198, 92, 0.45);
  background:
    linear-gradient(145deg, rgba(248, 198, 92, 0.14), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.24);
}

.ultimate-mode-card:hover,
.stories-action-card:hover {
  transform: translateY(-1px);
}

.ultimate-mode-card strong,
.stories-action-card strong {
  font-size: 1rem;
}

.ultimate-mode-card span,
.stories-action-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.stories-action-card .app-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

@media (max-width: 720px) {
  .ultimate-home-mode-switch,
  .stories-action-grid {
    grid-template-columns: 1fr;
  }
}

.ultimate-easy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.ultimate-easy-page.ultimate-home-choice .ultimate-easy-grid {
  display: none;
}

.ultimate-easy-page.ultimate-home-load .ultimate-easy-grid {
  grid-template-columns: minmax(0, 1fr);
  width: min(1380px, 100%);
  justify-self: center;
  justify-content: center;
}

.ultimate-easy-page.job-active .ultimate-easy-grid {
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
}

.ultimate-easy-page.branch-action-mode .ultimate-easy-grid {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.ultimate-easy-page.job-active .ultimate-setup-fields,
.ultimate-easy-page.job-active .ultimate-settings-panel,
.ultimate-easy-page.ultimate-home-load .ultimate-setup-fields,
.ultimate-easy-page.ultimate-home-load .ultimate-settings-panel,
.ultimate-easy-page.branch-action-mode .ultimate-setup-fields,
.ultimate-easy-page.branch-action-mode .ultimate-settings-panel {
  display: none;
}

.ultimate-setup-fields {
  display: grid;
  gap: 10px;
}

.ultimate-easy-main textarea,
.ultimate-easy-settings input,
.ultimate-easy-settings select {
  width: 100%;
}

.ultimate-lens-toggle {
  margin-top: 2px;
}

.ultimate-lens-field {
  display: grid;
  gap: 8px;
}

.ultimate-dialogue-control {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  border: 1px solid rgba(224, 179, 81, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.ultimate-dialogue-control select,
.ultimate-dialogue-control input[type="text"],
.ultimate-dialogue-control textarea {
  width: 100%;
}

.ultimate-reference-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(220px, 1.15fr);
  gap: 12px;
  align-items: end;
}

.ultimate-reference-preview {
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.ultimate-reference-preview-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  padding: 8px;
}

.ultimate-reference-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.ultimate-reference-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.ultimate-reference-name-input {
  min-width: 0;
  height: 28px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 0.74rem;
}

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

.ultimate-detail-control,
.ultimate-run-summary,
.ultimate-delivery-options,
.ultimate-cost-estimate {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.ultimate-slider-head,
.ultimate-slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ultimate-slider-head span,
.ultimate-slider-labels {
  color: var(--muted);
  font-size: 0.82rem;
}

.ultimate-slider-head span {
  font-weight: 750;
  text-align: right;
}

.ultimate-detail-control input[type="range"] {
  width: 100%;
}

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

.ultimate-length-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ultimate-length-grid input {
  width: 100%;
  height: 34px;
  min-width: 0;
}

.ultimate-run-summary strong {
  color: #ffe2a0;
}

.ultimate-run-summary span {
  color: var(--muted);
  font-size: 0.84rem;
}

.ultimate-delivery-options strong {
  color: #ffffff;
}

.ultimate-delivery-options .toggle-row {
  margin-bottom: 0;
}

.ultimate-cost-estimate {
  border-color: rgba(224, 179, 81, 0.2);
}

.ultimate-cost-estimate strong {
  color: #ffe2a0;
}

.ultimate-cost-estimate span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.ultimate-cost-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.own-key-estimate,
.own-key-total-price,
.own-key-stage-price {
  display: inline-grid;
  gap: 2px;
  justify-items: end;
  line-height: 1.1;
}

.own-key-total-price {
  justify-items: start;
}

.own-key-estimate s,
.own-key-total-price s,
.own-key-stage-price s {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.78em;
  text-decoration-color: rgba(224, 179, 81, 0.9);
  text-decoration-thickness: 2px;
}

.own-key-current {
  color: #ffffff;
  font-weight: 850;
}

.own-key-estimate small,
.own-key-total-price small,
.own-key-stage-price small {
  color: #ffe2a0;
  font-size: 0.72em;
  font-weight: 750;
  white-space: nowrap;
}

.ultimate-cost-estimate ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ultimate-cost-estimate li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
  font-size: 0.82rem;
}

.ultimate-cost-estimate li strong {
  flex: 0 0 auto;
  color: #ffffff;
  font-size: 0.82rem;
}

.ultimate-cost-estimate li.own-key-discounted {
  border-color: rgba(224, 179, 81, 0.18);
}

.ultimate-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ultimate-submit-row-bottom {
  margin-top: 12px;
  align-items: stretch;
}

.ultimate-submit-row-bottom .primary-btn {
  min-width: 180px;
}

.ultimate-total-estimate {
  border: 1px solid rgba(224, 179, 81, 0.24);
  border-radius: 8px;
  background: rgba(224, 179, 81, 0.08);
  color: #ffe2a0;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 9px 11px;
}

.ultimate-total-estimate.warning {
  border-color: rgba(255, 105, 105, 0.4);
  background: rgba(255, 105, 105, 0.08);
  color: #ffb7b7;
}

.ultimate-run-animation {
  width: 70px;
  height: 70px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(224, 179, 81, 0.32);
  display: grid;
  place-items: center;
  background: rgba(224, 179, 81, 0.06);
}

.ultimate-run-animation::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  animation: ultimate-spin 0.75s linear infinite;
}

.ultimate-run-animation span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(224, 179, 81, 0.62);
  animation: ultimate-pulse 1.15s ease-in-out infinite;
}

.ultimate-run-animation.idle::before,
.ultimate-run-animation.idle span {
  animation-play-state: paused;
  opacity: 0.45;
}

.ultimate-progress-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.ultimate-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ultimate-progress-head span:last-child {
  color: rgba(255, 255, 255, 0.52);
  font-weight: 600;
}

.ultimate-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.ultimate-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #77a8a2);
  transition: width 220ms ease;
}

.ultimate-progress-log {
  min-height: 92px;
  max-height: 230px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font-family: "Consolas", "Menlo", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.ultimate-result {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  word-break: break-word;
}

.ultimate-result a {
  color: #ffe2a0;
}

.ultimate-active-actions {
  display: none;
}

.ultimate-easy-page.job-active .ultimate-active-actions {
  display: flex;
}

.ultimate-easy-page.job-resumable .ultimate-active-actions {
  display: flex;
}

.ultimate-easy-page.job-active .ultimate-recovery-panel {
  display: none;
}

.ultimate-easy-page.ultimate-home-start .ultimate-recovery-panel,
.ultimate-easy-page.ultimate-home-start .ultimate-story-action-panel {
  display: none;
}

.ultimate-easy-page.job-active .ultimate-story-action-panel {
  display: none;
}

.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-easy-main > .panel-header,
.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-progress-head,
.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-progress-bar,
.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-progress-log,
.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-active-actions,
.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-result,
.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-easy-main > .fine-print {
  display: none;
}

.ultimate-easy-page.ultimate-home-load:not(.branch-action-mode):not(.job-active) .ultimate-progress-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ultimate-easy-page.branch-action-mode .ultimate-easy-main > .panel-header,
.ultimate-easy-page.branch-action-mode .ultimate-progress-head,
.ultimate-easy-page.branch-action-mode .ultimate-progress-bar,
.ultimate-easy-page.branch-action-mode .ultimate-progress-log,
.ultimate-easy-page.branch-action-mode .ultimate-active-actions,
.ultimate-easy-page.branch-action-mode .ultimate-recovery-panel,
.ultimate-easy-page.branch-action-mode .ultimate-result,
.ultimate-easy-page.branch-action-mode .ultimate-easy-main > .fine-print {
  display: none;
}

.ultimate-easy-page.job-active.branch-action-mode .ultimate-story-action-panel {
  display: grid;
}

.ultimate-easy-page.branch-action-mode .ultimate-progress-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ultimate-easy-page.branch-action-mode .ultimate-easy-head p {
  display: none;
}

.ultimate-recovery-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
}

.ultimate-easy-page.ultimate-home-load .ultimate-recovery-panel {
  margin-top: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ultimate-recovery-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.ultimate-recovery-head strong {
  color: #f7f7f7;
  font-size: 0.9rem;
}

.ultimate-recovery-head span,
.ultimate-recovery-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.ultimate-recovery-row {
  display: grid;
  grid-template-columns: auto minmax(145px, 180px) minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.ultimate-recovery-arrange,
.ultimate-recovery-lookup {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.ultimate-recovery-arrange select,
.ultimate-recovery-lookup input {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
}

.ultimate-recovery-title-picker {
  display: grid;
  gap: 8px;
}

.ultimate-recovery-tree {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.ultimate-recovery-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin-left: calc(var(--recovery-depth, 0) * 22px);
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.ultimate-recovery-title-row[style*="--recovery-depth: 1"],
.ultimate-recovery-title-row[style*="--recovery-depth: 2"],
.ultimate-recovery-title-row[style*="--recovery-depth: 3"],
.ultimate-recovery-title-row[style*="--recovery-depth: 4"],
.ultimate-recovery-title-row[style*="--recovery-depth: 5"],
.ultimate-recovery-title-row[style*="--recovery-depth: 6"],
.ultimate-recovery-title-row[style*="--recovery-depth: 7"],
.ultimate-recovery-title-row[style*="--recovery-depth: 8"] {
  border-left-color: rgba(246, 211, 110, 0.42);
}

.ultimate-recovery-title-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ultimate-recovery-title-main strong,
.ultimate-recovery-title-main span,
.ultimate-recovery-title-main small {
  overflow-wrap: anywhere;
}

.ultimate-recovery-title-main strong {
  color: #fff;
  font-size: 0.88rem;
}

.ultimate-recovery-title-main span,
.ultimate-recovery-title-main small {
  color: var(--muted);
  font-size: 0.74rem;
}

.ultimate-recovery-title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.ultimate-recovery-child-count {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(246, 211, 110, 0.12);
  color: #f6d36e;
  font-size: 0.7rem;
}

.ultimate-recovery-empty {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.ultimate-recovery-story-search {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(116, 210, 198, 0.18);
  border-radius: 8px;
  background: rgba(116, 210, 198, 0.045);
}

.ultimate-recovery-story-search-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.ultimate-recovery-story-search-head strong {
  color: #b9f5eb;
  font-size: 0.84rem;
}

.ultimate-recovery-story-search-head span {
  color: rgba(232, 237, 246, 0.68);
  font-size: 0.74rem;
  text-align: right;
}

.ultimate-recovery-story-search-tree {
  display: grid;
  gap: 7px;
}

.ultimate-recovery-story-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
  margin-left: calc(var(--recovery-depth, 0) * 22px);
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-left-color: rgba(116, 210, 198, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  box-sizing: border-box;
}

.ultimate-recovery-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.ultimate-recovery-loading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 9px 10px;
  border: 1px solid rgba(224, 179, 81, 0.18);
  border-radius: 8px;
  background: rgba(224, 179, 81, 0.07);
  color: rgba(232, 237, 246, 0.82);
}

.ultimate-recovery-loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: ultimate-spin 0.75s linear infinite;
}

.ultimate-recovery-project,
.ultimate-recovery-branch {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.ultimate-recovery-project > summary,
.ultimate-recovery-branch > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 10px 12px;
  color: #fff;
  list-style: none;
}

.ultimate-recovery-project > summary::-webkit-details-marker,
.ultimate-recovery-branch > summary::-webkit-details-marker {
  display: none;
}

.ultimate-recovery-project > summary::after,
.ultimate-recovery-branch > summary::after {
  content: "+";
  color: #ffe2a0;
  font-weight: 800;
}

.ultimate-recovery-project[open] > summary::after,
.ultimate-recovery-branch[open] > summary::after {
  content: "-";
}

.ultimate-recovery-project-title,
.ultimate-recovery-branch-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ultimate-recovery-project-title strong,
.ultimate-recovery-branch-title strong {
  overflow-wrap: anywhere;
}

.ultimate-recovery-project-title span,
.ultimate-recovery-branch-title span {
  color: var(--muted);
  font-size: 0.76rem;
}

.ultimate-recovery-branches,
.ultimate-recovery-branch-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.ultimate-easy-page.ultimate-home-load .ultimate-recovery-branches,
.ultimate-easy-page.ultimate-home-load .ultimate-recovery-branch-body {
  padding: 0 6px 6px;
}

.ultimate-easy-page.ultimate-home-load .ultimate-recovery-item {
  padding: 8px;
}

.ultimate-recovery-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.ultimate-recovery-item[data-linked="true"] {
  border-color: rgba(255, 214, 90, 0.18);
  background: linear-gradient(135deg, rgba(255, 214, 90, 0.055), rgba(255, 255, 255, 0.025));
}

.ultimate-recovery-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ultimate-recovery-item-main strong,
.ultimate-recovery-item-main span,
.ultimate-recovery-item-main small {
  overflow-wrap: anywhere;
}

.ultimate-recovery-item-main strong {
  color: #fff;
  font-size: 0.9rem;
}

.ultimate-recovery-actions,
.ultimate-recovery-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ultimate-recovery-actions {
  justify-content: flex-end;
}

.ultimate-recovery-story-branches-shell {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

.ultimate-recovery-badges span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 214, 90, 0.12);
  color: #f1d995;
  font-size: 0.7rem;
}

.ultimate-recovery-chain {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

.ultimate-recovery-error {
  color: #ffb4aa;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.ultimate-recovery-note {
  color: #e9d58a;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.ultimate-result-video {
  width: 100%;
  max-height: 340px;
  border-radius: 8px;
  background: #050505;
}

.ultimate-story-action-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 214, 90, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 214, 90, 0.1), transparent 34%),
    rgba(3, 7, 12, 0.58);
}

.ultimate-story-action-panel.hidden {
  display: none;
}

.ultimate-story-action-panel.focused-resolver {
  margin-top: 0;
  gap: 12px;
  border-color: rgba(255, 214, 90, 0.24);
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 214, 90, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(3, 7, 12, 0.72);
}

.ultimate-story-action-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ultimate-story-action-head > div,
.ultimate-story-command {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ultimate-story-action-head strong {
  color: #fff;
}

.ultimate-story-action-head span,
.ultimate-story-action-panel p,
.ultimate-story-command {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.ultimate-story-action-status {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 214, 90, 0.08);
  color: #f4d77e;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.ultimate-story-action-status.inline {
  margin-top: 2px;
}

.ultimate-story-action-status-list {
  display: grid;
  gap: 8px;
}

.ultimate-story-action-job-status {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 214, 90, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(2, 6, 12, 0.72);
  color: #e8edf6;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.ultimate-story-action-job-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ultimate-story-action-job-head strong {
  color: #ffd65a;
}

.ultimate-story-action-job-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(232, 237, 246, 0.62);
  white-space: nowrap;
}

.ultimate-recovery-story-branches {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 4px;
  max-height: min(72vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid rgba(255, 214, 90, 0.14);
  border-radius: 8px;
  background: rgba(255, 214, 90, 0.045);
  scrollbar-gutter: stable;
}

.ultimate-recovery-story-branches-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0 7px;
  background:
    linear-gradient(180deg, rgba(18, 16, 9, 0.98), rgba(18, 16, 9, 0.9)),
    rgba(255, 214, 90, 0.045);
}

.ultimate-recovery-story-branches-head strong,
.ultimate-recovery-story-branch strong {
  color: #f6d36e;
  font-size: 0.82rem;
}

.ultimate-recovery-story-branches-head span,
.ultimate-recovery-story-branch span,
.ultimate-recovery-story-branch small {
  color: rgba(232, 237, 246, 0.65);
  font-size: 0.74rem;
}

.ultimate-recovery-story-branch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  box-sizing: border-box;
}

.ultimate-recovery-story-branch-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.ultimate-recovery-story-branch-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.ultimate-recovery-story-branch-title .story-chip {
  flex: 0 0 auto;
  border-color: rgba(246, 211, 110, 0.32);
  color: #f6d36e;
}

.ultimate-recovery-story-branch-title strong,
.ultimate-recovery-story-branch-submeta {
  min-width: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.ultimate-recovery-story-branch-title strong {
  line-height: 1.25;
}

.ultimate-recovery-story-branch-submeta {
  line-height: 1.3;
}

.ultimate-recovery-story-branch-summary-box {
  margin: 1px 0 0;
  width: 100%;
  max-width: none;
  max-height: min(32rem, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.ultimate-recovery-story-branch-summary-box p {
  margin: 0;
  color: rgba(232, 237, 246, 0.82);
  font-size: 0.8rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ultimate-recovery-story-branch-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ultimate-recovery-story-branch-facts span {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 34rem);
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(232, 237, 246, 0.74);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ultimate-recovery-story-branch-details {
  min-width: 0;
  width: 100%;
  margin-top: 1px;
}

.ultimate-recovery-story-branch-details summary {
  width: fit-content;
  cursor: pointer;
  list-style: none;
  color: #f6d36e;
  font-size: 0.74rem;
  font-weight: 700;
}

.ultimate-recovery-story-branch-details summary::-webkit-details-marker {
  display: none;
}

.ultimate-recovery-story-branch-details summary::after {
  content: " +";
  color: rgba(246, 211, 110, 0.68);
}

.ultimate-recovery-story-branch-details[open] summary::after {
  content: " -";
}

.ultimate-recovery-story-branch-details p {
  margin: 6px 0 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(232, 237, 246, 0.72);
  font-size: 0.76rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.ultimate-recovery-story-branch-video {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
  padding: 7px;
  border: 1px solid rgba(255, 214, 90, 0.16);
  border-radius: 8px;
  background: rgba(255, 214, 90, 0.055);
}

.ultimate-recovery-story-branch-video > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 228, 143, 0.86);
  font-weight: 700;
}

.ultimate-recovery-story-branch-video .button-row.compact {
  max-width: none;
  flex: 0 0 auto;
}

.ops-auditor-report {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 9px;
  border: 1px solid rgba(98, 178, 255, 0.22);
  border-radius: 8px;
  background: rgba(8, 15, 27, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.ops-auditor-head,
.ops-auditor-issue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ops-auditor-head strong,
.ops-auditor-issue-head strong {
  color: #9cd2ff;
  font-size: 0.78rem;
}

.ops-auditor-head span,
.ops-auditor-issue-head span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(232, 237, 246, 0.66);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.ops-auditor-report > p,
.ops-auditor-issue p {
  margin: 0;
  color: rgba(232, 237, 246, 0.78);
  font-size: 0.76rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ops-auditor-issue {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.ops-auditor-issue.critical,
.ops-auditor-issue.error {
  border-color: rgba(255, 104, 104, 0.28);
  background: rgba(255, 74, 74, 0.075);
}

.ops-auditor-issue.warning {
  border-color: rgba(255, 214, 90, 0.28);
  background: rgba(255, 214, 90, 0.07);
}

.ops-auditor-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ops-auditor-evidence span {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  color: rgba(232, 237, 246, 0.64);
  font-size: 0.68rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ops-auditor-issue ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
  color: rgba(232, 237, 246, 0.76);
  font-size: 0.74rem;
  line-height: 1.35;
}

.ops-auditor-clean {
  padding: 7px;
  border-radius: 7px;
  color: rgba(169, 255, 203, 0.82);
  background: rgba(40, 217, 112, 0.08);
  font-size: 0.74rem;
}

.ops-live-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(98, 178, 255, 0.2);
  border-radius: 8px;
  background: rgba(8, 15, 27, 0.74);
}

.ops-live-status > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.ops-live-status strong {
  color: #9cd2ff;
  font-size: 0.8rem;
}

.ops-live-status span {
  color: rgba(232, 237, 246, 0.72);
  font-size: 0.74rem;
}

.ops-live-status.ok {
  border-color: rgba(156, 255, 194, 0.22);
}

.ops-live-status.error {
  border-color: rgba(255, 104, 104, 0.3);
  background: rgba(255, 74, 74, 0.06);
}

.ops-live-status.off {
  border-color: rgba(255, 214, 90, 0.22);
  background: rgba(255, 214, 90, 0.055);
}

.ultimate-recovery-story-branch .button-row.compact,
.ultimate-recovery-story-search-row .button-row.compact {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 14rem;
}

@media (max-width: 720px) {
  .ops-live-status {
    grid-template-columns: minmax(0, 1fr);
  }

  .ultimate-recovery-story-branch,
  .ultimate-recovery-story-search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ultimate-recovery-story-branch .button-row.compact,
  .ultimate-recovery-story-search-row .button-row.compact {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .ultimate-recovery-story-branch-video {
    align-items: flex-start;
    flex-direction: column;
  }

  .ultimate-recovery-story-branch-summary-box {
    max-height: min(22rem, 46vh);
  }

  .story-focused-video-actions {
    display: grid;
  }

}

@media (max-width: 920px) {
  .ultimate-recovery-item,
  .ultimate-recovery-story-branch,
  .ultimate-recovery-story-search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ultimate-recovery-actions,
  .ultimate-recovery-story-branch .button-row.compact,
  .ultimate-recovery-story-search-row .button-row.compact {
    justify-content: flex-start;
    max-width: none;
  }
}

.ultimate-story-action-buttons {
  align-items: center;
}

.ultimate-focused-video-panel {
  padding: 10px;
  border: 1px solid rgba(255, 214, 90, 0.16);
  border-radius: 8px;
  background: rgba(255, 214, 90, 0.045);
}

.story-focused-video-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.story-focused-video-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.story-focused-video-actions small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.story-resolution-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 214, 90, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.story-resolution-panel.compact {
  background: rgba(255, 214, 90, 0.045);
}

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

.story-resolution-head strong {
  color: var(--text);
}

.story-resolution-head span {
  color: #f4d77e;
  font-size: 0.78rem;
}

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

.story-resolution-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ultimate-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: fit-content;
  text-decoration: none;
}

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

@keyframes ultimate-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }

  50% {
    opacity: 0.9;
    transform: scale(1);
  }
}

body.start-mode .project-banner {
  display: none;
}

body.start-mode .storage-warning {
  display: none;
}

body.start-mode .topbar {
  position: relative;
  display: flex;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding-right: 0;
}

body.start-mode .top-title-block {
  max-width: 760px;
  justify-self: center;
  text-align: center;
}

body.start-mode .top-account-cluster {
  top: 16px;
  right: 18px;
  justify-content: flex-end;
  width: auto;
}

body.start-mode .profile-button {
  display: none;
}

body.start-mode .page-jump {
  display: none;
}

body.login-required .page-jump,
body.login-required .nav-tabs,
body.login-required .storage-warning,
body.login-required .project-banner {
  display: none;
}

body.login-required .workspace {
  min-height: 100vh;
  justify-content: center;
}

.menu-page-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.menu-page-tab span:first-child,
.menu-submenu summary span:first-child {
  min-width: 0;
}

.menu-icon {
  flex: 0 0 auto;
  color: var(--muted);
  width: 17px;
  height: 17px;
  opacity: 0.88;
}

.menu-page-tab[data-tab="ultimate-omega"] .menu-icon,
.omega-bolt-icon {
  color: var(--accent);
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(224, 179, 81, 0.28));
}

.menu-page-tab.active {
  border-color: rgba(224, 179, 81, 0.65);
  background: rgba(224, 179, 81, 0.16);
  color: #ffe2a0;
}

.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 3px 0;
}

.menu-submenu {
  display: grid;
  gap: 7px;
}

.menu-submenu summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border: 1px solid rgba(119, 168, 162, 0.55);
  border-radius: 7px;
  background: rgba(119, 168, 162, 0.1);
  color: #c6e2df;
  padding: 0 12px;
  font-weight: 750;
}

.menu-submenu[open] summary {
  margin-bottom: 7px;
}

.menu-submenu .menu-page-tab {
  margin-left: 12px;
}

.menu-project-block {
  display: grid;
  gap: 7px;
}

.menu-project-block label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.menu-project-block select {
  width: 100%;
  min-height: 36px;
}

.sidebar {
  display: none;
  border-right: 1px solid var(--line);
  background: rgba(3, 4, 4, 0.91);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(224, 179, 81, 0.55);
  background: #1d1b13;
  color: var(--accent);
  font-weight: 800;
  border-radius: 8px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.05rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.9rem;
  line-height: 1.15;
}

h3 {
  font-size: 1rem;
  line-height: 1.2;
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  letter-spacing: 0;
}

.plot-word {
  color: #f2d48a;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.thirst-word {
  position: relative;
  color: #ff6f3c;
  font-weight: 900;
  text-transform: lowercase;
}

.thirst-word::after {
  content: "";
  position: absolute;
  left: 1px;
  right: -2px;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 111, 60, 0.15), rgba(255, 111, 60, 0.95));
}

.beta-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid rgba(224, 179, 81, 0.55);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.68em;
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: middle;
}

.build-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.04);
}

.top-build-badge {
  margin: 2px 0 6px;
}

.brand p,
.topbar p,
.fine-print,
.empty-state {
  color: var(--muted);
}

.warning-text {
  color: var(--danger);
}

.system-prompt-hidden,
.hidden-prompt-note {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

.hidden-prompt-note {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.brand p {
  font-size: 0.85rem;
  margin-top: 5px;
}

.nav-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.nav-tab,
.segment,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  border-radius: 7px;
  min-height: 42px;
  padding: 0 14px;
}

.nav-tab.active,
.segment.active {
  border-color: rgba(224, 179, 81, 0.65);
  background: rgba(224, 179, 81, 0.16);
  color: #ffe2a0;
}

.primary-btn {
  border-color: transparent;
  background: var(--accent);
  color: #18140a;
  font-weight: 700;
}

.secondary-btn {
  border-color: rgba(119, 168, 162, 0.55);
  background: rgba(119, 168, 162, 0.12);
  color: #c6e2df;
}

.secondary-btn.danger {
  border-color: rgba(221, 107, 93, 0.55);
  background: rgba(221, 107, 93, 0.12);
  color: #ffb3a8;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
}

.danger-action {
  border-color: rgba(221, 107, 93, 0.55);
  color: var(--danger);
}

.danger-btn {
  border-color: rgba(221, 107, 93, 0.65);
  background: rgba(221, 107, 93, 0.14);
  color: #ffb3a8;
}

.pipeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
}

.account-card,
.project-card,
.panel {
  background: rgba(7, 8, 8, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-card {
  padding: 14px;
  margin-bottom: 16px;
}

.account-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.account-header h3 {
  margin-bottom: 5px;
}

.project-card {
  padding: 16px;
}

.mobile-share {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mobile-share h3 {
  margin-bottom: 8px;
}

.qr-box {
  width: 148px;
  height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 10px;
  overflow: hidden;
}

.qr-box img {
  display: block;
  width: 100%;
  height: 100%;
}

.workspace {
  padding: 26px;
  padding-top: 76px;
  min-width: 0;
}

.assistant-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.58);
  padding: 18px;
  overflow: hidden;
}

body.work-panel-open .assistant-panel {
  display: grid;
  justify-items: end;
  align-items: start;
}

.assistant-panel::before {
  content: "";
  position: absolute;
  inset: 0;
}

.assistant-panel > section {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 36px));
  border: 1px solid rgba(244, 241, 232, 0.16);
  background: rgba(3, 4, 4, 0.98);
  box-shadow: var(--shadow);
}

body:not(.show-assistant) .assistant-drawer,
body:not(.show-assistant) #toggleAssistantDrawer {
  display: none;
}

.assistant-panel h3 {
  margin-bottom: 10px;
}

.pending-panel {
  display: grid;
  gap: 12px;
  max-height: min(74vh, 620px);
  min-height: 220px;
  border-radius: 8px 8px 0 0;
  padding: 16px;
  overflow: hidden;
}

.assistant-drawer {
  display: grid;
  gap: 8px;
  max-height: min(78vh, 640px);
  padding: 16px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  overflow: auto;
  transition: max-height 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.assistant-drawer.collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateX(18px);
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
  pointer-events: none;
}

.assistant-panel textarea {
  margin: 12px 0;
}

.pending-panel .task-queue-list {
  overflow: auto;
  padding-right: 4px;
}

.assistant-log {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 90px;
  max-height: 180px;
  overflow: auto;
}

.task-queue-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
}

.task-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

button.task-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

button.task-item:hover {
  border-color: rgba(119, 168, 162, 0.65);
}

.task-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.task-item.running {
  border-color: var(--accent);
}

.task-item.done {
  border-color: rgba(102, 179, 132, 0.55);
}

.task-item.failed {
  border-color: rgba(221, 107, 93, 0.65);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  align-items: center;
  justify-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
  padding-right: 86px;
  position: relative;
}

.topbar p {
  margin-top: 2px;
}

.top-title-block {
  grid-column: auto;
  justify-self: start;
  min-width: 0;
  max-width: 620px;
  text-align: left;
}

.top-title-block h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.08;
}

.top-title-block #sectionSubhead {
  max-width: 56rem;
  font-size: 0.86rem;
  line-height: 1.35;
}

.top-app-name {
  display: inline-flex;
  margin: 0 8px 0 0;
  vertical-align: middle;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-account-cluster {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 320;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  width: auto;
  white-space: nowrap;
}

.profile-button {
  grid-column: auto;
  justify-self: end;
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  width: min(100%, 260px);
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(7, 8, 8, 0.84);
  color: var(--text);
  padding: 7px 10px;
  box-shadow: var(--shadow);
  text-align: left;
}

.work-panel-toggle {
  white-space: nowrap;
}

.profile-button strong {
  font-size: 0.92rem;
}

.profile-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.profile-icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 999px;
  color: var(--accent);
}

.profile-button span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-button .profile-title,
.profile-button .profile-title strong {
  color: var(--text);
}

body.studio-header-mode .topbar {
  box-sizing: border-box;
  width: min(var(--studio-header-width), calc(100vw - var(--studio-header-edge-reserve)));
  max-width: calc(100vw - var(--studio-header-edge-reserve));
  margin-right: auto;
  margin-left: auto;
  padding-left: 0;
  padding-right: 0;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
}

body.studio-header-mode .top-title-block {
  justify-self: start;
  max-width: min(100%, 48rem);
}

body.studio-header-mode .topbar > .profile-button {
  justify-self: end;
  max-width: min(260px, 100%);
}

.page-jump {
  display: none;
  gap: 5px;
  width: min(100%, 280px);
  min-width: 180px;
  justify-self: center;
}

.page-jump label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-jump select {
  width: 100%;
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid rgba(244, 241, 232, 0.18);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
}

.choice-divider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.05fr);
  gap: 16px;
}

.admin-grid > *,
.admin-grid .panel,
.admin-grid .panel-header,
.admin-grid .field-row,
.admin-grid .field-row > *,
.admin-grid .admin-callout > *,
.admin-grid .spend-report,
.admin-grid .invite-code-list {
  min-width: 0;
  max-width: 100%;
}

.admin-grid .panel {
  overflow: hidden;
}

.admin-grid .panel-header h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-grid .button-row > * {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-spend-panel .spend-report {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.admin-callout {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(224, 179, 81, 0.28);
  background: rgba(224, 179, 81, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.admin-callout strong,
.admin-callout span {
  display: block;
}

.admin-callout span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.canon-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.canon-asset-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}

.canon-asset-list.empty-state:empty,
.reference-grid.empty:empty,
.viewer-reference-stage.empty:empty {
  display: none;
}

.asset-editor-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid rgba(244, 241, 232, 0.12);
  padding-top: 12px;
}

.canon-asset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 4, 4, 0.52);
  padding: 10px;
}

.canon-asset-main {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.canon-asset-main:not(:has(img)) {
  grid-template-columns: minmax(0, 1fr);
}

.canon-asset-card strong,
.canon-asset-card span {
  display: block;
}

.canon-asset-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.canon-reference-status {
  display: block;
  margin-top: 6px;
  color: var(--warn);
  font-size: 0.76rem;
  line-height: 1.35;
}

.canon-card-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #07090d;
  margin: 0;
}

.canon-card-thumb-wrap {
  display: grid;
  gap: 5px;
  width: 84px;
  flex: 0 0 auto;
}

.canon-card-thumb-wrap a {
  display: block;
  line-height: 0;
}

.reference-variant-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.reference-variant-dot {
  min-width: 0;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(3, 4, 4, 0.9);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
}

.reference-variant-dot.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(182, 136, 75, 0.16);
}

.compact-row {
  margin: 0;
  flex-wrap: nowrap;
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin-bottom: 16px;
}

.admin-waitlist-panel > summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

.admin-waitlist-panel[open] > summary {
  margin-bottom: 12px;
}

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

.panel-collapse-toggle {
  margin-left: auto;
  white-space: nowrap;
}

.panel-collapsed > :not(.panel-header) {
  display: none !important;
}

.panel-header h3 {
  margin-bottom: 0;
}

.compact-panel-header {
  margin-top: 18px;
  margin-bottom: 8px;
}

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

.button-row.align-end {
  align-items: flex-end;
}

.shot-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.inline-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(224, 179, 81, 0.22);
  border-radius: 8px;
  background: rgba(10, 11, 10, 0.34);
}

.inline-editor.hidden {
  display: none;
}

.inline-editor h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.shot-addon-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.shot-addon-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 8, 7, 0.42);
}

.shot-addon-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
}

.shot-addon-card pre {
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
}

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

.quick-create-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.quick-create-tab {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.quick-create-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #11130f;
}

.standalone-reference-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  margin: 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.standalone-reference-strip.empty {
  display: block;
  color: var(--soft);
  font-size: 0.88rem;
}

.extend-source-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.extend-source-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.extend-source-summary strong {
  font-size: 0.92rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.standalone-reference-chip {
  flex: 0 0 112px;
  display: grid;
  grid-template-rows: 76px auto auto;
  gap: 6px;
  align-items: start;
  min-width: 112px;
  padding: 6px;
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  cursor: pointer;
}

.standalone-reference-chip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(224, 179, 81, 0.18);
}

.standalone-reference-thumb {
  width: 100%;
  height: 76px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
}

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

.standalone-reference-token {
  justify-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(119, 168, 162, 0.18);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.standalone-reference-chip.selected .standalone-reference-token {
  background: var(--accent);
  color: #11130f;
}

.standalone-reference-name {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-create-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.provider-key-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(7, 8, 8, 0.72);
  color: var(--muted);
  padding: 9px 11px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.provider-key-status::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.035);
}

.provider-key-status[data-key-state="server"],
.provider-key-status[data-key-state="own"],
.provider-key-status[data-key-state="browser"] {
  border-color: rgba(102, 179, 132, 0.32);
  color: var(--text);
}

.provider-key-status[data-key-state="server"]::before,
.provider-key-status[data-key-state="own"]::before,
.provider-key-status[data-key-state="browser"]::before {
  background: #66b384;
  box-shadow: 0 0 0 4px rgba(102, 179, 132, 0.12);
}

.provider-key-status[data-key-state="checking"] {
  border-color: rgba(119, 168, 162, 0.28);
}

.provider-key-status[data-key-state="checking"]::before {
  background: #77a8a2;
  box-shadow: 0 0 0 4px rgba(119, 168, 162, 0.12);
}

.provider-key-status[data-key-state="missing"] {
  border-color: rgba(221, 107, 93, 0.38);
  color: #f4b1a8;
}

.provider-key-status[data-key-state="missing"]::before {
  background: #dd6b5d;
  box-shadow: 0 0 0 4px rgba(221, 107, 93, 0.12);
}

.extend-generator-row {
  align-items: end;
}

.extend-provider-panel {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.extend-provider-panel.hidden {
  display: none;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

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

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(119, 168, 162, 0.15);
}

.icon-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.library-icon-upload-row {
  margin-top: -2px;
}

.icon-upload-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 18%, rgba(224, 179, 81, 0.22), transparent 42%),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.icon-upload-btn:hover,
.icon-upload-btn:focus-visible {
  border-color: rgba(224, 179, 81, 0.52);
  background:
    radial-gradient(circle at 30% 18%, rgba(224, 179, 81, 0.32), transparent 42%),
    rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.icon-upload-btn .app-icon {
  color: #ffe2a0;
}

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

.field-row {
  margin-bottom: 14px;
}

.field-row.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 0 12px;
  margin-bottom: 14px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.toggle-row span {
  color: var(--text);
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  color: var(--text);
  line-height: 1.35;
}

.inline-toggle input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.fine-print {
  font-size: 0.86rem;
  line-height: 1.45;
}

.image-preview {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  width: min(100%, var(--preview-width, 620px));
  height: auto;
  min-height: unset;
  min-width: 240px;
  max-width: 100%;
  margin: 0 0 10px;
  display: block;
  color: var(--muted);
  overflow: auto;
  resize: both;
  text-align: center;
}

.image-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #090a08;
}

.image-preview a {
  display: block;
  width: 100%;
  height: auto;
}

.reference-grid {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding: 8px;
  color: var(--muted);
}

.image-preview figure,
.reference-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 7px;
  background: #090a08;
}

.image-preview figure img,
.reference-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.image-preview figcaption,
.reference-grid figcaption {
  padding: 5px 6px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-grid figcaption span {
  display: block;
  margin-top: 2px;
  color: var(--text);
  line-height: 1.25;
}

.reference-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0 5px;
}

.reference-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reference-status-badge.ready {
  border-color: rgba(102, 179, 132, 0.54);
  color: #c9ead9;
  background: rgba(102, 179, 132, 0.12);
}

.reference-status-badge.pending {
  border-color: rgba(224, 179, 81, 0.58);
  color: #ffe0a0;
  background: rgba(224, 179, 81, 0.12);
}

.reference-status-badge.saved {
  border-color: rgba(119, 168, 162, 0.45);
  color: #c6e2df;
  background: rgba(119, 168, 162, 0.1);
}

.reference-meta-label {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.reference-meta-label input,
.reference-meta-label select {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.reference-grid figure {
  position: relative;
}

.reference-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(244, 241, 232, 0.35);
  background: rgba(8, 8, 7, 0.82);
  color: var(--text);
  cursor: pointer;
}

.prompt-counter {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.prompt-counter.warning {
  color: #f0d8a4;
}

.prompt-counter.over {
  color: #ff9b8f;
  font-weight: 700;
}

.generation-error-card {
  border: 1px solid rgba(255, 128, 114, 0.45);
  background: rgba(84, 25, 21, 0.18);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.full-plan-panel {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 10, 8, 0.74);
  padding: 10px;
}

.compact-header {
  align-items: baseline;
  gap: 10px;
}

.full-plan-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.full-plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px;
}

.full-plan-item.selected {
  border-color: rgba(218, 179, 95, 0.65);
  background: rgba(218, 179, 95, 0.08);
}

.full-plan-item p {
  margin: 4px 0;
}

.full-plan-item ol {
  margin: 6px 0 0 18px;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.image-preview.empty {
  display: grid;
  place-items: center;
  padding: 16px;
  border-style: dashed;
  min-height: 180px;
  resize: horizontal;
}

.video-preview {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  width: min(100%, var(--preview-width, 620px));
  aspect-ratio: var(--output-aspect-ratio, 9 / 16);
  min-height: 0;
  min-width: 240px;
  max-width: 100%;
  margin: 0 0 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
  resize: horizontal;
  text-align: center;
}

.video-preview video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #000;
}

.video-preview.empty {
  padding: 16px;
  border-style: dashed;
}

.generation-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  min-height: 240px;
  padding: 24px;
  overflow: hidden;
  color: var(--text);
  text-align: center;
  background:
    linear-gradient(115deg, rgba(119, 168, 162, 0.08), rgba(224, 179, 81, 0.08)),
    #0b0d0a;
}

.video-preview .generation-placeholder {
  height: 100%;
  min-height: 100%;
}

.generation-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(119, 168, 162, 0.12) 35%,
    rgba(224, 179, 81, 0.2) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: translateX(-100%);
  animation: generationShimmer 1.45s linear infinite;
}

.generation-placeholder strong,
.generation-placeholder span {
  position: relative;
  z-index: 1;
}

.generation-placeholder span {
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes generationShimmer {
  to {
    transform: translateX(100%);
  }
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
}

.start-screen {
  min-height: calc(100vh - 52px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.start-account-bar {
  width: min(920px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  background: rgba(7, 8, 8, 0.84);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.start-account-bar span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.start-account-bar strong {
  color: var(--text);
}

.start-hero {
  width: min(920px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.start-hero h2 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.95;
  margin-inline: auto;
}

.start-hero textarea {
  width: 100%;
  min-height: 220px;
  font-size: 1.05rem;
  line-height: 1.55;
  background: rgba(7, 8, 8, 0.95);
  border-color: rgba(244, 241, 232, 0.18);
  box-shadow: var(--shadow);
  text-align: left;
}

.start-hero .field-row {
  width: 100%;
  max-width: 760px;
  text-align: left;
}

.start-hero .button-row {
  justify-content: center;
}

.start-source-card {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  background: rgba(7, 8, 8, 0.82);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.start-source-card strong,
.start-source-card span {
  display: block;
}

.start-source-card strong {
  color: var(--text);
  margin-bottom: 3px;
}

.start-source-card span {
  color: var(--muted);
  line-height: 1.35;
}

.start-source-card[data-source-state="available"] {
  border-color: rgba(224, 179, 81, 0.42);
  background: rgba(224, 179, 81, 0.09);
}

.start-source-card[data-source-state="linked"] {
  border-color: rgba(102, 179, 132, 0.5);
  background: rgba(102, 179, 132, 0.1);
}

.start-source-card[data-source-state="linked"] strong {
  color: #c9ead9;
}

.start-hero #startStatus {
  max-width: 760px;
  text-align: center;
}

.boards-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
}

.board-list-panel {
  min-height: 620px;
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.board-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}

.board-media-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.media-work-panel,
.option-panel {
  border: 1px solid var(--line);
  background: rgba(32, 35, 31, 0.54);
  border-radius: 8px;
  padding: 14px;
}

.media-work-panel.panel-collapsed,
.option-panel.panel-collapsed {
  min-height: 0;
}

.media-work-panel > .panel-header,
.option-panel > .panel-header {
  margin-bottom: 0;
}

.media-work-panel:not(.panel-collapsed) > .panel-header,
.option-panel:not(.panel-collapsed) > .panel-header {
  margin-bottom: 14px;
}

.media-work-panel .image-preview,
.media-work-panel .video-preview {
  width: 100%;
  margin-bottom: 10px;
}

.board-options-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.batch-controls {
  border: 1px solid var(--line);
  background: rgba(32, 35, 31, 0.62);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 0;
}

.batch-controls-panel .batch-controls {
  background: rgba(3, 4, 4, 0.36);
}

.batch-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.batch-controls progress {
  width: 100%;
  height: 12px;
  margin-top: 12px;
  accent-color: var(--accent);
}

.batch-choice-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 14px;
}

.batch-choice-note > div {
  border: 1px solid rgba(244, 241, 232, 0.12);
  background: rgba(3, 4, 4, 0.42);
  border-radius: 8px;
  padding: 10px 12px;
}

.batch-choice-note strong,
.batch-choice-note span {
  display: block;
}

.batch-choice-note strong {
  color: var(--text);
  margin-bottom: 4px;
}

.batch-choice-note span,
.batch-mode-help {
  color: var(--muted);
}

.batch-mode-help {
  margin: -6px 0 12px;
}

.pipeline-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.pipeline-panel progress {
  width: 100%;
  height: 14px;
  accent-color: var(--accent);
}

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

.pipeline-step {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 8px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.pipeline-step.done {
  border-color: rgba(102, 179, 132, 0.55);
  color: #c9ead9;
  background: rgba(102, 179, 132, 0.1);
}

.pipeline-step.active {
  border-color: rgba(224, 179, 81, 0.7);
  color: var(--text);
  background: rgba(224, 179, 81, 0.15);
}

.pipeline-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.pipeline-flow-grid.empty {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

.pipeline-flow-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pipeline-flow-box.locked,
.pipeline-node-card.locked {
  border-color: rgba(135, 165, 210, 0.34);
  background: rgba(26, 32, 42, 0.94);
}

.pipeline-flow-box-header {
  margin-bottom: 0;
}

.pipeline-flow-box textarea {
  min-height: 108px;
  resize: vertical;
}

.compact-select {
  width: auto;
  min-width: min(260px, 100%);
}

.pipeline-security-note {
  border: 1px solid rgba(102, 179, 132, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(102, 179, 132, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
}

.story-writer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.story-release-panel {
  border-color: rgba(255, 210, 87, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 210, 87, 0.08), transparent 32%),
    rgba(255, 255, 255, 0.025);
}

.story-release-summary,
.story-release-progress-notice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.story-release-summary div {
  display: grid;
  gap: 4px;
}

.story-release-summary span,
.story-release-progress-notice {
  color: var(--muted);
  font-size: 0.82rem;
}

.story-release-summary strong {
  color: var(--text);
}

.story-release-summary.released,
.story-release-progress-notice.released {
  border-color: rgba(102, 179, 132, 0.28);
  background: rgba(102, 179, 132, 0.08);
}

.story-writer-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.story-writer-metrics span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(244, 241, 232, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.story-writer-metrics strong {
  color: var(--text);
  font-size: 1.12rem;
}

.story-writer-database,
.story-writer-list,
.story-writer-output {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.story-writer-database-card,
.story-writer-output article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.story-writer-database-card h4,
.story-writer-database-card p,
.story-writer-database-card ul {
  margin-top: 0;
}

.story-writer-database-card ul {
  margin-bottom: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.42;
}

.story-writer-entity-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0 8px 6px 0;
  vertical-align: top;
}

.story-writer-chapter-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.story-writer-chapter-card.active {
  border-color: rgba(224, 179, 81, 0.7);
  background: rgba(224, 179, 81, 0.12);
}

.story-writer-chapter-card span,
.story-writer-output span {
  color: var(--muted);
  line-height: 1.4;
}

.story-writer-chapter-card small {
  color: var(--soft);
  line-height: 1.35;
}

.story-writer-output article {
  display: grid;
  gap: 4px;
}

.story-writer-decision-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.story-writer-decision-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.story-writer-decision-heading,
.story-writer-decision-options,
.story-writer-decision-columns {
  display: grid;
  gap: 8px;
}

.story-writer-decision-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.story-writer-decision-heading span,
.story-writer-decision-columns small {
  color: var(--soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.story-writer-decision-columns {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.story-writer-decision-columns section {
  border: 1px solid rgba(244, 241, 232, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
  display: grid;
  gap: 5px;
}

.story-writer-decision-columns p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.pipeline-route-options {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.pipeline-route-dropdown {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.pipeline-route-dropdown summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  color: #d8dde6;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-route-dropdown summary::-webkit-details-marker {
  display: none;
}

.pipeline-route-dropdown summary::after {
  content: "v";
  float: right;
  color: var(--accent);
  margin-left: 8px;
}

.pipeline-route-dropdown[open] summary::after {
  content: "^";
}

.pipeline-route-dropdown .pipeline-route-options {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pipeline-route-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.pipeline-route-option input {
  width: auto;
}

.pipeline-node-identity,
.pipeline-node-lock {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(135, 165, 210, 0.28);
  border-radius: 7px;
  padding: 6px 8px;
  color: #c8d8ef;
  background: rgba(135, 165, 210, 0.09);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
}

.pipeline-node-identity {
  justify-content: center;
  text-align: center;
  color: #eef4ff;
  background: rgba(135, 165, 210, 0.14);
}

.pipeline-variable-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.pipeline-variable-list.empty {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
}

.pipeline-variable-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.pipeline-node-canvas {
  border: 1px solid rgba(224, 179, 81, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #111111;
  background-size: 24px 24px;
  padding: 12px;
  overflow: hidden;
}

.pipeline-node-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pipeline-node-toolbar input[type="range"] {
  width: min(260px, 52vw);
}

.pipeline-node-canvas-stage {
  position: relative;
  min-height: 62vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  touch-action: none;
}

.pipeline-node-zoom-layer {
  position: relative;
  min-width: min-content;
  transform-origin: 0 0;
  transition: transform 120ms ease;
}

.pipeline-node-wires {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.pipeline-node-wire {
  fill: none;
  stroke: rgba(224, 179, 81, 0.58);
  stroke-width: 3;
}

.pipeline-node-arrow {
  fill: rgba(224, 179, 81, 0.78);
}

.pipeline-node-card {
  position: absolute;
  z-index: 1;
  width: 320px;
  min-height: 310px;
  border: 1px solid rgba(224, 179, 81, 0.34);
  border-radius: 8px;
  background: rgba(23, 23, 23, 0.96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  padding: 14px;
  display: grid;
  gap: 9px;
  cursor: grab;
  touch-action: none;
}

.pipeline-node-card.dragging {
  cursor: grabbing;
  border-color: rgba(224, 179, 81, 0.8);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(224, 179, 81, 0.22);
}

.pipeline-node-card.locked {
  cursor: default;
}

.pipeline-node-card input,
.pipeline-node-card textarea,
.pipeline-node-card select,
.pipeline-node-card button {
  cursor: auto;
}

.pipeline-node-title {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.pipeline-node-title span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(224, 179, 81, 0.38);
  color: var(--accent);
  font-weight: 700;
}

.pipeline-node-port {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(224, 179, 81, 0.14);
}

.pipeline-node-port.input-port {
  left: -6px;
}

.pipeline-node-port.output-port {
  right: -6px;
}

.pipeline-node-route {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
}

.pipeline-node-empty {
  color: var(--muted);
  padding: 20px;
}

.pipeline-debug-panel {
  border: 1px solid rgba(224, 179, 81, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.pipeline-debug-todo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.pipeline-debug-todo-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
  min-width: 0;
}

.pipeline-debug-todo-card img,
.pipeline-debug-placeholder {
  width: 58px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
}

.pipeline-debug-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.pipeline-debug-todo-card span,
.pipeline-debug-todo-card small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.pipeline-debug-todo-card strong {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.pipeline-debug-snapshots {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.pipeline-debug-snapshot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  padding: 8px 10px;
}

.pipeline-debug-snapshot summary {
  cursor: pointer;
  color: var(--text);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-debug-snapshot summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pipeline-debug-snapshot pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d9f1ff;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.debug-copy-btn {
  width: fit-content;
  min-height: 28px;
  margin-top: 6px;
  white-space: nowrap;
}

.debug-copy-btn {
  margin-top: 0;
  flex: 0 0 auto;
}

.debug-copy-btn.copy-success,
#copyPipelineDebugPanel.copy-success,
#copyIdeaHandoffDebug.copy-success {
  border-color: rgba(92, 214, 159, 0.7);
  color: #9ff0c9;
}

.board-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.board-row.active {
  outline: 1px solid rgba(224, 179, 81, 0.25);
  outline-offset: 2px;
  border-radius: 8px;
}

.board-select {
  width: 20px;
  height: 20px;
  align-self: start;
  margin: 14px 0 0;
}

.board-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 12px;
}

.board-item.active {
  border-color: var(--accent);
  background: rgba(224, 179, 81, 0.13);
}

.board-item strong {
  display: block;
  font-size: 0.94rem;
  margin-bottom: 5px;
}

.board-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.board-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.asset-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.asset-badge.ready {
  color: #c9ead9;
  border-color: rgba(102, 179, 132, 0.55);
  background: rgba(102, 179, 132, 0.12);
}

.asset-badge.pending {
  color: #f0d8a4;
  border-color: rgba(224, 179, 81, 0.55);
  background: rgba(224, 179, 81, 0.12);
}

.cost-report {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: stretch;
}

.official-total {
  border: 1px solid rgba(224, 179, 81, 0.55);
  background: rgba(224, 179, 81, 0.13);
  color: var(--text);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 12px;
}

.cost-line.important {
  border-color: rgba(224, 179, 81, 0.55);
  background: rgba(224, 179, 81, 0.12);
}

.cost-line.own-key-discounted {
  border-color: rgba(224, 179, 81, 0.35);
  background: rgba(224, 179, 81, 0.075);
}

.cost-line.own-key-savings-line {
  border-color: rgba(105, 204, 167, 0.3);
  background: rgba(105, 204, 167, 0.08);
}

.cost-section-title {
  margin-top: 8px;
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.board-context-banner {
  margin: -10px 24px 18px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-spend-panel {
  grid-column: 1 / -1;
}

.spend-report {
  display: grid;
  gap: 12px;
}

.aws-cost-import-row {
  align-items: end;
}

.aws-cost-import-actions {
  display: grid;
  gap: 6px;
  align-content: end;
}

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

.spend-total > div,
.spend-row {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 12px;
}

.spend-total span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 5px;
}

.spend-total strong {
  color: var(--text);
  font-size: 1rem;
}

.spend-total small,
.spend-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.spend-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.spend-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.9fr 1fr 0.8fr 1.2fr;
  gap: 10px;
  align-items: center;
  min-width: 880px;
  font-size: 0.82rem;
}

.spend-row.project-profit-row {
  grid-template-columns: 1fr 1.4fr 1fr 0.9fr 0.8fr 1.2fr 0.8fr;
  min-width: 1040px;
}

.spend-row.credit-ledger-row {
  grid-template-columns: 1.1fr 0.95fr 1.35fr 1.35fr 0.7fr 0.7fr 0.7fr 1.2fr;
  min-width: 1280px;
}

.spend-row.generation-report-row {
  grid-template-columns: 1.35fr 1.35fr 0.9fr 1.25fr 1fr 1.35fr 0.8fr 0.7fr 0.75fr 0.75fr 0.75fr;
  min-width: 1560px;
}

.spend-row.aws-report-row {
  grid-template-columns: 1fr 1.5fr 0.55fr 0.75fr 0.75fr 0.75fr 0.8fr 0.75fr;
  min-width: 1120px;
}

.spend-row.aws-service-cost-row {
  grid-template-columns: 1.4fr 0.7fr 2fr;
  min-width: 760px;
}

.spend-row.daily-cost-row {
  grid-template-columns: 0.8fr 0.9fr 0.8fr 0.55fr 1.25fr 0.75fr 0.75fr 0.75fr 0.7fr;
  min-width: 1180px;
}

.spend-row.ops-alert-row {
  grid-template-columns: 1.05fr 0.65fr 2.4fr 1.4fr;
  min-width: 960px;
  align-items: start;
}

.spend-row.ops-alert-row.critical,
.spend-row.ops-alert-row.error {
  border-color: rgba(255, 96, 96, 0.38);
  background: linear-gradient(135deg, rgba(255, 96, 96, 0.12), rgba(255, 255, 255, 0.03));
}

.spend-row.ops-alert-row.warning {
  border-color: rgba(255, 214, 90, 0.3);
  background: linear-gradient(135deg, rgba(255, 214, 90, 0.1), rgba(255, 255, 255, 0.03));
}

.spend-row.ops-alert-row.info {
  border-color: rgba(115, 201, 255, 0.28);
}

.spend-row.backend-project-cost-row {
  grid-template-columns: 1.45fr 1.3fr 1.15fr 1.55fr 0.8fr 1.2fr;
  min-width: 1320px;
}

.spend-row.debug-row {
  grid-template-columns: 1fr 1fr 1fr 2.4fr;
  min-width: 1040px;
  align-items: start;
}

.debug-row pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 0.76rem;
}

.ledger-credit {
  color: #c9ead9;
}

.ledger-debit {
  color: #f0b4a4;
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.settings-summary > div {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.settings-summary span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-summary strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.personal-settings-card {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
}

.settings-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.settings-tab-button {
  border: 1px solid var(--line);
  background: rgba(25, 27, 24, 0.86);
  color: var(--muted);
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
}

.settings-tab-button.active {
  border-color: rgba(224, 179, 81, 0.7);
  background: rgba(224, 179, 81, 0.12);
  color: var(--text);
}

.settings-community-link {
  margin: 0 0 14px;
}

.settings-community-link button {
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
}

.settings-community-link p:empty {
  display: none;
}

.settings-tab-panel {
  display: none;
  border: 1px solid var(--line);
  background: rgba(3, 4, 4, 0.46);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.settings-tab-panel.active {
  display: grid;
  gap: 12px;
}

.settings-provider-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.settings-provider-key-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  padding: 10px;
}

.settings-provider-key-card label {
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
}

.settings-own-key-cost-note {
  border-left: 2px solid rgba(224, 179, 81, 0.62);
  padding-left: 10px;
}

.settings-provider-lookup-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.settings-recurring-breakdown {
  margin-top: 2px;
}

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

.settings-membership-policy > div {
  border: 1px solid var(--line);
  background: rgba(10, 11, 10, 0.72);
  border-radius: 7px;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.settings-membership-policy span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-membership-policy strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.settings-payment-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px;
}

.settings-payment-box span {
  color: var(--muted);
}

.settings-payment-box strong {
  color: var(--accent);
  text-align: right;
}

.settings-payment-history-box {
  border: 1px solid var(--line);
  background: rgba(10, 11, 10, 0.72);
  border-radius: 7px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.settings-payment-history-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.settings-payment-history-header span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-payment-history-header strong {
  color: var(--text);
}

.settings-payment-history {
  overflow-x: auto;
}

.settings-payment-history-table {
  display: grid;
  gap: 6px;
}

.settings-payment-history-row {
  display: grid;
  grid-template-columns: 1.05fr 1.45fr 0.75fr 0.75fr 0.8fr;
  min-width: 820px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 0.8rem;
}

.settings-payment-history-head {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.settings-payment-history-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}

.payment-method-details { display: block; overflow-wrap: anywhere; }
.payment-method-details a, .payment-details-retry { display: inline-block; margin-top: 5px; }

.settings-payment-history-empty {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px;
}

.settings-support-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(10, 11, 10, 0.72);
  border-radius: 7px;
  padding: 10px;
}

.settings-support-box textarea {
  resize: vertical;
  min-height: 92px;
}

.invite-code-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.invite-code-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 12px;
}

.invite-code-card.used {
  opacity: 0.66;
}

.invite-code-card strong,
.invite-code-card span {
  display: block;
}

.invite-code-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.spend-head {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 7, 0.72);
  backdrop-filter: blur(8px);
}

#creditConfirmModal {
  z-index: 260;
}

.modal-card {
  width: min(520px, 100%);
  border: 1px solid rgba(224, 179, 81, 0.45);
  background: #111312;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 22px;
}

.readiness-modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-title-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

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

.modal-card p {
  margin: 0 0 14px;
  color: var(--text);
}

.modal-details {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.payment-receipt-modal {
  z-index: 320;
}

.payment-receipt-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  border-color: rgba(84, 218, 142, 0.44);
  background: #0b0f0d;
}

.payment-receipt-warning .payment-receipt-card {
  border-color: rgba(224, 179, 81, 0.55);
}

.payment-receipt-pending .payment-receipt-card,
.payment-receipt-info .payment-receipt-card {
  border-color: rgba(103, 174, 255, 0.42);
}

.payment-receipt-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(84, 218, 142, 0.58);
  color: #8ff0b1;
  background: rgba(84, 218, 142, 0.12);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.payment-receipt-warning .payment-receipt-mark {
  border-color: rgba(224, 179, 81, 0.62);
  color: #f1c864;
  background: rgba(224, 179, 81, 0.12);
}

.payment-receipt-pending .payment-receipt-mark,
.payment-receipt-info .payment-receipt-mark {
  border-color: rgba(103, 174, 255, 0.58);
  color: #9fc7ff;
  background: rgba(103, 174, 255, 0.11);
}

.payment-receipt-card h3,
.payment-receipt-card p {
  margin: 0;
}

.payment-receipt-details {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.payment-receipt-details div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.payment-receipt-details strong {
  color: var(--text);
  text-align: right;
}

.payment-receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.story-map-content {
  max-height: min(68vh, 760px);
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.45;
}

#storyWritingProgressModal {
  padding: 12px;
}

.story-writing-progress-card {
  width: min(1220px, 100%);
  height: min(930px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.story-writing-progress-summary {
  display: grid;
  gap: 10px;
}

.story-writing-progress-bar {
  height: 10px;
  border: 1px solid rgba(102, 179, 132, 0.45);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.story-writing-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #69d58d, #b7efc8);
  transition: width 180ms ease;
}

.story-writing-progress-stats,
.story-writing-task-grid {
  display: grid;
  gap: 8px;
}

.story-writing-progress-stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  color: var(--muted);
  font-size: 0.84rem;
}

.story-writing-progress-stats strong {
  color: #c9ead9;
}

.story-writing-task-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-writing-task-grid div {
  min-width: 0;
  border: 1px solid rgba(244, 241, 232, 0.11);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.story-writing-task-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-writing-task-grid strong {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.3;
}

.story-writing-progress-layout {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  gap: 12px;
  overflow: hidden;
}

.story-writing-progress-list {
  min-height: 0;
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.story-writing-server-manifest {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(119, 168, 162, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(119, 168, 162, 0.13), transparent 42%),
    rgba(0, 0, 0, 0.22);
}

.story-writing-server-manifest-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: start;
}

.story-writing-server-manifest-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.story-writing-server-manifest-head strong {
  color: var(--text);
  font-size: 0.92rem;
}

.story-writing-server-manifest-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.story-writing-server-run-chip,
.story-writing-manifest-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(224, 179, 81, 0.38);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.story-writing-manifest-grid {
  display: grid;
  gap: 7px;
}

.story-writing-manifest-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.026);
}

.story-writing-manifest-row.active,
.story-writing-manifest-running {
  border-color: rgba(224, 179, 81, 0.48);
  background: rgba(224, 179, 81, 0.08);
}

.story-writing-manifest-done {
  border-color: rgba(102, 179, 132, 0.36);
  background: rgba(102, 179, 132, 0.07);
}

.story-writing-manifest-failed {
  border-color: rgba(241, 111, 92, 0.52);
  background: rgba(241, 111, 92, 0.09);
}

.story-writing-manifest-canceled {
  opacity: 0.82;
}

.story-writing-manifest-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 999px;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 850;
}

.story-writing-manifest-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.story-writing-manifest-body strong,
.story-writing-manifest-body span,
.story-writing-manifest-body small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.story-writing-manifest-body strong {
  color: var(--text);
  font-size: 0.82rem;
}

.story-writing-manifest-body span,
.story-writing-manifest-body small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.story-writing-manifest-error {
  color: #ffb4a6 !important;
}

.story-writing-manifest-log {
  border-top: 1px solid rgba(244, 241, 232, 0.09);
  padding-top: 8px;
}

.story-writing-manifest-log summary {
  cursor: pointer;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 850;
}

.story-writing-manifest-log div {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.story-writing-manifest-log small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.story-writing-progress-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(244, 241, 232, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.story-writing-progress-row.finished {
  border-color: rgba(102, 179, 132, 0.46);
  background: rgba(102, 179, 132, 0.08);
}

.story-writing-progress-number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(224, 179, 81, 0.5);
  color: var(--accent);
  font-weight: 800;
}

.story-writing-progress-row.finished .story-writing-progress-number {
  border-color: rgba(102, 179, 132, 0.75);
  color: #c9ead9;
  background: rgba(102, 179, 132, 0.16);
}

.story-writing-check,
.story-writing-chip-check {
  color: #75d99a;
  font-weight: 950;
}

.story-writing-progress-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.story-writing-progress-body strong,
.story-writing-progress-body span,
.story-writing-progress-body small {
  min-width: 0;
}

.story-writing-progress-body small {
  color: var(--muted);
  line-height: 1.35;
}

.story-writing-files {
  margin-top: 8px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 7px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.story-writing-files > summary,
.story-writing-file-card > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.story-writing-file-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.story-writing-file-card {
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.story-writing-file-card pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.story-writing-status-chip {
  justify-self: end;
  border: 1px solid rgba(119, 168, 162, 0.45);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-writing-progress-row.finished .story-writing-status-chip {
  border-color: rgba(102, 179, 132, 0.6);
  color: #c9ead9;
  background: rgba(102, 179, 132, 0.12);
}

.story-writing-file-explorer {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(96px, 0.38fr) minmax(280px, 1.35fr);
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.story-writing-file-explorer-head {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
}

.story-writing-file-tree {
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
}

.story-writing-file-button {
  width: 100%;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 7px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 3px;
}

.story-writing-file-button.active {
  border-color: rgba(224, 179, 81, 0.58);
  background: rgba(224, 179, 81, 0.12);
}

.story-writing-file-button span {
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-writing-file-button strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.story-writing-file-content {
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 7px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.32);
  color: #dce8e4;
  font: 0.76rem/1.42 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.story-writing-file-content.reader-mode {
  padding: clamp(16px, 3vw, 34px);
  background: #f5f0e5;
  color: #211b16;
  font: 0.98rem/1.72 Georgia, "Times New Roman", serif;
  word-break: normal;
  overflow-wrap: break-word;
}

@media (max-width: 820px) {
  #storyWritingProgressModal {
    align-items: start;
    overflow: auto;
  }

  .story-writing-progress-card {
    width: 100%;
    height: auto;
    max-height: none;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 14px;
    overflow: visible;
  }

  .story-writing-progress-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .story-writing-progress-list {
    max-height: min(42vh, 360px);
    min-height: 0;
  }

  .story-writing-file-explorer {
    grid-template-rows: auto minmax(108px, 180px) minmax(240px, 46vh);
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .story-writing-file-content {
    max-height: min(46vh, 480px);
  }

  .story-writing-task-grid {
    grid-template-columns: 1fr;
  }

  .story-writing-task-grid div {
    padding: 8px;
  }

  .story-writing-server-manifest-head {
    display: grid;
  }
}

@media (max-width: 560px) {
  .social-rail,
  .video-editor-mini-grid {
    grid-template-columns: 1fr;
  }

  .social-phone-frame {
    min-height: 500px;
    border-radius: 16px;
    padding: 8px;
  }

  .social-feed-card {
    min-height: 450px;
    border-radius: 12px;
  }

  .story-writing-task-grid,
  .story-writing-progress-layout {
    grid-template-columns: 1fr;
  }

  .story-writing-progress-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .story-writing-status-chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .story-writing-manifest-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .story-writing-manifest-chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .story-writing-progress-card {
    gap: 10px;
  }

  .story-writing-progress-stats {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .story-writing-progress-layout {
    grid-template-rows: auto auto;
    gap: 10px;
  }

  .story-writing-progress-row {
    padding: 10px;
    gap: 9px;
  }

  .story-writing-progress-number {
    min-width: 30px;
    height: 30px;
  }

  .story-writing-file-explorer {
    padding: 8px;
  }
}

.debug-payload {
  width: 100%;
  max-height: min(48vh, 520px);
  overflow: auto;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #d9f1ff;
  font: 0.76rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.readiness-scroll {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  padding-right: 8px;
}

.readiness-section {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  padding: 14px;
}

.readiness-section h4 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.readiness-detail {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.readiness-detail summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.5;
}

.readiness-detail[open] summary {
  margin-bottom: 12px;
}

.readiness-detail p,
.readiness-section > p {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.readiness-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.readiness-section li {
  color: var(--muted);
  line-height: 1.45;
}

.readiness-section li strong {
  color: var(--text);
}

.readiness-section code {
  color: var(--gold);
}

.canon-preview {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
}

.canon-preview pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.86rem;
}

.board-editor {
  min-height: 620px;
}

.current-board-identity {
  margin: -4px 0 12px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  background: rgba(244, 241, 232, 0.05);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.password-reset-panel {
  margin-top: 12px;
  border: 1px solid rgba(224, 179, 81, 0.24);
  background: rgba(224, 179, 81, 0.08);
  border-radius: 8px;
  padding: 12px;
}

.password-reset-panel h3 {
  margin-top: 0;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.hidden {
  display: none;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.hidden,
.empty-state.hidden {
  display: none;
}

.prompt-output {
  display: grid;
  gap: 16px;
}

.purchase-slider-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.pricing-lines {
  display: grid;
  gap: 8px;
}

.pricing-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 4, 4, 0.42);
  border-radius: 7px;
  padding: 9px 10px;
}

.pricing-line span {
  color: var(--muted);
}

.pricing-line strong {
  color: var(--text);
  text-align: right;
}

.pricing-line-pay-price strong {
  color: var(--accent);
}

.media-frame {
  width: min(100%, 520px);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.media-frame-large {
  width: min(100%, 980px);
}

.media-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(3, 4, 4, 0.82);
  border-radius: 7px;
  padding: 7px 8px;
}

.media-toolbar span {
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-frame-body img,
.media-frame-body video {
  width: 100%;
  max-height: min(72vh, 920px);
  object-fit: contain;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #050604;
}

.media-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 14px;
  background: #050604;
  align-content: center;
}

.media-frame:fullscreen .media-frame-body img,
.media-frame:fullscreen .media-frame-body video {
  max-height: calc(100vh - 70px);
}

.standalone-media-history {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  margin-top: 12px;
  scrollbar-width: thin;
}

.standalone-media-history.empty {
  display: block;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 12px;
  text-align: center;
}

.quick-create-actions,
.saved-prompt-list {
  margin: 10px 0 14px;
}

.quick-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-create-primary-create {
  min-width: 180px;
}

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

.saved-prompt-list.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.saved-prompt-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.saved-prompt-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.saved-prompt-card small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.standalone-media-card {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 8px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}

.standalone-media-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(224, 179, 81, 0.25);
}

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

.standalone-media-thumb {
  width: 100%;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050604;
}

.standalone-media-thumb.placeholder {
  display: grid;
  place-items: stretch;
  padding: 0;
}

.standalone-media-thumb.placeholder .generation-placeholder {
  min-height: 100%;
  border: 0;
  border-radius: 6px;
}

.standalone-media-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.standalone-media-card-body strong,
.standalone-media-card-body span,
.standalone-media-card-body small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standalone-media-card-body strong {
  color: var(--text);
  font-size: 0.88rem;
}

.standalone-media-card-body span,
.standalone-media-card-body small {
  color: var(--muted);
  font-size: 0.76rem;
}

.standalone-media-card-body .media-expiry-note.stale,
.standalone-media-card-body .media-expiry-note.expired {
  color: var(--danger);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.library-grid.empty {
  display: block;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.library-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-2);
  min-width: 0;
}

.library-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(224, 179, 81, 0.22);
}

.library-thumb {
  width: 100%;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050604;
}

.library-book-thumb {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--accent);
  background:
    radial-gradient(circle at 30% 25%, rgba(248, 198, 92, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.24));
}

.library-book-thumb .app-icon {
  width: 34px;
  height: 34px;
}

.library-book-thumb span {
  color: var(--muted);
  font-size: 0.78rem;
}

.library-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.library-card-body strong,
.library-card-body span,
.library-card-body small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card-body strong {
  color: var(--text);
  font-size: 0.9rem;
}

.library-card-body span,
.library-card-body small,
.library-card-body p {
  color: var(--muted);
  font-size: 0.78rem;
}

.library-card-body p {
  margin: 0;
  line-height: 1.4;
  white-space: normal;
}

.story-library-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.story-library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.story-library-header h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.98rem;
}

.story-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.story-library-grid.empty {
  display: block;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.story-library-family {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
}

.story-library-family > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.story-library-family > summary::-webkit-details-marker {
  display: none;
}

.story-library-family > summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.story-library-family > summary strong {
  color: var(--text);
  font-size: 0.92rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-library-family > summary small {
  color: var(--muted);
  font-size: 0.74rem;
}

.story-library-family-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.story-library-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  min-width: 0;
  margin-left: calc(var(--story-depth, 0) * 6px);
}

.story-library-card.selected {
  border-color: rgba(248, 198, 92, 0.42);
  box-shadow: 0 0 0 1px rgba(248, 198, 92, 0.12);
}

.story-library-card.nested {
  background:
    linear-gradient(150deg, rgba(248, 198, 92, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(0, 0, 0, 0.08);
}

.story-product-card.locked {
  border-color: rgba(248, 198, 92, 0.2);
}

.story-product-card.unlocked {
  border-color: rgba(85, 226, 162, 0.28);
  background:
    linear-gradient(150deg, rgba(85, 226, 162, 0.065), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.12);
}

.story-library-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.72rem;
}

.story-library-card-top small {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.story-chip {
  border: 1px solid rgba(224, 179, 81, 0.32);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--accent);
  background: rgba(224, 179, 81, 0.08);
}

.story-library-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.story-library-card-body strong,
.story-library-card-body span,
.story-library-card-body small {
  min-width: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.story-library-card-body strong {
  color: var(--text);
  font-size: 0.95rem;
}

.story-library-card-body span,
.story-library-card-body small,
.story-library-card-body p {
  color: var(--muted);
  font-size: 0.78rem;
}

.story-library-card-body p {
  margin: 0;
  line-height: 1.45;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-product-preview {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.story-product-preview small {
  color: var(--accent);
  font-size: 0.72rem;
}

.story-product-detail {
  display: grid;
  gap: 10px;
}

.story-product-detail section {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.story-product-detail strong {
  color: var(--text);
}

.story-product-chapter-summaries {
  max-height: min(34rem, 58vh);
  overflow: auto;
}

.story-product-chapter-list {
  display: grid;
  gap: 8px;
}

.story-product-chapter-list article {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.story-product-detail .story-product-chapter-list p {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  line-height: 1.5;
}

.story-product-chapter-list small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.story-admin-source-chapters {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(248, 198, 92, 0.2);
  border-radius: 8px;
  background: rgba(248, 198, 92, 0.045);
}

.story-admin-source-chapter-list {
  display: grid;
  gap: 8px;
}

.story-admin-source-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.story-admin-source-chapter {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.story-admin-source-chapter.is-resolution-extension {
  border-color: rgba(248, 198, 92, 0.26);
  background: rgba(248, 198, 92, 0.07);
}

.story-admin-source-chapter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.story-admin-source-chapter summary::-webkit-details-marker {
  display: none;
}

.story-admin-source-chapter summary span {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.story-admin-source-chapter summary em {
  display: inline-flex;
  margin-left: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.story-admin-source-chapter summary small {
  flex: 0 0 auto;
  color: var(--accent);
}

.story-admin-source-chapter pre {
  max-height: min(34rem, 58vh);
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 237, 246, 0.86);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.story-admin-debug-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(79, 214, 255, 0.18);
  border-radius: 8px;
  background: rgba(79, 214, 255, 0.045);
}

.story-admin-debug-browser {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 2fr);
  gap: 10px;
  min-width: 0;
}

.story-admin-debug-list {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: min(34rem, 58vh);
  overflow: auto;
  min-width: 0;
}

.story-admin-debug-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  text-align: left;
}

.story-admin-debug-list button.selected {
  border-color: rgba(79, 214, 255, 0.42);
  background: rgba(79, 214, 255, 0.12);
}

.story-admin-debug-list span,
.story-admin-debug-list small {
  overflow-wrap: anywhere;
}

.story-admin-debug-list small {
  color: var(--muted);
  font-size: 0.72rem;
}

.story-admin-debug-viewer {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr);
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.story-admin-debug-viewer > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.story-admin-debug-viewer strong,
.story-admin-debug-viewer small {
  overflow-wrap: anywhere;
}

.story-admin-debug-viewer pre {
  max-height: min(38rem, 64vh);
  overflow: auto;
  margin: 0;
  padding: 10px;
  color: rgba(232, 237, 246, 0.9);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.story-product-reader pre {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 0;
}

.story-completion-audit {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(248, 198, 92, 0.24);
  border-radius: 8px;
  background: rgba(248, 198, 92, 0.07);
  color: var(--muted);
}

.story-completion-audit strong {
  color: var(--accent);
  font-size: 0.78rem;
}

.story-origin-audit {
  border-color: rgba(79, 214, 255, 0.24);
  background: rgba(79, 214, 255, 0.07);
}

.story-origin-audit strong {
  color: #7bdcff;
}

.story-completion-audit span,
.story-completion-audit small,
.story-completion-audit li {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.story-completion-audit ul {
  margin: 0;
  padding-left: 16px;
}

.story-library-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.story-library-detail.empty {
  color: var(--muted);
  text-align: center;
}

.story-library-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.story-library-detail-head > div,
.story-library-detail-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.story-library-detail-head strong,
.story-library-detail-grid strong {
  color: var(--text);
}

.story-library-detail-head span,
.story-library-detail-grid span,
.story-library-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

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

.story-video-map-panel {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.story-video-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.story-video-map-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.story-video-map-head strong {
  color: var(--text);
}

.story-video-map-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.story-video-map-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.story-video-map-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.story-video-map-bottom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.story-video-map-bottom-actions .primary-btn {
  min-width: min(100%, 13rem);
}

.story-lens-answer {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.story-lens-answer.warning {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.08);
}

.story-lens-answer strong {
  color: var(--text);
}

.story-lens-answer p,
.story-lens-answer span,
.story-lens-answer small,
.story-lens-answer li {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.story-lens-answer ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 720px) {
  .story-library-header {
    display: grid;
  }

  .story-library-grid,
  .story-library-detail-grid,
  .story-admin-debug-browser,
  .story-video-map-grid {
    grid-template-columns: 1fr;
  }

  .story-video-map-head {
    display: grid;
  }
}

.workflow-card-list {
  display: grid;
  gap: 10px;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.workflow-card {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.workflow-card:hover,
.workflow-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(224, 179, 81, 0.22);
}

.workflow-card strong {
  font-size: 0.95rem;
}

.workflow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

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

.video-editor-page {
  display: grid;
  gap: 14px;
}

.video-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.video-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.video-editor-timeline {
  display: grid;
  gap: 9px;
  max-height: min(58vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
  scrollbar-width: thin;
}

.video-editor-timeline.empty {
  display: block;
  color: var(--muted);
  border-style: dashed;
  text-align: center;
}

.video-editor-clip-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-2);
  min-width: 0;
}

.video-editor-thumb {
  width: 92px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050604;
}

.video-editor-clip-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-editor-clip-meta strong,
.video-editor-clip-meta span,
.video-editor-clip-meta small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-clip-meta span,
.video-editor-clip-meta small {
  color: var(--muted);
  font-size: 0.78rem;
}

.video-editor-clip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.video-editor-result {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.video-editor-result video {
  width: min(100%, 520px);
  max-height: 52vh;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #050604;
}

.social-page,
.tools-page-panel {
  min-height: min(78vh, 880px);
}

.social-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.social-rail,
.social-discord-card,
.video-editor-stage,
.video-editor-timeline-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 4, 4, 0.52);
}

.social-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.social-pane-summary {
  display: grid;
  gap: 5px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.08);
}

.social-pane-summary h4 {
  margin: 0;
  color: var(--accent);
  font-size: 1rem;
}

.social-pane-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.social-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
  padding: 4px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.social-view-toggle button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.social-view-toggle button.active,
.social-view-toggle button:hover {
  border-color: rgba(224, 179, 81, 0.46);
  background: rgba(224, 179, 81, 0.13);
  color: #ffe2a0;
}

.social-nav {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.social-nav.active,
.social-nav:hover {
  border-color: rgba(224, 179, 81, 0.58);
  background: rgba(224, 179, 81, 0.1);
}

.social-nav span {
  color: var(--muted);
  font-size: 0.76rem;
}

.social-feed-shell {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.social-feed-shell.social-grid-shell {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
}

.social-feed-side {
  align-self: start;
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: visible;
}

.social-phone-frame {
  min-height: 620px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 22px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    #050604;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.social-feed-list {
  height: 100%;
  max-height: 620px;
  display: grid;
  gap: 12px;
  overflow: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
}

.social-phone-frame.social-grid-frame {
  min-height: 0;
  border-radius: 14px;
  overflow: visible;
}

.social-feed-list.social-grid-list {
  height: auto;
  max-height: none;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: stretch;
  overflow: visible;
  scroll-snap-type: none;
}

.social-feed-card {
  min-height: 520px;
  position: relative;
  display: grid;
  align-content: end;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 16px;
  padding: 14px;
  scroll-snap-align: start;
  background:
    radial-gradient(circle at 28% 20%, rgba(224, 179, 81, 0.18), transparent 34%),
    linear-gradient(145deg, #111615, #050605 58%, #15100d);
}

.social-grid-list .social-feed-card {
  min-height: 320px;
  border-radius: 12px;
  scroll-snap-align: none;
}

.social-feed-card.blue {
  background:
    radial-gradient(circle at 72% 18%, rgba(119, 168, 162, 0.22), transparent 36%),
    linear-gradient(145deg, #0f1718, #050605 58%, #0b1115);
}

.social-feed-card.green {
  background:
    radial-gradient(circle at 36% 18%, rgba(102, 179, 132, 0.2), transparent 36%),
    linear-gradient(145deg, #0f1712, #050605 58%, #11160d);
}

.social-feed-card.selected {
  border-color: rgba(224, 179, 81, 0.64);
  box-shadow: inset 0 0 0 1px rgba(224, 179, 81, 0.28);
}

.social-feed-card.editing {
  overflow: visible;
  z-index: 3;
}

.social-post-menu-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}

.social-post-menu-btn:hover,
.social-post-menu-btn.active {
  border-color: rgba(224, 179, 81, 0.7);
  background: rgba(224, 179, 81, 0.14);
  color: #ffe2a0;
}

.social-feed-preview {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 56px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.social-feed-badges {
  flex-wrap: wrap;
  align-items: flex-start;
}

.social-feed-preview span {
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.social-feed-preview .social-provenance {
  border-color: rgba(119, 168, 162, 0.42);
  color: #c6e2df;
}

.social-feed-preview .social-provenance.verified {
  border-color: rgba(224, 179, 81, 0.55);
  color: #ffe2a0;
}

.social-feed-preview .social-provenance.indirect {
  border-color: rgba(244, 241, 232, 0.22);
  color: var(--muted);
}

.social-feed-meta {
  display: grid;
  gap: 5px;
  padding-right: 52px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.72);
}

.social-feed-meta strong {
  font-size: 1.05rem;
}

.social-post-title {
  color: var(--text);
}

.social-feed-meta span {
  color: var(--soft);
  line-height: 1.35;
}

.social-post-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: rgba(244, 241, 232, 0.9);
  line-height: 1.38;
}

.social-post-description.expanded {
  display: block;
}

.social-read-more-btn {
  justify-self: start;
  width: max-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffe2a0;
  font-size: 0.78rem;
  font-weight: 850;
}

.social-feed-meta small {
  color: var(--muted);
  line-height: 1.35;
}

.social-visibility {
  border-color: rgba(244, 241, 232, 0.22);
}

.social-visibility.public {
  color: #bfe8df;
  border-color: rgba(119, 168, 162, 0.46);
}

.social-visibility.private {
  color: #ffe2a0;
  border-color: rgba(224, 179, 81, 0.5);
}

.social-remix-btn {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-color: rgba(224, 179, 81, 0.46);
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 229, 162, 0.3), transparent 24%),
    conic-gradient(from 30deg, rgba(224, 179, 81, 0.18), rgba(119, 168, 162, 0.36), rgba(224, 179, 81, 0.28), rgba(224, 179, 81, 0.18)),
    rgba(0, 0, 0, 0.42);
  color: #ffe2a0;
  box-shadow: 0 10px 26px rgba(224, 179, 81, 0.12);
}

.social-remix-btn .app-icon,
.social-icon-btn .app-icon,
.social-post-menu-btn .app-icon {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 0 10px rgba(224, 179, 81, 0.18));
}

.social-remix-btn:hover {
  border-color: rgba(224, 179, 81, 0.72);
  box-shadow: 0 12px 30px rgba(224, 179, 81, 0.2);
  transform: translateY(-1px);
}

.social-remix-btn.active {
  border-color: rgba(224, 179, 81, 0.86);
  box-shadow: 0 0 0 2px rgba(224, 179, 81, 0.18), 0 14px 34px rgba(224, 179, 81, 0.22);
}

.social-feed-actions {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: grid;
  gap: 8px;
}

.social-feed-actions button,
.social-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
}

.social-icon-btn {
  display: grid;
  place-items: center;
  padding: 0;
  font-weight: 900;
}

.social-icon-btn small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--muted);
  font-size: 0.52rem;
}

.social-icon-btn:hover,
.social-icon-btn.active {
  border-color: rgba(224, 179, 81, 0.6);
  background: rgba(224, 179, 81, 0.13);
  color: #ffe2a0;
}

.social-heart-btn.active {
  color: #ffcc7a;
}

.social-heart-btn.active .app-icon {
  fill: currentColor;
}

.social-feed-actions .social-remix-btn {
  border-color: rgba(224, 179, 81, 0.46);
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 229, 162, 0.3), transparent 24%),
    conic-gradient(from 30deg, rgba(224, 179, 81, 0.18), rgba(119, 168, 162, 0.36), rgba(224, 179, 81, 0.28), rgba(224, 179, 81, 0.18)),
    rgba(0, 0, 0, 0.42);
  color: #ffe2a0;
}

.social-discord-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background:
    radial-gradient(circle at 18% 15%, rgba(119, 168, 162, 0.18), transparent 34%),
    rgba(3, 4, 4, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.social-discord-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.social-discord-btn {
  width: 100%;
  border: 1px solid rgba(119, 168, 162, 0.34);
  border-radius: 8px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(119, 168, 162, 0.16), rgba(224, 179, 81, 0.08)),
    rgba(0, 0, 0, 0.26);
  color: var(--text);
  font-weight: 900;
  text-align: left;
}

.social-discord-btn:hover {
  border-color: rgba(119, 168, 162, 0.58);
  background:
    linear-gradient(135deg, rgba(119, 168, 162, 0.24), rgba(224, 179, 81, 0.12)),
    rgba(0, 0, 0, 0.34);
}

.social-post-edit-menu {
  position: absolute;
  top: 54px;
  right: 12px;
  z-index: 30;
  width: min(310px, calc(100% - 24px));
  display: grid;
  gap: 8px;
  border: 1px solid rgba(224, 179, 81, 0.34);
  border-radius: 10px;
  padding: 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(119, 168, 162, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(13, 13, 11, 0.98), rgba(4, 5, 5, 0.98));
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.54), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  text-shadow: none;
}

.social-post-edit-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.social-post-edit-head strong,
.social-post-edit-menu label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.social-post-edit-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.social-post-edit-menu input,
.social-post-edit-menu textarea {
  width: 100%;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  font-size: 0.82rem;
}

.social-post-edit-menu textarea {
  resize: none;
}

.social-visibility-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.social-visibility-toggle button {
  min-height: 34px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.social-visibility-toggle button.active,
.social-visibility-toggle button:hover {
  border-color: rgba(224, 179, 81, 0.56);
  background: rgba(224, 179, 81, 0.13);
  color: #ffe2a0;
}

.social-remix-panel {
  position: absolute;
  right: 52px;
  bottom: 14px;
  z-index: 25;
  width: min(278px, calc(100% - 88px));
  display: grid;
  gap: 8px;
  border: 1px solid rgba(224, 179, 81, 0.38);
  border-radius: 10px;
  padding: 9px;
  background:
    radial-gradient(circle at 100% 100%, rgba(224, 179, 81, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(14, 13, 10, 0.98), rgba(3, 4, 4, 0.98)),
    rgba(7, 8, 8, 0.98);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  animation: socialRemixSlideIn 180ms ease-out both;
}

.social-remix-panel.hidden {
  display: none;
}

.social-remix-panel::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 16px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(224, 179, 81, 0.38);
  border-right: 1px solid rgba(224, 179, 81, 0.38);
  background: rgba(5, 5, 4, 0.98);
  transform: rotate(45deg);
}

@keyframes socialRemixSlideIn {
  from {
    opacity: 0;
    transform: translate3d(12px, 4px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.social-remix-panel textarea {
  width: 100%;
  min-height: 68px;
  resize: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  font-size: 0.84rem;
}

.social-remix-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.social-remix-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
}

.video-editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "stage"
    "timeline";
  gap: 12px;
  align-items: stretch;
}

.video-editor-stage,
.video-editor-timeline-shell {
  min-width: 0;
  padding: 12px;
}

.video-editor-stage {
  grid-area: stage;
}

.video-editor-timeline-shell {
  grid-area: timeline;
}

.video-editor-panel-head,
.video-editor-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.video-editor-panel-head span,
.video-editor-timeline-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.76rem;
}

.music-origin-link {
  color: #98cec7;
  font-weight: 800;
  text-decoration: none;
}

.music-origin-link:hover {
  text-decoration: underline;
}

.music-origin-missing {
  color: #e29a75;
  font-weight: 800;
}

.music-source-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 4px;
  color: var(--soft);
  font-style: normal;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.music-source-badge.plotthirst {
  border-color: rgba(224, 179, 81, 0.55);
  color: var(--accent);
  background: rgba(224, 179, 81, 0.12);
}

.music-source-badge.upload {
  border-color: rgba(119, 168, 162, 0.45);
  color: #98cec7;
  background: rgba(119, 168, 162, 0.11);
}

.video-editor-stage {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 10px;
}

.video-editor-react-root:empty {
  display: none;
}

.video-editor-toolbar,
.video-editor-preview-controls {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.video-editor-control-dock {
  position: relative;
  z-index: 16;
  display: grid;
  gap: 8px;
}

.video-editor-add-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 48px));
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 8px;
  background: rgba(7, 8, 8, 0.98);
  box-shadow: var(--shadow);
}

.video-editor-music-publish {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(244, 241, 232, 0.1);
}

.video-editor-settings-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.video-editor-add-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
}

.video-editor-preview-stage {
  min-height: 320px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    #050604;
  background-size: 22px 22px;
}

.video-editor-preview-stage.empty {
  color: var(--muted);
  text-align: center;
}

.video-editor-preview-stage video,
.video-editor-preview-stage img,
.video-editor-preview-stage audio {
  width: 100%;
  height: 100%;
  max-height: 58vh;
  object-fit: contain;
  background: #000;
}

.video-editor-preview-stage audio {
  height: 44px;
  width: min(92%, 720px);
  background: transparent;
}

.video-editor-next-preload {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-9999px, -9999px);
}

.video-editor-preview-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
}

.video-editor-preview-label span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
}

.video-editor-preview-controls input[type="range"] {
  flex: 1 1 180px;
}

.video-editor-preview-controls span {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.video-editor-preview-controls .active {
  border-color: rgba(224, 179, 81, 0.46);
  color: var(--text);
  background: rgba(224, 179, 81, 0.16);
}

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

.video-editor-volume-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.video-editor-volume-label strong {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 1000;
}

.video-editor-volume-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 8px;
}

.video-editor-volume-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.video-editor-volume-control input[type="number"] {
  min-width: 0;
  text-align: center;
}

.video-editor-export-settings {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  border-top: 1px solid rgba(244, 241, 232, 0.1);
  padding-top: 10px;
}

.video-editor-timeline-shell {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.video-editor-ruler {
  position: relative;
  height: 24px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.12);
  color: var(--muted);
  font-size: 0.68rem;
}

.video-editor-ruler span {
  position: absolute;
  top: 2px;
  transform: translateX(-1px);
}

.video-editor-ruler span::before {
  content: "";
  display: block;
  width: 1px;
  height: 8px;
  margin-bottom: 2px;
  background: rgba(244, 241, 232, 0.25);
}

.video-editor-timeline {
  max-height: 380px;
  min-height: 250px;
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 0 0 4px;
  border: 0;
  background: transparent;
}

.video-editor-timeline.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.video-editor-track-row {
  display: grid;
  grid-template-columns: 78px minmax(420px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.video-editor-track-row.single {
  min-width: max-content;
}

.video-editor-track-label {
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.video-editor-track-lane {
  min-height: 96px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px),
    rgba(0, 0, 0, 0.22);
}

.video-editor-track-lane.audio-lane {
  min-height: 52px;
  background:
    repeating-linear-gradient(90deg, rgba(119, 168, 162, 0.055) 0 2px, transparent 2px 32px),
    rgba(0, 0, 0, 0.24);
}

.video-editor-timeline-clip {
  position: absolute;
  top: 7px;
  bottom: 7px;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-content: stretch;
  gap: 4px;
  overflow: hidden;
  border: 1px solid rgba(224, 179, 81, 0.46);
  border-radius: 7px;
  padding: 6px 8px;
  background: linear-gradient(135deg, rgba(224, 179, 81, 0.22), rgba(119, 168, 162, 0.14));
  color: var(--text);
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.video-editor-timeline-clip.audio {
  grid-template-rows: auto auto;
  border-color: rgba(119, 168, 162, 0.56);
  background: linear-gradient(135deg, rgba(119, 168, 162, 0.22), rgba(90, 119, 188, 0.14));
}

.video-editor-frame-strip {
  min-height: 38px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(38px, 1fr);
  gap: 2px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.32);
}

.video-editor-frame-strip img,
.video-editor-frame-strip span {
  width: 100%;
  height: 100%;
  min-height: 38px;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(244, 241, 232, 0.12), rgba(119, 168, 162, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.video-editor-frame-strip.image-strip {
  grid-auto-columns: 1fr;
}

.video-editor-frame-strip.loading span:nth-child(2n) {
  background:
    linear-gradient(135deg, rgba(224, 179, 81, 0.15), rgba(244, 241, 232, 0.06)),
    rgba(255, 255, 255, 0.035);
}

.video-editor-playhead-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 5;
  pointer-events: none;
  background: #ff6b5a;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 107, 90, 0.35);
}

.video-editor-playhead-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -1px);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: #ff6b5a;
}

.video-editor-timeline-clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(224, 179, 81, 0.24);
}

.video-editor-timeline-clip.local {
  border-style: dashed;
}

.video-editor-timeline-clip.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.video-editor-timeline-clip.drop-before {
  box-shadow: -5px 0 0 rgba(224, 179, 81, 0.85), 0 0 0 2px rgba(224, 179, 81, 0.18);
}

.video-editor-timeline-clip.drop-after {
  box-shadow: 5px 0 0 rgba(224, 179, 81, 0.85), 0 0 0 2px rgba(224, 179, 81, 0.18);
}

.video-editor-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  z-index: 2;
  cursor: ew-resize;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(224, 179, 81, 0.3));
  opacity: 0.62;
}

.video-editor-trim-handle.start {
  left: 0;
  border-radius: 6px 0 0 6px;
}

.video-editor-trim-handle.end {
  right: 0;
  border-radius: 0 6px 6px 0;
}

.video-editor-timeline-clip:hover .video-editor-trim-handle,
.video-editor-timeline.trimming .video-editor-trim-handle {
  opacity: 1;
}

.video-editor-timeline-clip strong,
.video-editor-timeline-clip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-timeline-clip span,
.video-editor-track-empty {
  color: var(--muted);
  font-size: 0.72rem;
}

.video-editor-track-empty {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.prompt-card {
  border: 1px solid var(--line);
  background: #11130f;
  border-radius: 8px;
  overflow: hidden;
}

.prompt-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.prompt-card header span {
  color: var(--muted);
}

.prompt-preview-textarea {
  min-height: 220px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
}

.board-shot-prompts {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.board-shot-prompt {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #11130f;
}

.board-shot-prompt header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

.board-shot-prompt header span {
  color: var(--muted);
  white-space: nowrap;
}

.board-shot-prompt pre {
  max-height: 260px;
  font-size: 0.82rem;
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #eee7d8;
  white-space: pre-wrap;
  line-height: 1.48;
}

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(360px, 1fr);
  gap: 16px;
}

.viewer-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}

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

.viewer-hero h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.viewer-reference-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.viewer-reference-stage.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
}

.storyboard-progress-strip {
  flex: 1 1 100%;
  min-width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(244, 241, 232, 0.12);
}

.progress-strip-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.storyboard-progress-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 128px);
  gap: 8px;
  max-height: 154px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.storyboard-progress-thumb {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(244, 241, 232, 0.035);
  color: var(--text);
  padding: 6px;
  text-align: left;
}

.storyboard-progress-thumb.active {
  border-color: rgba(224, 179, 81, 0.7);
  box-shadow: 0 0 0 1px rgba(224, 179, 81, 0.2);
}

.storyboard-progress-thumb img,
.storyboard-progress-placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 72px;
  border-radius: 5px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.32);
}

.storyboard-progress-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
}

.storyboard-progress-thumb strong,
.storyboard-progress-thumb small,
.storyboard-progress-thumb em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.storyboard-progress-thumb progress,
.timeline-item progress {
  width: 100%;
  height: 6px;
}

.reference-stage-card {
  display: grid;
  grid-template-columns: 52px minmax(120px, 1fr);
  gap: 9px;
  align-items: center;
  width: min(260px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 12, 10, 0.45);
  padding: 7px;
}

.reference-stage-card img,
.reference-stage-placeholder {
  width: 52px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(244, 241, 232, 0.16);
  background: var(--surface-2);
}

.reference-stage-placeholder {
  display: block;
}

.reference-stage-placeholder::after,
.pipeline-debug-placeholder::after {
  content: "";
  display: block;
  width: 34%;
  height: 34%;
  margin: 33%;
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.18);
}

.reference-stage-card span,
.reference-stage-card small {
  display: block;
  color: var(--muted);
}

.reference-stage-card strong {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
}

.timeline-list {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 4px;
}

.timeline-item {
  min-width: 180px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px;
  text-align: left;
}

.timeline-item.active {
  border-color: var(--accent);
  background: rgba(224, 179, 81, 0.13);
}

.timeline-item.ready {
  border-color: rgba(102, 179, 132, 0.55);
}

.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.timeline-item small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 4px;
}

.viewer-stitched-actions {
  margin-top: 8px;
}

.media-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}

.media-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px 12px;
  text-align: left;
}

.media-item.active {
  border-color: var(--accent);
  background: rgba(224, 179, 81, 0.13);
}

.media-item strong {
  display: block;
  margin-bottom: 4px;
}

.media-item progress {
  width: 100%;
  height: 6px;
  margin-top: 6px;
}

.media-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.media-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.clip-include {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  white-space: nowrap;
}

.clip-include input {
  width: auto;
}

.clip-open-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  min-width: 0;
  cursor: pointer;
}

.viewer-stitch-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.compact-header {
  margin-bottom: 8px;
}

.compact-header h4 {
  margin: 0;
  font-size: 0.98rem;
}

.viewer-trim-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 12px;
  padding-right: 4px;
}

.viewer-trim-list.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 10px;
}

.viewer-trim-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 120px) minmax(96px, 120px);
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 7px;
  padding: 9px;
}

.viewer-trim-row strong {
  min-width: 0;
  font-size: 0.84rem;
}

.viewer-trim-row label {
  margin: 0;
}

.viewer-trim-row label span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.clip-open-button strong,
.clip-open-button span {
  display: block;
}

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

.metric {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 1.35rem;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pending-panel,
  .assistant-drawer {
    max-height: 360px;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .boards-layout,
  .board-media-grid,
  .canon-grid,
  .spend-total {
    grid-template-columns: 1fr;
  }

  .board-list-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .workspace,
  .sidebar {
    padding: 12px;
  }

  body.studio-header-mode .workspace {
    padding: 8px;
    padding-top: 58px;
  }

  body.studio-header-mode .topbar {
    min-height: 0;
    margin-bottom: 0;
    padding: 0;
  }

  body.studio-header-mode .top-title-block,
  body.studio-header-mode .topbar > .profile-button,
  body.studio-header-mode .page-jump,
  body.studio-header-mode .work-panel-toggle {
    display: none !important;
  }

  body.studio-header-mode .top-account-cluster {
    position: fixed;
    top: 8px;
    right: 8px;
    width: auto;
    z-index: 340;
  }

  body.studio-header-mode .tab-panel {
    margin-top: 0;
  }

  .app-menu {
    top: 68px;
    right: 12px;
    left: auto;
    width: min(260px, calc(100vw - 24px));
    max-height: calc(100vh - 84px);
    overflow: auto;
  }

  .project-banner,
  .board-context-banner,
  .storage-warning {
    margin: 0 12px 12px;
    overflow-wrap: anywhere;
  }

  .storage-warning {
    display: grid;
    gap: 6px;
  }


  .brand {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin-bottom: 14px;
    padding-top: 56px;
    padding-right: 0;
  }

  .top-title-block {
    grid-column: 1 / -1;
    justify-self: stretch;
    padding-right: 0;
    text-align: left;
  }

  .top-title-block h2 {
    font-size: 1.28rem;
  }

  .topbar > .profile-button {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .top-account-cluster,
  .panel-header > div,
  .button-row {
    width: 100%;
  }

  .batch-choice-note {
    grid-template-columns: 1fr;
  }

  .top-account-cluster {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .video-editor-grid,
  .video-editor-workspace,
  .social-layout,
  .social-feed-shell,
  .video-editor-clip-row {
    grid-template-columns: 1fr;
  }

  .video-editor-workspace {
    grid-template-areas:
      "stage"
      "timeline";
  }

  .video-editor-actions,
  .video-editor-clip-actions {
    justify-content: flex-start;
  }

  .video-editor-thumb {
    width: min(100%, 260px);
  }

  .social-phone-frame {
    min-height: 540px;
  }

  .social-feed-card {
    min-height: 480px;
  }

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

  .social-pane-summary {
    grid-column: 1 / -1;
  }

  .video-editor-stage {
    min-height: 420px;
  }

  .video-editor-preview-stage {
    min-height: 280px;
  }

  .video-editor-track-row {
    grid-template-columns: 58px minmax(520px, 1fr);
  }

  .video-editor-timeline {
    min-height: 270px;
  }

  .video-editor-track-lane {
    min-height: 106px;
  }

  .ultimate-recovery-row,
  .ultimate-recovery-item {
    grid-template-columns: 1fr;
  }

  .ultimate-recovery-title-row {
    grid-template-columns: 1fr;
    margin-left: calc(var(--recovery-depth, 0) * 12px);
  }

  .ultimate-recovery-story-search-row {
    margin-left: calc(var(--recovery-depth, 0) * 12px);
  }

  .ultimate-recovery-title-actions {
    justify-content: flex-start;
  }

  .ultimate-recovery-head,
  .ultimate-recovery-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body.start-mode .topbar {
    display: flex;
    justify-content: center;
    padding-right: 0;
    padding-top: 56px;
  }

  .site-loader-header {
    top: 74px;
  }

.site-loader-card {
    inset: 0;
    top: 0;
    width: 100vw;
    height: 100svh;
    min-height: 0;
    transform: none;
  }

  .site-loader-page-frame {
    border-radius: 22px;
  }

  .site-loader-morph {
    width: 88px;
    height: 88px;
    max-height: 290px;
  }

  .site-loader-hero-copy {
    inset: 28px;
  }

  .site-loader-feature-card {
    width: 118px;
    height: 88px;
  }

  .card-one {
    left: 5%;
    top: 60%;
  }

  .card-two {
    right: 5%;
    top: 62%;
  }

  .site-loader-chart-card {
    width: 132px;
    height: 104px;
    right: 6%;
    top: 18%;
  }

  .site-loader-message {
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 14px));
    width: calc(100vw - 36px);
    white-space: normal;
  }

  body.start-mode .top-account-cluster {
    top: 12px;
    right: 12px;
    width: auto;
    justify-content: flex-end;
  }

  .profile-button {
    min-width: 0;
  }

  .control-grid,
  .split-layout,
  .boards-layout,
  .board-media-grid,
  .canon-grid,
  .admin-grid,
  .showcase-hero,
  .ultimate-easy-grid,
  .batch-control-grid,
  .field-row.three-column,
  .estimate-grid,
  .viewer-layout,
  .metric-list,
  .pipeline-steps {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .admin-grid .panel,
  .admin-grid .admin-spend-panel {
    width: 100%;
    min-width: 0;
  }

  .admin-grid .field-row.two-column,
  .admin-grid .field-row.three-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-grid .panel-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-grid .panel-collapse-toggle {
    justify-self: start;
    margin-left: 0;
  }

  .admin-grid .admin-callout {
    align-items: start;
  }

  .admin-grid .admin-callout .compact,
  .admin-grid .button-row .compact,
  .admin-grid .button-row .primary-btn,
  .admin-grid .button-row .secondary-btn,
  .admin-grid .button-row .ghost-btn {
    width: 100%;
  }

  .admin-grid .spend-total,
  .admin-grid .spend-row,
  .admin-grid .spend-row.project-profit-row,
  .admin-grid .spend-row.credit-ledger-row,
  .admin-grid .spend-row.generation-report-row,
  .admin-grid .spend-row.aws-report-row,
  .admin-grid .spend-row.aws-service-cost-row,
  .admin-grid .spend-row.daily-cost-row,
  .admin-grid .spend-row.ops-alert-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .ultimate-easy-head {
    display: grid;
  }

  .ultimate-reference-row,
  .ultimate-submit-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .extend-generator-row,
  .extend-provider-panel .field-row.two-column {
    grid-template-columns: 1fr;
  }

  .ultimate-reference-preview {
    width: 100%;
  }

  .settings-summary {
    grid-template-columns: 1fr;
  }

  .settings-membership-policy {
    grid-template-columns: 1fr;
  }

  .settings-payment-box {
    display: grid;
  }

  .settings-payment-box strong {
    text-align: left;
  }

  .settings-payment-history-header {
    display: grid;
  }

  .panel {
    padding: 14px;
  }

  .clip-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .viewer-trim-row {
    grid-template-columns: 1fr;
  }

  .clip-feature-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .admin-callout,
  .modal-title-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .readiness-modal-card {
    max-height: calc(100vh - 28px);
    padding: 16px;
  }

  .story-writing-progress-card {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .start-screen {
    min-height: auto;
    place-items: center;
    align-content: start;
    padding: 12px;
  }

  .start-account-bar,
  .start-source-card,
  .viewer-hero {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .start-source-card .compact {
    justify-self: start;
  }

  .start-hero h2,
  .showcase-copy h2 {
    font-size: 2.2rem;
    line-height: 1;
  }

  .showcase-hero {
    min-height: calc(100svh - 76px);
    align-items: start;
    padding: 14px;
  }

  .showcase-media-shell {
    min-height: 0;
    padding: 10px;
  }

  .showcase-media,
  .showcase-external-card {
    width: min(100%, calc((100vh - 250px) * 0.5625));
    height: auto;
    max-height: calc(100vh - 250px);
    min-height: 0;
  }

  .showcase-frame-top,
  .showcase-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .showcase-info-bar {
    grid-template-columns: 1fr;
  }

  .showcase-info-bar a {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .start-hero textarea {
    min-height: 180px;
  }

  .image-preview,
  .video-preview {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    resize: none;
  }

  .video-preview {
    aspect-ratio: var(--preview-ratio, 9 / 16);
    height: auto;
    max-height: min(72vh, 720px);
  }

  .image-preview img {
    max-height: 72vh;
    object-fit: contain;
  }

  .viewer-layout > .panel,
  .board-media-grid > *,
  .boards-layout > * {
    min-width: 0;
  }

  .generation-placeholder {
    min-height: 180px;
    padding: 18px;
  }

  .board-list-panel {
    min-height: 0;
  }

  .board-list,
  .media-list,
  .full-plan-list {
    max-height: none;
  }

  .full-plan-item,
  .spend-row,
  .admin-user-card,
  .invite-code-card {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    min-width: min(72vw, 220px);
  }

  .modal-backdrop {
    align-items: start;
    padding: 12px;
    overflow: auto;
  }

  .modal-card {
    width: 100%;
    padding: 16px;
  }

  input,
  textarea,
  select,
  button {
    max-width: 100%;
  }
}

.site-loader-fallback::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  box-shadow: 0 0 28px rgba(119, 168, 162, 0.12), inset 0 0 30px rgba(224, 179, 81, 0.035);
}

/* Video editor product pass: keep the existing worker-backed editor behavior while shaping the surface like a consumer timeline editor. */
#video-editor.tab-panel {
  padding-bottom: 8px;
}

.video-editor-page {
  overflow: hidden;
  gap: 10px;
  border-color: rgba(244, 241, 232, 0.08);
  background:
    radial-gradient(circle at 22% 0%, rgba(224, 179, 81, 0.09), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(119, 168, 162, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(8, 9, 9, 0.96), rgba(2, 3, 3, 0.98));
}

.video-editor-page > .panel-header {
  margin-bottom: 0;
}

.video-editor-page > .panel-header h3 {
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.video-editor-page > .panel-header .fine-print {
  max-width: 760px;
}

.video-editor-react-root {
  position: relative;
  z-index: 3;
}

.plotthirst-react-video-editor {
  max-width: 100%;
}

.video-editor-workspace {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.09);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 16%),
    rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 1px 0 rgba(244, 241, 232, 0.045), 0 22px 72px rgba(0, 0, 0, 0.28);
}

.video-editor-stage,
.video-editor-timeline-shell {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.video-editor-stage {
  position: relative;
  min-height: min(72vh, 760px);
  padding: 10px;
  grid-template-rows: auto minmax(340px, 1fr) auto;
}

.video-editor-viewer-actions {
  position: relative;
  z-index: 19;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
}

.video-editor-viewer-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.video-editor-viewer-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.video-editor-viewer-action-buttons button {
  min-height: 34px;
  border-radius: 999px;
}

.video-editor-viewer-actions .video-editor-settings-panel:not(.hidden) {
  top: calc(100% + 4px);
  right: 0;
  bottom: auto;
}

.video-editor-toolbar {
  z-index: 6;
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid rgba(244, 241, 232, 0.09);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.065), rgba(244, 241, 232, 0.025)),
    rgba(0, 0, 0, 0.5);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.22);
}

.video-editor-control-dock {
  position: relative;
  z-index: 17;
  margin: 0 12px 12px;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-radius: 20px;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.04), rgba(244, 241, 232, 0.015)),
    rgba(0, 0, 0, 0.42);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26);
}

.video-editor-toolbar button {
  white-space: nowrap;
  border-radius: 999px;
  min-height: 34px;
  padding-inline: 12px;
}

.video-editor-toolbar button.icon-only-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
}

.video-editor-add-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  border-color: rgba(224, 179, 81, 0.72);
  font-size: 1.55rem;
  box-shadow: 0 10px 30px rgba(224, 179, 81, 0.2);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.video-editor-add-button:hover,
.video-editor-add-button.active {
  transform: rotate(45deg) scale(1.05);
  border-color: rgba(224, 179, 81, 0.95);
  box-shadow: 0 12px 36px rgba(224, 179, 81, 0.3), 0 0 0 3px rgba(224, 179, 81, 0.12);
}

.video-editor-add-button .app-icon {
  width: 20px;
  height: 20px;
}

.video-editor-add-menu {
  position: static;
  width: min(430px, 100%);
  max-height: min(560px, 62vh);
  overflow: auto;
  margin-top: 8px;
  border-radius: 14px;
  border-color: rgba(244, 241, 232, 0.14);
  background:
    linear-gradient(180deg, rgba(19, 21, 20, 0.98), rgba(4, 5, 5, 0.98));
}

.video-editor-add-menu:not(.hidden) {
  display: grid;
  animation: video-editor-pop 150ms ease-out both;
}

.video-editor-add-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
}

.video-editor-add-menu-head strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 1000;
}

.video-editor-add-menu-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.video-editor-add-menu-item {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 12px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(244, 241, 232, 0.07), rgba(119, 168, 162, 0.04)),
    rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.video-editor-add-menu-item:hover {
  transform: translateY(-1px);
  border-color: rgba(224, 179, 81, 0.42);
  background:
    linear-gradient(135deg, rgba(224, 179, 81, 0.14), rgba(119, 168, 162, 0.08)),
    rgba(255, 255, 255, 0.035);
}

.video-editor-add-menu-item.active {
  border-color: rgba(224, 179, 81, 0.58);
  background:
    linear-gradient(135deg, rgba(224, 179, 81, 0.16), rgba(119, 168, 162, 0.1)),
    rgba(255, 255, 255, 0.04);
}

.video-editor-add-menu-item span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(224, 179, 81, 0.35);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 1000;
  background: rgba(224, 179, 81, 0.1);
}

.video-editor-add-menu-item span .app-icon {
  width: 18px;
  height: 18px;
}

.video-editor-add-menu-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 1000;
}

.video-editor-library-picker {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.video-editor-library-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.video-editor-library-picker-head strong,
.video-editor-library-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 1000;
}

.video-editor-library-picker-head span,
.video-editor-library-meta span,
.video-editor-library-empty {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.video-editor-library-list {
  display: grid;
  gap: 7px;
  max-height: min(320px, 34vh);
  overflow: auto;
  padding-right: 2px;
}

.video-editor-draft-list {
  display: grid;
  gap: 7px;
  max-height: min(320px, 34vh);
  overflow: auto;
  padding-right: 2px;
}

.video-editor-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.video-editor-draft-item strong,
.video-editor-draft-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-draft-item span {
  color: rgba(245, 247, 255, 0.58);
  font-size: 0.76rem;
}

.video-editor-library-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.video-editor-library-thumb {
  width: 46px;
  aspect-ratio: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(244, 241, 232, 0.08);
  background: rgba(244, 241, 232, 0.04);
}

.video-editor-library-thumb video,
.video-editor-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-editor-library-audio-thumb {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 1000;
}

.video-editor-library-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.video-editor-add-menu-publish {
  width: 100%;
  border: 1px solid rgba(119, 168, 162, 0.26);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(119, 168, 162, 0.08);
  color: var(--soft);
  font-weight: 900;
  cursor: pointer;
}

.video-editor-add-menu-publish:hover,
.video-editor-add-menu-publish.active {
  border-color: rgba(119, 168, 162, 0.5);
  color: var(--text);
  background: rgba(119, 168, 162, 0.14);
}

@keyframes video-editor-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-editor-settings-panel {
  border-radius: 12px;
  border-color: rgba(244, 241, 232, 0.1);
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.035), rgba(244, 241, 232, 0.012)),
    rgba(0, 0, 0, 0.46);
}

.video-editor-settings-panel:not(.hidden) {
  display: grid;
  position: absolute;
  top: auto;
  bottom: calc(100% + 10px);
  right: 12px;
  z-index: 18;
  width: min(390px, calc(100% - 24px));
  max-height: min(560px, 62vh);
  overflow: auto;
  border-color: rgba(244, 241, 232, 0.16);
  background:
    linear-gradient(180deg, rgba(22, 24, 22, 0.98), rgba(4, 5, 5, 0.98));
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px);
}

#video-editor .video-editor-add-menu.hidden,
#video-editor .video-editor-settings-panel.hidden,
#video-editor .video-editor-library-picker.hidden,
#video-editor .video-editor-music-publish.hidden {
  display: none !important;
}

.video-editor-preview-stage {
  min-height: clamp(340px, 55vh, 680px);
  border-radius: 14px;
  border-color: rgba(244, 241, 232, 0.1);
  background:
    radial-gradient(circle at 50% 42%, rgba(244, 241, 232, 0.075), transparent 30%),
    radial-gradient(circle at 24% 12%, rgba(224, 179, 81, 0.09), transparent 26%),
    linear-gradient(135deg, rgba(244, 241, 232, 0.035), transparent 28%),
    #000;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.72), 0 18px 58px rgba(0, 0, 0, 0.34);
}

.video-editor-preview-stage.empty {
  background:
    linear-gradient(90deg, rgba(244, 241, 232, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(244, 241, 232, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(224, 179, 81, 0.08), transparent 34%),
    #020303;
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.video-editor-preview-stage video,
.video-editor-preview-stage img {
  max-height: 66vh;
}

.video-editor-preview-controls,
.video-editor-playhead-inline {
  flex-wrap: nowrap;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(244, 241, 232, 0.09);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.055), rgba(244, 241, 232, 0.02)),
    rgba(0, 0, 0, 0.52);
}

.video-editor-timekeeper {
  margin-top: 2px;
}

.video-editor-preview-play {
  flex: 0 0 auto;
  min-width: 64px;
  border-radius: 999px;
}

.video-editor-preview-controls input[type="range"],
.video-editor-playhead-inline input[type="range"] {
  min-width: 140px;
  flex: 1 1 170px;
  accent-color: var(--accent);
}

.video-editor-preview-controls span,
.video-editor-playhead-inline span {
  min-width: 88px;
  text-align: right;
}

.video-editor-playhead-inline {
  min-width: min(360px, 100%);
  flex: 1 1 320px;
  border-radius: 999px;
}

.video-editor-preview-label {
  border-radius: 999px;
  border-color: rgba(244, 241, 232, 0.1);
  background: rgba(0, 0, 0, 0.62);
}

.video-editor-timeline-shell {
  gap: 9px;
  max-width: 100%;
  max-height: none;
  padding: 12px;
  border-top: 1px solid rgba(244, 241, 232, 0.08);
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.035), rgba(244, 241, 232, 0.012)),
    rgba(1, 2, 2, 0.7);
}

.video-editor-timeline-head {
  align-items: center;
  padding-inline: 2px;
}

.video-editor-timeline-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.video-editor-timeline-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: fit-content;
  padding: 6px;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}

.video-editor-timeline-tools button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}

.video-editor-timeline-tools input[type="range"] {
  width: min(18vw, 170px);
  min-width: 96px;
  accent-color: var(--accent);
}

.video-editor-ruler {
  height: 28px;
  min-width: 100%;
  border-bottom-color: rgba(244, 241, 232, 0.1);
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.02), transparent),
    rgba(0, 0, 0, 0.16);
}

.video-editor-ruler span {
  color: rgba(244, 241, 232, 0.64);
  font-size: 0.65rem;
  font-weight: 800;
}

.video-editor-ruler span.minor::before {
  height: 5px;
  background: rgba(244, 241, 232, 0.16);
}

.video-editor-ruler span.major::before {
  height: 11px;
  background: rgba(224, 179, 81, 0.48);
}

.video-editor-timeline {
  --video-editor-track-offset: 79px;
  position: relative;
  min-height: 326px;
  max-height: 460px;
  gap: 10px;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.video-editor-timeline.transition-open {
  padding-bottom: 230px;
}

.video-editor-track-row {
  grid-template-columns: 70px minmax(560px, 1fr);
  gap: 9px;
}

.video-editor-track-label {
  position: sticky;
  left: 0;
  z-index: 8;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 3px;
  border-radius: 10px;
  border-color: rgba(244, 241, 232, 0.1);
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.055), rgba(244, 241, 232, 0.018)),
    #070909;
  box-shadow: 8px 0 18px rgba(0, 0, 0, 0.25);
}

.video-editor-track-label span {
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(224, 179, 81, 0.28);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.58rem;
  line-height: 1;
  background: rgba(224, 179, 81, 0.08);
}

.video-editor-track-label strong {
  color: var(--soft);
  font-size: 0.66rem;
  font-weight: 1000;
}

.video-editor-track-label small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
}

.video-editor-track-lane {
  min-height: 124px;
  border-radius: 10px;
  border-color: rgba(244, 241, 232, 0.09);
  background:
    linear-gradient(180deg, transparent 48%, rgba(244, 241, 232, 0.045) 49%, transparent 52%),
    repeating-linear-gradient(90deg, rgba(244, 241, 232, 0.04) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.38);
}

.video-editor-track-lane.audio-lane {
  min-height: 70px;
  background:
    repeating-linear-gradient(90deg, rgba(119, 168, 162, 0.07) 0 2px, transparent 2px 38px),
    linear-gradient(180deg, rgba(119, 168, 162, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.4);
}

.video-editor-timeline-clip {
  top: 8px;
  bottom: 8px;
  gap: 5px;
  border-radius: 11px;
  border-color: rgba(224, 179, 81, 0.58);
  padding: 7px 10px;
  background:
    linear-gradient(135deg, rgba(224, 179, 81, 0.26), rgba(119, 168, 162, 0.15)),
    rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 0 rgba(244, 241, 232, 0.08), 0 10px 28px rgba(0, 0, 0, 0.25);
}

.video-editor-timeline-clip.audio {
  grid-template-rows: minmax(20px, 1fr) auto auto;
  background:
    linear-gradient(135deg, rgba(119, 168, 162, 0.27), rgba(90, 119, 188, 0.14)),
    rgba(0, 0, 0, 0.28);
}

.video-editor-clip-topline,
.video-editor-clip-subline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.video-editor-clip-topline {
  justify-content: flex-end;
}

.video-editor-clip-topline strong,
.video-editor-clip-subline small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-clip-topline em {
  flex: 0 0 auto;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--accent);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 1000;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.24);
}

.video-editor-clip-subline b {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 1000;
}

.video-editor-clip-subline small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.video-editor-audio-wave {
  height: 28px;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 7px;
  padding: 4px 5px;
  background:
    linear-gradient(90deg, rgba(119, 168, 162, 0.08), rgba(224, 179, 81, 0.08), rgba(119, 168, 162, 0.06)),
    rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 0 1px rgba(119, 168, 162, 0.16);
  opacity: 0.95;
}

.video-editor-audio-wave i {
  flex: 1 1 2px;
  min-width: 1px;
  max-width: 4px;
  align-self: center;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(224, 179, 81, 0.95), rgba(119, 168, 162, 0.9));
  box-shadow: 0 0 8px rgba(119, 168, 162, 0.22);
}

.video-editor-timeline-empty-state {
  width: min(100%, 420px);
  display: grid;
  gap: 7px;
  place-items: center;
  align-self: center;
  justify-self: center;
  border: 1px dashed rgba(244, 241, 232, 0.18);
  border-radius: 16px;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 179, 81, 0.12), transparent 50%),
    rgba(0, 0, 0, 0.24);
  text-align: center;
}

.video-editor-timeline-empty-state strong {
  color: var(--text);
  font-size: 1rem;
}

.video-editor-timeline-empty-state span {
  max-width: 32ch;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.video-editor-frame-strip {
  min-height: 52px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(244, 241, 232, 0.055);
}

.video-editor-frame-strip img,
.video-editor-frame-strip video,
.video-editor-frame-strip span {
  min-height: 52px;
}

.video-editor-frame-strip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.video-editor-frame-strip img {
  pointer-events: none;
}

.video-editor-frame-strip.fallback-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(34px, 1fr));
  gap: 2px;
  overflow: hidden;
}

.video-editor-frame-strip.generating-strip {
  position: relative;
  overflow: hidden;
  display: block;
}

.video-editor-frame-strip.generating-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.video-editor-generating-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.56));
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 1000;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.video-editor-playhead-marker {
  display: block;
  top: 0;
  bottom: 8px;
  width: 22px;
  z-index: 30;
  margin-left: -11px;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}

.video-editor-playhead-marker::before {
  left: 50%;
  width: 15px;
  height: 14px;
  background: var(--accent);
  filter: drop-shadow(0 0 10px rgba(224, 179, 81, 0.44));
}

.video-editor-playhead-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65), 0 0 22px rgba(224, 179, 81, 0.42);
}

.video-editor-playhead-marker.dragging {
  cursor: grabbing;
}

.video-editor-timeline-clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(224, 179, 81, 0.32), 0 14px 34px rgba(0, 0, 0, 0.32);
}

.video-editor-trim-handle {
  width: 16px;
  opacity: 0.76;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(224, 179, 81, 0.46));
}

.video-editor-trim-handle.start {
  border-radius: 10px 0 0 10px;
}

.video-editor-trim-handle.end {
  border-radius: 0 10px 10px 0;
}

.video-editor-timeline {
  scroll-behavior: smooth;
}

.video-editor-track-lane {
  isolation: isolate;
}

.video-editor-scrub-zone {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 24px;
  z-index: 18;
  cursor: pointer;
  border-bottom: 1px solid rgba(224, 179, 81, 0.12);
  background:
    linear-gradient(90deg, rgba(224, 179, 81, 0.16), rgba(224, 179, 81, 0.025) 22%, rgba(244, 241, 232, 0.035)),
    rgba(0, 0, 0, 0.18);
}

.video-editor-scrub-zone::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(224, 179, 81, 0.52) 0 1px, transparent 1px 28px);
  opacity: 0.72;
}

.video-editor-timeline-clip {
  top: 28px;
  border-radius: 9px;
  padding: 7px 9px;
  transition:
    left 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

.video-editor-timeline-clip.audio {
  top: 8px;
}

.video-editor-timeline-clip.holder {
  border-color: rgba(244, 241, 232, 0.18);
  background:
    linear-gradient(135deg, rgba(244, 241, 232, 0.08), rgba(224, 179, 81, 0.08)),
    rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 1px 0 rgba(244, 241, 232, 0.1), 0 10px 30px rgba(0, 0, 0, 0.34);
}

.video-editor-timeline-clip.holder .video-editor-frame-strip {
  border: 1px solid rgba(244, 241, 232, 0.1);
  background: #050506;
}

.video-editor-timeline-clip.generating {
  border-color: rgba(224, 179, 81, 0.72);
  background:
    linear-gradient(135deg, rgba(224, 179, 81, 0.18), rgba(119, 168, 162, 0.14)),
    rgba(0, 0, 0, 0.5);
}

.video-editor-timeline-clip:hover {
  transform: translateY(-1px);
}

.video-editor-timeline-clip.dragging {
  opacity: 0.55;
  cursor: grabbing;
  transform: scale(0.985);
}

.video-editor-timeline-clip.drop-before {
  box-shadow: -5px 0 0 rgba(224, 179, 81, 0.9), 0 0 0 2px rgba(224, 179, 81, 0.18), 0 14px 34px rgba(0, 0, 0, 0.32);
}

.video-editor-timeline-clip.drop-after {
  box-shadow: 5px 0 0 rgba(224, 179, 81, 0.9), 0 0 0 2px rgba(224, 179, 81, 0.18), 0 14px 34px rgba(0, 0, 0, 0.32);
}

.video-editor-drop-marker {
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 3px;
  z-index: 16;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scaleY(0.84);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72), 0 0 22px rgba(224, 179, 81, 0.45);
  transition: opacity 120ms ease, transform 120ms ease;
}

.video-editor-drop-marker.active {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

.video-editor-transition-wrap {
  position: absolute;
  top: 50%;
  z-index: 42;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.video-editor-transition-button {
  width: 27px;
  min-width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.14), rgba(0, 0, 0, 0.62)),
    rgba(0, 0, 0, 0.82);
  color: var(--soft);
  font-size: 0.66rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.video-editor-transition-button:hover,
.video-editor-transition-wrap.open .video-editor-transition-button,
.video-editor-transition-button.active {
  border-color: rgba(224, 179, 81, 0.68);
  background:
    linear-gradient(180deg, rgba(224, 179, 81, 0.28), rgba(0, 0, 0, 0.64)),
    rgba(0, 0, 0, 0.86);
  color: var(--text);
  transform: translateY(-1px);
}

.video-editor-transition-menu {
  position: absolute;
  top: 34px;
  left: 50%;
  width: 218px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(22, 24, 22, 0.98), rgba(4, 5, 5, 0.98));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  pointer-events: auto;
}

.video-editor-transition-floating-layer {
  position: absolute;
  top: 0;
  left: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 60;
}

.video-editor-transition-floating-layer .video-editor-transition-menu {
  top: 96px;
  left: 0;
  pointer-events: auto;
  z-index: 61;
}

.video-editor-transition-menu.floating {
  position: absolute;
}

.video-editor-transition-menu strong {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.video-editor-transition-menu button {
  width: 100%;
  border: 1px solid rgba(244, 241, 232, 0.09);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  font-size: 0.75rem;
  font-weight: 900;
  text-align: left;
}

.video-editor-transition-menu button.ai {
  background:
    linear-gradient(135deg, rgba(92, 124, 255, 0.18), rgba(224, 179, 81, 0.1)),
    rgba(255, 255, 255, 0.045);
}

.video-editor-transition-seconds {
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.video-editor-transition-seconds span,
.video-editor-transition-menu small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.25;
}

.video-editor-transition-seconds input {
  width: 100%;
  min-width: 0;
  border-radius: 7px;
  padding: 5px 6px;
  text-align: center;
}

.video-editor-transition-menu button.active,
.video-editor-transition-menu button:hover {
  border-color: rgba(224, 179, 81, 0.45);
  color: var(--text);
  background: rgba(224, 179, 81, 0.14);
}

@media (max-width: 760px) {
  .video-editor-page {
    margin-inline: -10px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .video-editor-page > .panel-header,
  .video-editor-react-root,
  .video-editor-status,
  #videoEditorStatus {
    padding-inline: 10px;
  }

  .video-editor-workspace {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .video-editor-stage {
    min-height: 0;
    padding: 8px;
    grid-template-rows: auto minmax(300px, 52vh) auto;
  }

  .video-editor-settings-panel:not(.hidden) {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 14px;
    width: auto;
    max-height: min(70svh, 620px);
    z-index: 70;
    border-radius: 18px;
  }

  .video-editor-toolbar {
    border-radius: 16px;
    justify-content: flex-start;
    gap: 6px;
  }

  .video-editor-toolbar button {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.76rem;
  }

  .video-editor-add-menu {
    width: 100%;
    max-height: min(56svh, 440px);
  }

  .video-editor-add-menu-grid {
    grid-template-columns: 1fr 1fr;
  }

  .video-editor-preview-stage {
    min-height: min(52vh, 420px);
    border-radius: 12px;
  }

  .video-editor-preview-controls {
    border-radius: 14px;
  }

  .video-editor-playhead-inline {
    order: 20;
    flex-basis: 100%;
    min-width: 0;
    border-radius: 14px;
  }

  .video-editor-playhead-inline input[type="range"] {
    min-width: 0;
  }

  .video-editor-preview-controls span {
    min-width: 78px;
  }

  .video-editor-timeline-shell {
    padding: 10px 0 10px 8px;
    border-radius: 0;
  }

  .video-editor-timeline-head,
  .video-editor-ruler {
    padding-right: 8px;
  }

  .video-editor-timeline-head {
    align-items: stretch;
    flex-direction: column;
  }

  .video-editor-timeline-tools {
    width: calc(100% - 8px);
    justify-content: space-between;
  }

  .video-editor-timeline-tools input[type="range"] {
    width: 100%;
    min-width: 0;
  }

  .video-editor-timeline {
    --video-editor-track-offset: 67px;
    min-height: 322px;
    max-height: min(46vh, 420px);
  }

  .video-editor-track-row {
    grid-template-columns: 58px minmax(560px, 1fr);
  }

  .video-editor-track-lane {
    min-height: 118px;
  }

  .video-editor-track-lane.audio-lane {
    min-height: 68px;
  }

  .video-editor-frame-strip {
    min-height: 46px;
  }

  .video-editor-frame-strip img,
  .video-editor-frame-strip span {
    min-height: 46px;
  }

  .video-editor-transition-menu {
    width: 156px;
  }
}

/* Segment cards follow available workspace width, including nested mobile panels. */
.sample-segment-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.sample-production-board .sample-segment-choice { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.sample-production-board .sample-segment-choice input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; padding: 0; }
.sample-production-board .sample-segment-choice span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; line-height: 1.6; }
@media (max-width: 640px) {
  #reactUltimateOmegaRoot [aria-label="Canonical screenplay sample"],
  #reactUltimateOmegaRoot [aria-label="Sample segment breakdown"],
  #reactUltimateOmegaRoot [aria-label="Sample production sequence"] { min-width: 0; padding: 8px; }
  #reactUltimateOmegaRoot [aria-label="Sample segment navigation"] { flex-wrap: wrap; }
  #reactUltimateOmegaRoot [aria-label="Sample settings workbench"] { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 640px) {
  #reactUltimateOmegaRoot [aria-label="Sample segment breakdown"] { border: 0; padding: 0; background: transparent; }
  #reactUltimateOmegaRoot [aria-label="Canonical screenplay sample"] { border: 0; padding: 0; background: transparent; }
  #reactUltimateOmegaRoot .sample-segment-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  #reactUltimateOmegaRoot .omega-workbench-utilities { width: 100%; max-width: 100%; margin-left: 0; }
  #reactUltimateOmegaRoot .omega-workbench-utilities > div { justify-content: flex-start; width: 100%; }
  #reactUltimateOmegaRoot .omega-workbench-utilities button { min-width: 0; max-width: 100%; height: auto; min-height: 38px; white-space: normal; font-size: 11px; padding: 7px 9px; }
}

/* Key sources stay inside the account box; no floating status banner. */
.profile-button .profile-key-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
}
.profile-button .profile-key-indicators.hidden { display: none; }
.profile-button .provider-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 0.68rem;
  line-height: 1.1;
  font-weight: 750;
  color: #68dfa3;
  background: rgba(104, 223, 163, 0.08);
}
.profile-button .provider-key-badge[data-key-source="user"] {
  color: #79baff;
  background: rgba(121, 186, 255, 0.08);
}
.provider-key-badge svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.login-recovery-link { padding: 4px; border: 0; background: transparent; color: var(--muted, #aaa); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* Native option popups need opaque colors, including Windows and mobile live preview. */
#reactUltimateOmegaRoot select { color-scheme: dark; }
#reactUltimateOmegaRoot select option, #reactUltimateOmegaRoot select optgroup { background: #101818; color: #f5f3eb; }

/* Keep generation consent text beside its checkbox, including narrow mobile views. */
label.screenplay-auto-contribute { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
label.screenplay-auto-contribute > input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; margin: 3px 0 0; padding: 0; }
label.screenplay-auto-contribute > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
label.quick-solo-angle-pack { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
label.quick-solo-angle-pack > input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; margin: 3px 0 0; padding: 0; }
label.quick-solo-angle-pack > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
label.quick-solo-checkbox { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; }
label.quick-solo-checkbox > input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; margin: 0; padding: 0; }
label.quick-solo-checkbox > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; text-align: left; }
#adminActivity .activity-rows { display: grid; gap: 10px; }
#adminActivity .activity-row { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-wrap: anywhere; }
#adminActivity .activity-row p { margin: 5px 0; }
#adminActivity .activity-failure { color: var(--accent); }
#adminActivity .activity-row details { margin: 8px 0; min-width: 0; }
#adminActivity .activity-row summary { cursor: pointer; }
#adminActivity select { min-width: 0; }
@media (max-width: 600px) { #adminActivity > .field-row { grid-template-columns: minmax(0, 1fr); } }
