/*
 * IWD result toolkit: print / save-as-PDF view. Loaded with media="print" only
 * on pages whose tool opts in (data-iwd-kit). Shows the tool's inputs as text
 * (the .iwd-tool__print summary built by assets/iwd-tool-kit.js), the result,
 * the breakdown table, the date printed, the page URL and the disclaimer.
 * Site chrome and every button are hidden; the kit marks everything outside
 * the tool with .iwd-kit-hide while printing.
 */
@media print {
  @page { margin: 14mm; }

  html, body { background: #fff !important; }
  .iwd-kit-hide,
  #wpadminbar,
  header.wp-block-template-part,
  footer.wp-block-template-part,
  .wp-block-navigation,
  nav,
  aside { display: none !important; }

  .iwd-tool { display: block !important; margin: 0 !important; color: #000 !important; font-size: 11pt !important; }
  .iwd-tool .iwd-tool__print { display: block !important; margin: 0 0 12pt; }
  .iwd-tool .iwd-tool__print-title { margin: 0 0 8pt; font-size: 16pt; }
  .iwd-tool .iwd-tool__print-inputs { display: grid; grid-template-columns: max-content 1fr; gap: 2pt 14pt; margin: 0 0 10pt; }
  .iwd-tool .iwd-tool__print-inputs dt { font-weight: 700; }
  .iwd-tool .iwd-tool__print-inputs dd { margin: 0; }
  .iwd-tool .iwd-tool__print-meta { margin: 2pt 0; font-size: 9pt; color: #333; overflow-wrap: anywhere; }

  /* The live form is replaced by the text summary above. */
  .iwd-tool .iwd-tool__steps,
  .iwd-tool .iwd-tool__kit,
  .iwd-tool button,
  .iwd-tool input[type="range"] { display: none !important; }

  .iwd-tool .iwd-tool__result {
    position: static !important;
    padding: 10pt 12pt !important;
    margin: 0 0 10pt;
    border: 1.5pt solid #000;
    background: #fff !important;
    color: #000 !important;
    break-inside: avoid;
  }
  .iwd-tool .iwd-tool__label,
  .iwd-tool .iwd-tool__sub,
  .iwd-tool .iwd-tool__stats small,
  .iwd-tool .iwd-tool__stats b,
  .iwd-tool .iwd-tool__figure { color: #000 !important; }
  .iwd-tool .iwd-tool__figure { font-size: 30pt !important; }
  .iwd-tool .iwd-tool__stats { background: #999 !important; }
  .iwd-tool .iwd-tool__stats > div { background: #fff !important; }
  .iwd-tool .iwd-tool__explain { padding: 6pt 0 0 !important; background: none !important; color: #000 !important; }
  .iwd-tool .iwd-tool__explain-text { margin: 6pt 0 0 !important; color: #000 !important; }

  .iwd-tool .iwd-tool__chart,
  .iwd-tool .iwd-tool__chart > * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .iwd-tool .iwd-tool__chart { height: 18pt !important; break-inside: avoid; }
  /* Show the math: the kit opens the <details> before printing. */
  .iwd-tool .iwd-tool__math:not([hidden]) { display: block !important; margin: 0 0 10pt; padding: 0 !important; border: 0 !important; background: none !important; }
  .iwd-tool .iwd-tool__math > summary { padding: 0 0 4pt; border: 0 !important; margin: 0 !important; color: #000 !important; font-size: 13pt; list-style: none; }
  .iwd-tool .iwd-tool__math > summary::-webkit-details-marker { display: none; }
  .iwd-tool .iwd-tool__math .iwd-tool__hint { display: none; }
  .iwd-tool .iwd-tool__math-step { break-inside: avoid; padding: 3pt 0 !important; }
  .iwd-tool .iwd-tool__math-label,
  .iwd-tool .iwd-tool__math-value,
  .iwd-tool .iwd-tool__math-src,
  .iwd-tool .iwd-tool__math-note { color: #000 !important; }
  /* Saved scenarios: the controls stay on screen only; a comparison that is showing is printed. */
  .iwd-tool .iwd-tool__scen { display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
  .iwd-tool .iwd-tool__scen-title,
  .iwd-tool .iwd-tool__scen-ui,
  .iwd-tool .iwd-tool__scen-note { display: none !important; }
  .iwd-tool .iwd-tool__compare:not([hidden]) { display: block !important; margin: 0 0 10pt; break-inside: avoid; }
  .iwd-tool .iwd-tool__compare-scroll { overflow: visible !important; }
  .iwd-tool .iwd-tool__compare table { font-size: 10pt !important; }
  .iwd-tool .iwd-tool__compare th,
  .iwd-tool .iwd-tool__compare td { color: #000 !important; }
  .iwd-tool .iwd-tool__table { overflow: visible !important; break-inside: avoid; }
  .iwd-tool .iwd-tool__table table { font-size: 10pt !important; }
  .iwd-tool .iwd-tool__table tr { break-inside: avoid; }
  .iwd-tool .iwd-tool__table tr.is-active td { background: #eee !important; }
  .iwd-tool .iwd-tool__table .it-swatch { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
