html {
  font-size: 15px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --plotline-ink: #1e252b;
  --plotline-muted: #66717b;
  --plotline-paper: #fbfaf7;
  --plotline-panel: #ffffff;
  --plotline-line: #d8ddd8;
  --plotline-accent: #2f6f63;
  --plotline-accent-dark: #22534a;
  --plotline-soft: #eef5f2;
  --timeline-label-width: 180px;
  --timeline-scene-width: 220px;
  --timeline-grid-gap: 10px;
}

body {
  min-height: 100%;
  margin-bottom: 0;
  color: var(--plotline-ink);
  background: var(--plotline-paper);
}

a {
  color: var(--plotline-accent-dark);
}

.btn-primary {
  --bs-btn-bg: var(--plotline-accent);
  --bs-btn-border-color: var(--plotline-accent);
  --bs-btn-hover-bg: var(--plotline-accent-dark);
  --bs-btn-hover-border-color: var(--plotline-accent-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--plotline-accent-dark);
  --bs-btn-border-color: var(--plotline-accent);
  --bs-btn-hover-bg: var(--plotline-accent);
  --bs-btn-hover-border-color: var(--plotline-accent);
}

.plotline-nav {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.plotline-shell {
  max-width: 1480px;
  padding-left: 24px;
  padding-right: 24px;
}

.plotline-shell-wide {
  max-width: none;
  padding-left: clamp(18px, 2vw, 32px);
  padding-right: clamp(18px, 2vw, 32px);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 18px 0 24px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 18px;
}

.workspace-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.page-heading.compact {
  max-width: 980px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--plotline-accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-text {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--plotline-muted);
  font-size: 1.05rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.button-row form,
.compact-buttons form,
.asset-card-footer form,
td.text-end form,
form[data-confirm-message] {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

td.text-end {
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.plain-card,
.empty-panel,
.edit-panel,
.list-section {
  background: var(--plotline-panel);
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(30, 37, 43, 0.04);
}

.plain-card h2,
.empty-panel h2,
.list-section h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.plain-card p,
.empty-panel p,
.muted {
  color: var(--plotline-muted);
}

.edit-panel {
  max-width: 980px;
}

.location-page .page-heading.compact,
.location-page .edit-panel,
.location-page .empty-panel,
.location-page .drag-drop-panel {
  max-width: none;
}

.import-panel,
.import-preview-section {
  max-width: none;
}

.import-json-input {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 34rem;
  max-height: 64vh;
  overflow: auto;
  resize: vertical;
  white-space: pre;
}

.import-preview-heading,
.import-counts {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.import-preview-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.import-counts {
  flex-wrap: wrap;
}

.import-counts span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--plotline-soft);
  color: var(--plotline-muted);
  font-weight: 700;
}

.import-counts strong {
  color: var(--plotline-ink);
}

.import-tree {
  display: grid;
  gap: 12px;
}

.import-tree-book {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.import-tree-book > summary,
.import-tree-chapter > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.import-tree-book > summary span,
.import-tree-chapter > summary span {
  color: var(--plotline-muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.import-tree-book h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.import-tree-chapter {
  border-top: 1px solid var(--plotline-line);
  padding: 10px 0 0;
  margin-top: 10px;
}

.import-tree-chapter ul {
  margin: 8px 0 0;
  color: var(--plotline-muted);
}

.import-scene-meta {
  display: block;
  margin-top: 2px;
  color: var(--plotline-muted);
  font-size: 0.82rem;
}

.import-mapping-summary {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(184, 118, 43, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: rgba(251, 236, 211, 0.5);
  color: var(--plotline-muted);
  font-size: 0.9rem;
}

.import-duplicate-confirm {
  border: 1px solid rgba(184, 118, 43, 0.34);
  border-radius: 8px;
  padding: 12px 12px 12px 38px;
  background: rgba(251, 236, 211, 0.72);
}

.import-confirmation,
.import-docs details {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.import-confirmation h3,
.import-doc-grid h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.import-docs summary {
  cursor: pointer;
  font-weight: 800;
}

.import-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.import-message-list ul {
  max-height: 16rem;
  overflow: auto;
}

.scene-editor {
  max-width: 1180px;
}

.table {
  margin-bottom: 0;
}

.table th {
  color: var(--plotline-muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.narrow {
  width: 90px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #c8d8d2;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--plotline-accent-dark);
  background: var(--plotline-soft);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.order-buttons {
  display: flex;
  gap: 6px;
}

.purpose-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: #fcfcfb;
}

.purpose-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.timeline-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(420px, 100%);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  --timeline-inspector-width: min(40vw, 560px);
}

.workspace-layout.inspector-drawer-open {
  grid-template-columns: minmax(420px, 1fr) 10px minmax(420px, var(--timeline-inspector-width));
  gap: 12px;
}

.timeline-workspace {
  min-width: 0;
  max-width: 100%;
}

.timeline-inspector-resizer {
  position: sticky;
  top: 76px;
  z-index: 25;
  width: 10px;
  height: calc(100vh - 96px);
  border-radius: 999px;
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(47, 111, 99, 0.16), rgba(47, 111, 99, 0.04));
}

.timeline-inspector-resizer::before {
  content: "";
  display: block;
  width: 2px;
  height: 48px;
  margin: 18px auto;
  border-radius: 999px;
  background: var(--plotline-accent);
  opacity: 0.55;
}

.timeline-inspector-resizer:hover,
.timeline-inspector-resizer:focus-visible {
  background: rgba(47, 111, 99, 0.16);
}

body.timeline-inspector-resizing {
  cursor: col-resize;
  user-select: none;
}

.pacing-panel {
  margin-top: 14px;
  margin-bottom: 0;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 37, 43, 0.04);
}

.pacing-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pacing-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.metric-graph-stack {
  display: grid;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
}

.metric-graph-row {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: max(100%, calc(150px + (var(--scene-count, 1) * 34px)));
}

.metric-graph-label {
  color: var(--plotline-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric-graph-points {
  display: grid;
  grid-template-columns: repeat(var(--scene-count), minmax(28px, 1fr));
  gap: 5px;
  align-items: end;
  min-height: 52px;
  border-radius: 8px;
  padding: 6px;
  background: linear-gradient(180deg, #f6faf8 0%, #edf4f1 100%);
  min-width: calc(var(--scene-count) * 34px);
}

.metric-point {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 48px;
  min-width: 28px;
  color: var(--plotline-accent-dark);
  text-decoration: none;
}

.metric-point::before {
  content: "";
  display: block;
  width: 100%;
  height: max(8px, var(--metric-height));
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #6fa99b, var(--plotline-accent-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.metric-point span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.timeline-shell {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
}

.workspace-timeline {
  min-height: 420px;
}

.timeline-series-row {
  display: grid;
  grid-template-columns: var(--timeline-label-width) max-content;
  gap: var(--timeline-grid-gap);
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

.timeline-project-title {
  position: sticky;
  left: 0;
  z-index: 20;
  display: grid;
  align-content: start;
  gap: 4px;
  width: var(--timeline-label-width);
  min-height: 100%;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  background: var(--plotline-accent-dark);
  font-weight: 700;
  box-shadow: 8px 0 18px rgba(30, 37, 43, 0.08);
}

.timeline-project-title span,
.timeline-book-title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-project-title strong,
.timeline-book-title strong {
  line-height: 1.15;
}

.timeline-books {
  display: flex;
  gap: var(--timeline-grid-gap);
  align-items: stretch;
}

.timeline-book {
  flex: 0 0 auto;
  width: calc((var(--book-scene-count) * var(--timeline-scene-width)) + ((var(--book-scene-count) - 1) * var(--timeline-grid-gap)));
  min-width: var(--timeline-scene-width);
}

.timeline-book-title {
  display: grid;
  gap: 2px;
  margin-bottom: var(--timeline-grid-gap);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  background: var(--plotline-accent-dark);
  font-weight: 700;
}

.timeline-chapters {
  display: flex;
  gap: var(--timeline-grid-gap);
  align-items: flex-start;
}

.timeline-chapter {
  flex: 0 0 auto;
  width: calc((var(--chapter-scene-count) * var(--timeline-scene-width)) + ((var(--chapter-scene-count) - 1) * var(--timeline-grid-gap)));
  min-width: var(--timeline-scene-width);
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(238, 245, 242, 0.7);
  outline: 1px solid #d4ded8;
  outline-offset: 0;
  overflow: visible;
}

.timeline-chapter-title {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid #d4ded8;
  padding: 10px 12px;
  color: var(--plotline-accent-dark);
  font-weight: 700;
}

.timeline-chapter-title span {
  color: var(--plotline-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.timeline-scenes {
  display: grid;
  grid-template-columns: repeat(var(--chapter-scene-count), minmax(0, 1fr));
  gap: var(--timeline-grid-gap);
  width: 100%;
  box-sizing: border-box;
  min-height: 190px;
  padding: 0;
}

.timeline-scene-card,
.timeline-empty-scene {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--plotline-ink);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(30, 37, 43, 0.05);
}

.timeline-scene-card:hover {
  border-color: var(--plotline-accent);
  color: var(--plotline-ink);
}

.timeline-placeholder-scene,
.timeline-placeholder-cell,
.metric-point-placeholder {
  cursor: default;
  opacity: 0.72;
}

.timeline-placeholder-scene {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--plotline-muted);
  background: rgba(255, 255, 255, 0.38);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.timeline-placeholder-cell {
  border-style: dashed;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(216, 221, 216, 0.18) 0,
      rgba(216, 221, 216, 0.18) 7px,
      rgba(255, 255, 255, 0.18) 7px,
      rgba(255, 255, 255, 0.18) 14px
    );
}

.metric-point-placeholder::before {
  height: 4px;
  background: rgba(102, 113, 123, 0.2);
  box-shadow: none;
}

.timeline-scene-card.selected {
  border-color: var(--plotline-accent-dark);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.16), 0 10px 22px rgba(30, 37, 43, 0.08);
}

.scene-badge-row,
.purpose-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.warning-placeholder {
  display: inline-flex;
  width: fit-content;
  border: 1px dashed #d6b25e;
  border-radius: 999px;
  padding: 2px 8px;
  color: #755715;
  background: #fff8e8;
  font-size: 0.74rem;
  font-weight: 700;
}

.warning-placeholder.active {
  border-color: rgba(159, 69, 69, 0.36);
  color: #8a3434;
  background: rgba(255, 232, 232, 0.9);
}

.dependency-placeholder {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(47, 111, 99, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--plotline-accent-dark);
  background: rgba(47, 111, 99, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
}

.purpose-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  color: #38453e;
  background: #edf0eb;
  font-size: 0.72rem;
  font-weight: 700;
}

.future-lane-placeholder {
  border-top: 1px dashed #cbd8d2;
  padding: 8px 12px;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.45);
}

.metric-timeline-board {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin-top: 14px;
  border-top: 1px solid var(--plotline-line);
  padding-top: 14px;
}

.metric-shape-controls {
  position: sticky;
  left: 0;
  z-index: 6;
  display: grid;
  gap: 8px;
  width: calc(var(--timeline-label-width) + (var(--scene-count) * var(--timeline-scene-width)) + (var(--scene-count) * var(--timeline-grid-gap)));
  min-width: 100%;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.metric-timeline-row {
  display: grid;
  grid-template-columns: var(--timeline-label-width) calc((var(--scene-count) * var(--timeline-scene-width)) + ((var(--scene-count) - 1) * var(--timeline-grid-gap)));
  gap: var(--timeline-grid-gap);
  align-items: stretch;
}

.metric-lane-label {
  position: sticky;
  left: 0;
  z-index: 12;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 320px;
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 8px;
  padding: 10px;
  color: var(--plotline-accent-dark);
  background: #fff;
  box-shadow: 0 6px 14px rgba(30, 37, 43, 0.04);
}

.metric-lane-label span {
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.colour-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(30, 37, 43, 0.18);
  border-radius: 999px;
  vertical-align: middle;
}

.plot-lane-board {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin-top: 14px;
  border-top: 1px solid var(--plotline-line);
  padding-top: 14px;
}

.lane-board-heading,
.metric-lane-board-heading,
.plot-lane-board-heading {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: calc(var(--timeline-label-width) + (var(--scene-count) * var(--timeline-scene-width)) + (var(--scene-count) * var(--timeline-grid-gap)));
  min-width: 100%;
  margin-bottom: 2px;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--plotline-accent-dark);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(30, 37, 43, 0.05);
}

.lane-board-heading small,
.metric-lane-board-heading small,
.plot-lane-board-heading small {
  color: var(--plotline-muted);
  font-weight: 500;
  white-space: nowrap;
}

.plot-lane-row {
  display: grid;
  grid-template-columns: var(--timeline-label-width) repeat(var(--scene-count), var(--timeline-scene-width));
  gap: var(--timeline-grid-gap);
  align-items: stretch;
}

.plot-lane-label {
  position: sticky;
  left: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid color-mix(in srgb, var(--plot-colour), #ffffff 55%);
  border-left: 5px solid var(--plot-colour);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--plotline-ink);
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(30, 37, 43, 0.04);
}

.plot-lane-label:hover {
  color: var(--plotline-ink);
  border-color: var(--plot-colour);
}

.plot-lane-slots {
  display: contents;
}

.plot-lane-slot {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  min-height: 46px;
  border: 1px dashed #d8ddd8;
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.62);
}

.thread-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--plot-colour), #000000 18%);
  border-radius: 999px;
  padding: 0 7px;
  color: var(--plotline-ink);
  background: color-mix(in srgb, var(--plot-colour), #ffffff 78%);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.thread-marker:hover {
  color: var(--plotline-ink);
  background: color-mix(in srgb, var(--plot-colour), #ffffff 58%);
}

.thread-marker.resolved {
  border-color: #5a8c60;
  background: #e6f4e7;
  color: #24512b;
}

.thread-marker.contradicted {
  border-color: #b45c5c;
  background: #fff0f0;
  color: #7a2222;
}

.thread-events-section {
  margin-top: 16px;
}

.thread-event-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.thread-event-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--plot-colour), #ffffff 55%);
  border-left: 4px solid var(--plot-colour);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.thread-event-item > div {
  display: grid;
  gap: 3px;
}

.thread-event-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  background: color-mix(in srgb, var(--plot-colour), #ffffff 72%);
  font-size: 0.72rem;
  font-weight: 800;
}

.thread-event-create {
  border-top: 1px solid var(--plotline-line);
  padding-top: 12px;
}

.asset-lane-board {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin-top: 14px;
  border-top: 1px solid var(--plotline-line);
  padding-top: 14px;
}

.asset-lane-row {
  display: grid;
  grid-template-columns: var(--timeline-label-width) repeat(var(--scene-count), var(--timeline-scene-width));
  gap: var(--timeline-grid-gap);
  align-items: stretch;
}

.asset-lane-label {
  position: sticky;
  left: 0;
  z-index: 12;
  display: grid;
  gap: 2px;
  min-height: 46px;
  border: 1px solid #d4d7df;
  border-left: 5px solid #6b5b95;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--plotline-ink);
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(30, 37, 43, 0.04);
}

.asset-lane-label span {
  color: var(--plotline-muted);
  font-size: 0.75rem;
}

.asset-lane-slots {
  display: contents;
}

.asset-lane-slot {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  min-height: 46px;
  border: 1px dashed #d8ddd8;
  border-radius: 8px;
  padding: 7px;
  background: rgba(250, 249, 255, 0.72);
}

.asset-marker,
.asset-event-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  border: 1px solid #7f70aa;
  border-radius: 7px;
  padding: 0 7px;
  color: #33284e;
  background: #eee9fb;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.asset-marker:hover {
  color: #33284e;
  background: #dfd6f7;
}

.asset-events-section {
  margin-top: 16px;
}

.asset-event-list,
.asset-mini-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.asset-event-item,
.asset-mini-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #ded9ea;
  border-left: 4px solid #6b5b95;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.asset-event-item > div,
.asset-mini-item > div {
  display: grid;
  gap: 3px;
}

.asset-create-form {
  border-top: 1px solid var(--plotline-line);
  padding-top: 12px;
}

.asset-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.asset-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(30, 37, 43, 0.04);
}

.asset-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.asset-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.asset-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
}

.character-lane-board {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin-top: 14px;
  border-top: 1px solid var(--plotline-line);
  padding-top: 14px;
}

.character-lane-row {
  display: grid;
  grid-template-columns: var(--timeline-label-width) repeat(var(--scene-count), var(--timeline-scene-width));
  gap: var(--timeline-grid-gap);
  align-items: stretch;
}

.character-lane-label {
  position: sticky;
  left: 0;
  z-index: 12;
  display: grid;
  gap: 2px;
  min-height: 46px;
  border: 1px solid #d7d4ce;
  border-left: 5px solid #8a6f3d;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--plotline-ink);
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(30, 37, 43, 0.04);
}

.character-lane-label span {
  color: var(--plotline-muted);
  font-size: 0.75rem;
}

.character-lane-slots {
  display: contents;
}

.character-lane-slot {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  min-height: 46px;
  border: 1px dashed #d8ddd8;
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 252, 246, 0.72);
}

.character-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  border: 1px solid #9a7a3f;
  border-radius: 999px;
  padding: 0 7px;
  color: #4f3810;
  background: #fff2d7;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.character-card {
  border-left: 4px solid #8a6f3d;
}

.character-section {
  margin-top: 16px;
}

.character-item {
  border-left-color: #8a6f3d;
}

.character-appearance-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d7d4ce;
  border-left: 4px solid #8a6f3d;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.character-appearance-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.character-appearance-summary > div:first-child {
  display: grid;
  gap: 3px;
}

.character-appearance-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.character-appearance-edit .asset-create-form {
  margin-top: 8px;
  border-top: 1px solid var(--plotline-line);
}

.form-helper-message {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.scene-number,
.time-label {
  color: var(--plotline-muted);
  font-size: 0.82rem;
}

.location-pill,
.location-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--plotline-accent-dark);
  background: rgba(47, 111, 99, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
}

.scene-summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--plotline-muted);
  font-size: 0.88rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.timeline-empty-scene {
  justify-content: center;
  color: var(--plotline-muted);
  background: rgba(255, 255, 255, 0.58);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--plotline-accent);
  box-shadow: 0 0 0 0.2rem rgba(47, 111, 99, 0.16);
}

.scene-inspector-panel {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 96px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(30, 37, 43, 0.08);
}

.inspector-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--plotline-line);
  padding: 16px;
  background: #fff;
}

.scene-inspector-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.inspector-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.scene-inspector-form {
  display: grid;
  gap: 14px;
}

.inspector-section {
  border-top: 1px solid var(--plotline-line);
  padding-top: 12px;
}

.inspector-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.inspector-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--plotline-accent-dark);
}

.location-helper {
  border: 1px solid rgba(138, 111, 61, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 248, 232, 0.74);
}

.location-warning-list {
  margin: 0;
  padding-left: 18px;
  color: #6f5526;
  font-size: 0.86rem;
}

.location-tree {
  display: grid;
  gap: 8px;
}

.location-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--plotline-line);
  padding: 10px 0 10px calc(var(--location-depth, 0) * 22px);
}

.location-tree-row:last-child {
  border-bottom: 0;
}

.location-tree-row > div:first-child {
  display: grid;
  gap: 3px;
}

.compact-buttons {
  flex-wrap: nowrap;
}

.location-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.location-chip {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  text-decoration: none;
}

.location-relationship-list {
  display: grid;
  gap: 8px;
}

.location-relationship-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.location-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--plotline-muted);
  font-size: 0.86rem;
}

.validation-summary,
.warning-filter-panel {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fff;
}

.validation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--plotline-muted);
}

.warning-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.warning-count-row,
.warning-card-title,
.inspector-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.warning-list,
.warning-mini-list {
  display: grid;
  gap: 10px;
}

.warning-card,
.warning-mini-card {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.warning-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.warning-card p,
.warning-mini-card p {
  margin: 6px 0;
}

.warning-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.severity-pill.info {
  color: #365f7c;
  background: rgba(107, 153, 184, 0.14);
}

.severity-pill.warning {
  color: #7a5527;
  background: rgba(205, 154, 72, 0.17);
}

.severity-pill.error {
  color: #8a3434;
  background: rgba(190, 83, 83, 0.15);
}

.warning-mini-card {
  background: rgba(255, 255, 255, 0.76);
}

.dependency-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dependency-card {
  display: grid;
  gap: 3px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.78);
}

.move-preview-panel {
  max-width: 900px;
}

.focused-validation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid rgba(47, 111, 99, 0.16);
  border-radius: 8px;
  margin-top: 12px;
  padding: 10px;
  color: var(--plotline-muted);
  background: rgba(47, 111, 99, 0.05);
}

.inspector-purpose-list {
  grid-template-columns: 1fr;
  max-height: 210px;
}

.metric-slider-stack {
  display: grid;
  gap: 12px;
}

.metric-slider {
  display: grid;
  gap: 4px;
}

.metric-slider-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--plotline-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric-slider-label output {
  color: var(--plotline-accent-dark);
}

.metric-slider .form-range {
  accent-color: var(--plotline-accent);
}

.asset-importance-slider {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(47, 111, 99, 0.05);
}

.story-asset-checkbox-field {
  margin-top: 1.95rem;
}

.story-asset-event-item {
  justify-content: flex-start;
  gap: 8px;
}

.story-asset-event-item .asset-event-marker {
  flex: 0 0 auto;
  min-width: 1.55rem;
  width: auto;
}

.story-asset-event-details {
  min-width: 0;
}

.scene-inspector-root {
  display: grid;
  gap: 12px;
}

.scene-overview-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(47, 111, 99, 0.08), rgba(255, 255, 255, 0.88));
}

.scene-overview-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.scene-overview-card .muted {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.overview-chip-grid,
.context-nav,
.breadcrumb-trail,
.inspector-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.overview-chip,
.context-nav a,
.breadcrumb-trail a,
.breadcrumb-trail span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
}

.overview-chip.attention {
  color: #7a5527;
  border-color: rgba(205, 154, 72, 0.35);
  background: rgba(205, 154, 72, 0.14);
}

.overview-outcome {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--plotline-muted);
}

.inspector-quick-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(55, 48, 39, 0.08);
  backdrop-filter: blur(8px);
}

.inspector-nav-links a {
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.inspector-nav-links a:hover,
.inspector-nav-links a.active {
  color: var(--plotline-accent-dark);
  border-color: rgba(47, 111, 99, 0.35);
  background: rgba(47, 111, 99, 0.08);
}

.inspector-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--plotline-ink);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: left;
  background: transparent;
}

.inspector-accordion-toggle::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  margin-right: 7px;
  color: var(--plotline-accent-dark);
  background: rgba(47, 111, 99, 0.09);
}

.inspector-section.is-open > .inspector-accordion-toggle::before {
  content: "-";
}

.inspector-accordion-toggle span:first-child {
  margin-right: auto;
}

.accordion-count {
  color: var(--plotline-muted);
  font-size: 0.75rem;
}

.inspector-subheading {
  margin: 14px 0 8px;
  color: var(--plotline-muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.inspector-accordion-body {
  display: none;
  margin-top: 12px;
}

.inspector-section.is-open > .inspector-accordion-body {
  display: block;
}

.inspector-section.is-filtered-out {
  display: none;
}

.breadcrumb-trail {
  margin-bottom: 12px;
}

.breadcrumb-trail a:hover,
.context-nav a:hover {
  color: var(--plotline-accent-dark);
  border-color: rgba(47, 111, 99, 0.35);
  background: rgba(47, 111, 99, 0.08);
}

.context-header,
.working-context-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(55, 48, 39, 0.05);
}

.context-title {
  display: grid;
  gap: 2px;
}

.context-title strong {
  color: var(--plotline-ink);
}

.health-kpi-grid,
.analytics-grid-two,
.analytics-grid-three {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.health-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.health-kpi-grid .plain-card {
  display: grid;
  gap: 4px;
}

.health-kpi-grid strong {
  color: var(--plotline-ink);
  font-size: 2rem;
  line-height: 1;
}

.analytics-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-section {
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  margin: 18px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 34px rgba(55, 48, 39, 0.07);
}

.analytics-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-section-heading h2,
.plain-card h3 {
  margin: 0;
}

.analytics-metric-stack {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.metric-shape-chart {
  display: grid;
  gap: 12px;
}

.metric-shape-intro {
  max-width: 760px;
  margin: 0;
  color: var(--plotline-muted);
}

.metric-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(82, 75, 65, 0.16);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.metric-toggle-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--metric-colour);
}

.metric-toggle-pill input {
  margin: 0;
  accent-color: var(--metric-colour);
}

.metric-chart-frame {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  padding: 14px 12px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 245, 240, 0.76));
}

.metric-timeline-frame {
  width: calc((var(--scene-count) * var(--timeline-scene-width)) + ((var(--scene-count) - 1) * var(--timeline-grid-gap)));
}

.metric-chart-frame canvas {
  width: 100%;
  height: 300px;
}

.metric-timeline-board .metric-graph-stack {
  width: max-content;
  min-width: 100%;
}

.metric-timeline-board .metric-graph-row {
  grid-template-columns: var(--timeline-label-width) repeat(var(--scene-count), var(--timeline-scene-width));
  gap: var(--timeline-grid-gap);
  min-width: 100%;
}

.metric-timeline-board .metric-graph-points {
  display: contents;
}

.metric-timeline-board .metric-point {
  border: 1px solid rgba(47, 111, 99, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.metric-raw-details {
  border-top: 1px solid var(--plotline-line);
  padding-top: 8px;
}

.metric-raw-details summary {
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.timeline-control-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(55, 48, 39, 0.05);
}

.timeline-filter-drawer summary {
  color: var(--plotline-ink);
  font-weight: 900;
  cursor: pointer;
}

.timeline-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.timeline-filter-checks,
.timeline-filter-actions,
.timeline-visibility-panel,
.timeline-preset-panel,
.preset-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timeline-filter-checks {
  grid-column: span 3;
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-filter-actions {
  grid-column: span 3;
  justify-content: flex-end;
}

.timeline-visibility-panel label,
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.76);
}

.timeline-preset-panel form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preset-chip a {
  color: var(--plotline-accent-dark);
  text-decoration: none;
}

.preset-chip button {
  border: 0;
  color: var(--plotline-muted);
  background: transparent;
  font-weight: 900;
}

.timeline-focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(47, 111, 99, 0.22);
  border-radius: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(47, 111, 99, 0.08);
}

.timeline-scene-card.filter-dim,
.timeline-scene-card.focus-dim,
.lane-dim {
  opacity: 0.35;
}

.timeline-scene-card.focus-match,
.timeline-scene-card.filter-match.focus-match {
  outline: 3px solid rgba(47, 111, 99, 0.32);
  box-shadow: 0 12px 26px rgba(47, 111, 99, 0.16);
}

.timeline-section-hidden {
  display: none !important;
}

.hide-scene-cards .timeline-scene-card {
  display: none;
}

.timeline-control-panel {
  position: sticky;
  top: 56px;
  z-index: 18;
}

.timeline-control-select {
  padding-right: 6px;
}

.timeline-control-select .form-select {
  width: auto;
  min-width: 132px;
  border: 0;
  padding-top: 2px;
  padding-bottom: 2px;
  background-color: transparent;
  color: var(--plotline-accent-dark);
  font-weight: 800;
}

.timeline-jump-panel {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(170px, 0.9fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.timeline-shortcut-hint {
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-minimap {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: 0 0 12px;
  padding: 8px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.timeline-minimap button {
  position: relative;
  flex: 0 0 max(42px, calc(var(--chapter-scenes) * 18px));
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 7px;
  color: var(--plotline-accent-dark);
  background: linear-gradient(180deg, #f8fbf9 0%, #edf4f1 100%);
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-minimap button.is-active {
  border-color: var(--plotline-accent);
  color: #fff;
  background: linear-gradient(180deg, var(--plotline-accent) 0%, var(--plotline-accent-dark) 100%);
  box-shadow: 0 0 0 2px rgba(47, 111, 99, 0.14);
}

.timeline-minimap button::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: calc(var(--chapter-warnings) * 4px);
  max-width: 28px;
  height: 4px;
  border-radius: 999px;
  background: #b45c5c;
  opacity: 0.75;
}

.timeline-drag-palette,
.drag-drop-panel {
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(55, 48, 39, 0.05);
}

.timeline-drag-palette {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.drag-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 104px;
  overflow: auto;
  padding-right: 4px;
}

.drag-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff;
  color: var(--plotline-ink);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: grab;
}

.drag-chip.character {
  border-color: #dacb9e;
  background: #fff8e8;
}

.drag-chip.asset {
  border-color: #ded9ea;
  background: #f4f0ff;
}

.drag-chip.location {
  border-color: rgba(47, 111, 99, 0.18);
  background: #eef8f4;
}

.is-dragging {
  opacity: 0.55;
}

.drop-target-active {
  outline: 3px solid rgba(47, 111, 99, 0.28);
  outline-offset: 2px;
}

.timeline-chapter.chapter-drop-active,
.timeline-scenes.drop-chapter-end {
  background: rgba(47, 111, 99, 0.06);
}

.timeline-scenes.drop-chapter-end::after {
  content: "Drop scene at end of chapter";
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--timeline-scene-width);
  min-height: 74px;
  border: 2px dashed rgba(197, 139, 43, 0.48);
  border-radius: 12px;
  color: #7a5527;
  background: rgba(255, 248, 232, 0.82);
  font-size: 0.8rem;
  font-weight: 900;
}

.timeline-scene-card.drop-before {
  box-shadow: inset 5px 0 0 #c58b2b, 0 12px 26px rgba(197, 139, 43, 0.16);
}

.timeline-scene-card.drop-after {
  box-shadow: inset -5px 0 0 #c58b2b, 0 12px 26px rgba(197, 139, 43, 0.16);
}

.drag-drop-panel {
  position: sticky;
  top: 132px;
  z-index: 19;
}

.drag-drop-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drag-drop-panel h2 {
  margin: 0;
  font-size: 1.08rem;
}

.drag-drop-form {
  border-top: 1px solid var(--plotline-line);
  margin-top: 10px;
  padding-top: 10px;
}

.scene-move-modal-content {
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 14px;
  background: var(--plotline-surface);
  color: var(--plotline-ink);
  box-shadow: 0 24px 70px rgba(55, 48, 39, 0.22);
}

.scene-move-modal-content .modal-header,
.scene-move-modal-content .modal-footer {
  border-color: var(--plotline-line);
}

.scene-move-modal-content .modal-title {
  margin: 0;
  color: var(--plotline-ink);
  font-size: 1.2rem;
  font-weight: 900;
}

.scene-move-summary {
  margin: 0 0 12px;
  color: var(--plotline-ink);
  font-size: 1rem;
  font-weight: 800;
}

[data-theme="dark"] .scene-move-modal-content {
  background: #201f22;
  color: #f4eadc;
  border-color: rgba(244, 234, 220, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .scene-move-modal-content .modal-title,
[data-theme="dark"] .scene-move-summary {
  color: #f4eadc;
}

[data-theme="dark"] .scene-move-modal-content .modal-header,
[data-theme="dark"] .scene-move-modal-content .modal-footer {
  border-color: rgba(244, 234, 220, 0.14);
}

[data-theme="dark"] .scene-move-modal-content .btn-close {
  filter: invert(1) grayscale(100%);
}

.plain-preview {
  border: 1px solid rgba(197, 139, 43, 0.28);
  border-radius: 8px;
  margin: 10px 0 0;
  padding: 8px 10px;
  color: #5e4518;
  background: #fff8e8;
  font-size: 0.86rem;
  font-weight: 800;
}

.drag-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-section-header,
.lane-board-heading,
.pacing-heading {
  position: sticky;
  left: 0;
  z-index: 6;
}

.timeline-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: calc(var(--timeline-label-width) + (var(--scene-count) * var(--timeline-scene-width)) + (var(--scene-count) * var(--timeline-grid-gap)));
  min-width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 16px rgba(30, 37, 43, 0.05);
}

.timeline-section-header button,
.lane-board-heading button,
.plot-lane-board-heading button,
.pacing-heading button,
.lane-group-heading {
  border: 0;
  padding: 0;
  color: var(--plotline-accent-dark);
  background: transparent;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.timeline-section-header button::before,
.lane-board-heading button::before,
.plot-lane-board-heading button::before,
.pacing-heading button::before,
.lane-group-heading::before {
  content: "v";
  display: inline-block;
  margin-right: 6px;
  color: var(--plotline-muted);
  font-size: 0.72rem;
}

.timeline-section-header button.is-collapsed::before,
.lane-board-heading button.is-collapsed::before,
.plot-lane-board-heading button.is-collapsed::before,
.pacing-heading button.is-collapsed::before,
.lane-group-heading.is-collapsed::before {
  content: ">";
}

.lane-group {
  display: grid;
  gap: 7px;
}

.character-lane-group-body {
  display: grid;
  gap: 7px;
}

.lane-group-heading {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--timeline-label-width);
  border-top: 1px solid rgba(47, 111, 99, 0.12);
  padding: 7px 8px 2px;
  color: var(--plotline-muted);
  background: rgba(247, 250, 248, 0.96);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.timeline-section-collapsed {
  display: none !important;
}

.timeline-chapter-title {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(238, 245, 242, 0.96);
  backdrop-filter: blur(6px);
}

.scene-pov-label,
.metric-mini-summary {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.scene-pov-label {
  color: #514018;
  background: #fff3d3;
}

.metric-mini-summary {
  color: var(--plotline-accent-dark);
  background: rgba(47, 111, 99, 0.08);
}

.timeline-scene-card.search-hit,
.timeline-scene-card.keyboard-focus {
  outline: 3px solid rgba(197, 139, 43, 0.34);
  box-shadow: 0 12px 26px rgba(197, 139, 43, 0.16);
}

.timeline-scene-card.search-dim {
  opacity: 0.28;
}

.thread-marker,
.asset-marker,
.character-marker {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.thread-marker:hover,
.asset-marker:hover,
.character-marker:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(30, 37, 43, 0.12);
}

.timeline-filtered-root.density-compact {
  --timeline-scene-width: 170px;
  --timeline-grid-gap: 6px;
}

.timeline-filtered-root.density-expanded {
  --timeline-scene-width: 280px;
  --timeline-grid-gap: 14px;
}

.timeline-filtered-root.density-compact .timeline-scene-card,
.timeline-filtered-root.zoom-book .timeline-scene-card {
  gap: 4px;
  padding: 9px;
}

.timeline-filtered-root.density-compact .scene-summary,
.timeline-filtered-root.density-compact .purpose-chip-row,
.timeline-filtered-root.density-compact .metric-mini-summary,
.timeline-filtered-root.zoom-book .scene-summary,
.timeline-filtered-root.zoom-book .purpose-chip-row,
.timeline-filtered-root.zoom-book .metric-mini-summary,
.timeline-filtered-root.zoom-book .location-pill,
.timeline-filtered-root.zoom-book .scene-pov-label {
  display: none;
}

.timeline-filtered-root.zoom-book {
  --timeline-scene-width: 150px;
  --timeline-grid-gap: 6px;
}

.timeline-filtered-root.zoom-scene-detail {
  --timeline-scene-width: 300px;
}

.timeline-filtered-root.zoom-scene-detail .scene-summary {
  -webkit-line-clamp: 7;
}

.timeline-filtered-root.density-expanded .timeline-scenes {
  min-height: 230px;
}

/* Timeline stabilization: keep controls compact and story lanes readable. */
.timeline-control-panel {
  position: relative;
  top: auto;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  box-shadow: none;
}

.timeline-filter-drawer,
.timeline-control-group {
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.timeline-filter-drawer[open],
.timeline-control-group[open] {
  border-radius: 10px;
  flex-basis: 100%;
}

.timeline-filter-drawer summary,
.timeline-control-group summary {
  min-width: max-content;
  padding: 5px 10px;
  color: var(--plotline-accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.timeline-filter-drawer summary::-webkit-details-marker,
.timeline-control-group summary::-webkit-details-marker,
.timeline-drag-palette summary::-webkit-details-marker {
  display: none;
}

.timeline-filter-drawer summary::after,
.timeline-control-group summary::after,
.timeline-drag-palette summary::after {
  content: " v";
  color: var(--plotline-muted);
  font-size: 0.72rem;
}

.timeline-filter-drawer[open] summary::after,
.timeline-control-group[open] summary::after,
.timeline-drag-palette[open] summary::after {
  content: " ^";
}

.timeline-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  max-height: min(48vh, 430px);
  overflow: auto;
  padding: 0 10px 10px;
}

.timeline-filter-grid .form-label {
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-filter-checks,
.timeline-filter-actions {
  grid-column: 1 / -1;
}

.timeline-visibility-panel,
.timeline-jump-panel,
.timeline-preset-panel {
  padding: 0 10px 10px;
}

.timeline-jump-panel {
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(150px, 1fr));
}

.timeline-shortcut-hint {
  grid-column: 1 / -1;
}

.timeline-preset-panel form {
  flex-wrap: nowrap;
}

.timeline-preset-panel .form-control {
  width: 150px;
}

.timeline-preset-panel .btn,
.timeline-filter-actions .btn {
  white-space: nowrap;
}

.timeline-drag-palette {
  display: block;
  margin-bottom: 8px;
  padding: 7px 9px;
  box-shadow: none;
}

.timeline-drag-palette summary {
  color: var(--plotline-accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.timeline-drag-palette .drag-chip-group {
  margin-top: 8px;
}

.drag-drop-panel {
  position: relative;
  top: auto;
  z-index: 9;
  box-shadow: 0 12px 28px rgba(30, 37, 43, 0.08);
}

.timeline-filtered-root,
.timeline-filtered-root.density-compact,
.timeline-filtered-root.zoom-book {
  --timeline-scene-width: 220px;
  --timeline-grid-gap: 10px;
}

.timeline-filtered-root.density-expanded,
.timeline-filtered-root.zoom-scene-detail {
  --timeline-scene-width: 290px;
}

.timeline-filtered-root.density-compact.zoom-book {
  --timeline-scene-width: 200px;
}

.timeline-chapter,
.timeline-scene-card,
.timeline-empty-scene {
  overflow-wrap: normal;
  word-break: normal;
}

.timeline-scene-card strong,
.timeline-chapter-title strong,
.plot-lane-label strong,
.asset-lane-label strong,
.character-lane-label strong {
  min-width: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.timeline-scene-card {
  cursor: grab;
}

.timeline-scene-card:active,
.drag-chip:active,
[draggable="true"]:active {
  cursor: grabbing;
}

body.drag-active .timeline-scene-card,
body.dragging-asset [data-asset-drop-target],
body.dragging-location [data-drag-type="location"] {
  transition: outline-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

body.dragging-character .timeline-scene-card,
body.dragging-asset .timeline-scene-card,
body.dragging-scene .timeline-scene-card,
body.dragging-scene .timeline-scenes[data-chapter-drop-target],
body.dragging-asset [data-asset-drop-target],
body.dragging-location [data-drag-type="location"] {
  outline: 1px dashed rgba(47, 111, 99, 0.22);
  outline-offset: 2px;
}

.is-dragging {
  opacity: 0.42;
  transform: scale(0.98);
}

.drop-target-active {
  outline: 3px solid rgba(47, 111, 99, 0.42) !important;
  outline-offset: 3px;
}

.analytics-metric-row {
  display: grid;
  grid-template-columns: 170px minmax(560px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.analytics-metric-label {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--plotline-line);
  color: var(--plotline-muted);
  font-weight: 800;
}

.analytics-sparkline {
  display: grid;
  grid-template-columns: repeat(var(--point-count), minmax(28px, 1fr));
  align-items: end;
  gap: 5px;
  min-height: 88px;
  border-bottom: 1px solid rgba(47, 111, 99, 0.25);
  padding-top: 10px;
}

.analytics-bar {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 12px;
  height: max(12px, var(--bar-height));
  border-radius: 6px 6px 2px 2px;
  color: var(--plotline-accent-dark);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(47, 111, 99, 0.58), rgba(47, 111, 99, 0.18));
}

.analytics-bar:hover {
  background: linear-gradient(180deg, rgba(47, 111, 99, 0.82), rgba(47, 111, 99, 0.28));
}

.analytics-bar span {
  position: absolute;
  bottom: calc(100% + 3px);
  color: var(--plotline-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.analytics-list-item,
.analytics-link-row,
.analytics-count-row,
.purpose-stat-row {
  border-top: 1px solid var(--plotline-line);
  padding: 9px 0;
}

.analytics-list-item {
  display: grid;
  gap: 3px;
}

.analytics-list-item p {
  margin: 0;
}

.analytics-link-row,
.analytics-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analytics-link-row {
  color: inherit;
  text-decoration: none;
}

.analytics-link-row:hover {
  color: var(--plotline-accent-dark);
}

.analytics-link-row span,
.analytics-link-row strong {
  min-width: 0;
}

.purpose-stat-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 1.5fr) 42px;
  align-items: center;
  gap: 10px;
}

.purpose-stat-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.08);
}

.purpose-stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--plotline-accent);
}

.inspector-actions {
  position: sticky;
  bottom: -16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--plotline-line);
  margin: 2px -16px -16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.story-bible-heading {
  align-items: end;
}

.story-bible-search {
  display: flex;
  gap: 8px;
  min-width: min(100%, 420px);
}

.story-bible-search .form-control {
  min-width: 0;
}

.story-bible-nav {
  position: sticky;
  top: 72px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 12px;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(10px);
}

.story-bible-nav a,
.story-bible-actions a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(47, 111, 99, 0.08);
  color: var(--plotline-ink);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.story-bible-nav a:hover,
.story-bible-actions a:hover {
  background: rgba(47, 111, 99, 0.16);
}

.story-bible-section {
  margin: 0 0 28px;
}

.story-bible-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.story-bible-section-heading h2 {
  margin: 0;
}

.soft-count {
  color: var(--plotline-muted);
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.story-bible-grid,
.story-bible-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.story-bible-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.story-bible-card {
  border: 1px solid var(--plotline-line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(36, 32, 26, 0.06);
}

.story-bible-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.story-bible-card h4 {
  margin: 14px 0 8px;
  font-size: 0.96rem;
}

.story-bible-card p {
  color: var(--plotline-muted);
}

.story-bible-card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.story-bible-card-title span {
  border: 1px solid var(--plotline-line);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(250, 249, 246, 0.9);
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.story-bible-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.story-bible-meta span {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(36, 32, 26, 0.05);
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.story-bible-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
  margin: 12px 0;
}

.story-bible-facts dt {
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-bible-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.story-bible-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.story-bible-link-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-bible-link-list li {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(36, 32, 26, 0.08);
}

.story-bible-link-list li:last-child {
  border-bottom: 0;
}

.story-bible-link-list span {
  color: var(--plotline-muted);
  font-size: 0.88rem;
}

.story-bible-timeline-summary {
  display: grid;
  gap: 14px;
}

.story-bible-wide-card {
  max-width: none;
}

.story-bible-chapter-summary {
  border-top: 1px solid var(--plotline-line);
  padding-top: 8px;
}

.story-bible-scene-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 0.8fr));
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid rgba(36, 32, 26, 0.08);
}

.story-bible-scene-summary p {
  grid-column: 1 / -1;
  margin: 0;
}

.story-bible-scene-summary span {
  color: var(--plotline-muted);
  font-size: 0.88rem;
}

.attention-list {
  display: grid;
  gap: 10px;
}

.attention-list article {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
}

.attention-list p {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--plotline-muted);
}

.writer-workspace-form,
.writer-add-form,
.writer-edit-form,
.chapter-goal-form {
  display: grid;
  gap: 10px;
}

.writer-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.writer-checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--plotline-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.writer-note-list,
.writer-queue-list {
  display: grid;
  gap: 10px;
}

.writer-mini-card {
  border: 1px solid var(--plotline-line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.writer-mini-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.writer-mini-card summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-list {
  display: grid;
  gap: 10px;
}

.attachment-summary {
  align-items: center;
}

.attachment-kind {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(47, 111, 99, 0.1);
  color: var(--plotline-accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.attachment-card-body {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.attachment-card-body p {
  margin: 0;
}

.attachment-add-card {
  margin-top: 10px;
}

.writer-checklist {
  display: grid;
  gap: 6px;
}

.writer-checklist-row,
.writer-add-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.writer-remove-inline {
  display: flex;
  justify-content: end;
  margin: -2px 0 4px;
}

.writer-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.writer-dashboard-panel {
  border: 1px solid var(--plotline-line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 34px rgba(36, 32, 26, 0.05);
}

.writer-queue-card {
  border: 1px solid var(--plotline-line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.writer-queue-card h3 {
  margin: 0;
  font-size: 1rem;
}

.writer-queue-card p {
  margin: 8px 0 0;
  color: var(--plotline-muted);
}

.writer-queue-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.writer-kpi {
  display: block;
  color: var(--plotline-accent);
  font-size: 2.2rem;
  line-height: 1;
}

.export-action-row {
  margin: -8px 0 18px;
}

.dynamics-timeline {
  position: relative;
  min-height: 128px;
  border: 1px solid var(--plotline-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(47, 111, 99, 0.07), rgba(255,255,255,0.84));
  overflow: hidden;
}

.dynamics-timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 64px;
  height: 1px;
  background: rgba(36, 32, 26, 0.18);
}

.dynamics-marker {
  position: absolute;
  bottom: 18px;
  width: 12px;
  height: 86px;
  transform: translateX(-50%);
  display: flex;
  align-items: end;
  justify-content: center;
}

.dynamics-marker span {
  display: block;
  width: 8px;
  min-height: 12px;
  max-height: 82px;
  border-radius: 999px;
  background: var(--plotline-accent);
  box-shadow: 0 8px 20px rgba(47, 111, 99, 0.22);
}

.dynamics-marker.pov span {
  background: #8a4b2f;
}

.dynamics-timeline.relationship .dynamics-marker span {
  background: #7c5fb0;
}

.scenario-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid rgba(103, 80, 164, 0.22);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(103, 80, 164, 0.10), rgba(255, 255, 255, 0.86));
  box-shadow: 0 12px 28px rgba(36, 32, 26, 0.08);
}

.scenario-banner h1 {
  margin: 0 0 4px;
}

.scenario-banner p {
  margin: 0;
  color: var(--plotline-muted);
}

.scenario-card {
  border-color: rgba(103, 80, 164, 0.18);
}

.scenario-warning-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--plotline-muted);
}

.scenario-warning-strip strong {
  color: var(--plotline-ink);
}

.scenario-board {
  border: 1px solid var(--plotline-line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(247, 245, 240, 0.74);
  overflow: hidden;
  margin-bottom: 18px;
}

.scenario-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.scenario-chapter {
  min-width: 360px;
  max-width: 520px;
  border: 1px solid rgba(82, 75, 65, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.scenario-chapter header {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--plotline-line);
  padding: 10px 12px;
}

.scenario-chapter header span {
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scenario-scene-row {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.scenario-scene-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(82, 75, 65, 0.12);
  border-radius: 9px;
  padding: 10px;
  background: white;
}

.scenario-scene-title {
  display: grid;
  gap: 2px;
}

.scenario-scene-title span,
.scenario-mini-data {
  color: var(--plotline-muted);
  font-size: 0.78rem;
}

.scenario-mini-data {
  display: grid;
  gap: 2px;
}

.scenario-move-actions,
.scenario-chapter-form,
.scenario-compare-list article {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.scenario-chapter-form select {
  min-width: 160px;
  width: auto;
}

.scenario-compare-list {
  display: grid;
  gap: 10px;
}

.scenario-compare-list article {
  justify-content: space-between;
  border: 1px solid var(--plotline-line);
  border-radius: 9px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.danger-zone {
  border-color: rgba(163, 61, 61, 0.24);
}

.archive-filter-form {
  align-items: end;
}

.archive-item-list {
  display: grid;
  gap: 10px;
}

.archive-item-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-items: end;
}

.delete-forever-form {
  display: inline-flex;
  margin: 0;
}

.archive-item-card h3 {
  margin: 4px 0;
}

.archived-badge {
  display: inline-flex;
  border: 1px solid rgba(82, 75, 65, 0.16);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--plotline-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(247, 245, 240, 0.86);
}

.restore-button {
  white-space: nowrap;
}

.archive-button-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.acceptance-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.acceptance-summary {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.acceptance-summary strong {
  font-size: 2rem;
  line-height: 1;
}

.acceptance-summary.pass {
  border-left: 5px solid #4d7654;
}

.acceptance-summary.review {
  border-left: 5px solid #b8762b;
}

.acceptance-summary.blocked {
  border-left: 5px solid #963f36;
}

.acceptance-check-list {
  display: grid;
  gap: 14px;
}

.acceptance-area {
  border: 1px solid var(--plotline-line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.acceptance-area h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.acceptance-check-items {
  display: grid;
  gap: 8px;
}

.acceptance-check-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(82, 75, 65, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.acceptance-check-item p {
  margin: 2px 0 0;
  color: var(--plotline-muted);
}

.acceptance-status {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  min-width: 74px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.acceptance-check-item.pass .acceptance-status {
  color: #24512b;
  background: #e6f4e7;
}

.acceptance-check-item.review .acceptance-status {
  color: #7b4b13;
  background: #fbecd3;
}

.acceptance-check-item.blocked .acceptance-status {
  color: #7a2222;
  background: #fff0f0;
}

.plotline-confirm-modal .modal-title {
  color: var(--plotline-ink);
}

.plotline-confirm-modal .modal-body p {
  white-space: pre-line;
}

.delete-confirm-field {
  border: 1px solid rgba(163, 61, 61, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 247, 244, 0.7);
}

@media print {
  header,
  .breadcrumb-trail,
  .context-header,
  .button-row,
  .story-bible-nav,
  .inspector-quick-nav {
    display: none !important;
  }

  .plotline-shell {
    max-width: none;
    padding: 0;
  }
}

@media (max-width: 760px) {
  .plotline-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .button-row,
  .timeline-filter {
    margin-top: 14px;
  }

  .timeline-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .story-bible-search,
  .story-bible-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .story-bible-scene-summary,
  .attention-list article {
    grid-template-columns: 1fr;
  }

  .writer-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .writer-checklist-row,
  .writer-add-inline {
    grid-template-columns: 1fr;
  }

  .attention-list p {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .workspace-layout,
  .workspace-layout.inspector-drawer-open {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .timeline-inspector-resizer {
    display: none;
  }

  .scene-inspector-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .scene-inspector-body {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1100px) {
  .metric-graph-row {
    grid-template-columns: 1fr;
  }

  .health-kpi-grid,
  .analytics-grid-two,
  .analytics-grid-three {
    grid-template-columns: 1fr;
  }

  .analytics-metric-row {
    grid-template-columns: 1fr;
  }

  .analytics-metric-label {
    border-right: 0;
  }
}
