/* Match Magic Flatplan purple brand (same family as brief editor / home) */
.ba-page .main {
  background: var(--surface);
}

.ba-page .content {
  max-width: none;
  background: var(--surface);
  color: var(--ink);
}

.ba-page .topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.ba-hero {
  background: linear-gradient(135deg, #4538a0 0%, #6b5cd6 55%, #a29bff 100%);
  color: #fff;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.ba-hero h1,
.ba-hero .page-title {
  color: #fff;
  margin: 0 0 0.4rem;
}
.ba-hero p,
.ba-hero .page-sub {
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  max-width: 52rem;
  font-size: 0.92rem;
}

.ba-principle {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.ba-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.ba-step-btn {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.ba-step-btn.active {
  background: var(--brand-dark, #4538a0);
  color: #fff;
  border-color: var(--brand-dark, #4538a0);
}
.ba-step-btn .role {
  font-weight: 400;
  opacity: 0.85;
  font-size: 0.72rem;
  display: block;
}

.ba-panel { display: none; }
.ba-panel.active { display: block; }

.ba-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.ba-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.ba-table th {
  position: sticky;
  top: 0;
  background: var(--brand-light, #e6e0ff);
  color: var(--brand-ink-on-light, #3d3489);
  text-align: left;
  padding: 0.5rem 0.45rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--brand-mid, #a29bff);
  z-index: 1;
}
.ba-table td {
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ba-table tr:hover td { background: rgba(69, 56, 160, 0.05); }
.ba-table tr.selected td { background: #f5f3ff; }
.ba-table input,
.ba-table select,
.ba-table textarea {
  width: 100%;
  min-width: 4rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
  background: #fff;
}
.ba-table textarea { min-height: 2.5rem; resize: vertical; }
.ba-table .ba-prompt-cell textarea { min-height: 3.5rem; background: #faf5ff; }
.ba-th-hint {
  display: block;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
  font-size: 0.62rem;
}
.ba-prompt-cell {
  min-width: 11rem;
}
.ba-prompt-upload {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ba-prompt-upload label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #7c6fe8);
  cursor: pointer;
  margin: 0;
}
.ba-prompt-upload label:hover { text-decoration: underline; }
.ba-prompt-upload input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}
.ba-prompt-upload .ba-upload-icon {
  font-size: 0.85rem;
  line-height: 1;
}
.ba-prompt-upload .ba-upload-name {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  word-break: break-all;
}
.ba-prompt-upload .ba-upload-name.has-file {
  color: var(--brand-ink-on-light, #3d3489);
  background: var(--brand-light, #e6e0ff);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--brand-mid, #a29bff);
}
.ba-prompt-upload--image label { color: var(--brand-ink-on-light, #3d3489); }
.ba-prompt-cell--image textarea { background: #faf8ff; }

.ba-summary-cell textarea {
  min-height: 3rem;
  background: #fff;
}

.ba-slot-cell input {
  min-width: 5.5rem;
}

.ba-run-history {
  min-width: 7.5rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.ba-run-entry {
  display: block;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.ba-run-entry:last-child {
  border-bottom: none;
}

.ba-run-entry time {
  color: var(--muted);
  font-size: 0.65rem;
}

.ba-run-entry .ba-run-type {
  font-weight: 600;
  color: var(--brand-ink-on-light, #3d3489);
}

.ba-run-none {
  color: var(--muted);
  font-style: italic;
}

.ba-articles-created input {
  max-width: 3.5rem;
  text-align: center;
  font-weight: 700;
  color: var(--brand-ink-on-light, #3d3489);
  background: var(--brand-light, #e6e0ff);
  border-color: var(--brand-mid, #a29bff);
}

.ba-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.ba-prompt-lab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .ba-prompt-lab { grid-template-columns: 1fr; }
}
.ba-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.ba-card h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }

.ba-version-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ba-version-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.ba-version-list li.locked { background: var(--brand-light, #e6e0ff); }
.ba-badge-locked {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand-ink-on-light, #3d3489);
  background: var(--brand-mid, #a29bff);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.ba-output-list {
  display: grid;
  gap: 0.65rem;
}
.ba-output-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: start;
}
.ba-output-item h4 { margin: 0; font-size: 0.95rem; }
.ba-output-item .synopsis { font-size: 0.82rem; color: var(--muted); margin: 0.25rem 0 0; }
.ba-output-item .score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-ink-on-light, #3d3489);
  background: var(--brand-light, #e6e0ff);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.ba-test-preview {
  background: #1c1917;
  color: #e7e5e4;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.55;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
}
