/* A4 print layout. Screen styles remain independent of paper dimensions. */
@page {
  size: A4 portrait;
  margin: 17mm 13mm 17mm;
  @top-center { content: "نافس نجران · نتائج 2025 و2026"; font: 8pt Tahoma, Arial, sans-serif; color: #4c425e; }
  @bottom-right { font: 8pt Tahoma, Arial, sans-serif; color: #4c425e; }
  @bottom-left { content: "صفحة " counter(page) " من " counter(pages); font: 8pt Tahoma, Arial, sans-serif; color: #4c425e; }
}
* { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; transition: none !important; animation: none !important; box-shadow: none !important; }
html, body { background: white !important; color: #252536; font-size: 10pt; line-height: 1.6; overflow: visible !important; }
body { margin: 0; }
body.printing-school #dashboard, dialog, #printReport { display: none !important; }
body.printing-school #printReport { display: block !important; }
.skip-link, .section-nav, #filters, #status, #schools, .method-section, .report-close, .report-actions { display: none !important; }
.wrap { width: 100%; }
h1,h2,h3,h4 { break-after: avoid; }
p,li { orphans: 3; widows: 3; }
table { border-collapse: collapse; width: 100%; }
thead { display: table-header-group; }
tr, .metric, .city-row, .rank-row, .chart-group { break-inside: avoid; }
.section-heading { break-after: avoid; margin-bottom: 9px; gap: 12px; }
.section-heading h2 { font-size: 14pt; }
.eyebrow { font-size: 8pt; color: #62457d; margin-bottom: 3px; }
.scope-pill { font-size: 8pt; color: #51445f; padding: 3px 8px; }
.muted, .footnote, .filter-note, .metric-label, .metric-note, .city-chart-note, .city-name small, .rank-name small, .target-footnote, .source-list li, .report-provenance { color: #51495d; }
.footnote { font-size: 8pt; margin-top: 8px; }
.masthead { min-height: 57px; padding-bottom: 9px; }
.brand { font-size: 20pt; }
.brand small { font-size: 8pt; }
.brand-mark { transform: none; }
.brand-mark i { height: 25px; }
.brand-mark i:nth-child(2),.brand-mark i:nth-child(4) { height: 33px; }
.brand-mark i:nth-child(3) { height: 40px; }
.institution { font-size: 8pt; color: #453b53; }
.hero { background: #f4f1fa !important; color: #30264b; border: 1px solid #ddd5e9; border-radius: 9px; break-inside: avoid; overflow: visible; }
.hero:before,.hero:after { display: none; }
.hero-grid { padding: 14px 20px; grid-template-columns: 1.45fr 1fr; gap: 20px; }
.hero h1 { font-size: 25pt; line-height: 1.3; margin-bottom: 8px; }
.hero h1 br,.hero-copy>p { display: none; }
.hero h1 span { color: #391571; display: block; }
.hero-eyebrow { color: #514063; padding: 0; border: 0; font-size: 8pt; margin-bottom: 6px; }
.hero-counts { gap: 20px; }
.hero-counts>div { padding-left: 20px; border-color: #ddd4e9; }
.hero-counts b { font-size: 16pt; }
.hero-counts span { font-size: 8pt; color: #514063; }
.ring { width: 100%; aspect-ratio: auto; }
.ring svg { display: none; }
.ring-track { stroke: #e0d8ec; }
.ring-value { stroke: #167daa; }
.ring-label { position: static; gap: 6px; padding: 14px 10px; border: 1px solid #ded5e9; border-radius: 8px; background: white; }
.ring-label strong { font-size: 24pt; }
.ring-label>span,.ring-label small,.gauge-caption { color: #40304e; font-size: 7.5pt; }
.ring-label small { padding: 0; background: none; }
.gauge-caption { margin-top: 5px; }
.print-context { display: block; margin: 12px 0; padding: 8px 12px; border-right: 3px solid #7652bb; background: #faf9fc; font-size: 9pt; break-inside: avoid; }
.print-context strong { color: #391571; }
.print-context p { margin: 3px 0 0; font-size: 8pt; }
.main-content>section { margin-top: 16px; }
.metrics { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.metric { padding: 10px 11px; overflow: visible; }
.metric-label { font-size: 8.5pt; }
.metric-value { font-size: 21pt; margin: 8px 0 5px; }
.metric-note,.metric-change { font-size: 8pt; }
.metric-change { padding: 2px 3px; margin-top: 6px; }
.notice { font-size: 8pt; padding: 9px 12px; margin-top: 10px; color: #4f3c65; break-inside: avoid; }
#coverageNote a { display: none; }
.comparison-grid { grid-template-columns: 1.2fr 1fr; gap: 12px; }
#comparison { break-before: page; margin-top: 0; }
.panel { padding: 13px 15px; border-radius: 9px; break-inside: avoid; }
.panel h3 { font-size: 12pt; margin-bottom: 6px; }
.muted { font-size: 8.5pt; margin-bottom: 8px; }
.annual-chart { margin-top: 12px; }
.chart-group { margin-bottom: 12px; }
.chart-label { font-size: 9pt; margin-bottom: 5px; }
.chart-label small { font-size: 8pt; }
.bar-line { margin: 5px 0; gap: 8px; }
.bar-track { height: 10px; }
.bar-line .year-label { font-size: 8pt; }
.bar-value { font-size: 8.5pt; width: 55px; }
.axis { font-size: 7.5pt; color: #655970; }
.legend { font-size: 8pt; }
.common-panel { background: #faf8fd; }
.paired-number { font-size: 29pt; margin: 4px 0; }
.paired-number small { font-size: 9pt; }
.paired-compare { gap: 15px; margin: 9px 0 12px; }
.paired-compare strong { font-size: 19pt; }
.paired-compare span,.paired-delta,.common-panel>p:last-child { font-size: 8pt; }
.common-panel>p:last-child { color: #51495d; margin-top: 10px; }
.target-section { padding: 13px 15px; gap: 16px; flex-direction: row; align-items: center; break-inside: avoid; }
.target-intro { flex: 1; }
.target-intro h2 { font-size: 16pt; margin-bottom: 6px; }
.target-intro p { font-size: 8pt; color: #51495d; }
.target-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; width: 56%; }
.target-card { min-width: 0; padding: 8px 12px; }
.target-card span,.target-card b { font-size: 8pt; color: #4d4260; }
.target-card strong { font-size: 21pt; margin: 2px 0; }
.target-footnote { grid-column: 1/-1; margin: 0; font-size: 8pt; max-width: none; }
#cities { break-before: page; margin-top: 0; }
.city-row { grid-template-columns: 108px 1fr 65px 108px; gap: 12px; padding: 7px 0; }
.city-name { font-size: 10pt; }
.city-name small,.city-chart-note,.city-change { font-size: 8pt; }
.city-change { display: block; }
.city-row .city-value { font-size: 12pt; }
.ranking-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rank-row { padding: 7px 0; min-width: 0; }
.rank-name { font-size: 9pt; overflow-wrap: anywhere; }
.rank-name small { font-size: 8pt; }
.rank-order { font-size: 8pt; width: 20px; }
.rank-result { font-size: 12pt; }
.rank-icon { height: 24px; width: 24px; font-size: 12pt; }
.footer { font-size: 8pt; padding: 12px 0 0; margin-top: 10px; color: #51495d; }
/* School print content is outside the scrolling modal, so it can paginate. */
.report-identity { display: block; font-size: 8.5pt; color: #453b53; margin-bottom: 11px; padding-bottom: 8px; border-bottom: 1px solid #d9d2e2; break-after: avoid; }
.report-header { background: #f2edf9; color: #302342; padding: 16px 20px; border: 1px solid #ded5e9; border-radius: 8px; break-inside: avoid; break-after: avoid; }
.report-header h2 { font-size: 17pt; color: #391571; line-height: 1.55; padding: 0; overflow-wrap: anywhere; }
.report-header>p { color: #4e405d; font-size: 9pt; margin: 7px 0 0; }
.report-topline { color: #58446d; font-size: 9pt; margin-bottom: 8px; }
.report-body { padding: 14px 0 0; }
.report-label { font-size: 9pt; color: #574667; break-after: avoid; }
.report-table { table-layout: fixed; font-size: 10pt; }
.report-table td,.report-table th { padding: 7px 9px; font-size: 9.5pt; overflow-wrap: anywhere; }
.report-table th { color: #4b365f; }
.report-table small { font-size: 8pt; color: #65522f; }
.report-section { margin-top: 18px; break-inside: avoid; }
.report-section h3 { font-size: 12pt; margin-bottom: 8px; }
.report-targets { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 8px; }
.report-targets>div { padding: 9px 12px; }
.report-targets span { font-size: 8.5pt; color: #5c486e; }
.report-targets b { font-size: 19pt; }
.report-body .footnote,.report-callout { font-size: 8.5pt; color: #51445f; }
.report-callout { padding: 10px 12px; margin: 12px 0; break-inside: avoid; }
.report-skills { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.skill { padding: 11px 13px; }
.skill h4 { font-size: 10pt; margin-bottom: 8px; }
.skill p { font-size: 9pt; color: #574667; }
.skill strong { color: #42304f; }
.external-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.external-grid>div { padding: 10px; }
.external-grid span { font-size: 8.5pt; color: #51445f; }
.external-grid strong { font-size: 16pt; color: #3d2853; }
.report-provenance { font-size: 8pt; line-height: 1.8; margin-top: 16px; padding-top: 11px; break-inside: avoid; overflow-wrap: anywhere; }
.report-provenance p { margin-bottom: 8px; }
.report-provenance ul { padding-right: 18px; margin: 6px 0; }
