/* Calculator pages (calculators.html and *-calculator.html). Loaded after styles.css and
   legal.css; uses their tokens only. The page body never scrolls sideways on a phone. */

.crumbs { font-size: 14px; color: var(--text-3); margin: 0 0 12px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.calc-line-intro { font-size: 18px; color: var(--text-2); margin: 0; }

.calc-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; margin: 24px 0 8px; }
.calc-field { margin: 0 0 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 10px; }
.calc-group { margin: 16px 0 8px 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.calc-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calc-label label { font-weight: 600; color: var(--text); font-size: 15px; max-width: calc(100% - 168px); }
.calc-help { position: relative; }
.calc-help summary { list-style: none; cursor: pointer; color: var(--text-3); font-size: 15px; line-height: 1; }
.calc-help summary::-webkit-details-marker { display: none; }
.calc-help p { margin: 6px 0 0; font-size: 14px !important; line-height: 1.5 !important; color: var(--text-2);
  background: var(--surface-2); border-radius: 10px; padding: 8px 10px; flex-basis: 100%; }
.calc-help[open] { flex-basis: 100%; order: 3; }
.calc-switch { margin-left: auto; width: 40px; height: 22px; accent-color: var(--ink); cursor: pointer; }

.calc-line { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin-top: 6px; }
.calc-line[hidden] { display: none; }
.calc-line .calc-box { align-self: flex-end; }
.calc-label .calc-box { margin-left: auto; }
.calc-slide { min-width: 0; padding-top: 4px; }
.calc-slide input[type=range] { width: 100%; accent-color: var(--ink); margin: 0; }
.calc-marks { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.calc-box { display: flex; align-items: center; gap: 4px; width: 128px; flex: none; background: var(--surface-2);
  border-radius: 12px; padding: 8px 10px; border: 1px solid transparent; }
.calc-box:focus-within { border-color: var(--ink); }
.calc-box input { border: 0; background: none; width: 100%; min-width: 0; text-align: right; font: inherit;
  font-size: 16px; color: var(--text); outline: none; }
.calc-unit { color: var(--text-3); font-size: 14px; }
.calc-err { color: var(--debit); font-size: 13px !important; margin: 4px 0 0 !important; min-height: 0; }
.calc-err:empty { display: none; }

.calc-seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.calc-seg button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.calc-seg button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.calc-results { margin-top: 8px; }
.calc-card { margin: 0; background: color-mix(in srgb, var(--ink) 9%, var(--surface)); border-radius: var(--radius); padding: 12px 16px; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.calc-row + .calc-row { border-top: 1px solid var(--line); }
.calc-row dt { color: var(--text-2); }
.calc-row dd { margin: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.calc-row--bold dd { color: var(--ink); font-weight: 700; font-size: 18px; }
.calc-summary { font-size: 16px !important; line-height: 1.5 !important; color: var(--text) !important; margin: 0 0 10px !important; }
.calc-muted { color: var(--text-3) !important; font-size: 14px !important; }

.calc-figure { margin: 16px 0 0; }
.calc-chart { width: 100%; height: auto; display: block; }
.calc-chart text { font-size: 11px; fill: var(--text-3); }
.calc-area { fill: var(--ink); opacity: .1; }
.calc-series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.calc-series--0 { stroke: var(--ink); stroke-width: 3; }
.calc-series--1 { stroke: var(--text-3); stroke-dasharray: 6 4; }
.calc-series--2 { stroke: var(--gold-deep); stroke-dasharray: 6 4; }
.calc-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.calc-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.calc-key--0 i { background: var(--ink); }
.calc-key--1 i { background: var(--text-3); }
.calc-key--2 i { background: var(--gold-deep); }

.calc-table { margin-top: 14px; }
.calc-table summary { cursor: pointer; font-weight: 600; color: var(--text); }
.calc-table table { min-width: 0 !important; width: 100%; margin-top: 8px; font-variant-numeric: tabular-nums; }
.calc-table th, .calc-table td { text-align: right; padding: 4px 6px; font-size: 14px; }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; }

.calc-cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--brand-tint);
  border-radius: var(--radius); padding: 16px 20px; margin: 32px 0; }
.calc-cta p { margin: 0; color: var(--brand-on-tint) !important; flex: 1 1 260px; }
/* legal.css colours every link in .legal green, which hid the label on the green button. */
.legal .calc-cta .btn--solid { color: #fff; width: auto; flex: none; text-decoration: none; }

.calc-list { list-style: none; padding: 0 !important; margin: 12px 0 !important; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.calc-list li { margin: 0 !important; }
.calc-list a { display: block; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; }
.calc-list a:hover { border-color: var(--ink); }
.calc-list strong { display: block; color: var(--text); }
.calc-list span { display: block; font-size: 14px; color: var(--text-2); line-height: 1.5; margin-top: 2px; }

@media (max-width: 420px) {
  .calc-wrap { padding: 16px 14px; }
  .calc-box { width: 118px; }
}
