﻿* { box-sizing: border-box; }

:root {
  --bg: #090b10;
  --card: #101522;
  --card-2: #0c111d;
  --border: #27314a;
  --text: #f4f7ff;
  --muted: #a8b6d9;
  --accent-1: #fd1d1d;
  --accent-2: #c13584;
  --accent-3: #833ab4;
  --accent-4: #405de6;
  --brand-kortex: #17c8ad;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 90% -10%, rgba(64, 93, 230, 0.18), transparent 60%),
    radial-gradient(1100px 620px at -10% -20%, rgba(193, 53, 132, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 16px 28px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 14px;
}

h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  position: fixed;
  top: 12px;
  right: max(12px, calc((100vw - 980px) / 2 + 12px));
  z-index: 60;
  border-radius: 999px;
  border: 1px solid rgba(23, 200, 173, 0.55);
  background: linear-gradient(90deg, #111728, #111a2b);
  padding: 7px 12px;
  font-size: 12px;
  color: #dfe6ff;
  box-shadow: 0 0 0 1px rgba(23, 200, 173, 0.12) inset;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
  padding: 6px 0 8px;
  background: transparent;
  backdrop-filter: none;
}

.kpi-chip {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(64, 93, 230, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 21, 34, 0.96), rgba(12, 17, 29, 0.96));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.kpi-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi-chip b {
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.kpi-chip.attention {
  border-color: rgba(253, 29, 29, 0.55);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(253, 29, 29, 0.14) inset;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.autopub-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.control-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.control-label {
  color: #c3d2f4;
  font-size: 12px;
  font-weight: 700;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(54px, 1fr);
  gap: 4px;
  width: min(100%, 360px);
  padding: 4px;
  border: 1px solid rgba(64, 93, 230, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(253, 29, 29, 0.12), rgba(193, 53, 132, 0.10), rgba(23, 200, 173, 0.10)),
    #090f1d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.segmented button {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: #c8d4f2;
  box-shadow: none;
}

.segmented button.active {
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2) 42%, var(--accent-3) 72%, var(--brand-kortex));
  box-shadow:
    0 8px 22px rgba(193, 53, 132, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.mode-control {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  border-radius: 20px;
  padding: 6px;
}

.subtitle-control {
  width: min(100%, 440px);
}

.template-control {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  border-radius: 20px;
  padding: 6px;
}

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

.template-control button {
  min-height: 52px;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.2;
}

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

.section-head h3 {
  margin: 0;
}

.section-head.subhead {
  margin: 0 0 8px;
}

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

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

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

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(23, 200, 173, 0.08) inset;
}

.card canvas {
  width: 100% !important;
  height: 240px !important;
}

.kpi p {
  font-size: 32px;
  margin: 6px 0 0;
  font-weight: 700;
  color: #f7f9ff;
}

h3 {
  margin: 0 0 12px;
  font-size: 19px;
  letter-spacing: 0;
}

button {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2) 46%, var(--accent-3) 76%, var(--brand-kortex));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(23, 200, 173, 0.18);
}

button:hover {
  filter: brightness(1.08);
}

.ghost-btn {
  background: #0d1528;
  border: 1px solid #34507a;
  border-radius: 999px;
  color: #dbe6ff;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.ghost-btn:hover {
  border-color: #4f6ea1;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

input,
textarea,
select {
  background: #0b1120;
  color: #f0f5ff;
  border: 1px solid #2e3b5f;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
}

select {
  width: auto;
  min-height: 40px;
  border-radius: 999px;
  padding: 8px 34px 8px 12px;
}

.compact-input {
  width: 112px;
  min-height: 40px;
  border-radius: 999px;
}

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

label {
  display: block;
  margin-bottom: 6px;
  color: #c3d2f4;
  font-size: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  margin-left: 4px;
}

.toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.toggle span {
  color: #dbe6ff;
  font-size: 14px;
}

.switch-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(64, 93, 230, 0.34);
  border-radius: 999px;
  background: #0b1120;
  cursor: pointer;
}

.switch-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-card b {
  display: block;
  color: #f2f6ff;
  font-size: 13px;
  line-height: 1.1;
}

.switch-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.switch-track {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #182238;
  border: 1px solid #31466d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dce7ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch-card input:checked + .switch-track {
  border-color: rgba(23, 200, 173, 0.7);
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3), var(--brand-kortex));
}

.switch-card input:checked + .switch-track .switch-thumb {
  transform: translateX(22px);
  background: #fff;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #27314a;
  padding-top: 10px;
  margin-top: 10px;
}

.metric span {
  color: #b2b7c6;
  font-size: 13px;
}

.metric b {
  color: #f2f6ff;
}

details summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: ">";
  color: #c1c6d4;
  margin-left: auto;
}

details[open] summary::after {
  content: "v";
}

.info-panel > summary {
  margin: -2px 0;
}

.info-panel[open] > summary {
  margin-bottom: 10px;
}

.draft-item,
.history-item {
  border: 1px solid #2e3b5f;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  background: #0b1120;
}

.hooks-library-status {
  min-height: 18px;
  margin-bottom: 2px;
}

.hooks-library-status.ok {
  color: #9ff6d8;
}

.hooks-library-status.error {
  color: #ffd1db;
}

.hooks-library-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.hook-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #2e3b5f;
  border-radius: 8px;
  background: #0b1120;
}

.hook-meta {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.hook-meta b,
.hook-copy > b,
.hook-analysis > b {
  color: #dce6ff;
}

.hook-copy p,
.hook-analysis p {
  margin: 4px 0 0;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.hook-copy p {
  color: #f4f7ff;
  font-size: 15px;
  font-weight: 700;
}

.hook-analysis p {
  color: #bdc9e6;
  font-size: 13px;
}

.hook-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #27314a;
}

.hook-source-link,
.hook-source-missing {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.hook-source-missing {
  color: var(--muted);
}

.hook-version-btn {
  flex: 0 0 auto;
}

.hook-version-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.hook-render-mode {
  min-width: 132px;
  max-width: 160px;
}

@media (max-width: 560px) {
  .hook-source-row,
  .hook-version-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hook-version-actions,
  .hook-render-mode,
  .hook-version-btn {
    width: 100%;
    max-width: none;
  }
}

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

.draft-card > summary {
  padding: 12px 14px;
  min-height: 64px;
}

.draft-card[open] > summary {
  border-bottom: 1px solid #27314a;
}

.draft-summary {
  align-items: flex-start;
}

.draft-summary-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.draft-summary-title {
  color: #cdd8f5;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.draft-summary-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-right: 18px;
}

.draft-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(64, 93, 230, 0.34);
  background: rgba(15, 22, 39, 0.95);
  color: #dce6ff;
  font-size: 11px;
  font-weight: 700;
}

.draft-pill-live {
  border-color: rgba(255, 106, 0, 0.48);
  background: rgba(255, 70, 125, 0.12);
  color: #ffd7e5;
}

.draft-pill-accent {
  border-color: rgba(23, 200, 173, 0.42);
  background: rgba(23, 200, 173, 0.10);
  color: #cffff1;
}

.draft-pill-mode {
  border-color: rgba(255, 170, 52, 0.40);
  background: rgba(255, 170, 52, 0.10);
  color: #ffe9b5;
}

.draft-body {
  padding: 12px 14px 14px;
}

.draft-preview-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.draft-preview-tools.has-preview {
  grid-template-columns: minmax(0, auto) minmax(280px, 1fr);
}

.draft-preview-tools > .draft-actions {
  margin-top: 0;
}

.draft-codeword-panel {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(23, 200, 173, 0.28);
  border-radius: 8px;
  background: rgba(23, 200, 173, 0.06);
}

.draft-codeword-controls {
  display: flex;
  align-items: end;
  gap: 8px;
}

.draft-codeword-controls label {
  display: grid;
  flex: 1;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.draft-codeword-controls input {
  min-width: 0;
}

.draft-codeword-controls button {
  min-height: 40px;
}

.draft-reels-caption {
  display: grid;
  gap: 4px;
  color: #f1f5ff;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.draft-reels-caption b {
  color: #9ff6d8;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.draft-script {
  margin-top: 10px;
  color: #f1f5ff;
  line-height: 1.52;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 640px) {
  .draft-preview-tools.has-preview {
    grid-template-columns: 1fr;
  }

  .draft-codeword-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .draft-codeword-controls button {
    width: 100%;
  }
}

.value-report {
  border-color: rgba(253, 29, 29, 0.22);
}

.readiness-state {
  color: #dce7ff;
  font-size: 12px;
  font-weight: 700;
}

.readiness-state.ok {
  color: #9ff6d8;
}

.readiness-state.miss {
  color: #ffd1db;
}

.readiness-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #27314a;
  padding-top: 10px;
  margin-top: 10px;
}

.readiness-item b {
  color: #eff5ff;
  font-size: 13px;
}

.readiness-item span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.readiness-item.ok b {
  color: #cffff1;
}

.readiness-item.miss b {
  color: #ffd7e5;
}

.compact-grid {
  margin-top: 8px;
}

.metric-tile {
  min-height: 76px;
  border: 1px solid rgba(64, 93, 230, 0.34);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(18, 25, 43, 0.96), rgba(10, 17, 32, 0.96));
}

.metric-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-tile b {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  margin-left: 6px;
  box-shadow: 0 0 0 0 rgba(253, 29, 29, 0.7);
  animation: badgePulse 1.8s infinite;
}

@keyframes badgePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(253, 29, 29, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(253, 29, 29, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(253, 29, 29, 0);
  }
}

.draft-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.draft-actions .btn-publish-ready {
  background: linear-gradient(90deg, #ff6a00, #ff2f6d, #c13584, #833ab4);
  box-shadow: 0 0 0 0 rgba(255, 69, 124, 0.72);
  animation: publishPulse 1.45s infinite;
}

.content-factory-creative,
.content-factory-variant-builder {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(155, 199, 220, 0.22);
  border-radius: 14px;
  background: rgba(7, 11, 22, 0.34);
}

.content-factory-creative summary {
  cursor: pointer;
  color: #eef5ff;
  font-weight: 700;
}

.content-factory-creative summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.content-factory-creative > label,
.content-factory-variant-builder-card > label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.content-factory-concept-note {
  margin: 10px 0 0;
  color: #ffd987;
  font-size: 12px;
}

.compact-head {
  margin-bottom: 8px;
}

.compact-head h4 {
  margin: 0;
  color: #f5f7ff;
}

.content-factory-variants {
  display: grid;
  gap: 10px;
}

.content-factory-variant-builder-card,
.content-factory-variant-result {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 12px;
  background: rgba(19, 26, 51, 0.58);
}

.content-factory-variant-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f6f8ff;
}

.compact-fields {
  margin-top: 8px;
}

.content-factory-shot-plan {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  padding: 9px 10px;
  border-left: 2px solid #00e5ff;
  background: rgba(0, 229, 255, 0.055);
  color: #eaf8ff;
}

.content-factory-shot-plan small {
  color: var(--muted);
  line-height: 1.35;
}

.content-factory-plan-valid {
  color: #7ce3c0;
  font-size: 12px;
  font-weight: 700;
}

.content-factory-concept-badge,
.content-factory-authentic-badge {
  display: inline-flex;
  width: fit-content;
  margin: 7px 0;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.content-factory-concept-badge {
  color: #ffd987;
  border: 1px solid rgba(255, 194, 76, 0.48);
  background: rgba(255, 194, 76, 0.10);
}

.content-factory-authentic-badge {
  color: #bfeeff;
  border: 1px solid rgba(0, 229, 255, 0.34);
  background: rgba(0, 229, 255, 0.07);
}

.content-factory-variant-result > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.38;
}

.content-factory-shot-list {
  display: grid;
  gap: 6px;
  margin: 11px 0;
  padding-left: 20px;
  color: #dce7ff;
  font-size: 12px;
}

.content-factory-shot-list small {
  display: inline;
}

@keyframes publishPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 69, 124, 0.72);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 69, 124, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 69, 124, 0);
  }
}

pre {
  white-space: pre-wrap;
  margin: 0;
  color: #e2e4ec;
  font-family: inherit;
  line-height: 1.45;
}

a {
  color: var(--brand-kortex);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.content-factory-card {
  border-color: rgba(64, 93, 230, 0.72);
  background:
    linear-gradient(145deg, rgba(17, 24, 49, 0.98), rgba(10, 19, 31, 0.98));
}

.project-workspace-card {
  border-color: rgba(0, 229, 255, 0.48);
  background:
    radial-gradient(circle at 100% 0, rgba(131, 58, 180, 0.16), transparent 38%),
    linear-gradient(145deg, rgba(13, 24, 43, 0.98), rgba(11, 17, 31, 0.98));
}

.project-isolation-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(0, 229, 255, 0.52);
  border-radius: 999px;
  color: #a9f5ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.project-switcher-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-switcher-row select {
  width: 100%;
}

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

.project-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 10px;
  background: rgba(6, 15, 27, 0.58);
}

.project-summary b,
.project-summary small {
  display: block;
  overflow-wrap: anywhere;
}

.project-summary small {
  margin-top: 3px;
  color: var(--muted);
}

.project-context-editor {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(155, 199, 220, 0.22);
  border-radius: 12px;
  background: rgba(7, 11, 22, 0.34);
}

.project-context-editor summary {
  cursor: pointer;
  color: #eef5ff;
  font-weight: 700;
}

.project-context-editor summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.creative-workspace-card {
  border-color: rgba(193, 53, 132, 0.58);
  background:
    radial-gradient(circle at 100% 0, rgba(253, 29, 29, 0.12), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(64, 93, 230, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(22, 17, 35, 0.98), rgba(10, 18, 31, 0.98));
}

.creative-workspace-badge,
.creative-claim-badge,
.creative-proof-badge,
.creative-unit-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(193, 53, 132, 0.55);
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffd8ef;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.creative-campaign-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.creative-campaign-toolbar label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.creative-campaign-toolbar select {
  width: 100%;
}

.creative-campaign-creator,
.creative-model-registry,
.creative-preflight-panel,
.creative-timeline-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(193, 53, 132, 0.28);
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.52);
}

.creative-campaign-creator summary,
.creative-model-registry summary {
  cursor: pointer;
  color: #f7efff;
  font-weight: 700;
}

.creative-campaign-creator summary small,
.creative-model-registry summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.creative-empty-state {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed rgba(168, 182, 217, 0.36);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.creative-campaign-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.creative-campaign-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(193, 53, 132, 0.23);
  border-radius: 10px;
  background: rgba(6, 12, 24, 0.58);
}

.creative-campaign-summary b,
.creative-campaign-summary small {
  display: block;
  overflow-wrap: anywhere;
}

.creative-campaign-summary small {
  margin-top: 3px;
  color: var(--muted);
}

.creative-flow-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 12px 0;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.creative-flow-strip span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(64, 93, 230, 0.32);
  border-radius: 999px;
  color: #cdd8f7;
  font-size: 10px;
}

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

.creative-unit-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(64, 93, 230, 0.34);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(12, 17, 31, 0.94), rgba(18, 13, 28, 0.9));
}

.creative-unit-card.is-approved {
  border-color: rgba(23, 200, 173, 0.52);
  box-shadow: 0 0 0 1px rgba(23, 200, 173, 0.08) inset;
}

.creative-unit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.creative-unit-head h4 {
  margin: 0;
  font-size: 15px;
}

.creative-unit-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.creative-unit-status.approved,
.creative-proof-badge.verified {
  border-color: rgba(23, 200, 173, 0.58);
  color: #bffcf1;
}

.creative-unit-status.draft,
.creative-proof-badge.unverified {
  border-color: rgba(255, 214, 0, 0.55);
  color: #ffe979;
}

.creative-claim-badge.metaphorical {
  border-color: rgba(131, 58, 180, 0.72);
  color: #ead2ff;
}

.creative-unit-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(168, 182, 217, 0.14);
}

.creative-unit-section > b {
  display: block;
  margin-bottom: 7px;
  color: #eaf0ff;
  font-size: 12px;
}

.creative-unit-card textarea {
  min-height: 68px;
}

.creative-unit-card select {
  width: 100%;
  border-radius: 8px;
}

.creative-proof-source {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
}

.creative-source-link {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.creative-recommendations,
.creative-compiled-preview,
.creative-manual-result {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(64, 93, 230, 0.24);
  border-radius: 9px;
  background: rgba(5, 10, 20, 0.56);
}

.creative-recommendation {
  display: grid;
  gap: 3px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(64, 93, 230, 0.1);
}

.creative-recommendation small,
.creative-compiled-preview small,
.creative-manual-result small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.creative-preflight-result {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 214, 0, 0.28);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.creative-preflight-result.ready {
  border-color: rgba(23, 200, 173, 0.48);
  color: #cffff6;
}

.creative-preflight-result.blocked {
  border-color: rgba(253, 29, 29, 0.48);
  color: #ffb0b4;
}

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

.creative-compare-column {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(64, 93, 230, 0.28);
  border-radius: 10px;
  background: rgba(7, 12, 24, 0.56);
}

.creative-compare-column h5 {
  margin: 0 0 7px;
}

.creative-experiment {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid rgba(168, 182, 217, 0.18);
  border-radius: 8px;
}

.creative-experiment.approved {
  border-color: rgba(23, 200, 173, 0.52);
}

.creative-timeline-panel {
  margin-top: 14px;
}

.creative-timeline-scenes {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.creative-timeline-scene {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(64, 93, 230, 0.3);
  border-radius: 10px;
  background: rgba(5, 10, 20, 0.58);
  cursor: grab;
}

.creative-timeline-scene:active {
  cursor: grabbing;
}

.creative-timeline-scene.is-disabled {
  opacity: 0.55;
}

.creative-timeline-scene.is-dragging {
  border-color: rgba(253, 29, 29, 0.65);
}

.creative-timeline-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.creative-timeline-copy,
.creative-timeline-copy b,
.creative-timeline-copy small {
  min-width: 0;
}

.creative-timeline-copy b,
.creative-timeline-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.creative-timeline-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.creative-timeline-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.creative-timeline-actions button {
  min-width: 34px;
  padding: 6px;
}

.creative-timeline-policy {
  margin-top: 10px;
}

.creative-assembly-history {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.creative-assembly-card {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(23, 200, 173, 0.28);
  border-radius: 9px;
  background: rgba(7, 12, 24, 0.56);
}

.creative-assembly-card.failed,
.creative-assembly-card.blocked {
  border-color: rgba(253, 29, 29, 0.38);
}

.creative-assembly-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.creative-experiment small,
.creative-experiment a {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.creative-experiment small {
  color: var(--muted);
}

@media (max-width: 820px) {
  .creative-unit-grid,
  .creative-compare-grid {
    grid-template-columns: 1fr;
  }

  .creative-campaign-summary {
    grid-template-columns: 1fr 1fr;
  }

  .creative-campaign-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .creative-campaign-toolbar label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .creative-proof-source,
  .creative-campaign-summary {
    grid-template-columns: 1fr;
  }

  .creative-timeline-scene {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .creative-timeline-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .project-switcher-row {
    grid-template-columns: 1fr 1fr;
  }

  .project-switcher-row label {
    grid-column: 1 / -1;
  }

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

.content-factory-readiness {
  flex: 0 0 auto;
  border: 1px solid #4b5875;
  border-radius: 999px;
  padding: 6px 10px;
  color: #dbe6ff;
  font-size: 12px;
}

.content-factory-readiness.ready {
  border-color: rgba(23, 200, 173, 0.7);
  color: #dffff9;
}

.content-factory-readiness.limited {
  border-color: rgba(255, 214, 0, 0.72);
  color: #ffe979;
}

.content-factory-readiness.not-ready {
  border-color: rgba(253, 29, 29, 0.65);
  color: #ff9ea3;
}

.content-factory-fields {
  margin-top: 10px;
}

.content-factory-fields label {
  display: grid;
  gap: 7px;
}

.content-factory-fields select {
  width: 100%;
  border-radius: 8px;
}

.content-factory-safety,
.content-factory-paid-panel {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(23, 200, 173, 0.38);
  border-radius: 8px;
  background: rgba(8, 21, 31, 0.78);
}

.content-factory-safety span,
.content-factory-paid-panel p {
  color: var(--muted);
  font-size: 12px;
}

.content-factory-paid-panel {
  border-color: rgba(255, 214, 0, 0.38);
  background: rgba(31, 27, 8, 0.34);
}

.content-factory-confirm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  color: #f3f6ff;
  font-size: 13px;
}

.content-factory-confirm-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.content-factory-status {
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.content-factory-provider-readiness {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.content-factory-sources {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.content-factory-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(64, 93, 230, 0.28);
  border-radius: 8px;
  background: rgba(8, 13, 25, 0.72);
}

.content-factory-source span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-factory-source small {
  flex: 0 0 auto;
  color: var(--muted);
}

.content-factory-drafts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.content-factory-draft {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 150px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
}

.content-factory-draft-head {
  display: grid;
  gap: 4px;
}

.content-factory-draft-head span {
  color: var(--brand-kortex);
  font-size: 11px;
}

.content-factory-draft small,
.content-factory-draft strong {
  overflow-wrap: anywhere;
}

.content-factory-draft small {
  color: var(--muted);
}

.content-factory-draft strong {
  color: #ffe979;
  font-size: 12px;
}

.content-factory-ledger {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(64, 93, 230, 0.28);
}

.content-factory-ledger-title {
  display: grid;
  gap: 3px;
}

.content-factory-ledger-title small,
.content-factory-ledger-empty {
  color: var(--muted);
}

.content-factory-ledger-list {
  display: grid;
  gap: 7px;
}

.content-factory-ledger-entry {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(64, 93, 230, 0.28);
  border-radius: 8px;
  background: rgba(8, 13, 25, 0.56);
}

.content-factory-ledger-entry.compact {
  margin-top: 7px;
  padding: 7px;
  font-size: 11px;
}

.content-factory-ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.content-factory-ledger-head b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.content-factory-ledger-head span {
  flex: 0 0 auto;
  color: #9bc7dc;
  font-size: 11px;
}

.content-factory-ledger-entry small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.content-factory-draft-ledger {
  border-top: 1px solid rgba(64, 93, 230, 0.22);
  padding-top: 7px;
}

.content-factory-draft-ledger summary {
  cursor: pointer;
  color: #9bc7dc;
  font-size: 11px;
}

.factory-card {
  border-color: rgba(23, 200, 173, 0.55);
  background: linear-gradient(145deg, rgba(16, 31, 40, 0.98), rgba(16, 21, 34, 0.98));
}

.factory-selection-count {
  flex: 0 0 auto;
  border: 1px solid rgba(23, 200, 173, 0.55);
  border-radius: 999px;
  padding: 6px 10px;
  color: #dffff9;
  font-size: 12px;
}

.factory-upload {
  display: grid;
  gap: 7px;
  margin: 14px 0 10px;
  padding: 12px;
  border: 1px dashed rgba(168, 182, 217, 0.45);
  border-radius: 8px;
}

.factory-upload input {
  width: 100%;
}

.factory-upload small,
.factory-error {
  color: var(--muted);
}

.factory-status {
  margin-top: 10px;
}

.factory-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.factory-result-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
}

.factory-result-item > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.factory-result-item span {
  color: var(--brand-kortex);
  font-size: 12px;
}

.factory-hook-selector {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #dffff9;
}

.factory-hook-selector input {
  width: auto;
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-content {
  width: min(920px, 100%);
  background: #0d1220;
  border: 1px solid #2e3b5f;
  border-radius: 8px;
  padding: 10px;
}

.modal-close {
  margin-bottom: 8px;
}

#previewVideo {
  width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  background: #000;
}

@media (max-width: 900px) {
  .grid3,
  .grid2 {
    grid-template-columns: 1fr;
  }

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

  .template-control,
  .music-control {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 26px;
  }

  .pill {
    top: 10px;
    right: 10px;
  }

  .hook-source-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hook-version-btn {
    width: 100%;
  }

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

  .content-factory-drafts {
    grid-template-columns: 1fr;
  }

  .content-factory-source {
    align-items: flex-start;
    flex-direction: column;
  }
}

