.onboarding-shell {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: start center;
  padding: 2rem 0 3rem;
}

.onboarding-panel {
  width: min(920px, 100%);
  background: var(--bs-body-bg);
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(31, 42, 68, .08);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.onboarding-progress {
  display: grid;
  gap: .55rem;
  margin-bottom: 2rem;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-progress-track {
  height: .55rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 42, 68, .12);
}

.onboarding-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bs-primary);
}

.onboarding-stepper {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: .45rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.onboarding-stepper li {
  position: relative;
  display: grid;
  gap: .35rem;
  min-width: 0;
  color: var(--bs-secondary-color);
}

.onboarding-stepper li::before {
  content: "";
  position: absolute;
  top: .7rem;
  left: calc(-50% + .7rem);
  width: calc(100% - .45rem);
  height: 2px;
  background: rgba(31, 42, 68, .14);
}

.onboarding-stepper li:first-child::before {
  content: none;
}

.onboarding-stepper span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.45rem;
  aspect-ratio: 1;
  border: 1px solid rgba(31, 42, 68, .18);
  border-radius: 50%;
  background: var(--bs-body-bg);
  color: var(--bs-secondary-color);
  font-size: .72rem;
  font-weight: 800;
}

.onboarding-stepper strong {
  overflow-wrap: anywhere;
  font-size: .72rem;
  line-height: 1.2;
}

.onboarding-stepper .is-complete,
.onboarding-stepper .is-current {
  color: var(--bs-body-color);
}

.onboarding-stepper .is-complete::before,
.onboarding-stepper .is-current::before {
  background: rgba(47, 111, 99, .38);
}

.onboarding-stepper .is-complete span {
  border-color: #2f6f63;
  background: #2f6f63;
  color: #fff;
}

.onboarding-stepper .is-complete span::before {
  content: "";
  width: .45rem;
  height: .7rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.onboarding-stepper .is-complete span {
  font-size: 0;
}

.onboarding-stepper .is-current span {
  border-color: #b68a46;
  box-shadow: 0 0 0 .22rem rgba(182, 138, 70, .18);
  color: #755624;
}

.onboarding-stepper--complete .is-complete:last-child span {
  border-color: #b68a46;
  background: #b68a46;
}

.onboarding-copy {
  max-width: 680px;
  margin-bottom: 1.5rem;
}

.onboarding-copy h1 {
  margin-bottom: .75rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.onboarding-copy p:not(.eyebrow) {
  font-size: 1.08rem;
  color: var(--bs-secondary-color);
}

.onboarding-option-grid {
  display: grid;
  gap: .9rem;
}

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

.onboarding-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  margin-bottom: 1rem;
}

.onboarding-option-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.onboarding-option-card input {
  position: absolute;
  opacity: 0;
}

.onboarding-option-card span {
  display: grid;
  gap: .35rem;
  min-height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(31, 42, 68, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.onboarding-option-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: var(--bs-body-color);
}

.onboarding-option-card small {
  color: var(--bs-secondary-color);
  line-height: 1.45;
}

.onboarding-option-card em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(47, 111, 99, .12);
  color: #2f6f63;
  font-size: .72rem;
  font-style: normal;
  padding: .2rem .55rem;
}

.onboarding-option-card input:checked + span {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, .16);
}

.onboarding-option-card:hover span {
  transform: translateY(-1px);
}

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.onboarding-form-section {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .45);
}

.onboarding-form-section h2 {
  margin: 0;
  font-size: 1.05rem;
}

.onboarding-summary {
  display: grid;
  gap: .8rem;
  margin: 0;
}

.onboarding-companion-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: center;
  margin: 1rem 0 1.25rem;
  padding: 1.1rem;
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 111, 99, .1), rgba(182, 138, 70, .12));
}

.onboarding-companion-mark {
  position: relative;
  width: 4.25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(47, 111, 99, .12);
  display: grid;
  place-items: center;
}

.onboarding-companion-mark::before,
.onboarding-companion-mark::after {
  content: "";
  position: absolute;
  inset: .55rem;
  border: 2px solid rgba(47, 111, 99, .28);
  border-radius: 50%;
  animation: onboardingPulse 1.8s ease-out infinite;
}

.onboarding-companion-mark::after {
  animation-delay: .6s;
}

.onboarding-companion-mark span {
  width: 1.25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #b68a46;
  box-shadow: 0 0 0 .45rem rgba(182, 138, 70, .18);
}

.onboarding-companion-card.is-connected .onboarding-companion-mark span,
.word-companion-presence-pill.is-connected .word-companion-presence-dot {
  background: #2f6f63;
}

.onboarding-companion-card.is-connected .onboarding-companion-mark::before,
.onboarding-companion-card.is-connected .onboarding-companion-mark::after {
  animation-play-state: paused;
  border-color: rgba(47, 111, 99, .18);
}

.onboarding-companion-body h2 {
  margin: 0 0 .35rem;
  font-size: 1.35rem;
}

.onboarding-companion-body p:not(.eyebrow) {
  margin: 0;
  color: var(--bs-secondary-color);
}

.onboarding-companion-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0 0;
}

.onboarding-companion-details div {
  min-width: 0;
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  padding: .75rem;
  background: rgba(255, 255, 255, .56);
}

.onboarding-companion-details dt {
  color: var(--bs-secondary-color);
  font-weight: 700;
  font-size: .82rem;
}

.onboarding-companion-details dd {
  margin: .15rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.onboarding-scan-panel {
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(31, 42, 68, .1);
  padding-top: 1rem;
}

.onboarding-scan-status {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-scan-progress {
  height: .5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 42, 68, .12);
}

.onboarding-scan-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2f6f63;
  transition: width .18s ease;
}

.onboarding-scan-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}

.onboarding-scan-counts div {
  min-width: 0;
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  padding: .75rem;
  background: rgba(255, 255, 255, .62);
}

.onboarding-scan-counts span {
  display: block;
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-scan-counts strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.2rem;
}

.onboarding-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.onboarding-scan-next {
  margin: .25rem 0 0;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-build-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem .85rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid rgba(47, 111, 99, .18);
  border-radius: 8px;
  background: rgba(47, 111, 99, .07);
}

.onboarding-build-panel .onboarding-scan-progress {
  grid-column: 1 / -1;
}

.onboarding-build-message {
  margin: .2rem 0 0;
  color: var(--bs-secondary-color);
}

.onboarding-build-panel > strong {
  color: #2f6f63;
  font-size: 1.1rem;
}

.onboarding-build-panel.is-running {
  border-color: rgba(47, 111, 99, .34);
}

.onboarding-review-panel {
  width: min(1120px, 100%);
}

.onboarding-review-counts {
  margin-bottom: 1.25rem;
}

.onboarding-review-panel .onboarding-review-counts {
  position: sticky;
  top: .75rem;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.onboarding-review-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.onboarding-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
  gap: 1rem;
}

.onboarding-review-section {
  display: grid;
  align-content: start;
  gap: .8rem;
}

.onboarding-review-section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.onboarding-character-filter {
  display: grid;
  gap: .35rem;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-empty-state {
  margin: 0;
  padding: .8rem;
  border: 1px dashed rgba(31, 42, 68, .2);
  border-radius: 8px;
  color: var(--bs-secondary-color);
  background: rgba(255, 255, 255, .55);
}

.onboarding-review-chapters {
  display: grid;
  gap: .85rem;
}

.onboarding-review-chapter {
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 255, 255, .58);
}

.onboarding-review-chapter summary {
  display: grid;
  gap: .2rem;
  margin-bottom: .75rem;
  cursor: pointer;
}

.onboarding-review-chapter summary span,
.onboarding-review-chapter summary small,
.onboarding-review-chapter li span {
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-review-chapter ol,
.onboarding-character-candidates,
.onboarding-character-groups {
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-review-chapter li,
.onboarding-character-candidates li {
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  padding: .75rem;
  background: rgba(255, 255, 255, .64);
}

.onboarding-review-chapter li {
  display: grid;
  gap: .45rem;
}

.onboarding-review-chapter li p {
  margin: .2rem 0 0;
  color: var(--bs-secondary-color);
}

[data-story-intelligence-onboarding] .onboarding-review-counts {
  position: static;
  margin-bottom: 1rem;
}

[data-story-intelligence-onboarding] > .onboarding-review-counts {
  gap: .9rem;
}

[data-story-intelligence-onboarding] > .onboarding-review-counts div {
  padding: 1rem;
}

[data-story-intelligence-onboarding] > .onboarding-review-counts strong {
  font-size: 1.45rem;
  line-height: 1.2;
}

[data-story-intelligence-onboarding] .onboarding-review-grid {
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.35fr);
  gap: 1.25rem;
}

[data-story-intelligence-onboarding] .onboarding-review-section {
  gap: 1rem;
}

[data-story-intelligence-onboarding] .onboarding-review-chapter {
  padding: 1.15rem;
}

[data-story-intelligence-onboarding] .onboarding-review-chapter summary {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
}

[data-story-intelligence-onboarding] .onboarding-review-chapter summary strong {
  white-space: normal;
  text-align: right;
}

[data-story-latest-summary] {
  margin: 0;
  padding: 1rem;
  border-left: 4px solid #2f6f63;
  border-radius: 8px;
  background: rgba(47, 111, 99, .08);
  color: #1f2a44;
}

.story-live-progress {
  width: min(1180px, 100%);
  max-width: none;
  padding: clamp(1.25rem, 2vw, 1.75rem);
}

.story-live-hero h1 {
  white-space: nowrap;
  font-size: clamp(2.6rem, 4vw, 3.6rem);
}

.story-live-hero {
  max-width: none;
  margin-bottom: 1rem;
}

.story-live-hero p:not(.eyebrow) {
  max-width: none;
}

.story-live-progress > .alert {
  margin-bottom: .85rem;
  padding: .65rem .9rem;
}

.story-live-progress > .alert-info {
  white-space: nowrap;
}

.story-live-progress-card,
.story-live-current,
.story-live-feed-grid,
.story-review-summary,
.story-review-chapter-card {
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
}

.story-live-progress-card {
  display: grid;
  gap: .65rem;
  padding: .9rem;
}

.story-live-progress-heading,
.story-review-chapter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

summary.story-review-chapter-heading {
  cursor: pointer;
}

.story-review-chapter-heading p:not(.eyebrow) {
  margin: .25rem 0 0;
  color: var(--bs-secondary-color);
}

.story-live-progress-heading strong {
  display: block;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
}

.story-live-progress-heading > span,
.story-review-status {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  padding: .25rem .7rem;
  background: rgba(47, 111, 99, .12);
  color: #2f6f63;
  font-weight: 800;
  white-space: nowrap;
}

.story-live-stats,
.story-review-summary,
.story-review-scene-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}

.story-live-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.story-live-stats div,
.story-review-summary div,
.story-review-scene-panel div {
  min-width: 0;
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  padding: .65rem .75rem;
  background: rgba(255, 255, 255, .58);
}

.story-live-stats span,
.story-review-summary span,
.story-review-scene-panel span {
  display: block;
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-live-stats strong,
.story-review-summary strong,
.story-review-scene-panel strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.12rem;
  line-height: 1.2;
  white-space: nowrap;
}

.story-stat-value {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
}

.story-live-current,
.story-live-feed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: .85rem;
  margin-top: .75rem;
  padding: .9rem;
}

.story-live-current h2,
.story-live-feed-grid h2,
.story-review-chapter-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.story-current-scene-panel {
  display: grid;
  align-content: start;
  gap: .35rem;
}

.story-chapter-progress {
  display: grid;
  gap: .35rem;
  margin-top: .2rem;
}

.story-chapter-progress span {
  color: var(--bs-secondary-color);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
}

.story-chapter-progress .progress {
  height: .45rem;
}

.story-live-feed-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.story-live-feed-grid > div {
  min-width: 0;
}

.story-live-feed-grid h2 {
  margin-bottom: .55rem;
}

.story-latest-summary[data-story-latest-summary] {
  padding: 1.1rem 1.15rem;
  border-left-width: 6px;
  font-size: 1.12rem;
  line-height: 1.55;
}

.story-live-feed-grid [data-story-latest-empty] {
  margin: 0;
  padding: 1rem 1.1rem;
  border-left: 6px solid #2f6f63;
  border-radius: 8px;
  background: rgba(47, 111, 99, .08);
}

.story-live-discoveries {
  display: grid;
  gap: .45rem;
}

.story-discovery-placeholder {
  margin: 0;
  font-size: .95rem;
}

.story-review-page {
  display: grid;
  gap: 1rem;
}

.story-pipeline-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.story-pipeline-current {
  display: grid;
  gap: .15rem;
}

.story-pipeline-current h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.story-pipeline-current p:not(.eyebrow) {
  margin: 0;
  color: var(--bs-secondary-color);
  font-weight: 800;
}

.story-pipeline-progress {
  margin-bottom: 0;
}

.story-pipeline-phase-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-pipeline-phase-list > li {
  display: grid;
  align-content: start;
  gap: .45rem;
  min-width: 0;
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  padding: .85rem;
  background: rgba(255, 255, 255, .58);
}

.story-pipeline-phase-list > li.is-current {
  border-color: rgba(47, 111, 99, .42);
  background: rgba(47, 111, 99, .08);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 99, .12);
}

.story-pipeline-phase-list > li.is-complete {
  background: rgba(47, 111, 99, .06);
}

.story-pipeline-phase-list > li.is-complete > strong::before {
  content: "✓ ";
  color: #2f6f63;
}

.story-pipeline-phase-list > li > strong {
  font-size: .98rem;
}

.story-pipeline-phase-list > li > span {
  color: var(--bs-secondary-color);
  font-size: .82rem;
  font-weight: 800;
}

.story-pipeline-phase-list ul {
  display: grid;
  gap: .2rem;
  margin: .25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--bs-secondary-color);
  font-size: .8rem;
}

.story-pipeline-review-list li {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.story-pipeline-review-list li strong {
  font-size: .82rem;
}

.story-pipeline-review-list li span {
  width: 1rem;
  color: var(--bs-secondary-color);
  font-weight: 900;
}

.story-pipeline-review-list li.is-complete span {
  color: #2f6f63;
}

.story-pipeline-review-list li.is-current {
  color: var(--bs-body-color);
}

.story-pipeline-review-list li.is-current span,
.story-pipeline-review-list li.is-current strong {
  color: var(--bs-primary);
}

.story-pipeline-review-list li em {
  color: var(--bs-secondary-color);
  font-size: .74rem;
  font-style: normal;
  font-weight: 800;
}

.story-review-heading {
  display: grid;
  gap: .15rem;
}

.story-review-heading p {
  margin: 0;
}

.story-review-heading__phase {
  color: var(--bs-secondary-color);
  font-size: .92rem;
  font-weight: 800;
}

.story-review-heading__stage {
  color: var(--bs-secondary-color);
  font-size: .84rem;
  font-weight: 800;
}

.story-database-build {
  display: grid;
  gap: .8rem;
  border: 1px solid rgba(47, 111, 99, .18);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(47, 111, 99, .07);
}

.story-database-build h2 {
  margin: 0;
  font-size: 1.2rem;
}

.story-database-build ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-database-build li {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 800;
}

.story-database-build li span {
  color: #2f6f63;
  font-weight: 900;
}

.story-database-build li em {
  color: var(--bs-secondary-color);
  font-size: .76rem;
  font-style: normal;
  font-weight: 800;
  margin-left: auto;
}

.story-database-build li.is-upcoming {
  color: var(--bs-secondary-color);
}

.story-database-build li.is-upcoming span {
  color: var(--bs-secondary-color);
}

.story-review-summary {
  padding: 1rem;
}

.story-review-chapter-list {
  display: grid;
  gap: .9rem;
}

.story-review-chapter-card {
  display: grid;
  gap: .9rem;
  padding: 1rem;
}

.story-review-status--created {
  background: rgba(47, 111, 99, .16);
}

.story-review-status--ready {
  background: rgba(47, 111, 99, .12);
}

.story-review-status--active {
  background: rgba(182, 138, 70, .14);
  color: #755624;
}

.story-review-status--warning {
  background: rgba(176, 58, 46, .12);
  color: #8a2f25;
}

.story-review-note {
  margin: 0;
  border-left: 4px solid rgba(47, 111, 99, .45);
  border-radius: 8px;
  padding: .8rem 1rem;
  background: rgba(47, 111, 99, .07);
  color: var(--bs-secondary-color);
}

.story-review-note ul {
  margin: .35rem 0 0;
  padding-left: 1.1rem;
}

.story-review-note--warning {
  border-left-color: rgba(176, 58, 46, .5);
  background: rgba(176, 58, 46, .07);
}

.story-review-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}

.story-pipeline-stepper small {
  display: block;
  color: var(--bs-secondary-color);
  font-size: .72rem;
  font-weight: 700;
  margin-top: .15rem;
}

.story-character-card-grid,
.story-future-stage-grid {
  display: grid;
  gap: .75rem;
}

.story-character-card {
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .64);
  padding: .8rem;
}

.story-character-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  cursor: pointer;
}

.story-character-card summary span {
  display: grid;
  gap: .1rem;
  min-width: 0;
}

.story-character-card summary small,
.story-character-card summary em {
  color: var(--bs-secondary-color);
  font-size: .82rem;
  font-style: normal;
  font-weight: 700;
}

.story-character-card__body {
  display: grid;
  gap: .75rem;
  padding-top: .85rem;
}

.story-character-card__body dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin: 0;
}

.story-character-card__body dt {
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-character-card__body dd {
  margin: .15rem 0 0;
}

.story-character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.story-character-actions legend {
  width: 100%;
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-character-actions label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 700;
}

.story-future-stage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1rem 0;
}

.story-future-stage {
  border: 1px dashed rgba(31, 42, 68, .22);
  border-radius: 8px;
  padding: .85rem;
  background: rgba(255, 255, 255, .45);
}

.story-future-stage strong,
.story-future-stage span {
  display: block;
}

.story-future-stage span {
  color: var(--bs-secondary-color);
  font-size: .84rem;
  font-weight: 700;
  margin-top: .2rem;
}

.story-scene-preview-list {
  display: grid;
  gap: .65rem;
}

.story-scene-preview {
  display: grid;
  gap: .45rem;
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  padding: .75rem;
  background: rgba(255, 255, 255, .58);
}

.story-scene-preview > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.story-scene-preview p {
  margin: 0;
}

.story-scene-preview dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin: 0;
}

.story-scene-preview dt {
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-scene-preview dd {
  margin: .1rem 0 0;
}

.story-review-admin {
  border-top: 1px solid rgba(31, 42, 68, .1);
  padding-top: .75rem;
}

.story-review-admin summary {
  cursor: pointer;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.story-review-admin dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin: .75rem 0 0;
}

.story-review-admin div {
  min-width: 0;
  border: 1px solid rgba(31, 42, 68, .1);
  border-radius: 8px;
  padding: .65rem;
}

.story-review-admin dt {
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.story-review-admin dd {
  margin: .15rem 0 0;
  overflow-wrap: anywhere;
}

[data-story-discovery-feed] {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--bs-secondary-color);
}

.onboarding-character-candidates li {
  display: grid;
  gap: .5rem;
}

.onboarding-review-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
}

.onboarding-review-field {
  display: grid;
  gap: .25rem;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-character-groups section {
  display: grid;
  gap: .5rem;
}

.onboarding-character-groups h3 {
  margin: 0;
  font-size: 1rem;
}

.onboarding-excluded-candidates {
  border-top: 1px solid rgba(31, 42, 68, .12);
  padding-top: .65rem;
}

.onboarding-excluded-candidates summary {
  cursor: pointer;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-excluded-candidates .onboarding-character-candidates {
  margin-top: .65rem;
}

.onboarding-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
}

.onboarding-summary dt {
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-summary dd {
  margin: 0;
}

.onboarding-success-heading {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.onboarding-success-heading span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #2f6f63;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 800;
  box-shadow: 0 0 0 .38rem rgba(47, 111, 99, .12);
}

.onboarding-success-heading h1 {
  margin: 0;
}

.onboarding-complete-next {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .58);
}

.onboarding-complete-next h2 {
  margin: 0 0 .35rem;
  font-size: 1.2rem;
}

.onboarding-complete-next p {
  margin: 0;
  color: var(--bs-secondary-color);
}

.onboarding-story-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}

.onboarding-story-facts div,
.onboarding-story-card,
.story-intelligence-dashboard-card {
  border: 1px solid rgba(31, 42, 68, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
}

.onboarding-story-facts div {
  display: grid;
  gap: .35rem;
  padding: 1rem;
}

.onboarding-story-facts span {
  color: #2f6f63;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-story-facts strong {
  font-size: 1.05rem;
}

.onboarding-story-facts p,
.onboarding-story-card p {
  margin: 0;
  color: var(--bs-secondary-color);
}

.onboarding-story-card {
  display: grid;
  gap: .7rem;
  padding: 1rem;
}

.onboarding-story-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.onboarding-story-progress {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid rgba(47, 111, 99, .18);
  border-radius: 8px;
  background: rgba(47, 111, 99, .07);
}

.story-intelligence-dashboard-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
}

.story-intelligence-dashboard-card--compact {
  padding: .9rem 1rem;
}

.story-intelligence-dashboard-card--compact h2 {
  font-size: 1.15rem;
}

.story-intelligence-dashboard-card--compact p:not(.eyebrow) {
  font-size: .95rem;
}

.story-intelligence-dashboard-card h2 {
  margin: 0 0 .35rem;
  font-size: 1.25rem;
}

.story-intelligence-dashboard-card p {
  margin: 0;
  color: var(--bs-secondary-color);
}

.story-intelligence-status-list {
  display: grid;
  gap: .35rem;
  margin-top: .7rem;
}

.story-intelligence-status-list__item {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: baseline;
}

.story-intelligence-status-list__item span {
  color: var(--bs-secondary-color);
  font-size: .9rem;
}

.story-intelligence-dashboard-progress {
  display: grid;
  grid-template-columns: auto auto;
  gap: .45rem .75rem;
  align-items: center;
  margin-top: .75rem;
  max-width: 420px;
}

.story-intelligence-dashboard-progress .onboarding-scan-progress {
  grid-column: 1 / -1;
}

.story-intelligence-dashboard-progress span {
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.onboarding-dashboard-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(47, 111, 99, .18);
  border-radius: 8px;
  background: rgba(47, 111, 99, .08);
}

.onboarding-dashboard-nudge h2 {
  margin: 0 0 .35rem;
  font-size: 1.25rem;
}

.onboarding-dashboard-nudge p:not(.eyebrow) {
  margin: 0;
  color: var(--bs-secondary-color);
}

.onboarding-dashboard-nudge.is-connected {
  border-color: rgba(47, 111, 99, .28);
  background: rgba(47, 111, 99, .12);
}

.word-companion-presence-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 31px;
  border: 1px solid rgba(31, 42, 68, .16);
  border-radius: 999px;
  padding: .25rem .7rem;
  background: rgba(255, 255, 255, .72);
  color: var(--bs-body-color);
  font-size: .875rem;
  font-weight: 700;
}

.word-companion-presence-dot {
  width: .58rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #b68a46;
}

.word-companion-presence-pill.is-offline .word-companion-presence-dot {
  background: #8b949e;
}

@keyframes onboardingPulse {
  0% {
    opacity: .75;
    transform: scale(.76);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@media (max-width: 720px) {
  .story-pipeline-phase-list,
  .story-database-build ul {
    grid-template-columns: 1fr;
  }

  .onboarding-choice-grid,
  .onboarding-option-grid--software {
    grid-template-columns: 1fr;
  }

  .onboarding-shell {
    padding-top: 1rem;
  }

  .onboarding-stepper {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .35rem;
    scroll-snap-type: x proximity;
  }

  .onboarding-stepper li {
    flex: 0 0 7.2rem;
    scroll-snap-align: start;
  }

  .onboarding-stepper li::before {
    width: 6rem;
    left: -6.35rem;
  }

  .onboarding-dashboard-nudge,
  .onboarding-companion-card,
  .onboarding-review-grid,
  .onboarding-summary div,
  .story-intelligence-dashboard-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .onboarding-story-facts {
    grid-template-columns: 1fr;
  }

  .onboarding-companion-details {
    grid-template-columns: 1fr;
  }

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

  .onboarding-review-panel .onboarding-review-counts {
    position: static;
  }

  .story-live-stats,
  .story-review-summary,
  .story-review-scene-panel,
  .story-character-card__body dl,
  .story-future-stage-grid,
  .story-scene-preview dl,
  .story-live-current,
  .story-live-feed-grid,
  .story-review-admin dl {
    grid-template-columns: 1fr;
  }

  .story-live-progress-heading,
  .story-review-chapter-heading {
    flex-direction: column;
  }

  .story-live-hero h1,
  .story-live-progress > .alert-info,
  .story-live-stats strong {
    white-space: normal;
  }

  .onboarding-build-panel,
  .onboarding-success-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .onboarding-success-heading {
    flex-direction: column;
  }
}
