/* ═══════════════════════════════════════════════════════════════════════
   v9 Skills — World Skills Standings, v9-styled rebuild of pages/skills.php.
   Consumes the same /api/skillsStandings + /api/searchTeamSkills JSON
   endpoints; this file only carries presentation. Loaded alongside v2.css
   (shares --bg/--text/--red-hi/etc tokens defined there).
   ═══════════════════════════════════════════════════════════════════════ */

.v9-sk-wrap { max-width: 1200px; }

/* Page-local accent: legacy success-green for BEST / stop-time markers
   (per approved mock; the shared v9 palette has no green token). */
:root { --sk-green: #00e676; }

/* Flag sizing — the server only has the squared 1x1 SVG set, so JS emits
   flag-icon-squared + this class. Selector needs .flag-icon too: flags.css's
   .flag-icon.flag-icon-squared { width:1em } is 2 classes deep and would
   out-rank a lone .v9-sk-flag, shrinking the box back to font-size width. */
.flag-icon.v9-sk-flag { flex: none; width: 20px; height: 20px; vertical-align: middle; }

/* ── Grade tabs + race toggle: one full-width segmented strip ─────────── */
.v9-sk-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  margin-top: 32px;
  border: 1px solid var(--line-hard);
  background: var(--bg-card);
}
.v9-sk-tab {
  padding: 13px 20px;
  border: none;
  border-right: 1px solid var(--line-hard);
  background: none;
  color: var(--text-dim);
  font-family: var(--font-tech);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
}
.v9-sk-tab:hover { background: var(--bg-raise); color: var(--text); }
.v9-sk-tab.active { background: var(--red); color: #fff; }
.v9-sk-race-toggle {
  padding: 13px 22px;
  border: none;
  background: none;
  color: var(--red-hi);
  font-family: var(--font-tech);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.v9-sk-race-toggle:hover { background: var(--red-dim); }
@media (max-width: 700px) {
  .v9-sk-tabs { grid-template-columns: 1fr 1fr 1fr; }
  .v9-sk-tab:nth-of-type(3) { border-right: none; }
  .v9-sk-race-toggle { grid-column: 1 / -1; border-top: 1px solid var(--line-hard); }
}

/* ── Race embed wrapper ───────────────────────────────────────────────── */
.v9-sk-race-wrap {
  display: none;
  margin-top: 20px;
  border: 1px solid var(--line-hard);
  background: var(--bg-card);
  overflow: hidden;
}
.v9-sk-race-wrap.open { display: block; }

/* ── Stats dashboard ──────────────────────────────────────────────────── */
.v9-sk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 28px;
}
/* Inside the .v9-gated wrapper the purple gate border replaces this strip's
   own hairline (nested borders would double up). */
.v9-gated .v9-sk-stats { border: none; margin-top: 0; }
.v9-gated { margin-top: 28px; }
.v9-sk-stats .stat-cell { background: var(--bg-card); padding: 18px 22px 20px; }
.v9-sk-stats .lbl { font-family: var(--font-tech); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.v9-sk-stats .num { font-family: var(--font-body); font-size: clamp(38px, 4.5vw, 52px); font-weight: 700; color: var(--text); line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.v9-sk-stats .split { display: flex; gap: 18px; margin-top: 6px; font-family: var(--font-tech); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.v9-sk-stats .split .p b { color: var(--red-hi); }
.v9-sk-stats .split .d b { color: var(--text); }
.v9-sk-stats .stat-cell.wq .num { color: var(--purple-neon); }

/* ── Top score cards ──────────────────────────────────────────────────── */
.v9-sk-top2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 700px) { .v9-sk-top2 { grid-template-columns: 1fr; } }
.v9-sk-top-card { position: relative; isolation: isolate; border: 1px solid var(--line-hard); background: var(--bg-card); padding: 22px 24px 24px; text-align: center; }
/* Country watermark: the team's flag filling a diagonal slice of the card.
   z-index:-1 + isolation on the card slots it between the card background
   and the text. */
.v9-sk-top-card .flagslice {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* full-height upright flag anchored to the left edge, fading out toward
     the middle of the card - roughly half the flag visible, half gone */
  background-size: auto 100%;
  background-position: left center;
  background-repeat: no-repeat;
  opacity: 0.1;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 0%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 0%, transparent 100%);
  pointer-events: none;
}
.v9-sk-top-card.prog, .v9-sk-top-card.driver {
  border-top: 2px solid rgba(255,255,255,0.45);
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255,255,255,0.04), transparent 60%), var(--bg-card);
}
/* corner ticks echoing the accent bar */
.v9-sk-top-card::before, .v9-sk-top-card::after { content: ''; position: absolute; bottom: -1px; width: 9px; height: 9px; pointer-events: none; }
.v9-sk-top-card::before { left: -1px; border-left: 2px solid; border-bottom: 2px solid; }
.v9-sk-top-card::after { right: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.v9-sk-top-card.prog::before, .v9-sk-top-card.prog::after,
.v9-sk-top-card.driver::before, .v9-sk-top-card.driver::after { border-color: rgba(255,255,255,0.45); }
.v9-sk-top-card .lbl { font-family: var(--font-tech); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.v9-sk-top-card .num { font-family: var(--font-body); font-size: clamp(46px, 6vw, 64px); font-weight: 700; line-height: 1; margin-top: 12px; font-variant-numeric: tabular-nums; }
.v9-sk-top-card.prog .num, .v9-sk-top-card.driver .num { color: var(--text); }
.v9-sk-top-card .num .unit { font-size: 12px; font-weight: 400; color: var(--text-dim); letter-spacing: 0.16em; margin-left: 8px; }
.v9-sk-top-card .stop { margin-top: 8px; font-family: var(--font-tech); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.v9-sk-top-card .stop.none { color: var(--text-dim); }
.v9-sk-top-card .team { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); font-weight: 600; }
.v9-sk-top-card .team a { color: var(--red-hi); text-decoration: none; font-family: var(--font-tech); }
.v9-sk-top-card .team a:hover { text-decoration: underline; }
.v9-sk-top-card .loc { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.v9-sk-top-card .flag-icon.v9-sk-flag { width: 15px; height: 15px; }

/* ── Recently Active Teams panel ──────────────────────────────────────── */
.v9-sk-recent { margin-top: 32px; border: 1px solid var(--line-hard); background: var(--bg-card); }
.v9-sk-recent-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.v9-sk-recent-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red-hi); animation: v9skPulse 1.6s ease-in-out infinite; }
@keyframes v9skPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.v9-sk-recent-title { font-family: var(--font-tech); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); }
.v9-sk-recent-live { margin-left: auto; font-family: var(--font-tech); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red-hi); }

.v9-sk-rt-row {
  display: grid;
  grid-template-columns: 40px 84px minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 118px;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.v9-sk-rt-trend { justify-self: end; line-height: 0; }
.v9-sk-rt-row:last-child { border-bottom: none; }
.v9-sk-rt-row:hover { background: rgba(255,255,255,0.03); }
.v9-sk-rt-rank { font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--red-hi); }
.v9-sk-rt-score { display: inline-block; justify-self: start; font-family: var(--font-body); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--bg-raise); border: 1px solid var(--line-hard); padding: 4px 12px; }
.v9-sk-rt-score a { color: var(--text); text-decoration: none; font-size: 16px; }
.v9-sk-rt-score a:hover { color: var(--red-hi); }
.v9-sk-rt-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v9-sk-rt-id .flag-icon { flex: none; }
.v9-sk-rt-id .txt { min-width: 0; }
.v9-sk-rt-id .tn { flex: none; min-width: 64px; font-family: var(--font-body); font-weight: 700; color: var(--red-hi); text-decoration: none; }
.v9-sk-rt-id .tn:hover { text-decoration: underline; }
.v9-sk-rt-id .nm { display: block; color: var(--text); font-size: 13px; font-weight: 600; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v9-sk-rt-id .line2 { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.v9-sk-rt-skill { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v9-sk-rt-skill .k { font-family: var(--font-tech); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; }
.v9-sk-rt-skill.prog .k { color: var(--red-hi); }
.v9-sk-rt-skill.driver .k { color: var(--text); }
.v9-sk-rt-skill .v { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-family: var(--font-body); font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.v9-sk-rt-skill .v .stop { font-size: 10.5px; font-weight: 700; color: var(--sk-green); text-transform: uppercase; }
.v9-sk-rt-skill .v .max { font-size: 10.5px; font-weight: 400; color: var(--text-dim); }
.v9-sk-rt-skill .m { font-family: var(--font-body); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }

/* BEST marker + tag chips shared by recent rows + table cells */
.v9-sk-best { font-style: normal; font-family: var(--font-tech); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sk-green); }
.v9-sk-tag { display: inline-block; font-style: normal; font-family: var(--font-tech); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; line-height: 15px; padding: 0 6px; }
.v9-sk-tag.new { color: var(--red-hi); background: var(--red-dim); }
.v9-sk-tag.lg { color: var(--gold); border: 1px solid var(--gold); }

.v9-sk-view-all {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--red-hi);
  font-family: var(--font-tech);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.v9-sk-view-all:hover { background: var(--red-dim); }

@media (max-width: 900px) {
  .v9-sk-rt-row { grid-template-columns: 32px 70px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .v9-sk-rt-skill .m { display: none; }
  .v9-sk-rt-trend { display: none; }
}
@media (max-width: 640px) {
  .v9-sk-rt-row { grid-template-columns: 26px 56px minmax(0, 1fr) 48px 48px; gap: 10px; padding: 12px 14px; }
  .v9-sk-rt-id .nm, .v9-sk-rt-id .line2,
  .v9-sk-rt-skill .stop, .v9-sk-rt-skill .max, .v9-sk-rt-skill .k,
  .v9-sk-rt-row .v9-sk-tag, .v9-sk-rt-row .v9-sk-best { display: none; }
  .v9-sk-rt-score { padding: 3px 8px; }
  .v9-sk-rt-score a { font-size: 14px; }
  .v9-sk-rt-id .tn { min-width: 0; }
  .v9-sk-rt-skill .v { font-size: 14px; }
  /* labels are hidden at this width - color carries the prog/driver cue */
  .v9-sk-rt-skill.prog .v { color: var(--red-hi); }
}

/* ── Filter bar ───────────────────────────────────────────────────────── */
.v9-sk-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 32px;
  padding: 18px 20px;
  border: 1px solid var(--line-hard);
  background: var(--bg-card);
}
.v9-sk-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.v9-sk-filters-main { row-gap: 10px; }
.v9-sk-filters-selects { display: flex; flex-wrap: wrap; gap: 10px; }

/* All controls in the bar share one height/rhythm so the row reads as a
   single aligned instrument panel instead of floating baselines. */
.v9-sk-filters input[type="text"],
.v9-sk-filters select,
.v9-sk-btn {
  height: 38px;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 13px;
}
.v9-sk-filters input[type="text"],
.v9-sk-filters select {
  background: var(--bg);
  border: 1px solid var(--line-hard);
  color: var(--text);
  padding: 0 12px;
}
.v9-sk-filters input[type="text"]:focus,
.v9-sk-filters select:focus {
  outline: none;
  border-color: var(--red-hi);
}
.v9-sk-search { flex: 1 1 220px; min-width: 160px; }
.v9-sk-filters-selects select { flex: 1 1 auto; min-width: 0; }

.v9-sk-filters-secondary { justify-content: space-between; }
.v9-sk-filters-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}
.v9-sk-filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.v9-sk-btn {
  padding: 0 16px;
  border: 1px solid var(--line-hard);
  background: none;
  color: var(--text-dim);
  font-family: var(--font-tech);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.v9-sk-btn:hover { border-color: var(--red-hi); color: var(--red-hi); }
.v9-sk-btn.primary { border-color: var(--red); background: var(--red); color: #fff; }

@media (max-width: 860px) {
  .v9-sk-filters-selects { flex-basis: 100%; }
  .v9-sk-filters-selects select { flex: 1 1 140px; }
}
@media (max-width: 600px) {
  .v9-sk-filters-secondary { flex-direction: column; align-items: stretch; }
  .v9-sk-filters-actions {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .v9-sk-filters-actions .v9-sk-btn { flex: 1 1 auto; }
}

/* ── Reusable custom checkbox (dark/red aesthetic; not skills-specific) ── */
.v9-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.v9-checkbox:hover { color: var(--text); }
.v9-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line-hard);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.v9-checkbox:hover input[type="checkbox"] { border-color: var(--red-hi); }
.v9-checkbox input[type="checkbox"]:checked {
  background: var(--red);
  border-color: var(--red);
}
.v9-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.v9-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--red-hi);
  outline-offset: 2px;
}

/* ── Active filter chips ──────────────────────────────────────────────── */
.v9-sk-active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v9-sk-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--red-hi);
  background: var(--red-dim);
  color: var(--red-hi);
  font-family: var(--font-tech);
  font-size: 11px;
}
.v9-sk-active-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; }

/* ── Ranking table ─────────────────────────────────────────────────────── */
.v9-sk-table-wrap { position: relative; margin-top: 20px; overflow-x: auto; border: 1px solid var(--line-hard); }
table.v9-sk-table { width: 100%; min-width: 820px; border-collapse: collapse; background: var(--bg-card); }
table.v9-sk-table th {
  font-family: var(--font-tech);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--line-hard);
  background: var(--bg-raise);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.v9-sk-table th:hover { color: var(--red-hi); }
table.v9-sk-table th.sorted { color: var(--red-hi); }
/* Sticky column header under the fixed navbar. Needs the wrap's overflow-x
   to be visible (an auto-overflow ancestor traps position:sticky), which is
   safe at >=901px where the 820px-min table fits without side-scrolling. */
@media (min-width: 901px) {
  .v9-sk-table-wrap { overflow-x: visible; }
  table.v9-sk-table thead th {
    position: sticky;
    top: var(--nav-h);
    z-index: 5;
    /* border-collapse borders detach while stuck - shadow stands in */
    box-shadow: 0 2px 0 var(--line-hard);
  }
}
table.v9-sk-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text-dim); vertical-align: middle; }
table.v9-sk-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
table.v9-sk-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
table.v9-sk-table tr.bookmarked td { background: rgba(224,170,62,0.06); border-left: 2px solid var(--gold); }
table.v9-sk-table tr.fresh td:first-child { box-shadow: inset 2px 0 0 var(--red); }
.v9-sk-rank { font-family: var(--font-body); font-weight: 700; }
.v9-sk-rank.top10 { color: var(--red-hi); }
.v9-sk-rank.top50 { color: var(--gold); }
.v9-sk-score { display: inline-block; font-family: var(--font-body); font-weight: 700; color: var(--text); font-size: 15px; background: var(--bg-raise); border: 1px solid var(--line-hard); padding: 4px 12px; font-variant-numeric: tabular-nums; }
.v9-sk-score a { color: inherit; text-decoration: none; }
.v9-sk-score a:hover { text-decoration: underline; }
.v9-sk-tie { display: block; font-family: var(--font-body); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.v9-sk-team-num { font-weight: 700; color: var(--red-hi); text-decoration: none; }
.v9-sk-team-num:hover { text-decoration: underline; }
.v9-sk-wq { margin-left: 5px; cursor: help; }
.v9-sk-namecell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v9-sk-team-name { color: var(--text); font-weight: 600; text-transform: uppercase; }
.v9-sk-loc { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.v9-sk-skillcell { font-family: var(--font-body); }
.v9-sk-skillcell .l1 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.v9-sk-skillcell .val { font-size: 15px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.v9-sk-skillcell .val.best { color: var(--text); }
.v9-sk-skillcell .stop { font-size: 10.5px; font-weight: 700; color: var(--sk-green); text-transform: uppercase; }
.v9-sk-skillcell .max { font-size: 10.5px; color: var(--text-dim); }
.v9-sk-skillcell .l2 { display: block; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.v9-sk-skillcell .l2.lg { color: var(--gold); }
.v9-sk-skillcell.empty { font-size: 11px; font-style: italic; text-transform: uppercase; color: var(--text-dim); }
/* Trend sparkline */
.v9-sk-trend { display: inline-block; vertical-align: middle; overflow: visible; }
.v9-sk-trend .l { fill: none; stroke: url(#skTrendLine); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v9-sk-trend .a { fill: url(#skTrendFill); stroke: none; }
.v9-sk-trend .p { fill: var(--red-hi); filter: drop-shadow(0 0 3px rgba(255, 42, 51, 0.8)); }
/* dark ring punches the node out of the same-color line */
.v9-sk-trend .d { fill: var(--red-hi); stroke: var(--bg-card); stroke-width: 1.5; }
.v9-sk-trend-none { color: var(--text-dim); }

.v9-sk-actions { display: flex; gap: 8px; }
.v9-sk-actions button { background: none; border: 1px solid var(--line-hard); color: var(--text-dim); width: 28px; height: 28px; cursor: pointer; font-size: 13px; }
.v9-sk-actions button:hover { border-color: var(--red-hi); color: var(--red-hi); }
.v9-sk-actions button.on { border-color: var(--gold); color: var(--gold); }

/* ── Mobile card collapse ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  table.v9-sk-table, table.v9-sk-table tbody, table.v9-sk-table tr, table.v9-sk-table td { display: block; width: 100%; min-width: 0; }
  table.v9-sk-table thead { display: none; }
  table.v9-sk-table tr { border: 1px solid var(--line-hard); margin-bottom: 10px; padding: 12px; }
  table.v9-sk-table td { border: none; padding: 4px 0; }
  table.v9-sk-table td::before { content: attr(data-label); display: inline-block; width: 90px; font-family: var(--font-tech); font-size: 10px; color: var(--text-dim); text-transform: uppercase; vertical-align: top; }
  .v9-sk-skillcell { display: inline-block; vertical-align: top; }
  /* .v9-sk-namecell and .v9-sk-actions are `display: flex` (a block-level
     box), so - unlike every other cell here - they dropped to their own
     line below the data-label prefix instead of sitting beside it, roughly
     doubling those rows' height and making the label/value pairing look
     inconsistent from field to field. inline-flex keeps the same flex
     layout but lets it sit inline like the rest. */
  .v9-sk-namecell, .v9-sk-actions { display: inline-flex; vertical-align: top; max-width: calc(100% - 96px); }
}

/* ── Pagination ────────────────────────────────────────────────────────── */
.v9-sk-pagination { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.v9-sk-page-btn {
  padding: 7px 13px;
  border: 1px solid var(--line-hard);
  background: none;
  color: var(--text-dim);
  font-family: var(--font-tech);
  font-size: 12px;
  cursor: pointer;
}
.v9-sk-page-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.v9-sk-page-btn:disabled { opacity: 0.35; cursor: default; }
.v9-sk-page-info { margin-left: auto; color: var(--text-dim); font-size: 12px; font-family: var(--font-tech); }

/* ── Comparison bar + modal ───────────────────────────────────────────── */
.v9-sk-cmp-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  max-width: calc(100vw - 24px);
  padding: 12px 18px;
  background: var(--bg-raise);
  border: 1px solid var(--line-hard);
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
  z-index: 80;
}
.v9-sk-cmp-bar.show { display: flex; }
.v9-sk-cmp-chip { padding: 5px 10px; border: 1px solid var(--line-hard); font-family: var(--font-tech); font-size: 12px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.v9-sk-cmp-chip button { background: none; border: none; color: var(--text-dim); cursor: pointer; }
.v9-sk-cmp-count { font-family: var(--font-tech); font-size: 12px; color: var(--text-dim); }
.v9-sk-cmp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 90; display: none; }
.v9-sk-cmp-overlay.open { display: block; }
.v9-sk-cmp-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(960px, 92vw);
  max-height: 88vh;
  z-index: 91;
  background: var(--bg-card);
  border: 1px solid var(--line-hard);
  overflow-y: auto;
  padding: 28px clamp(18px,3vw,36px) 32px;
  display: none;
}
.v9-sk-cmp-panel.open { display: block; }
.v9-sk-cmp-close { position: absolute; top: 18px; right: 18px; background: none; border: none; color: var(--text-dim); font-size: 26px; cursor: pointer; }

/* Comparison matrix: metrics as rows, teams as columns */
.v9-sk-cmp-grid { margin-top: 24px; overflow-x: auto; }
.v9-sk-cmp-table { width: 100%; min-width: 460px; border-collapse: collapse; }
.v9-sk-cmp-table th, .v9-sk-cmp-table td { border: 1px solid var(--line); padding: 12px 16px; text-align: left; }
.v9-sk-cmp-table thead th { background: var(--bg-raise); vertical-align: top; }
.v9-sk-cmp-table thead th.metric { background: none; border-top: none; border-left: none; }
.v9-sk-cmp-table .tnum { font-family: var(--font-body); font-size: 17px; font-weight: 700; color: var(--red-hi); }
.v9-sk-cmp-table .tname { font-size: 12px; font-weight: 400; color: var(--text); margin-top: 2px; }
.v9-sk-cmp-table td { font-family: var(--font-body); font-size: 15px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.v9-sk-cmp-table td.metric { font-family: var(--font-tech); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; width: 1%; }
.v9-sk-cmp-table td.txt { font-family: var(--font-body); font-size: 12.5px; }
.v9-sk-cmp-table .v9-sk-flag { margin-right: 6px; }
.v9-sk-cmp-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.v9-sk-cmp-table td.best { color: var(--red-hi); font-weight: 700; background: rgba(225,6,0,0.05); }
.v9-sk-cmp-table tbody tr:hover td.best { background: rgba(225,6,0,0.09); }

/* ── WQ tooltip ────────────────────────────────────────────────────────── */
.v9-sk-wq-tip {
  position: fixed;
  z-index: 95;
  max-width: 240px;
  padding: 10px 12px;
  background: var(--bg-raise);
  border: 1px solid var(--line-hard);
  border-top: 2px solid var(--purple-neon);
  font-size: 12px;
  color: var(--text-dim);
  display: none;
  pointer-events: none;
}
.v9-sk-wq-tip.show { display: block; }

.v9-sk-empty { padding: 40px; text-align: center; color: var(--text-dim); font-family: var(--font-tech); }
