/* Research page: build choices. The chart reuses .plot, .edges, .bar and the tier colours from style.css. */
.rs-plot { --label-w: 300px; --value-w: 122px; --more-w: 50px; --gap: 12px; }
.rs-plot .edges { left: calc(var(--label-w) + var(--gap)); right: calc(var(--value-w) + var(--more-w) + 2 * var(--gap)); }
.rs-row { display: grid; grid-template-columns: var(--label-w) 1fr var(--value-w) var(--more-w); align-items: center; gap: var(--gap); min-height: 30px; position: relative; z-index: 1; }
.rs-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; white-space: nowrap; }
.rs-name { overflow: hidden; text-overflow: ellipsis; }
.tier-none { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); font-weight: 500; }
.rs-c-tier .tier-badge { min-width: 0; padding: 2px 8px; font-size: 12px; }
.rs-tag { flex: none; min-width: 62px; padding: 2px 8px; font-size: 12px; text-align: center; box-sizing: border-box; }
.rs-track { display: block; height: 16px; border-radius: 4px; background: var(--track); overflow: hidden; }
.rs-track .bar { border-radius: 4px; }
.rs-none { background: transparent; border: 1px dashed var(--line-strong); display: flex; align-items: center; padding: 0 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rs-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-more { font-size: 12.5px; font-weight: 500; text-align: right; white-space: nowrap; }

/* Speed and Quality: longer names and values than the build choices */
.rs-plot-speed, .rs-plot-quality { --label-w: 400px; --value-w: 128px; }
.rs-plot-speed .rs-row, .rs-plot-quality .rs-row { min-height: 32px; }
.rs-plot-speed .rs-label, .rs-plot-quality .rs-label { white-space: normal; line-height: 1.25; font-size: 13px; }
.rs-plot-speed .rs-name, .rs-plot-quality .rs-name { overflow: visible; }

/* Details table */
.rs-table { font-size: 13.5px; }
.rs-table th, .rs-table td { vertical-align: top; padding: 12px 10px; }
.rs-table thead th:nth-child(1) { width: 8%; }
.rs-table thead th:nth-child(2) { width: 15%; }
.rs-table thead th:nth-child(3) { width: 19%; }
.rs-table thead th:nth-child(4) { width: 14%; }
.rs-table thead th:nth-child(5) { width: 31%; }
.rs-table-tech thead th:nth-child(1) { width: 8%; }
.rs-table-tech thead th:nth-child(2) { width: 19%; }
.rs-table-tech thead th:nth-child(3) { width: 13%; }
.rs-table-tech thead th:nth-child(4) { width: 17%; }
.rs-table-tech thead th:nth-child(5) { width: 25%; }
.rs-table-tech thead th:nth-child(6) { width: 10%; }
.rs-also { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.rs-also-head { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.rs-also-item { display: block; margin-top: 3px; }
.rs-also-item strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.rs-c-choice { font-weight: 600; }
.rs-choice { scroll-margin-top: 112px; }
.rs-choice:target > * { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.rs-choice:target > :first-child { box-shadow: inset 3px 0 0 var(--accent); }
.rs-headline { display: block; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.rs-measures { display: block; margin-bottom: 6px; }
.rs-effect-text, .rs-evidence { display: block; color: var(--muted); font-size: 13px; }
.rs-evidence { margin-top: 4px; font-size: 12.5px; }
.rs-c-source { overflow-wrap: anywhere; }
.rs-list { margin: 10px 0; padding-left: 20px; max-width: 760px; }
.rs-list li { margin: 6px 0; }

@media (max-width: 640px) {
  /* Chart: name and Details link on one line, bar and value under them */
  .rs-plot { padding-top: 0; }
  .rs-plot .edges { display: none; }
  .rs-row { grid-template-columns: 1fr auto; gap: 4px 8px; padding: 7px 0; }
  .rs-label { font-size: 13px; white-space: normal; line-height: 1.3; }
  .rs-name { overflow: visible; }
  .rs-track { grid-row: 2; grid-column: 1; }
  .rs-value { grid-row: 2; grid-column: 2; min-width: 44px; text-align: right; font-size: 12.5px; }
  .rs-more { grid-row: 1; grid-column: 2; }

  /* Table: one block per choice, each cell labelled */
  .rs-table, .rs-table tbody, .rs-table tr, .rs-table th, .rs-table td { display: block; }
  .rs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rs-table th, .rs-table td { padding: 0; border: 0; }

  .rs-choice, .rs-empty { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .rs-table tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .rs-choice { scroll-margin-top: 122px; }
  .rs-choice:target { margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 9%, transparent); }
  .rs-choice:target > *, .rs-choice:target > :first-child { background: none; box-shadow: none; }
  .rs-c-tier { margin-bottom: 6px; }
  .rs-c-tier::before { display: none !important; }
  .rs-c-choice { font-size: 15px; margin-bottom: 6px; }
  .rs-choice td { margin-top: 8px; }
  .rs-choice td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1px; }
}
.rs-source { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.rs-src { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }

/* Finance > Jobs (jobs.html) */
.rs-plot-jobs { --label-w: 250px; --value-w: 96px; }
.jobs-ref { font-size: 12px; }
.jobs-ref-bar { opacity: 0.55; }
.rs-table-jobs thead th:nth-child(1) { width: 8%; }
.rs-table-jobs thead th:nth-child(2) { width: 15%; }
.rs-table-jobs thead th:nth-child(3) { width: 14%; }
.rs-table-jobs thead th:nth-child(4) { width: 10%; }
.rs-table-jobs thead th:nth-child(5) { width: 15%; }
.rs-table-jobs thead th:nth-child(6) { width: 12%; }
.rs-table-jobs thead th:nth-child(7) { width: 19%; }
.rs-table-tiers thead th:nth-child(1) { width: 8%; }
.rs-table-tiers thead th:nth-child(2) { width: 35%; }
.rs-table-tiers thead th:nth-child(3), .rs-table-tiers thead th:nth-child(4), .rs-table-tiers thead th:nth-child(5) { width: 19%; }
.jobs-total > * { font-weight: 600; }
/* Margin chart: a "before R&D" bar is the profit from operations (solid) followed by the R&D added back (striped) */
.rs-track:has(.jobs-seg) { display: flex; }
.jobs-seg { flex: none; border-radius: 0 !important; }
.jobs-rd { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 3px, transparent 3px 7px); }
.jobs-split { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.rs-plot-margin { --value-w: 150px; }
@media (max-width: 640px) {
  /* Keep every track the same width: the two-part numbers sit on their own line under the bar */
  .rs-plot-margin .rs-value { position: relative; }
  .rs-plot-margin .jobs-split { position: absolute; right: 0; top: 100%; white-space: nowrap; }
  .rs-plot-margin .rs-row:has(.jobs-split) { padding-bottom: 22px; }
}
