.emt-pm-lab {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid rgba(111, 182, 255, 0.36);
  border-radius: 11px;
  background:
    radial-gradient(circle at 92% 0, rgba(111, 182, 255, 0.13), transparent 33%),
    linear-gradient(160deg, rgba(85, 214, 190, 0.065), rgba(9, 17, 27, 0.88) 55%),
    #101a27;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.emt-pm-lab :is(select, input, button):focus-visible {
  outline: 2px solid #a5e7dc;
  outline-offset: 3px;
}

.emt-pm-head {
  display: grid;
  justify-items: start;
  gap: 7px;
}

.emt-pm-head h3 {
  margin: 0;
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
}

.emt-pm-head p {
  max-width: 73ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.emt-pm-guided {
  padding: 12px 15px;
  border-left: 3px solid #55d6be;
  border-radius: 5px;
  background: rgba(85, 214, 190, 0.07);
}

.emt-pm-guided h4 { margin: 0 0 7px; font-size: 0.86rem; }
.emt-pm-guided ol { margin: 0; padding-left: 20px; color: #cbdde4; font-size: 0.8rem; line-height: 1.48; }
.emt-pm-guided li + li { margin-top: 5px; }

.emt-pm-visual {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(111, 182, 255, 0.27);
  border-radius: 9px;
  background: #081724;
  overflow: hidden;
}

.emt-pm-ruler {
  display: flex;
  justify-content: space-between;
  margin-left: 156px;
  padding: 0 3px 2px;
  color: #9bb5c5;
  font-size: 0.64rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.emt-pm-lane {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.emt-pm-lane-label {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
}

.emt-pm-lane-label strong {
  color: #e2f1f7;
  font-size: 0.81rem;
  line-height: 1.15;
}

.emt-pm-lane-label small {
  color: #93aebc;
  font-size: 0.67rem;
  line-height: 1.22;
}

.emt-pm-plot {
  position: relative;
  min-width: 0;
  height: 77px;
  overflow: hidden;
  border: 1px solid rgba(122, 176, 195, 0.16);
  border-radius: 5px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(150, 195, 219, 0.17) calc(10% - 1px), rgba(150, 195, 219, 0.17) 10%),
    repeating-linear-gradient(0deg, transparent 0, transparent 18px, rgba(150, 195, 219, 0.065) 19px),
    rgba(13, 34, 48, 0.7);
}

.emt-pm-plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.emt-pm-baseline {
  fill: none;
  stroke: rgba(169, 217, 229, 0.26);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.emt-pm-signal {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.emt-pm-lane-electrical .emt-pm-signal {
  stroke: #55d6be;
  filter: drop-shadow(0 0 5px rgba(85, 214, 190, 0.5));
}

.emt-pm-artifact {
  fill: none;
  stroke: #ffbf78;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px rgba(255, 191, 120, 0.66));
}

.emt-pm-artifact[hidden] {
  display: none;
}

.emt-pm-lane-mechanical .emt-pm-signal {
  stroke: #7eb6ff;
  filter: drop-shadow(0 0 5px rgba(126, 182, 255, 0.36));
}

.emt-pm-lane-pulse .emt-pm-signal {
  stroke: #ffbf78;
  filter: drop-shadow(0 0 5px rgba(255, 191, 120, 0.34));
}

.emt-pm-lane-mechanical .emt-pm-plot[data-pulse="unknown"] .emt-pm-signal,
.emt-pm-lane-pulse .emt-pm-plot[data-pulse="unknown"] .emt-pm-signal {
  stroke: #a5b1bd;
  stroke-dasharray: 7 7;
  filter: none;
}

.emt-pm-lane-mechanical .emt-pm-plot[data-pulse="noDefinite"] .emt-pm-signal,
.emt-pm-lane-pulse .emt-pm-plot[data-pulse="noDefinite"] .emt-pm-signal {
  stroke: #ff7e8b;
  filter: none;
}

.emt-pm-lane-bedside .emt-pm-signal {
  stroke: rgba(111, 182, 255, 0.62);
  stroke-dasharray: 3 5;
}

.emt-pm-playhead {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #e9f7ff;
  box-shadow: 0 0 11px rgba(203, 242, 255, 0.94);
  pointer-events: none;
}

.emt-pm-playhead::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f5fbff;
  box-shadow: 0 0 10px rgba(203, 242, 255, 0.7);
}

.emt-pm-plot-note {
  position: absolute;
  z-index: 2;
  right: 7px;
  top: 5px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #e8f0f5;
  background: rgba(7, 18, 28, 0.8);
  font-size: 0.64rem;
  font-weight: 750;
}

.emt-pm-plot-note:empty {
  display: none;
}

.emt-pm-bedside-chips {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
}

.emt-pm-bedside-chips span {
  padding: 5px 7px;
  border: 1px solid rgba(111, 182, 255, 0.4);
  border-radius: 5px;
  color: #d9e9f4;
  background: #1d3a50;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.2;
}

.emt-pm-bedside-chips span[data-state="unresponsive"],
.emt-pm-bedside-chips span[data-state="gasping"],
.emt-pm-bedside-chips span[data-state="absent"],
.emt-pm-bedside-chips span[data-state="noDefinite"] {
  border-color: rgba(255, 126, 139, 0.66);
  color: #ffe8eb;
  background: #5b2d38;
}

.emt-pm-bedside-chips span[data-state="unknown"] {
  border-color: rgba(255, 191, 120, 0.58);
  color: #ffe9ce;
  background: #53402d;
}

.emt-pm-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.emt-pm-control {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #dceaf1;
  font-size: 0.79rem;
  font-weight: 760;
}

.emt-pm-control select {
  width: 100%;
  min-height: 39px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: var(--text);
  background: #1b2935;
}

.emt-pm-artifact-control {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 191, 120, 0.28);
  border-radius: 7px;
  color: #f5e6d0;
  background: rgba(255, 191, 120, 0.07);
  cursor: pointer;
}

.emt-pm-artifact-control input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  accent-color: #ffbf78;
}

.emt-pm-artifact-control span {
  display: grid;
  gap: 3px;
}

.emt-pm-artifact-control strong {
  font-size: 0.78rem;
}

.emt-pm-artifact-control small {
  color: #b9b6ad;
  font-size: 0.69rem;
  line-height: 1.3;
}

.emt-pm-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.emt-pm-scrub-label {
  flex: 1 1 210px;
  display: grid;
  gap: 7px;
  min-width: 140px;
  color: #dceaf1;
  font-size: 0.79rem;
  font-weight: 760;
}

.emt-pm-scrub-label input {
  width: 100%;
  margin: 0 0 10px;
  accent-color: #55d6be;
}

.emt-pm-time {
  min-width: 80px;
  margin-bottom: 8px;
  color: #aee9dd;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.emt-pm-timeline button {
  min-height: 38px;
}

.emt-pm-explanation {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border: 1px solid rgba(85, 214, 190, 0.25);
  border-left: 3px solid #55d6be;
  border-radius: 7px;
  background: rgba(85, 214, 190, 0.07);
}

.emt-pm-lab[data-level="urgent"] .emt-pm-explanation {
  border-color: rgba(255, 126, 139, 0.4);
  border-left-color: #ff7e8b;
  background: rgba(255, 126, 139, 0.07);
}

.emt-pm-lab[data-level="review"] .emt-pm-explanation {
  border-color: rgba(255, 191, 120, 0.36);
  border-left-color: #ffbf78;
  background: rgba(255, 191, 120, 0.06);
}

.emt-pm-explanation h4,
.emt-pm-explanation p,
.emt-pm-footer {
  margin: 0;
}

.emt-pm-explanation h4 {
  font-size: 0.84rem;
}

.emt-pm-priority {
  color: #e6f0f3;
  font-size: 0.83rem;
  line-height: 1.5;
  font-weight: 680;
}

.emt-pm-constant,
.emt-pm-footer {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.48;
}

.emt-pm-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 780px) {
  .emt-pm-controls { grid-template-columns: 1fr; }
  .emt-pm-ruler { margin-left: 116px; }
  .emt-pm-lane { grid-template-columns: 105px minmax(0, 1fr); }
  .emt-pm-lane-label strong { font-size: 0.72rem; }
  .emt-pm-lane-label small { font-size: 0.61rem; }
  .emt-pm-bedside-chips span { font-size: 0.6rem; padding: 4px 5px; }
}

@media (max-width: 520px) {
  .emt-pm-visual { padding: 8px; }
  .emt-pm-ruler { margin-left: 0; }
  .emt-pm-lane { grid-template-columns: 1fr; gap: 4px; }
  .emt-pm-lane-label { display: flex; align-items: baseline; gap: 6px; }
  .emt-pm-lane-label small { white-space: nowrap; }
  .emt-pm-plot { height: 72px; }
  .emt-pm-bedside-chips { gap: 3px; padding: 5px; }
  .emt-pm-bedside-chips span { font-size: 0.56rem; }
}
