/* Resource tool and second-pass guide styling on the site-grand token system.
   Paper, ink, steel and cobalt only; radius 2px; 140ms interaction timing from
   the shared interaction sheet. No colour is hard-coded outside the tokens. */
.sp-page { overflow-wrap: anywhere; }
.sp-body { max-width: 1000px; margin: 0 auto; padding: 24px 0 64px; }
.sp-page .sp-intro { max-width: 68ch; }
.sp-calculator { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.sp-page fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.sp-page legend { font-weight: 600; margin-bottom: 16px; font-size: 22px; letter-spacing: -.02em; }
.sp-page .sp-basis { margin-bottom: 24px; padding: 16px; border: 1px solid var(--sg-color-steel); }
.sp-page .sp-basis legend { float: none; padding: 0; margin: 0 0 4px; font-size: 16px; }
.sp-page .sp-basis > .sp-radio:first-of-type { border-top: 0; }
.sp-page .sp-radio { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--sg-color-steel); cursor: pointer; }
.sp-page .sp-radio input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sg-color-cobalt); }
.sp-page .sp-radio strong { display: block; font-weight: 600; line-height: 1.4; }
.sp-page .sp-radio small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--sg-color-steel); }
.sp-page .sp-basis-summary { font-family: var(--sg-font-structural); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--sg-color-ink); }
.sp-field { margin-bottom: 20px; }
.sp-field label { display: block; font-weight: 600; margin-bottom: 8px; }
.sp-field input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--sg-color-steel); border-radius: 2px; background: transparent; font: 16px/1.5 var(--sg-font-structural); color: var(--sg-color-ink); font-variant-numeric: tabular-nums; }
.sp-field input:hover { border-color: var(--sg-color-ink); }
.sp-field input:disabled { background: transparent; color: var(--sg-color-steel); border-style: dashed; cursor: not-allowed; }
.sp-field input[aria-invalid="true"] { border-color: var(--sg-color-amber); border-width: 2px; }
.sp-page .sp-confirm { padding: 12px 16px; border: 1px solid var(--sg-color-steel); }
.sp-page .sp-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; }
.sp-page .sp-check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--sg-color-cobalt); cursor: pointer; }
.sp-page .sp-check label { margin: 0; font-weight: 600; line-height: 1.5; cursor: pointer; }
.sp-page .sp-check input[aria-invalid="true"] { outline: 2px solid var(--sg-color-amber); outline-offset: 2px; }
.sp-page .sp-help { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--sg-color-steel); }
.sp-page .sp-error { color: var(--sg-color-amber-text); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.sp-page .sp-error:empty { display: none; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.sp-page button.sg-button { min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 2px; font: 600 14px/1 var(--sg-font-body); cursor: pointer; }
.sp-page button.is-primary { background: var(--sg-color-cobalt); color: var(--sg-color-reverse-paper); }
.sp-page button.is-primary:hover { background: #1738ad; }
.sp-page button.is-primary:active { background: #102a87; }
.sp-page button.is-secondary { background: transparent; color: var(--sg-color-ink); border-color: var(--sg-color-steel); }
.sp-page button.is-secondary:hover { background: #e7e5de; }
.sp-page button.is-secondary:active { background: #dad8d0; }
.sp-page button:disabled { opacity: .55; cursor: not-allowed; }
.sp-page button:disabled:hover { background: transparent; }
.sp-page :is(input, button, a):focus-visible, .sp-result:focus { outline: 2px solid var(--sg-color-cobalt); outline-offset: 3px; }
.sp-page #calculation-notice { margin: 0 0 16px; padding-left: 16px; border-left: 3px solid var(--sg-color-steel); font-size: 14px; line-height: 1.55; }
.sp-page #calculation-notice:empty { display: none; }
.sp-result { padding: 24px; border: 1px solid var(--sg-color-ink); border-left: 3px solid var(--sg-color-cobalt); background: var(--sg-color-paper); scroll-margin-top: calc(var(--header-h, 100px) + 16px); }
.sp-page .sp-result h2 { font-size: 24px; }
.sp-page .sp-amount { font-family: var(--sg-font-structural); font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; line-height: 1.2; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--sg-color-cobalt); }
.sp-page #result-bridge { font-size: 14px; color: var(--sg-color-steel); }
.sp-page .sp-section { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--sg-color-steel); }
.sp-page table { border-collapse: collapse; table-layout: fixed; width: 100%; margin: 20px 0; font-size: 15px; }
.sp-page th:nth-child(1), .sp-page td:nth-child(1) { width: 30%; }
.sp-page th:nth-child(2), .sp-page td:nth-child(2) { width: 20%; white-space: nowrap; font-family: var(--sg-font-structural); font-variant-numeric: tabular-nums; }
.sp-page th:nth-child(3), .sp-page td:nth-child(3) { width: 50%; }
.sp-page caption { text-align: left; font-weight: 600; padding-bottom: 12px; }
.sp-page th, .sp-page td { border-bottom: 1px solid var(--sg-color-steel); padding: 12px 8px; text-align: left; vertical-align: top; }
.sp-page thead th { border-bottom-color: var(--sg-color-ink); font: 12px/1.5 var(--sg-font-structural); letter-spacing: .06em; text-transform: uppercase; }
.sp-page tbody th { font-weight: 500; }
.sp-page .sp-guide { max-width: 760px; }
.sp-page .sp-guide section { margin-bottom: 32px; }
.sp-page .sp-guide ul { list-style: disc; padding-left: 24px; }
.sp-page .sp-guide li { margin-bottom: 8px; }
.sp-page [hidden] { display: none !important; }
@media (max-width: 760px) { .sp-calculator { grid-template-columns: minmax(0, 1fr); gap: 24px; } .sp-result { padding: 18px; } .sp-page th, .sp-page td { padding: 10px 5px; } }
@media (prefers-reduced-motion: reduce) { .sp-page *, .sp-page *::before, .sp-page *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .sp-field input, .sp-result, .sp-page .sp-basis, .sp-page .sp-confirm, .sp-page button.sg-button { border-color: CanvasText; } }
