/* ==========================================================================
   MATEMATİK MOTORU | ÇALIŞMA KAĞIDI (A4) — ekran önizleme + baskı
   Kural: sayfa %100 dolu. Esnek bloklar (adet:{min,max}) sığdığı kadar büyür,
   'uzar' bloğu kalan boşluğu alır. Zemin saf beyaz, mürekkep tasarruflu.
   ========================================================================== */
:root { --u: 6px; }
body { overflow: auto; background: #cbd5e1; }
.ysm-sayfa { height: auto; min-height: 100vh; }
.arac { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 10px 14px; background: #fff; border-bottom: 2px solid var(--ince); position: sticky; top: 0; z-index: 30; }
.arac .ysm-btn { font-size: 15px; padding: 9px 18px; }
.arac .bilgi { font-weight: 800; color: var(--soluk); font-size: 14px; }
.tezgah { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 22px 10px 70px; }

.a4 {
  width: 210mm; height: 297mm; background: #fff; box-shadow: 0 6px 28px rgba(15, 23, 42, .28);
  padding: 8mm 10mm 7mm; display: flex; flex-direction: column; overflow: hidden; position: relative;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #0f172a; flex: none;
}
.a4-ust { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 0.6mm solid #334155; padding-bottom: 1.8mm; margin-bottom: 2.5mm; gap: 6mm; }
.a4-ust .marka { font-size: 7.5pt; font-weight: 900; letter-spacing: .12em; color: #4f46e5; }
.a4-ust h1 { margin: 0; font-size: 14.5pt; font-weight: 900; line-height: 1.15; }
.a4-ust .kimlik { font-size: 8.5pt; font-weight: 800; color: #334155; border: 0.3mm solid #94a3b8; border-radius: 2mm; padding: 1.2mm 2.4mm; white-space: nowrap; line-height: 1.7; }
.a4-govde { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2.6mm; overflow: hidden; }
.a4-govde.dagit { justify-content: space-between; }
.a4-alt { margin-top: 1.5mm; display: flex; justify-content: space-between; font-size: 7pt; font-weight: 800; color: #94a3b8; }

.blok { flex: 0 0 auto; }
.blok.uzar { flex: 1 1 auto; display: flex; flex-direction: column; }
.blok-baslik { background: #f1f5f9; border-left: 1.2mm solid #4f46e5; padding: 1mm 2.4mm; font-weight: 900; font-size: 10pt; border-radius: 0 1.5mm 1.5mm 0; }
.yonerge { font-size: 8.5pt; color: #475569; margin: 0.8mm 0 1.4mm; font-weight: 700; }
.izgara { display: grid; gap: 2mm; }
.hucre { border: 0.3mm solid #cbd5e1; border-radius: 2mm; padding: 1.4mm; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; position: relative; min-width: 0; }
.hucre .no { position: absolute; left: 1.5mm; top: 0.8mm; font-size: 7.5pt; font-weight: 900; color: #64748b; }
.hucre .altyazi { font-family: var(--font-rakam); font-weight: 900; font-size: 9pt; white-space: nowrap; margin-top: 1mm; text-align: center; line-height: 1.5; }

/* bileşenleri kâğıda uyarla */
.a4 .ysm-b { height: auto; width: 100%; gap: 3mm; }
.a4 .ysm-b > svg, .a4 .ysm-b .svg-kap, .a4 .ysm-b .svg-kap > svg { height: auto; width: 100%; max-height: none; }
.a4 .ysm-pay { gap: 1.5mm; padding: 0; }
.a4 .ysm-pay .havuz { min-height: 9mm; padding: 1mm; border-width: 0.5mm; }
.a4 .ysm-pay .tabaklar { padding-bottom: 5mm; gap: 2mm; flex: none; }
.a4 .ysm-pay .tabak { border-width: 0.5mm; padding: 5% 4%; max-width: 30mm; }
.a4 .ysm-pay .nesne { width: 5mm !important; height: 5mm !important; }
.a4 .ysm-pay .tabak .ad { font-size: 6.5pt; bottom: -3.8mm; }
.a4 .ysm-pay .alt-bar { min-height: 0; }
.a4 .ysm-ifade { font-size: 12pt; gap: .4em; }
.a4 .ysm-saglama { gap: 0; }
.a4 .ysm-saglama .denklem { font-size: 17pt; gap: 3mm; }
.a4 .ysm-saglama .kutu { min-width: 17mm; border-width: 0.6mm; padding: 0.6mm 2mm; border-radius: 3mm; }
.a4 .ysm-saglama .kutu small { font-size: 5.5pt; }
.a4 .ysm-saglama .kutu.bos { background: #fff; border-style: dashed; }
.a4 .bosluk { border-bottom-width: 0.4mm; min-width: 9mm; }

.terimler { display: flex; gap: 6mm; align-items: center; }
.terimler .sol { flex: 0 0 27%; }
.terimler .sag-liste { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 4mm; font-weight: 900; font-size: 10.5pt; }
.terimler .sag-liste div { display: flex; align-items: baseline; gap: 2mm; }
.rol-bn { color: #1d4ed8; } .rol-bl { color: #c2410c; } .rol-bm { color: #15803d; } .rol-kl { color: #b91c1c; }

.cumleler { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.6mm; font-size: 10.5pt; font-weight: 800; }
.cumleler li { display: flex; gap: 2mm; align-items: baseline; }
.cumleler li b.no { color: #4f46e5; min-width: 5mm; }

.problemler { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2mm; }
.problem { flex: 1 1 auto; border: 0.3mm solid #cbd5e1; border-radius: 2mm; padding: 1.6mm 2.4mm; display: flex; flex-direction: column; gap: 1mm; }
.problem .soru { font-size: 10.5pt; font-weight: 800; line-height: 1.35; }
.problem .soru b { color: #4f46e5; margin-right: 1.5mm; }
.problem .islem { flex: 1; min-height: 13mm; border: 0.3mm dashed #94a3b8; border-radius: 1.5mm; position: relative; background-image: linear-gradient(#f1f5f9 0.2mm, transparent 0.2mm); background-size: 5mm 5mm; }
.problem .islem span { position: absolute; left: 1.5mm; top: 0.6mm; font-size: 7pt; font-weight: 900; color: #94a3b8; }
.problem .cevap-satiri { font-size: 10pt; font-weight: 900; display: flex; gap: 2mm; align-items: baseline; }
.problem .cevap-satiri .cizgi { flex: 1; border-bottom: 0.4mm solid #334155; min-height: 5mm; font-weight: 800; color: #15803d; }
.problem .cevap-satiri .cizgi .cevap { display: none; }
body.cevap-acik .problem .cevap-satiri .cizgi .cevap { display: inline; }
.a4 .cevap { color: #15803d; }

@media print {
  body { background: #fff; overflow: visible; }
  .ysm-ust, .arac { display: none !important; }
  .tezgah { padding: 0; gap: 0; display: block; }
  .a4 { box-shadow: none; margin: 0; zoom: 1 !important; page-break-after: always; break-after: page; }
  .a4:last-child { page-break-after: auto; break-after: auto; }
  @page { size: A4; margin: 0; }
}
