:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #f1f5f4;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e0df;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff3f0;
  --orange: #c75a14;
  --orange-soft: #fff0df;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --red: #b42318;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #10201f;
  color: #fff;
}

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

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

.brand strong {
  font-size: 17px;
}

.brand span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #10201f;
  font-size: 13px;
  font-weight: 900;
}

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

.nav-item {
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.94), rgba(17, 24, 39, 0.96)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08) 10px, transparent 10px, transparent 20px);
  color: #fff;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #a8fff4;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric,
.workflow-strip article,
.account-card,
.source-card,
.job-card,
.clip-card,
.learning-grid article,
.cost-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  padding: 15px;
}

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

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.workflow-strip article {
  display: grid;
  gap: 8px;
  padding: 14px;
  box-shadow: none;
}

.workflow-strip span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 950;
}

.workflow-strip strong {
  font-size: 15px;
}

.workflow-strip p,
.account-card p,
.source-card p,
.job-card p,
.clip-card p,
.learning-grid p,
.cost-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.08fr) minmax(320px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.panel {
  min-width: 0;
}

.section-heading,
.account-topline,
.source-card-header,
.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading.compact {
  margin-top: 24px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.is-ready {
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.account-grid,
.source-list,
.job-list {
  display: grid;
  gap: 12px;
}

.account-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.provider-dot {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--provider-color, var(--accent));
}

.account-meta,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.button-row button {
  flex: 1;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hero .secondary-button {
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.full-button {
  width: 100%;
}

.manual-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.is-hidden {
  display: none;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.signal-grid legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input {
  padding: 0 12px;
}

select {
  padding: 0 34px 0 12px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.source-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  box-shadow: none;
  cursor: pointer;
}

.source-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.source-media {
  display: grid;
  min-height: 74px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, var(--tone), #111827),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14) 8px, transparent 8px, transparent 16px);
  color: #fff;
  font-weight: 950;
}

.source-content {
  min-width: 0;
}

.source-card-header strong {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card-header span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.scout-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.clip-form {
  display: grid;
  gap: 14px;
}

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

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

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

.signal-grid legend {
  grid-column: 1 / -1;
}

.signal-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.signal-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.signal-card span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.signal-card:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.36);
  background: var(--accent-soft);
}

.review-gates {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--orange-soft);
}

.review-gates strong,
.review-gates span {
  display: block;
}

.review-gates strong {
  font-size: 14px;
}

.review-gates div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  margin: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c5cfcd;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.job-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.job-header > div {
  min-width: 0;
}

.job-header strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dfe7e5;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.cost-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--blue-soft);
  box-shadow: none;
}

.clip-section,
.learning-loop {
  margin-top: 26px;
}

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

.clip-card {
  overflow: hidden;
}

.clip-preview {
  position: relative;
  display: grid;
  min-height: 212px;
  place-items: center;
  background: linear-gradient(145deg, #0f766e, #111827);
  color: #fff;
}

.phone-frame {
  display: grid;
  width: 106px;
  height: 168px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(17, 24, 39, 0.44);
}

.phone-frame span {
  font-size: 13px;
  font-weight: 900;
}

.phone-frame strong {
  font-size: 38px;
}

.score-label {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 950;
}

.clip-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.clip-body h3 {
  margin-bottom: 7px;
}

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

.clip-checks span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

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

.learning-grid article {
  display: grid;
  gap: 8px;
  padding: 15px;
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

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

  .sidebar {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 14px 18px;
  }

  .brand {
    margin-bottom: 0;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .workspace-grid,
  .clip-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .hero,
  .section-heading,
  .job-header {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions,
  .button-row {
    justify-content: stretch;
  }

  .metrics,
  .workflow-strip,
  .field-row,
  .field-row.three,
  .signal-grid,
  .learning-grid,
  .manual-source {
    grid-template-columns: 1fr;
  }

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

  .source-media {
    min-height: 92px;
  }

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

  .brand {
    width: 100%;
  }

  .nav-list {
    width: 100%;
  }

  .nav-item {
    white-space: nowrap;
  }
}
