/* ==========================================================================
   CricVerse — explorer sections
   Players · Matchups · Records · Match centre · Teams & venues.

   Written against the tokens styles.css already defines, so the explorer and
   the Ask thread are visibly the same product: the same hairline rules, the
   same tabular figures, the same pitch-green accent, the same data ramp.
   Nothing here restyles an Ask selector.
   ========================================================================== */

/* --------------------------------------------------- view switching ----- */
/* Ask and the explorer share the shell; only one occupies `main` at a time. */
#explore { display: none; }

body[data-view]:not([data-view="ask"]) #explore { display: block; }
body[data-view]:not([data-view="ask"]) .scroll,
body[data-view]:not([data-view="ask"]) .composer-wrap,
body[data-view]:not([data-view="ask"]) .jump,
body[data-view]:not([data-view="ask"]) #modelChip,
body[data-view]:not([data-view="ask"]) #exportBtn { display: none !important; }
body[data-view="ask"] #explore { display: none; }

/* ---------------------------------------------------------- rail nav ---- */
.nav {
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 8px 10px; margin: 0 0 6px;
  border-bottom: 1px solid var(--line);
}
.nav-label {
  font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); padding: 4px 9px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; text-align: left; position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { width: 15px; height: 15px; flex: none; color: var(--ink-3); transition: color .15s var(--ease); }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item:hover svg { color: var(--accent); }
.nav-item[aria-current="true"] {
  background: var(--surface); color: var(--ink); font-weight: 500;
  box-shadow: var(--shadow-1);
}
.nav-item[aria-current="true"] svg { color: var(--accent); }
.nav-item[aria-current="true"]::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 3px 3px 0; background: var(--accent);
}

/* --------------------------------------------------------- workspace ---- */
#explore {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scroll-behavior: smooth;
}
.xp {
  max-width: 1180px; margin: 0 auto; padding: 20px 24px 72px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ------------------------------------------------------------ filters --- */
.xp-filters {
  position: sticky; top: 0; z-index: 8;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-1);
}
.xp-filters-row {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px;
}
.xp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.xp-field > span {
  font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.xp-field select, .xp-field input[type="text"], .xp-field input[type="number"] {
  height: 32px; padding: 0 9px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 400 12.5px/1 var(--mono); outline: none; min-width: 0;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.xp-field select { padding-right: 26px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.xp-field select:hover, .xp-field input:hover { border-color: var(--accent-line); }
.xp-field select:focus, .xp-field input:focus { border-color: var(--accent); }
.xp-field.grow { flex: 1; min-width: 150px; }
.xp-filters-more { padding: 0 13px 11px; display: none; }
.xp-filters[data-more="1"] .xp-filters-more { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  animation: rise .26s var(--ease-out) both; }

.xp-slice {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 8px 13px; border-top: 1px solid var(--line);
  font: 400 11px/1.5 var(--mono); color: var(--ink-3);
}
.xp-slice b { color: var(--accent); font-weight: 500; }
.xp-slice .spacer { flex: 1; }

/* year range: two thumbs over one track */
.xp-range { display: flex; flex-direction: column; gap: 5px; width: 186px; }
.xp-range-head { display: flex; align-items: baseline; justify-content: space-between; }
.xp-range-head span { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.xp-range-head b { font: 500 11.5px/1 var(--mono); color: var(--accent); }
.xp-range-track { position: relative; height: 32px; }
.xp-range-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 3px;
  border-radius: 3px; background: var(--line-2);
}
.xp-range-fill {
  position: absolute; top: 15px; height: 3px; border-radius: 3px; background: var(--accent);
  transition: left .12s var(--ease), right .12s var(--ease);
}
.xp-range-track input[type="range"] {
  position: absolute; left: 0; width: 100%; top: 5px; margin: 0; pointer-events: none;
  -webkit-appearance: none; appearance: none; background: none; height: 22px;
}
.xp-range-track input[type="range"]::-webkit-slider-thumb { pointer-events: auto; }
.xp-range-track input[type="range"]::-moz-range-thumb { pointer-events: auto; }
.xp-range-track input[type="range"]::-webkit-slider-runnable-track { background: none; }
.xp-range-track input[type="range"]::-moz-range-track { background: none; }

/* --------------------------------------------------------- page head ---- */
.xp-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.xp-head-text { flex: 1; min-width: 240px; }
.xp-title {
  font: 400 clamp(24px, 3.4vw, 33px)/1.1 var(--serif); letter-spacing: -.02em;
  text-wrap: balance;
}
.xp-title em { font-style: italic; color: var(--accent); }
.xp-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 5px; max-width: 62ch; line-height: 1.55; }

.xp-identity {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--accent-soft) 62%, var(--surface)) 0%, var(--surface) 62%);
  box-shadow: var(--shadow-1); animation: rise .38s var(--ease-out) both;
}
.xp-monogram {
  width: 50px; height: 50px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font: 500 17px/1 var(--mono); letter-spacing: .02em;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
.xp-identity-text { flex: 1; min-width: 0; }
.xp-identity-text h2 { font: 500 19px/1.2 var(--sans); letter-spacing: -.015em; }
.xp-identity-text p { font: 400 12px/1.5 var(--mono); color: var(--ink-2); margin-top: 3px; }
.xp-identity-text .alias { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.xp-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.xp-badge {
  font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px;
  border: 1px solid var(--accent-line); color: var(--accent); background: var(--accent-soft);
}

/* ---------------------------------------------------------------- tabs -- */
.xp-tabs {
  display: flex; gap: 2px; padding: 4px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2);
  overflow-x: auto; scrollbar-width: none;
}
.xp-tabs::-webkit-scrollbar { display: none; }
.xp-tab {
  padding: 8px 14px; border-radius: var(--r-sm); white-space: nowrap;
  font: 500 12.5px/1 var(--sans); color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.xp-tab:hover { color: var(--ink); background: var(--surface-3); }
.xp-tab[aria-selected="true"] {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
}
.xp-panel { display: flex; flex-direction: column; gap: 18px; animation: rise .3s var(--ease-out) both; }

/* ------------------------------------------------------------- layout --- */
.xp-grid { display: grid; gap: 16px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.xp-grid.wide-first { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.xp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 940px) { .xp-grid, .xp-grid.wide-first { grid-template-columns: minmax(0, 1fr); } }

.xp-card {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  overflow: hidden; min-width: 0;
}
.xp-card-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.xp-card-head h3 {
  font: 500 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2);
}
.xp-card-head .hint { margin-left: auto; font: 400 10.5px/1 var(--mono); color: var(--ink-3); }
.xp-card-body { padding: 13px; display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.xp-card-body > .dtable { border: 0; border-radius: 0; margin: -13px; width: calc(100% + 26px); }

.xp-section-title {
  font: 500 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 4px;
}

/* --------------------------------------------------------- controls ----- */
.xp-controls {
  display: flex; align-items: flex-end; gap: 11px; flex-wrap: wrap;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
}
.xp-segment {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface);
}
.xp-segment button {
  padding: 6px 11px; border-radius: 5px; font: 500 11.5px/1 var(--mono); color: var(--ink-2);
  white-space: nowrap; transition: background .16s var(--ease), color .16s var(--ease);
}
.xp-segment button:hover { color: var(--ink); }
.xp-segment button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.xp-slider { display: flex; flex-direction: column; gap: 4px; width: 168px; }
.xp-slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.xp-slider-head span { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.xp-slider-head b { font: 500 11.5px/1 var(--mono); color: var(--accent); }

/* -------------------------------------------------------- player pick -- */
.xp-pick { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 210px; flex: 1; }
.xp-pick > span {
  font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.xp-pick-field {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.xp-pick-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.xp-pick-field svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.xp-pick-field input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: 400 13.5px/1 var(--sans); color: var(--ink);
}
.xp-pick-field input::placeholder { color: var(--ink-3); }
.xp-pick-clear { color: var(--ink-3); display: grid; place-items: center; width: 20px; height: 20px;
  border-radius: 5px; flex: none; }
.xp-pick-clear:hover { color: var(--bad); background: var(--surface-2); }
.xp-pick-clear svg { width: 11px; height: 11px; }

.xp-pick-menu {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 5px; z-index: 20;
  max-height: 320px; overflow-y: auto; padding: 5px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--ground);
  box-shadow: var(--shadow-2); animation: pal .18s var(--ease-out) both;
}
.xp-pick-menu[hidden] { display: none; }
.xp-pick-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px;
  border-radius: var(--r-sm); text-align: left; color: var(--ink-2);
  transition: background .13s var(--ease), color .13s var(--ease);
}
.xp-pick-opt:hover, .xp-pick-opt[aria-selected="true"] { background: var(--surface); color: var(--ink); }
.xp-pick-opt .n { font: 500 13px/1.3 var(--sans); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-pick-opt .m { font: 400 10.5px/1.3 var(--mono); color: var(--ink-3); white-space: nowrap; }
.xp-pick-empty { padding: 10px; font: 400 12px/1 var(--mono); color: var(--ink-3); }

/* --------------------------------------------------------- match list -- */
.xp-matches { display: flex; flex-direction: column; gap: 6px; max-height: 470px; overflow-y: auto; padding-right: 3px; }
.xp-match {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  text-align: left; color: var(--ink-2);
  transition: border-color .16s var(--ease), transform .16s var(--ease), background .16s var(--ease);
}
.xp-match:hover { border-color: var(--accent-line); transform: translateX(2px); }
.xp-match[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.xp-match-date {
  flex: none; width: 62px; font: 500 10.5px/1.4 var(--mono); color: var(--ink-3); text-align: center;
  border-right: 1px solid var(--line); padding-right: 10px;
}
.xp-match-date b { display: block; color: var(--accent); font-size: 13px; font-weight: 500; }
.xp-match-main { flex: 1; min-width: 0; }
.xp-match-teams { font: 500 13px/1.35 var(--sans); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-match-meta { font: 400 10.5px/1.4 var(--mono); color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-match-res {
  flex: none; width: 116px; min-width: 0;
  font: 400 10.5px/1.4 var(--mono); color: var(--ink-2); text-align: right;
}
.xp-match-res b, .xp-match-res span {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xp-match-res b { color: var(--good); font-weight: 500; }

/* -------------------------------------------------------- innings card -- */
.xp-innings { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.xp-innings + .xp-innings { margin-top: 14px; }
.xp-innings-head {
  display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.xp-innings-head h4 { font: 500 15px/1.2 var(--sans); letter-spacing: -.01em; }
.xp-innings-head .score { font: 500 17px/1 var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.xp-innings-head .meta { font: 400 11.5px/1 var(--mono); color: var(--ink-3); margin-left: auto; }
.xp-innings-body { padding: 0; }
.xp-innings-body .dtable { border: 0; border-radius: 0; }
.xp-innings-body .dtable + .dtable { border-top: 1px solid var(--line); }

/* --------------------------------------------------------- chart shell -- */
.cv-chart {
  margin: 0; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden; min-width: 0;
}
.xp-card-body > .cv-chart { border: 0; border-radius: 0; margin: -13px -13px 0; width: calc(100% + 26px); }
.cv-chart-head {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.cv-chart-title { font: 500 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.cv-chart-note { margin-left: auto; font: 400 10.5px/1.3 var(--mono); color: var(--ink-3); text-align: right; }
.cv-chart-body { padding: 11px 13px 13px; }
.cv-chart-plot { min-width: 0; }
/* The viewBox is set to this box's own pixel width, so one unit is one pixel and
   labels keep their intended size in a narrow column and a full-width row alike. */
.cv-chart-body svg { width: 100%; display: block; overflow: visible; }
.cv-empty { font: 400 12.5px/1.6 var(--mono); color: var(--ink-3); padding: 18px 2px; text-align: center; }

/* styles.css paints every <svg> descendant like an icon — fill:none and an
   inherited stroke:currentColor. That is right for the icon set and wrong for a
   chart: inherited stroke drew a hairline outline around every bar and label.
   Chart marks carry their own paint, so opt out of the icon defaults here; the
   classes below then say what each mark actually wants. */
.cv-chart svg rect,
.cv-chart svg circle,
.cv-chart svg polygon,
.cv-chart svg path,
.cv-chart svg line,
.cv-chart svg text { stroke: none; stroke-width: 1; }

/* chart marks — colour arrives as a CSS var from the JS, never a literal */
.cv-chart svg text { font: 400 11px var(--mono); fill: var(--ink-2); }
.cv-chart .cv-lab { fill: var(--ink-2); font-size: 11px; }
.cv-chart .cv-val { fill: var(--ink); font-weight: 500; font-size: 11px; font-variant-numeric: tabular-nums; }
.cv-chart .cv-axis { fill: var(--ink-3); font-size: 10px; }
.cv-chart .cv-axis.cv-dim { fill: color-mix(in srgb, var(--ink-3) 70%, transparent); font-size: 9.5px; }
.cv-chart .cv-axis-title { fill: var(--ink-3); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.cv-chart .cv-donut-num { fill: var(--ink); font: 500 22px var(--mono); font-variant-numeric: tabular-nums; }
.cv-chart .cv-seg-num { fill: #fff; font: 500 12px var(--mono); }
.cv-chart .cv-track { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.cv-chart .cv-grid { stroke: var(--line); stroke-width: 1; fill: none; }
.cv-chart .cv-grid-shape { stroke: var(--line); stroke-width: 1; fill: none; }
.cv-chart .cv-hit { fill: transparent; }
.cv-chart .cv-row:hover .cv-hit { fill: color-mix(in srgb, var(--ink) 4%, transparent); }
.cv-chart .cv-line { fill: none; stroke: var(--c, var(--d1)); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.cv-chart .cv-key { stroke: var(--c, var(--ink-3)); stroke-width: 2.2; stroke-linecap: round; }
.cv-chart .cv-area { opacity: .1; }
.cv-chart .cv-whisker { stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round;
  transform-box: fill-box; transform-origin: center; }
.cv-chart .cv-median { stroke: var(--ground); stroke-width: 2; }
.cv-chart .cv-radar { fill: var(--c, var(--d1)); fill-opacity: .13;
  stroke: var(--c, var(--d1)); stroke-width: 2; stroke-linejoin: round; }
.cv-chart .cv-pt { stroke: var(--surface); stroke-width: 1.4; }
.cv-chart .cv-wkt { stroke: var(--surface); stroke-width: 1.4; }
.cv-chart [data-tip] { cursor: crosshair; }
.cv-chart .cv-arc:hover, .cv-chart .cv-pt:hover, .cv-chart .cv-seg:hover { filter: brightness(1.14); }

/* motion: every mark grows from its own edge, so nothing slides in from 0,0 */
.cv-chart .cv-bar { transform-box: fill-box; transform-origin: left center;
  animation: cv-grow-x .5s var(--ease-out) both; }
.cv-chart .cv-bar-v { transform-origin: center bottom; animation: cv-grow-y .5s var(--ease-out) both; }
.cv-chart .cv-seg { transform-box: fill-box; transform-origin: left center;
  animation: cv-grow-x .55s var(--ease-out) both; }
.cv-chart .cv-whisker { animation: cv-grow-y .5s var(--ease-out) both; }
.cv-chart .cv-dot { animation: cv-pop .4s var(--ease-out) both; transform-box: fill-box; transform-origin: center; }
.cv-chart .cv-arc { animation: cv-fade .5s var(--ease-out) both; }
.cv-chart .cv-radar { animation: cv-bloom .55s var(--ease-out) both; transform-box: fill-box; transform-origin: center; }
.cv-chart .cv-line-draw { stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: cv-draw 1.15s var(--ease-out) forwards; }
@keyframes cv-grow-x { from { transform: scaleX(0); } }
@keyframes cv-grow-y { from { transform: scaleY(0); } }
@keyframes cv-pop { from { opacity: 0; transform: scale(.3); } }
@keyframes cv-fade { from { opacity: 0; } }
@keyframes cv-bloom { from { opacity: 0; transform: scale(.86); } }
@keyframes cv-draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------ tooltip --- */
.cv-tip {
  position: fixed; top: 0; left: 0; z-index: 70; pointer-events: none; max-width: 300px;
  padding: 8px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--ground); box-shadow: var(--shadow-2);
  font: 400 11.5px/1.5 var(--mono); color: var(--ink-2);
}
.cv-tip b { display: block; color: var(--ink); font-weight: 500; font-size: 12px; margin-bottom: 2px; }
.cv-tip span { display: block; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- tiles --- */
.cv-tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.cv-tiles.dense { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.cv-tile {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0;
  animation: rise .36s var(--ease-out) both;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.cv-tile:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.cv-tile-label {
  font: 500 9.5px/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}
.cv-tile-value {
  font: 500 19px/1.2 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Composite values ("3,597 / 632", "Sikandar Raza") step down and wrap rather
   than clip — a truncated name is worse than a second line. */
.cv-tile-value.long { font-size: 15.5px; white-space: normal; line-height: 1.3; }
.cv-tile-value.longer { font-size: 13px; white-space: normal; line-height: 1.35; }
.cv-tile-sub { font: 400 10px/1.35 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ minibar --- */
.cv-minibar { display: inline-flex; width: 66px; height: 7px; border-radius: 4px; overflow: hidden;
  background: var(--surface-3); vertical-align: -1px; }
.cv-minibar i { display: block; height: 100%; }

/* ------------------------------------------------------------- states --- */
.xp-note {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.xp-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--ink-3); }
.xp-note.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.xp-note.warn svg { color: var(--warn); }
.xp-note.err { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.xp-note.err svg { color: var(--bad); }
.xp-note code { font: 500 .88em var(--mono); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 5px; padding: .1em .38em; }

/* Skeletons hold the layout while a slice loads, so nothing jumps on arrival. */
.xp-loading { display: flex; flex-direction: column; gap: 12px; }
.sk { border-radius: var(--r-md); background: var(--surface-2); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 6%, transparent), transparent);
  animation: sk-sweep 1.25s var(--ease) infinite;
}
@keyframes sk-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-tiles { height: 66px; }
.sk-chart { height: 232px; }
.sk-row { height: 34px; }

.xp-busy { position: relative; }
.xp-busy::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ground) 52%, transparent);
  animation: fade .16s var(--ease) both;
}

/* A hairline progress line under the filter bar while a slice is refetching. */
.xp-progress { height: 2px; background: var(--line); overflow: hidden; border-radius: 0 0 var(--r-md) var(--r-md); }
.xp-progress[hidden] { display: none; }
.xp-progress i {
  display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--accent);
  animation: xp-slide 1.05s var(--ease) infinite;
}
@keyframes xp-slide {
  0% { transform: translateX(-100%); } 100% { transform: translateX(350%); }
}

/* -------------------------------------------------------- responsive ---- */
@media (max-width: 760px) {
  .xp { padding: 14px 14px 60px; gap: 15px; }
  /* Wrapped onto four rows the filter bar is a third of a phone screen, so it
     scrolls away with the page instead of pinning to the top. */
  .xp-filters { position: static; }
  .xp-filters-row { padding: 10px; gap: 8px; }
  .xp-field, .xp-field.grow { flex: 1 1 132px; min-width: 132px; }
  .xp-range { width: 100%; }
  .xp-identity { flex-wrap: wrap; }
  .cv-tiles { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
  .cv-tile-value { font-size: 16px; }
  .xp-match-res { display: none; }
}

/* --------------------------------------------------------- topbar swap -- */
/* Before explore.js runs, <body> carries no data-view, so Ask's title stands
   and the explorer's stays out of the way — no flash on first paint. */
#xpTitle { display: none; }
body[data-view]:not([data-view="ask"]) #xpTitle { display: block; }
body[data-view]:not([data-view="ask"]) #askTitle { display: none; }
