.ballistic-calculator-band {
  color: #fffdf3;
  background:
    radial-gradient(circle at 88% 8%, rgba(199, 83, 45, 0.28), transparent 28%),
    linear-gradient(140deg, #081d16, #123827 58%, #172f25);
}

.ballistic-calculator-head {
  align-items: end;
}

.ballistic-calculator-head h2 {
  color: #fffdf3;
}

.ballistic-calculator-head p {
  color: rgba(255, 253, 243, 0.74);
}

.ballistic-tool-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ballistic-tool-tabs button {
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 16px 12px;
  place-items: center;
  color: #fffdf3;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ballistic-tool-tabs button:hover,
.ballistic-tool-tabs button[aria-selected="true"] {
  border-color: #ff9a67;
  background: rgba(199, 83, 45, 0.88);
  transform: translateY(-2px);
}

.ballistic-tool-tabs button:focus-visible {
  outline: 3px solid #fff9ed;
  outline-offset: 3px;
}

.ballistic-tool-tabs button > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--pine-dark);
  background: #fff9ed;
  font-size: 1.35rem;
  font-weight: 950;
}

.ballistic-tool-tabs strong {
  font-size: 0.95rem;
  line-height: 1.15;
}

.ballistic-tool-tabs small {
  color: rgba(255, 253, 243, 0.68);
  font-size: 0.76rem;
  line-height: 1.25;
}

.ballistic-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(18px, 3vw, 34px);
  margin-top: 12px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(4, 17, 12, 0.58);
}

.ballistic-panel[hidden] {
  display: none;
}

.ballistic-panel-copy {
  display: grid;
  gap: 10px;
  align-content: center;
}

.ballistic-panel-copy h3 {
  color: #fffdf3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  line-height: 1;
}

.ballistic-panel-copy p {
  color: rgba(255, 253, 243, 0.72);
  line-height: 1.55;
}

.ballistic-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.ballistic-form-grid label {
  display: grid;
  gap: 7px;
  color: #fffdf3;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ballistic-form-grid label > span {
  position: relative;
  display: flex;
  min-width: 0;
}

.ballistic-form-grid input,
.ballistic-form-grid select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: #fff9ed;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 800;
}

.ballistic-form-grid label > span input {
  padding-right: 74px;
}

.ballistic-form-grid label > span em {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  letter-spacing: 0;
  pointer-events: none;
  text-transform: none;
  transform: translateY(-50%);
}

.ballistic-form-grid label > span select {
  flex: 0 0 88px;
  width: 88px;
  margin-left: 6px;
}

.ballistic-result {
  display: grid;
  grid-column: 1 / -1;
  min-height: 118px;
  padding: 16px;
  place-content: center;
  color: var(--pine-dark);
  border: 2px solid rgba(199, 83, 45, 0.34);
  border-radius: var(--radius);
  background: #fff9ed;
  text-align: center;
}

.ballistic-result small,
.ballistic-result span {
  color: var(--muted);
}

.ballistic-result small {
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ballistic-result strong {
  margin: 4px 0;
  color: var(--clay);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.ballistic-result span {
  font-size: 0.85rem;
  font-weight: 800;
}

.ballistic-converter-grid,
.ballistic-pcp-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ballistic-source {
  margin-top: 12px;
  color: rgba(255, 253, 243, 0.62);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: right;
}

.ballistic-source a {
  color: #ffd7bd;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .ballistic-tool-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ballistic-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ballistic-tool-tabs,
  .ballistic-form-grid,
  .ballistic-converter-grid,
  .ballistic-pcp-grid {
    grid-template-columns: 1fr;
  }

  .ballistic-tool-tabs button {
    min-height: 0;
    grid-template-columns: 38px 1fr;
    justify-items: start;
    text-align: left;
  }

  .ballistic-tool-tabs button small {
    grid-column: 2;
  }
}
