/* Shared presentation, activated explicitly in each candidate's Justice section. */
#justice.justice-with-status .stack { gap:12px; }
#justice.justice-with-status .justice-status-row {
  display:grid; grid-template-columns:24px minmax(0,1fr); gap:8px;
  align-items:start; min-width:0;
}
#justice.justice-with-status :is([data-status-kind="ongoing"],[data-status-tone="ongoing"]) {
  --status-ink:#ffbd80; --status-paper:#2e2014; --status-edge:#744829;
}
#justice.justice-with-status :is([data-status-kind="favourable"],[data-status-tone="favourable"]) {
  --status-ink:#8be6b3; --status-paper:#12281e; --status-edge:#365c48;
}
#justice.justice-with-status :is([data-status-kind="conviction"],[data-status-tone="conviction"],[data-status-kind="definitive"],[data-status-tone="definitive"]) {
  --status-ink:#ff9b98; --status-paper:#311c20; --status-edge:#6b3a40;
}
#justice.justice-with-status :is([data-status-kind="contested"],[data-status-tone="contested"]) {
  --status-ink:#f0cb86; --status-paper:#2b251a; --status-edge:#5e5036;
}
#justice.justice-with-status :is([data-status-kind="uncertain"],[data-status-tone="uncertain"],[data-status-kind="neutral"],[data-status-tone="neutral"]) {
  --status-ink:#d2d5e1; --status-paper:#23242c; --status-edge:#515361;
}
#justice.justice-with-status .justice-status-gutter {
  display:flex; justify-content:center; padding-top:44px; color:var(--status-ink);
}
#justice.justice-with-status .justice-status-icon { display:block; width:24px; height:24px; color:inherit; }
#justice.justice-with-status .justice-status-row > .justice-case { min-width:0; margin:0; }
#justice.justice-with-status .justice-status-labels { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:3px; }
#justice.justice-with-status .justice-status-label {
  display:inline-block; width:fit-content; max-width:100%; padding:2px 7px;
  color:var(--status-ink); background:var(--status-paper);
  border:1px solid var(--status-edge); border-radius:5px;
  font:700 .875rem/1.4 Inter,system-ui,sans-serif;
}
#justice.justice-with-status .justice-case > summary { padding:12px 29px 12px 12px; }
#justice.justice-with-status .justice-case > summary::after { right:11px; }
#justice.justice-with-status summary:focus-visible { outline-color:var(--status-ink); }
@media(min-width:541px) {
  #justice.justice-with-status .justice-status-row { grid-template-columns:28px minmax(0,1fr); gap:12px; }
  #justice.justice-with-status .justice-status-icon { width:25px; height:25px; }
}

/* A focusable/touchable help target keeps the approved 24px icon in place. */
#justice.justice-with-status .justice-status-gutter { position:relative; padding-top:34px; }
#justice .justice-status-help {
  display:inline-flex; flex:0 0 40px; align-items:center; justify-content:center;
  width:40px; height:44px; min-width:0; padding:0; margin:0;
  border:0; border-radius:8px; background:transparent; color:inherit;
  cursor:help; touch-action:manipulation;
}
#justice .justice-status-help:focus-visible { outline:2px solid currentColor; outline-offset:-2px; }
#justice .justice-status-tooltip {
  position:fixed; z-index:1000; display:block; width:max-content;
  max-width:min(320px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto;
  padding:10px 12px; border:1px solid var(--status-edge); border-radius:9px;
  background:var(--status-paper); color:var(--status-ink);
  font:500 .875rem/1.5 Inter,system-ui,sans-serif; text-align:left; overflow-wrap:anywhere;
  box-shadow:0 8px 24px #0008;
}
#justice .justice-status-tooltip[hidden] { display:none; }
#justice .justice-status-tooltip[data-pointer="touch"] { pointer-events:none; }

/* Only the two secondary Justice bands change their background. */
#justice .justice-section > h3 {
  background:linear-gradient(to right,var(--solid),color-mix(in srgb,var(--highlight) 45%,white));
}
body[data-tone="red"] #justice .justice-section > h3 {
  background:linear-gradient(to right,#94251f,#3e110e);
}
