.exchange-tool { min-width: 0; max-width: 46rem; margin-inline: auto; font-size: 1.0625rem; overflow-wrap: anywhere; }
.exchange-jumps { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.exchange-jumps a, .exchange-scene > p a { display: inline-flex; align-items: center; min-height: 44px; }
.exchange-scene, .exchange-method { margin-top: 1.8em; }
.exchange-scene { scroll-margin-block-start: 1rem; }
.exchange-tool h2 { margin: 0 0 .5em; font-size: 1.3em; }
.exchange-tool h3 { margin: 0; font-size: 1.04em; }
.exchange-tool p { margin: .45em 0; }
.exchange-settings { min-width: 0; margin: 1em 0; padding: 1em; border: 1px solid var(--rule); border-radius: 8px; }
.exchange-settings legend, .exchange-fields label { font-weight: 650; }
.exchange-settings legend { padding-inline: .4em; }
.exchange-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13em), 1fr)); gap: .8em 1em; }
.exchange-fields input { display: block; box-sizing: border-box; width: 100%; min-height: 44px; margin-top: .25em; padding: .35em .6em; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #717b87; border-radius: 5px; }
.exchange-fields input[aria-invalid="true"] { border-color: #8b3124; }
.exchange-fields p { margin: .25em 0 0; color: #8b3124; }
.exchange-fields p:empty { margin: 0; }
.exchange-result { padding: .4em 1em; background: var(--act-weak); border-radius: 8px; }
.exchange-result > section { padding: .65em 0; }
.exchange-result > section + section { border-top: 1px solid #aab8ca; }
.exchange-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25em 1em; margin: .4em 0 0; }
.exchange-values dt { color: var(--ink2); }
.exchange-values dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
@media screen {
  .exchange-result { container: exchange-values / inline-size; }
}
@container exchange-values (max-width: 18em) {
  .exchange-values { display: block; }
  .exchange-values > div { display: flex; justify-content: space-between; gap: .5em; }
  .exchange-values dd { min-width: 0; text-align: end; }
}
@media print {
  .exchange-tool { max-width: none; font-size: 10pt; line-height: 1.4; }
  .exchange-settings, .exchange-jumps, .exchange-tool noscript { display: none; }
  .exchange-tool h1 { font-size: 18pt; margin: 0 0 2mm; }
  .exchange-tool h2 { font-size: 13pt; margin: 0 0 1mm; }
  .exchange-tool p { margin: 1mm 0; }
  .exchange-scene, .exchange-method { margin-top: 3mm; }
  .exchange-result { padding: 1mm 2mm; border: 1px solid #777; background: white; }
  .exchange-result > section { display: grid; grid-template-columns: 30% 1fr; align-items: center; gap: 2mm; break-inside: avoid; padding: 1mm 0; }
  .exchange-values { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
  .exchange-scene > p a { min-height: 0; }
}

@media print {
  .calculator-print-button { display: none; }
  html:has(:is(.power-tool, .unit-price-tool, .basket-tool, .diet-votes-tool, .allocation-tool, .exchange-tool)) { font-size: 16px; }
  main:has(:is(.power-tool, .unit-price-tool, .basket-tool, .diet-votes-tool, .allocation-tool, .exchange-tool)) { min-height: 0; }
  :is(.power-tool, .unit-price-tool) { max-width: none; font-size: 11pt; line-height: 1.5; }
  :is(.power-tool, .unit-price-tool) .article-header { margin: 0 0 3mm; }
  :is(.power-tool, .unit-price-tool) h1 { font-size: 19pt; line-height: 1.35; margin: 0 0 2mm; }
  :is(.power-tool, .unit-price-tool) h2 { font-size: 13pt; line-height: 1.4; margin: 0 0 2mm; }
  :is(.power-tool, .unit-price-tool) .section { margin: 5mm 0 0; }
  :is(.power-tool, .unit-price-tool) p { margin: 1.5mm 0; }
  :is(.power-tool, .unit-price-tool) fieldset { padding: 2mm 3mm; }
  :is(.power-result, .unit-price-result) { margin: 4mm 0; padding: 2mm 3mm; }
  .power-mode { margin: 1mm 0; }
  .power-mode label { min-height: 0; }
  .unit-price-inputs, .power-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-price-result dl { margin-block: 1mm; }
  .power-result table :is(th, td), .turnout-differences div { padding-block: 1mm; }
  .calculator-print-value { font-weight: 600; overflow-wrap: anywhere; }
  :is(input, select):has(+ .calculator-print-value) { display: none !important; }
}
@media screen { .calculator-print-value { display: none; } }

.calculator-paper-link { display: none; }
@media print {
  .calculator-paper-link {
    display: block;
    float: right;
    margin: 0 0 2mm 4mm;
    break-inside: avoid;
    font: 9pt/1.25 sans-serif;
    text-align: center;
  }
  .calculator-paper-link a { display: block; color: #000; }
  .calculator-paper-link img { display: block; height: auto; margin: 0 auto 1mm; image-rendering: pixelated; }
  .exchange-tool[data-print-example-scene="payment"] #business,
  .exchange-tool[data-print-example-scene="business"] #payment { display: none; }
}
