/* Palomar Registry Explorer: Editorial Light & Dark Theme Stylesheet */

.wrap-palomar {
  max-width: 1320px;
}
.wrap-palomar [hidden],
.pe-drawer-backdrop[hidden] {
  display: none !important;
}

/* Header & Scope Banner */
.pe-intro {
  margin-bottom: 18px;
}
.pe-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 10px;
}
.pe-title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  min-width: 0;
}
.pe-title-group h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.pe-ext-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--math-blue-soft);
  color: var(--math-blue);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--math-blue) 26%, transparent);
}
.pe-ext-pill:hover {
  text-decoration: underline;
  color: var(--math-blue);
}

.pe-scope-note {
  padding: 10px 14px;
  border-left: 3px solid var(--math-blue);
  background: color-mix(in srgb, var(--math-blue-soft) 55%, var(--surface));
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}
.pe-scope-note p {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.pe-scope-note strong {
  color: var(--text);
}

.pe-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}
.pe-meta-strip strong {
  color: var(--text-secondary);
  font-weight: 600;
}
.pe-sep {
  opacity: 0.5;
}

/* KPI Summary Cards */
.pe-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.pe-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--text);
  font-family: var(--sans);
  min-width: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.pe-kpi:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.pe-kpi.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}
.pe-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.pe-kpi-value {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pe-kpi-unit {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.pe-kpi-sub {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Mode Tabs & Action Strip */
.pe-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 12px;
}
.pe-tabs {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.pe-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pe-tab:hover {
  color: var(--text);
}
.pe-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.pe-tab-count {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
}
.pe-tab.is-active .pe-tab-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.pe-mode-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pe-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pe-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
#pe-analytics-toggle::after {
  content: "▸";
  font-size: 11px;
}
#pe-analytics-toggle[aria-expanded="true"]::after {
  content: "▾";
}

/* Visual Analytics Panel */
.pe-analytics-wrap {
  margin-bottom: 16px;
}
.pe-analytics-scope {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
}
.pe-analytics {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.15fr;
  gap: 12px;
}
.pe-analytics[hidden] {
  display: none;
}
.pe-time-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
}
.pe-swatch-bar, .pe-swatch-line {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}
.pe-swatch-bar {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--math-blue);
  opacity: 0.78;
}
.pe-swatch-line {
  width: 14px;
  height: 2px;
  background: var(--accent);
}
.pe-time-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  fill: var(--accent);
  fill-opacity: 1;
}
.pe-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pe-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 10px;
}
.pe-chart-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}
.pe-chart-note {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
}
.pe-chart-body {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}
.pe-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.pe-svg text {
  font-family: var(--sans);
  fill: var(--muted);
}
.pe-chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  background: var(--ink-btn);
  color: var(--ink-btn-text);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.35;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

/* Horizontal meter bars (Axioms & Trust) */
.pe-hbar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pe-hbar-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  color: var(--text);
}
.pe-hbar-btn:hover {
  background: var(--surface-alt);
  border-color: var(--line);
}
.pe-hbar-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.pe-hbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pe-hbar-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.pe-hbar-track {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.pe-hbar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--math-blue);
  transition: width 180ms ease;
}
.pe-hbar-fill.is-green { background: var(--b-lean-fg); }
.pe-hbar-fill.is-amber { background: var(--b-cited-fg); }
.pe-hbar-fill.is-red { background: var(--b-counter-fg); }
.pe-hbar-fill.is-purple { background: var(--b-bound-fg); }

/* Compared buckets & arXiv chips inside Card 3 */
.pe-dist-split {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pe-dist-subhead {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 4px;
}
.pe-bucket-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 82px;
}
.pe-bucket-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
}
.pe-bucket-col:hover {
  background: var(--surface-alt);
  border-color: var(--line);
}
.pe-bucket-col.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.pe-bucket-num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.pe-bucket-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: var(--math-blue);
}
.pe-bucket-col.is-active .pe-bucket-bar {
  background: var(--accent);
}
.pe-bucket-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.pe-arxiv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pe-arxiv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.pe-arxiv-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-arxiv-btn.is-active {
  background: var(--ink-btn);
  color: var(--ink-btn-text);
  border-color: var(--ink-btn);
}
.pe-arxiv-btn code {
  font-family: var(--mono);
  font-size: 11px;
}
.pe-arxiv-btn span {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.85;
}

/* Search, Controls & Filters Panel */
.pe-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.pe-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pe-search-box {
  position: relative;
  flex: 1 1 320px;
  min-width: min(100%, 260px);
}
.pe-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.pe-search-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
}
.pe-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pe-search-kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  pointer-events: none;
}
.pe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pe-select {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 100%;
}
.pe-select-sm {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 13px;
}
.pe-view-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.pe-view-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.pe-view-btn:first-child {
  border-left: 0;
}
.pe-view-btn.is-active {
  background: var(--ink-btn);
  color: var(--ink-btn-text);
}

.pe-primary-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.pe-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pe-filter-kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.pe-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.pe-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-chip.is-active {
  background: var(--ink-btn);
  color: var(--ink-btn-text);
  border-color: var(--ink-btn);
}
.pe-chip .pe-n {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.85;
}
/* Keep WCAG AA contrast >= 4.5:1 on zero-count chips in both light and dark modes. */
.pe-chip.is-empty:not(.is-active) {
  color: var(--muted);
  border-style: dashed;
  border-color: var(--line-strong);
}
.pe-chip.is-empty:not(.is-active) .pe-n {
  opacity: 1;
}

.pe-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}
.pe-more-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-more-toggle::after {
  content: "▾";
  font-size: 11px;
}
.pe-more-toggle[aria-expanded="true"]::after {
  content: "▴";
}
.pe-more-badge:empty {
  display: none;
}
.pe-more-badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}

.pe-more-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.pe-more-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.pe-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pe-field label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.pe-field .pe-select {
  min-height: 36px;
  font-size: 13px;
  width: 100%;
}
.pe-signals-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.pe-sliders-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}
.pe-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pe-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--sans);
  font-size: 12.5px;
}
.pe-slider-head label {
  font-weight: 600;
  color: var(--text-secondary);
}
.pe-slider-head output {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.pe-slider-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pe-preset {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
}
.pe-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Active filter pills */
.pe-active-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.pe-active-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pe-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pe-pill-active:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.pe-reset-btn {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.pe-reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Status Row */
.pe-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.pe-status-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
.pe-result-count {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pe-kbd-hint {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.pe-kbd-hint code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
}
.pe-status-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pe-per-label {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
}

/* Loading & Empty States */
.pe-loading, .pe-empty {
  padding: 36px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  color: var(--muted);
  margin-bottom: 18px;
}
.pe-empty p {
  margin: 0 0 12px;
  font-size: 15px;
}

/* Data Table */
.pe-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.pe-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.pe-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13.5px;
  min-width: 860px;
}
.pe-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line-strong);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.pe-table thead th.col-owner {
  min-width: 158px;
}
.pe-table thead th.num, .pe-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pe-th-sort, .pe-org-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.pe-th-sort:hover, .pe-org-sort:hover {
  color: var(--text);
}
.pe-th-sort::after, .pe-org-sort::after {
  content: "↕";
  opacity: 0.45;
  font-size: 11px;
}
th[aria-sort="ascending"] .pe-th-sort::after,
th[aria-sort="ascending"] .pe-org-sort::after {
  content: "↑";
  opacity: 1;
  color: var(--accent);
}
th[aria-sort="descending"] .pe-th-sort::after,
th[aria-sort="descending"] .pe-org-sort::after {
  content: "↓";
  opacity: 1;
  color: var(--accent);
}
.pe-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background-color 100ms ease;
}
.pe-table tbody tr:last-child {
  border-bottom: 0;
}
.pe-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-alt) 55%, var(--surface));
}
.pe-table tbody tr.is-focused {
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.pe-table tbody td {
  padding: 10px 12px;
  vertical-align: top;
}
.pe-row-id-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}
.pe-id-code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.pe-row-title-btn {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
}
.pe-row-title-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}
.pe-row-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.pe-owner-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--math-blue);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  word-break: break-word;
}
.pe-owner-btn:hover {
  text-decoration: underline;
}
.pe-area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.pe-area-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

/* Ratio Cell & Micro-meter */
.pe-ratio-main {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.pe-ratio-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.pe-meter {
  width: 96px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line-strong) 45%, var(--surface-alt));
  border: 1px solid color-mix(in srgb, var(--line-strong) 65%, transparent);
  overflow: hidden;
  margin-top: 4px;
}
.pe-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--math-blue);
}
.pe-meter-fill.is-high { background: var(--b-lean-fg); }
.pe-meter-fill.is-low { background: var(--b-cited-fg); }

/* Semantic Badges inside Explorer */
.pe-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.pe-pill-pure { background: var(--b-lean-bg); color: var(--b-lean-fg); }
.pe-pill-compiler { background: var(--b-cited-bg); color: var(--b-cited-fg); }
.pe-pill-custom { background: var(--b-counter-bg); color: var(--b-counter-fg); }
.pe-pill-trust-high { background: var(--b-proved-bg); color: var(--b-proved-fg); }
.pe-pill-trust-other { background: var(--b-cited-bg); color: var(--b-cited-fg); }
.pe-pill-warn { background: var(--b-counter-bg); color: var(--b-counter-fg); }
.pe-pill-clean { background: var(--surface-alt); color: var(--muted); }
.pe-pill-ver { background: var(--b-bound-bg); color: var(--b-bound-fg); font-family: var(--mono); font-size: 11px; }
.pe-pill-hyp { background: var(--b-counter-bg); color: var(--b-counter-fg); border: 1px solid color-mix(in srgb, var(--b-counter-fg) 35%, transparent); }
.pe-pill-wrapper {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 10.5px;
}
.pe-pill-neutral {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--line);
}
.pe-badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pe-date-cell {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.pe-date-sub {
  display: block;
  font-size: 10.5px;
  opacity: 0.85;
  margin-top: 2px;
}
.pe-mobile-scroll-cue {
  display: none;
  margin: 0;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* Cards View */
.pe-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.pe-cards-grid[hidden] {
  display: none;
}
.pe-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}
.pe-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.pe-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.pe-card-body {
  padding: 14px 16px 10px;
  flex: 1 1 auto;
}
.pe-card-title {
  margin: 6px 0 6px;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.3;
}
.pe-card-title button {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.pe-card-title button:hover {
  color: var(--accent);
  text-decoration: underline;
}
.pe-card-abs {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.48;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pe-thm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.pe-thm-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.pe-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-alt) 55%, var(--surface));
  font-family: var(--sans);
  font-size: 13px;
}
.pe-card-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}
.pe-card-inspect {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}
.pe-card-inspect:hover {
  text-decoration: underline;
}
.pe-card-link {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
}
.pe-card-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Pagination */
.pe-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 18px;
  font-family: var(--sans);
  font-size: 13.5px;
}
.pe-pagination[hidden] {
  display: none;
}
.pe-page-info {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pe-page-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.pe-page-btn {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pe-page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-page-btn.is-current {
  background: var(--ink-btn);
  color: var(--ink-btn-text);
  border-color: var(--ink-btn);
}
.pe-page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Organizations Benchmark Panel */
.pe-orgs-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 18px;
}
.pe-orgs-panel[hidden] {
  display: none;
}
.pe-orgs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.pe-orgs-head h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--text);
}
.pe-orgs-head p {
  margin: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--muted);
}
.pe-orgs-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pe-org-search {
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
}
.pe-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.pe-orgs-table {
  min-width: 1010px;
}
.pe-orgs-table th:first-child,
.pe-orgs-table td:first-child {
  min-width: 152px;
}
.pe-orgs-table td:first-child .pe-owner-btn {
  word-break: normal;
  overflow-wrap: anywhere;
}
.pe-orgs-table tbody tr {
  cursor: pointer;
}
.pe-org-filter-btn {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pe-org-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-sub-num {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* Methodology Footer Section */
.pe-methodology {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  scroll-margin-top: 76px;
}
.pe-methodology h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
}
.pe-methodology p, .pe-methodology li {
  font-size: 13.5px;
  line-height: 1.52;
  color: var(--text-secondary);
}
.pe-methodology p {
  margin: 0 0 8px;
}
.pe-methodology ul {
  margin: 0;
  padding-left: 18px;
}
.pe-methodology li {
  margin-bottom: 6px;
}
.pe-methodology code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Entry Inspector Slide-Over Drawer */
.pe-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 14, 12, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}
.pe-drawer-backdrop[hidden] {
  display: none;
}
.pe-drawer {
  width: min(740px, 100vw);
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  color: var(--text);
  border-left: 1px solid var(--line-strong);
  box-shadow: -12px 0 42px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  outline: none;
}
.pe-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  font-family: var(--sans);
}
.pe-drawer-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.pe-mono-id {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.pe-ver-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--math-blue-soft);
  color: var(--math-blue);
  font-weight: 600;
}
.pe-date-kicker {
  font-size: 12.5px;
  color: var(--muted);
}
.pe-drawer-close {
  min-width: 40px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.pe-drawer-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 32px;
}
.pe-drawer-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--text);
}
.pe-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.pe-drawer-actions .btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.pe-audit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.pe-audit-tile {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--sans);
  min-width: 0;
}
.pe-audit-tile-k {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 3px;
}
.pe-audit-tile-v {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pe-audit-tile-s {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.pe-dsec {
  margin-bottom: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pe-dsec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pe-dsec h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.pe-dsec h3 a {
  color: var(--math-blue);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.pe-dsec h3 a:hover {
  text-decoration: underline;
}
.pe-drawer-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pe-live-note {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.pe-imports-details {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.pe-imports-details > summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--math-blue);
  padding: 2px 0;
}
.pe-imports-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.pe-hyp-list {
  margin: 6px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--b-counter-fg);
}
.pe-hyp-list code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--b-counter-bg);
  color: var(--b-counter-fg);
  padding: 1px 5px;
  border-radius: 4px;
}
.pe-copy-btn {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pe-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pe-drawer-abs {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.58;
  color: var(--text);
}
.pe-dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
}
.pe-dl dt {
  color: var(--muted);
  font-weight: 600;
}
.pe-dl dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.pe-dl code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 3px;
}
.pe-code-block {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  overflow-x: auto;
  max-height: 300px;
  white-space: pre;
}
.pe-warn-list, .pe-paper-list {
  margin: 0;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-secondary);
}
.pe-warn-list li {
  margin-bottom: 5px;
  color: var(--b-counter-fg);
}
.pe-paper-list li {
  margin-bottom: 7px;
  line-height: 1.45;
}
.pe-note-callout {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--b-cited-fg);
  background: color-mix(in srgb, var(--b-cited-bg) 50%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .pe-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pe-analytics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-analytics .pe-chart-card:last-child { grid-column: 1 / -1; }
  .pe-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .pe-mobile-scroll-cue { display: block; }
  .pe-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-kpis .pe-kpi:first-child { grid-column: 1 / -1; }
  .pe-analytics { grid-template-columns: minmax(0, 1fr); }
  .pe-analytics .pe-chart-card:last-child { grid-column: auto; }
  .pe-cards-grid { grid-template-columns: minmax(0, 1fr); }
  .pe-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-sliders-row { grid-template-columns: minmax(0, 1fr); }
  .pe-audit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-kbd-hint { display: none; }
}

@media (max-width: 560px) {
  .pe-intro { padding-top: 6px; margin-bottom: 12px; }
  .pe-meta-strip { gap: 4px 12px; }
  .pe-meta-strip .pe-sep { display: none; }
  .pe-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  .pe-kpis .pe-kpi:first-child { grid-column: 1 / -1; }
  .pe-kpi { padding: 9px 11px; gap: 2px; }
  .pe-kpi-value { font-size: 1.3rem; }
  .pe-kpi-sub { font-size: 11.5px; }
  .pe-more-grid { grid-template-columns: minmax(0, 1fr); }
  .pe-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pe-dl dd { margin-bottom: 6px; }
  .pe-drawer-body { padding: 14px 14px 28px; }
  .pe-search-kbd { display: none; }
  .pe-mode-actions { width: 100%; }
  .pe-mode-actions .pe-action-btn { flex: 1 1 auto; justify-content: center; }
}
