:root {
  color-scheme: dark;
  --ink: #f2f5f3;
  --muted: #adbab3;
  --line: #34423b;
  --panel: #191f1c;
  --accent: #45b2e5;
  font-family: system-ui, sans-serif;
  background: #111514;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(100%, 760px); margin: auto; padding: 24px 12px 32px; }
header { border-bottom: 3px solid var(--accent); padding-bottom: 14px; }
.brand { width: clamp(168px, 42vw, 240px); container-type: inline-size; }
.brand-logo { display: block; width: 100%; height: auto; }
.product {
  margin: .25em 0 0;
  color: var(--accent);
  font-size: 13.42cqw;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}
h1 { font-size: clamp(1.75rem, 6vw, 3rem); line-height: 1.04; margin: .3em 0; }
p { margin: .5em 0; }
#updated, footer, .ranking-head { color: var(--muted); font-size: .8rem; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 16px; }
label { min-width: 0; font-size: .75rem; color: var(--muted); font-weight: 650; }
label:last-child { grid-column: 1 / -1; }
select { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; font-size: .9rem; }
#results { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.columns { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 5.2rem 4.5rem; gap: 6px; align-items: center; padding: 0 8px; }
.columns > :nth-last-child(-n+2) { text-align: right; }
.ranking-head { min-height: 32px; text-transform: uppercase; letter-spacing: .05em; }
details { border-top: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; min-height: 48px; font-size: .85rem; }
summary::-webkit-details-marker { display: none; }
summary:hover { background: #252e29; }
.position, .value, .gap { font-variant-numeric: tabular-nums; }
.position { color: var(--muted); }
.name { font-weight: 650; overflow-wrap: anywhere; padding: 6px 0; }
.name::after { content: ' +'; color: var(--muted); }
details[open] .name::after { content: ' −'; }
.value { font-weight: 750; }
.gap { color: var(--muted); font-size: .8rem; }
.leader summary { background: #173243; }
.leader .position, .leader .value { color: var(--accent); }
.driver-details { padding: 12px; border-top: 1px solid var(--line); }
dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin: 0 0 14px; font-size: .84rem; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
footer { display: flex; gap: 8px 14px; flex-wrap: wrap; margin-top: 14px; line-height: 1.6; }
#empty { padding: 12px; }
@media (min-width: 560px) {
  main { padding-inline: 24px; }
  form { grid-template-columns: 1fr 1fr 1.25fr; }
  label:last-child { grid-column: auto; }
  .columns { grid-template-columns: 2.75rem minmax(0, 1fr) 7rem 7rem; padding-inline: 14px; }
  summary { font-size: .95rem; }
}

.refresh-row { display: flex; align-items: center; gap: 12px; }
#updated { color: var(--accent); }
#refresh {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #111514;
  font: inherit;
  font-size: .8rem;
  font-weight: 750;
  cursor: pointer;
}
#refresh:hover:not(:disabled) { background: #76c7ed; }
#refresh:active:not(:disabled) { background: #32a2d5; }
#refresh:focus-visible { outline-offset: 3px; }
#refresh:disabled { opacity: .65; cursor: wait; }
#refresh-status { color: var(--muted); font-size: .8rem; }
.practice-tips { color: var(--accent); font-size: .8rem; margin: 10px 0 0; padding-left: 1.15rem; line-height: 1.45; }
#refresh-status:empty { display: none; }
