/* L14 — Novel workflow UI: hint banner, plan editor, per-chapter Run button.
 *
 * Style philosophy: low-key, instructive. The hint banner is the primary
 * onboarding surface for novel projects — it tells the author what to do
 * next at each state. Plan editor uses card-per-chapter so edits feel direct.
 */

/* -- Hint banner (top of workspace, per workflow_run state) ------------- */

.novel-hint-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px 14px;
  background: var(--bg-elevated, #fffaf2);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  border-left: 4px solid var(--accent-amber, #d4a017);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
}

.novel-hint-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 1px;
}

.novel-hint-body {
  flex: 1;
  min-width: 0;
}

.novel-hint-body button {
  margin-left: 8px;
  vertical-align: baseline;
}

/* -- Per-chapter Run button (rendered inline in outline tree node row) -- */

.outline-chapter-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 6px;
  background: var(--accent-blue, #2563eb);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.outline-chapter-run-btn:hover {
  opacity: 1;
}

.outline-chapter-run-btn[disabled] {
  background: var(--text-hint, #94a3b8);
  cursor: not-allowed;
  opacity: 0.6;
}

.outline-chapter-run-btn--running {
  background: var(--accent-amber, #d4a017);
  cursor: wait;
}

.outline-chapter-run-btn--done {
  background: var(--accent-green, #16a34a);
}

.outline-chapter-run-btn--needs-revision {
  background: var(--accent-red, #dc2626);
}

/* Chapter status badge (small, beside the title in outline tree). */
.outline-chapter-status {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 8px;
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-secondary, #475569);
}

.outline-chapter-status[data-status="approved"] { background: #dcfce7; color: #15803d; }
.outline-chapter-status[data-status="needs_revision"] { background: #fee2e2; color: #b91c1c; }
.outline-chapter-status[data-status="drafting"] { background: #fef3c7; color: #b45309; }

/* -- Plan editor modal (chapter cards + section blocks) ----------------- */

.novel-plan-editor {
  max-height: 75vh;
  overflow-y: auto;
}

.novel-plan-editor h4 {
  margin: 18px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #64748b);
}

.novel-plan-editor .muted {
  color: var(--text-hint, #94a3b8);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.novel-plan-hint {
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--bg-elevated, #fefefe);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.novel-plan-meta {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.65;
}

.novel-plan-meta div + div {
  margin-top: 4px;
}

.novel-chapter-card {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 4px;
}

.novel-chapter-head {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.novel-chapter-head input {
  font-family: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--border-input, rgba(0, 0, 0, 0.12));
  border-radius: 3px;
  background: var(--bg-input, #fff);
  color: var(--text-primary);
}

.novel-chapter-head .novel-ch-num {
  width: 36px;
  text-align: center;
  font-weight: 600;
  background: var(--bg-subtle, #f1f5f9);
}

.novel-chapter-head .novel-ch-title {
  flex: 1;
  font-weight: 600;
}

.novel-chapter-head .novel-ch-pov {
  width: 110px;
}

.novel-chapter-head .novel-ch-words {
  width: 70px;
}

.novel-chapter-body label {
  display: block;
  margin: 6px 0 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #64748b);
}

.novel-chapter-body textarea {
  width: 100%;
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 8px;
  border: 1px solid var(--border-input, rgba(0, 0, 0, 0.12));
  border-radius: 3px;
  resize: vertical;
  background: var(--bg-input, #fff);
  color: var(--text-primary);
}

.novel-chapter-body ul {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.novel-char-list,
.novel-ability-list,
.novel-artifact-list {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.6;
}

.novel-world-block {
  padding: 8px 10px;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.65;
}

.novel-world-block div + div {
  margin-top: 4px;
}

.novel-plan-footer {
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  padding-top: 10px;
}

.novel-plan-footer .btn-warning {
  margin-right: auto;
  background: transparent;
  color: var(--accent-red, #dc2626);
  border: 1px solid var(--accent-red, #dc2626);
}

/* -- Clarify modal extras ---------------------------------------------- */

.novel-clarify-hint {
  padding: 8px 10px;
  margin-bottom: 12px;
  background: var(--bg-subtle, #f8fafc);
  border-left: 3px solid var(--accent-blue, #2563eb);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.novel-clarify-category {
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--text-tertiary, #64748b);
}

.novel-clarify-category em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-blue, #2563eb);
}

.novel-clarify-question {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}

.novel-clarify-tip {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-hint, #94a3b8);
}

.novel-loader-spinner {
  font-size: 28px;
  animation: novel-spin 2s linear infinite;
  display: inline-block;
}

@keyframes novel-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Modal round counter — reused by clarify modal */
.modal-round {
  font-weight: 400;
  color: var(--text-hint, #94a3b8);
  font-size: 12px;
}
