/* PAYBACK · the Year 1 rules legend and the board ring legend.
 *
 * Loaded last so it wins ties against the legacy .opening-brief rules in
 * wave1-native.css. No inline styles anywhere: the _headers rule for
 * /aifutures/ai-economy-model/* sets style-src 'self'.
 */

.rules-legend {
  display: grid;
  gap: 8px;
  max-height: none;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
  background: var(--field);
}

.rules-legend__head {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.rules-legend__strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-legend__cell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--board);
  color: var(--ink);
}

.rules-legend__glyph {
  width: 56px;
  height: 32px;
  color: var(--muted);
}

.rules-legend__rule {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

/* Glyph inks. Classes, not attributes: see the CSP note above. */
.gl-accent {
  fill: var(--volt);
  stroke: none;
}
.gl-chip {
  fill: #2b3646;
}
.gl-gold {
  stroke: var(--gold, #c9ad46);
}
.gl-gold-fill {
  fill: rgb(201 173 70 / 36%);
}
.gl-gold-cap {
  fill: rgb(201 173 70 / 60%);
}
.gl-kiln {
  stroke: #e0a458;
}
.gl-para {
  stroke: #7fa7c9;
}
.gl-kiln-fill,
.gl-para-fill {
  fill: var(--board);
}

@media (min-width: 720px) {
  .rules-legend {
    padding: 10px 20px 12px;
  }

  .rules-legend__strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .rules-legend__cell {
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 56px;
    padding: 8px 12px;
  }

  .rules-legend__glyph {
    width: 68px;
    height: 40px;
  }
}

/* The tour owns the opening board while it runs. */
[data-tour-active] .rules-legend {
  display: none;
}

/* Board ring legend — one row under the board header, Year 1 board only.
   The price rail's PRICE title is absolutely positioned above the plot and
   floats into this row's left edge (the same column the ticks live under).
   Match .board-legend's left inset so this row's text starts clear of that
   column instead of running underneath it — the fix mirrors the row above
   it rather than re-tuning the title's own offset. */
.board-legend-rings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-height: 22px;
  padding-left: calc(var(--plot-rail) + 4px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.board-legend-rings span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.board-legend__ring {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

/* Annual planning — the kicker names the sequence, YEAR N names the year. */
.dock-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.advisor-explain {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.advisor-basis > summary {
  text-transform: uppercase;
}
