/* footer */
footer { padding-block: 44px; font-size: .84rem; color: var(--ink2); border-top: 1px solid var(--rule) }
.sources { padding-left: 1.2em; display: grid; gap: 8px; max-width: 60em; margin: 12px 0 28px }
.legal { max-width: 60em }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px }

/* modals */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(16, 32, 47, .55); z-index: 40; padding: 20px; overflow-y: auto }
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center }
.modal-card { background: var(--sheet); border: 1px solid var(--rule); width: min(560px, 100%); margin-block: 6vh; box-shadow: 0 30px 60px -30px rgba(16, 32, 47, .6) }
.modal-card.wide { width: min(760px, 100%) }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--rule) }
.modal-header h3 { font-size: 1.25rem }
.modal-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink2); padding: 0 4px }
.modal-body { padding: 24px }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--rule); flex-wrap: wrap }
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--rule) }
.auth-tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 6px; font: 600 .98rem var(--body); color: var(--ink2); cursor: pointer }
.auth-tabs button.active { color: var(--ink); border-bottom-color: var(--green) }
.auth-form { display: grid; gap: 14px }
.auth-hint { font-size: .82rem; color: var(--ink2) }
.auth-error { border: 1px solid var(--red); background: rgba(198, 54, 44, .07); color: var(--red); padding: 10px 12px; font-size: .9rem }
.auth-ok { border: 1px solid var(--green); background: var(--green-soft); color: var(--green); padding: 10px 12px; font-size: .9rem }
.clickwrap { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: .9rem; line-height: 1.45 }
.clickwrap input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green) }
.clickwrap a { color: var(--green); text-decoration: underline }
.letter { white-space: pre-wrap; font: 400 .92rem/1.6 var(--mono); background: var(--paper); border: 1px solid var(--rule); padding: 18px; max-height: 52vh; overflow-y: auto }
.checkout-summary { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); font-size: 1.02rem }
.checkout-summary b { font: 800 1.4rem var(--display) }

@media (prefers-reduced-motion: no-preference) {
  .pen { animation: ink .5s ease-out both }
  .stmt tr.flag:nth-of-type(7) .pen { animation-delay: .5s }
  .stmt tr:last-child .pen { animation-delay: 1s }
  @keyframes ink { from { clip-path: inset(0 100% 0 0) } to { clip-path: inset(0 0 0 0) } }
}

/* The storage choice on the upload card, and the account panel */
.storage-card { margin-top: 20px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--rule); background: var(--sheet); border-radius: 4px; display: grid; gap: 14px }
.storage-option { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--rule); border-radius: 4px; font-size: .92rem; line-height: 1.45; cursor: pointer }
.storage-option:has(input:checked) { border-color: var(--green); background: var(--green-soft) }
.storage-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green) }
.storage-option, .storage-card .clickwrap { font-weight: 400 }
.storage-option strong, .storage-card .clickwrap strong { font-weight: 600 }
.storage-usual { color: var(--green); font-style: normal; font-weight: 600 }
.storage-card .btn { justify-self: start }
/* The accuracy-testing disclosure shares .storage-option with the radio rows, which are a two-column grid.
   It is one block: a summary row, then its content in normal flow (CSS only: the form's markup is pinned). */
details.storage-option { display: block; padding: 0; cursor: default }
details.storage-option summary { display: flex; align-items: center; gap: 10px; padding: 12px; font-weight: 600; cursor: pointer; list-style: none }
details.storage-option summary::-webkit-details-marker { display: none }
details.storage-option summary::before { content: ""; width: 7px; height: 7px; flex: none; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2);
  transform: rotate(-45deg); transition: transform .15s }
details.storage-option[open] summary::before { transform: rotate(45deg) }
details.storage-option > :not(summary) { margin-inline: 12px }
details.storage-option > :not(summary) + :not(summary) { margin-top: 10px }
details.storage-option > summary + * { margin-top: 4px }
details.storage-option[open] { padding-bottom: 12px }
details.storage-option > label:not(.clickwrap) { display: block; font-weight: 600; font-size: .92rem }
details.storage-option input[type="file"] { display: block; width: 100%; height: auto; margin: 6px 0 0; padding: 10px; border: 1px dashed var(--rule);
  border-radius: 4px; background: var(--sheet); font: inherit; font-weight: 400 }
.storage-card #clickwrapText { font-size: .9rem; color: var(--ink) }
.storage-card #clickwrapText a { color: var(--green); font-weight: 600; text-decoration: underline }
.upload-picked { margin-top: 10px; font-family: var(--mono); font-size: .85rem; color: var(--ink) }
.close-form { display: grid; gap: 12px; max-width: 26rem; margin-top: 12px }
.sources-block { margin-top: 32px; font-size: .84rem; color: var(--ink2) }

/* The report-format chooser under "Download the report" (ratably-report-formats.js) */
.calc-actions { position: relative }
.report-menu { position: absolute; z-index: 4; min-width: min(280px, 100%); display: grid; background: var(--sheet);
  border: 1.5px solid var(--ink); border-radius: 3px; box-shadow: 0 12px 24px rgba(16, 32, 47, .12) }
.report-menu[hidden] { display: none }
.report-menu-item { display: grid; gap: 2px; padding: 11px 16px; border: 0; background: none; color: var(--ink);
  font-family: var(--body); text-align: left; cursor: pointer }
.report-menu-item + .report-menu-item { border-top: 1px solid var(--rule) }
.report-menu-item:hover, .report-menu-item:focus-visible { background: var(--green-soft); outline-offset: -3px }
.report-menu-name { font-weight: 600; font-size: .95rem }
.report-menu-hint { font-size: .8rem; color: var(--ink2) }
.state-notes { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: .88rem; color: var(--ink2); line-height: 1.55 }
.state-notes[hidden] { display: none }
.state-notes h3 { font: 700 1rem/1.3 var(--display); color: var(--ink); margin: 0 0 8px }
.state-notes p { margin: 8px 0 }
.state-notes ol, .state-notes ul { margin: 8px 0; padding-left: 1.25em }
.state-notes li { margin: 5px 0 }
.state-notes a { color: var(--green); overflow-wrap: anywhere }
.state-notes .reminder-cta { margin-top: 12px }
.state-notes .reminder-cta a.btn { color: var(--ink); text-decoration: none }
.reminder-row { list-style: none }
