.cost-paper {
  position: relative;
  background: #fff;
  color: #242429;
  border: 1px solid #dedee3;
  border-radius: 8px;
}

.cost-paper-tabs {
  display: flex;
  align-items: stretch;
  gap: 22px;
  padding: 0 clamp(12px, 2.4vw, 28px);
  border-bottom: 1px solid #dedee3;
}

.cost-paper-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 1px 10px;
  background: transparent;
  border-radius: 0;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: #63636d;
  cursor: pointer;
}

.cost-paper-tabs button[aria-selected="true"] {
  border-bottom-color: #242429;
  color: #242429;
}

.cost-paper-tabs button:focus-visible {
  outline: 2px solid #4b5062;
  outline-offset: 2px;
}

.cost-paper-stage {
  padding: clamp(10px, 1.8vw, 24px) clamp(6px, 1.4vw, 18px);
}

.cost-paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(10px, 1.25vw, 18px);
}

.cost-paper-plot {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cost-paper-key {
  display: block;
  width: min(40%, 420px);
  height: auto;
  margin: 0 auto 12px;
}

.cost-paper-plot text, .cost-paper-key text {
  user-select: text;
  -webkit-user-select: text;
}

.cost-paper-plot image, .cost-paper-key image {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.cost-paper-plot text[data-cost-label] { cursor: help; }
.cost-paper-plot text.cost-paper-active { text-decoration: underline; }
.cost-paper-plot text:focus { outline: none; }
.cost-paper-hit {
  cursor: help;
  fill: transparent;
  stroke: transparent;
  stroke-width: .75px;
  pointer-events: all;
}
.cost-paper-hit.cost-paper-active { stroke: #252a37; }

.cost-paper-readout {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  display: grid;
  gap: 3px;
  max-width: calc(100% - 8px);
  padding: 8px 10px;
  background: #23242b;
  color: #fff;
  border-radius: 5px;
  box-shadow: 0 3px 12px rgb(20 20 30 / 16%);
  font: 500 12px/1.35 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.cost-paper-readout strong { font: 700 13px/1.3 Arial, sans-serif; }
.cost-paper-readout[hidden] { display: none; }

@media (max-width: 760px) {
  .cost-paper-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cost-paper-key { width: min(76%, 320px); }
  .cost-paper-stage { padding-inline: 7px; }
  .cost-paper-tabs { gap: 18px; }
}
