/* --- Reset & Global Variables --- */
:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0d9488;
  --secondary-light: #f0fdfa;
  --accent: #f59e0b;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --font-family-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- Header Styling --- */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background-color: #f1f5f9;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.header-icon {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.app-header h1 {
  font-size: 18px;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.btn-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-sample {
  background-color: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.btn-sample:hover {
  background-color: #dcfce7;
  border-color: #4ade80;
  color: #14532d;
}

.btn-danger {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.btn-danger:hover {
  background-color: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

.btn-print {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-print:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #ffffff;
}

/* --- Init Banner --- */
.init-banner {
  background: linear-gradient(to right, #eff6ff, #f0fdfa);
  border-bottom: 1px solid #bfdbfe;
  padding: 14px 24px;
  animation: fadeIn 0.3s ease-out;
}

.init-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.init-banner-icon {
  flex-shrink: 0;
}

.init-banner-text {
  flex: 1;
}

.init-banner-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 3px;
}

.init-banner-text p {
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}

.init-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-init {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-init-primary {
  background: #2563eb;
  color: white;
}
.btn-init-primary:hover {
  background: #1d4ed8;
}

.btn-init-secondary {
  background: #ffffff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.btn-init-secondary:hover {
  background: #eff6ff;
}

/* --- Layout Grid --- */
.main-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 65px);
  overflow: hidden;
}

.editor-sidebar {
  width: 480px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.sidebar-tab {
  flex: 1;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sidebar-tab:hover {
  color: var(--text-main);
  background: #f1f5f9;
}

.sidebar-tab.active {
  color: var(--primary);
  background: #ffffff;
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-pane.active {
  display: block;
}

/* Section Cards inside Sidebar */
.section-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.flex-1 {
  flex: 1;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #1e293b;
  background-color: #ffffff;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
  resize: vertical;
}

.checkbox-row, .checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Quick Symbols Bar */
.quick-symbols-bar {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
}

.symbols-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.symbols-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.btn-sym {
  padding: 3px 7px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sym:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Chapter Items & Blocks */
.chapters-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.chapter-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.chapter-header {
  background: #f1f5f9;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}

.chapter-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  flex: 1;
}

.chapter-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-subtle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #64748b;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-subtle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-icon-subtle.delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.chapter-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-block {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.sub-block-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-add-chapter {
  width: 100%;
  padding: 10px;
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-add-chapter:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

.btn-sub-add {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: white;
  border: 1px solid #cbd5e1;
  color: #1e40af;
  cursor: pointer;
}
.btn-sub-add:hover {
  background: #eff6ff;
}

/* MCQ Question item inside editor */
.item-edit-box {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

.item-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mcq-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.option-edit-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.option-edit-wrap input[type="text"] {
  font-size: 12px;
  padding: 4px 6px;
}

.radio-correct {
  cursor: pointer;
}

/* Format Card in Tab Print */
.format-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.format-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
}

.format-card:hover {
  border-color: #93c5fd;
}

.format-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--primary);
}

.format-card.selected {
  border-color: var(--primary);
  background-color: #eff6ff;
}

.format-body strong {
  font-size: 13px;
  color: #1e293b;
  display: block;
  margin-bottom: 4px;
}

.format-body p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.format-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.format-badge.highlight {
  background: #dcfce7;
  color: #15803d;
}

.tip-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.tip-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.tip-card ul {
  padding-left: 20px;
  font-size: 12px;
  color: #1e3a8a;
  line-height: 1.5;
}

.tip-card li {
  margin-bottom: 6px;
}

/* --- Preview Panel (Phải) --- */
.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #64748b;
  overflow: hidden;
}

.preview-toolbar {
  background: #1e293b;
  color: white;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.preview-badge {
  background: #334155;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  color: #cbd5e1;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-tool:hover {
  background: #2563eb;
}

.paper-scroll-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Document Paper Sheet */
.paper-container {
  background: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  color: #000;
  position: relative;
  transition: all 0.2s ease;
}

/* Layout Standard A4 */
.paper-container.layout-a4 {
  width: 210mm;
  min-height: 297mm;
  padding: 15mm 15mm 20mm 15mm;
  box-sizing: border-box;
}

/* Layout Mini Book A5 (2 pages A5 on A4 landscape) */
.paper-container.layout-a5-booklet {
  width: 297mm;
  min-height: 210mm;
  padding: 12mm;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 14mm;
  position: relative;
}

/* Central fold dashed line for A5 Booklet preview */
.paper-container.layout-a5-booklet::after {
  content: "ĐƯỜNG GẤP GIỮA SÁCH A5 (FOLD HERE)";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 1px dashed #94a3b8;
  pointer-events: none;
  font-size: 9px;
  color: #94a3b8;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding-left: 4px;
  display: flex;
  align-items: center;
}

/* --- Document Content Styling (Inside Paper) --- */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
}

.doc-org-block {
  text-align: center;
  width: 48%;
}

.doc-dept {
  font-size: 11pt;
  font-weight: bold;
  text-transform: uppercase;
  line-height: 1.2;
}

.doc-school {
  font-size: 11.5pt;
  font-weight: bold;
  text-transform: uppercase;
  margin-top: 2px;
  border-bottom: 1px solid #000;
  display: inline-block;
  padding-bottom: 2px;
}

.doc-student-box {
  width: 48%;
  border: 1px solid #000;
  padding: 6px 10px;
  font-size: 10pt;
  line-height: 1.4;
  border-radius: 3px;
}

.doc-title-block {
  text-align: center;
  margin: 12px 0 14px 0;
}

.doc-main-title {
  font-size: 15pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-sub-info {
  font-size: 11.5pt;
  font-weight: bold;
  margin-top: 4px;
}

.doc-note-box {
  background: #fbfbfb;
  border: 1px dashed #666;
  padding: 6px 10px;
  font-size: 10pt;
  font-style: italic;
  margin-bottom: 14px;
  border-radius: 4px;
}

/* Chapter presentation */
.doc-chapter {
  margin-bottom: 16px;
}

.doc-chapter-title {
  font-size: 12.5pt;
  font-weight: bold;
  text-transform: uppercase;
  color: #000;
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
  margin-bottom: 8px;
}

.doc-section-h3 {
  font-size: 11.5pt;
  font-weight: bold;
  margin: 8px 0 4px 0;
  display: flex;
  align-items: center;
}

.doc-theory-content {
  font-size: inherit;
  line-height: inherit;
  text-align: justify;
  margin-bottom: 10px;
}

.doc-theory-content p {
  margin-bottom: 6px;
}

.doc-theory-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.doc-theory-content th, .doc-theory-content td {
  border: 1px solid #000;
  padding: 4px 8px;
  font-size: inherit;
  text-align: left;
}

.doc-theory-content th {
  background-color: #eee;
  font-weight: bold;
}

/* MCQ in Document */
.doc-mcq-list {
  margin-bottom: 12px;
}

.doc-mcq-item {
  margin-bottom: 8px;
  line-height: inherit;
  page-break-inside: avoid;
}

.doc-mcq-q {
  font-weight: bold;
  margin-bottom: 3px;
}

.doc-mcq-grid {
  display: grid;
  gap: 4px;
}

.doc-mcq-grid.col-4 {
  grid-template-columns: repeat(4, 1fr);
}
.doc-mcq-grid.col-2 {
  grid-template-columns: repeat(2, 1fr);
}
.doc-mcq-grid.col-1 {
  grid-template-columns: 1fr;
}

.doc-mcq-opt {
  font-size: inherit;
}

.doc-mcq-opt.correct-key {
  /* subtly marked in preview or teacher mode */
}

/* Essay in Document */
.doc-essay-list {
  margin-bottom: 12px;
}

.doc-essay-item {
  margin-bottom: 10px;
  page-break-inside: avoid;
}

.doc-essay-q {
  font-weight: bold;
  margin-bottom: 3px;
}

.doc-essay-sol {
  padding-left: 12px;
  border-left: 2px solid #555;
  margin-top: 4px;
  font-style: italic;
  color: #222;
}

/* Answers Table at the end */
.doc-answers-summary {
  margin-top: 16px;
  page-break-inside: avoid;
}

.doc-answers-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.doc-answers-table th, .doc-answers-table td {
  border: 1px solid #000;
  padding: 4px 6px;
  text-align: center;
  font-size: 10pt;
}

.doc-answers-table th {
  background: #f0f0f0;
  font-weight: bold;
}

/* A5 Booklet Subpage containers */
.booklet-page {
  padding: 6mm;
  min-height: 185mm;
  box-sizing: border-box;
}

/* --- Modals & Toasts --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header-danger {
  background: #fef2f2;
  color: #991b1b;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
}

.modal-body p {
  margin-bottom: 10px;
}

.modal-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  padding: 8px 16px;
  background: white;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-confirm-danger {
  padding: 8px 16px;
  background: #dc2626;
  border: none;
  color: white;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.btn-confirm-danger:hover {
  background: #b91c1c;
}

.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- PRINT RULES (CRITICAL FOR PERFECT PRINTOUT & PHOTOCOPY) --- */
@media print {
  @page {
    size: auto;
    margin: 10mm 12mm 10mm 12mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  .no-print,
  .app-header,
  .editor-sidebar,
  .preview-toolbar,
  .init-banner,
  .modal-backdrop,
  .toast-notice {
    display: none !important;
  }

  .main-container {
    height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  .preview-panel {
    background: transparent !important;
    overflow: visible !important;
  }

  .paper-scroll-wrap {
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  .paper-container {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: auto !important;
  }

  .paper-container.layout-a5-booklet {
    width: 100% !important;
    min-height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    column-gap: 12mm !important;
  }

  .paper-container.layout-a5-booklet::after {
    border-left: 1px dashed #777 !important;
    content: "" !important;
  }

  .doc-chapter {
    page-break-inside: auto;
  }

  .doc-mcq-item, .doc-essay-item {
    page-break-inside: avoid;
  }

  .doc-answers-summary {
    page-break-inside: avoid;
  }

  /* Sharp pure black for high-contrast photo copy */
  * {
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
