.penalty-modes {
  display: flex;
  gap: 12px;
  margin: 25px 0 0;
}
.pu-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.pu-section-heading {
  display: flex;
  gap: 25px;
  justify-content: space-between;
  align-items: center;
}
.pu-section-heading h2,
.component-guide h2 {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.7px;
  margin: 8px 0 20px;
}
.pu-section-heading .micro,
.component-guide > .micro {
  color: var(--red);
  margin: 0;
}
.snapshot-stamp {
  font: 11px/1.8 var(--mono);
  color: var(--muted);
  max-width: 320px;
  text-align: right;
}
.pu-toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 18px;
  padding: 20px;
  background: #1b2226;
  border: 1px solid var(--line);
}
.pu-toolbar label {
  display: block;
  font: 10px var(--mono);
  color: #b6c0c6;
  margin-bottom: 10px;
}
.pu-toolbar select,
.pu-toolbar input {
  width: 100%;
  min-height: 46px;
  padding: 11px;
  background: #141b1f;
  color: var(--ink);
  border: 1px solid #53606a;
  border-radius: 0;
  font:
    13px Arial,
    sans-serif;
}
.pu-toolbar input:focus-visible,
.pu-toolbar select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.pu-legend {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  padding: 23px 0 8px;
}
.pu-legend i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
}
.legend-neutral {
  background: #b5c1c7;
}
.legend-amber {
  background: #edbc59;
}
.legend-red {
  background: #ff7e72;
}
.pu-context,
.pu-reading,
.scroll-hint {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.scroll-hint {
  font: 10px var(--mono);
  margin: 20px 0 12px;
}
.pu-table-scroll {
  overflow: auto;
  border: 1px solid #3b464c;
  max-height: 780px;
}
.pu-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 950px;
}
.pu-table th,
.pu-table td {
  padding: 17px 14px;
  border-bottom: 1px solid #344047;
  text-align: center;
}
.pu-table thead th {
  position: sticky;
  top: 0;
  background: #283137;
  z-index: 2;
  font: 11px var(--mono);
  color: #eef1ee;
}
.pu-table thead th small {
  display: block;
  font: 8px var(--mono);
  letter-spacing: 0.6px;
  color: #b1bdc3;
  margin-top: 8px;
}
.pu-table th:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  min-width: 220px;
  background: #1d262b;
  z-index: 1;
}
.pu-table thead th:first-child {
  z-index: 3;
  background: #283137;
}
.pu-table tbody tr:nth-child(even) {
  background: #1a2226;
}
.driver-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--driver-team);
  border-left: 2px solid var(--driver-team);
  padding-left: 10px;
}
.driver-team {
  display: block;
  font: 10px/1.6 var(--mono);
  color: var(--driver-team);
  padding-left: 12px;
  margin-top: 7px;
}
.pu-number {
  display: block;
  font: 22px/1.2 var(--mono);
}
.pu-table td small {
  display: block;
  font: 9px/1.4 var(--mono);
  margin-top: 6px;
}
.pu-over {
  color: #ff887d;
  background: #e94c3a0a;
}
.pu-limit {
  color: #efc26d;
}
.pu-below {
  color: #b7c5cd;
}
.pu-delta {
  display: block;
  font: 8px/1.5 var(--mono);
  color: #c3cbd0;
  margin-top: 6px;
}
.pu-no-results {
  padding: 28px !important;
  color: var(--muted);
}
.pu-reading {
  max-width: 960px;
}
.component-guide {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  margin-top: 35px;
}
.pu-toolbar-single {
  grid-template-columns: minmax(0, 420px);
  margin-bottom: 16px;
}
.pu-diagram {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr);
  gap: 16px;
  align-items: stretch;
}
.pu-figure {
  margin: 0;
  border: 1px solid var(--line);
  background: #1b2327;
  padding: 14px 14px 10px;
}
.pu-figure figcaption {
  font: 10px/1.6 var(--mono);
  color: var(--muted);
  padding-top: 6px;
}
.pu-svg {
  display: block;
  width: 100%;
  height: auto;
}
.pu-svg .axis {
  fill: none;
  stroke: #2f3b41;
  stroke-width: 1;
  stroke-dasharray: 3 6;
}
.pu-svg .end {
  font: 10px var(--mono);
  letter-spacing: 0.08em;
  fill: #66747b;
}
.pu-part {
  --stroke: #6b7c85;
  --fill: #1f2a30;
  --fine: #4c5d66;
  --label: #a5a8a9;
  cursor: pointer;
  outline: none;
}
.pu-part[data-state="below"] {
  --stroke: #b5c1c7;
  --fine: #7d8b92;
}
.pu-part[data-state="limit"] {
  --stroke: #edbc59;
  --fill: #2d2a20;
  --fine: #8a7640;
}
.pu-part[data-state="over"] {
  --stroke: #ff7e72;
  --fill: #35211f;
  --fine: #8f4c46;
}
.pu-part:hover,
.pu-part.is-selected {
  --stroke: var(--lime);
  --label: var(--lime);
}
.pu-part:hover:not([data-state]),
.pu-part.is-selected:not([data-state]) {
  --fill: #29351f;
  --fine: #7f9a49;
}
.pu-part.is-selected {
  filter: url(#pu-glow);
}
.pu-part .hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}
.pu-part:focus-visible .hit {
  stroke: var(--red);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.pu-part .body {
  fill: var(--fill);
  stroke: var(--stroke);
  stroke-width: 2;
  transition:
    fill 0.15s,
    stroke 0.15s;
}
.pu-part.is-selected .body {
  stroke-width: 2.5;
}
.pu-part .fine {
  fill: none;
  stroke: var(--fine);
  stroke-width: 1.5;
}
.pu-part .wire {
  stroke-dasharray: 4 4;
}
.pu-part .pin {
  fill: none;
  stroke: var(--stroke);
  stroke-width: 3;
}
.pu-part .pipe {
  fill: none;
  stroke: var(--stroke);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke 0.15s;
}
.pu-part .pipe-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 26;
  pointer-events: stroke;
}
.pu-part .label {
  font: 700 15px var(--mono);
  letter-spacing: 0.04em;
  text-anchor: middle;
  fill: var(--label);
  pointer-events: none;
}
.pu-part .badge {
  display: none;
  pointer-events: none;
}
.pu-part[data-state] .badge {
  display: inline;
}
.pu-part .badge rect {
  fill: #141618;
  stroke: var(--stroke);
  stroke-width: 1.5;
}
.pu-part .badge text {
  font: 700 13px var(--mono);
  text-anchor: middle;
  fill: var(--stroke);
}
.pu-detail {
  border: 1px solid var(--line);
  background: #1b2327;
  padding: 23px;
}
.pu-detail .micro {
  color: var(--red);
}
.pu-detail h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin: 13px 0;
}
.pu-detail p {
  font-size: 13px;
  color: #acb9c1;
  line-height: 1.8;
  margin: 0;
}
.pu-detail .pu-detail-usage {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--stroke, var(--line));
  background: #141b1f;
  color: var(--ink);
}
.pu-detail-usage[data-state="below"] {
  --stroke: #b5c1c7;
}
.pu-detail-usage[data-state="limit"] {
  --stroke: #edbc59;
}
.pu-detail-usage[data-state="over"] {
  --stroke: #ff7e72;
}
.pu-detail-usage small {
  display: block;
  font: 10px/1.6 var(--mono);
  color: var(--muted);
  margin-top: 4px;
}
.pu-detail-empty {
  color: var(--muted);
}
.component-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.component-chips button {
  min-height: 40px;
  padding: 8px 14px;
  background: #1b2327;
  border: 1px solid var(--line);
  font: 11px var(--mono);
  scroll-margin-top: 20px;
}
.component-chips button small {
  color: var(--muted);
  margin-left: 6px;
  font-size: 10px;
}
.component-chips button[aria-pressed="true"] {
  border-color: var(--lime);
  color: var(--lime);
}
.component-chips button[data-state="limit"] {
  box-shadow: inset 3px 0 #edbc59;
}
.component-chips button[data-state="over"] {
  box-shadow: inset 3px 0 #ff7e72;
}
.component-chips button[data-state="below"] {
  box-shadow: inset 3px 0 #b5c1c7;
}
.penalty-note {
  background: #1d262a;
  border: 1px solid var(--line);
  padding: 25px;
  margin: 25px 0 40px;
}
.penalty-note h2 {
  font-size: 23px;
  font-weight: 500;
  margin: 0 0 12px;
}
.penalty-note p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.decision-card {
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 16px;
}
.decision-card h3 {
  font-size: 22px;
  font-weight: 500;
  color: var(--driver-team);
  border-left: 2px solid var(--driver-team);
  padding-left: 14px;
}
.decision-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.decisions-footnote {
  margin: 20px 0 0;
  font: 12px var(--mono);
  line-height: 1.7;
  color: var(--muted);
}
@media (max-width: 900px) {
  .pu-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .pu-toolbar > div:first-child {
    grid-column: 1/-1;
  }
  .pu-diagram {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .pu-section-heading {
    display: block;
  }
  .snapshot-stamp {
    text-align: left;
    max-width: none;
  }
  .pu-toolbar {
    padding: 16px;
    gap: 15px;
  }
  .pu-figure {
    padding: 8px 8px 6px;
  }
  .pu-part .label {
    font-size: 18px;
  }
  .pu-part .badge text {
    font-size: 15px;
  }
  .pu-svg .end {
    font-size: 13px;
  }
  .pu-toolbar-single {
    grid-template-columns: 1fr;
  }
  .pu-table th:first-child {
    min-width: 164px;
    max-width: 164px;
  }
  .pu-table th,
  .pu-table td {
    padding: 15px 12px;
  }
  .driver-name {
    font-size: 13px;
  }
  .driver-team {
    font-size: 9px;
  }
  .pu-legend {
    gap: 12px;
  }
  .penalty-modes {
    margin: 22px 0 0;
    gap: 8px;
  }
}

/* Isolate component widths from the shared upgrade-table percentages. */
.pu-table {
  table-layout: fixed;
  min-width: 948px;
}
.pu-table .pu-driver-col {
  width: 220px;
}
.pu-table .pu-element-col {
  width: 104px;
}
.pu-table th:first-child {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}
@media (max-width: 700px) {
  .pu-table {
    width: 688px;
    min-width: 688px;
  }
  .pu-table .pu-driver-col {
    width: 156px;
  }
  .pu-table .pu-element-col {
    width: 76px;
  }
  .pu-table th:first-child {
    width: 156px;
    min-width: 156px;
    max-width: 156px;
  }
  .pu-table th,
  .pu-table td {
    padding: 15px 7px;
    overflow-wrap: break-word;
  }
  .pu-table thead th small {
    font-size: 7px;
    letter-spacing: 0;
  }
  .pu-table td small {
    font-size: 8px;
  }
  .pu-delta {
    font-size: 7px;
  }
}

/* Weekend penalties: part-by-part breakdown and the rules explainer. */
.decision-parts {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.decision-parts li {
  display: grid;
  grid-template-columns: 78px minmax(0, 1.4fr) 76px minmax(0, 1.6fr) 54px;
  gap: 4px 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.decision-parts .part-key {
  font: 700 12px var(--mono);
  color: var(--ink);
}
.decision-parts .part-count {
  font: 13px var(--mono);
  color: var(--ink);
}
.decision-parts .part-count b {
  font-weight: 700;
}
.decision-parts .part-places {
  font: 700 13px var(--mono);
  text-align: right;
}
.decision-parts li.is-over .part-count b,
.decision-parts li.is-over .part-status,
.decision-parts li.is-over .part-places {
  color: #ff7e72;
}
.decision-why {
  margin: 16px 0 0;
}
.decision-why .why-sum {
  display: inline-block;
  font: 700 12px var(--mono);
  color: var(--ink);
  margin-right: 8px;
}
.rule-guide {
  border-top: 1px solid var(--line);
  padding: 30px 0 10px;
  margin-top: 35px;
}
.rule-guide > .micro {
  color: var(--red);
  margin: 0;
}
.rule-guide h2 {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.7px;
  margin: 8px 0 14px;
}
.rule-guide > p {
  max-width: 760px;
  font-size: 14px;
  line-height: 1.8;
  color: #acb9c1;
}
.rule-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.rule-steps article {
  border: 1px solid var(--line);
  background: #1b2327;
  padding: 23px;
}
.rule-steps .rule-places {
  display: block;
  font: 700 34px/1 var(--mono);
  margin-bottom: 14px;
}
.rule-steps .rule-ok {
  color: #b5c1c7;
}
.rule-steps .rule-ten {
  color: #edbc59;
}
.rule-steps .rule-five {
  color: #ff7e72;
}
.rule-steps h3 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 10px;
}
.rule-steps p {
  font-size: 13px;
  line-height: 1.8;
  color: #acb9c1;
  margin: 0;
}
.rule-example {
  border-left: 2px solid var(--lime);
  background: #1b2327;
  padding: 16px 20px;
  max-width: 760px;
  font-size: 13px;
  line-height: 1.8;
  color: #acb9c1;
}
.rule-example strong {
  color: var(--ink);
}
@media (max-width: 900px) {
  .rule-steps {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .decision-parts li {
    grid-template-columns: 70px minmax(0, 1fr) 46px;
    grid-template-areas:
      "key count places"
      "name name name"
      "status status status";
  }
  .decision-parts .part-key { grid-area: key; }
  .decision-parts .part-count { grid-area: count; }
  .decision-parts .part-places { grid-area: places; }
  .decision-parts .part-name { grid-area: name; }
  .decision-parts .part-status { grid-area: status; }
  .rule-guide h2 {
    font-size: 26px;
  }
}
