/* Story Engine — render section */

.render-section { margin-top: 58px; scroll-margin-top: 24px; }

.render-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.engine-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}
.engine-card > header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.engine-tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6d675d;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
}
.engine-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #f2ede4;
}
.engine-state {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.engine-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5e594f;
}
.engine-state[data-state="online"] { color: var(--green); }
.engine-state[data-state="online"]::before { background: var(--green); }
.engine-state[data-state="offline"] { color: var(--red); }
.engine-state[data-state="offline"]::before { background: var(--red); }
.engine-state[data-state="busy"] { color: var(--gold); }
.engine-state[data-state="busy"]::before { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.engine-card > p {
  margin: 0 0 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #8a847a;
}

.engine-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.engine-controls label { font-size: 10.5px; color: var(--muted); letter-spacing: 0.01em; }
.engine-controls select,
.engine-controls input[type="text"],
.engine-controls input:not([type]) { font-size: 11.5px; padding: 8px 10px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-dim);
  margin-top: 2px;
}
.check-row input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: #d8b273;
  margin: 0;
  cursor: pointer;
}

.workflow-name {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5f5a51;
  margin-top: -4px;
}

.engine-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.engine-actions .primary { padding: 10px 16px; font-size: 11.5px; }

.progress {
  margin-top: 14px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold-bright));
  transition: width 0.18s linear;
}

.engine-meta {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: #6a655b;
  min-height: 15px;
}
.engine-meta strong { color: var(--gold-soft); font-weight: 500; }
.engine-meta.error { color: var(--red); }

.render-stage {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #040405;
}
.render-stage canvas { display: block; width: 100%; height: auto; }

.preview-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}
.preview-card video {
  display: block;
  width: 100%;
  border-radius: 7px;
  background: #000;
  max-height: 62vh;
}
.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
}
.preview-foot a {
  color: var(--gold-bright);
  border-bottom: 1px solid rgba(230, 195, 131, 0.35);
  padding-bottom: 1px;
}

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