#preview-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.page-sheet {
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--color-bg-page);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  padding: 20mm; /* fallback, overridden by JS */
}

/* Typography inside page (using native CSS nesting) */
.page-sheet {
  & h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
    margin-top: 0;
  }

  & h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
  }

  & p, & li {
    line-height: 1.6;
    font-size: var(--font-size-page);
    color: var(--color-text-heading);
  }

  & img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    margin: 12px auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  & table {
    border-collapse: collapse;
    width: 100%;
    margin: 24px 0;
    font-size: 15px;
    table-layout: fixed;
  }

  & th, & td {
    border: 1px solid #dfe2e5;
    padding: 12px;
    text-align: left;
    background: white;
    word-wrap: break-word;
  }

  & th {
    background-color: #f6f8fa;
    font-weight: 600;
  }

  & td img {
    max-width: 100%;
    max-height: 80mm !important;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }

  & pre, & code, & pre code {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    tab-size: 2;
  }

  & .page-break {
    display: none;
  }

  & .page-number {
      position: absolute;
      bottom: 8mm;
      left: 0;
      right: 0;
      text-align: center;
      font-size: 10pt;
      color: #555;
    }

  & .overflow-warning::after {
    content: "⚠ Content overflows this page";
    display: block;
    margin-top: 1em;
    color: #c00;
    font-size: 0.9em;
    font-weight: bold;
  }
}