.cal-main {
  padding: 40px 0 64px;
}

.cal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.cal-title .cal-brace { color: var(--purple); }

.cal-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

/* ── Inputs card ── */
.cal-card {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

.cal-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.cal-field label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.cal-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 26px 0 12px;
  transition: border-color 0.2s;
}
.cal-input-group:focus-within { border-color: var(--cyan); }

.cal-input-currency {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-right: 4px;
}

.cal-input-group input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
}

/* custom stepper replaces the native spin buttons */
.cal-input-group input::-webkit-outer-spin-button,
.cal-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cal-input-group input[type="number"] {
  -moz-appearance: textfield;
}

.cal-stepper {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 22px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-radius: 0 7px 7px 0;
  overflow: hidden;
}

.cal-step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.cal-step:not(:last-child) { border-bottom: 1px solid var(--border); }

.cal-step::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}
.cal-step--up::before   { border-bottom: 4px solid currentColor; }
.cal-step--down::before { border-top: 4px solid currentColor; }

.cal-step:hover {
  color: var(--bg-terminal);
  background: linear-gradient(180deg, var(--purple), var(--cyan));
}
.cal-step:active { filter: brightness(0.85); }

/* ── Result summary ── */
.cal-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.cal-result__item { flex: 1; min-width: 180px; }

.cal-result__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.cal-result__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan);
}
.cal-result__value--warn { color: var(--yellow); }

.cal-result__hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Table ── */
.cal-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

table.cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cal-table thead th {
  text-align: right;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.cal-table thead th:first-child { text-align: left; }

.cal-table tbody td {
  text-align: right;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}
.cal-table tbody td:first-child { text-align: left; color: var(--text-muted); }

.cal-table tbody tr:last-child td { border-bottom: none; }

.cal-table .cal-profit--pos { color: var(--green); }
.cal-table .cal-profit--neg { color: var(--red); }
.cal-table .cal-profit--zero { color: var(--text-muted); }

.cal-table tr.cal-row--breakeven td {
  background: rgba(0, 212, 255, 0.05);
}

/* ── Disclaimer ── */
.cal-disclaimer {
  margin-top: 20px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-muted);
  opacity: 0.7;
}

@media (max-width: 600px) {
  .cal-fields { grid-template-columns: 1fr; }
  .cal-table { font-size: 0.75rem; }
  .cal-table thead th, .cal-table tbody td { padding: 8px 10px; }
}