/* Storytelling view — files pane + timeline pane, synced */

.story-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.story-files {
  border-right: 1px solid var(--border);
  background: var(--canvas-2);
  overflow-y: auto;
  font-family: var(--font-ui);
}
.story-files .pane-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.story-files ul { list-style: none; margin: 0; padding: 8px 0; }
.story-files li {
  padding: 8px 16px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background .12s var(--ease);
}
.story-files li:hover { background: var(--card); }
.story-files li.selected { background: var(--card); border-left-color: var(--teal); }
.story-files li .swatch {
  width: 10px; height: 10px; border-radius: 2px; align-self: center;
}
.story-files li .path {
  font-family: var(--font-mono);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-files li .self-us {
  font-family: var(--font-mono);
  color: var(--ink-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.story-timeline {
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  overflow: hidden;
}
.story-timeline .pane-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.story-timeline .axis {
  position: relative;
  height: 22px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-2);
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.story-timeline .axis .tick {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid var(--border);
  padding-left: 4px;
  line-height: 22px;
}

.story-timeline .lanes {
  flex: 1;
  position: relative;
  overflow-y: auto;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 17px,
      var(--canvas-2) 17px,
      var(--canvas-2) 18px
    );
}
.story-timeline .span-block {
  position: absolute;
  height: 14px;
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 14px;
  color: rgba(0,0,0,.78);
  padding: 0 4px;
  white-space: nowrap;
  transition: opacity .12s var(--ease);
}
.story-timeline .span-block.dimmed { opacity: 0.18; }
.story-timeline .span-block.highlighted {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  z-index: 5;
}

.story-meta {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--canvas-2);
  font-size: 12px;
  color: var(--ink-2);
  min-height: 36px;
}
.story-meta strong { color: var(--ink); font-family: var(--font-mono); }

@media (max-width: 800px) {
  .story-wrap { grid-template-columns: 1fr; height: auto; }
  .story-files { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--border); }
  .story-timeline { min-height: 420px; }
}
