/* Round-Robin Activity Rotator (#026). Only this tool's own pieces; everything else is the shared tool frame.
   Colours come from the site's variables only (tests/catalogue.test.mjs checks there are no hex values here).
   The user's names are the content: plain cards and a plain table, no colour coding. */

/* ---------- set-up ---------- */
.rr-list { min-height: 150px; font-size: 17px; line-height: 1.55; }
.rr-status { margin: -2px 0 0; min-height: 1.4em; font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }
.rr-status.is-problem { color: var(--graphite); font-weight: 600; }
.rr-status:empty { min-height: 0; }

/* Groups at once: one row per activity, as #025's player rows. */
.rr-caps { border-radius: var(--r-card); background: var(--white); box-shadow: inset 0 0 0 1px var(--silver); overflow: hidden; }
.rr-caps__empty { margin: 0; padding: 18px 16px; font-size: 14px; color: var(--steel); }
.rr-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 14px; }
.rr-cap + .rr-cap { box-shadow: inset 0 1px 0 var(--mist); }
.rr-cap__name { min-width: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.rr-step { flex: none; align-self: flex-start; width: max-content; }
.rr-step button { width: 36px; height: 36px; font-size: 20px; }
.rr-step input { width: 44px; min-width: 0; font-size: 17px; }
.rr-break { margin-top: 10px; }
.rr-break .rr-cap { border-radius: var(--r-card); background: var(--white); box-shadow: inset 0 0 0 1.5px var(--graphite); }
.rr-break .rr-cap__name { font-weight: 600; }
.rr-break__hint { margin: 8px 0 6px; }
#rr-break-add { margin-top: 10px; }

.rr-rounds { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.rr-rounds__l { font-size: 15px; font-weight: 600; }
.rr-plan .rr-status { margin-top: 8px; }

.rr-time { max-width: 180px; font-variant-numeric: tabular-nums; }
.rr-tgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
.rr-tgrid .field__label, .rr-long .field__label { display: block; margin-bottom: 6px; }
.rr-longs { display: grid; gap: 10px; }
.rr-longs:empty { display: none; }
.rr-long { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 14px; padding: 10px 12px 12px; border-radius: var(--r-card); background: var(--white); box-shadow: inset 0 0 0 1px var(--silver); }
.rr-long .field { margin: 0; }
.rr-long__x { margin-left: auto; }

/* ---------- what can't work, and the fixes ---------- */
.rr-problem { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-card); background: var(--white); box-shadow: inset 0 0 0 1.5px var(--graphite); }
.rr-problem__t { margin: 0; font-size: 15px; line-height: 1.5; font-weight: 600; }
.rr-problem__fixes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.rr-problem__or { font-size: 14px; color: var(--slate); }
.rr-problem__fixes .btn { white-space: normal; text-align: left; }

/* What to include in the printout (shared chooser, styled here). */
.pdf-sections { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.pdf-sections legend { padding: 0; margin-bottom: 8px; color: var(--slate); }

/* ---------- the result ---------- */
.rr-empty { margin: 0; padding: 36px 0 20px; font-size: 15px; color: var(--steel); }
.rr-summary { margin: 4px 0 18px; }
.rr-sum { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.rr-note { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--slate); }
.rr-views { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: var(--r-btn); background: var(--mist); }
.rr-view { min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--slate); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rr-view[aria-pressed="true"] { background: var(--white); color: var(--graphite); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.rr-view:focus-visible { outline: 3px solid var(--graphite); outline-offset: 2px; }
.rr-sec { display: none; }
.rr-sec.is-view { display: block; }
.rr-sec__h, .rr-master-print { display: none; }

/* Cards: a group's route, or who's at an activity, round by round. */
.rr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 28px; }
.rr-card { min-width: 0; break-inside: avoid; }
.rr-card__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 8px; padding-bottom: 7px; border-bottom: 2px solid var(--graphite); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rr-card__h small { flex: none; font-size: 13px; font-weight: 500; color: var(--steel); }
.rr-card__l { list-style: none; margin: 0; padding: 0; }
.rr-card__l li { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--mist); font-size: 15px; line-height: 1.35; }
.rr-r { font-size: 13px; font-weight: 600; color: var(--slate); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rr-t { font-size: 13px; color: var(--steel); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rr-a { min-width: 0; overflow-wrap: anywhere; }
.rr-card__l li .rr-a:only-of-type, .rr-card__l li .rr-r + .rr-a { grid-column: 3; }
.rr-brk { font-style: italic; color: var(--slate); }
.rr-none { color: var(--steel); font-style: italic; }

/* Master: groups down, rounds across; the group column stays put while it scrolls sideways. */
.rr-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--silver); background: var(--white); }
.rr-scroll:focus-visible { outline: 3px solid var(--graphite); outline-offset: 2px; }
.rr-master { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; line-height: 1.3; }
.rr-master th, .rr-master td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--mist); min-width: 112px; max-width: 200px; overflow-wrap: anywhere; }
.rr-master thead th { font-size: 12.5px; font-weight: 600; color: var(--slate); white-space: nowrap; background: var(--white); }
.rr-master thead .rr-t { display: block; font-weight: 400; }
.rr-master .rr-mg { position: sticky; left: 0; z-index: 1; min-width: 96px; background: var(--white); font-weight: 600; box-shadow: inset -1px 0 0 var(--silver); }
.rr-master tbody tr:last-child > * { border-bottom: 0; }

.rr-send { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.rr-send h2 { margin: 0; color: var(--slate); }
.rr-send__btns { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 560px) {
  .rr-views { display: flex; }
  .rr-view { flex: 1 1 0; padding: 0 6px; }
  .rr-cards { grid-template-columns: minmax(0, 1fr); }
  .rr-send__btns { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .rr-send__btns .btn { width: 100%; justify-content: center; min-height: 44px; white-space: nowrap; }
  .rr-send__btns #rr-copy { grid-column: 1 / -1; }
}

/* ---------- paper: the sections chosen, each from a new page ---------- */
@media print {
  .rr-summary { margin: 2mm 0 5mm; }
  .rr-sum { font-size: 11pt; }
  .rr-note { font-size: 8.5pt; margin-top: 1mm; }
  /* Space after each section: the PDF maker starts a forced page a little above the next section, which must not
     fall inside the table before it (it would repeat that table's heading row on the new page). */
  .rr-sec { display: block; padding-bottom: 8mm; }
  .rr-sec[data-pdf-out] { display: none; }
  .rr-sec:not(.is-first) { break-before: page; }
  .rr-sec__h { display: block; margin: 0 0 4mm; font-size: 13pt; font-weight: 600; }
  .rr-sec:not(.is-first) .rr-sec__h { margin-top: 0; }
  .rr-master-print { display: block; }
  .rr-master-print .rr-master + .rr-master { margin-top: 7mm; }
  .rr-master { font-size: 8.5pt; table-layout: fixed; }
  .rr-master th, .rr-master td { min-width: 0; max-width: none; padding: 1.8mm 2mm; border-bottom: 0.5pt solid var(--silver); }
  .rr-master thead th { font-size: 8pt; white-space: normal; border-bottom: 1pt solid var(--graphite); }
  .rr-master .rr-mg { position: static; width: 30mm; box-shadow: none; }
  .rr-master tr { break-inside: avoid; }
  .rr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6mm 8mm; }
  .rr-land .rr-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rr-card__h { font-size: 11.5pt; padding-bottom: 1.5mm; border-bottom-width: 1.5pt; margin-bottom: 1.5mm; }
  .rr-card__h small { font-size: 8pt; }
  .rr-card__l li { padding: 1.2mm 0; font-size: 9.5pt; border-bottom: 0.5pt solid var(--mist); }
  .rr-r, .rr-t { font-size: 8pt; }
}
