/* Admin portal: layout and the few pieces the UI kit does not have.
   Colours, type and controls come from /kit/mzo_theme.css (--mzo-* tokens, .ui-* classes). */

html.ui, html.ui body { height: 100%; }
html.ui body { background: var(--mzo-canvas); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden; }
html.ui a { color: inherit; }
:where(html.ui) :focus-visible { outline: 2px solid var(--mzo-accent); outline-offset: 2px; border-radius: var(--mzo-radius-sm); }
.pt-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.pt-mono { font-family: var(--mzo-mono); font-size: 12px; }
.pt-nil { color: var(--mzo-faint); }
.pt-sub { color: var(--mzo-muted); font-size: 12px; }
.pt-pre { white-space: pre-wrap; word-break: break-word; }
.pt-break { word-break: break-all; }
.pt-pad { padding: 8px; }

/* ---------- brand ---------- */
.pt-brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px; min-width: 0; text-decoration: none; }
.pt-mark { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--mzo-ink); color: var(--mzo-bg); }
.pt-mark .ui-i { width: 15px; height: 15px; stroke-width: 2; }
.pt-brand-t { min-width: 0; line-height: 1.2; }
.pt-brand-t b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.pt-brand-t span { display: block; font-size: 11.5px; color: var(--mzo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sign-in ---------- */
.pt-login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; overflow: auto; }
html.ui body:has(.pt-login:not([hidden])) { overflow: auto; }
.pt-login-card { width: min(360px, 100%); display: grid; gap: 14px; padding: 24px; background: var(--mzo-surface); border: 1px solid var(--mzo-border); border-radius: 12px; box-shadow: var(--mzo-shadow-pop); }
.pt-login-card .pt-brand { padding: 0; margin-bottom: 4px; }
.pt-login-card h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.pt-field { display: grid; gap: 6px; font-size: 12.5px; color: var(--mzo-text-2); }
.pt-field .ui-input { width: 100%; padding: 0 10px; height: 36px; }
.pt-login-btn { height: 36px; width: 100%; }
.pt-login-msg { margin: 0; padding: 8px 10px; border-radius: 7px; background: var(--mzo-bad-soft); color: var(--mzo-bad); font-size: 12.5px; }
.pt-login-msg.info { background: var(--mzo-surface-2); color: var(--mzo-text-2); box-shadow: inset 0 0 0 1px var(--mzo-border); }
.pt-login-foot { margin: 0; font-size: 12px; color: var(--mzo-faint); text-align: center; }

/* ---------- app layout ---------- */
.pt-app { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100dvh; }
.pt-sb { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px 8px 8px; gap: 8px; background: var(--mzo-canvas); }
.pt-sb-search { display: block; max-width: none; flex: none; }
.pt-sb-search .ui-input { height: 32px; background: var(--mzo-surface); }
.pt-sb-mode { display: flex; }
.pt-sb-mode button { flex: 1; }
.pt-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -8px; padding: 2px 8px 8px; scrollbar-width: thin; scrollbar-color: var(--mzo-border-strong) transparent; }
.pt-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 8px 4px; font-size: 11px; font-weight: 500; color: var(--mzo-faint); white-space: nowrap; }
.pt-sec small { font-size: 11px; font-variant-numeric: tabular-nums; }
.pt-ni { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 8px; border-radius: var(--mzo-radius-sm); color: var(--mzo-text-2); text-decoration: none; white-space: nowrap; transition: background-color .1s, color .1s; }
html.ui .pt-ni { color: var(--mzo-text-2); }
.pt-ni:hover { background: var(--mzo-hover); color: var(--mzo-text); }
.pt-ni .ui-i { color: var(--mzo-muted); }
.pt-ni .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pt-ni small { flex: none; color: var(--mzo-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pt-ni .ui-dot { margin: 0 3px 0 1px; }
html.ui .pt-ni[aria-current="page"] { background: var(--mzo-surface); color: var(--mzo-text); font-weight: 500; box-shadow: 0 0 0 1px var(--mzo-border), 0 1px 2px rgba(0, 0, 0, .04); }
.pt-ni[aria-current="page"] .ui-i { color: var(--mzo-text); }
.pt-ni-top { margin-top: 2px; }
.pt-nav-empty { margin: 16px 8px; color: var(--mzo-muted); font-size: 12.5px; }
.pt-nav-load { display: grid; gap: 10px; padding: 16px 8px; }
.pt-sb-foot { border-top: 1px solid var(--mzo-border); margin: 0 -8px; padding: 8px 8px 0; }
.pt-me { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px; border: 0; border-radius: var(--mzo-radius-sm); background: none; text-align: left; cursor: pointer; }
.pt-me:hover, .pt-me[aria-expanded="true"] { background: var(--mzo-hover); }
.pt-av { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--mzo-surface); box-shadow: 0 0 0 1px var(--mzo-border-strong); font-size: 11.5px; font-weight: 600; color: var(--mzo-text-2); }
.pt-me-t { flex: 1; min-width: 0; line-height: 1.25; }
.pt-me-t b { display: block; font-weight: 500; font-size: 12.75px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-me-t span { display: block; font-size: 11.5px; color: var(--mzo-muted); }
.pt-me .ui-i { color: var(--mzo-faint); }

.pt-main { min-width: 0; min-height: 0; padding: 8px 8px 8px 0; display: flex; }
.pt-shell { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--mzo-bg); border-radius: 10px; box-shadow: 0 0 0 1px var(--mzo-border), 0 1px 2px rgba(0, 0, 0, .03); overflow: hidden; }
.pt-bar { height: 44px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px; border-bottom: 1px solid var(--mzo-border); background: var(--mzo-surface); }
.pt-menu-btn { display: none; }
.pt-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding-left: 6px; font-size: 13px; white-space: nowrap; }
.pt-crumbs .c-g { color: var(--mzo-muted); overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.pt-crumbs .c-s { color: var(--mzo-faint); }
.pt-crumbs .c-p { color: var(--mzo-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.pt-bar-busy { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--mzo-border-strong); border-top-color: var(--mzo-accent); animation: ui-spin .8s linear infinite; margin-right: 6px; }
.pt-bar-busy[hidden] { display: none; }
.pt-view { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.pt-page { padding-top: 20px; }

/* Data tab fills the panel: the grid scrolls, the page does not. */
.pt-view-fill { display: flex; flex-direction: column; }
.pt-view-fill > .pt-page { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: 16px; }
.pt-view-fill .pt-tabbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pt-view-fill .pt-data { flex: 1; min-height: 360px; display: flex; flex-direction: column; }
.pt-view-fill .pt-grid { flex: 1 1 0; min-height: 0; }

/* account menu */
.pt-menu { position: fixed; z-index: 960; width: 252px; padding: 6px; background: var(--mzo-surface); border-radius: 10px; box-shadow: 0 0 0 1px var(--mzo-border), var(--mzo-shadow-pop); }
.pt-menu[hidden] { display: none; }
.pt-menu-h { margin: -6px -6px 6px; padding: 12px 14px 10px; border-bottom: 1px solid var(--mzo-border); }
.pt-menu-h b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-menu-h span { display: block; margin-top: 1px; font-size: 12px; color: var(--mzo-muted); }
.pt-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 38px; padding: 4px 4px 4px 8px; color: var(--mzo-text-2); }
.pt-theme-seg button { width: 30px; padding: 0; display: grid; place-items: center; }
.pt-mi { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: var(--mzo-radius-sm); background: none; color: var(--mzo-text-2); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.pt-mi[hidden] { display: none; }
.pt-mi:hover { background: var(--mzo-hover); color: var(--mzo-text); }
.pt-mi .ui-i { color: var(--mzo-muted); }
.pt-mi.danger:hover, .pt-mi.danger:hover .ui-i { color: var(--mzo-bad); }
.pt-menu hr { border: 0; border-top: 1px solid var(--mzo-border); margin: 6px -6px; }

/* ---------- page pieces ---------- */
.pt-head { align-items: flex-start; margin-bottom: 14px; }
.pt-head-t { min-width: 0; }
.pt-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.pt-meta { display: block; }
.pt-meta time { color: var(--mzo-text-2); }
.pt-fresh-b { gap: 6px; }
.pt-fresh { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pt-src { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pt-src .ui-i { color: var(--mzo-muted); }
.pt-link { display: inline-flex; align-items: center; gap: 4px; color: var(--mzo-accent); text-decoration: none; white-space: nowrap; }
html.ui a.pt-link { color: var(--mzo-accent); }
.pt-link:hover { text-decoration: underline; }
.pt-link .ui-i { width: 13px; height: 13px; }
.pt-stats { --n: 6; }
.pt-stats .ui-stat .k .ui-dot { margin-right: -1px; }
.pt-ov-grid { margin-top: 0; }
.pt-ov-grid + .ui-panel { margin-top: 16px; }
.ui-panel-h .ui-note { margin-left: auto; }
.pt-skel { width: 40%; margin: 0 auto; }
.pt-ds-a { display: grid; gap: 1px; text-decoration: none; }
.pt-ds-a b { font-weight: 500; }
.pt-ds-a small { color: var(--mzo-muted); font-size: 11.5px; }
.pt-ds-a:hover b { text-decoration: underline; }
.pt-dstable td { vertical-align: middle; }
.pt-share { min-width: 140px; }
.pt-chg { color: var(--mzo-text-2); font-variant-numeric: tabular-nums; }
.pt-msg { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mzo-text-2); }
.pt-type { font-family: var(--mzo-mono); font-size: 11px; }
.pt-att { list-style: none; margin: 0; padding: 4px 0; }
.pt-att li + li { border-top: 1px solid var(--mzo-border); }
.pt-att-a { display: grid; gap: 3px; padding: 10px 16px; text-decoration: none; }
.pt-att-a:hover { background: var(--mzo-row-hover); }
.pt-att-t { display: flex; align-items: center; gap: 8px; }
.pt-att-t b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-att-s { font-size: 12px; color: var(--mzo-muted); padding-left: 15px; }
.pt-att-e { font-size: 12px; color: var(--mzo-bad); padding-left: 15px; overflow-wrap: anywhere; }

/* clickable table headers (sort) */
.pt-th { display: inline-flex; align-items: center; gap: 4px; max-width: 280px; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.pt-th span { overflow: hidden; text-overflow: ellipsis; }
.pt-th:hover { color: var(--mzo-text); background: var(--mzo-hover); }
.pt-th.on { color: var(--mzo-text); }
.ui-table th.num .pt-th { flex-direction: row-reverse; }
.pt-sort-i { width: 12px; height: 12px; stroke-width: 2.2; }
.ui-table th[aria-sort]::after { content: none; }

/* dataset tabs */
.pt-tabs { margin: 0 0 14px; padding: 0; border-bottom: 1px solid var(--mzo-border); }
.pt-tabs .ui-drill-tab { display: inline-flex; align-items: center; text-decoration: none; }
html.ui .pt-tabs .ui-drill-tab { color: var(--mzo-muted); }
html.ui .pt-tabs .ui-drill-tab[aria-selected="true"], html.ui .pt-tabs .ui-drill-tab:hover { color: var(--mzo-text); }
.pt-tabs .ui-drill-tab:first-child { padding-left: 2px; }
.pt-tabs .ui-drill-tab:first-child[aria-selected="true"]::after { left: 0; }
.pt-tabbody > .ui-panel + .ui-panel { margin-top: 16px; }

/* ---------- data grid ---------- */
.pt-toolbar { position: relative; gap: 8px; padding: 8px 10px; min-height: 0; }
.pt-q { flex: 1 1 220px; max-width: 360px; }
.pt-q .ui-input { height: 30px; }
.pt-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.ui-btn.on { background: var(--mzo-surface-2); border-color: var(--mzo-text-2); }
.pt-summary { margin-left: auto; color: var(--mzo-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--mzo-border); }
.pt-chips[hidden] { display: none; }
.pt-chip { display: inline-flex; align-items: center; max-width: 100%; height: 26px; border-radius: 6px; background: var(--mzo-surface-2); box-shadow: inset 0 0 0 1px var(--mzo-border-strong); font-size: 12.5px; }
.pt-chip-b { min-width: 0; height: 100%; padding: 0 4px 0 9px; border: 0; background: none; color: var(--mzo-text-2); font: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.pt-chip-b b { font-weight: 500; color: var(--mzo-text); }
.pt-chip-b i { font-style: normal; color: var(--mzo-text); font-family: var(--mzo-mono); font-size: 12px; }
.pt-chip-x { width: 24px; height: 100%; display: grid; place-items: center; border: 0; background: none; color: var(--mzo-muted); cursor: pointer; border-radius: 0 6px 6px 0; }
.pt-chip-x:hover { color: var(--mzo-text); background: var(--mzo-hover); }
.pt-chip-x .ui-i { width: 13px; height: 13px; }
.pt-note { padding: 6px 12px; border-bottom: 1px solid var(--mzo-border); font-size: 12px; color: var(--mzo-warn); background: var(--mzo-warn-soft); }
.pt-note[hidden] { display: none; }
.pt-progress { position: relative; height: 2px; margin-bottom: -2px; z-index: 3; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .15s; }
.pt-data.busy .pt-progress { opacity: 1; }
.pt-progress::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: -35%; background: var(--mzo-accent); border-radius: 2px; animation: pt-prog 1s ease-in-out infinite; }
@keyframes pt-prog { to { left: 100%; } }
.pt-data.busy tbody { opacity: .55; transition: opacity .15s .1s; }

.pt-grid { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pt-table { font-size: 12.75px; }
.pt-table th { padding: 8px 12px; background: var(--mzo-surface-2); z-index: 2; }
.pt-table td { padding: 6px 12px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-table tbody tr:focus-visible { outline: 2px solid var(--mzo-accent); outline-offset: -2px; }
.pt-table .rn { position: sticky; left: 0; z-index: 1; min-width: 56px; color: var(--mzo-faint); background: var(--mzo-surface); box-shadow: inset -1px 0 0 var(--mzo-border); font-size: 12px; }
.pt-table th.rn { z-index: 4; background: var(--mzo-surface-2); }
.pt-table td.t-date { color: var(--mzo-text-2); }
.pt-table td.t-bool { color: var(--mzo-muted); }
.pt-table td.t-bool.on { color: var(--mzo-text); font-weight: 500; }
.pt-table td.t-json { font-family: var(--mzo-mono); font-size: 11.5px; color: var(--mzo-text-2); max-width: 260px; }
.pt-table .ui-empty p { margin: 0 0 12px; }
.pt-table tbody tr:only-child:hover td { background: none; }

.pt-pager { flex-wrap: wrap; gap: 8px 12px; padding: 7px 10px 7px 16px; }
.pt-pages { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.pt-size select { height: 28px; font-size: 12.5px; margin-right: 8px; }
.pt-page-l { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px; white-space: nowrap; }
.pt-page-in { width: 64px; height: 28px; padding: 0 6px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.pt-page-in::-webkit-inner-spin-button, .pt-page-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pt-range { font-variant-numeric: tabular-nums; }

/* popovers (filter builder, columns) */
.pt-pop { position: fixed; z-index: 950; width: min(340px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; padding: 12px; background: var(--mzo-surface); border-radius: 10px; box-shadow: 0 0 0 1px var(--mzo-border), var(--mzo-shadow-pop); }
.pt-pop.wide { width: min(320px, calc(100vw - 16px)); }
.pt-pop h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.pt-fb { display: grid; gap: 8px; }
.pt-fb h4 { margin-bottom: 2px; }
.pt-fb .ui-select, .pt-fb .ui-select select { display: block; width: 100%; max-width: none; }
.pt-fval { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pt-fval[hidden] { display: none; }
.pt-fval .ui-input { width: 100%; padding: 0 10px; }
.pt-and { font-size: 12px; color: var(--mzo-muted); }
.pt-err { margin: 0; font-size: 12.5px; color: var(--mzo-bad); }
.pt-pop-f { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.pt-colpop .ui-input { width: 100%; padding: 0 10px; margin-bottom: 6px; }
.pt-cols { display: grid; max-height: min(360px, 55dvh); overflow: auto; margin: 0 -6px; padding: 0 2px; }
.pt-check { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--mzo-text-2); }
.pt-check:hover { background: var(--mzo-hover); color: var(--mzo-text); }
.pt-check input { margin: 0; accent-color: var(--mzo-fill); }
.pt-check span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-check small { color: var(--mzo-faint); font-family: var(--mzo-mono); font-size: 11px; }

/* row drawer */
.pt-drawer > section { width: min(580px, 100%); outline: none; }
.pt-drawer header { z-index: 2; align-items: center; }
.pt-drawer header p { font-family: var(--mzo-mono); font-size: 11.5px; }
.pt-drawer-b { padding-bottom: 24px; }
.pt-drawer-b > .ui-empty { padding: 32px 16px; }
.pt-dl { grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); }
.pt-dl dt { display: grid; align-content: start; gap: 1px; word-break: break-word; }
.pt-dl dt small, .pt-fname { font-family: var(--mzo-mono); font-size: 11px; color: var(--mzo-faint); }
.pt-dl dd { min-width: 0; }
.pt-drawer-h { margin: 12px 20px 0; font-size: 12px; font-weight: 600; color: var(--mzo-muted); text-transform: none; }
.pt-sys dd { font-size: 11.5px; word-break: break-all; }
.pt-json { margin: 0; padding: 8px 10px; max-height: 320px; overflow: auto; border-radius: 6px; background: var(--mzo-surface-2); box-shadow: inset 0 0 0 1px var(--mzo-border); font: 11.5px/1.5 var(--mzo-mono); white-space: pre-wrap; word-break: break-word; }
.pt-error { color: var(--mzo-bad); background: var(--mzo-bad-soft); box-shadow: none; }

/* source tab */
.pt-src-dl { padding-top: 4px; grid-template-columns: 180px minmax(0, 1fr); }
.pt-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px; align-items: baseline; }
.pt-k { color: var(--mzo-muted); }
.pt-kv .pt-mono, .pt-list .pt-mono { word-break: break-all; }
.pt-list { display: grid; gap: 3px; }
.pt-url { display: block; margin-top: 2px; font-family: var(--mzo-mono); font-size: 11px; word-break: break-all; }

/* ---------- phone: sidebar becomes a drawer ---------- */
.pt-scrim { display: none; }
@media (max-width: 900px) {
  .pt-app { grid-template-columns: minmax(0, 1fr); }
  .pt-sb { position: fixed; z-index: 920; inset: 0 auto 0 0; width: min(300px, 86vw); box-shadow: var(--mzo-shadow-pop); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
  body.pt-drawer-open .pt-sb { transform: none; }
  .pt-scrim { display: block; position: fixed; inset: 0; z-index: 910; background: var(--mzo-scrim); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.pt-drawer-open .pt-scrim { opacity: 1; pointer-events: auto; }
  .pt-main { padding: 0; }
  .pt-shell { border-radius: 0; box-shadow: none; }
  .pt-menu-btn { display: inline-flex; }
  .pt-page { padding-top: 14px; }
  .pt-stats { --n: 3; }
  .ui-panel-h .ui-note { margin-left: 0; }
}
@media (max-width: 760px) {
  .pt-head .ui-actions { width: 100%; }
  .pt-stats.ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-stats.ui-stats > .ui-stat:last-child:nth-child(odd) { grid-column: auto; }
  .pt-tabs { overflow-x: auto; }
  .pt-q { max-width: none; flex-basis: 100%; }
  .pt-summary { margin-left: 0; }
  .pt-toolbar { padding: 8px; }
  .pt-pager { padding: 6px 8px; justify-content: center; }
  .pt-range { width: 100%; text-align: center; }
  .pt-pages { margin: 0 auto; }
  .pt-hide-xs { display: none; }
  .pt-size select { margin-right: 2px; }
  .pt-view-fill .pt-data { min-height: 0; }
  .pt-view-fill .pt-grid { flex: none; max-height: 62dvh; }
  .pt-view-fill { display: block; }
  .pt-view-fill > .pt-page { display: block; }
  .pt-view-fill .pt-tabbody { display: block; }
  .pt-msg { max-width: 220px; }
  .pt-dl { grid-template-columns: minmax(0, 1fr); }
  .pt-dl dt { padding-bottom: 0; border-bottom: 0; }
  .pt-dl dd { padding-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-sb, .pt-scrim { transition: none; }
}

/* ---------- data quality ---------- */
.ui-badge.pt-info, .ui-badge.pt-sev.pt-info { background: var(--mzo-info-soft); color: var(--mzo-info); box-shadow: none; }
.ui-dot.pt-dot-info { background: var(--mzo-info); }
.pt-band-ok { --bar: var(--mzo-ok-mark); }
.pt-band-warn { --bar: var(--mzo-warn-mark); }
.pt-band-bad { --bar: var(--mzo-bad-mark); }
.pt-band-t-ok { color: var(--mzo-ok); }
.pt-band-t-warn { color: var(--mzo-warn); }
.pt-band-t-bad { color: var(--mzo-bad); }
.pt-score { min-width: 120px; }
.pt-score span { width: 28px; color: var(--mzo-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-score-c { min-width: 150px; }
.pt-count { font-weight: 600; }
.pt-count.bad { color: var(--mzo-bad); }
.pt-count.warn { color: var(--mzo-warn); }
.pt-worst { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-worst-i { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.pt-worst-i small { overflow: hidden; text-overflow: ellipsis; }
.pt-colc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-col { padding: 1px 6px; border-radius: 5px; background: var(--mzo-surface-2); box-shadow: inset 0 0 0 1px var(--mzo-border); font: 11.5px var(--mzo-mono); color: var(--mzo-text-2); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-qtable td { vertical-align: middle; }

/* Overview card */
.pt-dq { margin-bottom: 16px; }
.pt-dq-b { display: grid; grid-template-columns: auto minmax(220px, 1.2fr) minmax(0, 2fr); gap: 16px 28px; align-items: center; padding: 16px 18px; }
.pt-dq-b > .ui-empty { grid-column: 1 / -1; padding: 24px 0; }
.pt-dq-avg { display: flex; align-items: center; gap: 12px; }
.pt-dq-num { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pt-dq-k { font-size: 12.5px; color: var(--mzo-muted); }
.pt-dq-s { font-size: 12px; color: var(--mzo-faint); margin-top: 2px; }
.pt-dq-bands { display: grid; gap: 6px; }
.pt-dq-band { display: grid; grid-template-columns: 8px 92px minmax(60px, 1fr) 40px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mzo-text-2); }
.pt-dq-band .ui-bar { min-width: 0; }
.pt-dq-band > b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--mzo-text); }
.pt-dq-sev { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pt-dq-sevi { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--mzo-surface-2); text-decoration: none; min-width: 0; }
html.ui a.pt-dq-sevi:hover { background: var(--mzo-hover); }
.pt-dq-sevi b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-dq-sevi span { font-size: 12px; color: var(--mzo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-dq-last b { font-size: 13px; padding-top: 4px; }

/* Quality page */
.pt-qtiles { --n: 6; }
.pt-qlast { font-size: 15px; letter-spacing: 0; }
.pt-qdone, .pt-qfilters { display: none; }
.pt-qbar { gap: 8px; margin-bottom: 14px; }
.pt-qbar-h { display: none; }
.pt-qsearch { flex: 1 1 220px; max-width: 300px; }
.pt-qf { display: inline-flex; }
.pt-qf-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-qsheet { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--mzo-border-strong); background: var(--mzo-surface); font-size: 13px; white-space: nowrap; cursor: pointer; }
.pt-qsheet input { margin: 0; accent-color: var(--mzo-fill); }
.pt-qsheet:has(input:checked) { background: var(--mzo-surface-2); border-color: var(--mzo-text-2); font-weight: 500; }
.pt-qtabs { margin: 0 0 12px; padding: 0; }
.pt-qtabs .ui-drill-tab { display: inline-flex; align-items: center; text-decoration: none; }
html.ui .pt-qtabs .ui-drill-tab { color: var(--mzo-muted); }
html.ui .pt-qtabs .ui-drill-tab[aria-selected="true"], html.ui .pt-qtabs .ui-drill-tab:hover { color: var(--mzo-text); }
.pt-qtabs .ui-drill-tab:first-child { padding-left: 2px; }
.pt-qtabs .ui-drill-tab:first-child[aria-selected="true"]::after { left: 0; }
.pt-qscrim { display: none; }

/* Owner action list */
.pt-act-g { border-top: 1px solid var(--mzo-border); }
.pt-act-g:first-of-type { border-top: 0; }
.pt-act-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 6px; }
.pt-act-t { display: grid; gap: 1px; min-width: 0; }
.pt-act-t b { font-size: 13.5px; font-weight: 600; }
.pt-act-b { display: flex; gap: 6px; flex: none; }
.pt-act-l { list-style: none; margin: 0; padding: 0 8px 10px; }
.pt-act-i { padding: 8px 8px 9px; border-radius: 8px; cursor: pointer; }
.pt-act-i:hover { background: var(--mzo-row-hover); }
.pt-act-i:focus-visible { outline: 2px solid var(--mzo-accent); outline-offset: -2px; }
.pt-act-1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.pt-act-1 b { font-weight: 500; }
.pt-act-n { color: var(--mzo-text-2); font-variant-numeric: tabular-nums; }
.pt-act-hint { margin: 4px 0 0; color: var(--mzo-text-2); font-size: 12.5px; line-height: 1.45; }
.pt-act-s { margin: 5px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.pt-act-s li { font: 11.5px/1.45 var(--mzo-mono); color: var(--mzo-muted); overflow-wrap: anywhere; }
.pt-act-s li::before { content: "e.g. "; font-family: var(--mzo-font); color: var(--mzo-faint); }

/* Issue drawer */
.pt-drawer-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 20px 2px; }
.pt-hint-full { margin: 6px 20px 0; font-size: 13px; line-height: 1.5; color: var(--mzo-text); }
.pt-drawer-pad { padding: 8px 20px 0; }
.pt-sample { border: 1px solid var(--mzo-border); border-radius: 8px; }
.pt-sample .ui-table { font-size: 12px; }
.pt-sample .ui-table th, .pt-sample .ui-table td { padding: 6px 10px; font-family: var(--mzo-mono); font-size: 11.5px; }
.pt-sample .ui-table th { background: var(--mzo-surface-2); font-family: var(--mzo-font); }
.pt-sample .ui-table td { white-space: normal; max-width: 320px; overflow-wrap: anywhere; vertical-align: top; }
.pt-sample-kv { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pt-sample-kv > li { padding: 8px 10px; border-radius: 8px; background: var(--mzo-surface-2); box-shadow: inset 0 0 0 1px var(--mzo-border); }
.pt-sample-kv dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: 12px; }
.pt-sample-kv dt { color: var(--mzo-muted); }
.pt-sample-kv dd { margin: 0; font-family: var(--mzo-mono); font-size: 11.5px; overflow-wrap: anywhere; }

/* Dataset Quality tab */
.pt-dsq { display: grid; grid-template-columns: auto minmax(160px, 320px) minmax(0, 1fr); gap: 12px 28px; align-items: center; padding: 16px 18px; }
.pt-dsq-score { display: grid; gap: 2px; }
.pt-dsq-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--mzo-text-2); font-size: 12.5px; }
.pt-dsq-meta span { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1180px) {
  .pt-dq-b { grid-template-columns: auto minmax(0, 1fr); }
  .pt-dq-sev { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  /* Filters slide in from the right */
  .pt-qfilters, .pt-qdone { display: inline-flex; }
  .pt-qbar { position: fixed; z-index: 930; inset: 0 0 0 auto; width: min(320px, 88vw); margin: 0; padding: 0 14px 24px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; overflow-y: auto; background: var(--mzo-surface); border-left: 1px solid var(--mzo-border); box-shadow: var(--mzo-shadow-pop); transform: translateX(104%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
  body.pt-qside-open .pt-qbar { transform: none; }
  .pt-qbar-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -14px; padding: 12px 14px 10px; background: var(--mzo-surface); border-bottom: 1px solid var(--mzo-border); }
  .pt-qbar-h h2 { margin: 0; font-size: 14px; font-weight: 600; }
  .pt-qbar-h h2 small { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--mzo-accent); }
  .pt-qsearch { flex: none; max-width: none; }
  .pt-qf { display: grid; gap: 4px; }
  .pt-qf-l { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 11.5px; color: var(--mzo-muted); }
  .pt-qbar .ui-select select { width: 100%; max-width: none; height: 36px; }
  .pt-qsheet { height: 36px; }
  .pt-qbar > .ui-btn.ghost { align-self: flex-start; }
  .pt-qscrim { display: block; position: fixed; inset: 0; z-index: 925; background: var(--mzo-scrim); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.pt-qside-open .pt-qscrim { opacity: 1; pointer-events: auto; }
  .pt-qtiles { --n: 3; }
  .pt-dsq { grid-template-columns: auto minmax(0, 1fr); }
  .pt-dsq-meta { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .pt-qtiles.ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-dq-b { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .pt-dq-sev { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-act-h { flex-wrap: wrap; padding: 12px 12px 6px; }
  .pt-act-l { padding: 0 4px 8px; }
  .pt-qtabs { overflow-x: auto; }
  /* Tables become cards */
  .ui-table.pt-cards thead { display: none; }
  .ui-table.pt-cards, .ui-table.pt-cards tbody { display: block; }
  .ui-table.pt-cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 14px; border-bottom: 1px solid var(--mzo-border); }
  .ui-table.pt-cards tbody tr:last-child { border-bottom: 0; }
  .ui-table.pt-cards td, .ui-table.pt-cards td:first-child, .ui-table.pt-cards td:last-child { display: block; padding: 0; border: 0; text-align: left; white-space: normal; max-width: none; min-width: 0; background: none; overflow-wrap: anywhere; }
  .ui-table.pt-cards td::before { content: attr(data-label); display: block; margin-bottom: 1px; font-size: 11px; color: var(--mzo-faint); }
  .ui-table.pt-cards td.pt-card-main { grid-column: 1 / -1; }
  .ui-table.pt-cards td.pt-card-main::before { content: none; }
  .ui-table.pt-cards td.hide-sm { display: none; }
  .ui-table.pt-cards tbody tr:hover td { background: none; }
  .ui-table.pt-cards tbody tr.click:hover { background: var(--mzo-row-hover); }
  .ui-table.pt-cards .ui-bar { min-width: 0; }
  .pt-worst, .pt-colc { max-width: none; white-space: normal; }
}
.pt-sevcounts { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.pt-sevcounts i { font-style: normal; color: var(--mzo-faint); }
.pt-sevc { white-space: nowrap; }
.pt-groupc { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-qtable td { white-space: nowrap; }
.pt-qtable td.pt-card-main { white-space: normal; min-width: 170px; }
.pt-dq-last b { white-space: normal; font-size: 12.5px; }
@media (max-width: 760px) {
  .ui-table.pt-cards .pt-worst-i { display: inline; }
  .ui-table.pt-cards .pt-worst-i .ui-dot { margin-right: 6px; vertical-align: 1px; }
  .ui-table.pt-cards .pt-groupc { max-width: none; white-space: normal; }
}
.pt-tabbody > * + * { margin-top: 16px; }
.pt-dsq-bar .pt-score span { display: none; }
