#btn-microfilm2-overlay,
#btn-microfilm2-stream,
#btn-microfilm2-invert {
  font-weight: 700;
}

#page-image.microfilm2-inverted {
  filter: invert(1);
}

#microfilm2-hud,
#microfilm2-stream-hud {
  position: absolute;
  z-index: 80;
  top: calc(var(--microfilm2-frame-top, 11px) + 10px);
  width: min(340px, calc(var(--microfilm2-frame-width, 100%) - 20px));
  max-height: min(56vh, calc(var(--microfilm2-frame-height, 100%) - 20px));
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid rgba(0, 168, 214, 0.86);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(0, 214, 255, 0.16) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 214, 255, 0.16) calc(100% - 1px)),
    linear-gradient(rgba(0, 214, 255, 0.16) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 214, 255, 0.16) calc(100% - 1px)),
    rgba(220, 251, 255, 0.94);
  color: #031b24;
  font-family: "SFMono-Regular", "Roboto Mono", ui-monospace, monospace;
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(0, 44, 56, 0.18), 0 8px 24px rgba(0, 18, 26, 0.24);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  scrollbar-width: thin;
}

#microfilm2-hud {
  left: calc(var(--microfilm2-frame-left, 11px) + 10px);
}

#microfilm2-stream-hud {
  right: calc(var(--microfilm2-frame-right, 11px) + 10px);
}

html.dark #microfilm2-hud,
html.dark #microfilm2-stream-hud {
  border-color: rgba(0, 216, 255, 0.88);
  background:
    linear-gradient(90deg, rgba(0, 216, 255, 0.18) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 216, 255, 0.18) calc(100% - 1px)),
    linear-gradient(rgba(0, 216, 255, 0.18) 0 1px, transparent 1px calc(100% - 1px), rgba(0, 216, 255, 0.18) calc(100% - 1px)),
    rgba(0, 16, 24, 0.94);
  color: #dffaff;
  text-shadow: none;
}

#microfilm2-hud.is-hidden,
#microfilm2-stream-hud.is-hidden {
  display: none;
}

#microfilm2-hud a,
#microfilm2-hud button,
#microfilm2-stream-hud a,
#microfilm2-stream-hud button {
  pointer-events: auto;
}

.microfilm2-hud-head,
.microfilm2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.microfilm2-hud-head {
  justify-content: space-between;
}

.microfilm2-pill,
.microfilm2-actions a,
.microfilm2-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 1px 5px;
  border: 1px solid rgba(0, 99, 134, 0.5);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.64);
  color: #00384b;
  font: inherit;
  font-size: 9px;
  line-height: 1.25;
  text-decoration: none;
}

html.dark .microfilm2-pill,
html.dark .microfilm2-actions a,
html.dark .microfilm2-actions button {
  border-color: rgba(70, 223, 255, 0.32);
  background: rgba(0, 43, 59, 0.86);
  color: #7eefff;
}

.microfilm2-type {
  color: #a10085;
  text-transform: uppercase;
}

.microfilm2-health {
  color: #1b784e;
}

html.dark .microfilm2-type {
  color: #ff71df;
}

html.dark .microfilm2-health {
  color: #9dffbe;
}

#microfilm2-hud h2,
#microfilm2-stream-hud h2 {
  margin: 4px 0 0;
  color: #001f2b;
  font-size: 11px;
  line-height: 1.08;
  letter-spacing: 0.025em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html.dark #microfilm2-hud h2,
html.dark #microfilm2-stream-hud h2 {
  color: #f2fdff;
}

#microfilm2-hud h3 {
  margin: 6px 0 0;
  color: #00526e;
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 0.07em;
}

html.dark #microfilm2-hud h3 {
  color: #46dfff;
}

#microfilm2-hud dl,
#microfilm2-stream-hud dl {
  margin: 5px 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
}

#microfilm2-hud dl div,
#microfilm2-stream-hud dl div {
  display: contents;
}

#microfilm2-hud dt,
#microfilm2-stream-hud dt {
  margin: 0;
  color: #00526e;
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

html.dark #microfilm2-hud dt,
html.dark #microfilm2-stream-hud dt {
  color: #46dfff;
}

#microfilm2-hud dd,
#microfilm2-stream-hud dd {
  margin: 0;
  color: #061820;
  font-size: 9px;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark #microfilm2-hud dd,
html.dark #microfilm2-stream-hud dd {
  color: #e6fbff;
}

.microfilm2-annotation {
  margin-top: 5px;
}

.microfilm2-annotation dl {
  margin-top: 3px;
}

.microfilm2-annotation dd {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
  text-transform: none;
  letter-spacing: 0.02em;
}

.microfilm2-actions {
  margin-top: 5px;
}

.microfilm2-actions button {
  cursor: pointer;
}

.microfilm2-actions a:focus-visible,
.microfilm2-actions button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-halo);
}

.microfilm2-muted {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  #microfilm2-hud,
  #microfilm2-stream-hud {
    top: calc(var(--microfilm2-frame-top, 6px) + 6px);
    width: min(48vw, 174px);
    max-height: 30vh;
    padding: 4px 5px;
    font-size: 8px;
    line-height: 1.08;
    overflow: hidden;
  }

  #microfilm2-hud {
    left: calc(var(--microfilm2-frame-left, 6px) + 6px);
  }

  #microfilm2-stream-hud {
    right: calc(var(--microfilm2-frame-right, 6px) + 6px);
  }

  #microfilm2-hud h2,
  #microfilm2-stream-hud h2 {
    margin-top: 2px;
    font-size: 8px;
    -webkit-line-clamp: 1;
  }

  #microfilm2-hud h3 {
    margin-top: 3px;
    font-size: 7px;
  }

  #microfilm2-hud dl,
  #microfilm2-stream-hud dl {
    margin-top: 3px;
    gap: 2px 5px;
  }

  #microfilm2-hud dt,
  #microfilm2-hud dd,
  #microfilm2-stream-hud dt,
  #microfilm2-stream-hud dd,
  .microfilm2-pill,
  .microfilm2-actions a,
  .microfilm2-actions button {
    font-size: 7px;
  }

  #microfilm2-hud dl div:nth-child(n+4),
  #microfilm2-stream-hud dl div:nth-child(n+7) {
    display: none;
  }

  .microfilm2-actions {
    margin-top: 3px;
  }

  .microfilm2-actions a,
  .microfilm2-actions button {
    padding: 0 3px;
  }
}
