/* 剧情脉络图 · 只读叙事总谱 */
body.story-graph-active {
  overflow: hidden;
  padding-bottom: 0 !important;
  background: #080b15;
}

body.story-graph-active #app.app-container {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body.story-graph-active #themeToggle,
body.story-graph-active #authStatus,
body.story-graph-active .mobile-bottom-nav {
  display: none !important;
}

.story-structure-view.active {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 74% -12%, rgba(124, 108, 255, .18), transparent 34%),
    linear-gradient(180deg, #0b0e1a 0%, #080b15 100%);
  color: #f3f5ff;
}

.story-structure-page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  height: 100dvh;
  padding: 14px 18px 16px;
  gap: 10px;
}

.story-structure-page-header {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 0 4px;
}

.story-structure-back {
  justify-self: start;
  color: #c8cee6;
  border-color: #2c3354;
  background: rgba(15, 19, 34, .72);
}

.story-structure-page-title {
  min-width: 0;
  text-align: center;
}

.story-structure-page-title h1 {
  margin: 2px 0 0;
  max-width: 720px;
  overflow: hidden;
  color: #f7f8ff;
  font-size: clamp(22px, 2.1vw, 32px);
  font-weight: 760;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-structure-page-title p {
  margin: 4px 0 0;
  color: #8f98b8;
  font-size: 12px;
}

.story-structure-eyebrow {
  color: #9d92ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.story-structure-coverage {
  justify-self: end;
  max-width: 260px;
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid rgba(61, 220, 151, .28);
  border-radius: 999px;
  color: #9aefc8;
  background: rgba(61, 220, 151, .08);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-structure-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #2c3354;
  border-radius: 10px;
  color: #c8cee6;
  background: rgba(18, 22, 39, .92);
  font-size: 13px;
}

.story-structure-message[data-kind="loading"]::before {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(124, 108, 255, .3);
  border-top-color: #8b7cff;
  border-radius: 50%;
  content: "";
  animation: ssg-spin .8s linear infinite;
}

.story-structure-message[data-kind="error"] {
  border-color: rgba(255, 92, 124, .34);
  color: #ffc0cd;
  background: rgba(255, 92, 124, .09);
}

@keyframes ssg-spin { to { transform: rotate(360deg); } }

.story-structure-root {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #252c49;
  border-radius: 16px;
  background: rgba(12, 15, 27, .96);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .32);
}

.story-structure-card-button {
  order: -1;
  flex: 1 0 100%;
  border-color: rgba(124, 108, 255, .55) !important;
  color: #dedaff !important;
  background: linear-gradient(90deg, rgba(124, 108, 255, .19), rgba(76, 196, 255, .08)) !important;
}

.story-structure-card-button:hover {
  border-color: #8b7cff !important;
  background: linear-gradient(90deg, rgba(124, 108, 255, .3), rgba(76, 196, 255, .14)) !important;
}

.ssg-mounted,
.ssg-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ssg-shell {
  display: flex;
  flex-direction: column;
}

.ssg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-height: 61px;
  padding: 9px 12px;
  border-bottom: 1px solid #252c49;
  background: linear-gradient(180deg, rgba(26, 31, 53, .96), rgba(18, 22, 39, .96));
}

.ssg-toolbar-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ssg-toolbar-filters { flex-wrap: wrap; }
.ssg-toolbar-controls { margin-left: auto; }

.ssg-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8f98b8;
  font-size: 11px;
}

.ssg-field-label {
  font-weight: 700;
  white-space: nowrap;
}

.ssg-select,
.ssg-button {
  min-height: 32px;
  border: 1px solid #303858;
  border-radius: 7px;
  color: #dfe3f7;
  background: #101424;
  font: inherit;
  font-size: 11px;
}

.ssg-select {
  max-width: 168px;
  padding: 0 28px 0 9px;
}

.ssg-select:disabled { opacity: .5; }
.ssg-range-select { width: 78px; }

.ssg-range-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-left: 3px;
}

.ssg-range-separator {
  color: #626c8e;
  font-size: 10px;
}

.ssg-button {
  padding: 0 10px;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.ssg-button:hover,
.ssg-button:focus-visible,
.ssg-select:focus-visible {
  outline: none;
  border-color: #7c6cff;
  color: #fff;
}

.ssg-toggle[aria-pressed="true"] {
  border-color: rgba(124, 108, 255, .72);
  color: #eeeaff;
  background: rgba(124, 108, 255, .2);
}

.ssg-toolbar-summary {
  flex: 1 1 100%;
  color: #707998;
  font-size: 10px;
  letter-spacing: .03em;
}

.ssg-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ssg-guided[hidden],
.ssg-timeline-pane[hidden] {
  display: none !important;
}

.ssg-timeline-pane {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.ssg-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(78, 92, 150, .1), transparent 35%),
    #0b0f1c;
}

.ssg-lane-labels {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 4;
  width: 170px;
  overflow: hidden;
  border-right: 1px solid #28304d;
  background: linear-gradient(90deg, rgba(14, 18, 32, .99) 84%, rgba(14, 18, 32, .86));
  box-shadow: 12px 0 22px rgba(4, 6, 13, .24);
}

.ssg-lane-label {
  position: absolute;
  left: 10px;
  display: flex;
  width: 146px;
  min-height: 45px;
  padding: 6px 8px 6px 11px;
  overflow: hidden;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 0;
  border-left: 3px solid var(--lane-color, #59617f);
  border-radius: 0 7px 7px 0;
  color: #f0f2ff;
  background: rgba(25, 30, 50, .72);
  text-align: left;
  font: inherit;
}

button.ssg-lane-label { cursor: pointer; }
button.ssg-lane-label:hover { background: rgba(37, 43, 72, .94); }

.ssg-lane-label strong {
  width: 100%;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssg-lane-label small {
  width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: #7f89aa;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ssg-lane-kicker {
  color: var(--lane-color, #7c6cff);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
}

.ssg-scroller {
  position: absolute;
  inset: 0 0 0 170px;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
  scrollbar-color: #3c456d #0c101d;
  scrollbar-width: thin;
}

.ssg-scroller.dragging {
  cursor: grabbing;
  user-select: none;
}

.ssg-canvas { min-height: 100%; }
.ssg-svg { display: block; font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif; }
.ssg-canvas-bg { fill: #0b0f1c; }
.ssg-episode-column { fill: rgba(26, 31, 53, .2); }
.ssg-episode-column.alt { fill: rgba(35, 42, 69, .22); }
.ssg-grid-line { stroke: rgba(96, 107, 145, .15); stroke-width: 1; }
.ssg-section-line { stroke: rgba(96, 107, 145, .22); stroke-width: 1; }
.ssg-phase-band { opacity: .68; }
.ssg-phase-label { fill: #fff; font-size: 10px; font-weight: 760; letter-spacing: .05em; }
.ssg-episode-label { fill: #e4e7f8; font-size: 11px; font-weight: 740; }
.ssg-progress-label { fill: #647091; font-size: 8px; }

.ssg-rhythm-bar { opacity: .9; }
.ssg-rhythm-bar.unknown { stroke: #454d6d; stroke-width: 1; stroke-dasharray: 2 2; }
.ssg-evidence-count { fill: #7782a3; font-size: 8px; }

.ssg-event-spine {
  stroke: rgba(139, 124, 255, .62);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ssg-event-station { cursor: pointer; stroke-width: 3; }
.ssg-event-station.planned { fill: #0d1120; stroke: #8b7cff; }
.ssg-event-station.observed { fill: #4cc4ff; stroke: #aeeaff; }
.ssg-event-text { fill: #aeb6d4; font-size: 8px; pointer-events: none; }

.ssg-relationship-station {
  cursor: pointer;
  fill: #10152a;
  stroke-width: 3;
}

.ssg-relationship-hit { fill: rgba(255, 255, 255, .001); cursor: pointer; pointer-events: all; }
.ssg-relationship-station.planned { stroke: #ff6f91; }
.ssg-relationship-station.observed { stroke: #54dcaa; }
.ssg-relationship-station.unknown { stroke: #69728f; stroke-dasharray: 3 3; }
.ssg-relationship-text { fill: #b8bfd9; font-size: 8px; cursor: pointer; }

.ssg-character-route {
  stroke-width: 4;
  stroke-linecap: round;
  opacity: .82;
}

.ssg-character-route.unknown {
  stroke-width: 2;
  stroke-dasharray: 7 8;
  opacity: .34;
}

.ssg-character-station {
  cursor: pointer;
  stroke: #0b0f1c;
  stroke-width: 3;
}

.ssg-character-station.relationship { stroke-width: 3; }

.ssg-unknown-note { fill: #515b7b; font-size: 8px; }
.ssg-prop-route { stroke: #ffb547; stroke-width: 2; stroke-dasharray: 7 6; opacity: .8; }
.ssg-prop-station { fill: #ffb547; stroke: #ffe1a9; stroke-width: 2; cursor: pointer; }
.ssg-prop-unknown-label { fill: #69728f; font-size: 9px; }

.ssg-record:focus-visible,
.ssg-character-station:focus-visible,
.ssg-prop-station:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(139, 124, 255, .9));
}

.ssg-result-card { cursor: pointer; }
.ssg-result-card-bg { fill: rgba(24, 29, 49, .94); stroke: #303858; stroke-width: 1; }
.ssg-result-card:hover .ssg-result-card-bg,
.ssg-result-card:focus-visible .ssg-result-card-bg { stroke: #7c6cff; fill: rgba(37, 43, 72, .98); }
.ssg-result-kicker { fill: #54dcaa; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.ssg-result-text { fill: #d4d9ee; font-size: 8px; }
.ssg-pressure-text { fill: #ffbfce; font-size: 7px; }

.ssg-minimap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border-top: 1px solid #252c49;
  background: #0d1120;
}

.ssg-minimap-label {
  flex: 0 0 auto;
  color: #7d86a6;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.ssg-minimap-track {
  position: relative;
  display: flex;
  flex: 1;
  height: 18px;
  overflow: hidden;
  border: 1px solid #303858;
  border-radius: 5px;
  background: #080b14;
}

.ssg-minimap-segment {
  min-width: 2px;
  flex: 1;
  border: 0;
  border-right: 1px solid rgba(8, 11, 20, .5);
  cursor: pointer;
}

.ssg-minimap-segment.outside-range { filter: saturate(.25); opacity: .18 !important; }
.ssg-minimap-segment:hover { filter: brightness(1.45); }

.ssg-minimap-window {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 4%;
  border: 1px solid #f0edff;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 1px rgba(124, 108, 255, .65) inset;
  pointer-events: none;
}

.ssg-evidence-drawer {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-left: 0 solid #2a3150;
  color: #cfd4e9;
  background: #121627;
  opacity: 0;
  transition: width .2s ease, opacity .2s ease, border-width .2s ease;
}

.ssg-evidence-drawer.open {
  width: min(350px, 31vw);
  min-width: min(350px, 31vw);
  border-left-width: 1px;
  opacity: 1;
}

.ssg-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 310px;
  padding: 16px;
  border-bottom: 1px solid #2a3150;
}

.ssg-drawer-kicker {
  color: #958aff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.ssg-drawer-header h2 {
  margin: 4px 0 0;
  color: #f5f6ff;
  font-size: 16px;
  line-height: 1.35;
}

.ssg-drawer-close {
  min-width: 50px;
  padding: 6px 9px;
  border: 1px solid #343c5e;
  border-radius: 6px;
  color: #aab2ce;
  background: #171c30;
  cursor: pointer;
}

.ssg-drawer-body {
  min-width: 310px;
  max-height: calc(100dvh - 168px);
  padding: 14px 16px 24px;
  overflow-y: auto;
}

.ssg-evidence-meta {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 7px 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid #2b3352;
  border-radius: 9px;
  background: #0f1322;
  font-size: 10px;
}

.ssg-evidence-meta dt { color: #7882a2; }
.ssg-evidence-meta dd { margin: 0; color: #dce0f2; }

.ssg-evidence-section {
  margin-top: 15px;
}

.ssg-evidence-section h3 {
  margin: 0 0 8px;
  color: #aeb6d4;
  font-size: 11px;
}

.ssg-evidence-section p {
  margin: 6px 0;
  padding: 8px 9px;
  border-left: 2px solid #4cc4ff;
  border-radius: 0 6px 6px 0;
  color: #d4d9ec;
  background: #0e1220;
  font-size: 10px;
  line-height: 1.55;
}

.ssg-evidence-section .ssg-evidence-unknown {
  border-left-color: #59617f;
  color: #8089a9;
}

.ssg-source-card {
  display: flex;
  margin-bottom: 7px;
  padding: 8px 9px;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #2b3352;
  border-radius: 7px;
  background: #0e1220;
}

.ssg-source-card strong { color: #cbd1e8; font-size: 10px; }
.ssg-source-card span { color: #7f89aa; font-size: 9px; }
.ssg-source-card code { color: #6fcff4; font-size: 8px; }

.ssg-drawer-note {
  margin: 16px 0 0;
  color: #697392;
  font-size: 9px;
  line-height: 1.55;
}

.ssg-empty {
  display: grid;
  min-height: 360px;
  place-content: center;
  padding: 30px;
  color: #aeb6d4;
  text-align: center;
}

.ssg-empty strong { color: #f2f4ff; font-size: 18px; }
.ssg-empty p { max-width: 460px; color: #7983a3; font-size: 12px; }

/* 引导式剧情诊断：默认先给结论，再按集查看证据。 */
.ssg-view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #303858;
  border-radius: 9px;
  background: rgba(9, 13, 25, .72);
}

.ssg-view-tab {
  min-height: 28px;
  border: 0;
  background: transparent;
}

.ssg-view-tab[aria-selected="true"] {
  color: #fff;
  background: rgba(124, 108, 255, .3);
  box-shadow: inset 0 0 0 1px rgba(143, 130, 255, .46);
}

.ssg-guided {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  background:
    radial-gradient(circle at 58% -10%, rgba(93, 79, 204, .12), transparent 34%),
    #0b0f1c;
  scrollbar-color: #3c456d #0c101d;
  scrollbar-width: thin;
}

.ssg-reading-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 72px;
  margin-bottom: 10px;
  padding: 9px 18px;
  border: 1px solid #2a3252;
  border-radius: 12px;
  background: rgba(24, 29, 49, .82);
}

.ssg-guide-step {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.ssg-guide-number {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(139, 124, 255, .6);
  border-radius: 50%;
  color: #efeaff;
  background: rgba(124, 108, 255, .26);
  font-size: 16px;
  font-weight: 800;
}

.ssg-guide-step:nth-of-type(3) .ssg-guide-number {
  border-color: rgba(64, 199, 255, .52);
  color: #d8f5ff;
  background: rgba(64, 199, 255, .18);
}

.ssg-guide-step:nth-of-type(5) .ssg-guide-number {
  border-color: rgba(255, 111, 145, .54);
  color: #ffe1e8;
  background: rgba(255, 111, 145, .18);
}

.ssg-guide-step strong,
.ssg-guide-step small { display: block; }
.ssg-guide-step strong { color: #f0f2ff; font-size: 14px; }
.ssg-guide-step small { margin-top: 3px; color: #8993b4; font-size: 12px; }
.ssg-guide-arrow { color: #6e78a5; font-size: 23px; }

.ssg-guided-body {
  display: grid;
  grid-template-columns: 246px minmax(620px, 1fr) 292px;
  gap: 10px;
  align-items: start;
}

.ssg-insight-panel,
.ssg-episode-inspector,
.ssg-guided-section,
.ssg-conclusion-row {
  border: 1px solid #293150;
  border-radius: 12px;
  background: rgba(20, 25, 43, .88);
}

.ssg-insight-panel,
.ssg-episode-inspector {
  position: sticky;
  top: 0;
  max-height: calc(100dvh - 204px);
  overflow: auto;
  scrollbar-color: #3c456d transparent;
  scrollbar-width: thin;
}

.ssg-insight-panel { padding: 12px 10px; }
.ssg-insight-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 10px;
  border-bottom: 1px solid #293150;
}

.ssg-insight-header h2,
.ssg-inspector-header h2,
.ssg-section-heading h2,
.ssg-guided-section h3,
.ssg-conclusion-row h3 {
  margin: 0;
  color: #f2f4ff;
  font-size: 15px;
}

.ssg-insight-header p,
.ssg-section-heading p {
  margin: 4px 0 0;
  color: #7f89aa;
  font-size: 11px;
  line-height: 1.45;
}

.ssg-insight-filter {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #384162;
  border-radius: 7px;
  color: #cbd1e8;
  background: #11162a;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.ssg-insight-filter[aria-pressed="true"] {
  border-color: rgba(255, 111, 145, .62);
  color: #ffd4de;
  background: rgba(255, 111, 145, .13);
}

.ssg-insight-card {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 11px 10px 13px;
  border: 1px solid #303858;
  border-left: 3px solid #66708f;
  border-radius: 9px;
  color: #cfd4e9;
  background: rgba(25, 30, 51, .72);
  text-align: left;
  cursor: pointer;
}

.ssg-insight-card.attention { border-left-color: #ff6f91; }
.ssg-insight-card.notice { border-left-color: #ffb547; }
.ssg-insight-card.positive { border-left-color: #54dcaa; }
.ssg-insight-card.unknown { border-left-color: #75809f; }
.ssg-insight-card:hover,
.ssg-insight-card:focus-visible,
.ssg-insight-card.active {
  outline: none;
  border-color: #7c6cff;
  background: rgba(51, 47, 91, .76);
}

.ssg-insight-card strong {
  display: block;
  color: #edf0ff;
  font-size: 13px;
  line-height: 1.45;
}

.ssg-insight-card p {
  margin: 5px 0 7px;
  color: #939cbb;
  font-size: 12px;
  line-height: 1.5;
}

.ssg-insight-tags { display: flex; gap: 5px; }
.ssg-insight-tags em {
  padding: 2px 6px;
  border: 1px solid #3a4366;
  border-radius: 5px;
  color: #9ea8c8;
  font-size: 10px;
  font-style: normal;
}

.ssg-insight-summary {
  display: flex;
  margin-top: 10px;
  padding: 10px 4px 2px;
  flex-wrap: wrap;
  gap: 7px 10px;
  border-top: 1px solid #293150;
  color: #8d97b7;
  font-size: 10px;
}
.ssg-insight-summary strong { width: 100%; color: #dce0f2; font-size: 11px; }

.ssg-guided-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.ssg-guided-section { padding: 12px; }
.ssg-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ssg-strength-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9ca6c5;
  font-size: 10px;
}
.ssg-strength-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ssg-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69728f;
}
.ssg-legend-dot.high { background: #54dcaa; }
.ssg-legend-dot.medium { background: #5aa5ff; }
.ssg-legend-dot.low { background: #ffb547; }

.ssg-guided-chart {
  display: block;
  width: 100%;
  min-width: 620px;
  margin-top: 8px;
  overflow: visible;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
}
.ssg-chart-band { fill: rgba(23, 29, 50, .68); stroke: rgba(64, 74, 111, .55); stroke-width: 1; }
.ssg-chart-band.escalation { fill: rgba(24, 37, 62, .68); }
.ssg-chart-band.twist { fill: rgba(53, 28, 50, .35); }
.ssg-chart-band.payoff { fill: rgba(24, 53, 46, .3); }
.ssg-chart-band-label { fill: #edf0ff; font-size: 16px; font-weight: 760; }
.ssg-chart-band-note { fill: #7782a3; font-size: 10px; }
.ssg-guided-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ssg-guided-line.setup { stroke: #9b7cff; }
.ssg-guided-line.escalation { stroke: #54a6ff; }
.ssg-guided-line.twist { stroke: #ff6f91; }
.ssg-guided-line.payoff { stroke: #54dcaa; }
.ssg-guided-point { stroke: #0d1120; stroke-width: 2; }
.ssg-guided-point.setup { fill: #a087ff; }
.ssg-guided-point.escalation { fill: #62adff; }
.ssg-guided-point.twist { fill: #ff7898; }
.ssg-guided-point.payoff { fill: #61dfb1; }
.ssg-guided-point.unknown { fill: #69728f; stroke-dasharray: 2 2; }
.ssg-chart-hit { fill: rgba(255, 255, 255, .001); cursor: pointer; }
.ssg-chart-point:focus-visible .ssg-guided-point { outline: none; stroke: #fff; stroke-width: 3; }
.ssg-chart-episode { fill: #8f98b8; font-size: 10px; }
.ssg-selected-episode-line { stroke: rgba(255, 255, 255, .65); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.ssg-chart-range { fill: rgba(124, 108, 255, .09); stroke: rgba(124, 108, 255, .48); stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.ssg-chart-range.attention { fill: rgba(255, 111, 145, .08); stroke: rgba(255, 111, 145, .58); }
.ssg-chart-range.notice { fill: rgba(255, 181, 71, .07); stroke: rgba(255, 181, 71, .48); }

.ssg-conclusion-row {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(0, 1fr));
  align-items: stretch;
  overflow: hidden;
}
.ssg-conclusion-row h3 { align-self: center; padding: 0 14px; white-space: nowrap; }
.ssg-conclusion-card {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid #293150;
}
.ssg-conclusion-card span,
.ssg-conclusion-card strong,
.ssg-conclusion-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssg-conclusion-card span { color: #7f89aa; font-size: 10px; }
.ssg-conclusion-card strong { margin-top: 4px; color: #e9ecfb; font-size: 13px; }
.ssg-conclusion-card small { margin-top: 3px; color: #8b7cff; font-size: 10px; }

.ssg-guided-secondary {
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(340px, 1.3fr);
  gap: 10px;
}
.ssg-guided-section h3 { margin-bottom: 10px; }
.ssg-progress-row,
.ssg-character-row {
  display: grid;
  width: 100%;
  align-items: center;
  border: 0;
  color: #cfd4e9;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.ssg-progress-row {
  grid-template-columns: minmax(88px, 1fr) minmax(80px, 1.5fr) auto;
  gap: 9px;
  min-height: 35px;
}
.ssg-progress-row:hover,
.ssg-character-row:hover { background: rgba(124, 108, 255, .07); }
.ssg-progress-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ssg-progress-row > span:last-child { color: #8f98b8; font-size: 10px; }
.ssg-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #28304d; }
.ssg-progress-fill { display: block; height: 100%; border-radius: inherit; background: #8b7cff; }

.ssg-character-row {
  grid-template-columns: 122px minmax(100px, 1fr) auto;
  gap: 10px;
  min-height: 42px;
  padding: 3px 5px;
}
.ssg-character-identity { display: flex; min-width: 0; align-items: center; gap: 7px; }
.ssg-character-identity > i {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid var(--character-color);
  border-radius: 50%;
  color: #f1f3ff;
  background: color-mix(in srgb, var(--character-color) 18%, #11162a);
  font-size: 11px;
  font-style: normal;
}
.ssg-character-identity strong,
.ssg-character-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssg-character-identity strong { color: #e8ebfa; font-size: 11px; }
.ssg-character-identity small { margin-top: 2px; color: #7f89aa; font-size: 9px; }
.ssg-character-evidence-route { display: flex; align-items: center; gap: 2px; }
.ssg-character-evidence-route i { width: 100%; height: 3px; border-radius: 3px; background: #29314d; }
.ssg-character-evidence-route i.has-evidence { background: var(--character-color); }
.ssg-character-count { color: #8d97b7; font-size: 9px; white-space: nowrap; }

.ssg-hook-section .ssg-section-heading { align-items: center; }
.ssg-hook-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(20px, 1fr)); gap: 4px; }
.ssg-hook-item {
  min-width: 20px;
  height: 29px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #7983a3;
  background: #242b45;
  font-size: 9px;
  cursor: pointer;
}
.ssg-hook-item.low { border-top-color: #ffb547; }
.ssg-hook-item.medium { border-top-color: #5aa5ff; }
.ssg-hook-item.high { border-top-color: #54dcaa; color: #c9f8e4; background: rgba(46, 116, 92, .28); }
.ssg-hook-item.unknown { border-top-color: #69728f; }
.ssg-hook-item:hover,
.ssg-hook-item:focus-visible,
.ssg-hook-item.active { outline: none; border-color: #8b7cff; color: #fff; background: rgba(124, 108, 255, .28); }

.ssg-episode-inspector { padding: 12px; }
.ssg-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #293150;
}
.ssg-inspector-header span { color: #9f94ff; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.ssg-inspector-header h2 { margin-top: 3px; font-size: 18px; }
.ssg-inspector-nav { display: flex; gap: 5px; }
.ssg-icon-button {
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid #343d60;
  border-radius: 6px;
  color: #b9c0d9;
  background: #11162a;
  font-size: 10px;
  cursor: pointer;
}
.ssg-icon-button:disabled { opacity: .35; cursor: default; }

.ssg-inspector-card {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 10px 10px 12px;
  border: 1px solid #303858;
  border-left: 3px solid #8b7cff;
  border-radius: 8px;
  color: #d7dbee;
  background: rgba(25, 30, 51, .72);
  text-align: left;
}
button.ssg-inspector-card { cursor: pointer; }
.ssg-inspector-card.actionable:hover,
.ssg-inspector-card.actionable:focus-visible { outline: none; border-color: #8b7cff; background: rgba(51, 47, 91, .72); }
.ssg-inspector-card.empty { border-left-color: #4a536f; opacity: .72; }
.ssg-inspector-card > span { color: #9f94ff; font-size: 10px; font-weight: 800; }
.ssg-inspector-card p { margin: 6px 0 0; color: #dce0f2; font-size: 12px; line-height: 1.5; }
.ssg-inspector-card small { display: block; margin-top: 6px; color: #7f89aa; font-size: 9px; }

.ssg-inspector-evidence { margin-top: 10px; padding-top: 10px; border-top: 1px solid #293150; }
.ssg-inspector-evidence h3 { margin: 0 0 8px; color: #edf0ff; font-size: 12px; }
.ssg-status-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 6px; min-height: 27px; color: #aeb6d4; font-size: 10px; }
.ssg-status-row i { width: 8px; height: 8px; border-radius: 50%; background: #69728f; }
.ssg-status-row.observed i { background: #54dcaa; }
.ssg-status-row.planned i { background: #5aa5ff; }
.ssg-status-row strong { color: #cbd1e8; font-weight: 600; }
.ssg-open-evidence {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  border: 1px solid #7769e8;
  border-radius: 8px;
  color: #fff;
  background: rgba(124, 108, 255, .38);
  font-size: 12px;
  cursor: pointer;
}
.ssg-open-evidence:disabled { opacity: .4; cursor: default; }
.ssg-guided-empty { margin: 12px 2px; color: #75809f; font-size: 11px; line-height: 1.5; }

[data-ssg-view="guided"] .ssg-toolbar-summary { display: none; }
[data-ssg-view="guided"] .ssg-toolbar { min-height: 52px; }

@media (max-width: 900px) {
  .story-structure-page-shell { padding: 8px; }
  .story-structure-page-header {
    grid-template-columns: auto 1fr;
    min-height: 76px;
    gap: 10px;
  }
  .story-structure-page-title { text-align: left; }
  .story-structure-page-title h1 { font-size: 19px; }
  .story-structure-page-title p { display: none; }
  .story-structure-coverage { grid-column: 1 / -1; justify-self: stretch; max-width: none; text-align: center; }
  .ssg-toolbar { max-height: 148px; overflow-y: auto; }
  .ssg-toolbar-controls { margin-left: 0; flex-wrap: wrap; }
  .ssg-toolbar-summary { display: none; }
  .ssg-evidence-drawer.open {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 20;
    width: min(88vw, 360px);
    min-width: min(88vw, 360px);
    box-shadow: -20px 0 48px rgba(0, 0, 0, .48);
  }
  .ssg-lane-labels { width: 128px; }
  .ssg-scroller { left: 128px; }
  .ssg-lane-label { left: 6px; width: 112px; padding-left: 7px; }
  .ssg-lane-label small { display: none; }
  .ssg-reading-guide { grid-template-columns: 1fr; gap: 8px; }
  .ssg-guide-arrow { display: none; }
  .ssg-guided-body { grid-template-columns: 210px minmax(560px, 1fr); }
  .ssg-episode-inspector { position: static; grid-column: 1 / -1; max-height: none; }
  .ssg-conclusion-row { grid-template-columns: repeat(3, 1fr); }
  .ssg-conclusion-row h3 { grid-column: 1 / -1; padding: 10px 12px; border-bottom: 1px solid #293150; }
  .ssg-conclusion-card { border-bottom: 1px solid #293150; }
}

@media (max-width: 520px) {
  .story-structure-page-shell { height: 100dvh; min-height: 100dvh; padding: 6px; gap: 6px; }
  .story-structure-page-header { min-height: 64px; }
  .story-structure-back { padding: 7px 9px; font-size: 11px; }
  .story-structure-page-title h1 { max-width: 220px; font-size: 16px; }
  .story-structure-eyebrow { font-size: 8px; }
  .story-structure-coverage { display: none; }
  .story-structure-root { border-radius: 11px; }
  .ssg-toolbar { gap: 7px; min-height: 112px; padding: 7px; }
  .ssg-toolbar-filters { width: 100%; }
  .ssg-field { flex: 1 1 44%; }
  .ssg-field .ssg-select { width: 100%; max-width: none; }
  .ssg-range-control { width: 100%; padding-left: 0; }
  .ssg-range-control .ssg-field { flex: 1; }
  .ssg-range-control > .ssg-select { flex: 1; width: auto; }
  .ssg-toolbar-controls { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .ssg-button { flex: 0 0 auto; }
  .ssg-lane-labels { width: 106px; }
  .ssg-scroller { left: 106px; }
  .ssg-lane-label { left: 4px; width: 94px; min-height: 39px; }
  .ssg-lane-kicker { font-size: 7px; }
  .ssg-lane-label strong { font-size: 9px; }
  .ssg-minimap { padding: 7px; gap: 6px; }
  .ssg-minimap-label { display: none; }
  .ssg-drawer-body { max-height: calc(100dvh - 128px); }
  [data-ssg-view="guided"] .ssg-toolbar { max-height: 210px; }
  .ssg-view-switch { width: 100%; }
  .ssg-view-tab { flex: 1; }
  .ssg-guided { padding: 6px; }
  .ssg-reading-guide { padding: 10px; }
  .ssg-guide-step small { font-size: 11px; }
  .ssg-guided-body { display: flex; flex-direction: column; }
  .ssg-insight-panel { position: static; width: 100%; max-height: 310px; }
  .ssg-guided-main { width: 100%; }
  .ssg-pulse-section { overflow-x: auto; }
  .ssg-guided-chart { width: 720px; min-width: 720px; }
  .ssg-conclusion-row { grid-template-columns: repeat(2, 1fr); }
  .ssg-guided-secondary { grid-template-columns: 1fr; }
  .ssg-hook-strip { grid-template-columns: repeat(10, 1fr); }
  .ssg-episode-inspector { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .story-structure-message[data-kind="loading"]::before { animation: none; }
  .ssg-evidence-drawer { transition: none; }
  .ssg-button { transition: none; }
}
