.emod {
  --emod-bg: #0c1413;
  --emod-line: #30413c;
  --emod-soft: #b0c2bb;
  --emod-mint: #6defc3;
  width: min(900px, calc(100% - 42px));
  max-width: none;
  max-height: min(840px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--emod-line);
  border-radius: 19px;
  background: var(--emod-bg);
  color: #f4f5f1;
  box-shadow: 0 24px 100px #0009;
  font-family: var(--sans, Arial, sans-serif);
}

.emod::backdrop {
  background: #020908d9;
}

html:has(.emod[open]) {
  overflow: hidden;
}

.emod [hidden] {
  display: none !important;
}

.emod :where(button, input):focus-visible {
  outline: 2px solid var(--emod-mint);
  outline-offset: 3px;
}

.emod button {
  cursor: pointer;
  font: inherit;
}

.emod-shell {
  padding: clamp(18px, 3.3vw, 38px);
}

.emod-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 25px;
}

.emod-kicker, .emod-guide-title, .emod-stage-label, .emod-track-heading output, .emod-idx {
  font: 500 10px/1.45 var(--mono, monospace);
  letter-spacing: .085em;
  text-transform: uppercase;
}

.emod-kicker {
  color: var(--emod-mint);
  margin: 0 0 7px;
}

.emod-head h2 {
  margin: 0;
  color: #f4f5f1;
  font: 550 clamp(27px, 3.2vw, 42px)/1.12 var(--sans, Arial, sans-serif);
  letter-spacing: -.055em;
}

.emod-head h2 span {
  color: var(--emod-mint);
}

.emod-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--emod-line);
  border-radius: 50%;
  background: transparent;
  color: #e7eeeb;
}

.emod-close:hover, .emod-play:hover {
  color: var(--emod-mint);
  border-color: var(--emod-mint);
}

.emod-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(180px, 1fr);
  gap: clamp(20px, 3.3vw, 40px);
}

.emod-viewer {
  min-width: 0;
}

.emod-stage {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4/3;
  overflow: hidden;
  border: 1px solid var(--emod-line);
  border-radius: 7px;
  background: #081117;
}

.emod-film, .emod-still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.emod-stage-label {
  position: absolute;
  top: 14px;
  left: 15px;
  color: #a7bfba;
  font-size: 9px;
}

.emod-mark {
  position: absolute;
  width: 9px;
  height: 9px;
  color: #6a938b;
  pointer-events: none;
}

.emod-mark-a {
  top: 14px;
  right: 14px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.emod-mark-b {
  bottom: 14px;
  left: 14px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.emod-controls {
  padding-top: 16px;
}

.emod-track-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font: 550 13px/1.5 var(--sans, Arial, sans-serif);
}

.emod-track-heading output {
  color: var(--emod-mint);
  font-variant-numeric: tabular-nums;
}

#emod-range {
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  accent-color: var(--emod-mint);
  cursor: pointer;
}

.emod-play {
  margin: 3px 0 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--emod-line);
  border-radius: 5px;
  background: transparent;
  color: #e1ede6;
  font-size: 12px !important;
}

.emod-play-icon {
  width: 12px;
  height: 12px;
  color: var(--emod-mint);
}

.emod-pause-path, .emod-play[data-playing] .emod-play-path {
  display: none;
}

.emod-play[data-playing] .emod-pause-path {
  display: inline;
}

.emod-guide-title {
  margin: 0 0 12px;
  color: var(--emod-soft);
}

.emod-chapter {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: baseline;
  gap: 7px;
  width: 100%;
  padding: 17px 0;
  border: 0;
  border-top: 1px solid var(--emod-line);
  border-radius: 0;
  text-align: left;
  background: transparent;
  color: #e8eee9;
}

.emod-chapter:last-child {
  border-bottom: 1px solid var(--emod-line);
}

.emod-chapter[aria-pressed=true] {
  border-top-color: var(--emod-mint);
}

.emod-chapter .emod-idx {
  color: #8fa49b;
}

.emod-chapter strong {
  display: block;
  font-weight: 550;
  font-size: 18px;
  letter-spacing: -.025em;
  line-height: 1.22;
}

.emod-chapter[aria-pressed=true] :is(.emod-idx,strong), .emod-chapter:hover strong {
  color: var(--emod-mint);
}

.emod-chapter small {
  display: block;
  margin-top: 6px;
  color: var(--emod-soft);
  font: 400 13px/1.5 var(--sans, Arial, sans-serif);
}

@media (max-width: 670px) {
  .emod {
    width: min(500px, calc(100% - 18px));
    max-height: calc(100dvh - 16px);
    border-radius: 13px;
  }
  .emod-head {
    padding-bottom: 15px;
  }
  .emod-body {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .emod-stage {
    max-height: 32dvh;
    width: 100%;
  }
  .emod-controls {
    padding-top: 10px;
  }
  .emod-guide-title {
    margin-bottom: 8px;
  }
  .emod-chapter {
    padding: 12px 0;
  }
  .emod-chapter small {
    font-size: 12px;
  }
  .emod-close {
    width: 38px;
    height: 38px;
  }
}

.emod-parts {
  margin-top: 16px;
  border-top: 1px solid var(--emod-line);
  font-size: 13px;
}

.emod-parts summary {
  padding: 16px 0 6px;
  cursor: pointer;
  color: var(--emod-mint);
}

.emod-parts dl {
  margin: 10px 0 0;
}

.emod-parts dt {
  font-weight: 600;
}

.emod-parts dd {
  margin: 3px 0 12px;
  color: var(--emod-soft);
  line-height: 1.45;
}
