/* All rules are scoped so they can coexist with the Hugo Docsy theme. */
.guided-calc {
  --calc-border: #cdd8e6;
  --calc-bg: #ffffff;
  --calc-soft: #f3f7fb;
  --calc-text: #1d334c;
  --calc-muted: #546b83;
  --calc-blue: #1359ae;
  --calc-highlight: #eaf4ff;
  margin: 1.5rem 0;
  border: 1px solid var(--calc-border);
  border-radius: 16px;
  background: var(--calc-bg);
  color: var(--calc-text);
  box-shadow: 0 4px 20px rgba(17, 49, 88, 0.07);
  overflow: hidden;
}
.guided-calc [hidden] { display: none !important; }
.guided-calc__header { padding: 1rem 1.25rem 0.8rem; background: var(--calc-soft); }
.guided-calc__eyebrow {
  display: block; color: var(--calc-blue); font-size: 0.75rem;
  font-weight: 750; text-transform: uppercase; letter-spacing: 0.055em;
}
.guided-calc .guided-calc__title {
  margin: 0.25rem 0 0; font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 750; color: var(--calc-text); line-height: 1.25;
}
.guided-calc__toolbar {
  display: flex; align-items: center; gap: 0.8rem; justify-content: space-between;
  flex-wrap: wrap; padding: 0.9rem 1.25rem; border-top: 1px solid var(--calc-border);
  border-bottom: 1px solid var(--calc-border);
}
.guided-calc__progress { color: var(--calc-muted); font-weight: 750; white-space: nowrap; }
.guided-calc__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.guided-calc__actions button {
  color: var(--calc-blue); background: var(--calc-bg); border: 1px solid var(--calc-border);
  font: inherit; font-size: 0.9rem; font-weight: 650; line-height: 1.2;
  padding: 0.55rem 0.78rem; border-radius: 8px; cursor: pointer;
}
.guided-calc__actions button:hover:not(:disabled) { background: var(--calc-highlight); }
.guided-calc__actions .guided-calc__primary { color: #ffffff; background: var(--calc-blue); border-color: var(--calc-blue); }
.guided-calc__actions .guided-calc__primary:hover:not(:disabled) { background: #074787; }
.guided-calc__actions button:focus-visible { outline: 3px solid #ffbd59; outline-offset: 2px; }
.guided-calc__actions button:disabled { cursor: not-allowed; opacity: 0.46; }
.guided-calc__body { padding: 1rem 1.25rem 1.15rem; }
.guided-calc__body > :first-child { margin-top: 0; }
.guided-calc__body > :last-child { margin-bottom: 0; }
.guided-calc__body ol { padding-left: 1.55rem; margin: 1rem 0 0; }
.guided-calc__body ol > li { padding: 0.6rem 0.85rem; margin: 0.5rem 0; border-left: 3px solid var(--calc-border); }
.guided-calc__body ol > li::marker { color: var(--calc-blue); font-weight: 750; }
.guided-calc__body ol > li > :last-child { margin-bottom: 0; }
.guided-calc__body .guided-calc__step--latest { background: var(--calc-highlight); border-left-color: var(--calc-blue); border-radius: 0 8px 8px 0; }
.guided-calc__body code { overflow-wrap: anywhere; }
/* Follow the site's light/dark toggle (Docsy sets data-bs-theme on <html>), not the OS setting. */
[data-bs-theme="dark"] .guided-calc {
  --calc-border: #405671; --calc-bg: #162538; --calc-soft: #21364e;
  --calc-text: #edf4ff; --calc-muted: #bad0e9; --calc-blue: #90c5ff;
  --calc-highlight: #294564;
}
[data-bs-theme="dark"] .guided-calc__actions .guided-calc__primary { background: #165da5; border-color: #165da5; color: #ffffff; }
[data-bs-theme="dark"] .guided-calc__actions .guided-calc__primary:hover:not(:disabled) { background: #0f4a88; }
@media (max-width: 580px) {
  .guided-calc__toolbar { display: block; }
  .guided-calc__actions { margin-top: 0.65rem; }
  .guided-calc__actions button { flex: 1 1 auto; }
}
@media print {
  .guided-calc { box-shadow: none; border: 1px solid #888; break-inside: avoid-page; }
  .guided-calc .guided-calc__toolbar { display: none !important; }
  /* Print the entire solution, even if only one step was revealed on screen. */
  .guided-calc__body ol > li[hidden] { display: list-item !important; }
  .guided-calc__body ol > li { break-inside: avoid; }
}
