:root {
  color-scheme: dark;
  --bg: #0a0d0d;
  --bg-elevated: #101414;
  --panel: #141918;
  --panel-soft: #19201f;
  --line: #2b3431;
  --line-soft: #202725;
  --text: #f2f4ef;
  --muted: #8f9b96;
  --coral: #ff6b45;
  --coral-bright: #ff845f;
  --lime: #c6f35b;
  --cyan: #6fe1d4;
  --danger: #ff6474;
  --sidebar: 232px;
  --radius: 18px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% 4%, rgba(255, 107, 69, 0.07), transparent 26rem),
    var(--bg);
  color: var(--text);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(20, 25, 24, 0.96);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 22px;
}

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

.auth-card > .muted {
  margin-bottom: 24px;
  line-height: 1.7;
}

.auth-switch {
  width: 100%;
  margin-top: 18px;
  text-align: center;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line-soft);
  background: rgba(9, 12, 12, 0.94);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px 4px 12px 4px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--coral);
  font-weight: 900;
  font-size: 19px;
  transform: rotate(-3deg);
}

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

.brand strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #a8b1ad;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.nav-item span {
  color: #56615d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.nav-item:hover {
  color: var(--text);
  background: #141918;
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--text);
  background: #1b211f;
}

.nav-item.active span {
  color: var(--coral);
}

.sidebar-foot {
  margin-top: auto;
  padding: 15px 10px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-foot span,
.sidebar-foot small {
  display: block;
}

.sidebar-foot span {
  font-size: 12px;
}

.sidebar-foot small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.system-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #626b68;
  box-shadow: 0 0 0 5px rgba(98, 107, 104, 0.1);
}

.system-dot.ok {
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(198, 243, 91, 0.1);
}

.system-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 100, 116, 0.1);
}

.main {
  margin-left: var(--sidebar);
  padding: 0 34px 60px;
}

.topbar {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.topbar h1 {
  margin: 7px 0 0;
  font-size: clamp(22px, 2.2vw, 31px);
  font-weight: 660;
  letter-spacing: -0.035em;
}

.topbar-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  color: #77837e;
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}

.eyebrow.warm {
  color: var(--coral-bright);
}

.mode-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--panel);
  font-size: 11px;
}

.user-pill {
  padding: 8px 11px;
  border-radius: 999px;
  color: #d9dfdb;
  background: #1a211f;
  font-size: 11px;
}

.button {
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: wait;
  transform: none;
}

.button.primary {
  color: #101210;
  background: var(--text);
}

.button.accent {
  color: #15100e;
  background: var(--coral);
}

.button.secondary {
  border-color: var(--line);
  background: var(--panel-soft);
}

.button.ghost {
  border-color: var(--line);
  background: transparent;
}

.button.danger {
  color: #ffd9de;
  border-color: rgba(255, 100, 116, 0.35);
  background: rgba(255, 100, 116, 0.09);
}

.button.full {
  width: 100%;
}

.button.tiny {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.text-button:hover {
  color: var(--text);
}

.view {
  display: none;
  padding-top: 30px;
  animation: enter 200ms ease;
}

.view.active {
  display: block;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.hero-grid.simplified,
.hero-grid.simplified .hero-card {
  grid-template-columns: 1fr;
}

.hero-card,
.automation-card,
.panel,
.metric {
  border: 1px solid var(--line-soft);
  background: rgba(20, 25, 24, 0.94);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 345px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 107, 69, 0.08), transparent 48%),
    #141817;
}

.hero-copy h2 {
  max-width: 610px;
  margin: 15px 0 16px;
  font-size: clamp(38px, 5.3vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 730;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 560px;
  margin: 0 0 25px;
  color: #a2aaa7;
  font-size: 14px;
  line-height: 1.75;
}

.signal-visual {
  position: relative;
  height: 280px;
}

.signal-ring {
  position: absolute;
  border: 1px solid rgba(255, 107, 69, 0.33);
  border-radius: 50%;
  inset: 50%;
  transform: translate(-50%, -50%);
}

.ring-one {
  width: 230px;
  height: 230px;
  animation: pulse-ring 3.5s ease-in-out infinite;
}

.ring-two {
  width: 170px;
  height: 170px;
  border-color: rgba(198, 243, 91, 0.25);
  animation: pulse-ring 3.5s 0.8s ease-in-out infinite reverse;
}

@keyframes pulse-ring {
  50% {
    transform: translate(-50%, -50%) scale(1.04);
    opacity: 0.55;
  }
}

.signal-core {
  position: absolute;
  inset: 50%;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  color: #121412;
  background: var(--lime);
  box-shadow: 0 0 70px rgba(198, 243, 91, 0.17);
}

.signal-core span {
  font: 800 9px ui-monospace, monospace;
  letter-spacing: 0.16em;
}

.signal-core strong {
  margin-top: 3px;
  font-size: 21px;
}

.signal-tag {
  position: absolute;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #aab3af;
  background: #171c1b;
  font-size: 10px;
}

.tag-a {
  top: 23px;
  right: 21px;
}

.tag-b {
  bottom: 34px;
  left: 5px;
}

.tag-c {
  bottom: 13px;
  right: 0;
}

.automation-card {
  padding: 25px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
}

.card-heading,
.panel-head,
.automation-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h3,
.panel-head h3 {
  margin: 7px 0 0;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.radar-status {
  margin: auto 0 18px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #101514;
}

.radar-status strong,
.radar-status small {
  display: block;
}

.radar-status strong {
  font-size: 12px;
}

.radar-status small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #53605b;
}

.pulse.on {
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(198, 243, 91, 0.1);
}

.switch {
  position: relative;
  display: inline-block;
  width: 43px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #222927;
  cursor: pointer;
  transition: 180ms ease;
}

.switch span::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 2px;
  border-radius: 50%;
  background: #7d8783;
  transition: 180ms ease;
}

.switch input:checked + span {
  border-color: var(--lime);
  background: rgba(198, 243, 91, 0.18);
}

.switch input:checked + span::before {
  transform: translateX(18px);
  background: var(--lime);
}

.metric-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric {
  min-height: 137px;
  padding: 20px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 107, 69, 0.18);
  border-radius: 50%;
  right: -21px;
  top: -18px;
}

.metric.lime::after {
  border-color: rgba(198, 243, 91, 0.22);
}

.metric span,
.metric small {
  display: block;
}

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

.metric strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 32px;
  letter-spacing: -0.05em;
}

.metric small {
  color: #65706b;
  font-size: 10px;
}

.two-column {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.one-column {
  margin-top: 18px;
}

.panel {
  border-radius: var(--radius);
  padding: 22px;
}

.stack-list {
  margin-top: 17px;
  display: grid;
  gap: 8px;
}

.job-row {
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: #101514;
}

.job-row h4 {
  margin: 0;
  font-size: 12px;
}

.job-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.job-progress {
  width: 96px;
  height: 4px;
  border-radius: 99px;
  background: #29302e;
  overflow: hidden;
}

.job-progress span {
  display: block;
  height: 100%;
  background: var(--coral);
}

.queue-manager-panel {
  margin-top: 18px;
}

.queue-manager-head,
.queue-job-main,
.queue-job-progress,
.queue-job-actions {
  display: flex;
  align-items: center;
}

.queue-manager-head {
  justify-content: space-between;
  gap: 16px;
}

.queue-manager-head h3 {
  margin: 5px 0 0;
}

.queue-manager-head > span {
  color: var(--lime);
  font-size: 10px;
}

.queue-manager-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 17px;
}

.queue-job {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #101514;
}

.queue-job-main {
  justify-content: space-between;
  gap: 12px;
}

.queue-job-main strong,
.queue-job-main small {
  display: block;
}

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

.queue-job-main small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.queue-job-progress {
  gap: 10px;
  margin-top: 13px;
}

.queue-job-progress .job-progress {
  width: auto;
  flex: 1;
}

.queue-job-progress > span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.queue-job-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: #b7c4bf;
  font-size: 9px;
}

.queue-job-usage strong {
  color: var(--lime);
  font-weight: 600;
}

.queue-job-usage.muted {
  color: var(--muted);
}

.queue-job-error {
  margin: 10px 0 0;
  color: #d78e80;
  font-size: 9px;
  line-height: 1.5;
}

.queue-job-actions {
  justify-content: flex-end;
  gap: 7px;
  margin-top: 13px;
}

.provider-matrix {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.provider-chip {
  padding: 13px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  text-align: center;
  background: #101514;
}

.provider-chip strong,
.provider-chip small {
  display: block;
}

.provider-chip strong {
  text-transform: uppercase;
  font-size: 11px;
}

.provider-chip small {
  margin-top: 6px;
  color: #68726e;
  font-size: 9px;
}

.provider-chip.configured {
  border-color: rgba(198, 243, 91, 0.25);
}

.provider-chip.configured small {
  color: var(--lime);
}

.pipeline-legend {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  color: #919b97;
  font-size: 10px;
}

.pipeline-legend div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pipeline-legend span {
  color: var(--coral);
  font: 700 9px ui-monospace, monospace;
}

.section-intro {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.section-intro.align-end {
  align-items: end;
}

.section-intro h2 {
  margin: 8px 0 0;
  font-size: clamp(29px, 3.6vw, 48px);
  letter-spacing: -0.055em;
}

.section-intro > p {
  max-width: 420px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

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

.ingest-card {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.ingest-card h3 {
  margin: 6px 0 0;
  font-size: 20px;
}

.source-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #0e1110;
  background: var(--cyan);
  font-weight: 850;
}

.source-icon.coral {
  background: var(--coral);
}

.source-icon.lime {
  background: var(--lime);
}

.source-icon.outline {
  color: var(--text);
  border: 1px dashed #46504c;
  background: transparent;
}

.field-map {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aeb6b3;
  background: #101514;
  font-size: 10px;
}

.field-map i {
  color: var(--coral);
  font-style: normal;
}

.automation-control {
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.automation-control strong,
.automation-control small {
  display: block;
}

.automation-control strong {
  font-size: 12px;
}

.automation-control small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.form-stack.compact {
  gap: 10px;
}

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

label > span {
  display: block;
  margin-bottom: 7px;
  color: #9aa49f;
  font-size: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: #0f1312;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input,
select {
  min-height: 39px;
  padding: 8px 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 107, 69, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 107, 69, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #46504c;
}

.drop-field {
  min-height: 65px;
  padding: 13px;
  border: 1px dashed #3d4844;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  background: #101514;
}

.drop-field span {
  margin: 0;
  color: var(--text);
  font-size: 11px;
}

.drop-field small {
  max-width: 50%;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.run-config {
  display: grid;
  grid-template-columns: 130px 175px 100px 140px minmax(190px, 260px);
  gap: 8px;
}

.run-config span {
  margin-bottom: 5px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.filter-tabs {
  display: flex;
  gap: 5px;
}

.filter-tabs button {
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.filter-tabs button.active {
  color: var(--text);
  background: #252c2a;
}

.search {
  width: 220px;
  min-height: 33px;
  font-size: 10px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

th {
  color: #66716c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #b4bcb8;
  font-size: 11px;
}

td strong,
td small {
  display: block;
}

td strong {
  max-width: 320px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td small {
  margin-top: 4px;
  color: #69736f;
  font-size: 9px;
}

tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 99px;
  color: #afb8b4;
  background: #252c2a;
  font-size: 9px;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #74807a;
}

.status-badge.completed::before {
  background: var(--lime);
}

.status-badge.processing::before,
.status-badge.running::before {
  background: var(--coral);
}

.status-badge.failed::before,
.status-badge.missing_media::before,
.status-badge.canceled::before {
  background: var(--danger);
}

.analysis-modebar {
  width: min(620px, 100%);
  margin: -18px 0 22px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  background: #0e1211;
}

.analysis-modebar button {
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #8f9b96;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.analysis-modebar button:hover {
  color: var(--text);
  background: #171c1b;
}

.analysis-modebar button.active {
  border-color: #303936;
  color: var(--text);
  background: #202624;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.analysis-modebar span,
.analysis-modebar small {
  display: block;
}

.analysis-modebar span {
  font-size: 13px;
  font-weight: 720;
}

.analysis-modebar small {
  color: #6f7a76;
  font-size: 10px;
}

.analysis-workspace {
  display: none;
}

.analysis-workspace.active {
  display: block;
  animation: enter 180ms ease;
}

.analysis-layout {
  min-height: 660px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.batch-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 16px;
}

.batch-step-panel {
  min-height: 440px;
  padding: 20px;
}

.batch-step-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #171a18;
  background: var(--coral);
  font: 800 11px ui-monospace, monospace;
}

.batch-step-head h3,
.batch-step-head p {
  margin: 0;
}

.batch-step-head h3 {
  font-size: 15px;
}

.batch-step-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.batch-selection-summary {
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.batch-selection-summary strong {
  color: var(--lime);
  font-size: 12px;
}

.batch-selection-summary span {
  color: #68736e;
  font-size: 9px;
}

.batch-analysis-picker {
  max-height: 330px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
}

.batch-analysis-option {
  position: relative;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  background: #101514;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.batch-analysis-option:hover {
  border-color: #3b4642;
  background: #151b19;
}

.batch-analysis-option:has(input:checked) {
  border-color: rgba(198, 243, 91, 0.42);
  background: rgba(198, 243, 91, 0.055);
}

.batch-analysis-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.batch-option-check {
  width: 24px;
  height: 24px;
  border: 1px solid #3a4440;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 12px;
}

.batch-analysis-option input:checked + .batch-option-check {
  border-color: var(--lime);
  color: #111512;
  background: var(--lime);
}

.batch-option-copy {
  min-width: 0;
}

.batch-option-copy strong,
.batch-option-copy small {
  display: block;
}

.batch-option-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-option-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.batch-analysis-option > b {
  color: var(--coral-bright);
  font: 800 16px ui-monospace, monospace;
}

.batch-analysis-option > b small {
  color: #66716c;
  font-size: 8px;
}

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

.batch-controls label {
  min-width: 0;
}

.batch-controls .batch-title-field,
.batch-submit,
.batch-progress {
  grid-column: 1 / -1;
}

.batch-submit {
  min-height: 46px;
  margin-top: 4px;
}

.batch-progress {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.batch-library-panel {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.batch-library-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.batch-library-head > span {
  color: var(--muted);
  font-size: 10px;
}

.batch-library-layout {
  min-height: 460px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.batch-history {
  padding: 10px;
  border-right: 1px solid var(--line-soft);
  display: grid;
  align-content: start;
  gap: 6px;
  background: #0e1211;
}

.batch-history-item {
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: block;
  color: #b8c0bc;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.batch-history-item:hover,
.batch-history-item.active {
  border-color: var(--line);
  background: #1a201e;
}

.batch-history-item > span {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--coral-bright);
  font-size: 8px;
}

.batch-history-item strong,
.batch-history-item small {
  display: block;
}

.batch-history-item strong {
  font-size: 11px;
  line-height: 1.45;
}

.batch-history-item small {
  margin-top: 6px;
  color: #68736e;
  font-size: 8px;
}

.batch-results {
  min-width: 0;
  padding: 22px;
}

.batch-result-card {
  min-width: 0;
}

.batch-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.batch-result-head h2 {
  margin: 7px 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.batch-result-head p:not(.eyebrow),
.batch-progress {
  color: var(--muted);
  font-size: 10px;
}

.batch-result-meta {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.batch-result-meta > div {
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #101514;
}

.batch-result-meta span,
.batch-result-meta strong {
  display: block;
}

.batch-result-meta span {
  margin-bottom: 5px;
  color: #69746f;
  font-size: 8px;
}

.batch-result-meta strong {
  font-size: 11px;
}

.batch-source-line,
.script-sources {
  margin: 14px 0;
}

.batch-source-line > strong,
.script-sources > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
}

.batch-result-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.batch-result-empty > span {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--coral-bright);
  font: 800 12px ui-monospace, monospace;
}

.batch-result-empty h3 {
  margin: 14px 0 7px;
}

.batch-result-empty p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.analysis-list {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 42px);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.analysis-list-head {
  padding: 9px 8px 13px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.analysis-list-head div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.analysis-list-head span {
  font-size: 13px;
  font-weight: 720;
}

.analysis-list-head strong {
  color: var(--coral-bright);
  font: 800 11px ui-monospace, monospace;
}

.analysis-list-head small,
.analysis-list-group {
  color: #65706b;
  font-size: 8px;
}

.analysis-list-group {
  margin: 8px 7px 1px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.analysis-list-item {
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}

.analysis-list-item:hover,
.analysis-list-item.active {
  border-color: rgba(255, 107, 69, 0.32);
  background: rgba(255, 107, 69, 0.07);
}

.analysis-list-item strong,
.analysis-list-item small {
  display: block;
}

.analysis-list-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-list-item small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.analysis-detail {
  min-width: 0;
}

.empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.large {
  min-height: 600px;
}

.empty-state span {
  color: #46504c;
  font-size: 36px;
}

.empty-state h3 {
  margin: 15px 0 6px;
  color: #bdc4c1;
  font-size: 15px;
}

.empty-state p {
  max-width: 340px;
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.detail-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.detail-head h2 {
  margin: 8px 0;
  font-size: clamp(25px, 3vw, 39px);
  letter-spacing: -0.05em;
}

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

.detail-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 7px;
}

.score-card {
  min-width: 116px;
  padding: 14px;
  border: 1px solid rgba(255, 107, 69, 0.25);
  border-radius: 13px;
  text-align: center;
  background: rgba(255, 107, 69, 0.07);
}

.score-card strong {
  display: block;
  color: var(--coral-bright);
  font-size: 34px;
  letter-spacing: -0.06em;
}

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

.video-strip {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  display: grid;
  grid-template-columns: minmax(220px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  background: #0e1211;
}

.video-strip video {
  width: 100%;
  max-height: 230px;
  border-radius: 9px;
  background: #050606;
}

.video-strip h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.video-strip p:not(.eyebrow) {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
}

.result-tabs {
  margin: 18px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 16px;
  overflow-x: auto;
}

.result-tabs button {
  padding: 7px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 10px;
}

.result-tabs button.active {
  color: var(--text);
  border-color: var(--coral);
}

.result-pane {
  display: none;
}

.result-pane.active {
  display: block;
}

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

.insight-card {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #101514;
}

.insight-card.wide {
  grid-column: 1 / -1;
}

.insight-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--coral-bright);
  font: 700 9px ui-monospace, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.insight-card p {
  margin: 0;
  color: #bec5c2;
  font-size: 11px;
  line-height: 1.7;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #aeb7b3;
  background: #181e1c;
  font-size: 9px;
}

.structure-flow {
  display: grid;
  gap: 10px;
}

.structure-beat {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  background: #101514;
}

.beat-number {
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #161814;
  background: var(--lime);
  font: 850 12px ui-monospace, monospace;
}

.structure-beat h4 {
  margin: 0 0 6px;
  font-size: 12px;
}

.structure-beat p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.structure-beat > small {
  color: var(--coral-bright);
  font-size: 9px;
}

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

.prompt-card {
  position: relative;
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #101514;
}

.prompt-card h4 {
  margin: 0 0 12px;
  text-transform: capitalize;
  font-size: 12px;
}

.prompt-card p {
  margin: 0;
  color: #a7b0ac;
  font-size: 10px;
  line-height: 1.7;
}

.prompt-card button {
  position: absolute;
  right: 11px;
  top: 11px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-segment {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 13px;
  background: #101514;
}

.frame-thumb {
  width: 90px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #202624;
}

.frame-placeholder {
  width: 90px;
  height: 72px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #58625e;
  font: 700 9px ui-monospace, monospace;
}

.timeline-segment h4 {
  margin: 0 0 7px;
  font-size: 11px;
}

.timecode {
  padding: 0;
  border: 0;
  color: var(--coral-bright);
  background: transparent;
  cursor: pointer;
  font: 700 10px ui-monospace, monospace;
}

.timeline-segment p {
  margin: 0 0 8px;
  color: #aeb6b3;
  font-size: 10px;
  line-height: 1.55;
}

.segment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #68736e;
  font-size: 8px;
}

.segment-prompts {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 9px;
}

.segment-prompts summary {
  cursor: pointer;
  color: #8e9994;
}

.segment-prompts p {
  margin: 8px 0 0;
  font-size: 9px;
}

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

.transcript-list button {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  color: #b7bfbb;
  background: #101514;
  cursor: pointer;
  text-align: left;
}

.transcript-list button:hover {
  border-color: rgba(255, 107, 69, 0.4);
}

.transcript-list strong {
  color: var(--coral-bright);
  font: 700 9px ui-monospace, monospace;
}

.transcript-list span {
  font-size: 10px;
  line-height: 1.55;
}

.matrix-table td {
  vertical-align: top;
  line-height: 1.55;
}

.core-points {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.core-point {
  padding: 12px;
  border-left: 3px solid var(--lime);
  border-radius: 4px 10px 10px 4px;
  color: #bcc4c0;
  background: #101514;
  font-size: 10px;
}

.compare-empty {
  padding: 38px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  text-align: center;
}

.compare-empty h3 {
  margin: 0 0 8px;
}

.compare-empty p {
  color: var(--muted);
  font-size: 10px;
}

.compare-actions {
  max-width: 760px;
  margin: 0 auto 16px;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 100px 110px auto;
  align-items: end;
  gap: 8px;
}

.compare-empty .compare-actions {
  margin-top: 18px;
  margin-bottom: 0;
}

.compare-actions label {
  text-align: left;
}

.compare-actions .button {
  min-height: 39px;
}

.compare-progress {
  grid-column: 1 / -1;
  padding: 9px 11px;
  border: 1px solid rgba(185, 255, 82, 0.16);
  border-radius: 8px;
  color: #aab6af;
  background: rgba(185, 255, 82, 0.04);
  font-size: 9px;
  line-height: 1.5;
  text-align: left;
}

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

.script-workspace {
  min-width: 0;
}

.script-candidate-tabs {
  margin: 16px 0 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
}

.script-candidate-tabs button {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: #9da7a2;
  background: #101514;
  cursor: pointer;
  text-align: left;
}

.script-candidate-tabs button:hover,
.script-candidate-tabs button.active {
  border-color: rgba(255, 107, 69, 0.38);
  background: rgba(255, 107, 69, 0.065);
}

.script-candidate-tabs button > span {
  color: var(--coral-bright);
  font: 800 9px ui-monospace, monospace;
}

.script-candidate-tabs button div {
  min-width: 0;
}

.script-candidate-tabs strong,
.script-candidate-tabs small {
  display: block;
}

.script-candidate-tabs strong {
  overflow: hidden;
  color: #d6dcd8;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-candidate-tabs small {
  margin-top: 4px;
  overflow: hidden;
  color: #69746f;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-candidate-tabs b {
  color: var(--lime);
  font: 700 9px ui-monospace, monospace;
}

.script-card {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  overflow: hidden;
  background: #101514;
}

.script-head {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.script-head h3 {
  margin: 0;
  font-size: 17px;
}

.script-head p {
  margin: 6px 0 0;
  color: var(--coral-bright);
  font-size: 10px;
}

.script-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.script-score {
  color: var(--lime);
  font: 800 15px ui-monospace, monospace;
}

.script-body {
  padding: 0 18px 18px;
}

.script-primary-point {
  margin-bottom: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(185, 255, 82, 0.18);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(185, 255, 82, 0.045);
}

.script-primary-point span {
  flex: none;
  color: var(--lime);
  font: 700 9px ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.script-primary-point strong {
  color: #d7dcd9;
  font-size: 12px;
}

.script-hook {
  padding: 12px;
  border-left: 3px solid var(--coral);
  color: #d7dcd9;
  background: #171d1b;
  font-size: 11px;
  line-height: 1.6;
}

.script-body > p {
  color: #aeb6b3;
  font-size: 10px;
  line-height: 1.8;
  white-space: pre-wrap;
}

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

.script-field {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #151a19;
}

.script-field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--coral-bright);
  font-size: 9px;
  font-weight: 700;
}

.script-field > p {
  margin: 0;
  color: #b9c0bd;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.script-field.narration {
  grid-column: 1 / -1;
}

.script-field.hook {
  border-left: 3px solid var(--coral);
}

.structured-storyboard > h4 {
  margin: 16px 0 10px;
  font-size: 11px;
}

.storyboard-shot-card {
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  overflow: hidden;
}

.storyboard-shot-card > header {
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  background: #19201e;
  font-size: 9px;
}

.storyboard-shot-card > header span {
  color: var(--coral-bright);
}

.storyboard-fields {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.storyboard {
  margin-top: 11px;
  display: grid;
  gap: 5px;
}

.storyboard-row {
  padding: 10px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 10px;
  color: #9ea7a3;
  font-size: 9px;
}

.storyboard-row strong {
  color: var(--coral-bright);
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(330px, 0.55fr);
  gap: 16px;
}

.product-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.product-card {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-card h3 {
  margin: 0;
  font-size: 15px;
}

.product-card .sku {
  margin: 5px 0 14px;
  color: var(--muted);
  font: 9px ui-monospace, monospace;
}

.product-card h4 {
  margin: 13px 0 7px;
  color: #74807a;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-card ul {
  margin: 0;
  padding-left: 16px;
  color: #b1b9b5;
  font-size: 10px;
  line-height: 1.65;
}

.storyboard-create-panel {
  margin-bottom: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1.2fr) minmax(210px, 1.2fr) auto;
  align-items: end;
  gap: 14px;
}

.storyboard-create-panel h3 {
  margin: 4px 0 0;
}

.storyboard-create-panel label,
.storyboard-model-panel label,
.shot-edit-grid label,
.negative-prompt {
  display: grid;
  gap: 7px;
}

.storyboard-create-panel label > span,
.storyboard-model-panel label > span,
.model-field > span,
.shot-edit-grid label > span,
.negative-prompt > span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.storyboard-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.storyboard-project-list {
  position: sticky;
  top: 105px;
  padding: 9px;
  display: grid;
  gap: 5px;
  max-height: calc(100vh - 130px);
  overflow: auto;
}

.storyboard-project-item {
  width: 100%;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.storyboard-project-item strong,
.storyboard-project-item small {
  display: block;
}

.storyboard-project-item strong {
  font-size: 11px;
}

.storyboard-project-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.storyboard-project-item:hover,
.storyboard-project-item.active {
  border-color: var(--line);
  background: var(--panel-soft);
}

.storyboard-project-item.active {
  box-shadow: inset 3px 0 var(--coral);
}

.storyboard-workspace {
  min-width: 0;
  padding: 22px;
}

.storyboard-workspace-head,
.storyboard-shot-head,
.prompt-block-head,
.storyboard-final-panel,
.storyboard-run-panel > header,
.shot-reference-block > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.storyboard-workspace-head h2 {
  margin: 5px 0 7px;
}

.storyboard-workspace-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.storyboard-alert {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 100, 116, 0.38);
  border-radius: 10px;
  color: #ffc3ca;
  background: rgba(255, 100, 116, 0.08);
  font-size: 10px;
  line-height: 1.55;
}

.storyboard-model-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #101514;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  align-items: end;
  gap: 10px;
}

.model-field {
  display: grid;
  gap: 7px;
}

.storyboard-model-panel select {
  min-width: 0;
}

.storyboard-template-panel {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #101514;
}

.storyboard-template-panel > summary {
  padding: 14px;
  cursor: pointer;
  color: #c7d0cc;
  font-size: 11px;
}

.template-grid {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.skill-list {
  padding: 0 14px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-list span {
  padding: 6px 8px;
  border: 1px solid #32433e;
  border-radius: 999px;
  color: #9ec9bf;
  background: rgba(111, 225, 212, 0.05);
  font-size: 8px;
}

.storyboard-template-panel > p {
  padding: 0 14px 14px;
  margin: 0;
  font-size: 9px;
}

.storyboard-shot-stack {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

.storyboard-shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0f1413;
}

.storyboard-shot-head {
  padding: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(255, 107, 69, 0.08), transparent 44%),
    #131817;
}

.shot-index {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #543629;
  border-radius: 11px;
  color: var(--coral);
  font: 700 12px ui-monospace, monospace;
}

.storyboard-shot-head > div:nth-child(2) {
  margin-right: auto;
}

.storyboard-shot-head h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.storyboard-shot-head p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.shot-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.shot-statuses span {
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #1b2220;
  font-size: 8px;
}

.shot-statuses .completed,
.shot-statuses .ready {
  color: var(--lime);
  background: rgba(198, 243, 91, 0.08);
}

.shot-statuses .running,
.shot-statuses .queued {
  color: var(--cyan);
  background: rgba(111, 225, 212, 0.08);
}

.shot-statuses .failed {
  color: var(--danger);
}

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

.shot-edit-grid .wide {
  grid-column: 1 / -1;
}

.shot-prompt-block,
.shot-reference-block {
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #141a18;
}

.prompt-block-head {
  margin-bottom: 10px;
  align-items: center;
}

.prompt-block-head > div span,
.prompt-block-head > div strong {
  display: block;
}

.prompt-block-head > div span,
.shot-reference-block > header span,
.shot-result > span {
  color: #78847e;
  font: 8px ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.prompt-block-head > div strong {
  margin-top: 3px;
  color: #c2cbc7;
  font-size: 9px;
}

.shot-prompt-block > textarea,
.negative-prompt textarea {
  width: 100%;
  line-height: 1.65;
}

.prompt-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.shot-reference-block > header small {
  color: var(--muted);
  font-size: 8px;
}

.storyboard-assets {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.storyboard-asset {
  min-width: 0;
  padding: 7px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #101513;
}

.storyboard-asset img,
.asset-file {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
}

.asset-file {
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: #1b2522;
  font-size: 7px;
}

.storyboard-asset strong,
.storyboard-asset small {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyboard-asset strong {
  font-size: 9px;
}

.storyboard-asset small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.icon-button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--danger);
  background: rgba(255, 100, 116, 0.09);
}

.asset-attach-toggle {
  width: 24px;
  height: 24px;
  border: 1px solid #3a4641;
  border-radius: 7px;
  color: #69736f;
  background: #151a18;
  cursor: pointer;
}

.asset-attach-toggle.enabled {
  border-color: rgba(127, 226, 177, 0.38);
  color: var(--lime);
  background: rgba(127, 226, 177, 0.08);
}

.asset-upload-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.continuity-option {
  margin: 12px 0 0;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  background: #121816;
  cursor: pointer;
}

.continuity-option.disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.continuity-option input {
  margin: 2px 0 0;
  accent-color: var(--lime);
}

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

.continuity-option strong {
  font-size: 9px;
}

.continuity-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.continuity-prompt {
  margin-top: 8px;
  padding: 9px 10px;
  border-left: 2px solid var(--lime);
  color: #9da8a3;
  background: rgba(127, 226, 177, 0.05);
  font-size: 8px;
  line-height: 1.55;
}

.asset-upload-row input {
  flex: 1;
  min-width: 0;
  padding: 8px;
}

.shot-results {
  margin: 0 16px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shot-result {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.shot-result img,
.shot-result video,
.result-placeholder {
  width: 100%;
  aspect-ratio: 9 / 12;
  max-height: 360px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #090d0c;
  object-fit: contain;
}

.result-placeholder {
  display: grid;
  place-items: center;
  padding: 20px;
  color: #55605b;
  font-size: 9px;
  text-align: center;
}

.error-copy {
  margin: 0;
  color: #ff9aa5;
  font-size: 9px;
  line-height: 1.5;
}

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

.shortcut-row select {
  min-width: 0;
}

.negative-prompt {
  margin-top: 10px;
}

.storyboard-final-panel,
.storyboard-run-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #121716;
}

.storyboard-final-panel {
  align-items: center;
}

.storyboard-final-panel h3,
.storyboard-run-panel h3 {
  margin: 4px 0;
}

.storyboard-final-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.storyboard-final-panel video {
  width: min(220px, 35%);
  max-height: 180px;
  border-radius: 10px;
  background: #080b0a;
}

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

.storyboard-run {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0d1211;
}

.storyboard-run.failed {
  border-color: rgba(255, 100, 116, 0.35);
}

.storyboard-run.running {
  border-color: rgba(111, 225, 212, 0.35);
}

.storyboard-run summary {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: #b5bfba;
  font-size: 9px;
}

.storyboard-run > p {
  margin: 0;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 9px;
}

.storyboard-run pre {
  max-height: 220px;
  margin: 0 10px 10px;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  color: #9fb0a9;
  background: #080b0a;
  font: 8px/1.55 ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.storyboard-run .run-error {
  color: #ff9aa5;
}

.storyboard-run .button {
  margin: 0 10px 10px;
}

#toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #d6dbd8;
  background: #1d2422;
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 180ms ease;
}

.toast.error {
  border-color: rgba(255, 100, 116, 0.45);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1100px) {
  .hero-card {
    grid-template-columns: 1fr 220px;
  }

  .signal-visual {
    transform: scale(0.84);
  }

  .run-config {
    grid-template-columns: repeat(2, 1fr);
  }

  .run-config label:nth-last-child(-n + 1) {
    grid-column: 1 / -1;
  }

  .storyboard-create-panel {
    grid-template-columns: 1fr 1fr;
  }

  .storyboard-model-panel {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar: 76px;
  }

  .sidebar {
    padding-inline: 11px;
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .brand > span:last-child,
  .nav-item:not(.active)::after,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    font-size: 10px;
  }

  .sidebar-foot > div:last-child {
    display: none;
  }

  .sidebar-foot {
    justify-content: center;
  }

  .hero-grid,
  .two-column,
  .product-layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .signal-visual {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analysis-layout {
    grid-template-columns: 1fr;
  }

  .batch-builder-grid,
  .storyboard-fields {
    grid-template-columns: 1fr;
  }

  .batch-library-layout {
    grid-template-columns: 1fr;
  }

  .batch-history {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .queue-manager-grid {
    grid-template-columns: 1fr;
  }

  .analysis-list {
    position: static;
    max-height: 280px;
    overflow-y: auto;
  }

  .storyboard-layout {
    grid-template-columns: 1fr;
  }

  .storyboard-project-list {
    position: static;
    max-height: 230px;
  }

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

@media (max-width: 680px) {
  :root {
    --sidebar: 0px;
  }

  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: 64px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    flex-direction: row;
  }

  .brand,
  .sidebar-foot {
    display: none;
  }

  .main-nav {
    width: 100%;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
  }

  .nav-item {
    height: 46px;
    padding: 0;
  }

  .main {
    margin: 0;
    padding: 0 16px 90px;
  }

  .topbar {
    min-height: 92px;
  }

  .topbar-actions .mode-pill {
    display: none;
  }

  .topbar-actions .user-pill,
  #logout-button {
    display: none;
  }

  .script-summary-grid,
  .batch-controls {
    grid-template-columns: 1fr;
  }

  .analysis-modebar button {
    justify-content: center;
  }

  .analysis-modebar small {
    display: none;
  }

  .batch-result-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .script-candidate-tabs {
    grid-template-columns: 1fr;
  }

  .batch-controls > * {
    grid-column: 1 !important;
  }

  .hero-card {
    padding: 27px 21px;
  }

  .hero-copy h2 {
    font-size: 42px;
  }

  .metric-grid,
  .ingest-grid,
  .breakdown-grid,
  .prompt-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .section-intro,
  .section-intro.align-end {
    display: block;
  }

  .section-intro > p {
    margin-top: 13px;
  }

  .run-config {
    margin-top: 18px;
    grid-template-columns: 1fr;
  }

  .run-config label:last-child {
    grid-column: auto;
  }

  .compare-actions {
    grid-template-columns: 1fr 1fr;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .detail-head {
    flex-direction: column;
  }

  .video-strip {
    grid-template-columns: 1fr;
  }

  .timeline-segment {
    grid-template-columns: 1fr;
  }

  .storyboard-create-panel,
  .storyboard-model-panel,
  .shot-edit-grid,
  .shot-results,
  .storyboard-assets {
    grid-template-columns: 1fr;
  }

  .shot-edit-grid .wide {
    grid-column: auto;
  }

  .storyboard-workspace {
    padding: 14px;
  }

  .storyboard-workspace-head,
  .storyboard-final-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .storyboard-final-panel video {
    width: 100%;
  }
}

/* Node storyboard workspace */
.view.active.storyboard-view {
  min-height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
}

.storyboard-intro {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.storyboard-commandbar {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  min-height: 60px;
  margin-bottom: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.storyboard-project-switcher {
  min-width: min(440px, 48vw);
}

.storyboard-project-switcher label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storyboard-project-switcher label > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.storyboard-project-switcher select {
  width: 100%;
  min-width: 0;
  border-color: transparent;
  background: #0d1211;
  font-weight: 650;
}

.storyboard-command-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.canvas-hint {
  color: #5f6b66;
  font-size: 9px;
  white-space: nowrap;
}

.storyboard-create-menu {
  position: relative;
}

.storyboard-create-menu > summary {
  list-style: none;
}

.storyboard-create-menu > summary::-webkit-details-marker {
  display: none;
}

.storyboard-create-menu[open] > summary {
  color: #121615;
  background: var(--coral-bright);
}

.storyboard-create-menu .storyboard-create-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 12px);
  right: 0;
  width: min(760px, calc(100vw - var(--sidebar) - 68px));
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #151b19;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.storyboard-create-menu .storyboard-create-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 34px;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #151b19;
  transform: rotate(45deg);
}

.storyboard-workspace {
  min-height: 620px;
  height: calc(100vh - 280px);
  flex: 1 1 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #0c100f;
}

.storyboard-flow-toolbar {
  height: 72px;
  padding: 12px 15px 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: rgba(18, 23, 22, 0.96);
}

.storyboard-flow-toolbar h2 {
  margin: 3px 0 4px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storyboard-flow-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.flow-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.flow-toolbar-actions #storyboard-zoom-label {
  width: 48px;
  color: #9ba7a2;
  font: 9px ui-monospace, monospace;
  text-align: center;
}

.flow-control {
  border: 1px solid var(--line-soft);
  background: #0d1211;
}

.flow-control:hover {
  color: var(--text);
  background: #202825;
}

.storyboard-flow-shell {
  height: calc(100% - 72px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
}

.storyboard-flow-canvas {
  position: relative;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background-color: #0a0e0d;
  background-image:
    radial-gradient(circle, rgba(130, 149, 142, 0.22) 1px, transparent 1.2px),
    linear-gradient(rgba(72, 86, 81, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 86, 81, 0.06) 1px, transparent 1px);
  background-position: 0 0;
  background-size:
    24px 24px,
    120px 120px,
    120px 120px;
}

.storyboard-flow-canvas.panning {
  cursor: grabbing;
}

.storyboard-flow-viewport {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: 0 0;
}

.storyboard-flow-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.storyboard-flow-edge {
  fill: none;
  stroke: #40504b;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.storyboard-flow-node {
  position: absolute;
  width: 250px;
  height: 154px;
  overflow: visible;
  border: 1px solid #303b37;
  border-radius: 10px;
  outline: 0;
  color: #dbe1de;
  background: #141a18;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  cursor: default;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.storyboard-flow-node:hover {
  border-color: #53635d;
}

.storyboard-flow-node.selected {
  z-index: 3;
  border-color: var(--coral);
  box-shadow:
    0 0 0 2px rgba(255, 107, 69, 0.16),
    0 18px 40px rgba(0, 0, 0, 0.42);
}

.storyboard-flow-node.dragging {
  z-index: 5;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.52);
}

.flow-node-head {
  height: 43px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 9px 9px 0 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  background: #1b2220;
  cursor: move;
  user-select: none;
}

.type-source .flow-node-head {
  box-shadow: inset 3px 0 var(--cyan);
}

.type-shot .flow-node-head {
  box-shadow: inset 3px 0 #b991ff;
}

.type-image .flow-node-head {
  box-shadow: inset 3px 0 var(--coral);
}

.type-video .flow-node-head {
  box-shadow: inset 3px 0 #65aaff;
}

.type-final .flow-node-head {
  box-shadow: inset 3px 0 var(--lime);
}

.flow-node-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #38443f;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #9eaaa5;
  background: #111614;
  font: 10px ui-monospace, monospace;
}

.flow-node-head strong,
.flow-node-head small {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-node-head strong {
  font-size: 10px;
}

.flow-node-head small {
  margin-top: 2px;
  color: #77837e;
  font-size: 7px;
}

.flow-node-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #59635f;
}

.flow-node-status.ready,
.flow-node-status.completed {
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(198, 243, 91, 0.08);
}

.flow-node-status.running,
.flow-node-status.queued {
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(111, 225, 212, 0.08);
}

.flow-node-status.failed {
  background: var(--danger);
}

.flow-node-body {
  height: 109px;
  padding: 10px;
  overflow: hidden;
}

.flow-node-body > p {
  height: 42px;
  margin: 0;
  overflow: hidden;
  color: #aab4af;
  font-size: 8px;
  line-height: 1.7;
}

.flow-node-body > img {
  width: 100%;
  height: 89px;
  border-radius: 6px;
  object-fit: cover;
}

.flow-node-metric {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  color: #68736e;
  font-size: 7px;
}

.flow-node-metric strong {
  color: #aeb8b3;
  font-size: 8px;
}

.flow-node-placeholder {
  height: 89px;
  border: 1px dashed #303a36;
  border-radius: 6px;
  display: grid;
  place-content: center;
  gap: 7px;
  color: #53605b;
  background: #0f1412;
  text-align: center;
}

.flow-node-placeholder span {
  font: 700 11px ui-monospace, monospace;
  letter-spacing: 0.1em;
}

.flow-node-placeholder small {
  font-size: 7px;
}

.flow-node-placeholder.complete {
  color: var(--lime);
  border-color: rgba(198, 243, 91, 0.28);
  background: rgba(198, 243, 91, 0.035);
}

.flow-port {
  position: absolute;
  z-index: 2;
  top: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border: 2px solid #829089;
  border-radius: 50%;
  background: #111614;
}

.flow-port.input {
  left: -7px;
}

.flow-port.output {
  right: -7px;
}

.type-source .flow-port.input,
.type-final .flow-port.output {
  display: none;
}

.flow-canvas-watermark {
  position: absolute;
  left: 18px;
  bottom: 14px;
  color: rgba(136, 151, 145, 0.25);
  font: 8px ui-monospace, monospace;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.storyboard-node-inspector {
  min-width: 0;
  overflow: auto;
  border-left: 1px solid var(--line-soft);
  background: #111615;
  scrollbar-color: #35413d transparent;
}

.node-inspector-head {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 82px;
  padding: 15px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: rgba(17, 22, 21, 0.96);
  backdrop-filter: blur(12px);
}

.node-inspector-head h3 {
  margin: 4px 0;
  font-size: 14px;
}

.node-inspector-head p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.node-type-badge {
  padding: 5px 7px;
  border: 1px solid #39443f;
  border-radius: 5px;
  color: #81908a;
  font: 7px ui-monospace, monospace;
}

.node-type-badge.type-image {
  color: var(--coral);
}

.node-type-badge.type-video {
  color: #65aaff;
}

.node-type-badge.type-final {
  color: var(--lime);
}

.inspector-section {
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #151b19;
}

.inspector-section h4 {
  margin: 0 0 12px;
  color: #bac3bf;
  font-size: 10px;
}

.inspector-section > textarea,
.inspector-shot-card textarea {
  width: 100%;
  line-height: 1.55;
  resize: vertical;
}

.inspector-status-line {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7f8b85;
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inspector-status-line strong {
  color: #cad2ce;
}

.inspector-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.compact-form {
  display: grid;
  gap: 9px;
}

.compact-form label,
.inspector-details label {
  display: grid;
  gap: 6px;
  color: #7f8b85;
  font-size: 8px;
}

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

.inspector-details {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 0;
}

.inspector-details summary,
.inspector-runs > summary {
  cursor: pointer;
  color: #aab4af;
  font-size: 9px;
}

.inspector-details[open] summary {
  margin-bottom: 10px;
}

.inspector-details label + label {
  margin-top: 10px;
}

.inspector-shot-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.inspector-shot-card .shot-edit-grid {
  padding: 12px;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.inspector-shot-card > .inspector-actions {
  margin: 0 12px 12px;
}

.inspector-shot-card .shot-reference-block {
  margin: 12px;
}

.inspector-shot-card .storyboard-assets {
  grid-template-columns: 1fr;
}

.inspector-preview {
  margin: 12px;
  display: grid;
  gap: 9px;
}

.inspector-preview img,
.inspector-preview video,
.inspector-preview .result-placeholder {
  width: 100%;
  max-height: 410px;
  aspect-ratio: 9 / 12;
  border-radius: 9px;
  object-fit: contain;
  background: #090d0c;
}

.inspector-copy {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.inspector-runs {
  display: block;
}

.inspector-runs[open] > summary {
  margin-bottom: 9px;
}

@media (max-width: 1180px) {
  .storyboard-flow-shell {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .canvas-hint {
    display: none;
  }
}

@media (max-width: 900px) {
  .storyboard-intro {
    display: none;
  }

  .view.active.storyboard-view {
    min-height: calc(100vh - 116px);
    padding-top: 16px;
  }

  .storyboard-workspace {
    height: calc(100vh - 210px);
  }

  .storyboard-create-menu .storyboard-create-panel {
    width: min(680px, calc(100vw - var(--sidebar) - 32px));
    grid-template-columns: 1fr 1fr;
  }

  .storyboard-flow-shell {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}

@media (max-width: 680px) {
  .view.active.storyboard-view {
    min-height: auto;
  }

  .storyboard-commandbar {
    align-items: stretch;
    flex-direction: column;
  }

  .storyboard-project-switcher {
    min-width: 0;
  }

  .storyboard-command-actions {
    justify-content: flex-end;
  }

  .storyboard-create-menu .storyboard-create-panel {
    position: fixed;
    inset: 96px 16px auto;
    width: auto;
    grid-template-columns: 1fr;
  }

  .storyboard-workspace {
    height: auto;
    min-height: 0;
    padding: 0;
  }

  .storyboard-flow-toolbar {
    height: auto;
    min-height: 72px;
    align-items: flex-start;
  }

  .storyboard-flow-toolbar h2 {
    max-width: 180px;
  }

  .storyboard-flow-shell {
    height: auto;
    grid-template-columns: 1fr;
  }

  .storyboard-flow-canvas {
    height: 500px;
    border-bottom: 1px solid var(--line-soft);
  }

  .storyboard-node-inspector {
    max-height: none;
    border-left: 0;
  }

  .inspector-shot-card .shot-edit-grid {
    grid-template-columns: 1fr;
  }

  .inspector-shot-card .shot-edit-grid .wide {
    grid-column: auto;
  }
}

.storyboard-node-add {
  position: relative;
}

.storyboard-node-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  background: #171d1b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.storyboard-node-menu button {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #d5dcd8;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.storyboard-node-menu button:hover {
  background: #222a27;
}

.storyboard-node-menu button > span {
  width: 31px;
  height: 31px;
  border: 1px solid #3a4641;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #b991ff;
  background: #101513;
  font: 11px ui-monospace, monospace;
}

.storyboard-node-menu button > span.type-image {
  color: var(--coral);
}

.storyboard-node-menu button > span.type-note {
  color: var(--cyan);
}

.storyboard-node-menu strong,
.storyboard-node-menu small {
  display: block;
}

.storyboard-node-menu strong {
  font-size: 10px;
}

.storyboard-node-menu small {
  margin-top: 4px;
  color: #77827d;
  font-size: 8px;
  line-height: 1.4;
}

.type-note .flow-port {
  display: none;
}

.type-note .flow-node-head {
  box-shadow: inset 3px 0 #b991ff;
}

.type-note.note-cyan .flow-node-head {
  box-shadow: inset 3px 0 var(--cyan);
}

.type-note.note-orange .flow-node-head {
  box-shadow: inset 3px 0 var(--coral);
}

.type-note.note-lime .flow-node-head {
  box-shadow: inset 3px 0 var(--lime);
}

.note-editor {
  display: grid;
  gap: 11px;
}

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

.note-editor label > span {
  color: #7f8b85;
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.storyboard-settings-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
}

.storyboard-settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 6, 5, 0.64);
  backdrop-filter: blur(3px);
  cursor: default;
}

.storyboard-settings-drawer {
  position: absolute;
  z-index: 1;
  inset: 0 0 0 auto;
  width: min(500px, calc(100vw - 40px));
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #111615;
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.46);
  animation: settings-enter 170ms ease;
}

@keyframes settings-enter {
  from {
    transform: translateX(22px);
    opacity: 0;
  }
}

.storyboard-settings-drawer > header {
  min-height: 88px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.storyboard-settings-drawer > header h3 {
  margin: 4px 0;
  font-size: 17px;
}

.storyboard-settings-drawer > header p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.settings-scroll {
  min-height: 0;
  padding: 14px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.settings-section {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  display: grid;
  gap: 10px;
  background: #171d1b;
}

.settings-section h4 {
  margin: 0 0 2px;
  font-size: 11px;
}

.settings-section > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.settings-section label {
  display: grid;
  gap: 6px;
}

.settings-section label > span {
  color: #7f8b85;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-section textarea {
  width: 100%;
  line-height: 1.55;
  resize: vertical;
}

.settings-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.settings-section .skill-list {
  padding: 0;
}

.global-assets {
  grid-template-columns: 1fr;
}

.libtv-usage-total {
  padding: 10px;
  border: 1px solid rgba(127, 226, 177, 0.24);
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  background: rgba(127, 226, 177, 0.04);
  font-size: 8px;
}

.libtv-usage-total strong {
  color: var(--lime);
  font-size: 10px;
}

.storyboard-settings-drawer > footer {
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #151a18;
}

@media (max-width: 900px) {
  .flow-toolbar-actions > .button.secondary {
    font-size: 0;
  }

  .flow-toolbar-actions > .button.secondary::first-letter {
    font-size: 10px;
  }
}

@media (max-width: 680px) {
  .storyboard-node-menu {
    position: fixed;
    top: 152px;
    right: 16px;
  }

  .storyboard-settings-drawer {
    width: 100%;
  }

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