/* Role sections, rendered inline in the shell's content area. Tokens come from theme.css. */

.rh-status { margin: 0; min-height: 1.5em; font: 12.5px/1.5 var(--mono); color: var(--muted); }
.rh-status.rh-error { color: var(--danger); }
.rh-body { display: grid; gap: 20px; }
.rh-body[aria-busy="true"] { opacity: 0.6; }

.rh-section { background: var(--paper-2); border: 1px solid var(--rule); padding: 18px 20px; min-width: 0; }
.rh-section h3 {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px;
  font: 600 11px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.rh-count { color: var(--faint); font-weight: 400; }
.rh-sim {
  display: inline-block; margin: 0 0 10px; padding: 4px 7px;
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--warning); border: 1px solid var(--warning);
}

.rh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; margin: 0; border: 1px solid var(--rule); }
.rh-stats div { padding: 14px 16px; border-right: 1px solid var(--rule); }
.rh-stats div:last-child { border-right: 0; }
.rh-stats dt { font: 500 10.5px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.rh-stats dd { margin: 4px 0 0; font: 700 22px/1.1 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.rh-list { list-style: none; margin: 0; padding: 0; }
.rh-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rh-item:last-child { border-bottom: 0; }
.rh-item-body { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.rh-item-body strong { font-weight: 600; overflow-wrap: anywhere; }
.rh-meta, .rh-empty { font: 11.5px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.rh-empty { margin: 4px 0; }
.rh-error { color: var(--danger); }

.rh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 8px 14px; cursor: pointer;
  background: var(--paper-3); color: var(--ink); border: 1px solid var(--rule-strong);
  border-radius: 0; font: 500 13px/1.2 var(--sans);
}
.rh-btn:hover { border-color: var(--accent); }
.rh-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.rh-danger { color: var(--danger); border-color: var(--danger); background: var(--paper-2); }
.rh-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.rh-quiet { padding: 6px 10px; font-size: 12px; }
.rh-section > .rh-btn { margin-top: 12px; }

.rh-grant { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rh-grant select { flex: 1 1 160px; min-width: 0; }

.rh-card { border: 1px solid var(--rule); background: var(--paper-3); padding: 12px 14px; margin-top: 10px; display: grid; gap: 8px; }
.rh-card > strong { font: 600 12px/1.4 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.rh-text, .rh-select {
  width: 100%; background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule);
  border-radius: 0; padding: 9px 10px; font: 13px/1.5 var(--sans); resize: vertical;
}
.rh-select { width: auto; min-height: var(--tap); }
.rh-text:hover, .rh-select:hover { border-color: var(--rule-strong); }
.rh-row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.rh-compose { display: grid; gap: 8px; }
.rh-compose > .rh-btn { justify-self: end; }
.rh-draft { display: grid; gap: 8px; }
.rh-chip {
  justify-self: start; font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-soft); padding: 4px 7px;
}
.rh-label { margin: 0; font: 500 10px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.rh-grounding { margin: 0; padding: 0 0 0 16px; font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.rh-grounding a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.rh-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink); min-height: var(--tap); }
.rh-check input { accent-color: var(--accent); width: 18px; height: 18px; min-height: 0; }
.rh-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rh-msg { border-left: 2px solid var(--rule-strong); padding: 4px 0 4px 10px; display: grid; gap: 4px; }
.rh-msg-researcher { border-left-color: var(--accent); }
.rh-msg-body { margin: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--ink); }
.rh-translation { border: 1px dashed var(--rule-strong); padding: 8px 10px; display: grid; gap: 4px; }
.rh-translation p { margin: 0; font-size: 13px; }
.rh-foot { margin: 0; font: 11px/1.5 var(--mono); color: var(--muted); }

@media (max-width: 860px) {
  .rh-stats div { border-right: 0; border-bottom: 1px solid var(--rule); }
}

.rh-translate { border: 0; background: none; }
.rh-translate > summary { padding: 0; min-height: 32px; justify-content: flex-end; }
.rh-translate[open] > summary { border-bottom: 0; }
.rh-translate > .more-body { padding: 8px 0 0; justify-content: flex-end; }
