/* Min skifart (app/skispeed.php, assets/js/skispeed.js; docs/peak/skifart.md, PB39) – the piste map's row and panel, the
   group under Oversigt, /skifart and the demo. PEAK only: c2.css' --pk-* tokens, one accent (the average), the display
   face only on the gauge's big number, text never under 14 px, motion only without reduced motion. Born in the
   prototype (docs/peak/skifart-koncepter/src/proto.css). */

.sks-tag { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 10px; border-radius: var(--pk-r-pill); background: var(--pk-surface-2);
  color: var(--pk-ink-2); font: 600 var(--pk-fs-1) / 1.5 var(--pk-f-body); letter-spacing: 0; }
.sks-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: var(--pk-fs-2) !important; }

/* The numbers as text: the average first and the only accent, the highest and the lowest after it */
.sks-line { font-variant-numeric: tabular-nums; color: var(--pk-ink-2); }
.sks-line .is-avg { color: var(--pk-p-ink); font-weight: 800; }
.sks-line .is-max { color: var(--pk-ink); font-weight: 700; }

/* The switch: today / whole trip (and on /skifart the days) – quiet pills, so the number stays the loudest; PEAK's bubble
   glides between them (peak.js BUBBLE_ROWS) */
.sks-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sks-tabs button { min-height: 44px; padding: 0 12px; border: 1px solid var(--pk-line); border-radius: var(--pk-r-pill); background: transparent; color: var(--pk-ink-2);
  font: inherit; font-weight: 600; cursor: pointer; }
.sks-tabs button[aria-selected="true"] { background: var(--pk-surface-3); border-color: var(--pk-edge); color: var(--pk-ink); }
.sks-tabs button:disabled { opacity: 0.45; cursor: default; }
.sks-tabs-days { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.sks-tabs-days::-webkit-scrollbar { display: none; }
.sks-tabs-days button { flex: none; display: grid; justify-items: center; min-width: 84px; padding: 4px 12px; scroll-snap-align: start; line-height: 1.2; }
.sks-tabs-days button small { font-weight: 500; font-size: var(--pk-fs-1); }

/* The gauge: a half arc 0–100 km/t; the average fills it, two ticks (with a halo) mark the lowest and the highest */
.sks-gauge { position: relative; display: block; }
.sks-gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.sks-gauge path { fill: none; stroke-linecap: round; }
.sks-track { stroke: var(--pk-surface-2); stroke-width: 14; }
.sks-fill { stroke: var(--pk-p-solid); stroke-width: 14; }
.sks-gauge.is-empty .sks-fill { stroke-width: 0; }
.sks-tick { transform-box: view-box; transform-origin: 100px 100px; }
.sks-tick line { stroke-width: 4; stroke-linecap: round; }
.sks-tick .sks-tick-halo { stroke: var(--pk-surface); stroke-width: 9; }
.sks-tick-max line:not(.sks-tick-halo) { stroke: var(--pk-ink); }
.sks-tick-min line:not(.sks-tick-halo) { stroke: var(--pk-ink-2); }
.sks-gauge-l { width: min(100%, 220px); margin: 4px auto 0; }
.sks-gauge-num { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: 4px; }
.sks-gauge-num b { font: 800 2.75rem / 0.9 var(--pk-f-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sks-gauge-num small { color: var(--pk-ink-2); font-size: var(--pk-fs-1); }
.sks-gauge.is-empty .sks-gauge-num b { color: var(--pk-ink-3); }
.sks-gauge-s { flex: none; width: 44px; }
.sks-gauge-s .sks-track, .sks-gauge-s .sks-fill { stroke-width: 22; }
/* On a grey ground (the row, the empty state) the arc's track steps up a shade, so the gauge still reads */
:is(.sks-strip, .sks-empty) .sks-track { stroke: var(--pk-surface-3); }

/* The block: the gauge with the average inside it, and one line under it – the lowest and the highest */
.sks-block { display: grid; gap: 8px; }
.sks-range { display: flex; justify-content: center; gap: 20px; margin: 0; color: var(--pk-ink-2); font-variant-numeric: tabular-nums; }
.sks-range b { font-size: var(--pk-fs-2); font-weight: 800; color: var(--pk-ink-2); }
.sks-range .sks-max b { color: var(--pk-ink); }
.sks-partial, .sks-none { margin: 0; color: var(--pk-ink-2); font-size: var(--pk-fs-1); text-align: center; }

/* The map: one row in the resting sheet; it folds the sheet out to the panel (the row becomes its head) */
.sks-strip { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 10px 6px 8px; border: 0; border-radius: var(--pk-r-2);
  background: var(--pk-surface-2); color: var(--pk-ink); font: inherit; text-align: left; cursor: pointer; }
.sks-strip-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sks-strip-t > span { color: var(--pk-ink-2); font-size: var(--pk-fs-1); overflow-wrap: anywhere; }
.sks-strip-t .sks-tag { padding: 0 8px; }
.sks-strip > .icon, .sks-member > .icon { flex: none; width: 20px; height: 20px; color: var(--pk-ink-3); transform-origin: 50% 50%; }
.sks-strip[aria-expanded="true"] > .icon, .sks-member[aria-expanded="true"] > .icon { transform: rotate(90deg); }
.sks-panel { display: grid; gap: 12px; }
.sks-strip.is-open { min-height: 48px; padding: 4px 8px 4px 4px; background: transparent; }
.sks-strip.is-open b { font-size: var(--pk-fs-2); }
.sks-more { display: inline-flex; align-items: center; gap: 4px; justify-self: start; min-height: 44px; padding: 0 4px; color: var(--pk-p-ink); font-weight: 600; text-decoration: none; }
.sks-more .icon { width: 18px; height: 18px; }

/* Nobody tracks yet – what real users see in phase 1 (never on the map) */
.sks-empty { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--pk-r-2); background: var(--pk-surface-2); }
.sks-empty p { display: grid; gap: 2px; margin: 0; }
.sks-empty p span { color: var(--pk-ink-2); font-size: var(--pk-fs-1); }
.sks-empty .sks-gauge-s { width: 52px; }

/* Waiting: the empty arc and two lines, pulsing slowly only when motion is welcome */
.sks-skel { display: grid; justify-items: center; gap: 10px; padding: 8px 0; }
.sks-skel-line { display: block; width: 60%; height: 12px; border-radius: var(--pk-r-1); background: var(--pk-surface-2); }
.sks-skel-line.is-short { width: 36%; }

/* The group: one line for the group, then a row per member who shares – no rank, no bars, no columns; me first, then by name */
.sks-card { display: grid; gap: 12px; padding: 16px 12px; border-radius: var(--pk-r-3); background: var(--pk-surface); }
.sks-group .sks-card, .sks-history, .sks-demo { max-width: 720px; }
.sks-group-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 0 4px; padding: 10px 12px; border-radius: var(--pk-r-2); background: var(--pk-surface-2); }
.sks-group-line > span:first-child { font-weight: 700; }
.sks-members { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sks-member { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 8px; border: 0; border-radius: var(--pk-r-2); background: transparent; color: var(--pk-ink);
  font: inherit; text-align: left; cursor: pointer; }
.sks-member .avatar { flex: none; }
.sks-member-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sks-member-t > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sks-member-t > b small { color: var(--pk-ink-3); font-weight: 600; font-size: var(--pk-fs-1); }
.sks-member-t .sks-line, .sks-member-t .sks-off { font-size: var(--pk-fs-1); }
.sks-member:not(:disabled):hover, .sks-member[aria-expanded="true"] { background: var(--pk-surface-2); }
.sks-member:disabled { cursor: default; }
.sks-off { display: inline-flex; align-items: center; gap: 8px; color: var(--pk-ink-3); font-size: var(--pk-fs-1); }
.sks-off-dot { width: 12px; height: 12px; border: 2px dashed currentColor; border-radius: 50%; }
.sks-member-more { padding: 2px 8px 10px 52px; }
.sks-more-line { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: var(--pk-fs-1); }
.sks-more-line > span:first-child { color: var(--pk-ink-2); font-weight: 600; }
.sks-others { margin: 0; color: var(--pk-ink-2); font-size: var(--pk-fs-1); }

/* /skifart: my trips, the days of one, each day on a line */
.sks-page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sks-trips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.sks-trips::-webkit-scrollbar { display: none; }
.sks-trips .pk2-chip { flex: none; white-space: nowrap; }
.sks-trips .pk2-chip small { color: inherit; opacity: 0.75; font-weight: 500; font-size: var(--pk-fs-1); }
.sks-days { display: grid; margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--pk-line); }
.sks-days li { border-bottom: 1px solid var(--pk-line); }
.sks-days button, .sks-days.is-small li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; width: 100%; min-height: 52px; padding: 6px 4px;
  border: 0; background: transparent; color: var(--pk-ink); font: inherit; text-align: left; cursor: pointer; }
.sks-days button:hover { background: var(--pk-surface-2); }
.sks-days button .sks-line { margin-left: auto; }
.sks-days-d small { color: var(--pk-ink-2); font-size: var(--pk-fs-1); }
.sks-days.is-small { margin: 0; border-top: 0; }
.sks-days.is-small li { min-height: 40px; font-size: var(--pk-fs-1); cursor: default; }

/* The profile's (still inert) consent */
.sks-consent { margin: 0; }
.sks-consent-what { margin: 4px 0 0; color: var(--pk-ink-2); font-size: var(--pk-fs-1); }
.sks-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--pk-ink); font: inherit; font-weight: 600; }
.sks-switch:disabled { opacity: 0.6; }
.sks-switch-track { position: relative; width: 44px; height: 26px; border-radius: var(--pk-r-pill); background: var(--pk-surface-3); }
.sks-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--pk-ink-2); }

/* Motion: the lists cross-fade, the arc and its ticks glide – only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  [data-sks-body] { transition: opacity 120ms var(--pk-ease-out), transform 120ms var(--pk-ease-out); }
  [data-sks-body].is-out { opacity: 0; transform: translateY(4px); }
  [data-sks-body].is-in { opacity: 0; transform: translateY(-4px); transition: none; }
  .sks-fill { transition: stroke-dasharray var(--pk-dur-sheet) var(--pk-ease-out); }
  .sks-tick { transition: transform var(--pk-dur-sheet) var(--pk-ease-out); }
  .sks-member > .icon, .sks-strip > .icon { transition: transform var(--pk-dur-quick) var(--pk-ease-out); }
  .sks-skel :is(.sks-gauge, .sks-skel-line) { animation: sks-pulse 1.4s ease-in-out infinite alternate; }
  @keyframes sks-pulse { from { opacity: 1; } to { opacity: 0.45; } }
}

@media (min-width: 960px) {
  .sks-gauge-l { width: 240px; }
}
