/* pv-widgets.v1.css: the smaller Design System v2 components kept from the 2026-10-04 review: data health,
   dual range, paste a list, version picker, side panel, modal, Show SQL and dev mode, percentile track,
   score ladder, stepper, the hover card (D10), the map card and the distribution chart (DS 2.4). Each block names the app it came from. Load after pv-common.v1.css:
     <link rel="stylesheet" href="/play/_static/shared/pv-widgets.v1.css"> */

/* ---------- dual range slider (op-surg-provisions, stoploss-explorer RangeFilter) ---------- */
.pv-range { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.pv-range-track { position: relative; height: 24px; }
.pv-range-track .rail { position: absolute; left: 0; right: 0; top: 10px; height: 4px; background: var(--pv-stroke-dark); border-radius: 2px; }
.pv-range-track .fill { position: absolute; top: 10px; height: 4px; background: var(--pv-primary); border-radius: 2px; }
.pv-range-track input[type=range] { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 24px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.pv-range-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--pv-card); border: 2px solid var(--pv-primary); cursor: grab; box-shadow: 0 1px 3px rgba(2, 54, 61, 0.2); }
.pv-range-track input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--pv-card); border: 2px solid var(--pv-primary); cursor: grab; }
.pv-range-track input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--pv-primary); outline-offset: 2px; }
.pv-range-vals { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--pv-text-2); font-variant-numeric: tabular-nums; }
.pv-range-vals b { color: var(--pv-text); font-weight: 600; }
.pv-range-host.on .pv-range-vals b { color: var(--pv-primary); }   /* PVFilters active state */

/* ---------- Show SQL (maternity-episode-pricing drawer, clear-rates-accuracy dev mode) ---------- */
details.pv-sql { border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); background: var(--pv-card); }
details.pv-sql summary { cursor: pointer; padding: 8px 12px; font-size: 0.8rem; font-weight: 500; color: var(--pv-primary); display: flex; align-items: center; gap: 10px; }
details.pv-sql summary .pv-btn { margin-left: auto; }
details.pv-sql pre { margin: 0; padding: 10px 12px 12px; border-top: 1px solid var(--pv-stroke); background: var(--pv-surface); font-family: var(--pv-mono); font-size: 0.74rem; line-height: 1.5; white-space: pre-wrap; color: var(--pv-text); border-radius: 0 0 var(--pv-radius-card) var(--pv-radius-card); }
details.pv-sql .kw { color: var(--pv-primary); font-weight: 600; } details.pv-sql .tbl { color: var(--pv-primary-pressed); } details.pv-sql .str { color: var(--pv-warning); } details.pv-sql .cmt { color: var(--pv-text-3); }

/* ---------- side panel (mrf-source-selection-explorer, clear-rates-v2-compare) ---------- */
.pv-side-panel { background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); padding: 14px 16px; position: sticky; top: 12px; min-height: 160px; display: flex; flex-direction: column; gap: 10px; }
.pv-side-panel .pv-empty { border: none; padding: 26px 10px; background: transparent; }
.pv-side-panel-head h3 { font-size: 0.95rem; font-weight: 600; } .pv-side-panel-head .sub { font-size: 0.78rem; color: var(--pv-text-2); }
.pv-side-panel-body { font-size: 0.84rem; display: flex; flex-direction: column; gap: 10px; }
/* DS 2.20: a list view with a detail view in a side panel (open: 'panel:<view>'): the list and the panel side by side,
   stacked under 900px. The panel body holds the detail view's own cards, so they sit flat inside it. */
.pv-panel-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; }
.pv-panel-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 900px) { .pv-panel-layout { grid-template-columns: minmax(0, 1fr); } }
.pv-side-panel .pv-side-panel-body > .pv-view-panel .pv-card { border: none; box-shadow: none; padding: 0; background: transparent; }
.pv-table-tools .pv-detail-stepper { margin-left: auto; }
.pv-detail-stepper[hidden] { display: none; }

/* ---------- modal (cld-pg-identifiers, consumer-providers, network-provider-check-at-scale) ---------- */
.pv-modal-scrim { position: fixed; inset: 0; background: rgba(18, 19, 19, 0.36); z-index: 320; display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow: auto; }
.pv-modal-scrim.open { display: flex; }
.pv-modal { background: var(--pv-card); border-radius: var(--pv-radius-card); box-shadow: var(--pv-shadow-pop); width: min(var(--pv-modal-width, 520px), 100%); display: flex; flex-direction: column; }
.pv-modal-head { padding: 14px 18px; border-bottom: 1px solid var(--pv-stroke); display: flex; align-items: flex-start; gap: 10px; }
.pv-modal-head h2 { font-size: 1rem; font-weight: 600; } .pv-modal-head .sub { font-size: 0.78rem; color: var(--pv-text-2); }
.pv-modal-body { padding: 14px 18px; font-size: 0.86rem; display: flex; flex-direction: column; gap: 10px; }
.pv-modal-foot { padding: 12px 18px; border-top: 1px solid var(--pv-stroke); display: flex; justify-content: flex-end; gap: 8px; }
.pv-modal-close { margin-left: auto; background: none; border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius); width: 28px; height: 28px; cursor: pointer; color: var(--pv-text-2); flex-shrink: 0; }
.pv-field { display: flex; flex-direction: column; gap: 4px; } .pv-field .pv-input, .pv-field .pv-select { width: 100%; }

/* ---------- data health table (rate-change-explorer Data health tab) ---------- */
.pv-health { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.pv-health th { text-align: left; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pv-text-3); padding: 6px 8px; border-bottom: 1px solid var(--pv-stroke); }
.pv-health td { padding: 7px 8px; border-bottom: 1px solid var(--pv-stroke); vertical-align: top; } .pv-health tr:last-child td { border-bottom: none; }
.pv-health td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pv-health .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--pv-text-4); }
.pv-health .dot.fresh { background: var(--pv-success); } .pv-health .dot.stale { background: var(--pv-warning); } .pv-health .dot.failed { background: var(--pv-error); }
.pv-health .dot.running { background: var(--pv-primary); animation: pv-pulse 1s ease-in-out infinite; }
@keyframes pv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- dev mode: the queries behind a live view (clear-rates-accuracy dev toggle, maternity-episode-pricing SQL drawer) ---------- */
.pv-dev-queries { display: flex; flex-direction: column; gap: 8px; border-style: dashed; }
.pv-btn.pv-dev-toggle.on { background: var(--pv-highlight); border-color: var(--pv-primary); color: var(--pv-primary); }
/* SQL per card (DS 2.6, D26): PVSql.dev.attach puts .pv-card-sql in the card head; visible only while dev mode is on */
.pv-btn.pv-card-sql[hidden] { display: none; }
.pv-card-head:has(> .pv-card-sql) { justify-content: flex-start; }
.pv-card-head:has(> .pv-card-sql) > :first-child:not(.pv-card-sql) { margin-right: auto; }
.pv-card-head:has(> .pv-card-sql) > .pv-card-sql { margin-left: -4px; }
.pv-card-head.pv-card-head-sql { justify-content: flex-end; }
body:not(.pv-dev-on) .pv-card-head.pv-card-head-sql { display: none; }
.pv-card-sql-more { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- score ladder (stoploss-explorer confidence ladder) ---------- */
.pv-ladder { display: flex; flex-direction: column; gap: 3px; }
.pv-ladder-step { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 5px 8px; border-radius: var(--pv-radius); font-size: 0.8rem; }
.pv-ladder-step .n { font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; border-radius: var(--pv-radius); padding: 2px 0; color: #fff; background: var(--pv-text-3); }
.pv-ladder-step .lbl b { font-weight: 600; display: block; } .pv-ladder-step .lbl span { color: var(--pv-text-2); font-size: 0.76rem; }
.pv-ladder-step.on { background: var(--pv-highlight); outline: 1px solid var(--pv-interactive); }
.pv-ladder-step.dim { opacity: 0.55; }

/* ---------- percentile track (berje-network-check, validation-distribution-explorer) ---------- */
.pv-track { position: relative; height: 26px; }
.pv-track .rail { position: absolute; left: 0; right: 0; top: 11px; height: 4px; background: var(--pv-stroke); border-radius: 2px; }
.pv-track .iqr { position: absolute; top: 8px; height: 10px; background: var(--pv-interactive); border-radius: 3px; }
.pv-track .med { position: absolute; top: 5px; width: 2px; height: 16px; background: var(--pv-primary); }
.pv-track .pt { position: absolute; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--pv-card); border: 2px solid var(--pv-error); transform: translateX(-6px); }
.pv-track .pt.in { border-color: var(--pv-success); }
.pv-track .tick { position: absolute; top: 20px; font-size: 0.66rem; color: var(--pv-text-3); transform: translateX(-50%); white-space: nowrap; }
.pv-track.pv-track-up { margin-top: 14px; }   /* the median label above the track, clear of the end labels (DS 2.11) */
.pv-track .tick.up { top: -14px; color: var(--pv-text-2); }

/* ---------- paste-a-list (rate-change-explorer explorer.js paste handler) ---------- */
.pv-paste { display: flex; flex-direction: column; gap: 6px; }
.pv-paste textarea { font: inherit; font-size: 0.82rem; min-height: 64px; padding: 6px 9px; border: 1px solid var(--pv-stroke-dark); border-radius: var(--pv-radius); resize: vertical; color: var(--pv-text); }
.pv-paste textarea:focus { outline: 2px solid var(--pv-primary); outline-offset: 0; border-color: var(--pv-primary); }
.pv-paste .result { font-size: 0.78rem; color: var(--pv-text-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pv-paste .result .pv-tag { font-family: var(--pv-mono); }

/* ---------- stepper (ssp-visit-explorer Prev / Next) ---------- */
.pv-stepper { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--pv-text-2); }
.pv-stepper .pv-btn { padding: 4px 8px; } .pv-stepper b { color: var(--pv-text); font-variant-numeric: tabular-nums; }

/* ---------- version picker (header actions, five or more apps) ---------- */
.pv-version { position: relative; }
.pv-version .pv-dd-btn { font-size: 0.8rem; min-height: 30px; padding: 4px 26px 4px 9px; }
.pv-version .pv-dd-btn .pv-label { font-size: 0.62rem; margin-right: 4px; }

/* ---------- hover card (rate-change-explorer ui.js Popover and its .popover card; decision D10, 2026-10-04) ----------
   One look for every hover in the DOM: a light card in the card style, never the browser's title tooltip.
   PVTip.attach() fills it with a rich card; [data-tip="..."] shows a short text. Chart marks keep Plotly's
   dark hover label (PVCharts); map marks use the light .pv-mapcard below (D10 amended, DS 2.4). */
.pv-tip { display: none; position: fixed; z-index: 400; width: 330px; max-width: calc(100vw - 16px); background: var(--pv-card); border: 1px solid var(--pv-stroke);
  border-radius: var(--pv-radius-card); box-shadow: var(--pv-shadow-pop); padding: 10px 12px; font-size: 0.8rem; line-height: 1.4; color: var(--pv-text); pointer-events: none; }
.pv-tip.text { width: auto; max-width: 320px; padding: 7px 10px; color: var(--pv-text-2); }
.pv-tip-h { font-weight: 600; color: var(--pv-primary); margin-bottom: 6px; line-height: 1.3; }
.pv-tip-h span { display: block; font-weight: 500; color: var(--pv-text-2); font-size: 0.74rem; }
.pv-tip-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.pv-tip-row span { color: var(--pv-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-tip-row b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-tip-row b.up { color: var(--pv-up); } .pv-tip-row b.down { color: var(--pv-down); }
.pv-tip-row code { font-family: var(--pv-mono); font-size: 0.74rem; font-weight: 600; }
.pv-tip-tables { display: flex; flex-direction: column; gap: 3px; }
.pv-tip-tables code { font-family: var(--pv-mono); font-size: 0.74rem; color: var(--pv-text); overflow-wrap: anywhere; }
.pv-tip:has(.pv-tip-tables) { width: auto; min-width: 260px; max-width: min(520px, calc(100vw - 16px)); }
.pv-tip-dim { color: var(--pv-text-3); font-weight: 500; }
.pv-tip-sec { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pv-text-3); margin: 8px 0 3px; }
.pv-tip-note { color: var(--pv-text-2); font-size: 0.74rem; margin-top: 3px; line-height: 1.4; }
.pv-tip-foot { border-top: 1px solid var(--pv-stroke); margin-top: 8px; padding-top: 6px; color: var(--pv-text-2); font-size: 0.74rem; line-height: 1.45; }
.pv-tip .pv-skel-line { margin: 6px 0; }
/* the thing that has a tip: a header, a term or a badge gets a dotted underline and the help cursor; buttons and links keep their own */
th[data-tip], span[data-tip], abbr[data-tip], .pv-tip-term { cursor: help; text-decoration: underline dotted var(--pv-text-4); text-underline-offset: 3px; }
th[data-tip] > button { text-decoration: inherit; }
.pv-tag[data-tip] { text-decoration: none; }

/* ---------- map card (D10 amended, DS 2.4): the light card on map marks (PVStreetMap, PVMap) ----------
   The .pv-tip look, floated inside the map container with a caret on the mark. PVMapCard.show() places it. */
.pv-mapcard { display: none; position: absolute; z-index: 6; width: 268px; min-width: 240px; max-width: min(300px, calc(100% - 12px)); box-sizing: border-box;
  background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); box-shadow: var(--pv-shadow-pop);
  padding: 11px 13px 12px; font-family: var(--pv-font); font-size: 0.8rem; line-height: 1.4; color: var(--pv-text); pointer-events: none; text-align: left; }
.pv-mapcard-caret { position: absolute; bottom: -6px; width: 11px; height: 11px; margin-left: -5.5px; background: var(--pv-card);
  border-right: 1px solid var(--pv-stroke); border-bottom: 1px solid var(--pv-stroke); transform: rotate(45deg); border-bottom-right-radius: 2px; }
.pv-mapcard.below .pv-mapcard-caret { bottom: auto; top: -6px; transform: rotate(225deg); }
.pv-mc-name { font-weight: 600; font-size: 0.86rem; line-height: 1.3; color: var(--pv-text); overflow-wrap: anywhere; }
.pv-mc-sub { color: var(--pv-text-2); font-size: 0.74rem; margin-top: 1px; }
.pv-mc-loc { color: var(--pv-text-3); font-size: 0.74rem; margin-top: 1px; font-variant-numeric: tabular-nums; }
.pv-mc-payer { margin-top: 8px; font-size: 0.8rem; }
.pv-mc-payer .pv-payer { max-width: 100%; }
.pv-mc-payer .pv-payer-name { font-weight: 500; }
.pv-mc-net { color: var(--pv-text-2); }
.pv-mc-div { height: 1px; background: var(--pv-stroke); margin: 9px -13px 8px; }
.pv-mc-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pv-mc-price b { font-size: 1.3rem; font-weight: 600; line-height: 1.15; color: var(--pv-primary-pressed); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pv-mc-from { color: var(--pv-text-3); font-size: 0.74rem; }
.pv-mc-plabel { color: var(--pv-text-3); font-size: 0.74rem; }
.pv-mc-rank { color: var(--pv-text-2); font-size: 0.74rem; margin-top: 2px; }
.pv-mc-rows-h { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pv-text-3); margin: 9px 0 3px; }
.pv-mc-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-top: 1px solid var(--pv-surface); }
.pv-mc-row:first-child { border-top: none; }
.pv-mc-row span { color: var(--pv-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pv-mc-row b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-mc-more { color: var(--pv-text-3); font-size: 0.74rem; margin-top: 3px; }
.pv-mapcard.compact { width: auto; min-width: 0; max-width: min(300px, calc(100% - 12px)); padding: 8px 11px; }
.pv-mapcard b, .pv-mapcard strong { font-weight: 600; }
.pv-mapcard .pv-tip-h:last-child, .pv-mapcard .pv-tip-row:last-child { margin-bottom: 0; }

/* ---------- distribution chart (PVCharts.distribution, PVCharts.stat; drug-ssp-explorer price chart, DS 2.4) ----------
   The marker line, ring and pill and the min. / Price / max. footer are HTML over and under the Plotly plot.
   PVCharts places them in px from the plot's own margins, so the footer lines up with the axis. */
.pv-dist { position: relative; min-width: 0; }
.pv-dist-plot-wrap { position: relative; }
.pv-dist-plot { position: absolute; inset: 0; }
.pv-dist-overlay { position: absolute; inset: 0; pointer-events: none; }
.pv-dist-overlay[hidden] { display: none; }
.pv-dist-line { position: absolute; width: 2px; margin-left: -1px; background: repeating-linear-gradient(to bottom, var(--pv-text-2) 0 5px, transparent 5px 9px); transition: left 0.25s ease; }
.pv-dist-overlay.dotted .pv-dist-line { background: repeating-linear-gradient(to bottom, var(--pv-text-2) 0 2px, transparent 2px 5px); }
.pv-dist-ring { position: absolute; width: 9px; height: 9px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; border: 2px solid var(--pv-text-2); background: var(--pv-card); transition: left 0.25s ease; }
.pv-dist-pill { position: absolute; white-space: nowrap; background: var(--pv-primary-pressed); color: var(--pv-card); border-radius: 6px; padding: 5px 11px;
  font-size: 0.88rem; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(2, 54, 61, 0.18); transition: left 0.25s ease; }
.pv-dist-pill-sub { font-weight: 400; opacity: 0.82; margin-left: 6px; }
.pv-dist-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 0 12px; padding-top: 6px; font-size: 0.9rem; line-height: 1.35; }
.pv-dist-foot .k { color: var(--pv-text-3); }
.pv-dist-foot b { display: block; font-weight: 500; color: var(--pv-text); font-variant-numeric: tabular-nums; }
.pv-dist-min { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.pv-dist-max { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; text-align: right; }
.pv-dist-axis { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pv-dist-note { font-size: 0.74rem; color: var(--pv-text-3); }
.pv-dist-note:empty { display: none; }
/* the big number beside it (PVCharts.stat) */
.pv-figure { display: flex; flex-direction: column; gap: 6px; }
.pv-figure.center { align-items: center; text-align: center; }
.pv-figure-value { font-size: 2.1rem; font-weight: 500; line-height: 1.1; color: var(--pv-primary-pressed); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pv-figure-caption { font-size: 0.9rem; line-height: 1.45; color: var(--pv-text-2); max-width: 34ch; }

/* ---------- PVParts pieces (pv-parts.v1.js, DS 2.11): header, track, distribution, table cells ---------- */
.pv-part-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pv-part-head-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--pv-surface); color: var(--pv-primary-pressed); }
.pv-part-head-text { flex: 1 1 260px; min-width: 0; }
.pv-part-head-title { font-size: 1.4rem; font-weight: 600; line-height: 1.2; margin: 0; color: var(--pv-text); overflow-wrap: anywhere; }
.pv-part-head-sub { font-size: 0.86rem; color: var(--pv-text-2); margin-top: 2px; }
.pv-part-head-note { font-size: 0.78rem; color: var(--pv-text-3); margin-top: 4px; }
.pv-part-head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
@media (max-width: 820px) { .pv-part-head-actions { margin-left: 0; } }
.pv-part-tracks { display: flex; flex-direction: column; gap: 18px; }
.pv-part-tracks.pv-part-tracks-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; }
/* short pieces in a row (DS 2.11): a track or stats piece beside a taller chart or table sizes to its content and sits
   at the top of the row, as every piece in .pv-row--split does, instead of stretching into an empty card */
.pv-row > [data-part="track"], .pv-row > [data-part="stats"], .pv-grid-2 > [data-part="track"], .pv-grid-2 > [data-part="stats"] { align-self: start; }
.pv-part-track .pv-track { margin-top: 8px; }
.pv-part-track .pv-track.pv-track-up { margin-top: 22px; }
.pv-part-cap { margin-top: 8px; font-size: 0.78rem; color: var(--pv-text-3); }
.pv-part-dist-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pv-part-dist-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* DS 2.20: the distribution piece's five-number line (summary: true) under the chart */
.pv-part-dist-sum { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 6px; font-size: 0.8rem; color: var(--pv-text-2); }
.pv-part-dist-sum b { color: var(--pv-text); font-weight: 600; }
.pv-part-dist-sum[hidden] { display: none; }
.pv-table td .pv-clamp { max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-table td .pv-cell-sub { text-align: left; max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.74rem; color: var(--pv-text-2); margin-top: 1px; }
/* ---------- PVParts pieces (pv-parts.v1.js, DS 2.13): the chart's metric toggle, cards ---------- */
.pv-part-chart-ctl { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.pv-part-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pv-part-cards.pv-part-cards-c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-part-cards.pv-part-cards-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pv-part-cards.pv-part-cards-c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pv-part-cards.pv-part-cards-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (max-width: 820px) { .pv-part-cards.pv-part-cards-c3, .pv-part-cards.pv-part-cards-c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pv-part-cards.pv-part-cards-c2, .pv-part-cards.pv-part-cards-c3, .pv-part-cards.pv-part-cards-c4 { grid-template-columns: minmax(0, 1fr); } }
.pv-part-card { box-sizing: border-box; min-width: 0; padding: 12px 14px; background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); color: var(--pv-text); transition: border-color 0.12s, background 0.12s; }
.pv-part-card-click { cursor: pointer; }
.pv-part-card-click:hover { border-color: var(--pv-primary); }
.pv-part-card-click:focus-visible { outline: 2px solid var(--pv-primary); outline-offset: 2px; }
.pv-part-card-head { display: flex; align-items: flex-start; gap: 10px; }
.pv-part-card-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--pv-surface); color: var(--pv-primary-pressed); }
.pv-part-card-text { flex: 1 1 auto; min-width: 0; }
.pv-part-card-title { font-size: 0.92rem; font-weight: 600; line-height: 1.3; color: var(--pv-primary-pressed); overflow-wrap: anywhere; }
.pv-part-card-sub { font-size: 0.78rem; color: var(--pv-text-2); margin-top: 2px; }
.pv-part-card-payer { flex: none; margin-left: auto; display: inline-flex; max-width: 45%; font-size: 0.78rem; line-height: 1.2; }   /* 2.19: logo and name */
.pv-part-card-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.pv-part-card-stat-l { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pv-text-3); }
.pv-part-card-stat-v { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--pv-text); }
.pv-part-card-track { margin-top: 12px; }
.pv-part-card-track .pv-track { margin-top: 6px; }
.pv-part-card-track .pv-track.pv-track-up { margin-top: 20px; }
.pv-part-card-say { margin-top: 6px; font-size: 0.74rem; color: var(--pv-text-3); }
.pv-part-cards-list .pv-part-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 20px; }
.pv-part-cards-list .pv-part-card-stats { margin-top: 0; justify-content: flex-end; }
.pv-part-cards-list .pv-part-card-track { grid-column: 1 / -1; margin-top: 4px; }
@media (max-width: 560px) { .pv-part-cards-list .pv-part-card { grid-template-columns: minmax(0, 1fr); } .pv-part-cards-list .pv-part-card-stats { justify-content: flex-start; } }
.pv-part-cards-more { grid-column: 1 / -1; margin-top: 2px; }
/* 2.19: the pieces' shared states. A re-query dims what a piece drew (a skeleton only before its first draw); the
   compact stat row of a table drawer; a stats row with no rows spans its empty state; a stats section's host. */
.pv-part-busy { opacity: 0.5; transition: opacity 0.15s ease; pointer-events: none; cursor: progress; }
.pv-stats.pv-stats-compact { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pv-stats-compact .pv-stat { padding: 8px 10px; }
.pv-stats-compact .pv-stat-value { font-size: 1.15rem; }
.pv-stats > .pv-empty, .pv-stats > .pv-error { grid-column: 1 / -1; }
.pv-stats-host > .pv-card-head.pv-card-head-sql { margin-bottom: 6px; }
.pv-card-actions:has(> .pv-part-mx-legend) { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }   /* the matrix legend in the head wraps, never widens the card */
.pv-card-actions > .pv-part-mx-legend { min-width: 0; max-width: 100%; flex-wrap: wrap; margin: 0 6px 0 0; }
/* DS 2.20: a lookup result's entity icon before its title (the provider type's glyph) */
.pv-part-result-icon { display: inline-flex; vertical-align: -2px; margin-right: 6px; color: var(--pv-primary); }
