/* Paivo component styles. Load after tokens.css and base.css. Class names start with pv-. */

/* Layout helper */
.pv-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }

/* Logo */
.pv-logo { display: inline-flex; align-items: center; gap: var(--space-10); color: var(--ink); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
a.pv-logo-link { display: inline-flex; align-items: center; gap: var(--space-10); min-width: 0; color: var(--ink); text-decoration: none; border-radius: var(--radius-control); }
.pv-side-name { display: none; }

/* Button */
.pv-btn { font: inherit; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); height: var(--control-height); padding: 0 var(--space-14); border-radius: var(--radius-control); border: 1px solid var(--line-strong); background: var(--sheet); color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer; }
a.pv-btn, a.pv-btn:hover { color: var(--ink); }
.pv-btn:hover { background: var(--fill); }
.pv-btn--primary, a.pv-btn--primary, a.pv-btn--primary:hover { padding: 0 var(--space-16); background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pv-btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.pv-btn--quiet { background: transparent; border-color: transparent; padding: 0 var(--space-12); }
.pv-btn--quiet:hover { background: var(--fill-chip); }
.pv-btn--danger-outline, a.pv-btn--danger-outline { border-color: var(--danger-outline); color: var(--danger); }
.pv-btn--danger, a.pv-btn--danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); padding: 0 var(--space-16); }
.pv-btn--danger:hover { background: var(--danger); }
.pv-btn--sm { height: var(--control-height-dense); padding: 0 var(--space-12); }
.pv-btn--lg { height: var(--control-height-touch); padding: 0 var(--space-20); }
.pv-btn--icon { width: var(--icon-button); height: var(--icon-button); padding: 0; }
.pv-btn--block { width: 100%; }
.pv-btn[disabled], .pv-btn[disabled]:hover { background: var(--disabled-fill); border-color: var(--line); color: var(--ink-3); cursor: not-allowed; }

/* Fields */
.pv-field { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.pv-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.pv-help { margin: 0; font-size: 13px; color: var(--ink-3); }
.pv-error { margin: 0; font-size: 13px; color: var(--danger); }
.pv-control { display: flex; align-items: center; height: var(--control-height); border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--sheet); overflow: hidden; }
.pv-control:focus-within { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.pv-control.is-dense { height: var(--control-height-dense); }
.pv-control.is-invalid { border-color: var(--danger-dot); }
.pv-control input, .pv-control select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 0 var(--space-12); }
.pv-control input:focus-visible, .pv-control select:focus-visible { outline: none; }
.pv-control input::placeholder { color: var(--ink-3); }
.pv-control.is-mono input { font-family: var(--font-mono); font-size: 13px; }
.pv-control select { padding: 0 var(--space-10); cursor: pointer; }
.pv-control select option { background: var(--sheet); color: var(--ink); }
.pv-control:has(input:disabled, select:disabled) { background: var(--fill-quiet); border-color: var(--line); }
.pv-control input:disabled, .pv-control select:disabled { color: var(--ink-2); cursor: not-allowed; }
.pv-prefix { padding-left: var(--space-12); color: var(--ink-3); }
.pv-prefix + input { padding-left: var(--space-4); }
.pv-suffix { align-self: stretch; display: flex; align-items: center; padding: 0 var(--space-12); border-left: 1px solid var(--line); background: var(--fill-quiet); color: var(--ink-2); font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }

.pv-control .pv-color-swatch { flex: none; width: 28px; height: 28px; margin-left: var(--space-6); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-item); background: transparent; cursor: pointer; }
.pv-control .pv-color-swatch + input { padding-left: var(--space-8); }
.pv-color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.pv-color-swatch::-webkit-color-swatch { border: 0; border-radius: calc(var(--radius-item) - 1px); }
.pv-color-swatch::-moz-color-swatch { border: 0; border-radius: calc(var(--radius-item) - 1px); }
.pv-control .pv-color-swatch:disabled { cursor: not-allowed; }

.pv-textarea { width: 100%; min-height: 96px; padding: var(--space-10) var(--space-12); border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--sheet); color: var(--ink); font: inherit; line-height: 20px; resize: vertical; }
.pv-textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.pv-textarea:disabled { background: var(--fill-quiet); border-color: var(--line); color: var(--ink-2); }

/* Checkbox */
.pv-check { display: inline-flex; align-items: flex-start; gap: var(--space-10); cursor: pointer; }
.pv-check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ink); }
.pv-check-text { display: flex; flex-direction: column; gap: 2px; }
.pv-check-desc { font-size: 13px; color: var(--ink-3); }

/* Radio card */
.pv-radiocard { display: flex; gap: var(--space-12); align-items: flex-start; padding: var(--space-16); border-radius: var(--radius-card); border: 1.5px solid var(--line); background: var(--sheet); cursor: pointer; min-width: 0; }
.pv-radiocard.is-checked, .pv-radiocard:has(input:checked) { border-color: var(--ink); }
.pv-radiocard.is-disabled { background: var(--fill); cursor: not-allowed; }
.pv-radiocard input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ink); }
.pv-radiocard-body { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.pv-radiocard-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); font-weight: 600; }
.pv-radiocard.is-disabled .pv-radiocard-title { color: var(--ink-2); }
.pv-radiocard-desc { font-size: 13px; color: var(--ink-2); }
.pv-radiocard-example { font-size: 12.5px; font-weight: 500; }
.pv-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: var(--space-12); }

/* Toggle chip */
.pv-chip { display: inline-flex; align-items: center; gap: var(--space-8); height: var(--control-height-dense); padding: 0 var(--space-12); border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--sheet); font-size: 13px; font-weight: 500; cursor: pointer; }
.pv-chip.is-on, .pv-chip:has(input:checked) { background: var(--cobalt-soft); border-color: var(--cobalt-line); }
.pv-chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }

/* Pills */
.pv-pill { display: inline-flex; align-items: center; gap: var(--space-6); height: 22px; padding: 0 var(--space-8); border-radius: var(--radius-pill); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.pv-pill-dot { width: 6px; height: 6px; border-radius: var(--radius-pill); }
.pv-pill--success { background: var(--success-fill); color: var(--success); }
.pv-pill--success .pv-pill-dot { background: var(--success-dot); }
.pv-pill--neutral { background: var(--fill-chip); color: var(--ink-2); }
.pv-pill--neutral .pv-pill-dot { background: var(--neutral-dot); }
.pv-pill--warning { background: var(--warning-fill); color: var(--warning); }
.pv-pill--warning .pv-pill-dot { background: var(--warning-dot); }
.pv-pill--danger { background: var(--danger-fill); color: var(--danger); }
.pv-pill--danger .pv-pill-dot { background: var(--danger-dot); }
.pv-pill--accent { background: var(--cobalt-soft); color: var(--cobalt-ink); }
.pv-label-pill { height: 20px; font-size: 11.5px; }

/* Meter */
.pv-meter { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.pv-meter-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-8); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-meter-top strong { font-weight: 600; }
.pv-meter-of { color: var(--ink-2); }
.pv-meter-note { color: var(--ink-3); }
.pv-meter-pool { color: var(--cobalt-ink); }
.pv-meter-track { height: var(--meter-height); border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.pv-meter-fill { height: 100%; border-radius: var(--radius-pill); background: var(--cobalt); }
.pv-meter-fill.is-pool { background: var(--cobalt-light); }

/* Stat tile */
.pv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-12); }
.pv-tile { display: flex; flex-direction: column; gap: var(--space-10); padding: var(--space-16) var(--space-20); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--sheet); min-width: 0; }
.pv-tile-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.pv-tile-value { display: flex; align-items: baseline; gap: var(--space-6); }
.pv-tile-num { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.pv-tile-unit { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pv-tile-sub { font-size: 13px; color: var(--ink-3); }

/* Callout */
.pv-callout { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12) var(--space-16); padding: var(--space-12) var(--space-16); border-radius: var(--radius-panel); border: 1px solid transparent; }
.pv-callout-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-pill); }
.pv-callout-body { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pv-callout-title { font-weight: 600; color: var(--ink); }
.pv-callout-text { color: var(--ink-2); }
.pv-callout--warning { background: var(--warning-callout); border-color: var(--warning-line); }
.pv-callout--warning .pv-callout-icon { background: var(--warning-fill); color: var(--warning); }
.pv-callout--problem { background: var(--danger-callout); border-color: var(--danger-line); }
.pv-callout--problem .pv-callout-icon { background: var(--danger-fill); color: var(--danger); }
.pv-callout--note { background: var(--fill-quiet); }
.pv-callout--note .pv-callout-icon { background: var(--fill-chip); color: var(--ink-2); }

/* Empty state */
.pv-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); padding: var(--space-48) var(--space-24); text-align: center; }
.pv-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--fill-chip); color: var(--ink-2); }
.pv-empty-title { font-weight: 600; }
.pv-empty-text { max-width: 300px; font-size: 13px; color: var(--ink-3); }
.pv-empty-action { margin-top: var(--space-8); }
.pv-empty.is-drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-card); background: var(--fill); }
.pv-empty.is-drop .pv-empty-icon { background: var(--sheet); border: 1px solid var(--line); }

/* Table */
.pv-table-box { position: relative; border: 1px solid var(--line); border-radius: var(--radius-card); overflow-x: auto; background: var(--sheet); }
.pv-table { width: 100%; border-collapse: collapse; }
.pv-table th { text-align: left; padding: var(--space-10) var(--space-16); background: var(--fill); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.pv-table td { padding: var(--space-14) var(--space-16); border-top: 1px solid var(--line-soft); vertical-align: middle; }
.pv-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.pv-table-namecell { display: flex; flex-direction: column; gap: 2px; }
.pv-table-name, a.pv-table-name, a.pv-table-name:hover { font-weight: 600; color: var(--ink); text-decoration: none; }
a.pv-table-name:hover { text-decoration: underline; }
.pv-table-sub { font-size: 13px; color: var(--ink-3); }
/* A row whose name is a link: the link covers the whole row, and other controls in the row sit above it. */
.pv-table tbody tr:has(a.pv-table-name) { position: relative; cursor: pointer; }
.pv-table tbody tr:has(a.pv-table-name):hover td { background: var(--fill-quiet); }
.pv-table tbody a.pv-table-name::after { content: ""; position: absolute; inset: 0; }
.pv-table tbody tr:has(a.pv-table-name) :is(a:not(.pv-table-name), button, input, select, textarea, label) { position: relative; z-index: 1; }
@media (max-width: 760px) {
  .pv-table-box.is-stacked { overflow: visible; }
  .pv-table-box.is-stacked .pv-table { min-width: 0 !important; }
  .pv-table-box.is-stacked thead { display: none; }
  .pv-table-box.is-stacked tr { display: flex; flex-direction: column; gap: var(--space-10); padding: var(--space-16); }
  .pv-table-box.is-stacked tr + tr { border-top: 1px solid var(--line-soft); }
  .pv-table-box.is-stacked td { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); padding: 0; border: 0; text-align: left; }
  .pv-table-box.is-stacked td:first-child { justify-content: flex-start; }
  .pv-table-box.is-stacked td[data-label]::before { content: attr(data-label); flex: none; font-size: 13px; color: var(--ink-3); }
}

/* Menu */
.pv-menu { display: flex; flex-direction: column; width: 236px; padding: var(--space-6); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--shadow-float); }
.pv-menu-item { display: flex; align-items: center; gap: var(--space-10); height: var(--control-height-dense); padding: 0 var(--space-10); border: 0; border-radius: var(--radius-item); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pv-menu-item:hover { background: var(--fill-chip); }
.pv-menu-item.is-danger { color: var(--danger); }
.pv-menu-sep { height: 1px; margin: var(--space-6) 0; background: var(--line-soft); }
.pv-menu-anchor { display: inline-flex; }
.pv-menu-pop { position: fixed; inset: auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; }

/* Dialog */
.pv-scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--space-16); background: var(--scrim); }
.pv-dialog-stage { display: flex; justify-content: center; padding: var(--space-32) var(--space-16); background: var(--scrim); }
.pv-dialog { width: min(480px, 100%); display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-24); background: var(--sheet); border-radius: var(--radius-sheet); box-shadow: var(--shadow-dialog); }
.pv-dialog-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; }
.pv-dialog-body { color: var(--ink-2); }
.pv-dialog-body p { margin: 0; }
.pv-dialog-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--space-4); }
.pv-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-8); }

/* Tabs */
.pv-tabs { display: flex; gap: var(--space-24); border-bottom: 1px solid var(--line); overflow-x: auto; --pv-fade-start: 0px; --pv-fade-end: 0px; mask-image: linear-gradient(to right, transparent, var(--ink) var(--pv-fade-start), var(--ink) calc(100% - var(--pv-fade-end)), transparent); }
/* Set by Tabs while more tabs sit beyond that edge. The mask only uses alpha, so any opaque colour works. */
.pv-tabs[data-more-start] { --pv-fade-start: var(--space-64); }
.pv-tabs[data-more-end] { --pv-fade-end: var(--space-64); }
.pv-tab, a.pv-tab, a.pv-tab:hover { position: relative; flex: none; display: inline-flex; align-items: center; height: var(--control-height-touch); color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
a.pv-tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
a.pv-tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }

/* Sidebar */
.pv-side { width: var(--sidebar-width); min-height: 560px; display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-16) var(--space-14); background: var(--ground); color: var(--ink); }
.pv-side-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding-left: var(--space-6); }
.pv-bell { position: relative; color: var(--ink-2); }
.pv-bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--cobalt); box-shadow: 0 0 0 2px var(--ground); }
.pv-agency { display: flex; align-items: center; gap: var(--space-10); padding: var(--space-10); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--sheet); }
.pv-agency-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-control); background: var(--cobalt-soft); color: var(--cobalt-ink); font-size: 12px; font-weight: 600; }
.pv-agency-text, .pv-account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-agency-name, .pv-account-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-account-name { font-weight: 500; }
.pv-agency-sub, .pv-account-email { font-size: 12px; line-height: 16px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-nav { display: flex; flex-direction: column; gap: 2px; }
.pv-nav-item, a.pv-nav-item, a.pv-nav-item:hover { display: flex; align-items: center; gap: var(--space-10); height: var(--control-height); padding: 0 var(--space-10); border: 1px solid transparent; border-radius: var(--radius-control); color: var(--ink); text-decoration: none; font-weight: 500; }
a.pv-nav-item:hover { background: var(--fill-chip); }
a.pv-nav-item[aria-current="page"] { background: var(--sheet); border-color: var(--line); box-shadow: var(--shadow-nav); }
.pv-nav-dot { flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: var(--radius-pill); background: var(--cobalt); }
.pv-account { margin-top: auto; display: flex; align-items: center; gap: var(--space-10); padding: var(--space-14) 0 0 var(--space-6); border-top: 1px solid var(--line); }
.pv-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 600; }

/* Page header */
.pv-header { display: flex; flex-direction: column; gap: var(--space-16); }
.pv-back, a.pv-back, a.pv-back:hover { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--space-4); height: 28px; color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; }
.pv-header-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-16); }
.pv-header-text { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.pv-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-10); }
.pv-title { margin: 0; font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.pv-subtitle { margin: 0; color: var(--ink-2); }
.pv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-10); font-size: 13px; color: var(--ink-2); }
.pv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }

/* Save bar */
.pv-savebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12); padding-top: var(--space-20); border-top: 1px solid var(--line-soft); }
.pv-savebar-note { font-size: 13px; color: var(--ink-3); }
.pv-savebar-note.is-dirty { color: var(--warning); }

/* Copy field */
.pv-copy { display: flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--fill-quiet); overflow: hidden; }
.pv-copy code { flex: 1; min-width: 0; display: flex; align-items: center; height: var(--control-height); padding: 0 var(--space-12); font-family: var(--font-mono); font-size: 13px; white-space: nowrap; overflow-x: auto; }
.pv-copy button { flex: none; display: inline-flex; align-items: center; gap: var(--space-6); padding: 0 var(--space-14); border: 0; border-left: 1px solid var(--line-strong); background: var(--sheet); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pv-copy button:hover { background: var(--fill); }

/* Setup steps */
.pv-steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--sheet); }
.pv-step { display: flex; gap: var(--space-16); padding: var(--space-24); }
.pv-step + .pv-step { border-top: 1px solid var(--line-soft); }
.pv-step-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pv-step.is-current .pv-step-num { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pv-step.is-done .pv-step-num { background: var(--success-fill); border-color: var(--success-fill); color: var(--success); }
.pv-step.is-blocked .pv-step-num { border-color: var(--line); color: var(--ink-3); }
.pv-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-12); }
.pv-step-head { display: flex; flex-direction: column; gap: var(--space-4); }
.pv-step-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.pv-step-text { margin: 0; color: var(--ink-2); }
.pv-step.is-blocked .pv-step-title { color: var(--ink-2); }
.pv-step.is-blocked .pv-step-text { color: var(--ink-3); }

/* Notifications */
.pv-popover { width: min(392px, 100%); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-float); overflow: hidden; }
.pv-popover-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding: var(--space-6) var(--space-6) var(--space-6) var(--space-16); border-bottom: 1px solid var(--line-soft); }
.pv-popover-title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.pv-notes { list-style: none; margin: 0; padding: var(--space-4) 0; }
.pv-note { position: relative; display: flex; gap: var(--space-12); padding: var(--space-12) var(--space-16); }
/* A linked row: the title's link covers the whole row. */
.pv-note-link, .pv-note-link:hover { color: inherit; text-decoration: none; }
.pv-note-link::after { content: ''; position: absolute; inset: 0; }
.pv-note-link:focus-visible { outline: none; }
.pv-note:has(.pv-note-link):hover { background: var(--fill-chip); }
.pv-note:has(.pv-note-link:focus-visible) { outline: 2px solid var(--cobalt); outline-offset: -2px; }
.pv-note-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-pill); }
.pv-note-icon.is-danger { background: var(--danger-fill); color: var(--danger); }
.pv-note-icon.is-success { background: var(--success-fill); color: var(--success); }
.pv-note-icon.is-warning { background: var(--warning-fill); color: var(--warning); }
.pv-note-icon.is-accent { background: var(--cobalt-soft); color: var(--cobalt-ink); }
.pv-note-icon.is-neutral { background: var(--fill-chip); color: var(--ink-2); }
.pv-note-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-note-row { display: flex; justify-content: space-between; gap: var(--space-8); }
.pv-note-title { flex: 1; min-width: 0; font-weight: 600; }
.pv-note-time { flex: none; font-size: 12px; color: var(--ink-3); }
.pv-note-dot { flex: none; width: 8px; height: 8px; margin-top: var(--space-6); border-radius: var(--radius-pill); background: var(--cobalt); }
.pv-notes-empty { margin: 0; padding: var(--space-20) var(--space-16); font-size: 13px; color: var(--ink-3); }
.pv-note-detail { font-size: 13px; color: var(--ink-2); }
.pv-popover-foot { padding: var(--space-12) var(--space-16); border-top: 1px solid var(--line-soft); background: var(--fill); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* App shell: sidebar on the ground, the work on one white sheet */
.pv-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; background: var(--ground); }
.pv-shell > .pv-side { width: auto; height: 100%; min-height: 0; }
.pv-sheet { margin: var(--space-8) var(--space-8) var(--space-8) 0; min-width: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-sheet); }
.pv-content { max-width: var(--content-max); margin: 0 auto; padding: var(--space-40) var(--space-48) var(--space-64); display: flex; flex-direction: column; gap: var(--space-28); }
.pv-content.has-back { padding-top: var(--space-32); }
.pv-reading { max-width: var(--reading-max); }
@media (max-width: 760px) {
  .pv-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .pv-shell > .pv-side { height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 var(--space-8); padding: var(--space-12) var(--space-16) 0; border-bottom: 1px solid var(--line); }
  .pv-shell .pv-side-top { flex: 1; min-width: 0; padding-left: 0; }
  .pv-shell .pv-logo > span { display: none; }
  .pv-shell .pv-side-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .pv-shell .pv-agency, .pv-shell .pv-account-text { display: none; }
  .pv-shell .pv-account { order: 1; margin-top: 0; padding: 0; border-top: 0; gap: var(--space-4); }
  .pv-shell .pv-nav { order: 2; flex-basis: 100%; flex-direction: row; gap: var(--space-24); margin-top: var(--space-4); overflow-x: auto; }
  .pv-shell a.pv-nav-item, .pv-shell a.pv-nav-item:hover { position: relative; flex: none; height: var(--control-height-touch); padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-2); }
  .pv-shell a.pv-nav-item .pv-icon { display: none; }
  .pv-shell a.pv-nav-item[aria-current="page"] { color: var(--ink); font-weight: 600; background: none; box-shadow: none; }
  .pv-shell a.pv-nav-item[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
  .pv-sheet { margin: 0; border: 0; border-radius: 0; }
  .pv-content { padding: var(--space-24) var(--space-16) var(--space-48); }
}

/* Layout helpers: the card, settings rows and loading blocks the reference screens use */
.pv-card { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; padding: var(--space-20); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-card); }
.pv-card.is-flush { gap: 0; padding: 0; overflow: hidden; }
.pv-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-8) var(--space-16); }
.pv-card.is-flush > .pv-card-head { padding: var(--space-16) var(--space-20); border-bottom: 1px solid var(--line-soft); }
.pv-section-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.pv-card-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.pv-desc { margin: 0; color: var(--ink-2); }
.pv-settings { display: flex; flex-direction: column; }
.pv-setting { display: flex; flex-wrap: wrap; gap: var(--space-16) var(--space-48); padding: var(--space-28) 0; border-top: 1px solid var(--line-soft); }
.pv-setting:first-child { padding-top: var(--space-8); border-top: 0; }
.pv-setting-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: var(--space-4); }
.pv-setting-control { flex: 2 1 420px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.pv-skeleton { display: block; background: var(--line-soft); border-radius: var(--radius-control); }
