.emt-arrest-lab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  min-width: 0;
  padding: clamp(14px, 2.4vw, 24px);
  border: 1px solid #426274;
  border-radius: 22px;
  background: linear-gradient(145deg, #102938, #112331 62%, #182838);
  color: #f2f8fb;
}
.emt-arrest-lab * { box-sizing: border-box; }
.emt-arrest-lab [hidden] { display: none !important; }
.emt-arrest-lab :is(button, select, a):focus-visible { outline: 3px solid #ffd181; outline-offset: 3px; }
.emt-arrest-lab :is(h3, h4, p) { margin: 0; }
.emt-arrest-lab button { cursor: pointer; }
.emt-arrest-lab button:disabled { cursor: not-allowed; opacity: 0.52; }
.emt-arrest-lab :is(.emt-arrest-head, .emt-arrest-setup, .emt-arrest-scene,
  .emt-arrest-timeline-panel, .emt-arrest-source, .emt-arrest-live) { grid-column: 1 / -1; }
.emt-arrest-head { display: grid; gap: 8px; }
.emt-arrest-head h3 { font-size: clamp(1.25rem, 2.4vw, 1.85rem); line-height: 1.17; }
.emt-arrest-head p { max-width: 75ch; color: #c9dce5; line-height: 1.5; }
.emt-arrest-lab h4 { margin-bottom: 12px; color: #dff8f2; font-size: 1.02rem; }

.emt-arrest-setup, .emt-arrest-scene, .emt-arrest-assessment,
.emt-arrest-assignments, .emt-arrest-timeline-panel {
  min-width: 0;
  padding: clamp(12px, 1.6vw, 18px);
  border: 1px solid #426879;
  border-radius: 16px;
  background: #153342;
}
.emt-arrest-setup { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.emt-arrest-setup h4 { flex-basis: 100%; margin: 0; }
.emt-arrest-case-buttons { flex: 1 1 500px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.emt-arrest-case-button,
.emt-arrest-action-button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #668b98;
  border-radius: 10px;
  background: #214555;
  color: #ecf9fb;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
}
.emt-arrest-case-button[aria-pressed="true"] { border-color: #8ce4d0; background: #206463; box-shadow: inset 0 0 0 1px #8ce4d0; }
.emt-arrest-case-button:hover, .emt-arrest-action-button:not(:disabled):hover { filter: brightness(1.15); }
.emt-arrest-crew-select,
.emt-arrest-pulse-duration,
.emt-arrest-task-label { display: grid; gap: 5px; color: #d5e8ed; font-size: 0.8rem; font-weight: 700; }
.emt-arrest-crew-select { flex: 0 1 180px; }
.emt-arrest-lab select {
  width: 100%;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid #7395a1;
  border-radius: 8px;
  background: #0e2836;
  color: #f2f9fc;
  font: inherit;
}
.emt-arrest-setup-note { flex-basis: 100%; color: #b6ced7; font-size: 0.78rem; line-height: 1.4; }

.emt-arrest-scene { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(175px, 0.6fr); gap: 9px 16px; align-items: start; }
.emt-arrest-scene h4, .emt-arrest-scene-top, .emt-arrest-scene-description { grid-column: 1 / -1; }
.emt-arrest-scene h4 { margin: 0; }
.emt-arrest-scene-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.emt-arrest-clock { padding: 5px 10px; border: 1px solid #f0bd7c; border-radius: 8px; background: #553e32; color: #ffe2aa; font: 800 1.08rem/1.2 ui-monospace, Consolas, monospace; }
.emt-arrest-patient-cue { color: #ffdfa9; font-size: 0.86rem; font-weight: 700; }
.emt-arrest-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #557a87;
  border-radius: 13px;
  background: radial-gradient(circle at 48% 75%, #2b5861 0%, #143843 48%, #102b37 100%);
}
.emt-arrest-stage svg { display: block; width: 100%; height: auto; }
.emt-arrest-ground { fill: none; stroke: #6d9b9d; stroke-width: 3; }
.emt-arrest-shadow { fill: #081f2aaa; }
.emt-arrest-body { fill: #7c9ea5; stroke: #d0e5e0; stroke-width: 3; }
.emt-arrest-patient-head { fill: #9fc3c5; stroke: #dcebea; stroke-width: 3; }
.emt-arrest-limb { fill: none; stroke: #91b5bc; stroke-width: 18; stroke-linecap: round; }
.emt-arrest-eye { fill: none; stroke: #254b58; stroke-width: 3; stroke-linecap: round; }
.emt-arrest-chest { fill: #9ed0c7; opacity: 0.85; transform-origin: center; transform-box: fill-box; }
.emt-arrest-breath { fill: none; stroke: #b8f2e5; stroke-width: 4; stroke-linecap: round; opacity: 0.9; }
.emt-arrest-aed-case { fill: #ddad69; stroke: #ffe2ae; stroke-width: 4; }
.emt-arrest-aed-handle { fill: none; stroke: #ffe2ae; stroke-width: 5; }
.emt-arrest-aed-label { fill: #2e3636; font: 800 21px system-ui, sans-serif; }
.emt-arrest-stage[data-aed="unassigned"] :is(.emt-arrest-aed-case, .emt-arrest-aed-handle, .emt-arrest-aed-label) { opacity: 0.22; }
.emt-arrest-stage[data-aed="away"] :is(.emt-arrest-aed-case, .emt-arrest-aed-handle, .emt-arrest-aed-label) { opacity: 0.48; }
.emt-arrest-stage[data-breathing="absent"] .emt-arrest-breath { opacity: 0; }
.emt-arrest-stage[data-breathing="normal"] .emt-arrest-chest { animation: emt-arrest-normal-breath 3s ease-in-out infinite; }
.emt-arrest-stage[data-breathing="gasping"] .emt-arrest-chest { animation: emt-arrest-gasp 4.2s linear infinite; }
.emt-arrest-stage[data-breathing="gasping"] .emt-arrest-breath { stroke: #f4c484; stroke-dasharray: 9 8; }
.emt-arrest-stage[data-care="cpr"] .emt-arrest-chest { animation: emt-arrest-compression 0.55s ease-in-out infinite; fill: #f8d099; }
.emt-arrest-responder-layer { position: absolute; inset: 0; pointer-events: none; }
.emt-arrest-responder-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 2px solid #a4edde;
  border-radius: 50%;
  background: #17656c;
  color: white;
  font: 800 0.8rem/1 system-ui, sans-serif;
  box-shadow: 0 2px 8px #09202b;
  transform: translate(-50%, -50%);
  transition: left 0.25s ease, top 0.25s ease, background 0.25s ease;
}
.emt-arrest-responder-marker[data-task="idle"][data-index="0"] { left: 17%; top: 19%; }
.emt-arrest-responder-marker[data-task="idle"][data-index="1"] { left: 79%; top: 17%; }
.emt-arrest-responder-marker[data-task="idle"][data-index="2"] { left: 89%; top: 34%; }
.emt-arrest-responder-marker[data-task="call"] { left: 78%; top: 17%; background: #27637a; }
.emt-arrest-responder-marker[data-task="aed-away"] { left: 91%; top: 17%; border-color: #ffd296; background: #93623b; opacity: 0.7; }
.emt-arrest-responder-marker[data-task="aed-ready"] { left: 80%; top: 33%; border-color: #ffd296; background: #7c6536; }
.emt-arrest-responder-marker[data-task="cpr"] { left: 45%; top: 38%; border-color: #f9dd9e; background: #885734; }
.emt-arrest-responder-marker[data-task="breaths"] { left: 13%; top: 49%; border-color: #c9e6ff; background: #3c6685; }
.emt-arrest-stage-tag { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 5px 8px; border: 1px solid #a9d3d0; border-radius: 7px; background: #143b47e8; color: #eafffa; font-size: 0.8rem; }
@keyframes emt-arrest-normal-breath { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.4); } }
@keyframes emt-arrest-gasp { 0%, 15%, 24%, 100% { transform: scaleY(1); } 18% { transform: scaleY(1.55); } 77% { transform: scaleY(1.15); } }
@keyframes emt-arrest-compression { 0%, 100% { transform: scaleY(1); } 48% { transform: scaleY(0.58); } }
.emt-arrest-scene-description { color: #d2e5e9; font-size: 0.86rem; line-height: 1.42; }
.emt-arrest-crew-board { display: grid; gap: 7px; }
.emt-arrest-crew-card { display: grid; gap: 3px; min-width: 0; padding: 8px 8px 8px 28px; position: relative; border: 1px solid #57808a; border-radius: 9px; background: #204553; }
.emt-arrest-crew-card::before { content: ""; position: absolute; left: 9px; top: 11px; width: 11px; height: 11px; border-radius: 50%; background: #8de3cd; box-shadow: 0 0 0 3px #174e52; }
.emt-arrest-crew-card[data-away="true"] { border-color: #e3ac72; background: #574436; }
.emt-arrest-crew-card[data-away="true"]::before { background: #ffd290; box-shadow: 0 0 0 3px #684e36; }
.emt-arrest-crew-card strong { color: #ebf8fa; font-size: 0.81rem; }
.emt-arrest-crew-card span { color: #bdd8df; font-size: 0.73rem; line-height: 1.3; }

.emt-arrest-assessment, .emt-arrest-assignments { display: grid; align-content: start; gap: 10px; }
.emt-arrest-assessment h4, .emt-arrest-assignments h4 { margin: 0; }
.emt-arrest-check-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.emt-arrest-pulse-duration { max-width: 360px; }
.emt-arrest-assessment-note { color: #b8d3dc; font-size: 0.78rem; line-height: 1.4; }
.emt-arrest-findings { display: grid; gap: 6px; }
.emt-arrest-findings p { padding: 7px 9px; border: 1px solid #4d7480; border-radius: 8px; background: #1d4351; color: #d6e8ed; font-size: 0.82rem; line-height: 1.35; }
.emt-arrest-findings .emt-arrest-branch { border-left: 4px solid #efbe7e; background: #354446; color: #ffebc9; }
.emt-arrest-task-list { display: grid; gap: 8px; }
.emt-arrest-task-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 0.9fr); gap: 7px; align-items: end; }
.emt-arrest-task-row .emt-arrest-action-button { min-height: 40px; }
.emt-arrest-action-hint { color: #bcd7dc; font-size: 0.82rem; line-height: 1.4; }

.emt-arrest-timeline-panel { display: grid; gap: 11px; }
.emt-arrest-timeline-panel h4 { margin: 0; }
.emt-arrest-timeline-status { border-left: 4px solid #eeb87a; padding: 8px 10px; border-radius: 5px; background: #354247; color: #ffe8cb; font-size: 0.86rem; line-height: 1.42; }
.emt-arrest-timebar { display: flex; width: 100%; height: 25px; overflow: hidden; border: 1px solid #638895; border-radius: 8px; background: repeating-linear-gradient(90deg, #173742 0 16px, #1d414d 16px 17px); }
.emt-arrest-timebar-no-flow { height: 100%; background: repeating-linear-gradient(135deg, #c8784b 0 8px, #d88f60 8px 14px); transition: width 0.25s ease; }
.emt-arrest-timebar-care { height: 100%; background: #61c5af; transition: width 0.25s ease; }
.emt-arrest-timebar-elapsed { height: 100%; background: #648b98; transition: width 0.25s ease; }
.emt-arrest-axis { display: flex; justify-content: space-between; gap: 8px; color: #b8d2d8; font-size: 0.74rem; }
.emt-arrest-events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 15px; margin: 0; padding: 0; list-style: none; }
.emt-arrest-events li { display: flex; gap: 9px; min-width: 0; padding: 6px 8px; border: 1px solid #466e79; border-radius: 7px; background: #1d4150; color: #d5e9ec; font-size: 0.77rem; line-height: 1.3; }
.emt-arrest-events time { flex: 0 0 44px; color: #f3cc8f; font-weight: 800; }
.emt-arrest-warnings { display: grid; gap: 4px; margin: 0; padding: 0 0 0 20px; color: #ffe0b7; font-size: 0.8rem; line-height: 1.4; }
.emt-arrest-timeline-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.emt-arrest-timeline-actions button { min-height: 40px; padding: 7px 11px; white-space: normal; font-size: 0.8rem; }
.emt-arrest-source { color: #bcd3dc; font-size: 0.78rem; line-height: 1.45; }
.emt-arrest-source a { color: #9be9d6; }
.emt-arrest-live { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px !important; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 1000px) {
  .emt-arrest-lab { grid-template-columns: 1fr; }
  .emt-arrest-assessment, .emt-arrest-assignments { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .emt-arrest-case-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emt-arrest-crew-select { flex-basis: 100%; }
  .emt-arrest-scene { grid-template-columns: 1fr; }
  .emt-arrest-scene > * { grid-column: 1 / -1; }
  .emt-arrest-crew-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emt-arrest-check-buttons { grid-template-columns: 1fr; }
  .emt-arrest-events { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .emt-arrest-lab { padding: 10px; }
  .emt-arrest-setup, .emt-arrest-scene, .emt-arrest-assessment, .emt-arrest-assignments, .emt-arrest-timeline-panel { padding: 10px; }
  .emt-arrest-task-row { grid-template-columns: 1fr; }
  .emt-arrest-crew-board { grid-template-columns: 1fr; }
  .emt-arrest-case-button { font-size: 0.77rem; }
}
@media (prefers-reduced-motion: reduce) {
  .emt-arrest-stage .emt-arrest-chest { animation: none !important; }
  .emt-arrest-timebar :is(.emt-arrest-timebar-no-flow, .emt-arrest-timebar-care, .emt-arrest-timebar-elapsed) { transition: none; }
  .emt-arrest-responder-marker { transition: none; }
}
