/* ── RTP result pane ── */
.rtp-result-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rtp-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.rtp-result-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
}
.rtp-big-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.03em;
  line-height: 1;
}
.rtp-meta  { font-size: 0.72rem; color: var(--text3); }
.rtp-note  { font-size: 0.69rem; color: var(--text3); font-style: italic; margin-top: 0.25rem; line-height: 1.4; }

/* ── Stats grid ── */
.rtp-stats-grid { display: flex; flex-direction: column; gap: 1rem; }
.rtp-stat-group { display: flex; flex-direction: column; gap: 0.4rem; }
.rtp-stat-group-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--text3);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}
.rtp-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.rtp-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.rtp-stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; }
.rtp-stat-value { font-size: 1.15rem; font-weight: 700; color: var(--text); }

/* ── Tooltip ── */
.stat-tip-wrap { position: relative; display: inline-flex; align-items: center; }
.stat-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--tip-icon-b);
  background: transparent;
  color: var(--tip-icon-c);
  font-size: 0.6rem; font-weight: 800; font-style: normal;
  cursor: default; flex-shrink: 0;
  line-height: 14px;
  transition: border-color .15s, color .15s;
  vertical-align: middle;
  margin-left: 0.25rem;
  user-select: none;
}
.stat-tip-wrap:hover .stat-info,
.stat-tip-wrap:focus-within .stat-info { border-color: var(--accent); color: var(--accent); }

.stat-tip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.73rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--tip-text);
  line-height: 1.55;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
}
.stat-tip-box .tip-rule {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--tip-border);
  color: var(--tip-text);
  opacity: 0.65;
  font-size: 0.68rem;
  line-height: 1.6;
}
.stat-tip-box .tip-row { display: flex; justify-content: space-between; gap: 0.5rem; }
.stat-tip-box .tip-row span:last-child { text-align: right; white-space: nowrap; }
.stat-tip-box::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--tip-tip);
}
/* Directional variants */
.stat-tip-box.tip-right {
  bottom: auto; top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
}
.stat-tip-box.tip-right::after {
  top: 50%; left: -10px;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: var(--tip-tip);
}
.stat-tip-box.tip-below {
  bottom: auto;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.stat-tip-box.tip-below::after {
  bottom: auto; top: -10px; left: 50%;
  transform: translateX(-50%);
  border-top-color: transparent;
  border-bottom-color: var(--tip-tip);
}
.stat-tip-wrap:hover .stat-tip-box,
.stat-tip-wrap:focus-within .stat-tip-box { display: block; }

/* ── Combo breakdown ── */
.combo-section { margin-top: 0.5rem; }
.combo-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; user-select: none;
  padding: 0.4rem 0;
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--text3);
  border-top: 1px solid var(--border);
  border-bottom: none; border-left: none; border-right: none;
  background: none; width: 100%; text-align: left;
}
.combo-toggle:hover { color: var(--text2); }
.combo-chevron { transition: transform .2s; font-size: 0.7rem; }
.combo-chevron.open { transform: rotate(90deg); }
.combo-table-wrap { display: none; overflow-x: auto; margin-top: 0.4rem; }
.combo-table-wrap.open { display: block; }

.combo-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.combo-table th {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3); font-weight: 700; text-align: right;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.combo-table th:first-child { text-align: left; }
.combo-table td {
  padding: 0.3rem 0.6rem; text-align: right;
  color: var(--text2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.combo-table td:first-child { text-align: left; }
.combo-table tbody tr:hover td { background: var(--surface2); }
.combo-table tbody tr.combo-sym-odd td { background: var(--surface2); }
.combo-table tbody tr.combo-sym-odd:hover td { background: var(--border); }

.combo-th-btn {
  background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
  padding: 0; display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap;
}
.combo-th-btn:hover { color: var(--text); }
.combo-th-btn.active { color: var(--accent); }
.combo-sort-arrow { font-size: 0.65rem; opacity: 0.7; display: inline-flex; align-items: center; }
.combo-sort-pri {
  font-size: 0.5rem; font-weight: 800;
  background: var(--accent); color: var(--surface);
  border-radius: 3px; padding: 0 0.2rem; line-height: 1.3; vertical-align: middle;
}

.combo-sym-badge {
  display: inline-block;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.combo-bar-cell { min-width: 90px; }
.combo-bar-wrap { display: flex; align-items: center; gap: 0.4rem; }
.combo-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.combo-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); min-width: 1px; }
.combo-bar-pct { font-size: 0.7rem; color: var(--text2); min-width: 38px; text-align: right; }

/* ── Sort bar ── */
.combo-sort-bar {
  display: none; align-items: center; gap: 0.35rem; flex-wrap: wrap;
  padding: 0.4rem 0.2rem 0.5rem; min-height: 2rem;
}
.combo-sort-bar-label {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3); font-weight: 700; flex-shrink: 0;
}
.combo-sort-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.4rem 0.15rem 0.5rem;
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 20px; font-size: 0.63rem; font-weight: 600;
  color: var(--accent); cursor: default; white-space: nowrap;
}
.combo-sort-pill-dir { cursor: pointer; opacity: 0.8; font-size: 0.6rem; }
.combo-sort-pill-dir:hover { opacity: 1; }
.combo-sort-pill-rm { cursor: pointer; opacity: 0.55; font-size: 0.7rem; line-height: 1; margin-left: 0.1rem; }
.combo-sort-pill-rm:hover { opacity: 1; color: var(--danger); }
.combo-sort-clear {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--text3); background: none; border: none; cursor: pointer;
  padding: 0.15rem 0.3rem; border-radius: 4px; margin-left: 0.1rem;
}
.combo-sort-clear:hover { color: var(--danger); background: var(--danger-dim); }

.rtp-result-json-pre {
  margin: 0; padding: 1rem;
  font-family: var(--font-mono, monospace); font-size: 0.72rem;
  line-height: 1.5; color: var(--text1);
  white-space: pre; overflow: auto;
  flex: 1; height: 100%;
}

.rtp-json-toolbar {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem 0.3rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rtp-result-json-tree {
  flex: 1; overflow: auto; padding: 0.6rem 0.75rem;
  font-family: var(--font-mono, monospace); font-size: 0.72rem; line-height: 1.6;
  color: var(--text1);
}
.rtp-result-json-tree details { display: block; }
.rtp-result-json-tree summary {
  cursor: pointer; list-style: none; display: inline;
  user-select: none;
}
.rtp-result-json-tree summary::-webkit-details-marker { display: none; }
.rtp-result-json-tree summary::before { content: '▾ '; font-size: 0.65rem; opacity: 0.5; }
.rtp-result-json-tree details:not([open]) > summary::before { content: '▸ '; }
.jt-row { padding-left: 1.2em; }
.jt-key  { color: var(--accent); }
.jt-str  { color: var(--success, #2ecc71); }
.jt-num  { color: var(--warn, #e67e22); }
.jt-bool { color: var(--info, #3498db); }
.jt-null { color: var(--text3); }
.jt-brace { color: var(--text2); font-weight: 600; }
.jt-punct { color: var(--text3); }
.jt-count { font-size: 0.62rem; opacity: 0.5; margin-left: 0.2rem; font-weight: 400; }
