.tax-shell { max-width: 76rem; }
.tax-page { font-variant-numeric: tabular-nums; }
.tax-page .site-header { min-height: 5.15rem; }
.tax-languages { display: flex; align-items: center; gap: .15rem; }
.tax-languages a { display: inline-grid; place-items: center; position: relative; min-width: 2.25rem; min-height: 2.75rem; color: var(--muted); font-size: .82rem; }
.tax-languages a[aria-current] { color: var(--ink); font-weight: 700; }
.tax-languages a[aria-current]::after { content: ""; position: absolute; bottom: .26rem; inset-inline: .55rem; height: 2px; background: var(--accent); }
.crumbs { display: flex; align-items: center; gap: .6rem; color: var(--muted); margin: 1.6rem 0 .85rem; font-size: .81rem; }
.crumbs a, .underlink { text-decoration: underline; text-underline-offset: .2em; text-decoration-color: #aaa69b; }
.tax-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; padding: .6rem 0 2rem; }
.tax-intro h1 { max-width: 14.8em; font-size: clamp(2.5rem, 5.15vw, 5rem); line-height: 1.015; letter-spacing: -.065em; text-wrap: balance; }
.tax-intro p { max-width: 43rem; margin-top: 1rem; color: var(--muted); line-height: 1.55; font-size: clamp(.96rem, 1.35vw, 1.11rem); }
.date-block { flex: 0 0 auto; display: grid; gap: .2rem; padding-left: .85rem; margin-bottom: .25rem; border-left: 3px solid var(--accent); font-size: .77rem; color: var(--muted); }
.date-block time { color: var(--ink); font-weight: 700; font-size: .91rem; }
.roles { min-width: 0; border: 0; border-top: 1px solid var(--line); padding: 0; margin: 0 0 1.2rem; }
.roles legend { padding: 0 .7rem 0 0; font-size: .8rem; color: var(--muted); }
.roles > div { display: flex; flex-wrap: wrap; gap: .42rem; padding-top: .6rem; }
.roles label { cursor: pointer; position: relative; flex: 1 1 auto; }
.roles label > span { display: grid; place-items: center; min-height: 2.8rem; padding: .42rem .88rem; border: 1px solid #cecabe; border-radius: .3rem; background: transparent; font-size: .91rem; line-height: 1.15; text-align: center; }
.roles input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.roles input:focus-visible + span { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.calc-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: clamp(1rem,2.5vw,2.1rem); align-items: start; }
.form-paper { padding: clamp(1.15rem,2.8vw,2.25rem); background: var(--surface); border: 1px solid var(--line); border-radius: .35rem; min-width: 0; }
.form-head { display: flex; align-items: baseline; justify-content: space-between; gap: .65rem 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.form-head h2, .rules h2 { font-size: clamp(1.4rem,2.2vw,2.1rem); letter-spacing: -.055em; line-height: 1.15; }
.underlink { font-size: .84rem; color: var(--accent-ink); min-height: 2rem; text-align: start; }
.secondary { color: var(--muted); }
.inputs, .field-stack { display: grid; gap: 1rem; min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.field-grid:has(> [hidden]) { grid-template-columns: minmax(0,1fr); }
.field { min-width: 0; }
.field label { display: block; margin-bottom: .33rem; font-size: .9rem; line-height: 1.4; font-weight: 700; }
.field select, .number-wrap { width: 100%; min-height: 2.85rem; border: 1px solid #b9b6aa; border-radius: .27rem; background-color: #fffefa; font-size: 1rem; }
.field select { appearance: none; padding: .55rem 2.1rem .55rem .8rem; background: #fffefa url("polka/icons/chevron.svg") right .65rem center/15px no-repeat; text-overflow: ellipsis; }
.number-wrap { display: flex; align-items: stretch; }
.number-wrap:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.field input { min-width: 0; width: 100%; height: auto; padding: .5rem .8rem; border: 0; border-radius: inherit; background: transparent; font-size: 1rem; }
.field input:focus-visible { outline: 0; }
.field .unit { align-self: center; padding-right: .8rem; color: var(--muted); font-size: .83rem; }
.field .unit:empty { display: none; }
.field input::placeholder { color: #77776c; }
.main-amount input { font-size: clamp(1.28rem,2.6vw,1.65rem); font-weight: 700; letter-spacing: -.045em; }
.main-amount .number-wrap { min-height: 3.3rem; }
.field small, .field-note, .field-error { display: block; color: var(--muted); font-size: .79rem; line-height: 1.5; margin-top: .32rem; }
.inputs > .field-note { margin-top: -.69rem; }
.field-error { color: #9a3116; }
.field [aria-invalid=true], .number-wrap:has([aria-invalid=true]) { border-color: #b83c20; }
.options { border-block: 1px solid var(--line); }
.options summary, .faq-item summary, .sources summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
.options summary { font-size: .88rem; min-height: 2.8rem; font-weight: 700; }
.options summary::after, .faq-item summary::after, .sources summary::after { content: "+"; font: 1.26rem/1 var(--mono); color: var(--accent-ink); }
details[open] > summary::after { content: "−"; }
.options > .field-stack { padding-block: .25rem 1rem; }
.form-foot { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; margin-top: 1.4rem; }
.action { display: inline-flex; align-items: center; gap: 1.15rem; min-height: 2.85rem; padding: .52rem 1rem; border-radius: .25rem; color: #fff; background: #ac381b; font-size: .95rem; font-weight: 700; }
.action span:last-child { font-size: 1.05rem; line-height: 1; }
.receipt-column { min-width: 0; position: sticky; top: .8rem; }
.receipt { position: relative; padding: clamp(1.15rem,2.5vw,2rem); background: #edeae1; border-top: 4px solid var(--accent); border-radius: .24rem .24rem 0 0; }
.receipt::after { content: ""; position: absolute; top: 100%; inset-inline: 0; height: 7px; background: linear-gradient(135deg,#edeae1 25%,transparent 25%) -6px 0/12px 12px repeat-x, linear-gradient(225deg,#edeae1 25%,transparent 25%) -6px 0/12px 12px repeat-x; }
.receipt-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 700; font-size: .84rem; }
#sample { padding: .13rem .47rem; border: 1px solid #b9b5a7; color: #59564e; border-radius: .22rem; font-size: .7rem; font-weight: 400; }
.receipt-main { margin: 1.2rem 0 1.1rem; }
.receipt-main h2 { font-size: .91rem; color: #555349; font-weight: 400; }
.total { margin: .15rem 0 .25rem; font-size: clamp(1.9rem,4vw,3.45rem); line-height: 1.05; letter-spacing: -.075em; overflow-wrap: anywhere; }
.total strong { font-weight: 700; }
.total > span { font-size: .43em; letter-spacing: -.025em; white-space: nowrap; }
#context-line { color: #5a594f; font-size: .76rem; }
#breakdown { border-top: 1px dashed #b7afa0; padding-top: .3rem; }
#breakdown:empty, #result-notes:empty, #result-sources:empty { display: none; }
#breakdown > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .04rem .85rem; align-items: start; padding-block: .53rem; }
#breakdown dt { color: #4f4e45; font-size: .81rem; overflow-wrap: anywhere; }
#breakdown dd { text-align: right; font-size: .87rem; font-weight: 700; }
#breakdown .formula-line { grid-column: 1/-1; text-align: left; color: #626052; font: .75rem/1.43 var(--mono); overflow-wrap: anywhere; }
#result-notes p, #receipt-message, .result-sources { font-size: .77rem; line-height: 1.48; }
#result-notes p, #receipt-message { margin-top: .55rem; color: #59574b; }
.result-sources { margin-top: .8rem; }
.result-sources summary { cursor: pointer; color: #5a584d; font-size: .77rem; }
.result-sources a, .sources a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .18em; }
.result-sources ul { margin: .45rem 0; padding-left: 1.2rem; }
.receipt-actions { display: flex; gap: 1.15rem; margin-top: 1rem; padding-top: .45rem; border-top: 1px solid #c6c1b4; }
.receipt-actions button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.4rem; font-size: .84rem; }
.local-note { display: flex; align-items: center; justify-content: center; gap: .42rem; margin: 1.15rem .2rem 0; color: var(--muted); font-size: .76rem; text-align: center; }
#copy-status:not(:empty) { margin-top: .85rem; text-align: center; font-size: .82rem; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem,4vw,4rem); border-top: 1px solid var(--line); padding-top: 2.3rem; margin-top: 3.4rem; }
.rules h3 { margin: .9rem 0 .35rem; font-size: 1rem; }
.rules p, .faq-item p { color: var(--muted); font-size: .9rem; line-height: 1.58; }
.rules table { width: 100%; border-collapse: collapse; margin-top: .9rem; font-size: .82rem; }
.rules th, .rules td { padding: .48rem .2rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rules th:first-child { text-align: left; white-space: normal; }
.rules thead th { font-size: .75rem; color: var(--muted); white-space: normal; }
.faq { border-top: 1px solid var(--line); align-self: start; }
.faq-item, .sources { border-bottom: 1px solid var(--line); }
.faq-item summary, .sources summary { min-height: 3.15rem; font-weight: 700; font-size: .92rem; }
.faq-item p { padding: 0 1rem 1.1rem 0; }
.sources { border-top: 1px solid var(--line); margin: 2rem 0 3rem; }
.sources ul { padding: 0 0 1rem 1.2rem; columns: 2; column-gap: 3rem; font-size: .85rem; }
.sources li { break-inside: avoid; padding-block: .23rem; }
.noscript { padding: 1rem; border-left: 3px solid var(--accent); background: var(--surface); }
@media (hover:hover) {
  .roles input:not(:checked) + span:hover { background: #eae7dd; }
  .underlink:hover, .crumbs a:hover { color: #6a2413; }
  .action:hover { background: #852b14; }
  .receipt-actions button:not(:disabled):hover, .tax-languages a:hover { color: var(--accent-ink); }
}
@media (max-width:55rem) {
  .tax-page .site-header { min-height: 4.4rem; }
  .calc-grid { grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); }
  .field-grid { grid-template-columns: 1fr; }
  .tax-intro h1 { font-size: clamp(2.6rem,6.2vw,3.85rem); }
}
@media (max-width:43rem) {
  .tax-intro { display: block; padding-bottom: 1.35rem; }
  .date-block { display: flex; gap: .35rem; align-items: center; margin: .9rem 0 0; }
  .date-block time { font-size: .77rem; }
  .crumbs { margin-top: .9rem; }
  .calc-grid, .rules { grid-template-columns: minmax(0,1fr); }
  .roles > div { gap: .32rem; }
  .roles label { flex: 1 1 21%; }
  .roles label > span { min-height: 2.75rem; padding-inline: .35rem; font-size: .82rem; }
  .receipt-column { position: static; }
  .receipt { scroll-margin-top: .7rem; }
  .rules { margin-top: 2.2rem; padding-top: 1.7rem; }
  .sources ul { columns: 1; }
  .form-head { margin-bottom: 1rem; }
  .tax-page .footer-nav { gap: .5rem 1rem; flex-wrap: wrap; }
  .tax-page .footer-nav a { font-size: .82rem; }
}
@media (max-width:24rem) {
  .tax-languages a { min-width: 1.9rem; }
  .roles label { flex-basis: 27%; }
  .action { gap: .5rem; }
  .rules table { font-size: .73rem; }
}
@media print {
  @page { margin: 15mm; }
  .tax-page { background: #fff; color: #000; }
  .tax-page .site-header,.crumbs,.tax-intro p,.date-block,.roles,.form-paper,.local-note,.receipt-actions,.rules,.sources,.site-footer,.skip-link,#copy-status,#announcement { display: none !important; }
  .tax-page .shell { width: 100%; }
  .tax-intro { display: block; padding: 0 0 1rem; }
  .tax-intro h1 { font-size: 1.6rem; }
  .calc-grid { display: block; }
  .receipt-column { position: static; }
  .receipt { background: #fff; border: 1px solid #999; }
  .receipt::after { display: none; }
  .result-sources { display: none; }
  #breakdown > div { break-inside: avoid; }
  .total { font-size: 2.4rem; }
}

