/**
 * Dedicated notes viewer — best reading experience for MD notes from PDFs.
 * 3D single-line notebook view; 2 free pages then lock gate.
 */

.notes-viewer-page {
  --notes-read-width: 90ch;
  --notes-line-height: 1.72;
  --notes-sidebar-width: 220px;
  --notes-page-height: 72vh;
  --notes-line-spacing: 28px;
  --notes-font-handwritten: 'Caveat', cursive;
  --notes-content-font: var(--notes-font-handwritten);
  --notebook-paper: linear-gradient(165deg, #f2efe8 0%, #faf8f3 12%, #f5f2eb 50%, #faf8f3 88%, #eae6df 100%);
  --notebook-spine: linear-gradient(90deg, #c4bfb5 0%, #d8d4cb 8%, #e0dcd4 20%, #d8d4cb 92%, #c4bfb5 100%);
}

.notes-viewer-page.notes-font-caveat { --notes-content-font: 'Caveat', cursive; }
.notes-viewer-page.notes-font-patrick { --notes-content-font: 'Patrick Hand', cursive; }
.notes-viewer-page.notes-font-kalam { --notes-content-font: 'Kalam', cursive; }
.notes-viewer-page.notes-font-lora { --notes-content-font: 'Lora', serif; }
.notes-viewer-page.notes-font-system { --notes-content-font: var(--app-font, system-ui, -apple-system, sans-serif); }

.app-dark .notes-viewer-page {
  --notebook-paper: linear-gradient(165deg, #1e1d21 0%, #252328 15%, #2a282d 50%, #252328 85%, #1c1b1f 100%);
  --notebook-spine: linear-gradient(90deg, #3d3a42 0%, #4a4750 15%, #525058 50%, #4a4750 85%, #3d3a42 100%);
}

.notes-viewer-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-viewer-main .app-main-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

/* Read progress bar — top of content */
.notes-viewer-progress {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--app-border-soft);
  z-index: 5;
}

.notes-viewer-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--app-primary);
  border-radius: 0 2px 2px 0;
  transition: width 0.15s ease-out;
}

/* Layout: single column, no side panel — notebook only */
.notes-viewer-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.notes-viewer-content-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--app-space-sm) var(--app-page-padding, 1rem);
  padding-bottom: 0;
}

/* Mount must shrink so notebook + nav fit; nav stays visible */
#notes-notebook-mount {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#notes-notebook-mount:empty {
  display: none;
}

/* Notebook: viewport scrolls, prev/next bar fixed at bottom of notebook */
.notes-notebook-outer {
  width: 100%;
  max-width: min(1100px, 98vw);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--app-space-sm) 0;
}

/* Notebook: viewport (scrollable) + nav bar (prev/next) */
.notes-notebook {
  width: 100%;
  max-width: min(1040px, 96vw);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--notebook-spine);
  border-radius: 0 16px 16px 0;
  box-shadow:
    -8px 0 24px rgba(0, 0, 0, 0.08),
    -2px 0 8px rgba(0, 0, 0, 0.05),
    0 2px 12px rgba(0, 0, 0, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.app-dark .notes-notebook {
  box-shadow:
    -14px 0 36px rgba(0, 0, 0, 0.4),
    -4px 0 14px rgba(0, 0, 0, 0.25),
    2px 2px 20px rgba(0, 0, 0, 0.2),
    inset 1px 0 0 rgba(255, 255, 255, 0.06);
}

/* Left spine strip (binding) */
.notes-notebook::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, rgba(0,0,0,0.15) 0%, transparent 100%);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  z-index: 2;
}

.notes-notebook-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  background: var(--notebook-paper);
  border-radius: 0 14px 14px 0;
  margin-left: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.app-dark .notes-notebook-viewport {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.notes-notebook-page {
  min-height: var(--notes-page-height);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: var(--app-space-xl) var(--app-space-md);
  padding-left: calc(var(--app-space-md) + 24px);
  box-sizing: border-box;
  position: relative;
  /* Ruled lines: single-line notebook / handwritten notes feel */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--notes-line-spacing) - 1px),
    rgba(0, 0, 0, 0.07) calc(var(--notes-line-spacing) - 1px),
    rgba(0, 0, 0, 0.07) var(--notes-line-spacing)
  );
  background-attachment: local;
}

.app-dark .notes-notebook-page {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--notes-line-spacing) - 1px),
    rgba(255, 255, 255, 0.06) calc(var(--notes-line-spacing) - 1px),
    rgba(255, 255, 255, 0.06) var(--notes-line-spacing)
  );
}

.notes-notebook-page:first-child {
  padding-top: var(--app-space-xl);
}

/* Left margin line (notebook margin) */
.notes-notebook-page::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(180, 80, 60, 0.35) 8%, rgba(180, 80, 60, 0.35) 92%, transparent 100%);
  pointer-events: none;
}

.app-dark .notes-notebook-page::before {
  background: linear-gradient(180deg, transparent 0%, rgba(220, 120, 100, 0.25) 8%, rgba(220, 120, 100, 0.25) 92%, transparent 100%);
}

.notes-notebook-page .notes-viewer-content {
  max-width: var(--notes-read-width);
  margin: 0 auto;
  padding: 0;
}

/* Lock gate page — full page CTA after 2 free pages (desktop notebook) */
.notes-notebook-gate {
  min-height: var(--notes-page-height);
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--app-space-xl);
  background: linear-gradient(180deg, var(--notebook-paper) 0%, rgba(99, 102, 241, 0.08) 50%, rgba(99, 102, 241, 0.04) 100%);
  border: 2px dashed var(--app-primary);
  border-radius: var(--app-radius-lg);
  margin: 0 var(--app-space-sm);
  margin-bottom: var(--app-space);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.notes-notebook-gate-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--app-space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-primary-soft);
  border-radius: 50%;
  color: var(--app-primary);
  border: 2px solid var(--app-primary);
}

.notes-notebook-gate-icon svg {
  width: 36px;
  height: 36px;
}

.notes-notebook-gate h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--app-text);
  margin: 0 0 var(--app-space-sm);
}

.notes-notebook-gate p {
  font-size: 0.9375rem;
  color: var(--app-text-secondary);
  margin: 0 0 var(--app-space-md);
  max-width: 360px;
  line-height: 1.5;
}

.notes-notebook-gate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--app-primary);
  color: #fff;
  border-radius: var(--app-radius-md);
  text-decoration: none;
  margin-top: 8px;
  transition: background 0.2s, transform 0.15s;
}

.notes-notebook-gate-cta:hover {
  background: var(--app-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* Notebook nav: Prev | Page X of Y | Next — always visible at bottom */
.notes-notebook-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--app-space-sm) var(--app-space-md);
  background: var(--app-surface);
  border-top: 2px solid var(--app-border-soft);
  flex-shrink: 0;
  border-radius: 0 0 14px 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.app-dark .notes-notebook-nav {
  background: var(--app-bg);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}

.notes-notebook-nav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border: 1px solid var(--app-primary);
  border-radius: var(--app-radius-md);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.notes-notebook-nav button:hover:not(:disabled) {
  background: var(--app-primary);
  color: #fff;
  border-color: var(--app-primary);
}

.notes-notebook-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .notes-notebook-nav {
    padding: var(--app-space-md);
    gap: 16px;
  }
  .notes-notebook-nav button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    font-size: 0.9375rem;
    -webkit-tap-highlight-color: transparent;
  }
  .notes-notebook-page-indicator {
    font-size: 0.75rem;
  }
}

.notes-notebook-page-indicator {
  font-size: 0.8125rem;
  color: var(--app-text-muted);
  font-weight: 500;
}

.notes-viewer-content {
  max-width: var(--notes-read-width);
  margin: 0 auto;
  padding: var(--app-space-lg) 0 var(--app-space-2xl);
  padding-left: 0;
  padding-right: 0;
  font-family: var(--notes-content-font);
  color: var(--app-text);
  line-height: var(--notes-line-height);
  font-size: 1.125rem;
}

@media (min-width: 768px) {
  .notes-viewer-content {
    padding: var(--app-space-xl) var(--app-page-padding, 1.25rem) var(--app-space-2xl, 3rem) var(--app-page-padding, 1.25rem);
  }
}

/* Typography — notes content (marked.js output) */
.notes-viewer-content h1 {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  color: var(--app-text);
  margin: 0 0 0.5em;
  letter-spacing: -0.03em;
  line-height: 1.25;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--app-border-soft);
}

.notes-viewer-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--app-text);
  margin: 2em 0 0.6em;
  padding: 0.5em 0 0.25em;
  border-bottom: 1px solid var(--app-border-soft);
  scroll-margin-top: 1rem;
}

.notes-viewer-content h2:first-child {
  margin-top: 0;
}

.notes-viewer-content h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--app-primary);
  margin: 1.5em 0 0.5em;
  scroll-margin-top: 1rem;
}

.notes-viewer-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--app-text);
  margin: 1.25em 0 0.4em;
  scroll-margin-top: 1rem;
}

.notes-viewer-content p {
  margin: 0 0 1em;
  color: var(--app-text-secondary);
}

.notes-viewer-content strong {
  color: var(--app-text);
  font-weight: 700;
}

.notes-viewer-content em {
  font-style: italic;
  color: var(--app-text-secondary);
}

.notes-viewer-content ul,
.notes-viewer-content ol {
  margin: 0.75em 0 1.25em;
  padding-left: 1.5em;
}

.notes-viewer-content li {
  margin: 0.35em 0;
}

.notes-viewer-content li::marker {
  color: var(--app-primary);
}

.notes-viewer-content hr {
  border: none;
  height: 1px;
  background: var(--app-border-soft);
  margin: 2em 0;
}

/* Tables — clean, scannable */
.notes-viewer-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
  font-size: 0.9375rem;
  overflow: auto;
  display: block;
}

.notes-viewer-content thead {
  background: var(--app-primary-soft);
  border-bottom: 2px solid var(--app-primary);
}

.notes-viewer-content th {
  padding: 0.6em 0.75em;
  text-align: left;
  font-weight: 700;
  color: var(--app-text);
}

.notes-viewer-content td {
  padding: 0.5em 0.75em;
  border-bottom: 1px solid var(--app-border-soft);
  color: var(--app-text-secondary);
}

.notes-viewer-content tbody tr:hover {
  background: var(--app-bg);
}

.notes-viewer-content blockquote {
  margin: 1em 0;
  padding: 0.75em 1em 0.75em 1em;
  border-left: 4px solid var(--app-primary);
  background: var(--app-primary-soft);
  border-radius: 0 var(--app-radius-md) var(--app-radius-md) 0;
  color: var(--app-text-secondary);
  font-size: 0.9375rem;
}

.notes-viewer-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--app-bg);
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
}

.notes-viewer-content pre {
  margin: 1em 0;
  padding: 1em;
  overflow-x: auto;
  background: var(--app-bg);
  border-radius: var(--app-radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}

.notes-viewer-content pre code {
  padding: 0;
  background: none;
}

.notes-viewer-content a {
  color: var(--app-primary);
  text-decoration: none;
  font-weight: 600;
}

.notes-viewer-content a:hover {
  text-decoration: underline;
}

/* Note-specific: frequency tags & alerts (emoji + bold text) */
.notes-viewer-content p:has(strong:first-child) {
  color: var(--app-text);
}

.notes-viewer-content .notes-tag-high,
.notes-viewer-content .notes-tag-trick,
.notes-viewer-content .notes-tag-mnemonic,
.notes-viewer-content .notes-tag-chain {
  display: inline;
}

/* ——— Callout blocks: distinct presentation for TRAP, EXAMPLE, FORMULA, MEMORY, etc. ——— */
.notes-viewer-content p[class*="notes-callout-"] {
  margin: 1.25em 0;
  padding: 0.85em 1em 0.85em 1em;
  border-radius: 0 var(--app-radius-md) var(--app-radius-md) 0;
  border-left: 4px solid var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-text);
}
.notes-viewer-content p[class*="notes-callout-"] strong:first-child {
  display: block;
  margin-bottom: 0.35em;
}
.notes-viewer-content p.notes-callout-trap {
  border-left-color: #b45309;
  background: rgba(180, 83, 9, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-trap {
  background: rgba(251, 146, 60, 0.12);
  border-left-color: #fb923c;
}
.notes-viewer-content p.notes-callout-example {
  border-left-color: #0d9488;
  background: rgba(13, 148, 136, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-example {
  background: rgba(45, 212, 191, 0.12);
  border-left-color: #2dd4bf;
}
.notes-viewer-content p.notes-callout-formula {
  border-left-color: #059669;
  background: rgba(5, 150, 105, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-formula {
  background: rgba(52, 211, 153, 0.12);
  border-left-color: #34d399;
}
.notes-viewer-content p.notes-callout-memory {
  border-left-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-memory {
  background: rgba(167, 139, 250, 0.12);
  border-left-color: #a78bfa;
}
.notes-viewer-content p.notes-callout-shortcut {
  border-left-color: #0891b2;
  background: rgba(8, 145, 178, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-shortcut {
  background: rgba(34, 211, 238, 0.12);
  border-left-color: #22d3ee;
}
.notes-viewer-content p.notes-callout-chain {
  border-left-color: #64748b;
  background: rgba(100, 116, 139, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-chain {
  background: rgba(148, 163, 184, 0.12);
  border-left-color: #94a3b8;
}
.notes-viewer-content p.notes-callout-answer {
  border-left-color: #059669;
  background: rgba(5, 150, 105, 0.1);
  font-weight: 600;
}
.app-dark .notes-viewer-content p.notes-callout-answer {
  background: rgba(52, 211, 153, 0.14);
  border-left-color: #34d399;
}
.notes-viewer-content p.notes-callout-trick {
  border-left-color: #b45309;
  background: rgba(180, 83, 9, 0.08);
}
.app-dark .notes-viewer-content p.notes-callout-trick {
  background: rgba(251, 146, 60, 0.12);
  border-left-color: #fb923c;
}

/* Fallback: any callout-style p without a class (e.g. before JS runs) */
.notes-viewer-content p:has(> strong:first-child):not([class*="notes-callout-"]) {
  margin-top: 1em;
  margin-bottom: 0.75em;
  padding-left: 0.5em;
  border-left: 3px solid var(--app-border-soft);
}
.notes-viewer-content p:has(> strong:first-child) strong:first-child {
  display: inline-block;
  margin-bottom: 0.25em;
}

/* Heading hierarchy — clear and scannable */
.notes-viewer-content h2 { margin-top: 1.75em; margin-bottom: 0.5em; }
.notes-viewer-content h3 { margin-top: 1.35em; margin-bottom: 0.4em; }
.notes-viewer-content h2:first-of-type { margin-top: 0; }
.notes-viewer-content hr { margin: 1.75em 0; }

/* Step lists (Step 1, Step 2, …) — slight indent and accent */
.notes-viewer-content ul li:has(> strong:first-child) {
  margin: 0.5em 0;
  padding-left: 0.25em;
}
.notes-viewer-content ul li:has(> strong:first-child)::marker {
  color: var(--app-primary);
  font-weight: 600;
}

/* Loading & error */
.notes-viewer-loading,
.notes-viewer-error {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--app-space-xl);
  text-align: center;
  color: var(--app-text-muted);
}

.notes-viewer-error {
  color: var(--app-text-secondary);
}

.notes-viewer-error a {
  color: var(--app-primary);
  font-weight: 600;
}

/* Ask expert bar — sticky below progress */
.notes-viewer-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: var(--app-space-sm) var(--app-page-padding, 1rem);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border-soft);
  flex-shrink: 0;
  min-width: 0;
}

.notes-viewer-toolbar .notes-viewer-back {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.notes-viewer-toolbar .notes-viewer-back:hover {
  text-decoration: underline;
}

.notes-viewer-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
}

.notes-viewer-subject-wrap,
.notes-viewer-font-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.notes-viewer-toolbar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-text-muted);
  white-space: nowrap;
}

.notes-viewer-subject-select,
.notes-viewer-font-select {
  font-size: 0.875rem;
  padding: 6px 10px;
  padding-right: 28px;
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius-md);
  background: var(--app-bg);
  color: var(--app-text);
  cursor: pointer;
  min-width: 0;
  max-width: 160px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 18px;
}
.notes-viewer-subject-select:hover,
.notes-viewer-subject-select:focus,
.notes-viewer-font-select:hover,
.notes-viewer-font-select:focus {
  border-color: var(--app-primary);
  outline: none;
}
.app-dark .notes-viewer-subject-select,
.app-dark .notes-viewer-font-select {
  border-color: var(--app-border-soft);
  background-color: var(--app-surface);
}

.notes-viewer-subject-select {
  width: auto;
  min-width: 120px;
}

.notes-viewer-font-select {
  min-width: 110px;
}

.notes-viewer-toolbar .notes-viewer-ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-radius: var(--app-radius-md);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.notes-viewer-toolbar .notes-viewer-ask:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--app-primary-hover);
}

.notes-viewer-ask-text-short {
  display: none;
}

@media (max-width: 767px) {
  .notes-viewer-toolbar {
    padding: 8px 12px;
    gap: 8px 10px;
  }
  .notes-viewer-toolbar-controls {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 8px 12px;
  }
  .notes-viewer-toolbar .notes-viewer-back {
    order: 1;
  }
  .notes-viewer-toolbar .notes-viewer-ask {
    order: 2;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .notes-viewer-ask-text-long {
    display: none;
  }
  .notes-viewer-ask-text-short {
    display: inline;
  }
  .notes-viewer-toolbar-label {
    font-size: 0.75rem;
  }
  .notes-viewer-subject-select,
  .notes-viewer-font-select {
    font-size: 0.8125rem;
    padding: 5px 8px;
    padding-right: 24px;
    max-width: 140px;
    min-width: 0;
  }
  .notes-viewer-subject-select {
    min-width: 100px;
  }
  .notes-viewer-font-select {
    min-width: 90px;
  }
}

/* Print */
@media print {
  .notes-viewer-progress,
  .notes-viewer-toolbar,
  .notes-notebook-nav,
  .notes-notebook-gate,
  .app-header,
  .app-tabbar {
    display: none !important;
  }

  .notes-viewer-content-wrap {
    overflow: visible;
  }

  .notes-viewer-content {
    max-width: 100%;
    padding: 0;
    font-size: 11pt;
  }

  .notes-viewer-content h2 {
    page-break-after: avoid;
  }

  .notes-viewer-content table {
    page-break-inside: avoid;
  }
}
