.wv-landing {
  padding-top: 70px;
  padding-bottom: 70px;
}
.wv-landing h1 {
  max-width: 800px;
}
.wv-intro {
  max-width: 730px;
  font-size: 20px;
}
.wv-drop {
  margin: 35px 0;
  border: 1px dashed #57706a;
  border-radius: 18px;
  padding: 36px;
  text-align: center;
  background: #111916;
}
.wv-drop.dragging {
  border-color: #3d8bfd;
  background: #182239;
}
.wv-drop h2 {
  margin: 12px 0;
}
.wv-file-icon {
  width: 38px;
  color: #a8c8b1;
  margin: auto;
}
.wv-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.wv-muted {
  font-size: 13px;
  color: #a5aab3;
}
.wv-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 48px 0;
}
.wv-facts h2,
.wv-support h2 {
  font-size: 22px;
}
.wv-support {
  max-width: 900px;
}
.wv-support p {
  color: #bdc2c9;
}
.wv-landing button {
  cursor: pointer;
}
/* MedicalTheme.swift, ViewerTopBarChrome.swift, PanelHUDScale.swift,
   ViewerSettingsChrome.swift and MultiPanelContainer.mprHybrid. CSS px are
   native logical points; only browser safe areas and pointer hover differ. */
.wv-workspace {
  --accent: #3d8bfd;
  --surface: #0c0f14;
  --border: #ffffff1a;
  --muted: #ffffff8c;
  --ui: 1;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #000;
  color: #fff;
  font:
    13px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}
.wv-workspace[open] {
  display: flex;
  flex-direction: column;
}
.wv-workspace::backdrop {
  background: #000;
}
.wv-workspace * {
  box-sizing: border-box;
}
.wv-workspace button {
  font: inherit;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ffffff0f;
  padding: 8px 9px;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}
.wv-workspace button:hover {
  background: #ffffff1f;
}
.wv-workspace button:focus-visible,
.wv-panel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.wv-workspace button[aria-pressed="true"] {
  color: var(--accent);
  border-color: #3d8bfd66;
  background: #3d8bfd1f;
}
.wv-workspace svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}
.wv-workspace button[data-locked] svg {
  width: 10px;
  height: 10px;
  margin-left: 3px;
  opacity: 0.55;
}
.wv-topbar {
  height: 44px;
  min-height: 44px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #000;
}
.wv-top-actions {
  display: flex;
  gap: 8px;
}
.wv-workspace .wv-icon {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 7px;
  background: transparent;
}
.wv-mode-chips {
  display: flex;
  gap: 5px;
  align-items: center;
}
.wv-mode-chips button {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 16px;
}
#wv-active-tool {
  color: var(--accent);
  border-color: #3d8bfd66;
  font-size: 11px;
  border-radius: 16px;
  padding: 5px 10px;
}
.wv-canvas-area {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 1px;
}
.wv-grid {
  height: 100%;
  display: grid;
  grid-template: 1fr / 1fr;
  gap: 1px;
  background: #000;
  container-type: size;
}
.wv-panel {
  --plane: #3d8bfd;
  --hud: 1;
  position: relative;
  background: #000;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  border: 1.5px solid color-mix(in srgb, var(--plane) 55%, transparent);
}
.wv-panel:not(:first-child) {
  display: none;
}
.wv-grid.mpr {
  grid-template: 60% minmax(0, 1fr) / 1fr 1fr;
}
.wv-grid.mpr .wv-panel {
  display: block;
}
.wv-grid.mpr .wv-panel:first-child {
  grid-column: 1 / 3;
}
.wv-grid.mpr.landscape {
  grid-template: 1fr 1fr / 60% minmax(0, 1fr);
}
.wv-grid.mpr.landscape .wv-panel:first-child {
  grid-column: 1;
  grid-row: 1 / 3;
}
.wv-grid.mpr.fullscreen {
  grid-template: 1fr / 1fr;
}
.wv-grid.fullscreen .wv-panel {
  display: none;
}
.wv-grid.fullscreen .wv-panel.is-fullscreen {
  display: block;
  grid-column: 1;
  grid-row: 1;
}
.wv-panel[data-plane="1"] {
  --plane: #ff6b5d;
}
.wv-panel[data-plane="2"] {
  --plane: #3ecf6e;
}
.wv-panel > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.wv-position {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: #ffffff0f;
  pointer-events: none;
}
.wv-position i {
  height: 2px;
  display: block;
  background: #3d8bfdd9;
  width: 0;
}
.wv-panel-header {
  position: absolute;
  top: 3px;
  left: 4px;
  right: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
  pointer-events: none;
  white-space: nowrap;
  font:
    700 calc(9px * var(--hud) * var(--ui)) -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  text-shadow:
    1px 1px #000,
    0 1px 3px #0008;
}
.wv-panel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 1.5px;
  color: #ffffffbf;
}
.wv-value {
  color: #ffffffbf;
  letter-spacing: 1.5px;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wv-readout {
  position: absolute;
  bottom: calc(2px * var(--hud));
  left: calc(2px * var(--hud));
  font:
    500 calc(9px * var(--hud) * var(--ui)) / 1.45 -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: #fff;
  white-space: pre-line;
  pointer-events: none;
  text-shadow:
    1px 1px #000,
    0 1px 3px #0009;
}
.wv-workspace .wv-orientation-reset {
  position: absolute;
  top: calc(22px * var(--hud));
  right: 8px;
  padding: 5px 8px;
  background: #0009;
  color: var(--accent);
  font:
    600 11px ui-monospace,
    monospace;
}
.wv-projection {
  color: var(--muted);
  font: inherit;
  letter-spacing: 1.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: auto;
}
.wv-angle {
  position: absolute;
  pointer-events: none;
  background: #000b;
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
  font:
    600 12px ui-monospace,
    monospace;
}
.wv-cine {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background: #0009 !important;
  padding: 6px 10px !important;
}
/* SeriesStripView: 56-point tiles, labels below, 84-point portrait strip. */
.wv-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  min-height: 84px;
  height: 84px;
  padding: 6px 12px;
  overflow: hidden;
  background: #000;
}
.wv-series-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
}
.wv-series-content[hidden] {
  display: none !important;
}
.wv-series-content > * {
  flex-shrink: 0;
}
.wv-series {
  display: flex;
  gap: 8px;
}
.wv-workspace .wv-series button {
  padding: 0;
  width: 56px;
  height: 70px;
  border: 0;
  border-radius: 0;
  position: relative;
  background: transparent;
  opacity: 0.55;
}
.wv-workspace .wv-series button[aria-pressed="true"] {
  background: transparent;
  opacity: 1;
}
.wv-series canvas {
  display: block;
  width: 56px;
  height: 56px;
  background: #000;
  border: 1px solid #ffffff1a;
  border-radius: 6px;
}
.wv-series button[aria-pressed="true"] canvas {
  border: 2px solid var(--accent);
}
.wv-series button::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  top: 4px;
  left: 4px;
  border-radius: 50%;
  background: #4dd8e6;
}
.wv-series small {
  font:
    500 9px ui-monospace,
    monospace;
  display: block;
  margin-top: 3px;
}
.wv-series button[aria-pressed="true"] small {
  font-weight: 700;
}
.wv-workspace .wv-add {
  position: relative;
  align-self: center;
  width: 56px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
}
.wv-add::before {
  content: "";
  position: absolute;
  inset: 0 0 14px;
  border: 1px dashed #ffffff59;
  border-radius: 6px;
}
.wv-add > svg {
  width: 24px;
  height: 24px;
  margin: 16px;
  color: #ffffff8c;
}
.wv-add small {
  font-size: 9px;
  line-height: 11px;
  margin-top: 3px;
  color: #ffffff80;
}
.wv-topbar .wv-icon {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 13px;
  border: 0;
  color: #ffffff8c;
  border-radius: 0;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wv-topbar .wv-icon::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  background: #ffffff1f;
  pointer-events: none;
}
.wv-topbar .wv-icon[aria-expanded="true"]::before {
  background: #3d8bfd38;
  border: 1px solid #3d8bfd8c;
}
.wv-topbar .wv-icon[aria-expanded="true"] {
  color: var(--accent);
}
@media (max-height: 500px) and (orientation: landscape) {
  .wv-bottom {
    min-height: 46px;
    height: 46px;
    padding: 4px 12px;
    gap: 6px;
  }
  .wv-series {
    gap: 6px;
  }
  .wv-workspace .wv-series button,
  .wv-series canvas,
  .wv-workspace .wv-add {
    width: 38px;
    height: 38px;
  }
  .wv-series small,
  .wv-add small {
    display: none;
  }
  .wv-add::before {
    inset: 0;
  }
  .wv-add > svg {
    margin: 7px;
  }
}
.wv-menu {
  position: absolute;
  z-index: 4;
  right: 0;
  top: 0;
  bottom: 0;
  width: 290px;
  background: linear-gradient(0deg, #3d8bfd24, transparent 55%), var(--surface);
  border-left: 0.5px solid var(--border);
  overflow-y: auto;
}
.wv-menu-heading {
  font-size: calc(13px * var(--ui));
  font-weight: 600;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 10px;
  border-bottom: 0.5px solid var(--border);
}
.wv-menu-heading .wv-icon {
  border-radius: 50%;
  background: #ffffff0f;
  width: 30px;
  height: 30px;
}
.wv-menu-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wv-menu section,
.wv-menu details {
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
}
.wv-menu h2,
.wv-menu summary {
  font:
    600 calc(13px * var(--ui)) -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  margin: 0;
  color: #fff;
}
.wv-menu h2 {
  margin-bottom: 10px;
}
.wv-menu summary {
  cursor: pointer;
}
.wv-menu details[open] > summary {
  margin-bottom: 12px;
}
.wv-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.wv-mode-row button {
  padding: 8px;
  font-size: calc(12px * var(--ui));
}
.wv-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.wv-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.wv-preset-grid button {
  text-align: left;
  font-size: calc(10px * var(--ui));
  padding: 7px 6px;
  white-space: normal;
}
.wv-preset-grid small {
  display: block;
  color: var(--muted);
  font:
    9px ui-monospace,
    monospace;
  margin-top: 4px;
}
.wv-menu label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: #fff;
  font-size: calc(13px * var(--ui));
}
.wv-menu input[type="number"] {
  width: 100px;
  color: #fff;
  background: #ffffff0f;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px;
  text-align: right;
}
.wv-menu input[role="switch"] {
  appearance: none;
  width: 40px;
  height: 24px;
  border-radius: 20px;
  background: #ffffff33;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}
.wv-menu input[role="switch"]:checked {
  background: var(--accent);
}
.wv-menu input[role="switch"]:before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
}
.wv-menu input[role="switch"]:checked:before {
  left: 18px;
}
.wv-wide {
  width: 100%;
  margin-top: 8px;
  text-align: left;
}
.wv-workspace #wv-menu-scrim {
  position: absolute;
  inset: 0;
  background: #0008;
  z-index: 3;
  border-radius: 0;
}
.wv-tools {
  position: absolute;
  left: 1px;
  bottom: 1px;
  right: 1px;
  z-index: 5;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  overflow-x: auto;
}
.wv-tools button {
  font-size: 12px;
  background: transparent;
}
.wv-tools button:last-child {
  margin-left: auto;
  color: var(--accent);
  background: #3d8bfd1f;
}
.wv-empty {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #000b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: #dadde2;
}
.wv-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #ffffff1a;
  border-top-color: #3d8bfd;
  border-radius: 50%;
  animation: wv-spin 1s linear infinite;
}
@keyframes wv-spin {
  to {
    transform: rotate(360deg);
  }
}
#wv-notice {
  position: absolute;
  z-index: 7;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 90%);
  padding: 14px 18px;
  background: #161c26f5;
  border: 1px solid #546782;
  border-radius: 10px;
  font-size: 13px;
  color: #e3e7ed;
  box-shadow: 0 8px 20px #0009;
  pointer-events: none;
}
.wv-lock-overlay {
  position: absolute;
  inset: 0;
  background: #000a;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}
.wv-lock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(420px, 100%);
  padding: 24px;
  text-align: center;
}
.wv-lock-card > button:first-child {
  float: right;
}
.wv-lock-mark {
  padding: 20px 0 8px;
  color: var(--accent);
}
.wv-lock-mark svg {
  width: 36px;
  height: 36px;
}
.wv-lock-card h2 {
  font-size: 23px;
  margin: 14px 0;
}
.wv-lock-card p {
  font-size: 14px;
  color: #bfc5ce;
  line-height: 1.6;
}
.wv-lock-card a {
  display: block;
  margin: 20px 0 10px;
}
.wv-lock-card > button:last-child {
  width: 100%;
}
.wv-workspace [hidden] {
  display: none !important;
}
@media (min-width: 768px) {
  .wv-workspace {
    --ui: 1.18;
  }
  .wv-menu {
    width: 310px;
  }
  .wv-workspace.menu-open .wv-grid {
    width: calc(100% - 310px);
  }
  .wv-workspace #wv-menu-scrim {
    display: none;
  }
  .wv-tool-grid button {
    font-size: 14px;
  }
  .wv-topbar {
    padding: 0 8px;
  }
}
@media (max-width: 640px) {
  .wv-landing {
    padding-top: 35px;
  }
  .wv-drop {
    padding: 24px 14px;
  }
  .wv-facts {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .wv-mode-chips {
    gap: 3px;
  }
  .wv-mode-chips button {
    padding: 5px 7px;
    font-size: 10px;
  }
  .wv-top-actions {
    gap: 4px;
  }
  .wv-menu {
    max-width: 94vw;
  }
  .wv-tools {
    gap: 3px;
    padding: 8px 4px;
  }
  .wv-tools button {
    padding: 7px 5px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wv-spinner {
    animation: none;
  }
}
.wv-workspace .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Current SideMenuUI: plain collapsible groups, neutral disclosure headers. */
.wv-menu {
  position: fixed;
  top: env(safe-area-inset-top);
  bottom: env(safe-area-inset-bottom);
}
.wv-menu-body {
  padding: 14px 22px;
  gap: 14px;
}
.wv-menu details,
.wv-menu section {
  padding: 0 0 6px;
  border: 0;
  border-radius: 0;
}
.wv-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: calc(10px * var(--ui));
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffffbf;
  background: #ffffff0a;
  border: 1px solid #ffffff1f;
  border-radius: 8px;
  padding: 8px 10px;
}
.wv-menu summary::-webkit-details-marker {
  display: none;
}
.wv-menu summary::after {
  content: "›";
  margin-left: auto;
  opacity: 0.65;
}
.wv-menu details[open] > summary::after {
  content: "⌃";
}
.wv-menu .wv-plain-section > summary {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.wv-tool-symbol {
  display: block;
  font-size: 19px;
  margin-bottom: 3px;
}
.wv-plain-section .wv-tool-grid button {
  font-size: 10px;
  min-height: 48px;
}
.wv-menu .wv-wide {
  margin: 0;
  padding: 9px;
}
.wv-menu label + label {
  border-top: 0.5px solid var(--border);
  padding-top: 10px;
}
.wv-bottom #wv-strip-toggle {
  margin-left: auto;
  flex-shrink: 0;
}
.wv-workspace.strip-collapsed .wv-bottom {
  height: 26px;
  min-height: 26px;
  padding: 0 8px;
}
.mpr .wv-panel-title {
  padding-left: 10px;
}
.mpr .wv-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-top: 10px solid var(--plane);
  border-right: 10px solid transparent;
  pointer-events: none;
}
.fullscreen .wv-panel::after {
  display: none;
}
.wv-value {
  font-size: inherit;
}
@media (min-width: 768px) {
  .wv-workspace.menu-open .wv-topbar,
  .wv-workspace.menu-open .wv-bottom {
    width: calc(100% - 310px);
  }
  .wv-workspace.menu-open .wv-tools {
    right: 311px;
  }
}

.wv-source-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column: 1 / -1;
  gap: 6px;
}
.wv-workspace button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.wv-workspace .wv-reorder {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 28px;
  padding: 0;
  background: transparent;
  z-index: 2;
  border-radius: 0;
  touch-action: none;
  cursor: grab;
}
.mpr:not(.fullscreen) .wv-reorder {
  display: block;
}
.wv-panel.reordering {
  opacity: 0.65;
  outline: 2px solid var(--plane);
  outline-offset: -3px;
}
.wv-panel.reorder-target {
  box-shadow: inset 0 0 0 3px #0a84ff;
}
.wv-panel.reorder-target::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: #0a84ff26;
  pointer-events: none;
  z-index: 3;
}
.wv-workspace .wv-reorder:hover {
  background: #ffffff0d;
}

.wv-workspace.strip-collapsed #wv-strip-toggle {
  width: auto;
  min-width: 64px;
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  background: transparent;
  font:
    600 11px ui-monospace,
    monospace;
}

/* Interaction chrome repaints independently of the decoded image surface. */
.wv-panel > .wv-overlay {
  pointer-events: none;
}
