/* pv-common.v1.css: Sandbox Apps Design System v2 base styles (decisions D2, D3, D5, D8, D9).
   Reset, page shell, buttons, inputs, filter bar, cards, stat cards, table, tags, drawer,
   skeleton, empty, error, provenance. Behavior lives in the pv-*.v1.js files.

   Usage:
     <link rel="stylesheet" href="/play/_static/shared/pv-tokens.v1.css">
     <link rel="stylesheet" href="/play/_static/shared/pv-common.v1.css">
   Markup reference: static/apps/_template/index.html. Versioned: copy, never edit in place. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; height: 100%; }
body { font-family: var(--pv-font); color: var(--pv-text); background: var(--pv-surface); line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; min-height: 100%; }
a { color: var(--pv-primary); }
button, input, select, textarea { font: inherit; color: inherit; }
code, .pv-mono { font-family: var(--pv-mono); font-size: 0.86em; }
:focus-visible { outline: 2px solid var(--pv-primary); outline-offset: 2px; }
.pv-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- shell (D2) ---------- */
.pv-header { background: var(--pv-card); border-bottom: 1px solid var(--pv-stroke); padding: 14px 24px 0;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 20px; }
.pv-header-title { flex: 1 1 280px; padding-bottom: 10px; }
.pv-header h1 { font-size: 1.25rem; font-weight: 600; line-height: 1.2; margin-bottom: 2px; }
/* the app mark and the way home (DESIGN_SYSTEM.md section 4c): the mark and the app name are one link to the Sandbox Apps home page */
.pv-home { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; border-radius: var(--pv-radius); max-width: 100%; }
.pv-home h1 { margin-bottom: 0; }
.pv-home:hover h1, .pv-home:hover .pv-home-name { color: var(--pv-primary); }
.pv-app-mark { flex: 0 0 auto; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--app-mark-bg, var(--pv-primary-pressed)); color: var(--app-mark-ink, var(--pv-interactive)); font-weight: 600; font-size: 1.05rem; line-height: 1; }
.pv-app-mark svg { width: 20px; height: 20px; }
.pv-header-title:has(> .pv-home .pv-app-mark) > .pv-subtitle { padding-left: 42px; margin-top: 2px; }
.pv-subtitle { font-size: 0.8rem; color: var(--pv-text-2); max-width: 70ch; }
.pv-subtitle .pv-pill { margin-left: 6px; }
/* one-line subtitle (DS 2.6, D26): pv-common.v1.js wraps the text in .pv-subtitle-text; the text clamps with an
   ellipsis (full text in a PVTip hover card when cut), pills and other children keep their size beside it. A grid,
   not flex: the text column is minmax(0, max-content), so the subtitle never makes its header wider than the screen.
   The 70ch cap is for wrapped lines; one line uses the room the header gives it. */
.pv-subtitle:has(> .pv-subtitle-text) { display: grid; grid-auto-flow: column; grid-template-columns: minmax(0, max-content); grid-auto-columns: max-content;
  justify-content: start; align-items: baseline; min-width: 0; max-width: none; }
.pv-subtitle-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* text after a pill, or a pill first: flex keeps every piece in the row (rare markup) */
.pv-subtitle:has(> .pv-subtitle-text ~ .pv-subtitle-text), .pv-subtitle:has(> .pv-subtitle-text):not(:has(> .pv-subtitle-text:first-child)) { display: flex; }
.pv-subtitle:has(> .pv-subtitle-text) > .pv-subtitle-text { flex: 0 1 auto; }
.pv-subtitle:has(> .pv-subtitle-text) > :not(.pv-subtitle-text) { flex: none; }
@media print { .pv-subtitle-text { white-space: normal; overflow: visible; } }
.pv-tabs { display: flex; gap: 18px; flex-wrap: wrap; }
.pv-tabs a, .pv-tabs button { color: var(--pv-text-2); font-weight: 500; font-size: 0.9rem; text-decoration: none; background: none; border: none;
  padding: 6px 0 10px; border-bottom: 2px solid transparent; cursor: pointer; }
.pv-tabs a.on, .pv-tabs button.on, .pv-tabs [aria-selected="true"] { color: var(--pv-primary); border-bottom-color: var(--pv-primary); }
.pv-actions { display: flex; gap: 8px; padding-bottom: 10px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.pv-main { max-width: var(--pv-main-width); margin: 0 auto; padding: 14px 24px 32px; display: flex; flex-direction: column; gap: 12px; }
.pv-main.pv-narrow { max-width: 1100px; }
.pv-view { display: none; } .pv-view.on { display: contents; }
.pv-layout-sidebar { display: grid; grid-template-columns: var(--pv-sidebar-width) minmax(0, 1fr); gap: 12px; align-items: start; }
.pv-layout-sidebar > .pv-sidebar { position: sticky; top: 8px; z-index: 2; display: flex; flex-direction: column; gap: 12px; }   /* position:sticky always opens a stacking context (spec), so without an explicit z-index its dropdowns paint under a later sibling's sticky table header */
.pv-layout-sidebar > .pv-content { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 820px) { .pv-seg { flex-wrap: wrap; } .pv-header, .pv-main { padding-inline: 14px; } .pv-layout-sidebar { grid-template-columns: 1fr; } .pv-layout-sidebar > .pv-sidebar { position: static; } }

/* ---------- caustic surfaces (opt-in): PVCaustic.mount(el) on a header, strip or hero ---------- */
.pv-header.pv-caustic { position: relative; overflow: hidden; border-bottom-color: rgba(255, 255, 255, 0.5); }
.pv-header.pv-caustic > * { position: relative; z-index: 1; }
.pv-header.pv-caustic::after { content: ""; position: absolute; inset: 0; z-index: 0; background: rgba(255, 255, 255, 0.84); }   /* wash: light header, caustic shows through */
.pv-header.pv-caustic.pv-dark::after { background: rgba(2, 54, 61, 0.42); }
.pv-header.pv-caustic.pv-dark, .pv-header.pv-caustic.pv-dark h1, .pv-header.pv-caustic.pv-dark .pv-tabs a, .pv-header.pv-caustic.pv-dark .pv-tabs button { color: #fff; }
.pv-header.pv-caustic.pv-dark .pv-subtitle { color: rgba(255, 255, 255, 0.82); }
.pv-header.pv-caustic.pv-dark .pv-tabs a:not(.on), .pv-header.pv-caustic.pv-dark .pv-tabs button:not(.on) { color: rgba(255, 255, 255, 0.72); }
.pv-header.pv-caustic.pv-dark .pv-tabs .on, .pv-header.pv-caustic.pv-dark .pv-tabs [aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
.pv-header.pv-caustic.pv-dark .pv-btn { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.pv-header.pv-caustic.pv-dark .pv-btn:hover { background: rgba(255, 255, 255, 0.26); }
.pv-header.pv-caustic.pv-dark .pv-btn.pv-primary { background: #fff; color: var(--pv-primary-pressed); border-color: #fff; }
.pv-header.pv-caustic.pv-dark .pv-pill { color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.pv-header.pv-caustic.pv-dark .pv-seg { border-color: rgba(255, 255, 255, 0.45); } .pv-header.pv-caustic.pv-dark .pv-seg button { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.pv-header.pv-caustic.pv-dark .pv-seg button.on, .pv-header.pv-caustic.pv-dark .pv-seg button[aria-pressed="true"] { background: #fff; color: var(--pv-primary-pressed); }
.pv-caustic-strip { position: relative; height: 4px; overflow: hidden; }
.pv-splash { position: relative; overflow: hidden; border-radius: var(--pv-radius-card); padding: 22px 24px; min-height: 150px; display: flex; align-items: flex-end; gap: 16px; }   /* overview splash on a first tab; not .pv-hero, which is the stat modifier */
.pv-splash > * { position: relative; z-index: 1; }
.pv-splash-card { background: rgba(255, 255, 255, 0.94); border-radius: var(--pv-radius-card); padding: 14px 18px; max-width: 560px; box-shadow: var(--pv-shadow-pop); }
.pv-splash-card h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; }
.pv-splash-card p { font-size: 0.86rem; color: var(--pv-text-2); max-width: 60ch; }
.pv-splash .pv-stats { flex: 1; align-self: stretch; align-content: end; }

/* ---------- buttons, inputs ---------- */
.pv-btn { font-size: 0.8rem; font-weight: 500; padding: 6px 11px; border-radius: var(--pv-radius); border: 1px solid var(--pv-stroke);
  background: var(--pv-card); color: var(--pv-text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; white-space: nowrap; text-decoration: none; }
.pv-btn:hover { background: var(--pv-surface); }
.pv-btn.pv-primary { background: var(--pv-primary); border-color: var(--pv-primary); color: #fff; }
.pv-btn.pv-primary:hover { background: var(--pv-primary-hover); border-color: var(--pv-primary-hover); }
.pv-btn.pv-ghost { border-color: transparent; background: transparent; color: var(--pv-primary); }
.pv-btn.pv-sm { padding: 4px 8px; font-size: 0.74rem; }
.pv-btn.pv-xl { padding: 10px 18px; font-size: 0.95rem; gap: 8px; }
.pv-btn.pv-xl svg { width: 16px; height: 16px; }
.pv-btn:disabled { color: var(--pv-text-disabled); cursor: not-allowed; background: var(--pv-surface); }
.pv-btn svg { width: 13px; height: 13px; }
.pv-link { background: none; border: none; color: var(--pv-primary); font-weight: 500; cursor: pointer; padding: 0; font-size: inherit; }
.pv-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pv-text-3); }
.pv-input, .pv-select { font-size: 0.85rem; padding: 6px 9px; border: 1px solid var(--pv-stroke-dark); border-radius: var(--pv-radius); background: var(--pv-card); color: var(--pv-text); min-height: 32px; }
.pv-select { appearance: none; padding-right: 28px; background: var(--pv-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E8081' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center; }
.pv-input::placeholder { color: var(--pv-text-3); }
.pv-input:focus, .pv-select:focus { outline: 2px solid var(--pv-primary); outline-offset: 0; border-color: var(--pv-primary); }
.pv-input.on, .pv-select.on, .pv-dd-btn.on { border-color: var(--pv-primary); box-shadow: inset 0 0 0 1px var(--pv-primary); }
.pv-seg { display: inline-flex; border: 1px solid var(--pv-stroke-dark); border-radius: var(--pv-radius); overflow: hidden; }
.pv-seg button { border: none; background: var(--pv-card); padding: 6px 10px; font-size: 0.82rem; cursor: pointer; color: var(--pv-text); }
.pv-seg button + button { border-left: 1px solid var(--pv-stroke-dark); }
.pv-seg button:disabled { color: var(--pv-text-disabled); cursor: not-allowed; }
.pv-seg button.on, .pv-seg button[aria-pressed="true"] { background: var(--pv-primary); color: #fff; }
.pv-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; cursor: pointer; }
.pv-switch input { accent-color: var(--pv-primary); }

/* ---------- filter bar (D3): controls show their own active state; count and Reset top-right ---------- */
.pv-filters { background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.pv-filters-head { display: flex; align-items: center; gap: 12px; font-size: 0.76rem; color: var(--pv-text-2); }
.pv-filters-head .pv-count { font-weight: 500; }
.pv-filters-head .pv-reset { margin-left: auto; }
.pv-filters-head .pv-note { color: var(--pv-warning); }
.pv-filters-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.pv-filter { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.pv-filter.pv-grow { flex: 1 1 200px; }
.pv-filter .pv-input { min-width: 190px; }
.pv-filter .pv-dd-btn, .pv-filter .pv-select { width: var(--pv-filter-w, 170px); }   /* fixed width: a selection never widens the bar (Nick, 2026-10-04) */
.pv-filter.pv-grow .pv-dd-btn { width: 100%; }
.pv-sidebar .pv-filters-row { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }   /* the base .pv-filters-row is flex-wrap: wrap for the bar layout; left on in a column container, the browser sizes each filter as if it might need to wrap into a second column, so a long selected label (a filter's own min-content width) stretches .pv-filter past the sidebar instead of being clipped by the 100%-width .pv-dd-btn (the clampPop bug's sibling -- same "a filter's content is wider than the sidebar" root shape, different property) */
.pv-sidebar .pv-filter .pv-input, .pv-sidebar .pv-filter .pv-dd-btn, .pv-sidebar .pv-filter .pv-select { width: 100%; min-width: 0; }
.pv-dd { position: relative; }
.pv-dd-btn { font-size: 0.85rem; padding: 6px 28px 6px 9px; border: 1px solid var(--pv-stroke-dark); border-radius: var(--pv-radius); background: var(--pv-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E8081' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 32px; text-align: left; max-width: 100%; }
.pv-dd-btn .pv-dd-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-dd-btn-full { position: absolute !important; left: 0; top: 0; width: max-content !important; max-width: 90vw; z-index: 21; pointer-events: none; }   /* clamp-time clone showing the closed button's full, un-truncated text while open; see clampPop. !important: the sidebar/bar layouts both pin .pv-dd-btn's width with a more specific selector than this one-off class can out-rank otherwise */
.pv-dd-n { background: var(--pv-highlight); color: var(--pv-primary); font-weight: 600; border-radius: 3px; padding: 0 5px; font-size: 0.72rem; }
.pv-dd-pop { display: none; position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: var(--pv-pop-w, 320px); max-width: 90vw;
  background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); box-shadow: var(--pv-shadow-pop); padding: 6px; }
.pv-dd-list { max-height: 320px; overflow: auto; }   /* the list scrolls; the Search box and the footer stay put (rate-change-explorer Dropdown) */
.pv-dd-sec { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pv-text-3); padding: 6px 6px 2px; }
.pv-dd-item .pv-dd-text { flex: 1; min-width: 0; } .pv-dd-l { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pv-dd-s { display: block; color: var(--pv-text-3); font-size: 0.74rem; }
.pv-dd-meta { color: var(--pv-text-3); font-size: 0.74rem; white-space: nowrap; }
.pv-dd-item.pv-hi { background: var(--pv-surface); box-shadow: inset 0 0 0 1px var(--pv-stroke-dark); }
.pv-dd-foot { display: flex; gap: 10px; align-items: center; font-size: 0.74rem; color: var(--pv-text-3); border-top: 1px solid var(--pv-stroke); margin-top: 4px; padding: 6px 4px 0; } .pv-dd-foot span { margin-right: auto; }
.pv-dd-msg { font-size: 0.74rem; color: var(--pv-warning); padding: 2px 6px; } .pv-dd-msg:empty { display: none; }
.pv-dd.open .pv-dd-pop { display: block; }
.pv-dd-pop .pv-input { width: 100%; margin-bottom: 4px; }
.pv-dd-tools { display: flex; gap: 10px; font-size: 0.74rem; padding: 2px 4px 4px; }
.pv-dd-item { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: var(--pv-radius); cursor: pointer; font-size: 0.84rem; }
.pv-dd-item:hover, .pv-dd-item:focus-within { background: var(--pv-surface); }
.pv-dd-item input { accent-color: var(--pv-primary); }
.pv-dd-item .pv-dd-c { margin-left: auto; color: var(--pv-text-3); font-size: 0.74rem; } .pv-dd-item .pv-dd-text + .pv-dd-c, .pv-dd-item .pv-dd-meta + .pv-dd-c { margin-left: 0; }
.pv-dd-item.pv-zero { color: var(--pv-text-4); }
.pv-dd-item.pv-on { background: var(--pv-highlight); }
.pv-dd-item .pv-dd-only { display: none; margin-left: 6px; font-size: 0.72rem; } .pv-dd-item:hover .pv-dd-only, .pv-dd-item:focus-within .pv-dd-only { display: inline; }
.pv-dd-item:has(.pv-dd-only:hover) .pv-dd-c, .pv-dd-item:hover .pv-dd-c { margin-left: auto; }
.pv-dd-item input:focus-visible { outline: 2px solid var(--pv-primary); outline-offset: 1px; }
.pv-dd-btn.pv-scope, .pv-select.pv-scope { border-color: var(--pv-text-3); }   /* scope filters: kept by Reset */

/* ---------- cards, stat cards ---------- */
.pv-card { background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); padding: 14px 16px; min-width: 0; }
.pv-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pv-card-actions { display: flex; align-items: center; gap: 6px; flex: none; }   /* the head's buttons as one group: PNG, then SQL in dev mode (DS 2.6) */
.pv-card h2, .pv-card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.pv-card-sub { font-size: 0.78rem; color: var(--pv-text-2); max-width: 70ch; }
.pv-grid-2, .pv-row--grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; }
.pv-grid-2-3 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; }
@media (max-width: 820px) { .pv-grid-2-3 { grid-template-columns: 1fr; } }
/* rows (DS 2.8, D27): how sections sit side by side. .pv-row--grid-2 is .pv-grid-2. .pv-row--split puts a list or
   table beside a map or chart that stays in view (sticky, below the header) while the list scrolls. .pv-row--full
   bleeds past the page padding to the viewport width, for a wide matrix or map. Both stack on a narrow screen. */
.pv-row--split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.pv-row--split > :not(style, script) ~ :not(style, script) { position: sticky; top: var(--pv-sticky-top, 12px); z-index: 1; }   /* the second piece (a Builder custom section brings its own style and script); z-index: sticky opens a stacking context, dropdowns from the list still paint above it */
.pv-row--full { margin-inline: min(0px, calc(50% - 50vw)); padding-inline: 24px; min-width: 0; }
body:has(.pv-row--full) { overflow-x: clip; }   /* 50vw counts the scrollbar; clip, unlike hidden, keeps position: sticky working */
@media (max-width: 900px) { .pv-row--split { grid-template-columns: 1fr; } .pv-row--split > :not(style, script) ~ :not(style, script) { position: static; } }
@media (max-width: 820px) { .pv-row--full { padding-inline: 14px; } }
.pv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pv-stat { background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); padding: 12px 14px; }
.pv-stat-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pv-text-3); }
.pv-stat-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.pv-stat.pv-hero .pv-stat-value { color: var(--pv-primary-pressed); font-size: 1.9rem; }
.pv-stat-caption { font-size: 0.76rem; color: var(--pv-text-2); margin-top: 3px; }
.pv-stat-caption.up { color: var(--pv-up); } .pv-stat-caption.down { color: var(--pv-down); }

/* ---------- table (D5) ---------- */
.pv-table-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pv-table-tools .pv-input { min-width: 220px; }
.pv-table-tools .pv-count { font-size: 0.76rem; color: var(--pv-text-2); }
.pv-table-tools .pv-right { margin-left: auto; display: flex; gap: 6px; }
.pv-table-wrap { overflow: auto; max-height: var(--pv-table-max, 70vh); border: 1px solid var(--pv-stroke); border-radius: 6px; background: var(--pv-card); }
table.pv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; }
.pv-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 0; background: var(--pv-surface); border-bottom: 1px solid var(--pv-stroke); white-space: nowrap; }
.pv-table th > button, .pv-table th > span { width: 100%; text-align: inherit; font-size: 0.76rem; font-weight: 600; color: var(--pv-text-2); background: none; border: none; padding: 7px 10px; display: flex; align-items: center; gap: 4px; }
.pv-table th > button { cursor: pointer; } .pv-table th > button:hover { color: var(--pv-text); }
.pv-table th.num > button, .pv-table th.num > span { justify-content: flex-end; }
.pv-table th[aria-sort] > button { color: var(--pv-text); }
.pv-table th[aria-sort="descending"] > button::after { content: "\25BC"; font-size: 0.55em; } .pv-table th[aria-sort="ascending"] > button::after { content: "\25B2"; font-size: 0.55em; }
.pv-table td { padding: 6px 10px; border-bottom: 1px solid var(--pv-stroke); white-space: nowrap; vertical-align: top; }
.pv-table td.wrap { white-space: normal; }
.pv-table tbody tr:last-child td { border-bottom: none; }
.pv-table td.num { text-align: right; }
.pv-table tbody tr.pv-click { cursor: pointer; } .pv-table tbody tr.pv-click:hover td { background: var(--pv-surface-2); }
.pv-table tbody tr.sel td { background: var(--pv-highlight); }
.pv-table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--pv-primary); }
/* PVTable cards: one card per row on a narrow table (option cards, 2026-10-05) */
.pv-table-cardable.pv-cards .pv-table-wrap { max-height: none; }
.pv-table-cardable.pv-cards .pv-table, .pv-table-cardable.pv-cards .pv-table tbody, .pv-table-cardable.pv-cards .pv-table tr, .pv-table-cardable.pv-cards .pv-table td { display: block; }
.pv-table-cardable.pv-cards .pv-table thead { display: none; }
.pv-table-cardable.pv-cards .pv-table tbody tr { display: flex; flex-direction: column; padding: 9px 10px; border-bottom: 1px solid var(--pv-stroke); }
.pv-table-cardable.pv-cards .pv-table tbody tr:last-child { border-bottom: none; }
.pv-table-cardable.pv-cards .pv-table td { display: flex; gap: 10px; border: none; padding: 2px 0; white-space: normal; text-align: left; }
.pv-table-cardable.pv-cards .pv-table td::before { content: attr(data-label); flex: 0 0 6rem; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pv-text-3); padding-top: 2px; }
.pv-table-cardable.pv-cards .pv-table td[colspan]::before, .pv-table-cardable.pv-cards .pv-table td.pv-card-lead::before { display: none; }
.pv-table-cardable.pv-cards .pv-table td.pv-card-lead { order: -1; display: block; font-size: 0.88rem; font-weight: 500; padding-bottom: 4px; }
.pv-table-cardable.pv-cards .pv-table tbody tr.sel { background: var(--pv-highlight); } .pv-table-cardable.pv-cards .pv-table tbody tr.sel td { background: none; }
/* PVTable loading: table.loading(on) (2026-10-05) */
.pv-table-skel { display: none; border: 1px solid var(--pv-stroke); border-top: none; border-radius: 0 0 6px 6px; padding: 10px 12px; background: var(--pv-card); }
.pv-loading .pv-table-skel { display: block; }
.pv-loading .pv-table tbody { display: none; }
.pv-loading .pv-table-wrap { border-radius: 6px 6px 0 0; }
.pv-table-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 0.76rem; color: var(--pv-text-2); flex-wrap: wrap; gap: 6px; }
.pv-pager { display: inline-flex; gap: 2px; }
.pv-pager button { font-size: 0.74rem; padding: 3px 7px; border: 1px solid var(--pv-stroke); background: var(--pv-card); border-radius: var(--pv-radius); cursor: pointer; color: var(--pv-text); min-width: 26px; }
.pv-pager button.on { background: var(--pv-primary); border-color: var(--pv-primary); color: #fff; }
.pv-pager button:disabled { color: var(--pv-text-disabled); cursor: default; }
.pv-colpick { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); box-shadow: var(--pv-shadow-pop); padding: 6px; min-width: 200px; display: none; }
.pv-colpick.open { display: block; }
.pv-colpick label { display: flex; gap: 8px; align-items: center; padding: 4px 6px; font-size: 0.82rem; cursor: pointer; border-radius: var(--pv-radius); }
.pv-colpick label:hover { background: var(--pv-surface); } .pv-colpick input { accent-color: var(--pv-primary); }
.pv-bar-track { display: inline-block; height: 8px; border-radius: 2px; background: var(--pv-primary); vertical-align: middle; }

/* ---------- tags, pills ---------- */
.pv-tag { font-size: 0.7rem; font-weight: 500; padding: 1px 6px; border-radius: var(--pv-radius); display: inline-block; background: var(--pv-surface); color: var(--pv-text-2); border: 1px solid transparent; white-space: nowrap; }
.pv-tag.ok, .pv-tag.success { background: var(--pv-success-bg); color: var(--pv-success); }
.pv-tag.warn, .pv-tag.warning { background: var(--pv-warning-bg); color: var(--pv-warning); }
.pv-tag.err, .pv-tag.error { background: var(--pv-error-bg); color: var(--pv-error); }
.pv-tag.brand { background: var(--pv-highlight); color: var(--pv-primary); }
.pv-tag.info { background: var(--pv-info-bg); color: var(--pv-info); }   /* a fifth tone for notable-but-neutral states (2026-10-05) */
.pv-tag.running { background: var(--pv-highlight); color: var(--pv-primary); }   /* work in progress: a pulsing dot */
.pv-tag.running::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; animation: pv-tag-pulse 1.4s ease-in-out infinite; }
@keyframes pv-tag-pulse { 50% { opacity: 0.25; } }
.pv-pill { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--pv-brand-border); color: var(--pv-primary); border-radius: var(--pv-radius); padding: 1px 5px; }

/* ---------- states: skeleton, empty, error ---------- */
@keyframes pv-shimmer { 0% { background-position: -500px 0; } 100% { background-position: 500px 0; } }
.skel, .pv-skel { background: linear-gradient(90deg, #E8EFEF 25%, #F6FAFA 37%, #E8EFEF 63%); background-size: 1000px 100%; animation: pv-shimmer 1.1s linear infinite; border-radius: 4px; }
.skel-line, .pv-skel-line { height: 0.85rem; margin: 0.45rem 0; }
.skel-title, .pv-skel-title { height: 1.5rem; width: 40%; margin-bottom: 0.6rem; }
.skel-badge, .pv-skel-badge { display: inline-block; width: 90px; height: 1.15rem; }
.skel-stat, .pv-skel-stat { height: 1.9rem; width: 65%; margin-top: 0.4rem; }
.skel-chart, .pv-skel-chart { height: 260px; }
.pv-empty { border: 1px dashed var(--pv-stroke-dark); border-radius: var(--pv-radius-card); padding: 18px 14px; text-align: center; color: var(--pv-text-2); font-size: 0.84rem; background: var(--pv-card); }
.pv-empty-title { display: block; color: var(--pv-text); font-weight: 600; margin-bottom: 2px; }
.pv-empty .pv-link { display: inline-block; margin-top: 6px; }
.pv-error { border: 1px solid var(--pv-error-border); background: var(--pv-error-bg); border-radius: var(--pv-radius-card); padding: 12px 14px; font-size: 0.84rem; color: var(--pv-text); }
.pv-error-title { color: var(--pv-error); font-weight: 600; }
.pv-error code { color: var(--pv-text-2); }
.pv-error details { margin-top: 4px; } .pv-error summary { cursor: pointer; color: var(--pv-primary); font-weight: 500; font-size: 0.78rem; }
.pv-error pre { white-space: pre-wrap; font-family: var(--pv-mono); font-size: 0.74rem; margin-top: 4px; color: var(--pv-text-2); }
.pv-alert { font-size: 0.82rem; border: 1px solid var(--pv-warning-border); background: var(--pv-warning-bg); color: var(--pv-warning); border-radius: var(--pv-radius); padding: 7px 10px; }
.pv-alert.info { border-color: #B0E8E4; background: var(--pv-highlight); color: var(--pv-primary-pressed); }

/* ---------- provenance, prose ---------- */
.pv-provenance { font-size: 0.74rem; color: var(--pv-text-3); display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 2px 4px; }
.pv-provenance code { color: var(--pv-text-2); font-size: 0.72rem; }
/* the short source line (DS 2.6): "K sources" opens the tables in a hover card, a click copies them */
.pv-prov-sources { font: inherit; color: var(--pv-text-2); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.pv-prov-sources:hover { color: var(--pv-primary); }
.pv-how-sources { margin-top: 8px; color: var(--pv-text-2); }
.pv-how-sources-h { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pv-text-3); margin-bottom: 2px; }
.pv-how-sources ul { margin: 0; padding-left: 18px; }
.pv-how-sources code { font-size: 0.76rem; color: var(--pv-text-2); overflow-wrap: anywhere; }
.pv-how-sources-sub { font-size: 0.76rem; color: var(--pv-text-3); margin-top: 2px; }
details.pv-how { background: var(--pv-card); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius-card); padding: 10px 14px; font-size: 0.84rem; }
details.pv-how summary { cursor: pointer; font-weight: 600; color: var(--pv-primary); }
details.pv-how p { margin-top: 6px; color: var(--pv-text-2); max-width: 70ch; }
details.pv-how p + p { margin-top: 8px; }
.pv-kv { display: grid; grid-template-columns: minmax(110px, 140px) 1fr; gap: 4px 10px; font-size: 0.82rem; }
.pv-kv dt { color: var(--pv-text-3); } .pv-kv dd { margin: 0; }
.pv-trace { border-left: 2px solid var(--pv-interactive); padding-left: 10px; font-size: 0.8rem; display: flex; flex-direction: column; gap: 6px; }
.pv-trace > div > b { font-weight: 600; } .pv-trace > div > span { color: var(--pv-text-2); display: block; }

/* ---------- drawer (D8): z-index 300 to 399, under the Ask the Sandbox drawer ---------- */
.pv-scrim { position: fixed; inset: 0; background: rgba(18, 19, 19, 0.28); z-index: 300; display: none; }
.pv-scrim.open { display: block; }
.pv-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--pv-drawer-width), 95vw); background: var(--pv-card); z-index: 301;
  box-shadow: var(--pv-shadow-drawer); transform: translateX(100%); transition: transform 0.2s, width 0.2s; display: flex; flex-direction: column; }
.pv-drawer.wide { --pv-drawer-width: 640px; }
.pv-drawer.open { transform: none; }
.pv-drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--pv-stroke); display: flex; align-items: flex-start; gap: 10px; }
.pv-drawer-head h2 { font-size: 1rem; font-weight: 600; }
.pv-drawer-sub { font-size: 0.78rem; color: var(--pv-text-2); }
.pv-drawer-expand { flex-shrink: 0; white-space: nowrap; }
.pv-drawer-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-drawer-body { padding: 14px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.pv-drawer-body h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }

/* ---------- toast ---------- */
.pv-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--pv-inverse); color: #fff; font-size: 0.8rem; padding: 8px 14px; border-radius: var(--pv-radius); z-index: 390; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.pv-toast.show { opacity: 1; }
/* pv-filters popTop: app content above a dropdown's option list (opt-in) */
.pv-dd-top { padding: 0 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--pv-stroke); }
