/* A zero page margin prevents Chrome from reserving room for browser headers and footers. */
@page { size: A4 portrait; margin: 0; }

@media print {
  html, body {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body > * { display: none !important; }
  body > main.rb-app {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  main.rb-app > :not(.preview-column),
  .preview-column > :not(.rb-stage),
  .rb-stage > :not(#scale) { display: none !important; }
  .preview-column, .rb-stage, #scale, #resume-print {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  #resume-print > .sheet {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    /* Keep the existing A4 content inset inside the page while @page has no margins. */
    padding: 13mm 14mm !important;
    -webkit-box-decoration-break: clone !important;
    box-decoration-break: clone !important;
    overflow: visible !important;
    background: #fff !important;
    color: #172033 !important;
    box-shadow: none !important;
    font-size: max(11pt, var(--font-size, 13px)) !important;
    line-height: 1.4 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    break-after: auto !important;
    page-break-after: auto !important;
  }
  .sheet * { box-sizing: border-box !important; }
  .sheet .r-head { min-width: 0 !important; margin-bottom: 5mm !important; break-inside: avoid-page; page-break-inside: avoid; }
  .sheet .r-name { font-size: 2.15em !important; line-height: 1.08 !important; color: #111827 !important; overflow-wrap: break-word !important; word-break: normal !important; }
  .sheet .r-title, .sheet .r-contact, .sheet .r-sub, .sheet .r-date { color: #374151 !important; }
  .sheet .r-contact a, .sheet .r-text, .sheet li, .sheet .r-link { overflow-wrap: anywhere !important; word-break: normal !important; }
  .sheet .r-sec { min-width: 0 !important; margin-top: 5mm !important; break-inside: auto !important; orphans: 3; widows: 3; }
  .sheet .r-h { margin: 0 0 2.5mm !important; padding-bottom: 1.5mm !important; color: #253247 !important; font-size: 1.02em !important; break-after: avoid-page !important; page-break-after: avoid !important; border-color: #7b8798 !important; background: transparent !important; }
  .sheet .r-item { min-width: 0 !important; margin-bottom: 3.5mm !important; break-inside: avoid-page; page-break-inside: avoid; orphans: 3; widows: 3; }
  .sheet .r-item-head { align-items: baseline !important; gap: 1mm 4mm !important; }
  .sheet .r-item-head strong { color: #111827 !important; }
  .sheet .r-date { max-width: 42% !important; white-space: normal !important; text-align: right !important; }
  .sheet .r-photo-wrap { break-inside: avoid-page !important; print-color-adjust: exact !important; }
  .sheet .r-photo { max-width: 100% !important; print-color-adjust: exact !important; }
  .sheet .r-rail { background: #f1f3f6 !important; color: #172033 !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .sheet .r-main, .sheet .r-rail { min-width: 0 !important; break-inside: auto !important; }
  .tpl-layout-single, .tpl-layout-compact, .tpl-layout-editorial,
  .tpl-layout-sidebar-left, .tpl-layout-sidebar-right { padding: 0 !important; }
  .tpl-layout-sidebar-left .r-head, .tpl-layout-sidebar-right .r-head { padding: 0 0 5mm !important; margin: 0 0 4mm !important; }
  .tpl-header-band .r-head { margin: 0 0 5mm !important; padding: 6mm !important; background: var(--accent, #8f0e31) !important; color: #fff !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .tpl-header-band .r-name, .tpl-header-band .r-title, .tpl-header-band .r-contact { color: #fff !important; }
  .tpl-layout-sidebar-left .tpl-header-band .r-head, .tpl-layout-sidebar-right .tpl-header-band .r-head { padding: 6mm !important; }
  .tpl-layout-sidebar-left .r-layout, .tpl-layout-sidebar-right .r-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) !important; gap: 0 !important; }
  .tpl-layout-sidebar-right .r-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important; }
  .tpl-layout-sidebar-left .r-rail, .tpl-layout-sidebar-right .r-rail { padding: 5mm 3mm !important; }
  .tpl-layout-sidebar-left .r-main, .tpl-layout-sidebar-right .r-main { padding: 5mm !important; }
  .tpl-layout-editorial .r-editorial { columns: 2 !important; column-gap: 8mm !important; column-rule: 1px solid #cbd2dc !important; }
  .empty-resume { min-height: 0 !important; }
  .r-empty-state { max-width: none !important; border: 0 !important; padding: 0 !important; color: #374151 !important; }
  a { color: inherit !important; text-decoration: underline !important; text-decoration-color: #94a3b8 !important; }
}
