.ems {
  --sky: #9adfff;
  --lavender: #e2c4ff;
  --moon-gold: #ffcf8e;
}

.ems-intro { padding-block: 35px 27px; }
.ems-intro h1 { letter-spacing: -.06em; }
.ems-intro h1 em { color: #a2def5; }
.ems-intro .lead { max-width: 60ch; }
.ems-month {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 15px;
  min-width: min(100%, 265px);
  padding: 13px 0 13px 20px;
  margin: 0;
  border-left: 1px solid #456480;
}
.ems-month dt { color: #bdcfe2; font-size: .76rem; }
.ems-month dd { margin: 6px 0 0; font-size: 1.65rem; line-height: 1; font-weight: 680; letter-spacing: -.055em; }
.ems-month dd span { font-size: .91rem; color: var(--sky); letter-spacing: 0; }

.ems-cases, .ems-landmarks, .ems-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ems-cases { margin-bottom: 16px; }
.ems-cases > span {
  margin-right: 4px;
  color: #b9d0e1;
  font-size: .83rem;
  font-weight: 650;
}
.ems-cases button, .ems-landmarks button, .ems-view-switch button {
  min-height: 39px;
  padding: 6px 11px;
  border: 1px solid #527491;
  border-radius: 8px;
  background: #10253b;
  color: #e0f1fb;
  font-size: .80rem;
  font-weight: 625;
}
.ems-cases button:hover, .ems-landmarks button:hover, .ems-view-switch button:hover { border-color: #a4e9fa; }
.ems button[aria-pressed=true] {
  border-color: #73d3ee;
  background: #204b61;
  color: #f3fbff;
}

.ems-visuals, .ems-work {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(0,1fr);
  gap: 18px;
}
.ems-work { margin-top: 18px; }
.ems-panel-heading {
  min-height: 71px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 17px 13px;
}
.ems-panel-heading p { margin: 4px 0 0; color: #b9d1e5; font-size: .76rem; }
.ems select {
  max-width: 100%;
  min-height: 39px;
  border: 1px solid #557995;
  border-radius: 8px;
  padding: 5px 8px;
  background: #0d263d;
  color: #e7f7ff;
  font-size: .8rem;
}
.ems-view-switch {
  display: inline-flex;
  border: 1px solid #426684;
  border-radius: 10px;
  background: #0b1b2f;
  padding: 3px;
  gap: 3px;
}
.ems-view-switch button {
  min-height: 33px;
  border-color: transparent;
  background: transparent;
  border-radius: 7px;
}

.ems-stage {
  position: relative;
  isolation: isolate;
  margin: 0 14px;
  height: clamp(300px,32vw,450px);
  overflow: hidden;
  border: 1px solid #31516b;
  border-radius: 12px;
  background: #080f21;
}
.ems-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ems-bodies { pointer-events: none; }

.ems-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0;
  list-style: none;
  margin: 15px 16px 0;
  color: #c9dcea;
  font-size: .77rem;
}
.ems-key li { display: inline-flex; align-items: center; gap: 7px; }
.ems-key i { display: inline-block; width: 20px; border-top: 2px solid var(--sky); }
.ems-key .ems-key-plane { border-top-style: dashed; border-color: #98afd4; }
.ems-key .ems-key-node { width: 8px; height: 8px; border: 1px solid #eccdff; border-radius: 50%; background: #b88aff; }
.ems-key .ems-key-light { border-top-style: dashed; border-color: var(--moon-gold); }
.ems-caption { font-size: .78rem; color: #bad0e1; line-height: 1.5; margin: 10px 16px 15px; }
.ems-event { color: #d5e9f8; }

.ems-readings {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  margin: 12px 14px 0;
  border: 1px solid #3a5973;
  border-radius: 10px;
  background: #0a1b2d;
}
.ems-readings > div { min-width: 0; padding: 8px 10px 9px; }
.ems-readings > div + div { border-left: 1px solid #31516b; }
.ems-readings dt { color: #bed3e4; font-size: .72rem; }
.ems-readings dd { margin: 4px 0 0; font-size: .91rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ems [hidden] { display: none!important; }

.ems-controls-body, .ems-inquiry-body { padding: 3px 17px 17px; }
.ems-phase-controls { display: flex; gap: 15px; align-items: center; }
.ems-phase-controls .ems-range { flex: 1; min-width: 0; }
.ems-phase-controls .action { min-width: 116px; }
.ems-range-heading {
  display: flex;
  gap: 4px 10px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: .88rem;
  font-weight: 650;
}
.ems-range input[type=range] { display: block; width: 100%; margin: 1px 0; min-height: 40px; accent-color: #74d5ed; touch-action: pan-y; }
.ems-range output { color: var(--sky); font-variant-numeric: tabular-nums; }
.ems-controls .ems-caption { margin-inline: 0; }
.ems-settings { display: grid; grid-template-columns: 1.2fr 1fr; align-items: start; column-gap: 19px; margin-top: 16px; }
.ems-distance { display: grid; gap: 6px; font-size: .88rem; font-weight: 650; }
.ems-check { display: inline-flex; align-items: center; gap: 8px; min-height: 39px; grid-column: 1 / -1; font-size: .86rem; }
.ems-check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: #74d5ed; }

.ems-inquiry-body { color: #c5d9e8; line-height: 1.55; font-size: .88rem; }
.ems-inquiry-body ol { padding-left: 1.3rem; margin: 0 0 17px; }
.ems-inquiry-body li + li { margin-top: 7px; }
.ems-inquiry-body strong { color: #eaf5fc; }
.ems-feedback { color: #c5eff9; background: #0d263e; border: 1px solid #3b5e7a; border-radius: 8px; padding: 9px 11px; margin: 14px 0; }
.ems-feedback:empty { padding: 0; border: 0; margin: 0; }
.ems-model { padding: 13px 17px; margin-top: 17px; border: 1px solid #3b5e7a; border-radius: 10px; color: #c1d7e8; background: #0d2338; font-size: .84rem; line-height: 1.55; }
.ems summary { min-height: 33px; padding-block: 6px; cursor: pointer; color: #aeeafc; font-weight: 640; }
.ems summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.ems-model p:last-child, .ems-inquiry-body details p { margin-bottom: 0; }
.ems-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 925px) {
  .ems-visuals, .ems-work { grid-template-columns: 1fr; }
  .ems-stage { height: clamp(284px,49vw,400px); }
}
@media (max-width: 650px) {
  .ems-intro { padding-block: 25px 18px; }
  .ems-month { padding: 0; border-left: 0; gap: 18px; }
  .ems-month dd { font-size: 1.33rem; }
  .ems-visuals, .ems-work { gap: 12px; }
  .ems-work { margin-top: 12px; }
  .ems-stage { margin-inline: 10px; }
  .ems-readings { margin-inline: 10px; }
  .ems-panel-heading { padding: 14px 12px 11px; }
  .ems-readings > div { padding-inline: 7px; }
  .ems-readings dt { font-size: .68rem; }
  .ems-readings dd { font-size: .80rem; }
  .ems-controls-body, .ems-inquiry-body { padding-inline: 13px; }
  .ems-settings { grid-template-columns: 1fr; }
  .ems select { font-size: 1rem; }
}
@media (max-width: 390px) {
  .ems-phase-controls { gap: 5px; flex-direction: column; align-items: stretch; }
  .ems-phase-controls .action { align-self: start; }
}
