:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #647283;
  --line: #dce2e8;
  --accent: #0f8b8d;
  --accent-strong: #0b6466;
  --warn: #b05219;
  --soft: #edf7f7;
  --shadow: 0 12px 30px rgba(20, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

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

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 22px 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 760;
}

h2 {
  font-size: 17px;
  margin-bottom: 16px;
}

.topbar p {
  color: var(--muted);
  margin-top: 5px;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: 430px minmax(0, 1fr);
  padding: 22px;
}

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

.input-panel {
  grid-row: span 3;
}

.wide {
  grid-column: 2;
}

label {
  color: #293746;
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 7px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  background: #fbfcfd;
  border: 1px solid #cad4dd;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  min-height: 42px;
  padding: 10px 11px;
  resize: vertical;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.14);
  outline: none;
}

.grid {
  display: grid;
  gap: 12px;
}

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

.upload-box {
  align-items: center;
  background: linear-gradient(180deg, #fbffff, #eef7f7);
  border: 1px dashed #8abfc0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 130px;
  padding: 18px;
  text-align: center;
}

.upload-box input {
  display: none;
}

.upload-box span {
  display: block;
  font-size: 16px;
}

.upload-box small {
  color: var(--muted);
  display: block;
  font-weight: 500;
  margin-top: 6px;
}

.ai-box {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

.ai-box small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 9px;
  margin-bottom: 12px;
}

.check-row input {
  min-height: auto;
  width: auto;
}

.preview {
  aspect-ratio: 9 / 16;
  background: #eef1f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  margin-bottom: 14px;
  object-fit: contain;
  width: 100%;
}

.hidden {
  display: none;
}

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 720;
  min-height: 42px;
  padding: 10px 14px;
}

.primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

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

.status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 10px;
  min-height: 20px;
}

.secondary {
  background: #243241;
  color: white;
}

.ghost {
  background: #eef3f6;
  color: #253442;
}

.empty {
  color: var(--muted);
}

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

.insight-row {
  align-items: center;
  border-bottom: 1px solid #edf0f3;
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
}

.insight-row b {
  color: var(--ink);
}

.swatch {
  border: 1px solid #c8d1da;
  border-radius: 50%;
  display: inline-block;
  height: 20px;
  margin-left: 8px;
  vertical-align: middle;
  width: 20px;
}

.script-output {
  display: grid;
  gap: 16px;
}

.script-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.script-card header {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.script-card h3 {
  font-size: 16px;
  margin: 0;
}

.script-card ol {
  margin: 0;
  padding: 12px 18px 14px 34px;
}

.script-card li {
  line-height: 1.55;
  margin: 8px 0;
}

.caption {
  background: #fbfcfd;
  border-top: 1px solid var(--line);
  line-height: 1.55;
  padding: 12px 14px;
}

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

.metrics-table table {
  border-collapse: collapse;
  margin-top: 16px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 10px 8px;
  text-align: left;
}

th {
  color: #425163;
  font-weight: 760;
}

.strategy {
  background: #fff8f1;
  border: 1px solid #f0d6be;
  border-radius: 8px;
  color: #3d2c1e;
  line-height: 1.6;
  margin-top: 16px;
  padding: 14px;
}

@media (max-width: 980px) {
  .workspace,
  .wide {
    display: block;
  }

  .panel {
    margin-bottom: 16px;
  }

  .metrics-grid,
  .two {
    grid-template-columns: 1fr;
  }

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