/* APE price page — charts + calculator */
.ape-tools--page {
  max-width: var(--max-wide);
  margin: 0 auto;
}

.ape-tools__panel {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ape-tools__panel--first {
  margin-top: 0;
}

.ape-tools__h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  margin: 0 0 0.75rem;
}

.ape-tools__toggle-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.ape-tools__toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ape-tools__toggle {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.ape-tools__toggle-btn {
  margin: 0;
  padding: 0.45rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ape-tools__toggle-btn:hover {
  color: var(--text);
}

.ape-tools__toggle-btn.is-active {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: var(--bg);
}

.ape-tools__toggle-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.ape-tools__toggle-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 42rem;
}

.ape-tools__status {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.ape-tools__status.ape-tools__status--error {
  color: #f87171;
}

.ape-tools__stats {
  display: grid;
  gap: 1rem;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.ape-tools__stats dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.ape-tools__stats dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.ape-tools__charts {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0;
}

.ape-tools__figure {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ape-tools__caption {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.ape-tools__canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
  max-height: 380px;
}

.ape-tools__panel--calc {
  margin-bottom: 3rem;
}

.ape-tools__panel--calc.ape-tools__panel--first {
  margin-bottom: 1.5rem;
}

.ape-tools__form {
  max-width: 420px;
}

.ape-tools__label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ape-tools__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ape-tools__input {
  flex: 1;
  min-width: 8rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  font-family: var(--font-sans);
}

.ape-tools__input:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.ape-tools__unit {
  color: var(--muted);
  font-weight: 600;
}

.ape-tools__help {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}

.ape-tools__muted {
  color: var(--muted);
  margin: 0 0 1rem;
}

.ape-tools__result {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(94, 234, 212, 0.06);
}

.ape-tools__result-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.ape-tools__result-value {
  font-size: 1.5rem;
  color: var(--accent);
}
