/* Homeostasis ER: the patient + chart row and the feedback-loop builder inside the practice shell's stage. */
.her { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px 12px 10px; }
.her-top { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 12px; min-height: 0; }
.her-scene { position: relative; border-radius: var(--tlg-radius-lg); overflow: hidden; border: var(--tlg-border-width) solid var(--tlg-border); background: #e9f3f5; height: 244px; }
.her-scene-svg { display: block; width: 100%; height: 100%; }
.her-legend { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.her-legend:empty { display: none; }
.her-legend span { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: rgb(255 255 255 / .92); color: #15191f; font-size: 16px; font-weight: 700; }
.her-legend i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
.her-graph { min-width: 0; display: flex; flex-direction: column; gap: 2px; background: var(--tlg-surface); border: var(--tlg-border-width) solid var(--tlg-border); border-radius: var(--tlg-radius-lg); padding: 6px 10px; height: 244px; }
.her-graph-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 16px; }
.her-status { font-weight: var(--tlg-weight-bold); color: var(--tlg-text-muted); }
.her-bottom { min-height: 0; display: flex; flex-direction: column; gap: 3px; overflow-x: hidden; overflow-y: auto; padding: 6px 10px 0 0; margin-top: -8px; }
.her-q { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.her-q-t { margin: 0; font-size: 16px; }
.her-q-opts { display: flex; gap: 8px; }
.her-chip { min-height: 42px; padding: 4px 14px; }
.her-chip small { font-weight: 400; font-size: 16px; }
.her-chip.is-right, .her-shape.is-right { outline: 3px solid var(--tlg-status-done-fg); outline-offset: 2px; }
.her-chip.is-right::after, .her-shape.is-right b::after { content: " ✓"; }
.her-chip.is-wrong, .her-shape.is-wrong { outline: 3px solid #b42318; outline-offset: 2px; }
.her-chip.is-wrong::after, .her-shape.is-wrong b::after { content: " ✗"; }
.her .ps-chip:disabled { opacity: 1; cursor: default; }
/* the assignment card sits bottom-right of the stage while playing: keep the tray clear of it */
body:has(.lga-card) .her .pcb-tray { padding-right: 250px; }
.her--whatif .pcb-tray, .her--whatif .pcb-tray-h { display: none; }
.her-missing { background: repeating-linear-gradient(-45deg, transparent 0 8px, rgb(180 35 24 / .12) 8px 16px) !important; border-color: #b42318 !important; }
.her-missing .pcb-chip { text-decoration: line-through; text-decoration-thickness: 2px; }
.her .pcb-note.her-missing-tag { background: #b42318; color: #fff; }
.her-predict { display: flex; flex-direction: column; gap: 6px; }
.her-predict-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.her-shape { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 6px 10px; border-radius: var(--tlg-radius-sm); border: 2px solid var(--tlg-border-strong);
  background: var(--tlg-surface); color: var(--tlg-text); font: inherit; text-align: left; cursor: pointer; }
.her-shape svg { width: 104px; height: 52px; flex: none; }
.her-shape span { display: flex; flex-direction: column; font-size: 16px; line-height: 1.2; }
.her-shape small { font-size: 16px; color: var(--tlg-text-muted); }
.her-shape[aria-checked="true"] { border-color: var(--tlg-text); background: var(--tlg-surface-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tlg-text) 25%, transparent); }
.her-shape[aria-checked="true"] b::before { content: "● "; }
.her-shape:disabled { cursor: default; }
/* briefing example */
.her-ex { display: flex; flex-direction: column; align-items: stretch; gap: 2px; font-size: 16px; }
.her-ex-row { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 8px; background: var(--tlg-surface); border: 1px solid var(--tlg-border); }
.her-ex-k { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tlg-text-muted); }
.her-ex-arrow { text-align: center; font-weight: 700; color: var(--tlg-text-muted); line-height: 1; }
.her-ex-loop { margin-top: 6px; font-weight: 700; color: var(--tlg-status-done-fg); }
/* start art */
.her-start-art { position: absolute; inset: 0; }
.ps-start-art:has(.her-start-art) { position: relative; }
.her-start-art svg { width: 100%; height: 100%; }
.her-start-chips { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; justify-content: center; padding: 6px; border-radius: 10px; background: rgb(255 255 255 / .92); color: #15191f; font-size: 13px; font-weight: 700; }
.her-start-chips span { padding: 2px 6px; border-radius: 6px; border: 1.5px solid #a3343c; }
.her-start-chips i { font-style: normal; color: #a3343c; }
/* the scene is a picture of a real room: it stays light in dark mode */
html[data-theme="dark"] .her-scene { border-color: var(--tlg-border); }
@media (max-width: 1100px) { .her-top { grid-template-columns: 250px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .her { position: static; }
  .her-top { grid-template-columns: 1fr; }
  .her-scene { height: auto; aspect-ratio: 6 / 5; max-width: 420px; }
  .her-predict-opts { grid-template-columns: 1fr; }
  .her-graph { height: auto; }
  .her-bottom { overflow: visible; margin-top: 0; }
  body:has(.lga-card) .her .pcb-tray { padding-right: 0; }
}
