:root {
  --bg: #FFFFFF;
  --ink: #111111;
  --magenta: #E0218A;
  --tier-1: #F5B8DD;
  --tier-2: #E05FB4;
  --tier-3: #8F1A68;
  --graticule: #D6D6D6;
  --country-boundary: #AFAFAF;
  --annot: #8E8E8E;
  --pale: #E4E4E4;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, Montserrat, "Century Gothic", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.network-stage:focus-visible {
  outline: 1px solid var(--magenta);
  outline-offset: 3px;
}

.depth-step:focus-visible {
  outline: none;
}

.depth-step:focus-visible i {
  outline: 1px solid var(--magenta);
  outline-offset: 2px;
}

.sheet {
  position: relative;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 54px 28px 28px;
  background: var(--bg);
}

.visualization-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.visualization-content {
  min-width: 0;
}

.depth-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  padding-top: 44px;
  color: var(--annot);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.depth-title {
  margin: 0 0 10px;
  color: #777777;
  font-size: 9px;
  font-weight: 600;
}

.depth-control {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.depth-control::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 5px;
  width: 1px;
  background: #D9D9D9;
  content: "";
}

.depth-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 7px 0;
  background: transparent;
  color: #A0A0A0;
  font-family: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.depth-step i {
  display: block;
  width: 11px;
  height: 11px;
  border: 1px solid #C5C5C5;
  border-radius: 50%;
  background: #FFFFFF;
}

.depth-step.is-revealed {
  color: #777777;
}

.depth-step.is-revealed i {
  border-color: #B8B8B8;
  background: #D7D7D7;
}

.depth-step.is-active {
  color: var(--ink);
  font-weight: 600;
}

.depth-step.is-active i {
  border: 2px solid var(--magenta);
  background: #FFFFFF;
  box-shadow: inset 0 0 0 2px #FFFFFF;
}

.depth-step:hover {
  color: var(--ink);
}

.exposure-counter {
  margin: 14px 0 0;
  color: #777777;
  font-size: 9px;
  line-height: 1.45;
}

.exposure-note {
  margin: 5px 0 0;
  color: #B6B6B6;
  font-size: 8px;
  line-height: 1.4;
}

.masthead {
  text-align: center;
}

.page-title {
  margin: 0;
  font-size: 25px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  min-height: 36px;
  margin-top: 27px;
  color: var(--annot);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.view-switch {
  display: inline-flex;
  gap: 16px;
}

.company-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #A0A0A0;
}

.company-filter {
  max-width: 180px;
  border: 0;
  border-bottom: 1px solid var(--pale);
  border-radius: 0;
  padding: 4px 18px 4px 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: inherit;
  font-size: 10px;
}

.view-button,
.reset-button {
  border: 0;
  border-bottom: 1px solid var(--pale);
  border-radius: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--annot);
  cursor: pointer;
}

.view-button:hover,
.reset-button:hover,
.view-button.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.view-button.is-active {
  font-weight: 600;
}

.view-button.is-active::after {
  display: block;
  width: 3px;
  height: 3px;
  margin: 3px auto -7px;
  border-radius: 50%;
  background: var(--magenta);
  content: "";
}

button:disabled {
  cursor: default;
  opacity: .3;
}

.network-summary {
  margin: 0;
  color: #B3B3B3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  text-align: center;
}

.visual-view[hidden] {
  display: none;
}

.network-stage {
  width: 100%;
  margin-top: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  cursor: crosshair;
  scrollbar-color: #D8D8D8 transparent;
  scrollbar-width: thin;
}

.network-stage canvas {
  display: block;
}

.specimen-legend,
.map-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 2px auto 18px;
  color: var(--annot);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.specimen-legend span,
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sample {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.t1-sample {
  background: var(--tier-1);
}

.t2-sample {
  background: var(--tier-2);
}

.t3-sample {
  background: var(--tier-3);
}

.shared-sample {
  background: var(--tier-2);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.map-legend {
  margin-top: 0;
}

.route-sample {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 1px dashed #AFAFAF;
}

.relationship-sample {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 1px solid #AFAFAF;
}

.local-sample {
  display: inline-block;
  width: 9px;
  height: 7px;
  border: 1px solid #AFAFAF;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.diamond-sample {
  display: inline-block;
  width: 7px;
  height: 7px;
  border: 1px solid var(--ink);
  transform: rotate(45deg);
}

.missing-sample {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tier-2);
}

.node-detail {
  display: grid;
  grid-template-columns: minmax(150px, .34fr) minmax(0, 1fr);
  gap: 22px;
  width: min(100%, 840px);
  min-height: 58px;
  margin: 0 auto;
  padding: 12px 0;
  border-top: 1px solid var(--pale);
  border-bottom: 1px solid var(--pale);
  font-size: 11px;
  line-height: 1.45;
}

.node-detail[hidden] {
  display: none;
}

.node-detail strong {
  font-size: 12px;
  font-weight: 600;
}

.node-detail span {
  color: var(--annot);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.globe-stage {
  width: 100%;
  margin-top: 24px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.globe-stage.is-dragging {
  cursor: grabbing;
}

.graticule {
  fill: none;
  stroke: var(--graticule);
  stroke-width: .5;
}

.landmass {
  fill: #E5EBEE;
  stroke: none;
}

.country-boundary {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: .55;
  opacity: .9;
  pointer-events: none;
}

.supply-link {
  fill: none;
  stroke: #8F8F8F;
  stroke-width: .24;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .3;
  pointer-events: none;
  transition: opacity 250ms ease, stroke 250ms ease, stroke-width 250ms ease;
}

.sea-route {
  stroke-dasharray: 2 2.5;
}

.relationship-link,
.source-link {
  stroke-dasharray: none;
}

.relationship-arrowhead {
  fill: #8F8F8F;
}

.supply-link.is-prior {
  opacity: .56;
}

.supply-link.is-current {
  opacity: .56;
}

.sea-route.is-prior {
  opacity: .48;
}

.sea-route.is-current {
  opacity: .48;
}

.relationship-link.is-current,
.relationship-link.is-prior,
.source-link.is-current,
.source-link.is-prior {
  stroke-width: .32;
  opacity: .66;
}

.relationship-link.co-located-link.is-current,
.relationship-link.co-located-link.is-prior {
  stroke-width: .42;
}

.supply-link.is-ghost {
  stroke-dasharray: 1 4;
  opacity: .08;
}

.supply-link.is-hidden {
  opacity: 0;
}

.supply-link.is-focus-muted {
  opacity: .075;
}

.supply-link.is-highlighted {
  stroke: var(--magenta);
  stroke-width: .4;
  opacity: .82;
}

.map-node {
  stroke: #FFFFFF;
  stroke-width: .3;
  opacity: .82;
  cursor: pointer;
  transition: opacity 250ms ease, fill 250ms ease, stroke 250ms ease, stroke-width 250ms ease;
}

.map-node.tier-0 {
  fill: var(--ink);
}

.map-node.source-node {
  fill: var(--ink);
}

.map-node.tier-1 {
  fill: var(--tier-1);
}

.map-node.tier-2 {
  fill: var(--tier-2);
}

.map-node.tier-3 {
  fill: var(--tier-3);
}

.map-node.is-prior {
  opacity: .42;
}

.map-node.is-current {
  stroke: var(--magenta);
  stroke-width: .45;
  opacity: 1;
}

.map-node.is-ghost {
  fill: none;
  stroke: #AFAFAF;
  stroke-width: .7;
  opacity: .12;
  pointer-events: none;
  cursor: default;
}

.map-node.is-hidden {
  opacity: 0;
  pointer-events: none;
  cursor: default;
}

.map-node.is-focus-muted {
  opacity: .1;
}

.map-node.is-selected {
  fill: var(--magenta);
  stroke: var(--ink);
  stroke-width: 1.1;
  opacity: 1;
}

.map-root-label {
  fill: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 7px;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 2px;
  stroke-linejoin: round;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.map-root-label.is-current {
  opacity: .9;
}

.map-root-label.is-prior {
  opacity: .55;
}

.map-root-label.is-hidden {
  opacity: 0;
}

.chokepoint {
  fill: #FFFFFF;
  stroke: var(--ink);
  stroke-width: .75;
  cursor: pointer;
}

.chokepoint:hover,
.chokepoint.is-selected {
  fill: var(--magenta);
  stroke: var(--magenta);
}

.chokepoint-label {
  fill: #777777;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  pointer-events: none;
}

.tooltip {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  max-width: 250px;
  padding: 6px 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;
  transform: translate(8px, -100%);
}

.tooltip[hidden] {
  display: none;
}

.tooltip strong {
  font-weight: 600;
}

.tooltip span {
  color: #CFCFCF;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
}

@media (max-width: 700px) {
  .sheet {
    padding: 38px 14px 22px;
  }

  .page-title {
    font-size: 19px;
  }

  .toolbar {
    flex-wrap: wrap;
    margin-top: 20px;
  }

  .visualization-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .depth-panel {
    position: static;
    padding-top: 0;
  }

  .depth-control {
    flex-direction: row;
    justify-content: space-between;
  }

  .depth-control::before {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: 5px;
    width: auto;
    height: 1px;
  }

  .depth-step {
    width: auto;
    grid-template-columns: 11px auto;
    padding-right: 8px;
    background: #FFFFFF;
  }

  .exposure-counter,
  .exposure-note {
    display: block;
  }

  .exposure-note {
    margin-left: 0;
  }

  .network-stage {
    margin-right: -14px;
    margin-left: -14px;
    width: calc(100% + 28px);
    padding-left: 14px;
  }

  .node-detail {
    grid-template-columns: 1fr;
    gap: 4px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .supply-link,
  .map-node,
  .map-root-label {
    transition-duration: 0ms;
  }
}
