.msme-heading h1 { font-size: clamp(2.16rem, 5.2vw, 4.5rem); line-height: 1.02; letter-spacing: -.05em; }
.msme-tool { padding-bottom: 0; }
.msme-tool .calculator-top { gap: .7rem; }
.msme-tool .calculator-top .button { flex-shrink: 0; padding: .6rem .9rem; min-height: 44px; }
.msme-form { min-width: 0; align-content: start; }
.msme-fields { display: grid; gap: .9rem; margin: 0; border: 0; padding: 0; min-inline-size: 0; }
.msme-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; align-items: start; }
.msme-fields [hidden], .msme-result [hidden], #msme-document-container[hidden] { display: none; }
.msme-form h3 { margin: 0; font-size: 1rem; }
.msme-scope, .msme-privacy { margin: 0; font-size: .83rem; }
.msme-result { min-width: 0; overflow-wrap: anywhere; }
.msme-result h2 { font-size: 1.13rem; margin: 0 0 .7rem; }
.msme-result .result-label { margin: 0; font-weight: 750; }
.msme-result .result-total { margin-top: 0; }
.msme-result .result-total strong { color: inherit; }
.msme-result [data-msme-actions] { margin: 1rem 0; }
.msme-privacy, .msme-result [data-msme-copy-fallback] { margin-top: .5rem; }
.msme-result .ibt-calc-runs { margin-top: 1rem; }
.msme-result [data-msme-error] { font-weight: 700; }
.msme-result [data-msme-message]:empty { margin: 0; }
.msme-guide li { margin-block: .25rem; }
.msme-guide a { text-underline-offset: .15em; }
.msme-line { border: 1px solid var(--line); border-radius: .45rem; padding: .8rem; margin: .65rem 0; display: grid; gap: .55rem; }
.msme-line legend { padding-inline: .25rem; font-size: .85rem; font-weight: 700; }
.msme-line .button { justify-self: start; min-height: 44px; padding: .4rem .65rem; }
#msme-document-container { margin-block: 1.4rem; }
#msme-document-container .invoice-preview { border: 1px solid var(--line); border-radius: .55rem; box-shadow: var(--shadow); color: #07173f; overflow-wrap: anywhere; }
.msme-document-parties { padding-block: .9rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem; }
.msme-document-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.msme-document-table caption { text-align: left; font-weight: 700; padding: .35rem 0; }
.msme-document-table th, .msme-document-table td { padding: .38rem; border-bottom: 1px solid #becbdf; text-align: start; vertical-align: top; }
.msme-document-table tbody th { font-weight: 600; }
.msme-document-table tr > :nth-child(n+3) { text-align: end; font-variant-numeric: tabular-nums; }
.msme-document-table tr > :first-child { width: 30%; }
.msme-document-totals { margin: .8rem 0 .8rem auto; width: min(100%,22rem); }
.msme-document-totals div { display: flex; justify-content: space-between; gap: .45rem; padding: .3rem 0; }
.msme-document-totals div:last-child { border-top: 1px solid #879bb9; font-weight: 750; }
.msme-document-totals dd { margin: 0; }
.msme-document-note { white-space: pre-wrap; }
@media screen and (max-width: 630px) {
  .msme-field-grid { grid-template-columns: minmax(0,1fr); }
  #msme-document-container .invoice-preview { padding: .85rem; }
  .msme-document-table { font-size: .75rem; }
  .msme-document-table th, .msme-document-table td { padding: .24rem; }
}
@page msmeInvoice { size: A4; margin: 12mm; }
@media print {
  body[data-msme-tool="invoice"]:has(#msme-document-container:not([hidden])) {
    background: #fff; color: #07173f; page: msmeInvoice;
  }
  body[data-msme-tool="invoice"]:has(#msme-document-container:not([hidden])) > :not(main),
  body[data-msme-tool="invoice"]:has(#msme-document-container:not([hidden])) main > :not(#msme-document-container) {
    display: none !important;
  }
  #msme-document-container .invoice-preview { display: block; border: 0; box-shadow: none; margin: 0; padding: 0; font-size: 10pt; }
  #msme-document-container { margin: 0; width: 100%; max-width: none; }
  .msme-document-table { font-size: 9pt; }
  .msme-document-table thead { display: table-header-group; }
  .msme-document-table tr, .msme-document-parties, .msme-document-totals { break-inside: avoid; }
}

/* Reserve the install control's slot before the browser signals availability. */
.site-header .pwa-install[hidden] { display: inline-block; visibility: hidden; }
.msme-guide :is(h2,h3), #msme-document-container { scroll-margin-top: 12rem; }

@media (min-width: 651px) {
  .msme-tool-links .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
