.tp {
  max-width: 64rem;
}

.tp-intro,
.tp-facts > p,
.tp-results > h2,
.tp-facts > h2 {
  max-width: 38rem;
}

/* ── The picker ────────────────────────────────────────────────────────── */
.tp-columns {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 13rem) minmax(0, 13rem);
  justify-content: space-between;
  gap: 2rem;
  margin: 2rem 0 0.5rem;
}

.tp-ribbons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.tp-stage {
  position: relative;
  z-index: 1;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.tp-stage legend {
  padding: 0;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.tp-when {
  display: block;
  font-family: var(--sc);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.tp-skill {
  display: block;
  font-style: italic;
  color: var(--ink-2);
  font-size: 0.85rem;
}

.tp-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tp-node-row {
  position: relative;
}

.tp-node-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.tp-node {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  grid-template-areas:
    "tile name count"
    "tile bar bar";
  align-items: center;
  column-gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.2rem 0.45rem 0.25rem 0.3rem;
  border-left: 3px solid transparent;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.15;
}

.tp-node:hover {
  background: var(--paper-2);
}

.tp-node-row input:focus-visible + .tp-node {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tp-node-row input:checked + .tp-node {
  border-left-color: var(--arcane);
  background: var(--paper-2);
}

.tp-node-row input:checked + .tp-node .tp-node-name {
  font-weight: 700;
}

.tp-node .tp-tile {
  grid-area: tile;
  width: 2rem;
  height: 2rem;
  image-rendering: pixelated;
}

.tp-blank {
  display: block;
}

.tp-node-name {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-node-skill {
  grid-area: name;
  justify-self: end;
  color: var(--ink-3);
  font-size: 0.8rem;
  margin-right: 0.2rem;
}

.tp-node-count {
  grid-area: count;
  color: var(--ink-2);
  font-size: 0.85rem;
}

.tp-bar {
  grid-area: bar;
  display: block;
  height: 3px;
  background: var(--rule-2);
}

.tp-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--arcane);
  transition: width 240ms ease-out;
}

.tp-any .tp-bar,
.tp-any .tp-blank {
  visibility: hidden;
}

.tp-any .tp-node-name,
.tp-none .tp-node-name {
  font-style: italic;
  color: var(--ink-2);
}

.tp-none .tp-tile {
  border: 1px dashed var(--rule);
}

.tp-empty .tp-node-name,
.tp-empty .tp-node-count,
.tp-empty .tp-tile {
  opacity: 0.4;
}

.tp-ribbon {
  transition: opacity 240ms ease-out;
}

.tp-dead {
  fill: var(--rule);
  opacity: 0.25;
}

.tp-idle {
  fill: var(--ink-3);
}

.tp-live {
  fill: var(--arcane);
}

.tp-path {
  fill: var(--arcane);
  opacity: 0.85;
}

.tp-sentence {
  font-size: 1.15rem;
  font-style: italic;
  margin: 1.25rem 0 0.75rem;
  max-width: 38rem;
}

.tp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-size: 0.95rem;
}

.tp-controls select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
}

/* ── Seeds ─────────────────────────────────────────────────────────────── */
.tp-status {
  color: var(--ink-2);
}

.tp-seeds {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tp-seed {
  padding: 0.75rem 0 0.9rem;
  border-top: 1px solid var(--rule-2);
}

.tp-seed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
  margin-bottom: 0.4rem;
}

.tp-seed-head .seed {
  font-size: 1.05rem;
}

.tp-complete {
  color: var(--ink-2);
  font-size: 0.9rem;
}

.tp-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  font-size: 0.9rem;
}

.tp-boon {
  color: var(--verdant);
  font-weight: 700;
}

.tp-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border-left: 1px solid var(--rule-2);
}

.tp-floor {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.2rem;
  min-height: 3.6rem;
  padding: 0 0.3rem;
  border-right: 1px solid var(--rule-2);
}

.tp-floor-name {
  flex-basis: 100%;
  font-size: 0.72rem;
  color: var(--ink-3);
}

.tp-find {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.5;
}

.tp-find-on {
  opacity: 1;
}

.tp-find .tp-tile {
  width: 2rem;
  height: 2rem;
  image-rendering: pixelated;
  border-bottom: 2px solid transparent;
}

.tp-find-on .tp-tile {
  border-bottom-color: var(--arcane);
}

.tp-find-art .tp-tile {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}

.tp-price,
.tp-portal {
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--ink-2);
}

.tp-arts {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: 0.85rem;
}

/* ── Facts ─────────────────────────────────────────────────────────────── */
.tp-facts {
  margin-top: 3rem;
}

.tp-tiers {
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.tp-tiers td.num:first-child {
  text-align: left;
}

.tp-chart {
  margin: 1.5rem 0;
}

.tp-chart figcaption {
  max-width: 38rem;
  color: var(--ink-2);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.tp-panels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem 1rem;
}

.tp-panel-name {
  margin: 0;
  font-size: 0.85rem;
}

.tp-panel {
  width: 100%;
  height: auto;
  overflow: visible;
}

.tp-axis {
  stroke: var(--rule);
  stroke-width: 1;
}

.tp-tick {
  fill: var(--ink-2);
  font-family: var(--sans);
  font-size: 10px;
}

.tp-line-obs {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
}

.tp-line-table {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.tp-hit {
  fill: transparent;
}

.tp-hit:hover {
  fill: var(--ink);
  fill-opacity: 0.15;
}

.tp-legend {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.tp-key {
  display: inline-block;
  width: 1.5rem;
  vertical-align: middle;
  border-top: 2px solid var(--ink);
}

.tp-key-table {
  border-top: 2px dashed var(--ink-3);
  margin-left: 1rem;
}

.tp-provenance {
  font-size: 0.85rem;
  color: var(--ink-2);
}

/* ── Narrow screens ────────────────────────────────────────────────────── */
@media (max-width: 44rem) {
  .tp-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .tp-node {
    grid-template-columns: 1fr;
    grid-template-areas: "tile" "name" "count" "bar";
    justify-items: center;
    text-align: center;
    padding: 0.3rem 0.15rem;
    font-size: 0.82rem;
  }

  .tp-node-name {
    max-width: 100%;
  }

  .tp-node-skill {
    display: none;
  }

  .tp-bar {
    width: 100%;
  }

  .tp-when {
    font-size: 1rem;
  }

  .tp-stage legend {
    min-height: 4.4rem;
  }

  .tp-ladder {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 0.4rem;
  }

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