/* The calculators and the tools page (sections/Tools.php, sections/Calculator.php, web/calc-widget.js). Tokens only (R7). */

.nv-calc__tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; margin-bottom: 24px; }
.nv-calc__tab {
  display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 12px 13px; border: 1px solid transparent; border-radius: var(--nv-r-row);
  background: var(--nv-surface-alt); color: var(--nv-text-2); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer;
  transition: background var(--nv-dur-hover), border-color var(--nv-dur-hover);
}
.nv-calc__tab:hover { color: var(--nv-text); }
.nv-calc__tab[aria-pressed="true"] { border-color: var(--nv-primary); background: var(--nv-primary-light); color: var(--nv-primary); box-shadow: 0 6px 16px rgba(var(--nv-primary-rgb), .12); }
.nv-calc__tab-icon { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 12px; background: var(--nv-surface-alt); color: var(--nv-primary); }
.nv-calc__tab[aria-pressed="true"] .nv-calc__tab-icon { background: var(--nv-surface); }

.nv-calc__grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.nv-calc__form { flex: 1 1 440px; min-width: 0; }
.nv-calc__side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.nv-calc__nojs { font-size: 14.5px; line-height: 1.6; color: var(--nv-text-2); }
.nv-calc__title { margin-bottom: 4px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.nv-calc__sub { max-width: 52ch; margin-bottom: 20px; font-size: 14px; line-height: 1.55; color: var(--nv-text-3); }
.nv-calc__fields { display: flex; flex-direction: column; gap: 14px; }
.nv-calc__actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }

/* the answer: a blue card in light and dark (the hero colours do not change with the theme) */
.nv-calc__result { padding: 24px; border-radius: 20px; background: var(--nv-hero-primary); color: var(--nv-on-hero); box-shadow: 0 16px 36px rgba(var(--nv-ink-rgb), .22); }
.nv-calc__result-label { font-size: 13px; font-weight: 600; color: var(--nv-on-hero-2); }
.nv-calc__value { margin: 6px 0 4px; font-size: var(--nv-fs-figure); font-weight: 600; line-height: 1.02; letter-spacing: -.025em; overflow-wrap: anywhere; }
.nv-calc__result-sub { font-size: 14px; line-height: 1.5; color: var(--nv-on-hero-2); }
.nv-calc__legend { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.nv-calc__legend[hidden], .nv-calc__bar[hidden] { display: none; }
.nv-calc__legend-row { display: flex; align-items: center; gap: 11px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .16); font-size: 14px; }
.nv-calc__legend-name { flex: 1; min-width: 0; }
.nv-calc__sw { flex: none; width: 9px; height: 9px; border-radius: 3px; }
.nv-calc__sw--1 { background: rgba(255, 255, 255, .95); }
.nv-calc__sw--2 { background: rgba(255, 255, 255, .72); }
.nv-calc__sw--3 { background: rgba(255, 255, 255, .5); }
.nv-calc__sw--4 { background: rgba(255, 255, 255, .3); }
.nv-calc__bar { display: flex; height: 10px; margin-top: 18px; border-radius: 5px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.nv-calc__seg { display: block; flex-basis: 0; min-width: 2px; transition: flex-grow .3s var(--nv-ease); }

.nv-calc__details { padding: 20px; }
.nv-calc__details-title { margin-bottom: 12px; font-size: 16px; font-weight: 600; }
.nv-calc__rows { display: flex; flex-direction: column; gap: 11px; margin: 0; }
.nv-calc__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.nv-calc__row dt { color: var(--nv-text-3); }
.nv-calc__row dd { margin: 0; font-weight: 600; text-align: right; color: var(--nv-text); }
.nv-calc__note { margin-top: 14px; font-size: 12.5px; line-height: 1.55; color: var(--nv-text-3); }

.nv-calc__help { padding: 20px; border-radius: 20px; background: var(--nv-primary-light); }
.nv-calc__help:empty { display: none; }
.nv-calc__help-title { margin-bottom: 8px; font-size: 16px; font-weight: 600; color: var(--nv-primary); }
.nv-calc__help-body { margin-bottom: 14px; font-size: 14px; line-height: 1.55; color: var(--nv-text-2); }

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