.calc-cap {
  caption-side: top;
  padding: 0 0 8px;
  text-align: left;
  font: .72rem var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.calc-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  counter-reset: calc-step;
}

.calc-steps:empty {
  display: none;
}

.calc-steps li {
  position: relative;
  padding: 10px 14px 10px 46px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  font-size: .92rem;
  color: var(--text-2);
  counter-increment: calc-step;
}

.calc-steps li::before {
  content: counter(calc-step, decimal-leading-zero);
  position: absolute;
  left: 12px;
  top: 10px;
  font: 600 .8rem var(--font-mono);
  color: var(--signal);
}

.calc-steps strong {
  color: var(--text);
}

.calc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: .86rem;
  color: var(--text-2);
}

.calc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calc-legend i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 4px;
}

.calc-legend i.is-line {
  height: 2px;
  border-radius: 0;
}

.calc-legend i.is-dash {
  height: 0;
  border-top: 2px dashed var(--muted);
  background: none !important;
}

.calc-chart {
  position: relative;
  min-width: 0;
}

.calc-chart__title {
  margin: 0 0 8px;
  font: .72rem var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.calc-chart__svg {
  position: relative;
  width: 100%;
}

.calc-chart__svg svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cv-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.cv-axis {
  stroke: var(--line-3);
  stroke-width: 1;
}

.cv-tick {
  fill: var(--muted);
  font: 10.5px var(--font-mono);
}

.cv-label {
  fill: var(--text-2);
  font: 11.5px var(--font-body);
}

.cv-label.is-sel {
  fill: var(--text);
  font-weight: 700;
}

.cv-band {
  fill: transparent;
}

.cv-band.is-sel {
  fill: rgba(255, 138, 31, .08);
}

.cv-row:hover .cv-band {
  fill: rgba(255, 255, 255, .03);
}

.cv-ref {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.cv-ref-text {
  fill: var(--muted);
  font: 10px var(--font-mono);
}

.cv-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.cv-area {
  stroke: none;
  opacity: .14;
}

.cv-dot {
  stroke: var(--bg);
  stroke-width: 2;
}

.cv-cross {
  stroke: var(--text-2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.cv-night {
  fill: rgba(90, 169, 255, .06);
}

.cv-hit {
  fill: transparent;
  cursor: crosshair;
}

.calc-tip {
  position: absolute;
  z-index: 5;
  min-width: 140px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line-3);
  background: rgba(7, 9, 12, .96);
  box-shadow: var(--shadow);
  font-size: .82rem;
  line-height: 1.45;
  color: var(--text-2);
  pointer-events: none;
}

.calc-tip strong {
  display: block;
  color: var(--text);
}

.calc-tip[hidden] {
  display: none;
}

.calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  height: 20px;
  border: 1px solid var(--line-2);
  font: .68rem var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}

.calc-badge--warn {
  border-color: rgba(245, 197, 24, .45);
  color: var(--warn);
}

.calc-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: .92rem;
}

.calc-dl dt {
  color: var(--muted);
}

.calc-dl dd {
  margin: 0;
  color: var(--text);
}

.calc-planets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 8px;
}

.calc-planets button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  color: var(--text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.calc-planets button small {
  font: .7rem var(--font-mono);
  color: var(--muted);
}

.calc-planets button[aria-pressed="true"] {
  border-color: var(--signal);
  color: var(--text);
  background: rgba(255, 138, 31, .08);
}

.calc-planets i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.calc-list-plain {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text-2);
}

.calc-shop {
  display: grid;
  gap: 8px;
}

.calc-shop__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
}

.calc-shop__row .field {
  margin: 0;
}

.calc-shop__meta {
  grid-column: 1 / -1;
  margin: 0;
}

.calc-search {
  display: grid;
  gap: 8px;
}

.calc-search__list {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
}

.calc-search__list li + li {
  border-top: 1px solid var(--line);
}

.calc-search__list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.calc-search__list button:hover,
.calc-search__list button:focus-visible {
  background: rgba(255, 138, 31, .08);
  color: var(--text);
}

.calc-search__list small {
  color: var(--muted);
  font: .72rem var(--font-mono);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .calc-shop__row {
    grid-template-columns: minmax(0, 1fr) 80px auto;
  }
}

.tp-calc {
  padding: 18px 18px 46px;
}

.tp-calc__svg {
  width: min(100%, 360px);
  height: auto;
  max-height: 100%;
}

.tp-calc__grid {
  stroke: var(--line);
  stroke-width: 1;
}

.tp-calc__bar--a {
  fill: #3987e5;
}

.tp-calc__bar--b {
  fill: #d95926;
}

.tp-calc__ref {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.tp-calc__night {
  fill: rgba(90, 169, 255, .07);
}

.tp-calc__area {
  fill: rgba(217, 89, 38, .18);
}

.tp-calc__line {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linejoin: round;
}

.tp-calc__cell {
  fill: none;
  stroke: var(--line-3);
}

.tp-calc__cell.is-on {
  fill: var(--ok);
  stroke: var(--ok);
}

.tp-calc__orbit {
  fill: none;
  stroke: var(--line-3);
  stroke-dasharray: 3 5;
}

.tp-calc__planet {
  fill: rgba(213, 81, 129, .22);
  stroke: #d55181;
  stroke-width: 2;
}

.tp-calc__band {
  fill: none;
  stroke: rgba(213, 81, 129, .55);
  stroke-width: 2;
}

.tp-calc__moon {
  fill: var(--line-3);
}

.tp-calc__box {
  fill: rgba(63, 213, 196, .08);
  stroke: var(--cyan);
  stroke-width: 2;
}

.tp-calc__arrow {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.tp-calc__ingot {
  fill: rgba(201, 133, 0, .3);
  stroke: #c98500;
  stroke-width: 1.5;
}

.tp-calc__ore {
  fill: #2b3744;
  stroke: var(--line-3);
}

.tp-calc__lamp {
  fill: var(--hazard);
}

.tp-calc__glow {
  fill: rgba(245, 197, 24, .07);
}

.tp-calc__stem {
  stroke: #199e70;
  stroke-width: 2;
}

.tp-calc__leaf {
  fill: rgba(25, 158, 112, .5);
  stroke: #199e70;
}

.tp-calc__tray {
  fill: #19222c;
  stroke: var(--line-3);
}

@media (prefers-reduced-motion: no-preference) {
  .tp-calc__line {
    stroke-dasharray: 600;
    animation: tp-calc-draw 6s ease-in-out infinite alternate;
  }
}

@keyframes tp-calc-draw {
  from {
    stroke-dashoffset: 600;
  }
  to {
    stroke-dashoffset: 0;
  }
}
