/* Approved Tournament Science: three category toggles and one compact additive-books table. */
.tournament-science-page { min-width: 0; max-width: 56.25rem; }
.tournament-science-allocation { min-width: 0; max-width: none; }
.tournament-science-summary { display: flex; justify-content: space-between; align-items: center; gap: .625rem; margin-bottom: .75rem; }
.tournament-science-summary h2 { margin: 0 0 .3125rem; font-size: 1rem; }
.tournament-science-summary p { margin: 0; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.tournament-science-budget { flex: 0 0 auto; min-width: 6.5rem; padding: .4375rem .5625rem; border: 1px solid var(--border); border-radius: .375rem; background: var(--panel); text-align: right; }
.tournament-science-budget span { display: block; color: var(--muted); font-size: .625rem; }
.tournament-science-budget strong { display: block; margin-top: .25rem; color: var(--accent); font-size: 1.3125rem; font-variant-numeric: tabular-nums; }
.tournament-science-budget.over-budget { border-color: var(--bad); }
.tournament-science-budget.over-budget strong { color: var(--bad); }
.tournament-science-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .1875rem; width: 100%; padding: .1875rem; box-sizing: border-box; margin: 0 0 .75rem; border: 1px solid var(--border); border-radius: .4375rem; background: var(--panel); }
#tournament-frame .tournament-science-tabs button { min-width: 0; min-height: 2.75rem; padding: .5625rem .25rem; white-space: nowrap; border: 1px solid var(--border); background: var(--panel); color: var(--muted); font-size: .75rem; }
#tournament-frame .tournament-science-tabs button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.tournament-science-table { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1px solid var(--border); background: var(--panel); }
.tournament-science-table th, .tournament-science-table td { box-sizing: border-box; padding: .5625rem .4375rem; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.tournament-science-table thead th { font-size: .625rem; line-height: 1.4; letter-spacing: 0; }
.tournament-science-table thead th:first-child { width: 35%; text-align: left; }
.tournament-science-table thead th:nth-child(2) { width: 35%; text-align: left; color: var(--accent); }
.tournament-science-table thead th:last-child { width: 30%; text-align: right; }
.tournament-science-table tbody th { font-size: .75rem; font-weight: 500; text-align: left; text-transform: none; letter-spacing: 0; line-height: 1.4; color: var(--text); }
.tournament-science-table tbody td { font-size: .75rem; text-align: right; line-height: 1.4; font-variant-numeric: tabular-nums; }
.tournament-science-table .tournament-science-bonus { text-align: left; color: var(--muted); font-size: .6875rem; }
.tournament-science-bonus > div + div { margin-top: .4375rem; }
.tournament-science-bonus b { color: var(--accent); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.tournament-science-effect { display: block; }
.tournament-science-effect + .tournament-science-effect { margin-top: .375rem; }
.tournament-science-table small { display: block; margin-top: .25rem; color: var(--muted); font-size: .625rem; font-weight: 400; line-height: 1.4; }
.tournament-science-table input { box-sizing: border-box; width: 100%; min-width: 0; max-width: 8.75rem; min-height: 2.75rem; padding: .5rem .375rem; text-align: right; font-size: 16px; font-variant-numeric: tabular-nums; background: var(--bg); color: var(--text); }
.tournament-science-table input[aria-invalid=true] { border-color: var(--bad); }
#tournament-frame .tournament-science-table button.term-help:not(.chip) { max-width: 100%; min-width: 0; min-height: 2.75rem; padding: 0; justify-content: flex-start; text-align: left; white-space: normal; font: inherit; line-height: inherit; }
.tournament-science-plan-summary { display: flex; justify-content: space-between; gap: .5rem; margin: .875rem 0 .5rem; color: var(--muted); font-size: .6875rem; font-variant-numeric: tabular-nums; }
.tournament-science-plan-summary strong { color: var(--text); }
.tournament-science-validation, .tournament-science-error { margin: .5rem 0; color: var(--bad); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.tournament-science-validation:empty, .tournament-science-result:empty { display: none; }
.tournament-science-result { margin: .5rem 0; color: var(--text); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
#tournament-frame .tournament-science-submit { width: 100%; min-height: 2.875rem; margin: .625rem 0; background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 700; }
.tournament-science-note { margin: .625rem 0; color: var(--muted); font-size: .6875rem; line-height: 1.5; overflow-wrap: anywhere; }
.tournament-science-unknown { color: var(--muted); }
.tournament-science-page [data-tournament-science-refresh] { min-height: 2.75rem; margin-bottom: .75rem; }
.tournament-science-reallocation-section { margin-top: 1rem; padding-top: .875rem; border-top: 1px solid var(--border); }
#tournament-frame .tournament-science-reallocation-section button { min-height: 2.75rem; max-width: 100%; white-space: normal; font-size: .75rem; }
.tournament-science-reallocation-section form { max-width: none; }
.tournament-science-reallocation-section fieldset { min-width: 0; margin: .75rem 0; padding: .625rem; border: 1px solid var(--border); border-radius: .375rem; }
.tournament-science-reallocation-section legend { max-width: 100%; font-size: .8125rem; overflow-wrap: anywhere; }
.tournament-science-reallocation-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .625rem; }
.tournament-science-reallocation-fields label { display: grid; min-width: 0; gap: .25rem; font-size: .75rem; }
.tournament-science-reallocation-fields input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 2.75rem; padding: .5rem; font-size: 16px; }
.tournament-science-reallocation-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.tournament-science-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (min-width: 760px) {
  .tournament-science-summary { gap: .875rem; margin-bottom: .875rem; }
  .tournament-science-summary h2 { font-size: 1.125rem; }
  .tournament-science-summary p { font-size: .8125rem; }
  .tournament-science-budget { padding: .5625rem .75rem; }
  .tournament-science-budget strong { font-size: 1.5625rem; }
  #tournament-frame .tournament-science-tabs button { padding: .625rem .5rem; font-size: .8125rem; }
  .tournament-science-table th, .tournament-science-table td { padding: .6875rem .625rem; }
  .tournament-science-table thead th:first-child { width: 36%; }
  .tournament-science-table thead th:last-child { width: 29%; }
  .tournament-science-table tbody th { font-size: .875rem; }
  .tournament-science-table .tournament-science-bonus { font-size: .75rem; }
  .tournament-science-bonus b { font-size: .875rem; }
  .tournament-science-table small { font-size: .6875rem; }
  .tournament-science-plan-summary { font-size: .75rem; }
}
