:root {
  --midnight: #17213d;
  --purple: #6750a4;
  --gold: #d7a642;
  --cream: #fbf6ea;
  --sage: #6f936f;
  --ink: #202332;
}

body {
  background: radial-gradient(circle at top left, rgba(215,166,66,.14), transparent 28rem), var(--cream);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3, h4, h5, .navbar-brand {
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
}

.navbar {
  background: var(--midnight);
}

.navbar .nav-link, .navbar-brand {
  color: #fff;
}

.navbar .nav-link:hover, .navbar-brand:hover {
  color: var(--gold);
}

.btn-primary {
  --bs-btn-bg: var(--purple);
  --bs-btn-border-color: var(--purple);
  --bs-btn-hover-bg: #523f88;
  --bs-btn-hover-border-color: #523f88;
}

.btn-warning {
  --bs-btn-bg: var(--gold);
  --bs-btn-border-color: var(--gold);
  --bs-btn-color: #1d1b16;
}

.story-card, .wizard-panel, .editor-panel, .stat-card {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(23,33,61,.08);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(23,33,61,.08);
}

.hero {
  min-height: 72vh;
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(23,33,61,.88), rgba(23,33,61,.35)),
    url("../theme/images/slider-imgs/slide1-img.jpg") center/cover;
  color: #fff;
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 5rem);
}

.progress-bar {
  background-color: var(--sage);
}

.badge-soft {
  background: rgba(103,80,164,.12);
  color: var(--purple);
}

.wizard-step {
  border-left: 4px solid var(--gold);
}

.editor-workspace,
.editor-workspace > .row {
  min-height: calc(100vh - 88px);
}

.editor-main-column {
  display: flex;
}

.editor-panel[data-editor-panel] {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100vh - 96px);
}

.chapter-content {
  flex: 1 1 auto;
  height: 100%;
  min-height: calc(100vh - 230px);
  resize: none;
  line-height: 1.7;
  overflow: auto;
}

.editor-panel.is-ai-busy {
  cursor: progress;
}

.ai-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 33, 61, .42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}

.ai-loading-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.ai-loading-card {
  width: min(360px, 100%);
  padding: 28px;
  text-align: center;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 24px 80px rgba(23, 33, 61, .24);
}

.ai-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: block;
}

.ai-loading-title {
  font-weight: 800;
  color: var(--midnight);
}

.ai-loading-subtitle {
  margin-top: 4px;
  color: #62657a;
  font-size: 14px;
}

body.ai-loading-active {
  overflow: hidden;
}

body.ai-loading-active .app-shell {
  user-select: none;
}

.editor-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-radius: 0;
  background: #fffdf8;
}

.editor-panel.is-fullscreen .chapter-content {
  flex: 1;
  height: 100%;
  min-height: 0;
  resize: none;
  font-size: 18px;
}

body.editor-fullscreen-active {
  overflow: hidden;
}

.sidebar-nav .list-group-item.active {
  background: var(--midnight);
  border-color: var(--midnight);
}

.autosave {
  color: var(--sage);
  font-weight: 700;
}

.table > :not(caption) > * > * {
  background: transparent;
}
