/* ==================================================================
   uphill notes · Race Fees · Einzelseite (fees.css)
   Kommt im Build nach trailbase.css und landing.css (Kopien der Website,
   Stand des Builds) und nutzt deren Atome: Filterleiste + Reset,
   Seg-Group, Insights, Panel-Label, Top10-Tabelle, Page-Nav, v6-.bar-row,
   Country-Table, Disclaimer-Card, Source-Line. Neu: Spaltenbreiten,
   Zweitzeilen, 2026-Linie, Legende unter der Tabelle, einfacher Kopf ohne
   Website-Navigation. Farben nur aus den v6-Tokens.
   ================================================================== */
/* Einzelseite: Kopf ohne Navigation, nicht klebend; Filterleiste klebt oben */
header.site-header.fees-head { position: static; }
.fees-head-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ice); text-align: right; }
.filter-bar.filter-bar--fees { top: env(safe-area-inset-top, 0px); }
/* Legende direkt unter der Tabelle: erklaert *, ≈, + fees und top */
.fees-keys {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; line-height: 1.6;
  color: var(--ice); opacity: .8;
}
.fees-keys b { color: var(--copper); font-weight: 500; }
:root { color-scheme: dark; }

/* Filterleiste: sechs Felder plus Reset. Eine Zeile erst ab 1400px,
   darunter vier, drei, eine Spalte. Segment-Knoepfe nach Inhalt breit,
   damit "61-120" und "Vs 2026" nicht umbrechen. */
.filter-bar--fees { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-bar--fees .seg-group button { flex: 1 1 auto; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
@media (min-width: 1600px) {
  .filter-bar--fees { grid-template-columns: 1fr .85fr 2.1fr 1.1fr 1fr .75fr auto; }  /* Distanz mit 6 Knoepfen (07.10.2026) */
}
@media (min-width: 1181px) and (max-width: 1599px) {
  .filter-bar--fees .fb-dist { grid-column: span 2; }  /* 6 Distanz-Knoepfe brauchen zwei Spalten */
  .filter-bar--fees .filter-reset-cell { grid-column: -2 / -1; justify-self: end; }
}
@media (max-width: 1180px) {
  .filter-bar--fees { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; }
  .filter-bar--fees .fb-dist { grid-column: 1 / -1; }  /* Distanz als eigene Zeile */
}
@media (max-width: 960px) {
  .filter-bar--fees { grid-template-columns: 1fr; }
}
.filter-bar--fees .date-select { letter-spacing: .06em; padding-left: 12px; padding-right: 28px; background-position: right 10px center; }

/* Tabelle */
.fees-table-wrap { overflow-x: auto; }
.top10.fees-top col.col-frank { width: 52px; }
.top10.fees-top col.col-fkm   { width: 64px; }
.top10.fees-top col.col-f26   { width: 140px; }
.top10.fees-top col.col-f27   { width: 140px; }
.top10.fees-top col.col-fchg  { width: 104px; }
.top10.fees-top col.col-fpk   { width: 118px; }
.top10.fees-top col.col-fxci  { width: 120px; }
.top10.fees-top td { vertical-align: top; }
.top10.fees-top td.race-cell { white-space: normal; overflow: visible; }
.top10.fees-top .name { color: var(--off); }
.top10.fees-top .fees-ev {
  display: block; margin-top: 3px;
  font-size: 12px; color: var(--ice); line-height: 1.4;
}
.top10.fees-top .fees-ev .xci-series,
.top10.fees-top .fees-ev .xci-new,
.top10.fees-top .fees-ev .xci-cat { margin-left: 6px; }
.top10.fees-top td .rank { font-size: 16px; }
.top10.fees-top td.num {
  text-align: right; padding-right: 0;
  font-family: var(--mono); font-size: 13px; color: var(--nude);
}
.top10.fees-top td.num.y27 { color: var(--off); }
.top10.fees-top td.num .sub {
  display: block; margin-top: 3px; white-space: normal;
  font-size: 10.5px; letter-spacing: .04em; color: var(--ice); opacity: .75; line-height: 1.45;
}
.top10.fees-top td.num .na { color: var(--ice); opacity: .45; font-size: 11px; letter-spacing: .08em; }
.top10.fees-top .star { color: var(--copper); margin-left: 2px; }
.top10.fees-top td.chg .delta-up,
.top10.fees-top td.chg .delta-dn,
.top10.fees-top td.chg .delta-em { font-family: var(--mono); font-size: 13px; }
.top10.fees-top td.xcicell { color: var(--ice); font-size: 12px; }
.top10.fees-top tr.lead-row .name { color: var(--copper-soft); }
.top10.fees-top .fees-meta { display: none; }
.fees-empty td { text-align: center; color: var(--ice); padding: 28px 0; white-space: normal; }

/* Mobile: Rang, Rennen, 2027, Change. Rest wandert in die zweite Zeile.
   Die generische .top10-Regel blendet Spalte 3 und 5 aus, hier gilt eine eigene. */
@media (max-width: 768px) {
  .top10.fees-top th:nth-child(5),
  .top10.fees-top td:nth-child(5) { display: table-cell; }
  .top10.fees-top th:nth-child(3), .top10.fees-top td:nth-child(3),
  .top10.fees-top th:nth-child(4), .top10.fees-top td:nth-child(4),
  .top10.fees-top th:nth-child(7), .top10.fees-top td:nth-child(7),
  .top10.fees-top th:nth-child(8), .top10.fees-top td:nth-child(8) { display: none; }
  .top10.fees-top .fees-meta {
    display: block; margin-top: 4px;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
    color: var(--ice); opacity: .8; line-height: 1.5;
  }
  .top10.fees-top td.num { font-size: 12.5px; }
}

/* Panel: Euro je km nach Distanz. v6-Atom .bar-rows/.bar-row aus
   trailbase.css (Name | Spur | Wert); 2027 Kupfer, darunter 2026 als
   duenne Eisblau-Spur derselben Rennen. Wertspalte breiter fuer "€ 3.40". */
.fees-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ice); margin: -4px 0 18px;
}
.fees-legend i { display: inline-block; width: 18px; vertical-align: middle; margin-right: 8px; border-radius: 2px; }
.fees-legend i.k27 { height: 5px; background: var(--copper-soft); }
.fees-legend i.k26 { height: 2px; background: var(--ice); }
.fees-perkm { gap: 6px; }
.fees-perkm .bar-row { grid-template-columns: 132px 1fr 64px; }
.fees-perkm .bar-row .track i { background: var(--copper-soft); }
.fees-perkm .bar-row.r26 { font-size: 11.5px; margin-bottom: 14px; }
.fees-perkm .bar-row.r26 .n { color: var(--ice); opacity: .75; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
.fees-perkm .bar-row.r26 .track { height: 2px; background: transparent; }
.fees-perkm .bar-row.r26 .track i { background: var(--ice); }
.fees-perkm .bar-row.r26 .v { font-size: 11.5px; opacity: .8; }
.fees-perkm .bar-row .v { color: var(--off); }
@media (max-width: 540px) {
  .fees-perkm .bar-row { grid-template-columns: 104px 1fr 56px; gap: 8px; }
}

/* Panel: durchschnittliche Veraenderung je Event (Country-Table-Atom) */
.country-table td.ev { color: var(--off); padding-right: 14px; width: 42%; }
.country-table td.ev .ev-n { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ice); opacity: .6; margin-top: 2px; }
.country-table td.count.neg { color: var(--ice); }
.fees-empty-panel { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--ice); opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .country-bar-fill { transition: none; }
}
.country-table td.count.chg { width: 76px; font-family: var(--mono); font-size: 12.5px; }

/* Links in der Tabelle: Event fuehrt zur Preisseite 2027, * zur Quelle 2026 */
.top10.fees-top .fees-ev a.ev-link { color: var(--ice); border-bottom: 1px solid var(--line2); }
.top10.fees-top .fees-ev a.ev-link:hover { color: var(--copper-soft); border-bottom-color: var(--copper-soft); }
.top10.fees-top a.star { color: var(--copper); font-weight: 500; padding: 0 2px; border-bottom: 1px solid var(--copper); }
.top10.fees-top a.star:hover { color: var(--copper-soft); }
.fees-keys a { color: var(--copper-soft); border-bottom: 1px solid var(--copper); }

/* Quellen je Event */
.fees-sources { margin-top: 56px; scroll-margin-top: 16px; }
.fees-sources-note { font-size: 13px; line-height: 1.7; color: var(--ice); max-width: 760px; margin: 0 0 22px; }
.fees-sources-note .star { color: var(--copper); }
.fees-sources-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 32px; }
@media (max-width: 960px) { .fees-sources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .fees-sources-grid { grid-template-columns: 1fr; } }
.src-item { border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.src-ev { color: var(--off); font-size: 13.5px; margin-bottom: 6px; }
.src-ev .src-c { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--ice); opacity: .7; margin-left: 6px; }
.src-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.6; }
.src-row .src-y { color: var(--ice); opacity: .7; letter-spacing: .08em; }
.src-row .src-l { overflow-wrap: anywhere; }
.src-row a { color: var(--copper-soft); border-bottom: 1px solid var(--line2); }
.src-row a:hover { color: var(--off); border-bottom-color: var(--copper-soft); }
.src-row .na { color: var(--ice); opacity: .45; }
.src-row .star { color: var(--copper); margin-left: 4px; }
section.summit.fees-src-section { padding-top: 0; border-top: 0; }
.fees-src-section .fees-sources { margin-top: 0; }

/* Klickbare Spaltenkoepfe: Klick sortiert, zweiter Klick dreht die Richtung */
.top10.fees-top th .th-sort {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
  border-bottom: 1px dotted var(--line2);
}
.top10.fees-top th .th-sort:hover { color: var(--copper-soft); border-bottom-color: var(--copper-soft); }
.top10.fees-top th .th-sort.active { color: var(--copper); border-bottom-color: var(--copper); }
.top10.fees-top th .th-sort .arr { margin-left: 3px; }
.top10.fees-top th .th-sort:focus-visible { outline: 2px solid var(--copper-soft); outline-offset: 2px; }
/* Tabellenkopf groesser und fett (Martin, 06.10.2026) */
/* Kopf in Archivo 900 statt DM Mono, damit er sich klar von den Werten abhebt
   (DM Mono ist nur bis 500 geladen und sah aus wie die Zahlen darunter). */
.top10.fees-top th { font-family: var(--grotesk); font-size: 14px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; color: var(--off); padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--copper-30); }
.top10.fees-top th .th-sort { font-family: var(--grotesk); font-weight: 900; border-bottom: 0; }
.top10.fees-top th .th-sort .arr { font-family: var(--mono); font-weight: 500; }
@media (max-width: 768px) { .top10.fees-top th { font-size: 12.5px; letter-spacing: .02em; } }

/* Range und + fees je eine Zeile, ohne Umbruch (07.10.2026) */
.fees-top td .sub.nowrap{white-space:nowrap}
/* Preis-Spalten klar trennen (07.10.2026): Abstand links, Range und + fees
   je eine Zeile, die Range bleibt in ihrer eigenen Spalte */
.top10.fees-top td.num, .top10.fees-top th.right { padding-left: 18px; }
.top10.fees-top td.num .sub.nowrap { overflow: hidden; text-overflow: ellipsis; }

/* KPI-Strip: drei Kacheln (07.10.2026) */
#fees-insights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#fees-insights .big .vs { font-family: var(--mono); font-weight: 400; font-size: .32em; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ice); margin: 0 .45em; vertical-align: .55em; }
@media (max-width: 960px) {
  #fees-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #fees-insights .insight:last-child { grid-column: 1 / -1; }
}

/* Intro: Bitte um Hilfe (07.10.2026) */
.subhead.fees-help { color: var(--nude); }
.subhead.fees-help a { color: var(--copper-soft); border-bottom: 1px solid var(--copper-30); }
.subhead.fees-help a:hover { color: var(--off); opacity: 1; }

/* Nur noch ein Panel unter der Tabelle (Euro je km nach Distanz, 07.10.2026) */
.fees .compare-row { grid-template-columns: minmax(0, 720px); }

.filter-bar--fees #fees-seg-dist button { padding-left: 6px; padding-right: 6px; }
