:root { --ft-color-secondary-readable: #7a5410; --ft-color-control-border: #756b62; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ft-color-surface-1); color: var(--ft-color-text); font-family: var(--ft-font-body); line-height: 1.6; }
main { max-width: 1120px; margin: auto; padding: clamp(16px, 4vw, 48px); }
header { border-top: 5px solid var(--ft-color-primary); padding-top: 24px; margin-bottom: 32px; }
h1 { font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.15 var(--ft-font-display); letter-spacing: -.025em; max-width: 900px; }
h1 span { font-size: .65em; font-weight: 500; color: var(--ft-color-text-muted); }
h2 { line-height: 1.25; font-size: 1.35rem; }
p { margin: 0 0 12px; }
.intro { max-width: 78ch; font-size: 1.1rem; }
.eyebrow { color: var(--ft-color-secondary-readable); font-weight: 700; font-size: .85rem; }
.notice { border-left: 4px solid var(--ft-color-primary); padding: 12px 16px; background: var(--ft-color-surface-0); }
.case { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid var(--ft-color-border); border-radius: var(--ft-radius-lg); background: var(--ft-color-surface-0); margin-bottom: 24px; }
.case h2 { margin-top: 0; }
.case p:last-child { margin-bottom: 0; color: var(--ft-color-text-muted); }
fieldset { min-width: 0; border: 1px solid var(--ft-color-border); border-radius: var(--ft-radius-lg); padding: 24px; margin: 0 0 24px; background: var(--ft-color-surface-0); }
legend { font-weight: 700; padding: 0 8px; font-size: 1.15rem; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; font-size: .8rem; color: var(--ft-color-text-muted); margin-top: 4px; }
input[type=number] { width: 100%; min-height: 46px; border: 1px solid var(--ft-color-control-border); border-radius: var(--ft-radius-sm); padding: 8px 12px; background: var(--ft-color-surface-0); color: var(--ft-color-text); font: inherit; }
input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--ft-color-primary); }
.checks { display: grid; gap: 8px; margin-top: 16px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.hint { color: var(--ft-color-text-muted); font-size: .9rem; max-width: 90ch; margin-bottom: 20px; }
button { cursor: pointer; border: 2px solid var(--ft-color-primary); border-radius: var(--ft-radius-md); padding: 12px 20px; font: 600 1rem var(--ft-font-body); min-height: 48px; color: var(--ft-color-on-primary); background: var(--ft-color-primary); }
button.secondary { background: var(--ft-color-surface-0); color: var(--ft-color-primary); }
button:hover { filter: brightness(.94); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
:focus-visible { outline: 3px solid var(--ft-color-text); outline-offset: 4px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--ft-color-surface-0); border: 1px solid var(--ft-color-border); border-top: 4px solid var(--ft-color-primary); border-radius: var(--ft-radius-md); padding: 24px; }
.card h3 { margin-top: 0; }
.amount { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.04em; margin: 0; }
dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: .95rem; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.difference { padding: 18px 0; font-weight: 600; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--ft-color-border); border-radius: var(--ft-radius-md); background: var(--ft-color-surface-0); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 16px; font-weight: 700; }
th, td { text-align: right; padding: 12px 16px; border-bottom: 1px solid var(--ft-color-border); white-space: nowrap; }
th:first-child { text-align: left; white-space: normal; min-width: 160px; }
thead { background: var(--ft-color-surface-2); }
tbody th { font-weight: 500; }
details { background: var(--ft-color-surface-0); border: 1px solid var(--ft-color-border); border-radius: var(--ft-radius-md); padding: 20px; margin: 24px 0; }
summary { cursor: pointer; font-weight: 700; min-height: 28px; }
details[open] summary { margin-bottom: 20px; }
.formula { overflow-wrap: anywhere; font-family: var(--ft-font-mono); font-size: .9rem; }
a { color: var(--ft-color-primary); overflow-wrap: anywhere; }
li { margin-bottom: 12px; }
#error { color: var(--ft-color-error); border: 2px solid currentColor; padding: 16px; }
footer { padding: 24px; text-align: center; color: var(--ft-color-text-muted); font-size: .85rem; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; top: -100px; padding: 12px; background: var(--ft-color-surface-0); z-index: 10; }
.skip:focus { top: 0; }
@media (max-width: 760px) { .fields { grid-template-columns: 1fr 1fr; } .case { align-items: flex-start; flex-direction: column; } .cards { grid-template-columns: 1fr; } }
@media (max-width: 440px) { .fields { grid-template-columns: 1fr; } fieldset, .case, .card { padding: 16px; } dl { grid-template-columns: 1fr; gap: 0; } dd { margin-bottom: 10px; } }

.source-actions { margin-top: 20px; }
.button-link { display: inline-block; border: 2px solid var(--ft-color-primary); border-radius: var(--ft-radius-md); padding: 12px 18px; font-weight: 600; min-height: 48px; background: var(--ft-color-surface-0); }
