:root {
  --bg: #09090b;
  --panel: #09090b;
  --ink: #ffffff;
  --muted: #a1a1aa;
  --line: #27272a;
  --black: #000000;
  --white: #ffffff;
  --soft: #09090b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: #09090b;
}

button {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  --sidebar-w: 240px;
  --assistant-w: 360px;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--assistant-w);
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.sidebar-closed {
  --sidebar-w: 0px;
}

.app-shell.assistant-closed {
  --assistant-w: 0px;
}

.app-shell.assistant-closed .chat-panel {
  display: none;
}

.sidebar {
  background: var(--black);
  color: var(--white);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  overflow: hidden;
}

.app-shell.sidebar-closed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.app-shell.sidebar-closed #btn-sidebar-open {
  display: flex !important;
}

.header-brand {
  display: none;
  align-items: center;
  gap: 10px;
  opacity: 0;
}

.app-shell.sidebar-closed .header-brand {
  display: flex !important;
  animation: headerBrandFadeIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes headerBrandFadeIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-toggle-btn-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
}

.sidebar-toggle-btn-close:hover {
  background: #1a1a1a;
  color: var(--white);
}

.sidebar-toggle-btn-open {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: none; /* Shown only when sidebar-closed */
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn-open:hover {
  background: #1a1a1a;
  color: var(--white);
  border-color: #3f3f46;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--black);
  font-weight: 800;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-label {
  margin: 12px 10px 2px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b0b0b0;
}

.nav-item {
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #efefef;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #1a1a1a;
  border-color: #3a3a3a;
}

.nav-icon-svg {
  color: #a1a1aa;
  flex-shrink: 0;
  transition: color 0.2s;
}

.nav-item.active .nav-icon-svg,
.nav-item:hover .nav-icon-svg {
  color: #ffffff;
}

.user-row {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.user-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.user-role {
  color: #9a9a9a;
  font-size: 0.8rem;
}

.global-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid #27272a;
  background: #09090b;
}

.main-panel {
  border-right: 1px solid #27272a;
  background: #09090b;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas {
  padding: 24px;
  height: 100%;
  flex: 1;
  overflow-y: auto;
  box-sizing: border-box;
}

/* When lobby is showing, lock scroll so the carousel stays centered */
.canvas:has(.agent-lobby:not(.hidden)) {
  overflow-y: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

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

.subtitle {
  margin: 6px 0 20px;
  color: var(--muted);
}

.engine-strip,
.form-card,
.loading-card,
.results-card,
.history-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.engine-strip {
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.engine-strip h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.engine-strip p {
  margin: 0;
  color: var(--muted);
}

.primary-btn {
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.top-pill {
  border: 1px solid #cfd6df;
  background: #f8fafc;
  color: #233042;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.form-card {
  padding: 16px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.86rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.count-card input,
.chat-composer textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  color: #111111;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
}

.field-error {
  border-color: #b42318 !important;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12);
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field.span-2 {
  grid-column: span 2;
}

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

.count-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  padding: 10px;
}

.count-card span {
  font-size: 0.82rem;
  color: #5b5b5b;
}

.count-card input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 800;
}

.loading-card,
.results-card,
.history-card {
  margin-top: 14px;
  padding: 18px;
}

.loading-card p {
  color: var(--muted);
}

.loading-dots {
  display: inline-flex;
  gap: 8px;
}

.loading-dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #111111;
  animation: blink 0.9s infinite ease-in-out;
  opacity: 0.3;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blink {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }

  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.results-head h2 {
  margin: 0;
}

.results-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.tab {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: #111111;
  color: #ffffff;
}

.section-title {
  margin: 14px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.section-title span,
.metric-pill {
  border: 1px solid #111111;
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
  padding: 3px 8px;
  font-size: 0.8rem;
}

.stack {
  display: grid;
  gap: 10px;
}

.card {
  border: 1px solid #dddddd;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.card p {
  margin: 0 0 6px;
  color: #3f3f3f;
}

.card-inline-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed #cfcfcf;
  border-radius: 8px;
  color: #5e5e5e;
  background: #fafafa;
}

.creative-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.creative-meta {
  display: grid;
  gap: 8px;
}

.ad-copy-block {
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafbfc;
}

.ad-copy-label {
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #516072;
}

.ad-copy-body,
.ad-copy-inline {
  margin: 0;
  color: #1c2430;
}

.ad-copy-inline-row {
  display: grid;
  gap: 8px;
  color: #344054;
}

.final-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-chip {
  border: 1px solid #e3e6eb;
  border-radius: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-chip span {
  width: 140px;
  flex-shrink: 0;
  margin-bottom: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667085;
  display: block;
}

.summary-chip strong {
  font-size: 0.9rem;
  line-height: 1.35;
  color: #101828;
  flex: 1;
  display: block;
}

.summary-chip.emphasis {
  border-color: #cfd4dc;
}

.summary-chip.confidence {
  border-color: #d6e8d7;
  background: linear-gradient(180deg, #f6fbf7 0%, #eef8f0 100%);
}

/* Glowing action button & Reset form button styling */
.glowing-btn {
  border: 1px solid #3f3f46 !important;
  background: #18181b !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  min-height: 40px !important;
  padding: 0 20px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15) !important;
  transition: all 0.3s ease !important;
  position: relative;
}

.glowing-btn:hover {
  background: #27272a !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px) !important;
}

.reset-btn {
  background: #18181b !important;
  border: 1px solid #27272a !important;
  color: #a1a1aa !important;
  padding: 0 16px !important;
  min-height: 40px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease !important;
}

.reset-btn:hover {
  background: #27272a !important;
  color: #ffffff !important;
  border-color: #3f3f46 !important;
}

.summary-stack {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e3e6eb;
  border-radius: 12px;
  background: #fcfcfd;
  color: #344054;
}

.pill-row,
.download-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.download-btn:hover {
  background: #111111;
  color: #ffffff;
}

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

.mono {
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.82rem/1.45 Consolas, "Courier New", monospace;
  color: #4f4f4f;
}

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

.reel-score-card {
  border: 1px solid #e3e6eb;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.reel-score-card span,
.reel-mini-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #667085;
}

.reel-score-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
  color: #101828;
}

.reel-meter-list {
  display: grid;
  gap: 10px;
}

.reel-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.84rem;
  color: #344054;
}

.reel-meter-track {
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.reel-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111111 0%, #4a4a4a 100%);
}

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

.reel-mini-card {
  border: 1px solid #e3e6eb;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.reel-mini-card h4 {
  margin: 6px 0 6px;
  font-size: 0.98rem;
  color: #101828;
}

.reel-mini-card p {
  margin: 0 0 8px;
  color: #344054;
}

.reel-timeline {
  display: grid;
  gap: 10px;
}

.reel-timeline-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #e3e6eb;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
}

.reel-timeline-item.is-critical {
  border-color: #111111;
}

.reel-timeline-second {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #111111;
}

.reel-timeline-body strong {
  display: block;
  margin-bottom: 4px;
  color: #101828;
}

.reel-timeline-body p {
  margin: 0 0 6px;
  color: #344054;
}

.instagram-ingestion-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #27272a;
  border-radius: 18px;
  background: linear-gradient(180deg, #09090b 0%, #111113 100%);
}

.instagram-ingestion-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.panel-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #a1a1aa;
}

.instagram-ingestion-head h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #ffffff;
}

.instagram-ingestion-head p {
  margin: 6px 0 0;
  color: #a1a1aa;
}

.instagram-ingestion-badges,
.instagram-ingestion-options,
.instagram-ingestion-actions,
.instagram-ingestion-status-row,
.instagram-ingestion-summary-grid,
.instagram-ingestion-summary-lists,
.instagram-ingestion-reel-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.instagram-ingestion-grid .field textarea {
  min-height: 86px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #27272a;
  border-radius: 999px;
  background: #18181b;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

.toggle-pill input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.instagram-ingestion-actions {
  align-items: center;
}

.instagram-ingestion-status {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #27272a;
  border-radius: 14px;
  background: #09090b;
}

.instagram-ingestion-status-row {
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
}

.instagram-ingestion-status-row span {
  color: #a1a1aa;
  font-size: 0.88rem;
}

.instagram-ingest-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #18181b;
  overflow: hidden;
}

.instagram-ingest-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111111 0%, #4a4a4a 100%);
  transition: width 0.2s ease;
}

.instagram-ingest-progress-fill.is-error {
  background: linear-gradient(90deg, #b42318 0%, #f04438 100%);
}

.instagram-ingest-message.is-error {
  color: #b42318;
}

.instagram-ingestion-result {
  display: grid;
  gap: 12px;
}

.instagram-ingestion-empty {
  margin: 0;
}

.instagram-ingestion-summary-card,
.instagram-ingestion-reels-card,
.instagram-ingestion-trends-card {
  display: grid;
  gap: 12px;
}

.instagram-ingestion-summary-metric {
  flex: 1 1 120px;
  border: 1px solid #27272a;
  border-radius: 14px;
  padding: 10px 12px;
  background: #18181b;
}

.instagram-ingestion-summary-metric span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a1a1aa;
}

.instagram-ingestion-summary-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 1.3rem;
  color: #ffffff;
}

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

.instagram-ingestion-reel-list,
.instagram-ingestion-trend-list {
  display: grid;
  gap: 10px;
}

.instagram-ingestion-reel-card,
.instagram-ingestion-trend-card {
  border: 1px solid #27272a;
  border-radius: 14px;
  padding: 12px;
  background: #18181b;
}

.instagram-ingestion-reel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.instagram-ingestion-reel-head strong,
.instagram-ingestion-trend-card strong {
  color: #ffffff;
}

.instagram-ingestion-reel-head span {
  color: #a1a1aa;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.instagram-ingestion-reel-card p {
  margin: 8px 0 8px;
  color: #a1a1aa;
}

.instagram-ingestion-reel-metrics span {
  border: 1px solid #27272a;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  background: #09090b;
  font-size: 0.8rem;
  font-weight: 600;
}

.concept-img {
  width: 100%;
  border-radius: 8px;
  margin: 0.35rem 0 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e4e7ec;
}

.error-msg {
  color: #b42318;
  font-size: 0.9rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #fef3f2;
  border-radius: 4px;
  border: 1px solid #fda29b;
}

.reels-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 20px;
  padding: 26px;
  border: 1px solid #27272a;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 28%),
    linear-gradient(160deg, #09090b 0%, #111113 55%, #0f1720 100%);
  overflow: hidden;
}

.reels-hero-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.reels-hero-copy p {
  margin: 0;
  max-width: 780px;
  color: #b4b4bd;
  font-size: 1rem;
  line-height: 1.6;
}

.reels-hero-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: #9fb4d4;
}

.reels-hero-orbit {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 10px;
}

.reels-orbit-pill {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #ffffff;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset;
}

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

.reels-hero-field textarea {
  min-height: 96px !important;
}

.reels-hero-actions,
.reels-manual-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.reels-manual-toolbar {
  padding-top: 4px;
}

.reels-manual-toolbar span {
  color: #71717a;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-right: 4px;
}

.reels-secondary-sources {
  display: grid;
  gap: 12px;
}

.reels-advanced-panel {
  border: 1px solid #27272a;
  border-radius: 18px;
  background: #0d0d10;
  padding: 14px 16px;
}

.reels-advanced-panel summary {
  cursor: pointer;
  list-style: none;
  color: #ffffff;
  font-weight: 700;
}

.reels-advanced-panel summary::-webkit-details-marker {
  display: none;
}

.reels-advanced-panel[open] summary {
  margin-bottom: 14px;
}

.reels-pipeline-strip {
  display: flex;
  background: #111114;
  border: 1px solid #27272a;
  border-radius: 14px;
  overflow: hidden;
}

.reels-pipeline-step {
  flex: 1;
  position: relative;
  padding: 12px 14px;
  background: transparent;
  border-right: 1px solid #27272a;
  color: #71717a;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: default;
  pointer-events: none;
}

.reels-pipeline-step:last-child {
  border-right: none;
}

.reels-pipeline-step.is-active {
  color: #ffffff;
  border-color: #3f3f46;
  background: linear-gradient(180deg, #18181b 0%, #202028 100%);
  transform: translateY(-1px);
}

.reels-pipeline-step.is-done {
  color: #d4d4d8;
  border-color: #2f4e6f;
  background: linear-gradient(180deg, #10161d 0%, #18222d 100%);
}

.reels-pipeline-step.is-error {
  color: #fecaca;
  border-color: #7f1d1d;
  background: #2a1215;
}

.reels-empty-state {
  padding: 28px;
  border: 1px dashed #27272a;
  border-radius: 22px;
  background: linear-gradient(180deg, #09090b 0%, #0f0f13 100%);
  text-align: center;
}

.reels-empty-state h3 {
  margin: 0 0 8px;
  color: #ffffff;
}

.reels-empty-state p,
.reels-empty-inline {
  margin: 0;
  color: #a1a1aa;
}

.reels-intelligence-header,
.reels-dashboard-section {
  border: 1px solid #27272a;
  border-radius: 22px;
  background: linear-gradient(180deg, #09090b 0%, #101014 100%);
  padding: 20px;
}

.reels-intelligence-header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.reels-intelligence-header h3,
.reels-dashboard-section h3 {
  margin: 0;
  color: #ffffff;
}

.reels-intelligence-header p {
  margin: 8px 0 0;
  color: #a1a1aa;
}

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

.reels-meta-card,
.reels-signal-card,
.reels-graph-card,
.reels-storyboard-card,
.reels-scene-card,
.reels-hook-hero,
.reels-hook-facts,
.reels-competitor-hero,
.reels-trend-card {
  border: 1px solid #27272a;
  border-radius: 18px;
  background: #141418;
}

.reels-meta-card,
.reels-signal-card {
  padding: 14px;
}

.reels-meta-card span,
.reels-signal-card span,
.reels-graph-card span,
.reels-hook-score span,
.reels-scene-head span,
.reels-storyboard-card span {
  display: block;
  color: #71717a;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.reels-meta-card strong,
.reels-signal-card strong,
.reels-graph-card strong,
.reels-scene-head strong,
.reels-storyboard-card strong,
.reels-hook-score strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
}

.reels-warning-banner {
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.28) 0%, rgba(63, 29, 14, 0.22) 100%);
}

.reels-warning-banner strong {
  color: #fde68a;
}

.reels-warning-banner p {
  margin: 6px 0 0;
  color: #f5deb3;
}

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

.reels-confidence-chip,
.reels-opportunity-bar {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #27272a;
  background: #18181b;
  color: #ffffff;
}

.reels-hook-grid,
.reels-graph-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.reels-hook-hero {
  padding: 18px;
}

.reels-hook-type {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  color: #ffffff;
  line-height: 1.3;
  font-weight: 800;
  margin-bottom: 18px;
}

.reels-hook-score {
  display: inline-flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #27272a;
  background: #09090b;
  margin-bottom: 14px;
}

.reels-hook-hero p,
.reels-competitor-hero p,
.reels-trend-card p {
  margin: 0;
  color: #a1a1aa;
  line-height: 1.55;
}

.reels-hook-facts {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reels-flow-track,
.reels-storyboard-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.reels-flow-card {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid #27272a;
  background: linear-gradient(180deg, #131317 0%, #18181d 100%);
}

.reels-flow-card.is-critical {
  border-color: #38526d;
  box-shadow: 0 0 0 1px rgba(80, 140, 200, 0.1) inset;
}

.reels-flow-card span,
.reels-flow-card small {
  display: block;
}

.reels-flow-card span,
.reels-flow-card small,
.reels-caption-bar {
  color: #8d8d98;
}

.reels-flow-card strong {
  display: block;
  margin: 10px 0 8px;
  color: #ffffff;
}

.reels-flow-card p,
.reels-scene-body p {
  margin: 0;
  color: #b4b4bd;
}

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

.reels-graph-card,
.reels-graph-meta {
  padding: 16px;
}

.reels-curve {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 160px;
  margin-top: 14px;
}

.reels-curve-col {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.reels-curve-bar {
  width: 100%;
  max-width: 24px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #8faed4 100%);
  box-shadow: 0 10px 30px rgba(143, 174, 212, 0.18);
}

.reels-curve-bar.is-replay {
  background: linear-gradient(180deg, #f5f3ff 0%, #818cf8 100%);
  box-shadow: 0 10px 30px rgba(129, 140, 248, 0.18);
}

.reels-curve-col small {
  color: #71717a;
  font-size: 0.72rem;
}

.reels-graph-meta {
  display: grid;
  gap: 10px;
  border: 1px solid #27272a;
  border-radius: 18px;
  background: #141418;
}

.reels-trend-grid,
.reels-scene-stack {
  display: grid;
  gap: 12px;
}

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

.reels-trend-card,
.reels-competitor-hero,
.reels-scene-card,
.reels-storyboard-card {
  padding: 16px;
}

.reels-trend-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.reels-trend-top strong,
.reels-competitor-hero h4 {
  color: #ffffff;
  margin: 0;
}

.reels-trend-badge {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #27272a;
  color: #c4c4d0;
  background: #09090b;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.reels-trend-badge.is-rising {
  color: #dbeafe;
  border-color: #27496d;
}

.reels-trend-badge.is-hot {
  color: #fde68a;
  border-color: #5b3a12;
}

.reels-trend-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.reels-trend-metric strong {
  color: #ffffff;
}

.reels-opportunity-bar {
  margin-top: 14px;
}

.reels-scene-stack {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.reels-scene-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.reels-scene-body {
  display: grid;
  gap: 8px;
}

.reels-scene-body strong {
  color: #ffffff;
}

.reels-storyboard-flow {
  margin-bottom: 14px;
}

.reels-caption-bar {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #27272a;
  border-radius: 18px;
  background: #121216;
}

@media (max-width: 980px) {
  .reels-hero-card,
  .reels-intelligence-header,
  .reels-hook-grid,
  .reels-graph-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .reels-guided-grid,
  .instagram-ingestion-grid,
  .reels-intelligence-meta,
  .reels-hook-facts {
    grid-template-columns: 1fr;
  }

  .reels-hero-card,
  .reels-dashboard-section,
  .reels-intelligence-header {
    padding: 16px;
  }
}

.chat-panel {
  background: #f7f8fb;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-left: 1px solid #dfe3ea;
}

.chat-header {
  padding: 14px;
  border-bottom: 1px solid #dfe3ea;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  background: #f5f7fb;
}

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

.assistant-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #111111;
  color: #ffffff;
  font-weight: 800;
}

.chat-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.1;
}

.chat-subtitle {
  margin-top: 2px;
  color: #516072;
  font-size: 0.84rem;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #c9d1dc;
  background: transparent;
  color: #6c7787;
  display: grid;
  place-items: center;
  padding: 0;
  font-weight: 700;
  font-size: 1.1rem;
}

.chat-body {
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.chat-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.chat-row.user {
  grid-template-columns: auto minmax(0, 1fr) 30px;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid #1e2b3f;
  color: #1e2b3f;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.chat-bubble {
  border: 1px solid #d3dcea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #eaf0f8;
  color: #1b2330;
  line-height: 1.35;
}

.chat-row.user .chat-bubble {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.chat-time {
  color: #6b7786;
  font-size: 0.86rem;
  white-space: nowrap;
  padding-top: 4px;
}

.meta {
  margin-top: 6px;
  font-size: 0.74rem;
  color: #5f6a79;
}

.chat-row.user .meta {
  color: #d5d8de;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px solid #dfe3ea;
  padding: 10px;
  background: #f4f7fc;
}

.chat-composer textarea {
  min-height: 44px;
  max-height: 110px;
  resize: vertical;
  border-radius: 10px;
  border-color: #cad5e7;
  background: #ffffff;
}

.chat-composer button {
  min-width: 72px;
  height: 42px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 12px;
  cursor: pointer;
}

/* Campaign History Styles */
.campaign-card {
  padding: 0;
  overflow: hidden;
}

.campaign-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  background: #fafbfc;
  border-bottom: 1px solid #e3e6eb;
  transition: background 0.2s;
}

.campaign-header:hover {
  background: #f3f5f7;
}

.campaign-title-block {
  flex: 1;
}

.campaign-title-block h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.campaign-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.meta-pill {
  display: inline-block;
  padding: 3px 8px;
  background: #e8eef7;
  border-radius: 999px;
  color: #516072;
  border: 1px solid #d0d9e8;
}

.campaign-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #d6d6d6;
}

.toggle-icon {
  font-size: 0.9rem;
  color: #6c7787;
  transition: transform 0.3s;
}

.campaign-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.campaign-content.expanded {
  max-height: 2000px;
  padding: 12px;
}

.campaign-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e3e6eb;
  background: #ffffff;
  padding: 0 12px;
}

.tab-btn {
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6c7787;
  border-bottom: 3px solid transparent;
  transition: color 0.2s;
}

.tab-btn:hover {
  color: #111111;
}

.tab-btn.active {
  color: #111111;
  border-bottom-color: #111111;
}

.tab-content {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.tab-content.hidden {
  display: none;
}

.item-box {
  padding: 10px;
  border: 1px solid #e3e6eb;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 0.85rem;
}

.item-box strong {
  display: block;
  margin-bottom: 4px;
  color: #111111;
}

.item-box p {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: #3f3f3f;
}

.item-box small {
  display: block;
  color: #6c7787;
  font-size: 0.78rem;
}

.creative-item {
  border: 1px solid #e3e6eb;
  border-radius: 6px;
  padding: 12px;
  background: #fafbfc;
  margin-bottom: 8px;
}

.creative-info {
  margin-bottom: 8px;
}

.creative-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: #111111;
}

.primary-text {
  font-weight: 600;
  color: #516072;
  margin: 0 0 4px !important;
}

.description {
  font-size: 0.85rem;
  color: #3f3f3f;
  margin: 0 0 4px !important;
}

.cta {
  font-size: 0.85rem;
  color: #3f3f3f;
  margin: 0 0 4px !important;
}

.score {
  font-size: 0.82rem;
  color: #6c7787;
  margin: 0 !important;
}

.creative-downloads {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #516072;
  background: #ffffff;
  color: #516072;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.view-btn:hover {
  background: #516072;
  color: #ffffff;
}

/* Image Modal Styles */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.image-modal.hidden {
  display: none;
}

#kbModal {
  z-index: 1000;
}

#imageModal {
  z-index: 2000;
}

.image-modal-content {
  background: #18181b;
  border-radius: 16px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 24px;
  border: 1px solid #27272a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  color: #ffffff;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #27272a;
  background: #27272a;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.modal-close:hover {
  background: #3f3f46;
  border-color: #52525b;
}

.image-modal-content h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  border: 1px solid #27272a;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (max-width: 1260px) {
  html,
  body,
  .app-shell,
  .main-panel {
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: auto !important;
  }

  .canvas {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .chat-panel {
    grid-column: 1 / -1;
    border-top: 1px solid #d7d7d7;
    min-height: 420px;
  }

  .main-panel {
    border-right: none;
  }
}

@media (max-width: 980px) {
  .creative-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    display: none;
  }

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

  .field.span-2 {
    grid-column: span 1;
  }

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

  .chat-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .chat-time {
    display: none;
  }

  .hero-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .dashboard-actions {
    width: 100%;
    flex-direction: column;
  }

  .dashboard-actions button {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .count-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .count-card input {
    font-size: 1.2rem;
  }

  .engine-strip {
    flex-direction: column;
    gap: 10px;
  }

  .engine-strip button {
    width: 100%;
  }

  .summary-chip {
    padding: 8px 10px;
  }

  .summary-chip span {
    font-size: 0.68rem;
  }

  .summary-chip strong {
    font-size: 0.85rem;
  }

  .canvas {
    padding: 12px;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .image-modal-content {
    max-width: 95%;
    padding: 12px;
  }

  .modal-image {
    max-height: 50vh;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

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

  .sidebar {
    display: none;
  }

  .brand {
    margin-bottom: 10px;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 2vw, 2rem);
  }

  .engine-strip h2 {
    font-size: 1.1rem;
  }

  .engine-strip p {
    font-size: 0.85rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .form-card {
    padding: 12px;
  }

  .field span {
    font-size: 0.8rem;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px; /* Prevents zoom on mobile */
    padding: 8px 10px;
  }

  .top-pill {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.85rem;
  }

  .primary-btn {
    min-height: 40px;
    font-size: 0.9rem;
  }

  .tab {
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .chat-body {
    padding: 8px;
    gap: 8px;
  }

  .chat-bubble {
    padding: 8px 10px;
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .chat-composer {
    padding: 8px;
    gap: 6px;
  }

  .chat-composer textarea {
    min-height: 40px;
    font-size: 16px;
  }

  .chat-composer button {
    min-width: 60px;
    height: 40px;
    font-size: 0.85rem;
  }

  .image-modal-content {
    border-radius: 8px;
    padding: 10px;
    max-width: 98%;
  }

  .image-modal-content h2 {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .modal-close {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 8px;
  }

  .modal-image {
    max-height: 40vh;
    border-radius: 6px;
  }
}

/* Supervisor Panel - Dark Theme */
.supervisor-panel {
  background: #09090b;
  color: #ffffff;
  margin: -24px; /* offset the canvas padding */
  padding: 24px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.supervisor-panel.hidden {
  display: none !important;
}

.supervisor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #27272a;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.supervisor-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.supervisor-header-icon {
  width: 36px;
  height: 36px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.supervisor-header-titles h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.supervisor-header-titles p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #a1a1aa;
}

.supervisor-header-right {
  display: flex;
  gap: 8px;
}

.supervisor-header-right .top-pill {
  border: none !important;
  background: transparent !important;
  color: #ffffff !important;
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.supervisor-header-right .top-pill:hover {
  color: #a1a1aa;
}

.supervisor-centered {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px 80px;
}

.supervisor-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #000000;
  border: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.supervisor-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 28px;
}

.supervisor-bars .bar {
  width: 5px;
  background: #ffffff;
  border-radius: 2px;
}

.supervisor-bars .bar-short {
  height: 12px;
}

.supervisor-bars .bar-med {
  height: 20px;
}

.supervisor-bars .bar-tall {
  height: 28px;
}

.supervisor-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.supervisor-desc {
  font-size: 1rem;
  color: #a1a1aa;
  max-width: 520px;
  line-height: 1.6;
  margin: 0;
}

/* Premium Dark Theme Overrides & Global Card/Inputs Unification */
.field input,
.field select,
.field textarea,
.count-card input,
.chat-composer textarea {
  background: #18181b !important;
  color: #ffffff !important;
  border: 1px solid #27272a !important;
}

.card {
  border: 1px solid #27272a !important;
  background: #09090b !important;
}

.card h3 {
  color: #ffffff !important;
}

.card p {
  color: #a1a1aa !important;
}

.tab {
  border: 1px solid #27272a !important;
  background: #18181b !important;
  color: #ffffff !important;
}

.tab.active {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
}

.section-title span,
.metric-pill {
  border: 1px solid #27272a !important;
  background: #18181b !important;
  color: #ffffff !important;
}

.count-card {
  border: 1px solid #27272a !important;
  background: #09090b !important;
}

.count-card span {
  color: #a1a1aa !important;
}

.primary-btn {
  border: 1px solid #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
}

.primary-btn:hover {
  background: #e4e4e7 !important;
  border-color: #e4e4e7 !important;
}

.top-pill {
  border: 1px solid #27272a !important;
  background: #18181b !important;
  color: #ffffff !important;
}

.top-pill:hover {
  background: #27272a !important;
  border-color: #3f3f46 !important;
}

.item-box {
  border: 1px solid #27272a !important;
  background: #18181b !important;
}

.item-box strong {
  color: #ffffff !important;
}

.card-inline-empty {
  border: 1px dashed #27272a !important;
  background: #111113 !important;
  color: #a1a1aa !important;
}

.summary-chip {
  border: 1px solid #27272a !important;
  background: #111113 !important;
}

.summary-chip span {
  color: #a1a1aa !important;
}

.summary-chip strong {
  color: #ffffff !important;
}

.summary-chip.emphasis {
  border-color: #3f3f46 !important;
}

.summary-chip.confidence {
  border-color: #27272a !important;
  background: #111113 !important;
}

.ad-copy-block {
  border: 1px solid #27272a !important;
  background: #111113 !important;
}

.ad-copy-label {
  color: #a1a1aa !important;
}

.ad-copy-body,
.ad-copy-inline {
  color: #ffffff !important;
}

.ad-copy-inline-row {
  color: #a1a1aa !important;
}

.summary-stack {
  border: 1px solid #27272a !important;
  background: #111113 !important;
  color: #a1a1aa !important;
}

.summary-stack strong {
  color: #ffffff !important;
}

.item-box p {
  color: #a1a1aa !important;
}

.creative-item {
  border: 1px solid #27272a !important;
  background: #18181b !important;
}

.creative-info strong {
  color: #ffffff !important;
}

.primary-text {
  color: #e4e4e7 !important;
}

.description,
.cta {
  color: #a1a1aa !important;
}

.view-btn {
  border: 1px solid #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
}

.view-btn:hover {
  background: #e4e4e7 !important;
  color: #000000 !important;
}

.campaign-header {
  background: #18181b !important;
  border-bottom: 1px solid #27272a !important;
}

.campaign-header:hover {
  background: #27272a !important;
}

.campaign-tabs {
  background: #09090b !important;
  border-bottom: 1px solid #27272a !important;
}

.tab-btn {
  color: #a1a1aa !important;
}

.tab-btn:hover {
  color: #ffffff !important;
}

.tab-btn.active {
  color: #ffffff !important;
  border-bottom-color: #ffffff !important;
}

.image-modal-content {
  background: #09090b !important;
  border: 1px solid #27272a !important;
  color: #ffffff !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7) !important;
}

.image-modal-content h2 {
  color: #ffffff !important;
}

.modal-close {
  border: 1px solid #27272a !important;
  background: #18181b !important;
  color: #ffffff !important;
}

.modal-close:hover {
  background: #27272a !important;
}

/* AI Assistant Redesign & Dark Theme Chat Panel */
.chat-panel {
  background: #09090b !important;
  border-left: 1px solid #27272a !important;
  display: flex !important;
  flex-direction: column !important;
}

.chat-header {
  background: #09090b !important;
  border-bottom: 1px solid #27272a !important;
  color: #ffffff;
}

.assistant-head .assistant-icon {
  background: transparent !important;
  border: none !important;
}

.chat-title {
  color: #ffffff !important;
}

.chat-subtitle {
  color: #a1a1aa !important;
}

.icon-btn {
  border: none !important;
  background: transparent !important;
  color: #ffffff !important;
}

.icon-btn:hover {
  color: #a1a1aa !important;
}

.assistant-tabs {
  display: flex;
  background: #18181b;
  border-radius: 10px;
  margin: 12px;
  padding: 4px;
  gap: 4px;
}

.assistant-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #a1a1aa;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.assistant-tab:hover {
  color: #ffffff;
}

.assistant-tab.active {
  background: #27272a;
  color: #ffffff;
}

.chat-body {
  background: #09090b !important;
}

.chat-bubble {
  background: #18181b !important;
  color: #ffffff !important;
  border: 1px solid #27272a !important;
}

.chat-row.user .chat-bubble {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
}

.chat-composer {
  background: #09090b !important;
  border-top: 1px solid #27272a !important;
}

.chat-composer textarea {
  background: #18181b !important;
  color: #ffffff !important;
  border: 1px solid #27272a !important;
}

.chat-composer button {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
}

.chat-composer button:hover {
  background: #e4e4e7 !important;
}

.chat-session-item {
  color: #ffffff !important;
  border-bottom: 1px solid #27272a !important;
}

.chat-session-item:hover {
  background: #27272a !important;
}

.chat-session-item span {
  color: #a1a1aa !important;
}

/* Suggestion Card Styles */
.suggestion-card {
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 16px;
  background: #18181b;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.suggestion-card:hover {
  border-color: #3f3f46;
}

.suggestion-category {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
}

.category-content_quality {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.category-strategy_gap {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.category-copy_optimization {
  background: rgba(249, 115, 22, 0.1);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.suggestion-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.suggestion-desc-text {
  font-size: 0.85rem;
  color: #a1a1aa;
  margin: 0;
  line-height: 1.4;
}

.suggestion-btn {
  align-self: flex-end;
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.suggestion-btn:hover {
  background: #e4e4e7;
}

.suggestion-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.floating-chat-btn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #18181b;
  border: 1px solid #27272a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 1000;
  transition: all 0.2s ease;
}

.floating-chat-btn:hover {
  background: #27272a;
  border-color: #3f3f46;
}

/* Spinner Animation */
.spinner-ring {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s linear infinite;
  margin-right: 12px;
  vertical-align: middle;
}

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

/* ── Suggestion Cards ── */
.suggestion-card {
  background: #111111;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 16px;
}

.suggestion-category {
  display: inline-block;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 8px;
}

.suggestion-title-text {
  color: #ffffff;
  font-size: 0.95em;
  font-weight: 500;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.suggestion-btn-outline {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggestion-btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}

.suggestion-btn {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggestion-btn:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.suggestion-detail {
  color: #a1a1aa;
  line-height: 1.5;
}

.suggestion-detail strong {
  color: #ffffff;
}

/* Redesigned Chat Composer */
.chat-composer-redesign {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #09090b;
  border-top: 1px solid #27272a;
  padding: 12px;
  margin: 0;
  box-sizing: border-box;
}

.chat-composer-top {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #18181b;
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  width: fit-content;
  border: 1px solid #27272a;
}

.chat-attach-btn {
  background: #27272a;
  border: none;
  color: #a1a1aa;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-attach-btn:hover {
  color: #ffffff;
  background: #3f3f46;
}

.chat-composer-hint {
  font-size: 0.75rem;
  color: #71717a;
}

.chat-composer-redesign textarea {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  background: #18181b;
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 8px 12px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.chat-composer-redesign textarea:focus {
  outline: none;
  border-color: #3f3f46;
}

.chat-composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-composer-selectors {
  display: flex;
  gap: 8px;
}

.chat-select {
  background: #18181b;
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.chat-select:focus {
  border-color: #3f3f46;
}

.chat-send-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: #e4e4e7;
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chat-attachment-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #27272a;
  color: #ffffff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
}

.chat-attachment-pill button {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

/* Login Overlay Styles */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at bottom right, #1a1a1a, #09090b 60%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.login-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #a1a1aa;
  text-transform: uppercase;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.login-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

#login-form .input-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#login-form .input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
}

#login-form .input-group input {
  background: #18181b;
  border: 1px solid #27272a;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

#login-form .input-group input:focus {
  border-color: #555;
}

.login-info-box {
  background: rgba(217, 119, 6, 0.05);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: #a1a1aa;
  font-size: 0.8rem;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  margin-top: 24px;
  line-height: 1.4;
}

.login-submit-btn {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-submit-btn:hover {
  opacity: 0.9;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: #555;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #27272a;
}

.login-divider span {
  padding: 0 10px;
}

.login-guest-btn {
  width: 100%;
  background: transparent;
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-guest-btn span {
  color: #a1a1aa;
  font-weight: 400;
}

.login-guest-btn:hover {
  background: #18181b;
}

/* ----------------------------------------------------------------------
   PREMIUM REELS ANALYSIS UPGRADE STYLES
   ---------------------------------------------------------------------- */
.reels-analysis-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}

.reels-section-card {
  background: linear-gradient(145deg, #111115 0%, #0c0c0e 100%);
  border: 1px solid #1f1f23;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.reels-section-card:hover {
  border-color: #2e2e35;
}

.reels-section-title-premium {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid #ffffff; /* white accent */
  padding-left: 10px;
}

/* Statistics Grid */
.reels-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.reels-stat-card-premium {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.reels-stat-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #ffffff;
  opacity: 0.7;
}

.reels-stat-card-premium:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.02);
  border-color: rgba(255,255,255,0.1);
}

.reels-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a1a1aa;
  margin-bottom: 8px;
}

.reels-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

.reels-stat-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.reels-stat-progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 3px;
}

.reels-stat-desc {
  font-size: 0.72rem;
  color: #71717a;
  line-height: 1.3;
}

/* Hooks Section Layout */
.reels-hooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.reels-hook-card-premium {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reels-hook-card-premium:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.reels-hook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.reels-hook-tag {
  background: #18181b;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #27272a;
}

.reels-hook-tag.visual {
  background: #27272a;
  color: #a1a1aa;
  border-color: #3f3f46;
}

.reels-hook-duration {
  font-size: 0.75rem;
  color: #71717a;
}

.reels-hook-content {
  font-size: 1.05rem;
  color: #ffffff;
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
  margin: 4px 0;
}

.reels-hook-why {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid #ffffff;
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: #d4d4d8;
  line-height: 1.45;
}

.reels-hook-why strong {
  color: #ffffff;
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Timeline grid and squares */
.reels-timeline-horizontal {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

@media (max-width: 1024px) {
  .reels-timeline-horizontal {
    grid-template-columns: repeat(5, 220px);
  }
}

.reels-timeline-square-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: all 0.3s ease;
}

.reels-timeline-square-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.reels-timeline-square-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reels-timeline-square-box {
  aspect-ratio: 1;
  width: 100%;
  background: linear-gradient(135deg, #18181b 0%, #09090b 100%);
  border: 2px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: #71717a;
  font-size: 0.72rem;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.3s ease;
}

.reels-timeline-square-card:hover .reels-timeline-square-box {
  border-color: rgba(255, 255, 255, 0.3);
  color: #a1a1aa;
}

.reels-timeline-square-box svg {
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.3s ease;
}

.reels-timeline-square-card:hover .reels-timeline-square-box svg {
  color: #ffffff;
}

.reels-timeline-time-badge {
  background: #27272a;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #3f3f46;
}

.reels-timeline-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a1a1aa;
}

.reels-timeline-caption {
  font-size: 0.8rem;
  color: #ffffff;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reels-timeline-visual-desc {
  font-size: 0.72rem;
  color: #71717a;
  margin: 0;
  line-height: 1.35;
}

/* 10 Reasons Virality Grid */
.reels-reasons-premium-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .reels-reasons-premium-grid {
    grid-template-columns: 1fr;
  }
}

.reels-reason-card-premium {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  align-items: flex-start;
  transition: all 0.25s ease;
}

.reels-reason-card-premium:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.reels-reason-number {
  background: #ffffff;
  color: #000000;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05);
}

.reels-reason-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reels-reason-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.reels-reason-desc {
  font-size: 0.8rem;
  color: #a1a1aa;
  margin: 0;
  line-height: 1.4;
}

@media (min-width: 1261px) {
  .chat-panel {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
  }
}

/* Sequential Generation Image Container Constraints */
.creative-image-container {
  width: 100%;
  height: 450px;
  overflow: hidden;
  border-radius: 12px;
  margin-top: 10px;
  border: 1px solid #27272a;
  background: #111113;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creative-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Google Sign-In and Mock Button Styles */
.google-btn-mock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: #18181b;
  color: #a1a1aa;
  border: 1px dashed #3f3f46;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-btn-mock:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #52525b;
}

.google-btn-mock svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.google-status-msg {
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 4px;
}

.google-status-msg.info {
  color: #a1a1aa;
}

.google-status-msg.error {
  color: #ff5252;
}

/* ==========================================================================
   AGENT LOBBY & TRANSITIONS
   ========================================================================== */

.agent-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Fill exactly the canvas height so carousel is always centered */
  height: 100%;
  flex: 1;
  box-sizing: border-box;
  padding: 24px 20px;
  /* No overflow:hidden — it clips 3D-transformed cards */
  overflow: visible;
  animation: fadeInLobby 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInLobby {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.lobby-header {
  text-align: center;
  margin-bottom: 32px;
  max-width: 650px;
  flex-shrink: 0;
}

.lobby-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 30%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lobby-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.back-to-lobby-btn {
  border: 1px solid var(--line) !important;
  background: #111113 !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
}

.back-to-lobby-btn:hover {
  background: #27272a !important;
  border-color: #3f3f46 !important;
}

.lobby-carousel-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  overflow: visible;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.carousel-3d {
  position: relative;
  width: 174px;
  height: 247px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-3d.dragging {
  transition: none !important;
}

.carousel-item-3d {
  position: absolute;
  width: 174px;
  height: 247px;
  background: rgba(22, 22, 26, 0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: box-shadow 0.3s ease,
              border-color 0.3s ease,
              opacity 0.5s ease;
  user-select: none;
  backdrop-filter: blur(16px);
  opacity: 0.72;
  transform-origin: center center;
}

.carousel-item-3d::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(800px circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.08), transparent 40%);
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

.carousel-item-3d.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 30px rgba(255,255,255,0.06);
  z-index: 50;
}

.carousel-item-3d.near-active {
  opacity: 0.88;
}

.carousel-item-3d:hover {
  border-color: rgba(255, 255, 255, 0.3);
  opacity: 0.92;
}

.carousel-item-3d.active:hover {
  opacity: 1;
}

/* Cylinder card positions — 8 cards, 45° apart, 275px radius (reduced by 15%) */
.carousel-item-3d:nth-child(1) { transform: rotateY(  0deg) translateZ(275px); }
.carousel-item-3d:nth-child(2) { transform: rotateY( 45deg) translateZ(275px); }
.carousel-item-3d:nth-child(3) { transform: rotateY( 90deg) translateZ(275px); }
.carousel-item-3d:nth-child(4) { transform: rotateY(135deg) translateZ(275px); }
.carousel-item-3d:nth-child(5) { transform: rotateY(180deg) translateZ(275px); }
.carousel-item-3d:nth-child(6) { transform: rotateY(225deg) translateZ(275px); }
.carousel-item-3d:nth-child(7) { transform: rotateY(270deg) translateZ(275px); }
.carousel-item-3d:nth-child(8) { transform: rotateY(315deg) translateZ(275px); }

/* Card Inner Components */
.lobby-card-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0);
  transition: box-shadow 0.3s ease;
}

.carousel-item-3d:hover .lobby-card-glow {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.15);
}

.lobby-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #111113;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: #a1a1aa;
  transition: all 0.3s ease;
}

.carousel-item-3d:hover .lobby-card-icon,
.carousel-item-3d.active .lobby-card-icon {
  background: #ffffff;
  color: #000000;
  transform: scale(1.05);
}

.lobby-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #ffffff;
}

.lobby-card-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 16px;
  flex-grow: 1;
}

.lobby-card-action {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  transition: transform 0.3s ease;
  margin-top: auto;
}

.carousel-item-3d:hover .lobby-card-action {
  transform: translateX(6px);
}

/* Nav Arrows */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid var(--line);
  color: var(--white);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
}

.carousel-nav-btn:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.carousel-nav-btn.prev { left: 40px; }
.carousel-nav-btn.next { right: 40px; }

/* Overhead-cylinder pop animation */
.carousel-3d.animating .carousel-item-3d:not(.selected) {
  opacity: 0 !important;
  pointer-events: none;
}

.carousel-item-3d.selected {
  z-index: 1000;
  opacity: 1 !important;
  border-color: #ffffff !important;
  background: #000000 !important;
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.45) !important;
  pointer-events: none;
  animation: carouselCardPop 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

@keyframes carouselCardPop {
  0% {
    opacity: 1;
    transform: rotateY(0deg) translateZ(291px) scale(1);
  }
  40% {
    transform: rotateY(0deg) translateZ(153px) scale(1.1) rotateX(5deg);
    opacity: 0.95;
  }
  100% {
    transform: rotateY(0deg) translateZ(46px) scale(1.8) rotateX(0deg);
    opacity: 0;
  }
}

/* Page pop/slide animation for workspaces */
.supervisor-panel,
.hero,
.results-card,
.history-card {
  animation: sectionPopIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes sectionPopIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- Chat Prompt Options & Inline Editing Styles --- */
.chat-prompt-menu-container {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-block;
}

.chat-prompt-menu-btn {
  background: transparent;
  border: none;
  color: #71717a;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s ease;
  outline: none;
}

.chat-row.user .chat-prompt-menu-btn {
  color: #52525b;
}

.chat-row.user .chat-prompt-menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: #000000;
}

.chat-prompt-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
  z-index: 200;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.chat-prompt-menu-dropdown.hidden {
  display: none !important;
}

.chat-prompt-menu-item {
  background: none;
  border: none;
  color: #e4e4e7;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  width: 100%;
  font-family: inherit;
}

.chat-prompt-menu-item:hover {
  background-color: #27272a;
  color: #ffffff;
}

/* Inline Edit States */
.chat-edit-textarea {
  width: 100%;
  min-height: 60px;
  background: #f4f4f5 !important;
  color: #09090b !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 6px !important;
  padding: 8px !important;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  resize: vertical;
  margin-bottom: 8px;
  outline: none;
}

.chat-edit-textarea:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.chat-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.chat-edit-cancel-btn {
  background: #e4e4e7;
  color: #18181b;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-edit-cancel-btn:hover {
  background: #d4d4d8;
}

.chat-edit-save-btn {
  background: #18181b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-edit-save-btn:hover {
  background: #09090b;
}

/* Saved Prompts Panel and List Items */
#chat-saved-prompts-panel {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.saved-prompt-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.saved-prompt-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: rgba(32, 32, 36, 0.98);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
}

.saved-prompt-text {
  font-size: 0.82rem;
  color: #e4e4e7;
  line-height: 1.45;
  text-align: left;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.35em;
  font-weight: 450;
}

.saved-prompt-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.saved-prompt-use-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.saved-prompt-use-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.saved-prompt-use-btn:active {
  transform: translateY(0);
}

.saved-prompt-delete-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s ease;
  outline: none;
}

.chat-row.user .chat-prompt-menu-btn {
  color: #52525b;
}

.chat-row.user .chat-prompt-menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: #000000;
}

.chat-prompt-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
  z-index: 200;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.chat-prompt-menu-dropdown.hidden {
  display: none !important;
}

.chat-prompt-menu-item {
  background: none;
  border: none;
  color: #e4e4e7;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  width: 100%;
  font-family: inherit;
}

.chat-prompt-menu-item:hover {
  background-color: #27272a;
  color: #ffffff;
}

/* Inline Edit States */
.chat-edit-textarea {
  width: 100%;
  min-height: 60px;
  background: #f4f4f5 !important;
  color: #09090b !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 6px !important;
  padding: 8px !important;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  resize: vertical;
  margin-bottom: 8px;
  outline: none;
}

.chat-edit-textarea:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.chat-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.chat-edit-cancel-btn {
  background: #e4e4e7;
  color: #18181b;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-edit-cancel-btn:hover {
  background: #d4d4d8;
}

.chat-edit-save-btn {
  background: #18181b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-edit-save-btn:hover {
  background: #09090b;
}

/* Saved Prompts Panel and List Items */
#chat-saved-prompts-panel {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.saved-prompt-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.saved-prompt-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: rgba(32, 32, 36, 0.98);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
}

.saved-prompt-text {
  font-size: 0.82rem;
  color: #e4e4e7;
  line-height: 1.45;
  text-align: left;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.35em;
  font-weight: 450;
}

.saved-prompt-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.saved-prompt-use-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.saved-prompt-use-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.saved-prompt-use-btn:active {
  transform: translateY(0);
}

.saved-prompt-delete-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.saved-prompt-delete-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Reels Script Director Premium Styling */
.reels-phone-mockup {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reels-phone-mockup:hover {
  border-color: #3f3f46 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.mockup-screen {
  box-shadow: inset 0 0 40px rgba(0,0,0,0.9);
}

/* Modal styling for Reels Publication */
.reels-modal {
  opacity: 1;
  transition: opacity 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reels-modal-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 9, 11, 0.95) !important;
}

/* SVG Chart retention stroke animation */
#retention-stroke {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawStroke 2s forwards ease-in-out;
}

@keyframes drawStroke {
  to {
    stroke-dashoffset: 0;
  }
}

/* Dynamic styling for mockup video play click */
#mock-video-bg svg:hover {
  transform: scale(1.1) rotate(5deg);
  color: #e11d48 !important;
}
