/* ---------- Interactive tools (score checker). Uses the design tokens from styles.css. ---------- */
.sc-form { display: grid; gap: 8px; max-width: 560px; margin: 22px 0 0; }
.sc-form .control-label { margin-top: 10px; }
.sc-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sc-form legend { padding: 0; margin-bottom: 8px; }
.sc-test { display: flex; flex-wrap: wrap; gap: 10px; }
.sc-radio { position: relative; display: inline-flex; }
.sc-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sc-radio span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid var(--line-control); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700;
}
.sc-radio input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.sc-radio input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.sc-grid { display: grid; gap: 4px 16px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .sc-grid { grid-template-columns: 1fr 1fr; } }
.sc-grid > div { display: grid; gap: 6px; }
.sc-form .btn { justify-self: start; margin-top: 18px; }
.sc-error { margin: 8px 0 0; font-size: 17px; font-weight: 600; color: #9B2C1F; }
.sc-hint { margin: 0; font-size: 16px; color: var(--ink-soft); }

.sc-out { margin-top: 30px; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius-lg); background: var(--tint); }
.sc-out:focus { outline: none; }
.sc-out:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.prose .sc-h, .sc-h { margin: 28px 0 12px; font-size: 22px; line-height: 1.3; }
.sc-h:first-child { margin-top: 0; }
.sc-block, .sc-row { margin: 0 0 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.sc-uni { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.prose .sc-row p, .prose .sc-block p, .prose .sc-facts li { margin: 0 0 8px; font-size: 17px; line-height: 1.55; color: var(--ink-soft); }
.sc-pub { color: var(--ink); font-weight: 600; }
.sc-row strong, .sc-block strong { color: var(--ink); }
.sc-facts, .prose .sc-facts { list-style: none; margin: 0; padding: 0; }
.prose .sc-src { font-size: 15px; }
.prose .sc-small { font-size: 16px; }
.sc-table { min-width: 0; font-size: 16px; }
.sc-table th, .sc-table td { padding: 10px 12px 10px 0; }
.sc-cmp { display: block; font-size: 14px; font-weight: 600; color: var(--gold-deep); }
.sc-caveat { margin-top: 18px; }
.sc-next { margin: 0; padding-left: 20px; }
.prose .sc-next li { margin: 0 0 8px; font-size: 17px; }

/* The 1.0 to 9.0 scale bar */
.sc-scale { position: relative; height: 72px; margin: 6px 6px 10px; }
.sc-track { position: absolute; left: 0; right: 0; top: 34px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--line) 0%, var(--gold-wash) 100%); border: 1px solid var(--line); }
.sc-tick, .sc-you { position: absolute; top: 0; transform: translateX(-50%); }
.sc-tick { top: 28px; width: 2px; height: 20px; background: var(--ink-soft); }
.sc-tick > span { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.sc-you { width: 18px; height: 18px; top: 29px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--ink); }
.sc-you > span { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sc-end { position: absolute; top: 48px; font-size: 13px; color: var(--ink-soft); }
.sc-end-lo { left: 0; }
.sc-end-hi { right: 0; }

/* Static fact tables: stack on phones */
.sc-facts-table th[scope="row"] { min-width: 9em; }
@media (max-width: 600px) {
  .sc-facts-table, .sc-facts-table tbody, .sc-facts-table tr, .sc-facts-table th, .sc-facts-table td { display: block; width: auto; min-width: 0; }
  .sc-facts-table thead { display: none; }
  .sc-facts-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .sc-facts-table th, .sc-facts-table td { padding: 2px 0; border: 0; }
  .sc-facts-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; color: var(--ink); }
  .lp-tablewrap:has(.sc-facts-table) { overflow-x: visible; }
}

@media (max-width: 480px) {
  .sc-out { padding: 16px 12px; margin-left: -4px; margin-right: -4px; }
  .sc-table { font-size: 15px; }
  .sc-table th, .sc-table td { padding: 8px 8px 8px 0; }
  .sc-table thead th { font-size: 13px; }
  .sc-table th:last-child, .sc-table td:last-child { padding-right: 0; }
  .sc-block, .sc-row { padding: 14px 12px; }
  /* Imperial comparison: department name on its own line, the group columns below it,
     so three groups fit at 360px without a sideways scroll. */
  .lp-tablewrap:has(.sc-table) { overflow-x: visible; }
  .sc-table, .sc-table thead, .sc-table tbody { display: block; width: 100%; }
  .sc-table tr { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 8px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .sc-table.sc-g1 tr { grid-template-columns: 1fr; }
  .sc-table tbody tr:last-child { border-bottom: 0; }
  .sc-table th, .sc-table td { display: block; padding: 0; border: 0; }
  .sc-table thead tr { border-bottom: 1.5px solid var(--line-strong); }
  .sc-table thead th { border: 0; padding: 0; }
  .sc-table thead th:first-child { display: none; }
  .sc-table th[scope="row"] { width: auto; grid-column: 1 / -1; margin-bottom: 4px; }
}
