@page { size: A4 portrait; margin: 12mm; }

body.finance-page,
.finance-page main,
.finance-page .finance-shell {
  display: block;
  position: static;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.finance-page .finance-grid > .finance-card {
  width: 100%;
  margin-block-end: 4mm;
  break-inside: auto;
}
.finance-page .finance-grid .finance-fields,
.finance-page .finance-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.finance-page .finance-field :is(input, select) {
  width: 100%;
  min-width: 0;
}
.finance-page .finance-chart {
  width: 100%;
  height: auto;
  break-inside: avoid;
}
.finance-page .finance-table { width: 100%; table-layout: fixed; }
.finance-page .finance-table tr { break-inside: avoid; }
.finance-page .finance-table :is(th, td) { overflow-wrap: anywhere; }
.finance-page .finance-table-wrap { max-width: 100%; }

/* Anchor the printed page to its physical left margin, keeping the content RTL. */
html:has(body.finance-page) {
  direction: ltr;
  width: 100%;
  margin: 0;
  padding: 0;
}
body.finance-page {
  direction: ltr;
  width: 100%;
}
body.finance-page main {
  direction: rtl;
  width: 100%;
  inset: auto;
  transform: none;
}
.finance-page .finance-shell {
  width: 100%;
  inset: auto;
  transform: none;
}

/* Let long comparison forms and results flow across printed pages. */
.finance-page #mix-form,
.finance-page main section.finance-card {
  break-inside: auto;
}
.finance-page #mix-form fieldset {
  min-inline-size: 0;
  break-inside: avoid;
}
.finance-page .finance-intro {
  break-after: avoid;
}
