/* PBM Research Explorer — scoped to .pbmx so the theme is untouched. Brand: norahlux.red */
.pbmx {
  --pbmx-ink: #070707;
  --pbmx-text: #4a4c56;
  --pbmx-muted: #8a8c94;
  --pbmx-red: #ec1c24;
  --pbmx-blue: #4593ed;
  --pbmx-line: #e6e6ea;
  --pbmx-plane: #f5f5f7;
  --pbmx-card: #ffffff;
  --pbmx-radius: 14px;
  color: var(--pbmx-text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 0 32px;
  box-sizing: border-box;
}
.pbmx *, .pbmx *::before, .pbmx *::after { box-sizing: inherit; }
.pbmx h2, .pbmx h3, .pbmx h4 { font-family: "Roboto", system-ui, sans-serif; color: var(--pbmx-ink); margin: 0; letter-spacing: -0.4px; line-height: 1.25; text-transform: none; }
.pbmx p { margin: 0; }
.pbmx button, .pbmx select, .pbmx input { font: inherit; color: inherit; margin: 0; }

.pbmx-loading { padding: 64px 16px; text-align: center; color: var(--pbmx-muted); }
.pbmx-error { color: var(--pbmx-red); }

/* Header */
.pbmx-head { margin-bottom: 20px; }
.pbmx-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
.pbmx-title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--pbmx-red); margin-top: 12px; }
.pbmx-intro { margin-top: 12px; font-size: 1.05rem; max-width: 760px; }
.pbmx-meta { margin-top: 6px; font-size: 0.85rem; color: var(--pbmx-muted); }

/* Primary search: find a condition directly */
.pbmx-finder { margin-bottom: 12px; }
.pbmx-finder-label { display: block; font-family: "Roboto", system-ui, sans-serif; font-size: 1rem; font-weight: 700; color: var(--pbmx-ink); margin-bottom: 8px; }
.pbmx-finder-box { position: relative; }
.pbmx-finder-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--pbmx-ink); pointer-events: none; }
.pbmx .pbmx-finder-box input {
  width: 100%; height: 58px; padding: 0 52px 0 50px; border: 2px solid var(--pbmx-ink); border-radius: 999px; background: #fff;
  font-size: 1.05rem; color: var(--pbmx-ink); box-shadow: 0 2px 10px rgba(7, 7, 7, 0.06); outline: none; margin: 0;
}
.pbmx .pbmx-finder-box input::placeholder { color: var(--pbmx-muted); opacity: 1; }
.pbmx .pbmx-finder-box input:focus { border-color: var(--pbmx-red); box-shadow: 0 0 0 4px rgba(236, 28, 36, 0.14); }
.pbmx-finder-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--pbmx-plane); color: var(--pbmx-ink); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0;
}
.pbmx-finder-clear:hover { background: #e6e6ea; }
.pbmx-finder-pop {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); max-height: min(420px, 60vh); overflow-y: auto;
  background: #fff; border: 1px solid var(--pbmx-line); border-radius: 14px; box-shadow: 0 16px 40px rgba(7, 7, 7, 0.14); padding: 6px;
}
.pbmx-opt-group { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--pbmx-muted); padding: 10px 12px 4px; }
.pbmx-opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.pbmx-opt.is-active { background: var(--pbmx-plane); }
.pbmx-opt-main { color: var(--pbmx-ink); font-size: 0.95rem; overflow-wrap: anywhere; }
.pbmx-opt-main em { font-style: normal; color: var(--pbmx-muted); font-size: 0.82rem; margin-left: 8px; }
.pbmx-opt-main mark { background: rgba(236, 28, 36, 0.12); color: inherit; border-radius: 3px; padding: 0 1px; }
.pbmx-opt-n { font-variant-numeric: tabular-nums; font-size: 0.82rem; color: var(--pbmx-text); white-space: nowrap; }
.pbmx-opt-none { padding: 10px 12px; font-size: 0.88rem; color: var(--pbmx-muted); }

.pbmx-activechips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.pbmx-activechips:empty { display: none; }
.pbmx-active-label { font-size: 0.82rem; color: var(--pbmx-muted); margin-right: 2px; }
.pbmx-achip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--pbmx-ink); color: #fff; font-size: 0.85rem; }
.pbmx-achip > span { opacity: .7; }
.pbmx-achip button { width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.pbmx-achip button:hover { background: var(--pbmx-red); }

/* Filters */
.pbmx-filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px;
  background: var(--pbmx-plane); border-radius: var(--pbmx-radius); padding: 16px 18px; margin-bottom: 16px;
}
.pbmx-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pbmx-field label, .pbmx-label { font-size: 0.78rem; font-weight: 600; color: var(--pbmx-ink); text-transform: uppercase; letter-spacing: 0.04em; }
.pbmx-typefield { grid-column: span 2; }
.pbmx-toggles { grid-column: span 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 18px; align-self: end; }
.pbmx-search { grid-column: span 2; }
.pbmx-filters select, .pbmx-filters input[type="search"], .pbmx-controls select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--pbmx-line); border-radius: 10px; background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234a4c56' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; font-size: 0.93rem; line-height: 38px; box-shadow: none; min-height: 0;
}
.pbmx-filters input[type="search"] { background-image: none; padding-right: 12px; }
.pbmx-filters select:disabled { color: var(--pbmx-muted); background-color: #fafafa; }
.pbmx select:focus-visible, .pbmx input:focus-visible, .pbmx button:focus-visible, .pbmx tr:focus-visible, .pbmx a:focus-visible { outline: 2px solid var(--pbmx-blue); outline-offset: 2px; }
.pbmx-inline { display: flex; align-items: center; gap: 6px; }
.pbmx-inline select { flex: 1; }

.pbmx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pbmx-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--pbmx-line);
  background: #fff; cursor: pointer; font-size: 0.88rem; transition: background .15s, border-color .15s;
}
.pbmx-chip i, .pbmx-legend i, .pbmx-kpi-label i, .pbmx-badge i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex: none; }
.pbmx-chip:hover { border-color: #c9cad0; }
.pbmx-chip.is-on { background: var(--pbmx-ink); border-color: var(--pbmx-ink); color: #fff; }
.pbmx-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 400 !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--pbmx-text) !important; cursor: pointer; }
.pbmx-check input { accent-color: var(--pbmx-ink); width: 16px; height: 16px; }

.pbmx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--pbmx-line); background: #fff; color: var(--pbmx-ink); font-size: 0.88rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pbmx-btn:hover { border-color: var(--pbmx-ink); }
.pbmx-btn:disabled { opacity: .4; cursor: default; border-color: var(--pbmx-line); }
.pbmx-btn-primary { background: var(--pbmx-red); border-color: var(--pbmx-red); color: #fff !important; }
.pbmx-btn-primary:hover { background: #c9141b; border-color: #c9141b; }
.pbmx-reset { margin-left: auto; }

/* KPI tiles */
.pbmx-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pbmx-kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--pbmx-radius);
  border: 1px solid var(--pbmx-line); background: var(--pbmx-card); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.pbmx-kpi:hover { border-color: #c9cad0; }
.pbmx-kpi.is-on { border-color: var(--pbmx-ink); box-shadow: inset 0 0 0 1px var(--pbmx-ink); }
.pbmx-kpi-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--pbmx-text); }
.pbmx-kpi-value { font-family: "Roboto", system-ui, sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--pbmx-ink); letter-spacing: -0.8px; line-height: 1.15; }
.pbmx-kpi-sub { font-size: 0.8rem; color: var(--pbmx-muted); min-height: 1.2em; }

/* Cards */
.pbmx-card { background: var(--pbmx-card); border: 1px solid var(--pbmx-line); border-radius: var(--pbmx-radius); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.pbmx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pbmx-grid > .pbmx-card { margin-bottom: 16px; }
.pbmx-grid-flat { gap: 24px; margin-top: 8px; }
.pbmx-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pbmx-card-head h3 { font-size: 1.12rem; font-weight: 700; }
.pbmx-card-head p { font-size: 0.86rem; color: var(--pbmx-muted); margin-top: 2px; }
.pbmx-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.85rem; }
.pbmx-controls label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pbmx-controls select { width: auto; height: 34px; line-height: 32px; font-size: 0.85rem; }

.pbmx-chartbox { position: relative; width: 100%; height: 320px; }
.pbmx-h240 { height: 240px; } .pbmx-h280 { height: 280px; } .pbmx-h300 { height: 300px; }
.pbmx-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.85); color: var(--pbmx-muted); font-size: 0.9rem; }

.pbmx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.84rem; }
.pbmx-legend li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pbmx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.88rem; margin: -4px 0 8px; }
.pbmx-crumbs:empty { display: none; }
.pbmx-crumbs button { background: none; border: 0; padding: 0; color: var(--pbmx-blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pbmx-crumbs strong { color: var(--pbmx-ink); }

.pbmx-human-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pbmx-human-stats div { background: var(--pbmx-plane); border-radius: 10px; padding: 10px 12px; }
.pbmx-human-stats span { display: block; font-size: 0.78rem; color: var(--pbmx-text); }
.pbmx-human-stats strong { font-family: "Roboto", system-ui, sans-serif; font-size: 1.3rem; color: var(--pbmx-ink); }

/* Ranked lists */
.pbmx-rank { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.pbmx-rank li { display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto 6px; column-gap: 10px; row-gap: 4px; padding: 8px 0; border-top: 1px solid var(--pbmx-line); margin: 0; align-items: baseline; }
.pbmx-rank li:first-child { border-top: 0; }
.pbmx-rank-n { grid-row: span 2; font-family: "Roboto", system-ui, sans-serif; font-weight: 700; color: var(--pbmx-muted); font-size: 0.9rem; }
.pbmx-rank-name { color: var(--pbmx-ink); font-size: 0.93rem; overflow-wrap: anywhere; }
.pbmx-rank-name em { font-style: normal; color: var(--pbmx-muted); font-size: 0.8rem; }
.pbmx-rank-name button { background: none; border: 0; padding: 0; color: var(--pbmx-ink); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: #d0d0d6; text-underline-offset: 3px; }
.pbmx-rank-name button:hover { text-decoration-color: var(--pbmx-red); }
.pbmx-rank-v { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--pbmx-ink); font-size: 0.9rem; }
.pbmx-rank-bar { grid-column: 2 / 4; height: 6px; background: var(--pbmx-plane); border-radius: 3px; overflow: hidden; }
.pbmx-rank-bar i { display: block; height: 100%; background: var(--pbmx-text); border-radius: 3px; }
.pbmx-rank-empty { display: block !important; color: var(--pbmx-muted); }

/* Table */
.pbmx-tablewrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.pbmx-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 760px; margin: 0; border: 0; }
.pbmx-table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pbmx-muted); font-weight: 600; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--pbmx-line); background: none; }
.pbmx-table td { padding: 12px 10px; border: 0; border-bottom: 1px solid var(--pbmx-line); vertical-align: top; background: none; }
.pbmx-table tr[data-i] { cursor: pointer; }
.pbmx-table tr[data-i]:hover td { background: #fafafb; }
.pbmx-table tr.is-open td { background: var(--pbmx-plane); border-bottom-color: transparent; }
.pbmx-year { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--pbmx-ink); width: 56px; }
.pbmx-t { display: block; color: var(--pbmx-ink); font-weight: 500; }
.pbmx-by { display: block; color: var(--pbmx-muted); font-size: 0.8rem; margin-top: 2px; }
.pbmx-cond { display: block; color: var(--pbmx-ink); }
.pbmx-badges { white-space: nowrap; }
.pbmx-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; margin: 0 8px 2px 0; }
.pbmx-light { white-space: nowrap; }
.pbmx-flag { display: inline-block; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; background: #fff4d6; color: #7a5600; margin: 6px 6px 0 0; }
.pbmx-flag.is-bad { background: #fde2e3; color: #a3060c; }
.pbmx-empty-row { text-align: center; color: var(--pbmx-muted); padding: 32px !important; }

.pbmx-detail td { background: var(--pbmx-plane) !important; padding: 0 10px 18px !important; }
.pbmx-detail-body { background: #fff; border-radius: 12px; padding: 16px 18px; cursor: auto; }
.pbmx-detail-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pbmx-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; }
.pbmx-detail h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pbmx-muted); margin: 14px 0 6px; font-weight: 600; }
.pbmx-detail p { font-size: 0.88rem; }
.pbmx-detail blockquote { margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--pbmx-red); font-size: 0.88rem; font-style: normal; color: var(--pbmx-text); background: none; quotes: none; }
.pbmx-detail blockquote::before, .pbmx-detail blockquote::after { content: none; }
.pbmx-params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0; }
.pbmx-params div { margin: 0; }
.pbmx-params dt { font-size: 0.74rem; color: var(--pbmx-muted); margin: 0; }
.pbmx-params dd { margin: 0; font-size: 0.88rem; color: var(--pbmx-ink); font-variant-numeric: tabular-nums; }

.pbmx-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 0.86rem; color: var(--pbmx-muted); }
.pbmx-pager div { display: flex; gap: 8px; }
.pbmx-foot { font-size: 0.8rem; color: var(--pbmx-muted); max-width: 860px; }
.pbmx .pbmx-copy { margin-top: 2px; }

@media (max-width: 980px) {
  .pbmx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pbmx-human-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pbmx-detail-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 720px) {
  .pbmx-grid { grid-template-columns: 1fr; gap: 0; }
  .pbmx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbmx-kpis .pbmx-kpi:first-child { grid-column: span 2; }
  .pbmx-human-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbmx-typefield, .pbmx-toggles, .pbmx-search { grid-column: auto; }
  .pbmx-filters { grid-template-columns: 1fr; }
  .pbmx-card { padding: 14px; }
  .pbmx-tablewrap { margin: 0 -14px; padding: 0 14px; }
  .pbmx-reset { margin-left: 0; }
}
