/* The preview and print output use the same report content. */
.report-dialog { width: min(920px, calc(100% - 24px)); max-height: 92dvh; border: 1px solid var(--line); border-radius: 6px; padding: 0; color: var(--ink); background: white; }
.report-dialog::backdrop { background: rgb(20 40 30 / 48%); }
body:has(.report-dialog[open]) { overflow: hidden; }
.report-toolbar { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.report-toolbar strong { font-size: 15px; font-weight: 600; }
.report-toolbar-actions { display: flex; gap: 9px; }
.report-toolbar button { min-height: 44px; white-space: nowrap; }
.report-print-button { background: var(--teal); color: white; border: 1px solid var(--teal); border-radius: 6px; padding: 9px 17px; }
.report-print-button:hover { background: #204b3b; }
.fee-report { padding: 32px; font-size: 14px; line-height: 2; background: white; color: #253b34; overflow-wrap: anywhere; }
.report-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 2px solid #285b48; }
.report-heading img { flex-shrink: 0; object-fit: contain; }
.report-heading > div { flex: 1; }
.report-heading h1 { font-size: 22px; font-weight: 600; line-height: 1.8; margin: 0; letter-spacing: 0; }
.report-heading p { margin: 3px 0 0; color: #65715f; font-size: 13px; }
.report-date { font-size: 12px; color: #65715f; flex-shrink: 0; }
.report-subject { margin: 22px 0 16px; }
.fee-report > p { margin: 12px 0; }
.fee-report h2 { font-size: 16px; font-weight: 600; margin: 25px 0 10px; }
.report-inputs { margin: 20px 0; padding: 12px 16px; border: 1px solid #d9e2d2; background: #f8faf5; }
.report-inputs > div, .report-totals > div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; }
.fee-report dt { font-weight: 500; }
.fee-report dd { margin: 0; text-align: left; }
.report-conclusion { margin: 22px 0; padding: 6px 18px; border-right: 3px solid #285b48; background: #f1f4ec; }
.report-conclusion p { margin: 10px 0; }
.report-breakdown { font-size: 13px; }
.report-breakdown th { background: #eef2e9; color: #253b34; }
.report-breakdown td { border-bottom: 1px solid #d9e2d2; }
.report-breakdown td:last-child { width: 30%; }
.report-breakdown small { display: block; margin-top: 4px; color: #65715f; font-size: 12px; line-height: 1.9; }
.report-totals { margin: 0; }
.report-totals > div { border-bottom: 1px solid #d9e2d2; }
.report-total-emphasis { color: #285b48; font-weight: 700; }
.report-total-emphasis dt { font-weight: 700; }
.report-warnings { margin-top: 22px; padding: 1px 16px 6px; border: 1px solid #d9e2d2; }
.report-footer { margin-top: 26px; border-top: 1px solid #d9e2d2; padding-top: 12px; color: #65715f; font-size: 12px; }
.report-footer p { margin: 6px 0; }
@media (max-width: 640px) {
  .report-toolbar { padding: 12px 16px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .report-toolbar-actions { width: 100%; }
  .report-toolbar-actions button:first-child { flex: 1; }
  .fee-report { padding: 20px 16px; }
  .report-heading { flex-wrap: wrap; gap: 10px; }
  .report-heading h1 { font-size: 18px; }
  .report-date { width: 100%; }
  .report-inputs > div, .report-totals > div { gap: 10px; }
  .report-breakdown td, .report-breakdown th { padding-inline: 6px; }
}
@page { size: A4; margin: 16mm 15mm; }
@media screen {
  .report-dialog { border:0; border-radius:18px; }
  .fee-report { font-size:16px; }
  .report-breakdown { font-size:14px; }
  .report-toolbar { background:white; padding:15px 24px; }
  .report-print-button { border-radius:10px; min-height:48px; font-weight:550; }
  .report-toolbar .secondary-button { border-radius:10px; }
}
@media screen and (max-width:767px) {
  .report-dialog { position:fixed; inset:auto 0 0; width:100%; max-width:none; max-height:96dvh; margin:0; border-radius:20px 20px 0 0; }
  .report-toolbar { padding:16px 20px 12px; align-items:stretch; flex-direction:column; gap:10px; }
  .report-toolbar-actions { width:100%; }
  .report-toolbar-actions button:first-child { flex:1; }
  .fee-report { padding:24px 20px calc(24px + env(safe-area-inset-bottom)); }
}
@media print {
  body > :not(#report-dialog) { display: none !important; }
  html, body { background: white !important; color: #15251d !important; overflow: visible !important; }
  #report-dialog { display: block !important; position: static !important; inset: auto !important; width: auto !important; max-width: none !important; height: auto !important; max-height: none !important; overflow: visible !important; border: 0 !important; border-radius: 0 !important; margin: 0 !important; padding: 0 !important; }
  #report-dialog::backdrop, .report-toolbar { display: none !important; }
  .fee-report { padding: 0; font-size: 10.5pt; line-height: 1.9; color: #15251d; }
  .report-heading { flex-wrap: nowrap; break-inside: avoid; padding-bottom: 12px; }
  .report-heading h1 { font-size: 16pt; }
  .report-heading p, .report-date { font-size: 9pt; }
  .report-date { width: auto; }
  .fee-report h2 { font-size: 12pt; margin-top: 18px; break-after: avoid; }
  .report-heading, .report-inputs, .report-conclusion, .report-totals > div, .report-breakdown tr { break-inside: avoid; }
  .report-breakdown { font-size: 9.5pt; }
  .report-breakdown small, .report-footer { font-size: 9pt; }
  .report-breakdown th, .report-breakdown td { padding: 7px 8px; }
  .report-breakdown thead { display: table-header-group; }
  .report-inputs > div, .report-totals > div { padding-block: 4px; }
  .report-footer a { color: inherit; text-decoration: none; }
  .report-footer { margin-top: 18px; }
  p { orphans: 3; widows: 3; }
}
