@page {
  margin: 0;
}

@media print {
  /* ---------- Force light palette regardless of theme ---------- */
  :root,
  body,
  body.theme-dark {
    --paper-bg: #fdfdfc !important;
    --paper-text: #181919 !important;
    --paper-muted: #5d6572 !important;
    --paper-divider: rgba(16, 24, 40, 0.18) !important;
    color-scheme: light !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
  }


  /* ---------- Force exact color printing on resume ---------- */
  .resume-page,
  .resume-page *,
  .resume-page *::before,
  .resume-page *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ---------- Hide app chrome ---------- */
  .bg-noise,
  .topbar,
  .editor-panel,
  .preview-toolbar,
  .app-footer,
  .privacy-modal,
  .page-break-line {
    display: none !important;
  }

  .app-shell {
    width: 100% !important;
    margin: 0 !important;
  }

  .workspace,
  .preview-panel,
  .resume-preview {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .workspace {
    gap: 0 !important;
  }

  /* ---------- Printed page setup ---------- */
  .resume-page {
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--paper-text) !important;
    overflow: visible !important;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }


  .entry,
  .template-aurora .timeline li {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .section-label,
  .alpine-icon-heading,
  .alpine-dot-heading {
    page-break-after: avoid;
    break-after: avoid-page;
  }

  .section-label + *,
  .alpine-icon-heading + *,
  .alpine-dot-heading + * {
    page-break-before: avoid;
    break-before: avoid-page;
  }


  /* ---------- Stretch inner layouts to fill the page ---------- */
  .template-aurora .resume-page[data-print-page-count="1"] {
    display: flex !important;
    flex-direction: column !important;
  }

  .template-aurora .resume-page[data-print-page-count="1"] .aurora-shell {
    flex: 1 !important;
  }

  .template-aurora .resume-page[data-print-page-count="1"] .aurora-main {
    display: flex !important;
    flex-direction: column !important;
  }

  .template-aurora .aurora-side,
  .template-aurora .aurora-main {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  .template-aurora .resume-page[data-print-page-count="1"] .aurora-main > section:last-child {
    flex: 1 !important;
  }

  .template-berlin .resume-page[data-print-page-count="1"] {
    display: flex !important;
    flex-direction: column !important;
  }

  .template-berlin .resume-page[data-print-page-count="1"] .resume-columns {
    flex: 1 !important;
  }

  /* ---------- Force light Aurora banner in print ---------- */
  .template-aurora .aurora-banner {
    background:
      linear-gradient(120deg, rgba(14, 99, 122, 0.95), rgba(13, 61, 101, 0.92)),
      radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.18), transparent 45%) !important;
    color: #f8fbff !important;
  }

  .template-aurora .aurora-role {
    color: rgba(248, 251, 255, 0.86) !important;
  }

  /* ---------- Force light backgrounds per template in print ---------- */
  .template-berlin .resume-page {
    background: #fdfdfc !important;
  }

  .template-atelier .resume-page {
    background:
      linear-gradient(160deg, rgba(252, 252, 250, 1), rgba(250, 248, 244, 1)) !important;
  }

  .variant-noir .resume-page {
    background: linear-gradient(170deg, #1b2028, #10151b) !important;
    color: #edf2f7 !important;
  }

  .variant-fjord .resume-page {
    background: linear-gradient(180deg, #f9fcff, #edf4f9) !important;
  }

  .variant-slate .resume-page {
    background: linear-gradient(180deg, #fbfcfd, #eef1f4) !important;
  }

  .variant-kernel .resume-page {
    background:
      repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 22px,
        rgba(18, 46, 73, 0.045) 22px,
        rgba(18, 46, 73, 0.045) 23px
      ),
      repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 22px,
        rgba(18, 46, 73, 0.045) 22px,
        rgba(18, 46, 73, 0.045) 23px
      ),
      linear-gradient(180deg, #fbfcfd, #eef3f8) !important;
  }

  /* ---------- Force light Solstice banner in print ---------- */
  .variant-solstice .aurora-banner {
    background:
      linear-gradient(120deg, rgba(178, 56, 87, 0.95), rgba(240, 130, 68, 0.92)),
      radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.24), transparent 45%) !important;
  }

  .variant-solstice .aurora-side {
    background: rgba(242, 145, 78, 0.06) !important;
  }

  /* ---------- Force light Bastion banner in print ---------- */
  .variant-bastion .aurora-banner {
    background:
      linear-gradient(120deg, rgba(70, 78, 92, 0.95), rgba(38, 44, 53, 0.92)),
      radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.14), transparent 45%) !important;
  }

  /* ---------- Alpine: fill page in print ---------- */
  .template-alpine .resume-page[data-print-page-count="1"] {
    display: flex !important;
    flex-direction: column !important;
    background: #fdfdfc !important;
  }

  .template-alpine .resume-page[data-print-page-count="1"] .alpine-body {
    flex: 1 !important;
  }

  .template-alpine .alpine-body,
  .template-alpine .alpine-sidebar,
  .template-alpine .alpine-main {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  /* ---------- Hide empty-state placeholders ---------- */
  .empty-copy {
    display: none !important;
  }
}
