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;
}

.feature-request-admin-page .page-heading.compact,
.feature-request-admin-page .edit-panel {
  max-width: none;
}

.feature-request-admin-table {
  table-layout: fixed;
}

.feature-request-admin-table th,
.feature-request-admin-table td {
  vertical-align: middle;
}

.feature-request-admin-table__preview {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-request-admin-table__action {
  width: 78px;
}

@media (max-width: 1100px) {
  .feature-request-admin-table {
    table-layout: auto;
  }

  .feature-request-admin-table__preview {
    max-width: 160px;
  }
}

.trial-status-panel,
.trial-dashboard-banner {
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--plotline-panel);
}

.trial-status-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.trial-status-panel--signup {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  max-width: 980px;
}

.trial-status-panel h2,
.trial-status-panel h3,
.trial-dashboard-banner h2 {
  margin: 0;
}

.trial-status-panel p,
.trial-dashboard-banner p {
  margin-bottom: 0;
}

.trial-status-panel__heading,
.trial-dashboard-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.trial-dashboard-banner {
  margin-bottom: 18px;
}

.trial-dashboard-banner__body {
  min-width: 0;
}

.trial-dashboard-banner__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.trial-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(84, 68, 48, 0.12);
}

.trial-progress__bar {
  height: 100%;
  border-radius: inherit;
}

.trial-status-panel[hidden],
.trial-dashboard-banner[hidden] {
  display: none;
}

.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;
}

.dashboard-summary-card {
  border-color: var(--plotline-line);
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-summary-body {
  padding: 8px 9px;
}

.dashboard-summary-label {
  margin-bottom: 3px;
  font-size: 0.64rem;
  line-height: 1.15;
}

.dashboard-summary-value {
  display: block;
  font-size: 1.25rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.dashboard-summary-calm {
  border-color: rgba(47, 111, 99, 0.28);
  background: rgba(238, 245, 242, 0.62);
}

.dashboard-summary-mild {
  border-color: rgba(197, 139, 43, 0.32);
  background: rgba(255, 248, 232, 0.68);
}

.dashboard-summary-attention {
  border-color: rgba(142, 80, 103, 0.32);
  background: rgba(252, 241, 246, 0.7);
}

@media (max-width: 1199.98px) {
  .dashboard-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-progress-card {
  border-color: rgba(47, 111, 99, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, rgba(238, 245, 242, 0.64) 100%);
}

.dashboard-progress-body {
  padding: 12px 14px;
}

.dashboard-progress-heading {
  margin-bottom: 8px;
}

.dashboard-progress-title {
  margin: 0 0 2px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.dashboard-series-progress {
  height: 7px;
  background: rgba(47, 111, 99, 0.1);
}

.dashboard-series-progress .progress-bar {
  background: linear-gradient(90deg, var(--plotline-accent), #6fa99b);
}

.dashboard-progress-source {
  border-color: rgba(47, 111, 99, 0.2);
  color: var(--plotline-accent-dark);
  background: rgba(238, 245, 242, 0.9);
}

.dashboard-book-title-block h3 {
  line-height: 1.16;
}

.dashboard-book-title-block a {
  color: var(--plotline-ink);
  text-decoration-color: rgba(47, 111, 99, 0.35);
}

.dashboard-book-subtitle {
  color: var(--plotline-muted);
  font-size: 0.95rem;
  line-height: 1.25;
}

.dashboard-status-pill {
  border-color: var(--dashboard-status-border, #c8d8d2);
  color: var(--dashboard-status-ink, var(--plotline-accent-dark));
  background: var(--dashboard-status-bg, var(--plotline-soft));
}

.dashboard-status-published {
  --dashboard-status-border: rgba(47, 111, 99, 0.32);
  --dashboard-status-bg: #e7f2ed;
  --dashboard-status-ink: #22534a;
}

.dashboard-status-drafting {
  --dashboard-status-border: rgba(184, 118, 43, 0.35);
  --dashboard-status-bg: #fff2dd;
  --dashboard-status-ink: #7b4b12;
}

.dashboard-status-planning {
  --dashboard-status-border: rgba(51, 117, 155, 0.3);
  --dashboard-status-bg: #e9f3f8;
  --dashboard-status-ink: #245b78;
}

.dashboard-status-research,
.dashboard-status-outlining {
  --dashboard-status-border: rgba(103, 80, 164, 0.26);
  --dashboard-status-bg: #f0edf8;
  --dashboard-status-ink: #51417c;
}

.dashboard-status-revising {
  --dashboard-status-border: rgba(123, 82, 148, 0.3);
  --dashboard-status-bg: #f4eefa;
  --dashboard-status-ink: #5f3e73;
}

.dashboard-status-editing {
  --dashboard-status-border: rgba(68, 75, 130, 0.3);
  --dashboard-status-bg: #eceef8;
  --dashboard-status-ink: #343b72;
}

.dashboard-status-proofreading {
  --dashboard-status-border: rgba(43, 130, 123, 0.3);
  --dashboard-status-bg: #e6f5f2;
  --dashboard-status-ink: #23625d;
}

.dashboard-status-ready {
  --dashboard-status-border: rgba(185, 142, 30, 0.34);
  --dashboard-status-bg: #fff6d8;
  --dashboard-status-ink: #765a0f;
}

.dashboard-status-paused {
  --dashboard-status-border: rgba(102, 113, 123, 0.28);
  --dashboard-status-bg: #f0f2f1;
  --dashboard-status-ink: #56616b;
}

.dashboard-status-archived {
  --dashboard-status-border: rgba(139, 80, 86, 0.28);
  --dashboard-status-bg: #f3eded;
  --dashboard-status-ink: #76474d;
}

.dashboard-attention-soft {
  border-color: rgba(102, 113, 123, 0.24);
  color: #56616b;
  background: #f3f4f2;
}

.word-companion-follow-toggle[aria-pressed="true"] {
  border-color: rgba(47, 111, 99, 0.36);
  color: var(--plotline-accent-dark);
  background: var(--plotline-soft);
  font-weight: 700;
}

.word-companion-follow-toggle[aria-pressed="true"]::after {
  content: " On";
}

.word-companion-follow-toggle[aria-pressed="false"]::after {
  content: " Off";
}

.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);
  gap: 5px;
  font-weight: 800;
}

.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 {
  position: relative;
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin-top: 14px;
  border-top: 1px solid var(--plotline-line);
  padding-top: 14px;
}

.plot-lane-svg-overlay {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.plot-lane-svg-health-overlay {
  z-index: 8;
}

.plot-line-svg-path {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  opacity: 0.72;
}

.plot-line-svg-segment-dormant {
  stroke-dasharray: 9 8;
  opacity: 0.48;
}

.plot-line-svg-connector {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.58;
}

.plot-line-svg-path.plotline-state-resolved,
.plot-line-svg-path.plotline-state-questionable {
  stroke: #8c9491;
  opacity: 0.42;
}

.plot-line-svg-path.plotline-state-abandoned {
  stroke: #9b2f36;
  opacity: 0.5;
}

.plot-event-svg-node.plotline-state-resolved,
.plot-event-svg-node.plotline-state-questionable {
  opacity: 0.88;
}

.plot-event-svg-node.plotline-state-abandoned {
  opacity: 0.9;
}

.plot-event-svg-node.plotline-state-abandoned line {
  stroke: #ffffff;
}

.plotline-health-marker path,
.plotline-health-marker circle {
  fill: #f4c430;
  stroke: #8a6712;
  stroke-width: 1.5;
}

.plotline-health-marker {
  pointer-events: visiblePainted;
}

.plotline-health-marker line,
.plotline-health-marker text {
  stroke: #5e4710;
  fill: #5e4710;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.plotline-health-marker text {
  font-size: 11px;
  font-weight: 800;
  stroke-width: 0;
  pointer-events: none;
}

.plotline-health-count {
  fill: #ffffff;
  stroke: #8a6712;
  stroke-width: 2;
  paint-order: stroke;
}

.plotline-health-marker-dangling path,
.plotline-health-marker-dangling circle {
  fill: #f8df8f;
}

.plotline-health-marker-abandoned path,
.plotline-health-marker-abandoned circle {
  fill: #d85c63;
  stroke: #8b1e2d;
}

.plotline-health-marker-abandoned line {
  stroke: #ffffff;
}

.plot-event-svg-node circle,
.plot-event-svg-node ellipse,
.plot-event-svg-node path {
  stroke: #ffffff;
  stroke-width: 2;
}

.plot-event-svg-node line,
.plot-event-svg-node path[fill="none"] {
  stroke: #8b1e2d;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plot-event-svg-node-reveal ellipse {
  stroke-width: 2.4;
}

.plot-event-svg-label {
  font-size: 9.5px;
  font-weight: 900;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  paint-order: stroke;
  stroke: rgba(30, 37, 43, 0.22);
  stroke-width: 0.8px;
  pointer-events: none;
}

.plot-event-svg-node-resolve path[fill="none"] {
  stroke: #ffffff;
}

.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;
}

.timeline-heading-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.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: center;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 46px;
  border: 1px dashed #d8ddd8;
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.62);
}

.thread-marker {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 30px;
  border: 2px solid color-mix(in srgb, var(--plot-colour), #000000 20%);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--plotline-ink);
  background: color-mix(in srgb, var(--plot-colour), #ffffff 66%);
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(30, 37, 43, 0.14);
}

.plot-lane-board [data-plot-event-node] {
  opacity: 1;
}

.thread-marker:hover,
.thread-marker:focus-visible {
  color: var(--plotline-ink);
  background: color-mix(in srgb, var(--plot-colour), #ffffff 48%);
  outline: 3px solid rgba(47, 111, 99, 0.22);
  outline-offset: 2px;
}

.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-marker.timeline-marker-story-turn,
.character-marker.timeline-marker-story-turn {
  border-width: 2px;
}

.asset-marker.timeline-marker-important,
.character-marker.timeline-marker-important {
  box-shadow: inset 0 -3px 0 rgba(197, 139, 43, 0.36);
}

.asset-marker.timeline-marker-state-change,
.character-marker.timeline-marker-state-change {
  border-style: double;
}

.asset-marker.timeline-marker-transfer {
  box-shadow: inset 3px 0 0 rgba(47, 111, 99, 0.32);
}

.character-marker.timeline-marker-exit {
  opacity: 0.86;
  border-style: dashed;
}

.asset-marker.timeline-marker-has-warning,
.character-marker.timeline-marker-has-warning {
  box-shadow: 0 0 0 2px rgba(179, 95, 59, 0.22);
}

.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);
}

.word-companion-suggestion-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(138, 111, 61, 0.24);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 248, 232, 0.72);
}

.word-companion-suggestion-list {
  display: grid;
  gap: 8px;
}

.word-companion-suggestion-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #ded9ea;
  border-left: 4px solid #8a6f3d;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.word-companion-suggestion-item > div:first-child {
  display: grid;
  gap: 3px;
}

.word-companion-suggestion-pill {
  margin-left: 6px;
}

.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;
}

.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;
}

.overview-chip-grid,
.context-nav,
.breadcrumb-trail {
  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);
}

.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);
}

.timeline-metric-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.timeline-metric-edit-select {
  display: grid;
  gap: 3px;
  min-width: 180px;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.timeline-metric-edit-status {
  align-self: center;
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
}

.timeline-metric-edit-hint {
  font-size: 0.82rem;
}

.metric-chart-frame canvas.metric-curve-editing {
  cursor: ns-resize;
}

.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);
}

.thread-marker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  font-size: 0.78rem;
  font-weight: 900;
}

.thread-marker-type-start .thread-marker-icon,
.thread-marker-type-resolve .thread-marker-icon,
.thread-marker-type-abandon .thread-marker-icon,
.thread-marker-type-twist .thread-marker-icon {
  font-size: 0.9rem;
}

.thread-marker-type-start {
  border-radius: 8px 999px 999px 8px;
}

.thread-marker-type-twist {
  border-color: #b8762b;
  background: #fff4dc;
}

.thread-marker-type-branch,
.thread-marker-type-split,
.thread-marker-type-merge {
  border-color: #6750a4;
  background: #f0ebff;
}

.thread-marker-type-reveal .thread-marker-icon {
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0;
}

.thread-marker-type-reveal .thread-marker-icon::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.timeline-navigation-card {
  display: grid;
  grid-template-areas:
    "icon copy"
    "icon actions";
  grid-template-columns: auto minmax(0, 620px);
  gap: 8px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(47, 111, 99, 0.42);
  border-left: 5px solid var(--plotline-accent);
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 14px 16px;
  max-height: 280px;
  overflow: hidden;
  color: var(--plotline-ink);
  background: linear-gradient(135deg, rgba(238, 245, 242, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 10px 26px rgba(30, 37, 43, 0.08);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.15s ease, max-height 1.2s ease, margin 1.2s ease, padding 1.2s ease, transform 1.15s ease;
}

.timeline-navigation-card[hidden] {
  display: none;
}

.timeline-navigation-card.is-dismissing {
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
}

.timeline-navigation-card-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--plotline-accent);
  font-size: 1.25rem;
  font-weight: 900;
}

.timeline-navigation-card-copy {
  grid-area: copy;
  text-align: center;
}

.timeline-navigation-card-copy h2 {
  margin: 0 0 6px;
  color: var(--plotline-accent-dark);
  font-size: 1rem;
  font-weight: 900;
}

.timeline-navigation-card-copy p {
  margin: 2px 0;
  color: var(--plotline-ink);
  font-size: 0.9rem;
}

.timeline-navigation-card-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.timeline-horizontal-overflow {
  transition: box-shadow 0.18s ease;
}

.timeline-horizontal-overflow.has-scroll-left {
  box-shadow: inset 18px 0 18px -20px rgba(30, 37, 43, 0.55);
}

.timeline-horizontal-overflow.has-scroll-right {
  box-shadow: inset -18px 0 18px -20px rgba(30, 37, 43, 0.55);
}

.timeline-horizontal-overflow.has-scroll-left.has-scroll-right {
  box-shadow: inset 18px 0 18px -20px rgba(30, 37, 43, 0.55), inset -18px 0 18px -20px rgba(30, 37, 43, 0.55);
}

[data-theme="dark"] .timeline-navigation-card {
  border-color: rgba(111, 169, 155, 0.52);
  border-left-color: #6fa99b;
  color: #f4eadc;
  background: linear-gradient(135deg, rgba(34, 83, 74, 0.72), rgba(32, 31, 34, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .timeline-navigation-card-copy h2,
[data-theme="dark"] .timeline-navigation-card-copy p {
  color: #f4eadc;
}

[data-theme="dark"] .timeline-horizontal-overflow.has-scroll-left {
  box-shadow: inset 18px 0 18px -20px rgba(244, 234, 220, 0.55);
}

[data-theme="dark"] .timeline-horizontal-overflow.has-scroll-right {
  box-shadow: inset -18px 0 18px -20px rgba(244, 234, 220, 0.55);
}

[data-theme="dark"] .timeline-horizontal-overflow.has-scroll-left.has-scroll-right {
  box-shadow: inset 18px 0 18px -20px rgba(244, 234, 220, 0.55), inset -18px 0 18px -20px rgba(244, 234, 220, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-navigation-card {
    transition: opacity 0.12s ease;
  }
}

.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);
}

.scene-overview-panel {
  display: none;
  gap: 8px;
  margin-top: 4px;
}

.scene-overview-section {
  display: grid;
  gap: 4px;
}

.scene-overview-label {
  color: var(--plotline-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scene-overview-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.scene-overview-chip,
.scene-overview-empty,
.scene-overview-brief {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(47, 111, 99, 0.08);
  color: var(--plotline-ink);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scene-overview-chip.is-pov {
  border: 1px solid rgba(197, 139, 43, 0.38);
  background: #fff3d3;
}

.scene-overview-chip.is-important {
  border: 1px solid rgba(103, 80, 164, 0.3);
  background: #f0edf8;
}

.scene-overview-chip.is-more,
.scene-overview-empty {
  color: var(--plotline-muted);
  background: rgba(102, 113, 123, 0.08);
}

.scene-overview-brief {
  display: block;
  width: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--plotline-muted);
  font-weight: 600;
}

.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.zoom-scene-overview {
  --timeline-scene-width: 380px;
}

.timeline-filtered-root.zoom-scene-overview .timeline-scenes {
  min-height: 320px;
}

.timeline-filtered-root.zoom-scene-overview .timeline-scene-card {
  gap: 8px;
  padding: 14px;
}

.timeline-filtered-root.zoom-scene-overview .scene-summary {
  display: none;
}

.timeline-filtered-root.zoom-scene-overview .scene-overview-panel {
  display: grid;
}

.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);
}

.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-priority-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
}

.writer-priority-control .form-range {
  min-width: 0;
}

.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 {
    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;
  }

  .timeline-navigation-card {
    grid-template-areas:
      "copy"
      "actions";
    grid-template-columns: 1fr;
  }

  .timeline-navigation-card-icon {
    display: none;
  }

  .timeline-navigation-card-actions {
    justify-content: center;
  }

  .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;
  }

  .trial-status-panel--signup,
  .trial-status-panel__heading,
  .trial-dashboard-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .trial-dashboard-banner__actions,
  .trial-dashboard-banner__actions .btn,
  .trial-status-panel--signup .btn {
    width: 100%;
  }

  .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;
  }
}

.floor-plan-list {
  display: grid;
  gap: 12px;
}

.floor-plan-list-item {
  align-items: center;
  border: 1px solid var(--border-color, #d8ded9);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.floor-plan-list-item h2 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.floor-plan-list-item p {
  margin: 0;
}

.floor-plan-tools {
  display: grid;
  gap: 14px;
}

.floor-plan-meta-wide {
  max-width: none;
}

.floor-plan-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.floor-plan-tab {
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border-color, #d8ded9);
  border-radius: 999px;
  color: inherit;
  padding: 6px 12px;
}

.floor-plan-tab.active {
  background: var(--bs-primary, #2f6f63);
  border-color: var(--bs-primary, #2f6f63);
  color: #fff;
}

.floor-plan-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

.floor-plan-editor--occupancy .floor-plan-layout {
  grid-template-columns: minmax(0, 1fr);
}

.floor-plan-editor-toolbar {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--border-color, #d8ded9);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  position: sticky;
  top: 10px;
  z-index: 20;
}

.floor-plan-toolbar-main,
.floor-plan-toolbar-floor-group,
.floor-plan-toolbar-control-group,
.floor-plan-toolbar-action-group,
.floor-plan-occupancy-scene-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.floor-plan-toolbar-main {
  justify-content: space-between;
}

/* Scene Inspector V2: summary-first shell scoped to the new hosts only. */
.scene-editor-v2-workspace {
  max-width: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.scene-inspector-v2 {
  position: relative;
  display: grid;
  gap: 14px;
  color: var(--plotline-ink);
}

.scene-inspector-v2-edit {
  --scene-editor-width: 520px;
  padding-bottom: 16px;
}

.scene-inspector-v2-edit.editor-overlay-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(400px, min(var(--scene-editor-width), 46%));
  align-items: stretch;
  gap: 12px;
  height: clamp(480px, calc(100vh - 240px), 820px);
  min-height: 0;
}

.scene-inspector-v2-summary-pane {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.scene-inspector-v2-edit.editor-overlay-open .scene-inspector-v2-summary-pane {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.scene-inspector-v2-edit.editor-overlay-open .scene-inspector-v2-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scene-inspector-v2-timeline {
  min-height: 100%;
}

.scene-inspector-v2-timeline.editor-overlay-open {
  height: clamp(380px, calc(100vh - 190px), 680px);
  min-height: 0;
  overflow: hidden;
}

.scene-inspector-v2-grid {
  display: grid;
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scene-inspector-v2-edit .scene-inspector-v2-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.scene-inspector-v2-health {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
}

.scene-inspector-v2-health > div,
.scene-inspector-v2-card,
.scene-inspector-editor-overlay {
  border: 1px solid var(--plotline-line);
  background: var(--plotline-panel);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 37, 43, 0.06);
}

.scene-inspector-v2-health > div {
  min-width: 0;
  padding: 10px 12px;
}

.scene-inspector-v2-health span,
.scene-inspector-v2-section > span,
.scene-inspector-v2-counts span,
.scene-inspector-v2-summary > span,
.scene-inspector-v2-facts dt {
  display: block;
  color: var(--plotline-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-inspector-v2-health strong {
  display: block;
  overflow: hidden;
  color: var(--plotline-ink);
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-inspector-v2-health .attention strong,
.scene-inspector-v2-counts .attention strong {
  color: var(--plotline-danger, #b35f3b);
}

.scene-inspector-v2-card {
  display: grid;
  align-content: start;
  gap: 14px;
  height: 100%;
  min-width: 0;
  padding: 16px;
}

.scene-inspector-v2-edit .scene-inspector-v2-card {
  gap: 10px;
  padding: 14px;
}

.scene-inspector-v2-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-inspector-v2-card-header > div:first-child {
  min-width: 0;
}

.scene-inspector-v2-card-header h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.scene-inspector-v2-heading,
.scene-inspector-editor-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.scene-inspector-v2-heading h3,
.scene-inspector-editor-title-row h3 {
  min-width: 0;
}

.scene-inspector-v2-heading .plotline-help-icon-wrapper {
  flex: 0 0 auto;
}

.scene-inspector-v2-edit .scene-inspector-v2-card-header {
  gap: 10px;
}

.scene-inspector-v2-edit .scene-inspector-v2-card-header h3 {
  font-size: 1rem;
}

.scene-inspector-v2-card p {
  margin: 0;
}

.scene-inspector-v2-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.scene-inspector-v2-facts div {
  min-width: 0;
}

.scene-inspector-v2-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.scene-inspector-v2-summary,
.scene-inspector-v2-section {
  display: grid;
  gap: 6px;
}

.scene-inspector-v2-edit .scene-inspector-v2-summary,
.scene-inspector-v2-edit .scene-inspector-v2-section {
  gap: 5px;
}

.scene-inspector-v2-chip-row,
.scene-inspector-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.scene-inspector-v2-edit .scene-inspector-v2-actions {
  gap: 6px;
}

.scene-inspector-v2-edit .scene-inspector-v2-actions .btn {
  padding: 0.22rem 0.5rem;
}

.scene-inspector-v2-card-header .scene-inspector-v2-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  max-width: 100%;
}

.scene-inspector-v2-card-header .scene-inspector-v2-action-menu {
  flex-wrap: nowrap;
  max-width: 100%;
}

.scene-inspector-v2-card-header .scene-inspector-v2-action-menu .btn {
  white-space: nowrap;
}

.scene-inspector-v2-action-menu .dropdown-menu {
  min-width: 11rem;
}

.scene-inspector-v2-action-menu .dropdown-item {
  font-size: 0.86rem;
}

.scene-inspector-v2-chip-row span {
  border: 1px solid rgba(47, 111, 99, 0.18);
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.08);
  padding: 3px 9px;
  color: var(--plotline-accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.scene-inspector-v2-metrics,
.scene-inspector-v2-counts {
  display: grid;
  gap: 8px;
}

.scene-inspector-v2-metrics {
  grid-template-columns: 1fr;
}

.scene-inspector-v2-counts {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.scene-inspector-v2-metrics > div,
.scene-inspector-v2-counts > div {
  min-width: 0;
  border: 1px solid rgba(47, 111, 99, 0.12);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.05);
  padding: 9px 10px;
}

.scene-inspector-v2-edit .scene-inspector-v2-metrics > div,
.scene-inspector-v2-edit .scene-inspector-v2-counts > div {
  padding: 7px 8px;
}

.scene-inspector-v2-metrics span {
  display: block;
  overflow: hidden;
  color: var(--plotline-muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-inspector-v2-metrics strong,
.scene-inspector-v2-counts strong {
  display: block;
  color: var(--plotline-ink);
  font-size: 1rem;
}

.scene-inspector-v2-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scene-inspector-v2-edit .scene-inspector-v2-list {
  gap: 5px;
}

.scene-inspector-v2-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(47, 111, 99, 0.1);
  padding-bottom: 6px;
}

.scene-inspector-v2-edit .scene-inspector-v2-list li {
  padding-bottom: 5px;
}

.scene-inspector-v2-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.scene-inspector-v2-list span {
  color: var(--plotline-muted);
  font-size: 0.82rem;
  text-align: right;
}

.scene-inspector-v2-character-list,
.scene-inspector-v2-compact-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scene-inspector-v2-character-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.scene-inspector-v2-character-list strong,
.scene-inspector-v2-character-list span {
  display: block;
}

.scene-inspector-v2-character-list div {
  min-width: 0;
}

.scene-inspector-v2-character-list div span {
  color: var(--plotline-muted);
  font-size: 0.8rem;
}

.scene-inspector-v2-character-list .visual-avatar {
  width: 34px;
}

.scene-inspector-v2-character-list .visual-avatar > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.scene-inspector-v2-avatar-pov {
  box-shadow: 0 0 0 2px rgba(47, 111, 99, 0.24);
}

.scene-inspector-v2-mini-badge {
  border: 1px solid rgba(47, 111, 99, 0.2);
  border-radius: 999px;
  background: var(--plotline-soft);
  color: var(--plotline-accent-dark);
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 800;
}

.scene-inspector-v2-preview-stack {
  display: grid;
  gap: 8px;
}

.scene-inspector-v2-preview-group {
  border: 1px solid rgba(47, 111, 99, 0.12);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 8px 10px;
}

.scene-inspector-v2-preview-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--plotline-accent-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.scene-inspector-v2-preview-group summary span {
  color: var(--plotline-muted);
  font-size: 0.76rem;
}

.scene-inspector-v2-preview-group[open] summary {
  margin-bottom: 7px;
}

.scene-inspector-v2-compact-list li {
  min-width: 0;
  color: var(--plotline-ink);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.scene-inspector-v2-compact-list li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.42);
  vertical-align: middle;
}

.scene-inspector-v2-compact-list a {
  color: var(--plotline-accent-dark);
  font-weight: 700;
}

.scene-inspector-v2-suggestion-strip,
.scene-inspector-v2-good-state,
.scene-inspector-v2-warning-state {
  border-radius: 8px;
  padding: 8px 10px;
}

.scene-inspector-v2-suggestion-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(197, 139, 43, 0.24);
  background: rgba(197, 139, 43, 0.1);
}

.scene-inspector-v2-suggestion-strip strong {
  color: #805815;
  font-size: 1rem;
}

.scene-inspector-v2-suggestion-strip span {
  color: var(--plotline-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.scene-inspector-v2-good-state {
  border: 1px solid rgba(47, 111, 99, 0.16);
  background: rgba(47, 111, 99, 0.07);
  color: var(--plotline-accent-dark);
  font-weight: 800;
}

.scene-inspector-v2-good-state::before {
  content: "\2713";
  margin-right: 7px;
}

.scene-inspector-v2-warning-state {
  border: 1px solid rgba(179, 95, 59, 0.22);
  background: rgba(179, 95, 59, 0.1);
  color: var(--plotline-danger, #b35f3b);
  font-weight: 800;
}

.scene-inspector-v2-metric-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.scene-inspector-v2-metric-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-inspector-v2-metric-track {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.12);
  padding: 0;
}

.scene-inspector-v2-metric-track i {
  display: block;
  width: var(--metric-percent);
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fa99b, var(--plotline-accent-dark));
}

.scene-inspector-v2-callout {
  border-left: 4px solid var(--plotline-warning, #c58b2b);
  border-radius: 8px;
  background: rgba(197, 139, 43, 0.1);
  padding: 10px 12px;
}

.scene-overview-v2-header {
  align-items: flex-start;
}

.scene-overview-v2-controls {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.scene-overview-v2-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.scene-overview-v2-facts div:nth-child(3),
.scene-overview-v2-summary {
  grid-column: 1 / -1;
}

.scene-overview-v2-summary p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.scene-inspector-editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  max-height: 100%;
  padding: 16px;
  overflow: hidden;
  background: var(--plotline-panel);
}

.scene-inspector-editor-overlay[hidden] {
  display: none;
}

.scene-inspector-v2-edit .scene-inspector-editor-overlay {
  position: static;
  inset: auto;
  z-index: 1;
  min-width: 0;
  height: 100%;
  max-height: none;
}

.scene-inspector-editor-resizer {
  display: none;
}

.scene-inspector-v2-edit.editor-overlay-open .scene-inspector-editor-resizer {
  display: block;
  align-self: stretch;
  min-height: 100%;
  border-radius: 999px;
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(47, 111, 99, 0.16), rgba(47, 111, 99, 0.04));
}

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

.scene-inspector-v2-edit.editor-overlay-open .scene-inspector-editor-resizer:focus-visible,
.scene-inspector-v2-edit.editor-overlay-open .scene-inspector-editor-resizer:hover {
  background: rgba(47, 111, 99, 0.16);
}

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

.scene-inspector-editor-shell {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--plotline-line);
  background: var(--plotline-panel);
  padding-bottom: 12px;
}

.scene-inspector-editor-shell h3 {
  margin: 0;
  font-size: 1.1rem;
}

.scene-inspector-editor-help {
  flex: 0 0 auto;
}

.scene-inspector-editor-empty {
  min-height: 0;
  overflow: auto;
}

.scene-inspector-editor-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100%;
  gap: 14px;
}

.scene-inspector-editor-fields {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 4px;
}

.scene-inspector-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scene-inspector-editor-fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  padding: 12px;
}

.scene-inspector-editor-fieldset legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0 4px;
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-inspector-editor-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scene-inspector-editor-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(47, 111, 99, 0.12);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.05);
  padding: 8px 10px;
}

.scene-inspector-editor-checks span {
  overflow-wrap: anywhere;
}

.scene-inspector-editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--plotline-line);
  background: var(--plotline-panel);
  padding-top: 12px;
}

.scene-inspector-editor-error {
  border: 1px solid rgba(179, 95, 59, 0.28);
  border-radius: 8px;
  background: rgba(179, 95, 59, 0.1);
  padding: 10px 12px;
  color: var(--plotline-danger, #b35f3b);
  font-weight: 700;
}

.scene-inspector-editor-loading,
.scene-inspector-editor-pending {
  border: 1px dashed rgba(47, 111, 99, 0.24);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 16px;
  color: var(--plotline-muted);
}

.scene-inspector-editor-metric {
  display: grid;
  gap: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 12px;
}

.scene-inspector-editor-metric-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-inspector-editor-metric-heading h4 {
  margin: 0;
  font-size: 0.98rem;
}

.scene-inspector-editor-metric-heading p {
  margin: 3px 0 0;
  color: var(--plotline-muted);
  font-size: 0.88rem;
}

.scene-inspector-editor-metric-heading output {
  min-width: 42px;
  border-radius: 8px;
  background: var(--plotline-accent);
  padding: 5px 8px;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.scene-inspector-editor-range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--plotline-muted);
  font-size: 0.78rem;
}

.scene-character-editor-section {
  display: grid;
  gap: 10px;
}

.scene-character-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-character-editor-heading strong {
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.1);
  padding: 2px 8px;
  color: var(--plotline-accent-dark);
}

.scene-character-pov-options {
  display: grid;
  gap: 7px;
}

.scene-character-pov-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.scene-character-editor-list {
  display: grid;
  gap: 10px;
}

.scene-character-editor-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 12px;
}

.scene-character-editor-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-character-editor-card-header h4 {
  margin: 0;
  font-size: 1rem;
}

.scene-character-editor-card-header p {
  margin: 2px 0 0;
  color: var(--plotline-muted);
  font-size: 0.86rem;
}

.scene-character-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.scene-world-editor-section {
  display: grid;
  gap: 10px;
}

.scene-world-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-world-editor-heading strong {
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.1);
  padding: 2px 8px;
  color: var(--plotline-accent-dark);
}

.scene-world-editor-list {
  display: grid;
  gap: 10px;
}

.scene-world-editor-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 12px;
}

.scene-world-editor-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-world-editor-card-header h4 {
  margin: 0;
  font-size: 1rem;
}

.scene-world-editor-card-header p {
  margin: 2px 0 0;
  color: var(--plotline-muted);
  font-size: 0.86rem;
}

.scene-world-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.scene-writer-editor-section {
  display: grid;
  gap: 10px;
}

.scene-writer-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-writer-editor-heading strong {
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.1);
  padding: 2px 8px;
  color: var(--plotline-accent-dark);
}

.scene-writer-editor-list {
  display: grid;
  gap: 10px;
}

.scene-writer-editor-card,
.scene-writer-checklist-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 12px;
}

.scene-writer-editor-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-writer-editor-card-header h4 {
  margin: 0;
  font-size: 1rem;
}

.scene-writer-editor-card-header p {
  margin: 2px 0 0;
  color: var(--plotline-muted);
  font-size: 0.86rem;
}

.scene-writer-checklist-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.scene-writer-remove,
.scene-writer-checklist-complete,
.scene-writer-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.scene-attachment-editor-card {
  align-items: stretch;
}

.scene-attachment-preview-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.scene-attachment-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.06);
  color: var(--plotline-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.scene-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-attachment-preview-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.scene-attachment-preview-copy p {
  margin: 0;
}

.scene-attachment-editor-form,
.scene-attachment-delete-form {
  display: grid;
  gap: 10px;
}

.scene-attachment-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.scene-structure-editor-section {
  display: grid;
  gap: 10px;
}

.scene-structure-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--plotline-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-structure-editor-heading strong {
  border-radius: 999px;
  background: rgba(47, 111, 99, 0.1);
  padding: 2px 8px;
  color: var(--plotline-accent-dark);
}

.scene-structure-editor-list,
.scene-structure-editor-form,
.scene-structure-delete-form {
  display: grid;
  gap: 10px;
}

.scene-structure-editor-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--plotline-line);
  border-radius: 8px;
  background: rgba(47, 111, 99, 0.04);
  padding: 12px;
}

.scene-structure-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-structure-card-header h4 {
  margin: 0;
  font-size: 1rem;
}

.scene-structure-card-header p,
.scene-structure-editor-card p {
  margin: 2px 0 0;
}

.scene-structure-marker {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--plot-colour, var(--plotline-accent));
  padding: 3px 8px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.scene-structure-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.scene-structure-inline-check {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 6px;
  margin: 0;
  color: var(--plotline-muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.scene-inspector-v2-timeline .scene-inspector-v2-health {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scene-inspector-v2-timeline .scene-inspector-v2-card {
  padding: 14px;
}

.scene-inspector-v2-timeline .scene-inspector-v2-card-header,
.scene-inspector-v2-timeline .scene-inspector-v2-list li {
  align-items: stretch;
  flex-direction: column;
}

.scene-inspector-v2-timeline .scene-inspector-v2-card-header .scene-inspector-v2-actions {
  justify-content: flex-start;
}

.scene-inspector-v2-timeline .scene-inspector-v2-facts,
.scene-inspector-v2-timeline .scene-inspector-v2-metrics,
.scene-inspector-v2-timeline .scene-inspector-v2-counts {
  grid-template-columns: 1fr;
}

.scene-inspector-v2-timeline .scene-inspector-v2-metrics {
  grid-template-columns: 1fr;
}

.scene-inspector-v2-timeline .scene-inspector-v2-metric-track {
  height: 7px;
}

.scene-inspector-v2-timeline .scene-inspector-v2-metric-row {
  grid-template-columns: minmax(118px, 150px) minmax(0, 1fr) auto;
}

@media (max-width: 1100px) {
  .scene-inspector-v2-edit.editor-overlay-open {
    grid-template-columns: minmax(0, 1fr) 10px minmax(360px, min(var(--scene-editor-width), 52%));
  }

  .scene-inspector-v2-grid,
  .scene-inspector-v2-health {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .scene-inspector-v2-edit .scene-inspector-v2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .scene-inspector-v2-grid,
  .scene-inspector-v2-health,
  .scene-inspector-v2-facts,
  .scene-inspector-v2-metrics,
  .scene-inspector-v2-counts {
    grid-template-columns: 1fr;
  }

  .scene-inspector-v2-card-header {
    flex-direction: column;
  }

  .scene-inspector-editor-grid,
  .scene-inspector-editor-checks {
    grid-template-columns: 1fr;
  }

  .scene-writer-checklist-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .scene-attachment-preview-row {
    grid-template-columns: 1fr;
  }

  .scene-structure-dependency-columns {
    grid-template-columns: 1fr;
  }
}

.floor-plan-toolbar-floor-group {
  flex: 1 1 420px;
  min-width: min(100%, 320px);
}

.floor-plan-active-floor {
  display: grid;
  gap: 2px;
}

.floor-plan-toolbar-control-group {
  flex: 0 1 auto;
}

.floor-plan-toolbar-action-group {
  flex: 1 1 360px;
  justify-content: flex-end;
}

.floor-plan-occupancy-scene-row {
  border-top: 1px solid rgba(47, 111, 99, .12);
  padding-top: 9px;
}

.floor-plan-occupancy-scene-row[hidden] {
  display: none;
}

.floor-plan-occupancy-scene-row .floor-plan-reference-control {
  flex: 1 1 320px;
  min-width: min(100%, 320px);
}

.floor-plan-occupancy-scene-row .form-select {
  width: 100%;
}

.floor-plan-occupancy-warning-panel {
  background: rgba(47, 111, 99, .05);
  border: 1px solid rgba(47, 111, 99, .16);
  border-radius: 8px;
  color: var(--plotline-ink, #1e252b);
  flex: 1 1 100%;
  font-size: .82rem;
  padding: .55rem .7rem;
}

.floor-plan-occupancy-warning-panel strong {
  display: block;
  font-size: .78rem;
  margin-bottom: .25rem;
  text-transform: uppercase;
}

.floor-plan-occupancy-warning-panel p,
.floor-plan-occupancy-warning-panel ul {
  margin: 0;
}

.floor-plan-occupancy-warning-panel ul {
  display: grid;
  gap: .25rem;
  list-style: none;
  padding: 0;
}

.floor-plan-occupancy-warning,
.floor-plan-occupancy-warning-empty {
  border-radius: 6px;
  font-weight: 700;
  padding: .32rem .45rem;
}

.floor-plan-occupancy-warning-empty {
  background: rgba(47, 111, 99, .08);
  color: var(--plotline-accent-dark, #22534a);
}

.floor-plan-occupancy-warning--warning {
  background: rgba(251, 236, 211, .78);
  color: #7b4b12;
}

.floor-plan-occupancy-warning--info {
  background: rgba(233, 243, 248, .86);
  color: #245b78;
}

.floor-plan-occupancy-warning[hidden],
.floor-plan-occupancy-warning-empty[hidden] {
  display: none;
}

.floor-plan-editor-toolbar .muted {
  display: block;
  font-size: .76rem;
  line-height: 1.1;
}

.floor-plan-toolbar-check,
.floor-plan-reference-control {
  align-items: center;
  color: var(--muted-color, #6b756f);
  display: inline-flex;
  font-size: .82rem;
  font-weight: 700;
  gap: 6px;
}

.floor-plan-reference-control {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.floor-plan-reference-control .form-select {
  min-width: 180px;
}

.floor-plan-save-status {
  border: 1px solid rgba(47, 111, 99, .2);
  border-radius: 999px;
  color: var(--plotline-accent-dark, #22534a);
  background: rgba(47, 111, 99, .08);
  font-size: .78rem;
  font-weight: 800;
  padding: 4px 9px;
}

.floor-plan-save-status[data-save-state="dirty"] {
  border-color: rgba(184, 118, 43, .32);
  color: #7b4b12;
  background: rgba(251, 236, 211, .72);
}

.floor-plan-save-status[data-save-state="saving"] {
  border-color: rgba(51, 117, 155, .3);
  color: #245b78;
  background: rgba(233, 243, 248, .82);
}

.floor-plan-save-status[data-save-state="failed"] {
  border-color: rgba(163, 61, 61, .32);
  color: #8a3434;
  background: rgba(255, 232, 232, .9);
}

.floor-plan-floor {
  display: none;
}

.floor-plan-floor.active {
  display: block;
}

.floor-plan-stage {
  min-width: 0;
}

.floor-plan-grid-wrap {
  max-width: 100%;
  max-height: calc(100vh - 250px);
  min-height: min(58vh, 520px);
  overflow: auto;
  padding-bottom: 8px;
}

.floor-plan-grid {
  --cell-size: 34px;
  background:
    linear-gradient(to right, rgba(93, 111, 101, .18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(93, 111, 101, .18) 1px, transparent 1px),
    var(--panel-bg, #fff);
  background-size: var(--cell-size) var(--cell-size), var(--cell-size) var(--cell-size), auto;
  border: 1px solid var(--border-color, #d8ded9);
  border-radius: 8px;
  height: calc(var(--grid-height) * var(--cell-size));
  min-width: calc(var(--grid-width) * var(--cell-size));
  position: relative;
  width: calc(var(--grid-width) * var(--cell-size));
}

.floor-plan-coordinate-label {
  color: rgba(33, 61, 55, .42);
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  user-select: none;
  z-index: 5;
}

.floor-plan-coordinate-label--column {
  left: calc(var(--coord-x) * var(--cell-size) + 4px);
  top: 3px;
}

.floor-plan-coordinate-label--row {
  left: 4px;
  top: calc(var(--coord-y) * var(--cell-size) + 4px);
}

.floor-plan-reference-overlay {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.floor-plan-reference-block {
  align-items: center;
  background: rgba(47, 111, 99, .08);
  border: 1px dashed rgba(47, 111, 99, .34);
  border-radius: 2px;
  color: rgba(27, 55, 49, .46);
  display: flex;
  font-size: .62rem;
  font-weight: 800;
  height: calc(var(--h) * var(--cell-size));
  justify-content: center;
  left: calc(var(--x) * var(--cell-size));
  line-height: 1.05;
  overflow: hidden;
  padding: 3px;
  position: absolute;
  text-align: center;
  top: calc(var(--y) * var(--cell-size));
  width: calc(var(--w) * var(--cell-size));
}

.floor-plan-reference-warning {
  background: rgba(251, 236, 211, .92);
  border: 1px solid rgba(184, 118, 43, .34);
  border-radius: 999px;
  color: #7b4b12;
  font-size: .76rem;
  font-weight: 800;
  left: 10px;
  padding: 4px 10px;
  pointer-events: none;
  position: absolute;
  top: 10px;
  z-index: 6;
}

.floor-plan-background-image {
  height: auto;
  left: 0;
  max-width: none;
  opacity: var(--bg-opacity, .35);
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(var(--bg-offset-x, 0), var(--bg-offset-y, 0)) scale(var(--bg-scale, 1));
  transform-origin: top left;
  user-select: none;
  width: 100%;
  z-index: 0;
}

.floor-plan-background-image.is-locked {
  pointer-events: none;
}

.floor-plan-block {
  align-items: center;
  --floor-plan-wall-color: rgba(44, 84, 75, .55);
  border: 2px solid transparent;
  border-radius: 2px;
  color: #12332c;
  cursor: grab;
  display: flex;
  font-size: .72rem;
  font-weight: 700;
  height: calc(var(--h) * var(--cell-size));
  justify-content: center;
  left: calc(var(--x) * var(--cell-size));
  line-height: 1.08;
  overflow: hidden;
  padding: 4px;
  position: absolute;
  text-align: center;
  top: calc(var(--y) * var(--cell-size));
  touch-action: none;
  width: calc(var(--w) * var(--cell-size));
  z-index: 2;
}

.floor-plan-wall-segment {
  background: var(--floor-plan-wall-color);
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.floor-plan-wall-segment--north,
.floor-plan-wall-segment--south {
  height: 2px;
  left: var(--wall-start);
  width: var(--wall-length);
}

.floor-plan-wall-segment--north {
  top: 0;
}

.floor-plan-wall-segment--south {
  bottom: 0;
}

.floor-plan-wall-segment--east,
.floor-plan-wall-segment--west {
  height: var(--wall-length);
  top: var(--wall-start);
  width: 2px;
}

.floor-plan-wall-segment--east {
  right: 0;
}

.floor-plan-wall-segment--west {
  left: 0;
}

.floor-plan-block-label {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.floor-plan-block[style*="--h:2"] .floor-plan-block-label,
.floor-plan-block[style*="--h:3"] .floor-plan-block-label,
.floor-plan-block[style*="--h:4"] .floor-plan-block-label,
.floor-plan-block[style*="--h:5"] .floor-plan-block-label,
.floor-plan-block[style*="--h:6"] .floor-plan-block-label,
.floor-plan-block[style*="--h:7"] .floor-plan-block-label,
.floor-plan-block[style*="--h:8"] .floor-plan-block-label {
  -webkit-line-clamp: 2;
}

.floor-plan-block.selected {
  box-shadow: 0 0 0 3px rgba(47, 111, 99, .28);
  outline: 2px solid var(--bs-primary, #2f6f63);
  z-index: 3;
}

.floor-plan-block.overlap {
  border-color: #b45544;
  box-shadow: inset 0 0 0 2px rgba(180, 85, 68, .18);
}

.floor-plan-block.is-hidden-location {
  background-image: repeating-linear-gradient(135deg, rgba(18, 51, 44, .08) 0, rgba(18, 51, 44, .08) 3px, transparent 3px, transparent 9px);
  box-shadow: inset 0 0 0 1px rgba(43, 54, 49, .18);
}

.floor-plan-block.is-hidden-location.selected {
  box-shadow: inset 0 0 0 1px rgba(43, 54, 49, .18), 0 0 0 3px rgba(47, 111, 99, .28);
}

.floor-plan-block.is-hidden-location.overlap {
  box-shadow: inset 0 0 0 2px rgba(180, 85, 68, .18), inset 0 0 0 1px rgba(43, 54, 49, .18);
}

.floor-plan-secret-route {
  border-top: 2px dashed rgba(69, 55, 42, .58);
  height: 0;
  left: calc(var(--route-x, 0) * var(--cell-size));
  opacity: .72;
  pointer-events: none;
  position: absolute;
  top: calc(var(--route-y, 0) * var(--cell-size));
  transform: rotate(var(--route-angle, 0));
  transform-origin: 0 50%;
  width: calc(var(--route-length, 0) * var(--cell-size));
  z-index: 3;
}

.floor-plan-secret-route::after {
  background: rgba(255, 250, 242, .9);
  border: 1px solid rgba(69, 55, 42, .5);
  border-radius: 50%;
  content: "";
  height: 7px;
  left: 50%;
  position: absolute;
  top: -5px;
  transform: translateX(-50%);
  width: 7px;
}

.floor-plan-transition-marker {
  align-items: center;
  --transition-marker-ink: #12332c;
  --transition-marker-window: #246f9f;
  --transition-marker-blocked: #9b342b;
  background: rgba(255, 250, 242, .98);
  border: 1px solid rgba(47, 111, 99, .55);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(31, 37, 34, .16);
  color: var(--transition-marker-ink);
  display: flex;
  font-size: .72rem;
  font-weight: 900;
  height: 21px;
  justify-content: center;
  left: calc(var(--transition-x, 0) * var(--cell-size));
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: calc(var(--transition-y, 0) * var(--cell-size));
  transform: translate(-50%, -50%);
  width: 21px;
  z-index: 4;
}

.floor-plan-transition-marker svg {
  display: block;
  height: 21px;
  overflow: visible;
  width: 21px;
}

.floor-plan-transition-marker.is-vertical svg {
  transform: rotate(90deg);
}

.floor-plan-transition-marker .marker-line,
.floor-plan-transition-marker .marker-arc,
.floor-plan-transition-marker .marker-window,
.floor-plan-transition-marker .marker-blocked {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.floor-plan-transition-marker .marker-arc {
  stroke-width: 1.35;
}

.floor-plan-transition-marker .marker-window {
  stroke: var(--transition-marker-window);
}

.floor-plan-transition-marker .marker-dotted {
  opacity: .72;
  stroke-dasharray: 1.4 2;
}

.floor-plan-transition-marker .marker-blocked {
  stroke: var(--transition-marker-blocked);
  stroke-width: 1.8;
}

.floor-plan-transition-marker .marker-strong {
  stroke-width: 2;
}

.floor-plan-transition-marker .marker-track {
  opacity: .72;
}

.floor-plan-transition-marker--window {
  background: rgba(239, 249, 255, .98);
  border-color: rgba(36, 111, 159, .48);
}

.floor-plan-transition-marker--sliding-door {
  background: rgba(248, 252, 249, .98);
  border-color: rgba(47, 111, 99, .58);
}

.floor-plan-transition-marker--french-door {
  background: rgba(255, 252, 246, .98);
  border-color: rgba(119, 86, 45, .5);
}

.floor-plan-transition-marker--secret-door {
  background: rgba(255, 250, 242, .88);
  border-style: dashed;
}

.floor-plan-transition-marker--ladder {
  background: rgba(246, 248, 245, .98);
  border-color: rgba(77, 91, 67, .55);
}

.floor-plan-transition-marker--blocked-door {
  background: rgba(255, 244, 241, .98);
  border-color: rgba(155, 52, 43, .52);
}

.floor-plan-transition-marker--exterior-door {
  border-width: 2px;
}

.floor-plan-transition-marker.is-shared-edge {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(47, 111, 99, .72);
}

.floor-plan-transition-marker--window.is-shared-edge {
  background: rgba(239, 249, 255, .98);
  border-color: rgba(36, 111, 159, .58);
}

.floor-plan-transition-marker--blocked-door.is-shared-edge {
  background: rgba(255, 244, 241, .98);
  border-color: rgba(155, 52, 43, .6);
}

.visual-card-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.visual-card-heading > div {
  min-width: 0;
}

.visual-avatar {
  align-items: center;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(47, 111, 99, .16), rgba(212, 154, 98, .16));
  border: 1px solid rgba(47, 111, 99, .22);
  border-radius: 999px;
  color: var(--plotline-accent-dark, #22534a);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  justify-content: center;
  letter-spacing: .02em;
  overflow: hidden;
  text-transform: uppercase;
}

.visual-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.visual-avatar--sm {
  font-size: .72rem;
  width: 32px;
}

.visual-avatar--md {
  font-size: .9rem;
  width: 48px;
}

.visual-avatar--lg {
  font-size: 1.3rem;
  width: 96px;
}

.visual-avatar--xl {
  font-size: 1.6rem;
  width: 128px;
}

.visual-image-editor {
  align-items: center;
  background: rgba(47, 111, 99, .05);
  border: 1px solid rgba(47, 111, 99, .14);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  padding: 14px;
}

.visual-image-editor__controls {
  flex: 1 1 auto;
  min-width: 220px;
}

.floor-plan-block--room {
  background: #d9eee7;
}

.floor-plan-block--corridor {
  background: #e7e2f4;
}

.floor-plan-block--openspace {
  background: #e5efd4;
}

.floor-plan-block--exterior {
  background: #d9ecf3;
}

.floor-plan-block--other {
  background: #ece9e1;
}

.floor-plan-resize-handle {
  border-bottom: 10px solid rgba(18, 51, 44, .45);
  border-left: 10px solid transparent;
  bottom: 4px;
  height: 0;
  position: absolute;
  right: 4px;
  width: 0;
}

.floor-plan-side-panel {
  align-self: start;
  position: sticky;
  top: 82px;
}

.floor-plan-side-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.floor-plan-side-panel h3 {
  font-size: .92rem;
  margin: 0 0 8px;
}

.floor-plan-toolbox {
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border-color, #d8ded9);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 250px);
  min-height: min(58vh, 520px);
  overflow: hidden;
}

.floor-plan-toolbox-tabs {
  border-bottom: 1px solid var(--border-color, #d8ded9);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.floor-plan-toolbox-tab {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border-color, #d8ded9);
  border-bottom: 1px solid var(--border-color, #d8ded9);
  color: inherit;
  flex: 1 1 118px;
  font-size: .82rem;
  font-weight: 800;
  min-width: 112px;
  padding: 10px 8px;
}

.floor-plan-toolbox-tab:last-child,
.floor-plan-toolbox-tab.active:last-child {
  border-right: 0;
}

.floor-plan-toolbox-tab.active {
  background: rgba(47, 111, 99, .1);
  border-bottom-color: var(--plotline-accent, #2f6f63);
  color: var(--plotline-accent-dark, #22534a);
}

.floor-plan-toolbox-body {
  min-height: 0;
  overflow: auto;
}

.floor-plan-tool-card {
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border-color, #d8ded9);
  border-radius: 8px;
  padding: 14px;
}

.floor-plan-toolbox .floor-plan-tool-card {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.floor-plan-tool-card[hidden] {
  display: none;
}

.floor-plan-tool-card p {
  margin-bottom: 10px;
}

.floor-plan-tool-subsection {
  border-top: 1px solid var(--border-color, #d8ded9);
  margin-top: 12px;
  padding-top: 12px;
}

.floor-plan-tool-subsection:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.floor-plan-background-file {
  border: 1px solid rgba(47, 111, 99, .16);
  border-radius: 6px;
  font-size: .86rem;
  padding: 8px 10px;
}

.floor-plan-background-range {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 44px;
}

.floor-plan-background-range span {
  color: var(--muted-text, #5d6f65);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.floor-plan-transition-list {
  display: grid;
  gap: 8px;
}

.floor-plan-transition-item {
  border: 1px solid rgba(47, 111, 99, .14);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 8px;
}

.floor-plan-transition-item strong,
.floor-plan-transition-item span {
  display: block;
  font-size: .84rem;
}

.floor-plan-transition-item span {
  color: var(--muted-text, #5d6f65);
}

.floor-plan-editor--occupancy .floor-plan-block {
  cursor: default;
  touch-action: auto;
}

.floor-plan-editor--occupancy .floor-plan-resize-handle {
  display: none;
}

.floor-plan-editor--occupancy .floor-plan-side-panel {
  display: none;
}

.floor-plan-occupancy-tray {
  position: absolute;
  z-index: 14;
  height: calc(var(--h) * var(--cell-size));
  left: calc(var(--x) * var(--cell-size));
  top: calc(var(--y) * var(--cell-size));
  width: calc(var(--w) * var(--cell-size));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0 0 0.25rem;
  pointer-events: auto;
}

.floor-plan-occupancy-tray[hidden] {
  display: none;
}

.floor-plan-occupancy-token {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--plotline-accent);
  box-shadow: 0 4px 12px rgba(30, 37, 43, 0.18);
  font-size: 0.68rem;
  font-weight: 800;
}

.floor-plan-occupancy-token img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floor-plan-occupancy-token--asset {
  width: 1.45rem;
  height: 1.45rem;
  background: #805c15;
  font-size: 0.58rem;
}

.floor-plan-occupancy-more {
  border-radius: 999px;
  padding: 0.15rem 0.36rem;
  color: var(--plotline-ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(30, 37, 43, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
}

.floor-plan-occupancy-message {
  align-self: start;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(47, 111, 99, .18);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(30, 37, 43, .08);
  color: var(--muted-color, #6b756f);
  font-size: .82rem;
  font-weight: 700;
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  margin-top: .55rem;
  max-width: min(92%, 520px);
  padding: .45rem .7rem;
  position: relative;
  z-index: 16;
}

.floor-plan-occupancy-message[hidden] {
  display: none;
}

.floor-plan-transition-accordion .accordion-item {
  background: transparent;
  border-color: var(--border-color, #d8ded9);
}

.floor-plan-transition-accordion .accordion-button {
  background: rgba(47, 111, 99, .06);
  color: inherit;
  font-size: .88rem;
  font-weight: 800;
  padding: 10px 12px;
}

.floor-plan-transition-accordion .accordion-button:not(.collapsed) {
  background: rgba(47, 111, 99, .12);
  color: var(--plotline-accent-dark, #22534a);
  box-shadow: inset 0 -1px 0 var(--border-color, #d8ded9);
}

.floor-plan-transition-accordion .accordion-body {
  padding: 12px;
}

.floor-plan-checkbox {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  font-weight: 700;
  margin-bottom: 4px;
}

.floor-plan-choice-row {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.floor-plan-choice-row label {
  align-items: center;
  display: flex;
  gap: 6px;
  font-size: .88rem;
}

.floor-plan-overlap-warning {
  background: rgba(180, 85, 68, .12);
  border: 1px solid rgba(180, 85, 68, .35);
  border-radius: 6px;
  color: #8f3f31;
  margin-bottom: 10px;
  padding: 8px 10px;
}

[data-bs-theme="dark"] .floor-plan-grid,
.dark .floor-plan-grid {
  background:
    linear-gradient(to right, rgba(214, 224, 218, .12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(214, 224, 218, .12) 1px, transparent 1px),
    #15201d;
  background-size: var(--cell-size) var(--cell-size), var(--cell-size) var(--cell-size), auto;
}

[data-bs-theme="dark"] .floor-plan-editor-toolbar,
.dark .floor-plan-editor-toolbar,
[data-bs-theme="dark"] .floor-plan-toolbox,
.dark .floor-plan-toolbox,
[data-bs-theme="dark"] .floor-plan-tool-card,
.dark .floor-plan-tool-card {
  background: var(--panel-bg, #1f2522);
}

[data-bs-theme="dark"] .floor-plan-toolbox .floor-plan-tool-card,
.dark .floor-plan-toolbox .floor-plan-tool-card {
  background: transparent;
}

[data-bs-theme="dark"] .floor-plan-toolbox-tab.active,
.dark .floor-plan-toolbox-tab.active {
  background: rgba(212, 154, 98, .16);
  color: var(--plotline-accent-dark, #f0c99d);
}

[data-bs-theme="dark"] .floor-plan-block,
.dark .floor-plan-block {
  --floor-plan-wall-color: rgba(212, 154, 98, .6);
  color: #f1f6f3;
}

[data-bs-theme="dark"] .floor-plan-block.is-hidden-location,
.dark .floor-plan-block.is-hidden-location {
  background-image: repeating-linear-gradient(135deg, rgba(244, 234, 220, .09) 0, rgba(244, 234, 220, .09) 3px, transparent 3px, transparent 9px);
  box-shadow: inset 0 0 0 1px rgba(244, 234, 220, .2);
}

[data-bs-theme="dark"] .floor-plan-secret-route,
.dark .floor-plan-secret-route {
  border-top-color: rgba(244, 204, 160, .58);
  opacity: .76;
}

[data-bs-theme="dark"] .floor-plan-secret-route::after,
.dark .floor-plan-secret-route::after {
  background: rgba(42, 35, 30, .95);
  border-color: rgba(244, 204, 160, .55);
}

[data-bs-theme="dark"] .floor-plan-coordinate-label,
.dark .floor-plan-coordinate-label {
  color: rgba(244, 234, 220, .46);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .55);
}

[data-bs-theme="dark"] .floor-plan-reference-block,
.dark .floor-plan-reference-block {
  background: rgba(131, 199, 242, .08);
  border-color: rgba(131, 199, 242, .32);
  color: rgba(244, 234, 220, .46);
}

[data-bs-theme="dark"] .floor-plan-reference-warning,
.dark .floor-plan-reference-warning {
  background: rgba(84, 57, 25, .92);
  border-color: rgba(244, 177, 100, .32);
  color: #ffd9a5;
}

[data-bs-theme="dark"] .floor-plan-transition-marker,
.dark .floor-plan-transition-marker {
  --transition-marker-ink: #f4eadc;
  --transition-marker-window: #83c7f2;
  --transition-marker-blocked: #f08a78;
  background: rgba(42, 35, 30, .98);
  border-color: rgba(212, 154, 98, .6);
}

[data-bs-theme="dark"] .floor-plan-transition-marker.is-shared-edge,
.dark .floor-plan-transition-marker.is-shared-edge {
  background: rgba(48, 39, 32, .98);
  border-color: rgba(212, 154, 98, .78);
}

[data-bs-theme="dark"] .floor-plan-transition-marker--window,
.dark .floor-plan-transition-marker--window,
[data-bs-theme="dark"] .floor-plan-transition-marker--window.is-shared-edge,
.dark .floor-plan-transition-marker--window.is-shared-edge {
  background: rgba(24, 45, 58, .98);
  border-color: rgba(131, 199, 242, .66);
}

[data-bs-theme="dark"] .floor-plan-transition-marker--sliding-door,
.dark .floor-plan-transition-marker--sliding-door,
[data-bs-theme="dark"] .floor-plan-transition-marker--french-door,
.dark .floor-plan-transition-marker--french-door,
[data-bs-theme="dark"] .floor-plan-transition-marker--ladder,
.dark .floor-plan-transition-marker--ladder {
  background: rgba(39, 43, 37, .98);
  border-color: rgba(212, 154, 98, .58);
}

[data-bs-theme="dark"] .floor-plan-transition-marker--blocked-door,
.dark .floor-plan-transition-marker--blocked-door,
[data-bs-theme="dark"] .floor-plan-transition-marker--blocked-door.is-shared-edge,
.dark .floor-plan-transition-marker--blocked-door.is-shared-edge {
  background: rgba(58, 33, 28, .98);
  border-color: rgba(240, 138, 120, .66);
}

[data-bs-theme="dark"] .visual-avatar,
.dark .visual-avatar {
  background: linear-gradient(135deg, rgba(131, 199, 242, .14), rgba(212, 154, 98, .18));
  border-color: rgba(244, 234, 220, .18);
  color: #f4eadc;
}

[data-bs-theme="dark"] .visual-image-editor,
.dark .visual-image-editor {
  background: rgba(244, 234, 220, .04);
  border-color: rgba(244, 234, 220, .12);
}

[data-bs-theme="dark"] .floor-plan-transition-item,
.dark .floor-plan-transition-item {
  border-color: rgba(212, 154, 98, .22);
}

[data-bs-theme="dark"] .floor-plan-occupancy-token,
.dark .floor-plan-occupancy-token {
  border-color: #1f2630;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
}

[data-bs-theme="dark"] .floor-plan-occupancy-more,
.dark .floor-plan-occupancy-more {
  color: #f1e7dd;
  background: rgba(31, 38, 48, .92);
}

[data-bs-theme="dark"] .floor-plan-occupancy-message,
.dark .floor-plan-occupancy-message {
  background: rgba(31, 38, 48, .94);
  border-color: rgba(212, 154, 98, .24);
  color: #d9c8b8;
}

[data-bs-theme="dark"] .floor-plan-occupancy-warning-panel,
.dark .floor-plan-occupancy-warning-panel {
  background: rgba(244, 234, 220, .04);
  border-color: rgba(212, 154, 98, .2);
  color: #f1e7dd;
}

[data-bs-theme="dark"] .floor-plan-occupancy-warning-empty,
.dark .floor-plan-occupancy-warning-empty {
  background: rgba(47, 111, 99, .18);
  color: #b8e2d7;
}

[data-bs-theme="dark"] .floor-plan-occupancy-warning--warning,
.dark .floor-plan-occupancy-warning--warning {
  background: rgba(84, 57, 25, .92);
  color: #ffd9a5;
}

[data-bs-theme="dark"] .floor-plan-occupancy-warning--info,
.dark .floor-plan-occupancy-warning--info {
  background: rgba(24, 45, 58, .92);
  color: #b9dcf3;
}

[data-bs-theme="dark"] .floor-plan-transition-accordion .accordion-item,
.dark .floor-plan-transition-accordion .accordion-item {
  border-color: rgba(212, 154, 98, .22);
}

[data-bs-theme="dark"] .floor-plan-transition-accordion .accordion-button,
.dark .floor-plan-transition-accordion .accordion-button {
  background: rgba(212, 154, 98, .08);
  color: #f4eadc;
}

[data-bs-theme="dark"] .floor-plan-transition-accordion .accordion-button:not(.collapsed),
.dark .floor-plan-transition-accordion .accordion-button:not(.collapsed) {
  background: rgba(212, 154, 98, .16);
  color: var(--plotline-accent-dark, #f0c99d);
  box-shadow: inset 0 -1px 0 rgba(212, 154, 98, .22);
}

[data-bs-theme="dark"] .floor-plan-block--room,
.dark .floor-plan-block--room {
  background: #29584f;
}

[data-bs-theme="dark"] .floor-plan-block--corridor,
.dark .floor-plan-block--corridor {
  background: #514876;
}

[data-bs-theme="dark"] .floor-plan-block--openspace,
.dark .floor-plan-block--openspace {
  background: #4f6133;
}

[data-bs-theme="dark"] .floor-plan-block--exterior,
.dark .floor-plan-block--exterior {
  background: #315d6f;
}

[data-bs-theme="dark"] .floor-plan-block--other,
.dark .floor-plan-block--other {
  background: #5b564c;
}

@media (max-width: 1100px) {
  .floor-plan-layout,
  .floor-plan-editor-toolbar {
    grid-template-columns: 1fr;
  }

  .floor-plan-grid-wrap {
    max-height: 62vh;
  }

  .floor-plan-side-panel {
    position: static;
  }

  .floor-plan-toolbox {
    max-height: none;
  }
}
