@charset "UTF-8";
/* =============================================================================
   H-Index Calculator — block-scoped internals.
   Consumes the shared design tokens + primitives from interactive-card.css.
   Every rule is scoped under #bsb-hindex so it never touches core styles.
   ============================================================================= */

/* ── input mode toggle ─────────────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-modes {
  display: flex;
  gap: 6px;
  background: var(--light-bg);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
#bsb-hindex .bsb-hidx-mode {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#bsb-hindex .bsb-hidx-mode:hover { color: var(--orange); }
#bsb-hindex .bsb-hidx-mode.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

#bsb-hindex .bsb-hidx-panel { display: none; }
#bsb-hindex .bsb-hidx-panel.active { display: block; }

/* ── manual rows ───────────────────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
#bsb-hindex .bsb-hidx-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#bsb-hindex .bsb-hidx-rownum {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--light-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
#bsb-hindex .bsb-hidx-cite { flex: 1; }
#bsb-hindex .bsb-hidx-delrow {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  color: var(--faint);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
#bsb-hindex .bsb-hidx-delrow:hover { color: var(--danger-text); background: var(--danger-bg); }
#bsb-hindex .bsb-hidx-addrow {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
#bsb-hindex .bsb-hidx-addrow:hover { border-color: var(--orange); }
#bsb-hindex .bsb-hidx-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }

/* ── buttons + error ───────────────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-btn-row { display: flex; gap: 10px; margin-top: 18px; }
#bsb-hindex .bsb-hidx-err { margin-top: 12px; }

/* ── result ────────────────────────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-result { display: none; margin-top: 24px; }
#bsb-hindex .bsb-hidx-result.visible { display: block; }

#bsb-hindex .bsb-hidx-headline {
  background: var(--orange);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
}
#bsb-hindex .bsb-hidx-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
#bsb-hindex .bsb-hidx-h-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}
#bsb-hindex .bsb-hidx-h-value { font-size: 44px; font-weight: 800; line-height: 1; }
#bsb-hindex .bsb-hidx-h-explain { margin: 8px 0 0; font-size: 13.5px; opacity: 0.95; line-height: 1.5; }

/* ── secondary metrics ─────────────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
#bsb-hindex .bsb-hidx-metric {
  background: var(--light-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
#bsb-hindex .bsb-hidx-metric-val { display: block; font-size: 22px; font-weight: 700; color: var(--text); }
#bsb-hindex .bsb-hidx-metric-label { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── ranked table (collapsible) ────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-table-wrap, #bsb-hindex .bsb-hidx-limits-wrap { margin-top: 16px; }
#bsb-hindex .bsb-hidx-table-toggle,
#bsb-hindex .bsb-hidx-limits-toggle {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}
#bsb-hindex .bsb-hidx-table, #bsb-hindex .bsb-hidx-limits { display: none; margin-top: 8px; }
#bsb-hindex .bsb-hidx-table.open, #bsb-hindex .bsb-hidx-limits.open { display: block; }
#bsb-hindex .bsb-hidx-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
#bsb-hindex .bsb-hidx-table th {
  text-align: left; padding: 7px 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border-bottom: 1px solid var(--rule);
}
#bsb-hindex .bsb-hidx-table td { padding: 6px 10px; border-bottom: 1px solid var(--rule); color: var(--body-text); }
#bsb-hindex .bsb-hidx-table tr.is-out td { color: var(--faint); }
#bsb-hindex .bsb-hidx-table tr.is-threshold td {
  background: var(--tint);
  font-weight: 700;
  color: var(--orange-dark);
  border-top: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
}

/* ── benchmarking ──────────────────────────────────────────────────────────── */
#bsb-hindex .bsb-hidx-result .bsb-icard__section-label { margin-top: 26px; }
#bsb-hindex .bsb-hidx-bench-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
#bsb-hindex .bsb-hidx-bench-out:empty { display: none; }
#bsb-hindex .bsb-hidx-bench-out { margin-top: 14px; }
#bsb-hindex .bsb-hidx-bench-prompt { margin: 0; font-size: 13px; color: var(--muted); }
#bsb-hindex .bsb-hidx-bench {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border-left: 4px solid var(--border);
  background: var(--light-bg);
}
#bsb-hindex .bsb-hidx-bench.sev-above { border-left-color: var(--success-border); background: var(--success-bg); }
#bsb-hindex .bsb-hidx-bench.sev-near  { border-left-color: var(--orange); background: var(--tint); }
#bsb-hindex .bsb-hidx-bench.sev-below { border-left-color: var(--warning-border); background: var(--warning-bg); }
#bsb-hindex .bsb-hidx-bench-msg { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--body-text); }
#bsb-hindex .bsb-hidx-bench-scale { display: flex; gap: 10px; }
#bsb-hindex .bsb-hidx-bench-item {
  flex: 1; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px;
}
#bsb-hindex .bsb-hidx-bench-num { display: block; font-size: 18px; font-weight: 700; color: var(--text); }
#bsb-hindex .bsb-hidx-bench-tier { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
#bsb-hindex .bsb-hidx-mquot { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
#bsb-hindex .bsb-hidx-discipline-note { margin-top: 12px; }

#bsb-hindex .bsb-hidx-limits ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
#bsb-hindex .bsb-hidx-limits li { font-size: 12.5px; line-height: 1.5; color: var(--body-text); }

/* ── responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  #bsb-hindex .bsb-hidx-metrics { grid-template-columns: repeat(2, 1fr); }
  #bsb-hindex .bsb-hidx-bench-inputs { grid-template-columns: 1fr; }
  #bsb-hindex .bsb-hidx-btn-row { flex-direction: column; }
  #bsb-hindex .bsb-hidx-h-value { font-size: 36px; }
}
