/* ============================================================
   Save-time calculator — /save-time-calculate/
   ------------------------------------------------------------
   Styles for src/pages/save-time-calculate.astro only. Every
   selector is namespaced under .sbb-calc so this file cannot
   reach any other page, and it lives in public/ (Vite never
   processes public/), so adding it changes no other page's
   bundled CSS or chunk graph.

   Tokens (--accent, --text, --muted, --panel, --radius-card,
   --shadow-soft, --ease, ...) come from refresh.css :root, which
   Layout.astro loads because this page passes refresh={true}.
   Nothing is redefined here — the calculator is on the same
   visual system as changelog/contact/terms.

   Tone rule (matches the extension's stats work, see
   OPTIONS-STATS-STRIP-SPEC.md): calm, not gamified. No
   celebration colors, no big green counters, no progress bars.
   The estimate is styled as a quiet number with its unit, and
   every derived figure carries a visible "(est.)".
   ============================================================ */

.sbb-calc {
  font-family: var(--ui-font);
  color: var(--text);
  padding: clamp(18px, 4vw, 44px) clamp(18px, 4vw, 24px) clamp(40px, 6vw, 72px);
  max-width: 900px;
  margin: 0 auto;
}

/* ---- Header ---- */

.sbb-calc__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sbb-calc__eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.sbb-calc__title {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.sbb-calc__lead {
  margin: 0 0 10px;
  max-width: 68ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

/* ---- The calculator card ---- */

.sbb-calc__card {
  margin: clamp(24px, 4vw, 36px) 0 0;
  padding: clamp(20px, 3.4vw, 32px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.sbb-calc__card-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sbb-calc__card-note {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- Inputs ---- */

.sbb-calc__fields {
  display: grid;
  gap: 22px;
}

.sbb-calc__field {
  display: grid;
  gap: 10px;
}

.sbb-calc__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.sbb-calc__value {
  flex: none;
  min-width: 3.5ch;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sbb-calc__hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sbb-calc__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.sbb-calc__range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-strong);
}

.sbb-calc__range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-strong);
}

.sbb-calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.22);
}

.sbb-calc__range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.22);
}

.sbb-calc__range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 999px;
}

/* Slider end labels */
.sbb-calc__scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---- Results ---- */

.sbb-calc__results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--panel-border);
}

.sbb-calc__result {
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-control);
  background: var(--control-bg-soft);
}

.sbb-calc__result-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sbb-calc__result-figure {
  display: block;
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.sbb-calc__result-est {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ---- The arithmetic, written out ---- */

.sbb-calc__math {
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--field-border);
  border-radius: var(--radius-control);
  background: var(--field-surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.sbb-calc__math strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---- Prose sections below the card ---- */

.sbb-calc__section {
  margin: clamp(28px, 4vw, 40px) 0 0;
  padding: clamp(20px, 3.4vw, 28px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft);
}

.sbb-calc__section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sbb-calc__section p {
  margin: 0 0 12px;
  max-width: 70ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.sbb-calc__section p:last-child {
  margin-bottom: 0;
}

.sbb-calc__section ul {
  margin: 0 0 12px;
  padding-left: 20px;
  max-width: 70ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.sbb-calc__section li {
  margin-bottom: 8px;
}

.sbb-calc__section li:last-child {
  margin-bottom: 0;
}

.sbb-calc__section a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.sbb-calc__section a:hover {
  text-decoration: underline;
}

/* ---- Closing CTA ---- */

.sbb-calc__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: clamp(28px, 4vw, 40px) 0 0;
}

.sbb-calc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.sbb-calc__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(26, 115, 232, 0.24);
}

.sbb-calc__cta-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---- Narrow viewports ---- */

@media (max-width: 720px) {
  .sbb-calc__results {
    grid-template-columns: 1fr;
  }

  .sbb-calc__label {
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sbb-calc__btn {
    transition: none;
  }

  .sbb-calc__btn:hover {
    transform: none;
  }
}
