/* EP02 companion page: three-rulebook table and scenario explorer.
   Uses the tokens from main.css only. No external requests. */
.rb-table-wrap { overflow-x: auto; max-width: 100%; margin: 1.25rem 0 .75rem; border-radius: var(--radius-sm); }
.rb-table-wrap:focus-visible { outline: 3px solid var(--evergreen); outline-offset: 2px; }
.rb-table { width: 100%; min-width: 42rem; border-collapse: collapse; background: var(--paper-raised); font-size: .92rem; line-height: 1.45; }
.rb-table caption { text-align: left; caption-side: top; padding: 0 0 .6rem; color: var(--ink-soft); font-size: .92rem; }
.rb-table caption .kicker { display: block; margin-bottom: .2rem; }
.rb-table th, .rb-table td { border: 1px solid var(--paper-line); padding: .7rem .75rem; vertical-align: top; text-align: left; }
.rb-table thead th { font: 600 .74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); background: var(--paper-deep); }
.rb-table thead th:nth-child(4) { color: var(--evergreen-deep); }
.rb-table tbody th { width: 24%; font-weight: 400; background: var(--paper); }
.rb-table tbody tr:target th, .rb-table tbody tr:target td { background: var(--evergreen-tint); }
.rb-num { display: block; font: 600 .72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--brass-text); }
.rb-sname { display: block; font: 600 1rem/1.3 var(--serif); color: var(--ink); margin: .15rem 0 .35rem; }
.rb-fam { display: block; color: var(--ink-soft); font-size: .86rem; }
.rb-result { display: block; color: var(--ink); margin-bottom: .3rem; }
.rb-rule { display: block; color: var(--ink-soft); }
.rb-law { display: block; margin-top: .35rem; font-size: .74rem; }
.rb-note { background: var(--clay-tint); border-left: 4px solid var(--clay); border-radius: var(--radius-sm); padding: .8rem 1rem; max-width: 48rem; }
.rb-note strong { font-weight: 600; }

/* Explorer (only shown when JavaScript runs; the table above is the no-JS version) */
.rb-explorer { background: var(--paper-raised); border: 1px solid var(--paper-line); border-left: 4px solid var(--evergreen); border-radius: var(--radius-sm); padding: 1rem 1.2rem .6rem; margin: 1.25rem 0; }
.rb-picker { border: 0; margin: 0; padding: 0; min-width: 0; }
.rb-picker legend { padding: 0; margin-bottom: .55rem; color: var(--evergreen); }
.rb-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.rb-options label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; border: 1px solid var(--paper-line); background: var(--paper); border-radius: 999px; padding: .35rem .8rem; font-size: .88rem; color: var(--ink); }
.rb-options input { accent-color: var(--evergreen); margin: 0; }
.rb-options label:has(input:checked) { border-color: var(--evergreen); background: var(--evergreen-tint); color: var(--evergreen-deep); font-weight: 600; }
.rb-options label:has(input:focus-visible) { outline: 3px solid var(--evergreen); outline-offset: 2px; }
.rb-family { margin: .9rem 0 .7rem; color: var(--ink-soft); }
.rb-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.rb-col { border: 1px solid var(--paper-line); border-radius: var(--radius-sm); background: var(--paper); padding: .75rem .8rem; }
.rb-col h3 { font: 600 .74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 0 0 .55rem; }
.rb-col--up h3 { color: var(--evergreen-deep); }
.rb-bar { display: flex; height: 1.1rem; border-radius: 4px; overflow: hidden; background: var(--paper-deep); margin: 0 0 .35rem; }
.rb-bar span { display: block; height: 100%; border-right: 2px solid var(--paper); }
.rb-bar span:last-child { border-right: 0; }
.rb-legend { list-style: none; margin: 0 0 .55rem; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem .7rem; font: 400 .72rem/1.4 var(--mono); color: var(--ink-soft); }
.rb-legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.p-robin { background: var(--evergreen); }
.p-ava { background: var(--slate); }
.p-leo { background: #6F8799; }
.p-mother { background: var(--brass); }
.rb-col .rb-result { font-size: .98rem; }
.rb-col .rb-rule { font-size: .88rem; }
.rb-foot { margin: .7rem 0 0; }
.rb-steps { padding-left: 1.3rem; }
.rb-steps li { margin-bottom: .6rem; }
@media (max-width: 760px) {
  .rb-board { grid-template-columns: 1fr; }
}
@media print {
  .rb-explorer { display: none !important; }
  .rb-table { min-width: 0; font-size: .8rem; }
  .rb-table-wrap { overflow: visible; }
  .rb-note { background: #fff !important; }
}
.rb-section > p { max-width: var(--measure); }
.rb-section > .rb-note { max-width: 48rem; }
/* Keep the wide table scrolling inside its box on narrow screens (grid items default to min-width:auto). */
.episode-main { min-width: 0; }
.rb-caveat { max-width: var(--measure); font-size: .92rem; color: var(--ink-soft); }
