/* mrm_hub.css — MODEL HUB v5, CORE lane (2026-09-25). Shared primitives every hub page
   uses (verdict, dots, state words, chips, banner, ids) plus the top-bar additions and
   the Home page. Spec: mrm-hub-research/SPEC_v5.md §2 rule 5 and §10.6.

   Tokens only (the app's :root and [data-theme="dark"] blocks redefine every one, so
   the dark theme needs nothing here). Colour appears only where a written rule exists:
   a 7 px dot or a coloured word, never a filled cell; green is never drawn. Every
   selector sits under .mrm; .mrm-tw-inv is untouched so the sticky headers keep working. */

/* ---- shared primitives ---- */
.mrm .mrmh-verdict { font-size: 13.5px; line-height: 1.5; margin: 2px 0 10px; max-width: 120ch; color: var(--text); }
.mrm .mrmh-verdict b { font-weight: 700; }
.mrm .mrmh-verdict .mb-pill { vertical-align: 1px; }
.mrm .mrmh-verdict .mrmh-sub { margin-top: 2px; font-size: 12px; }
.mrm .mrmh-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: 1px; flex: none;
}
.mrm .mrmh-dot-red { background: var(--bear); }
.mrm .mrmh-dot-amber { background: var(--amber); }
.mrm .mrmh-dot-grey { background: var(--muted); opacity: .7; }
.mrm .mrmh-state { white-space: nowrap; }
.mrm .mrmh-state-breach { color: var(--bear); }
.mrm .mrmh-state-watch { color: var(--amber); }
.mrm .mrmh-state-ok { color: var(--text); }
.mrm .mrmh-na { color: var(--muted); cursor: help; }
.mrm .mrmh-muted { color: var(--muted); }
.mrm .mrmh-sub { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 1px; }
.mrm .mrmh-red-text { color: var(--bear); font-weight: 700; }
.mrm .mrmh-amber-text { color: var(--amber); }
.mrm .mrmh-chipbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.mrm .mrmh-chip {
  font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted);
}
.mrm .mrmh-chip b { color: var(--text); font-weight: 700; margin-left: 2px; }
.mrm .mrmh-chip:hover { border-color: var(--accent); color: var(--accent); }
.mrm .mrmh-chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mrm .mrmh-chip.on b { color: var(--accent); }
.mrm .mrmh-banner {
  border: 1px dashed var(--border); border-radius: 6px; padding: 6px 10px; margin: 0 0 10px;
  color: var(--muted); font-size: 12px; line-height: 1.45; background: var(--panel);
}
.mrm .mrmh-id { font-weight: 700; color: var(--text); white-space: nowrap; }
.mrm .mrmh-dec { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.mrm .mrmh-dec:hover { text-decoration: underline; }
/* a tool in the tier matrix: outlined and muted, so models read first */
.mrm .mrm-mx-id.mrmh-mx-tool { color: var(--muted); font-weight: 600; border-style: dashed; background: transparent; }
.mrm .mrm-mx-id.mrmh-mx-tool:hover { color: var(--accent); border-color: var(--accent); }
/* Models opened from a matrix cell that tools share: one muted line to them */
.mrm .mrmh-mxnote { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.mrm .mrmh-mxnote a { color: var(--muted); text-decoration: none; }
.mrm .mrmh-mxnote a:hover { color: var(--accent); text-decoration: underline; }

/* ---- top bar ---- */
.mrm .mrmh-top-dot { display: inline-flex; align-items: center; margin-left: 5px; }
.mrm .mrmh-top-dot .mrmh-dot { margin-right: 0; vertical-align: 0; }
/* on the active (accent-filled) pill the dot keeps a ring so red/amber stay legible */
.mrm .mrm-pill.active .mrmh-top-dot .mrmh-dot { box-shadow: 0 0 0 1.5px var(--panel); }

/* ---- Home ---- */
.mrm .mrmh-home { max-width: 1480px; }
.mrm .mrmh-home .info { color: var(--muted); cursor: help; margin-left: 4px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.mrm .mrmh-home .info:hover { color: var(--accent); }
.mrm .mrmh-home-sec { margin: 0 0 14px; }
.mrm .mrmh-home-h {
  font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin: 14px 0 6px;
}
.mrm .mrmh-home-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; }
.mrm .mrmh-home-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.mrm .mrmh-home-links a:hover { text-decoration: underline; }

/* Do next — one link per row: dot · ids · what + since + clauses / action · → */
.mrm .mrmh-home-acts { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); overflow: hidden; }
.mrm .mrmh-home-act {
  display: grid; grid-template-columns: 14px minmax(88px, 11em) minmax(0, 1fr) 16px; gap: 2px 10px;
  align-items: baseline; padding: 7px 10px; color: var(--text); text-decoration: none;
  border-top: 1px solid var(--row-border);
}
.mrm .mrmh-home-acts > .mrmh-home-act:first-child { border-top: 0; }
.mrm .mrmh-home-act:hover { background: var(--hover); }
.mrm .mrmh-home-act:hover .mrmh-home-act-go { color: var(--accent); }
.mrm .mrmh-home-act-dot { display: inline-flex; align-items: center; min-height: 1em; }
.mrm .mrmh-home-act-ids { line-height: 1.4; overflow-wrap: anywhere; }
.mrm .mrmh-home-act-main { min-width: 0; line-height: 1.45; overflow-wrap: anywhere; }
.mrm .mrmh-home-act-t { font-weight: 700; }
.mrm .mrmh-home-act-go { color: var(--muted); text-align: right; }
.mrm .mrmh-home-more { margin-top: 6px; }
.mrm .mrmh-home-more > summary,
.mrm .mrmh-home-blind > summary { cursor: pointer; color: var(--accent); font-size: 12px; width: fit-content; }
.mrm .mrmh-home-more > .mrmh-home-acts { margin-top: 6px; }

/* Estate health — six cells in one row, 3×2 under 900 px, 2×3 under 600 px */
.mrm .mrmh-home-kri { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.mrm .mrmh-home-kri-cell {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
  color: var(--text); text-decoration: none;
}
.mrm .mrmh-home-kri-cell:hover { border-color: var(--accent); }
.mrm .mrmh-home-kri-l { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.mrm .mrmh-home-kri-v { font-size: 20px; line-height: 1.2; display: flex; align-items: center; gap: 2px; }
.mrm .mrmh-home-kri-v b { font-weight: 700; }
.mrm .mrmh-home-kri-v .mrmh-muted { font-size: 14px; }
.mrm .mrmh-home-kri-v .mrmh-dot { margin: 0 0 0 8px; }
.mrm .mrmh-home-kri-sub { font-size: 11px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.mrm .mrmh-home-kri-sub .mrmh-id { color: var(--muted); }
.mrm .mrmh-home-kri-tr { margin-top: auto; font-size: 10.5px; color: var(--muted); padding-top: 2px; }
.mrm .mrmh-home-spark { display: block; color: var(--muted); }

/* Where the risk sits — side by side from 1100 px, each panel scrolls on its own */
.mrm .mrmh-home-grids { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mrm .mrmh-home-grid {
  min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); padding: 8px 10px;
}
.mrm .mrmh-home-gh { font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.mrm .mrmh-home-grid table.mrm-matrix { min-width: 420px; }
.mrm .mrmh-home-mxlink { text-decoration: none; }
.mrm .mrmh-home-mxlink:hover { text-decoration: underline; }
.mrm table.mrmh-home-tr { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 12px; }
.mrm table.mrmh-home-tr th,
.mrm table.mrmh-home-tr td { padding: 5px 8px; border-bottom: 1px solid var(--row-border); text-align: left; vertical-align: top; }
.mrm table.mrmh-home-tr thead th {
  color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: help;
}
.mrm table.mrmh-home-tr .num { text-align: right; font-variant-numeric: tabular-nums; }
.mrm table.mrmh-home-tr tbody th { font-weight: 700; white-space: nowrap; cursor: help; }
.mrm table.mrmh-home-tr tbody th .mrmh-sub { font-weight: 400; white-space: normal; max-width: 24em; }
.mrm table.mrmh-home-tr td a { color: var(--text); text-decoration: none; font-weight: 600; }
.mrm table.mrmh-home-tr td a:hover { color: var(--accent); text-decoration: underline; }
.mrm table.mrmh-home-tr td a.mrmh-red-text { color: var(--bear); }
.mrm table.mrmh-home-tr .mrmh-home-tr-tools { border-left: 1px solid var(--border); }
.mrm table.mrmh-home-tr .mrmh-home-tr-tot { font-weight: 700; }
.mrm table.mrmh-home-tr tfoot th,
.mrm table.mrmh-home-tr tfoot td { color: var(--muted); border-bottom: 0; border-top: 1px solid var(--border); font-weight: 600; }
.mrm .mrmh-home-trnote { margin: 6px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* Can't see yet — one muted line that opens */
.mrm .mrmh-home-blind { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.mrm .mrmh-home-blind > summary { color: var(--muted); }
.mrm .mrmh-home-blind > summary:hover { color: var(--accent); }
.mrm .mrmh-home-blind ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.mrm .mrmh-home-blind .mrmh-id { color: var(--muted); }

@media (min-width: 1100px) {
  .mrm .mrmh-home-grids { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}
@media (max-width: 899px) {
  .mrm .mrmh-home-kri { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .mrm .mrmh-home-kri { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mrm .mrmh-home-act { grid-template-columns: 14px minmax(0, 1fr) 16px; }
  .mrm .mrmh-home-act-ids { grid-column: 2; }
  .mrm .mrmh-home-act-main { grid-column: 2; }
  .mrm .mrmh-home-act-go { grid-column: 3; grid-row: 1; }
  .mrm .mrmh-home-kri-v { font-size: 18px; }
  .mrm .mrmh-verdict { font-size: 13px; }
}
