/* ==========================================================================
   ÖDEVMATİK İLKOKUL (1-4. SINIF) — ÇEVRİMDIŞI ETKİNLİK & A4 BASKI STİLLERİ
   ========================================================================== */

:root {
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-muted: #f8fafc;
  --border-color: #cbd5e1;
  --border-light: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent-grade1: #e11d48;
  --accent-grade2: #d97706;
  --accent-grade3: #059669;
  --accent-grade4: #7c3aed;
  --danger: #dc2626;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-a4: 0 10px 30px rgba(15, 23, 42, 0.14);
  --font-base: "Fredoka", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  min-width: 0;
  font-weight: 400 !important;
  font-synthesis: none;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-base);
  font-weight: 400 !important;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

b, strong, h1, h2, h3, h4, h5, h6, th, label, button, select, input, svg text {
  font-family: var(--font-base) !important;
  font-weight: 400 !important;
}

h1, h2, h3, p {
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

button, select, input {
  font-family: inherit;
  font-size: inherit;
  touch-action: manipulation;
}

/* --------------------------------------------------------------------------
   ÜST BAR (HEADER)
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 800;
  color: var(--text-main);
}

.brand-text h1 span {
  color: var(--primary);
}

.brand-text p {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Sınıf Seçici Sekmeler */
.grade-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.grade-tab {
  min-height: 44px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grade-tab:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.grade-tab.active[data-grade="1"] {
  background: var(--accent-grade1);
  color: #fff;
}
.grade-tab.active[data-grade="2"] {
  background: var(--accent-grade2);
  color: #fff;
}
.grade-tab.active[data-grade="3"] {
  background: var(--accent-grade3);
  color: #fff;
}
.grade-tab.active[data-grade="4"] {
  background: var(--accent-grade4);
  color: #fff;
}

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

/* Butonlar */
.btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  min-height: 36px;
  padding: 5px 11px;
  font-size: 12.5px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #0f172a;
  color: #fff;
}
.btn-secondary:hover {
  background: #1e293b;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-muted);
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
}

.mobile-only {
  display: none;
}

/* --------------------------------------------------------------------------
   ANA DÜZEN (SOL PANEL + SAĞ A4 ÖNİZLEME)
   -------------------------------------------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: calc(100vh - 65px);
  align-items: stretch;
}

.sidebar-panel {
  background: #eef2f7;
  border-right: 1px solid #cbd5e1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 3.5px solid #2563eb;
  border-radius: 14px;
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.panel-card:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
}

.panel-card:nth-of-type(1) { border-top-color: #2563eb; }
.panel-card:nth-of-type(2) { border-top-color: #7c3aed; }
.panel-card:nth-of-type(3) { border-top-color: #059669; }
.panel-card:nth-of-type(4) { border-top-color: #d97706; }

.card-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -13px -14px 2px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.card-title-row h2 {
  font-size: 14.5px;
  color: #0f172a;
  letter-spacing: 0.1px;
  flex: 1;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
}

.panel-card:nth-of-type(1) .step-badge { background: #2563eb; }
.panel-card:nth-of-type(2) .step-badge { background: #7c3aed; }
.panel-card:nth-of-type(3) .step-badge { background: #059669; }
.panel-card:nth-of-type(4) .step-badge { background: #d97706; }

.saved-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.module-desc {
  font-size: 12.5px;
  color: #334155;
  background: #f8fafc;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #2563eb;
  border-radius: 9px;
  line-height: 1.45;
}

.tymm-badge {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 3.5px solid #059669;
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tymm-badge-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tymm-code {
  background: #065f46;
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
}

.tymm-theme {
  font-size: 11.5px;
  color: #065f46;
}

.tymm-outcome {
  font-size: 12px;
  color: #1e293b;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12.5px;
  color: #334155;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-control {
  min-height: 40px;
  width: 100%;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--text-main);
  font-size: 13px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.form-control:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.dynamic-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   SAĞ ÖNİZLEME ALANI & A4 SAYFA SİMÜLASYONU
   -------------------------------------------------------------------------- */
.preview-workspace {
  padding: 16px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  overflow-x: hidden;
}

.preview-toolbar {
  width: 100%;
  max-width: 210mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.preview-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-pill {
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 700;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 99px;
}

.summary-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seed-loader-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.seed-input {
  width: 78px;
  min-height: 36px;
  padding: 4px 7px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  background: #f8fafc;
  color: var(--text-main);
}

.pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   GERÇEK A4 SAYFASI TASARIMI (EKRAN VE YAZICI ORTAK)
   -------------------------------------------------------------------------- */
.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  background: #ffffff;
  color: #000000;
  padding: 10mm 11mm;
  box-shadow: var(--shadow-a4);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Font Seçenekleri (Tüm çalışma kağıtlarında Google Fredoka font ailesi + tabular-nums) */
.a4-sheet,
.a4-sheet.font-comic,
.a4-sheet.font-sans,
.a4-sheet.font-mono {
  font-family: var(--font-base);
  font-variant-numeric: tabular-nums;
}

/* Çerçeve Temaları */
.a4-inner-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5mm 6mm;
  height: 100%;
}

.a4-sheet.theme-classic .a4-inner-frame {
  border: 3px double #1e293b;
}
.a4-sheet.theme-rounded .a4-inner-frame {
  border: 2px solid #1e293b;
  border-radius: 14px;
}
.a4-sheet.theme-dashed .a4-inner-frame {
  border: 2px dashed #334155;
  border-radius: 8px;
}
.a4-sheet.theme-stars .a4-inner-frame {
  border: 2.5px solid #1e293b;
  border-radius: 12px;
  position: relative;
}
.a4-sheet.theme-none .a4-inner-frame {
  border: none;
  padding: 2mm;
}

/* Çalışma Kağıdı Üst Başlık (Antet) */
.ws-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.ws-page-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
}

.ws-title-center {
  text-align: center;
}

.ws-school-line {
  font-size: 16.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #334155;
  margin-bottom: 2px;
}

.ws-main-title {
  font-size: 18px;
  font-weight: 800;
  color: #000;
  line-height: 1.2;
}

.ws-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  padding-top: 2px;
}

.ws-field {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.ws-field-grow {
  flex: 2.2;
}

.ws-field-class {
  flex: 0.9;
}

.ws-field-no {
  flex: 1;
}

.ws-field strong {
  font-weight: 700;
}

.ws-dots {
  flex: 1;
  border-bottom: 1.2px dotted #334155;
  min-width: 50px;
  height: 14px;
}

/* Soru Izgarası (Grid) — A4 sayfasının tamamını doldurur */
.ws-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  padding: 4px 0;
}

.ws-grid {
  flex: 1;
  display: grid;
  gap: 8px 10px;
  width: 100%;
  height: 100%;
  align-items: stretch;
  align-content: stretch;
}

.ws-grid.cols-1 { grid-template-columns: 1fr; }
.ws-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ws-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ws-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.ws-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Boyut Varyasyonları */
.a4-sheet.size-large .ws-grid {
  gap: 16px 16px;
}
.a4-sheet.size-compact .ws-grid {
  gap: 8px 10px;
}

/* Soru Kartı */
.q-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  background: #fff;
  page-break-inside: avoid;
  break-inside: avoid;
}

.q-card > :not(.q-num) {
  flex: 1 1 0;
  min-width: 0;
}

.q-card > .vertical-op,
.q-card > .tr-division,
.q-card > .magic-box-table {
  flex: 0 0 auto;
}

.q-num {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.4;
  margin-top: 2px;
}

/* 1. Alt Alta Dört İşlem (Klasik) */
.vertical-op {
  font-family: var(--font-base);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 700;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 2px auto 2px;
  min-width: 78px;
  padding-right: 6px;
}

.a4-sheet.size-large .vertical-op {
  font-size: 23px;
  min-width: 92px;
}

.vertical-op .op-row {
  letter-spacing: 2px;
  line-height: 1.15;
}

.vertical-op .op-line {
  width: 100%;
  border-bottom: 2px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 1px;
}

.vertical-op .op-line .op-row {
  line-height: 1.05;
}

.vertical-op .op-sign {
  display: inline-block;
  font-size: 1.1em;
  line-height: 0.85;
}

.vertical-op .op-answer-space {
  min-height: 24px;
  width: 100%;
  text-align: right;
  padding-top: 2px;
  letter-spacing: 2px;
}

/* 2. Yan Yana İşlem & Verilmeyenli Kutucuk */
.horizontal-op {
  font-size: 16.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding-left: 0;
  min-height: 24px;
  flex-wrap: wrap;
}

.a4-sheet.size-large .horizontal-op {
  font-size: 20px;
  min-height: 28px;
}

.blank-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  border: 1.8px solid #0f172a;
  border-radius: 5px;
  padding: 0 5px;
  background: #fff;
}

.blank-box.wide {
  min-width: 68px;
}

.blank-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.8px solid #0f172a;
  border-radius: 50%;
}

/* 3. Türk Usulü Klasik Bölme Çizgisi (Kartın en üstünden başlar, altında çıkarma adımları için geniş boşluk bırakır) */
.q-card:has(.tr-division) {
  justify-content: flex-start !important;
  padding-top: 6px !important;
}

.tr-division {
  display: grid;
  grid-template-columns: auto auto;
  font-family: var(--font-base);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 700;
  margin: 0 auto auto;
  width: fit-content;
}

.tr-div-left {
  padding: 0 10px 44px 12px;
  border-right: 2px solid #000;
  min-width: 68px;
  text-align: right;
  line-height: 1.25;
}

.tr-div-right {
  display: flex;
  flex-direction: column;
}

.tr-div-divisor {
  padding: 0 10px 2px 8px;
  border-bottom: 2px solid #000;
  min-width: 52px;
  line-height: 1.25;
}

.tr-div-quotient {
  padding: 4px 8px;
  min-height: 36px;
}

/* 4. Ritmik Sayma Zinciri (Satır sonuna kadar tam genişlikte uzanır) */
.rhythmic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
  padding-left: 0;
  padding-right: 2px;
  flex-wrap: nowrap;
}

.rhythmic-cell {
  flex: 1 1 0;
  min-width: 32px;
  height: 32px;
  padding: 0 3px;
  border: 1.6px solid #1e293b;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}

.rhythmic-arrow {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: #475569;
  line-height: 1;
}

/* 5. Sihirli Toplama Kutusu */
.magic-box-table {
  border-collapse: collapse;
  margin: 2px auto 0;
}

.magic-box-table td {
  width: 40px;
  height: 36px;
  border: 1.8px solid #0f172a;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.magic-box-table td.sum-cell {
  background: #f1f5f9;
  border-style: double;
  border-width: 3px;
}

/* 6. Saat & Kesir & Şekil Kartları */
.visual-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 0;
}

.visual-card-inner svg {
  max-width: 100%;
  height: auto;
}

.clock-label-box {
  border: 1.5px solid #0f172a;
  border-radius: 5px;
  min-width: 82px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Kesir Gösterimi (Pay / Payda) */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 3px;
}
.frac-num {
  border-bottom: 1.6px solid #000;
  padding: 0 4px 1px;
}
.frac-den {
  padding: 1px 4px 0;
}

/* Cevap Anahtarı (Satır İçi Kırmızı Gösterim) */
.ans-inline {
  color: #dc2626;
  font-weight: 800;
  display: none;
}

.show-inline-answers .ans-inline {
  display: inline;
}

/* Sayfa Alt Bilgisi (Footer) */
.ws-footer {
  border-top: 1.5px solid #334155;
  padding-top: 5px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.ws-footer-answers {
  font-size: 9.5px;
  color: #334155;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 3px;
  line-height: 1.35;
}

.ws-footer-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.ws-footer-left {
  text-align: left;
}

.ws-footer-center {
  text-align: center;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.3px;
}

.ws-footer-right {
  text-align: right;
}

/* Ayrı Cevap Anahtarı Sayfası */
.answer-key-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.answer-key-block {
  border: 1px solid #94a3b8;
  border-radius: 6px;
  padding: 8px 10px;
}

.answer-key-block h3 {
  font-size: 13px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.answer-key-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px 8px;
  font-size: 11px;
}

.answer-key-list.answer-key-list-wide {
  grid-template-columns: 1fr;
  font-size: 10.5px;
}

/* --------------------------------------------------------------------------
   ÖĞRENCİ YÖNERGESİ, TYMM KAZANIM BANDI, ÖZ DEĞERLENDİRME & YENİ NESİL BİLEŞENLER
   -------------------------------------------------------------------------- */
.ws-instruction-bar {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #334155;
  border-radius: 5px;
  padding: 5px 10px;
}

.a4-sheet.size-large .ws-instruction-bar {
  font-size: 14.5px;
}

.ws-tymm-bar {
  font-size: 9.5px;
  line-height: 1.3;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 7px;
}

.ws-self-eval {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  color: #1e293b;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 5px;
  padding: 3px 8px;
}

/* Yeni Nesil Problem Kartları & Kareli Çözüm Alanı */
.problem-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 0;
}

.problem-text {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
}

.a4-sheet.size-large .problem-text {
  font-size: 14px;
}

.solution-grid-box {
  height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, #e2e8f0 1px, transparent 1px),
    linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
  background-size: 12px 12px;
}

.solution-blank-box {
  height: 54px;
  border: 1px dashed #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
}

.problem-ans-row {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  text-align: right;
}

/* Çoktan Seçmeli Test Kartları */
.mc-card-inner {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 0;
}

.mc-card-inner svg {
  max-height: 60px;
  width: auto;
}

.mc-prompt {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.mc-options {
  display: grid;
  gap: 4px 8px;
}

.mc-options.cols-opt-2 {
  grid-template-columns: repeat(2, 1fr);
}

.mc-options.cols-opt-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mc-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 5px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
}

.mc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.4px solid #334155;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.show-inline-answers .mc-option.mc-correct {
  border-color: #dc2626;
  background: #fef2f2;
  color: #dc2626;
}

.show-inline-answers .mc-option.mc-correct .mc-badge {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* Sayı Piramidi */
.pyramid-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 0;
}

.pyramid-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.pyramid-cell {
  width: 44px;
  height: 26px;
  border: 1.6px solid #0f172a;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
}

.pyramid-cell.pyramid-blank {
  background: #ffffff;
}

/* İşlem Zinciri / Treni */
.chain-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 0;
}

.chain-node {
  min-width: 34px;
  height: 28px;
  padding: 0 6px;
  border: 1.6px solid #0f172a;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 800;
}

.chain-op {
  font-size: 11.5px;
  color: #334155;
  white-space: nowrap;
}

/* Faz 1B Bileşenleri: Örüntü Şeridi, Takvim Yaprağı, Tahmin Kartı & Şekil Grafiği */
.visual-card-inner,
.pattern-strip,
.estimate-card {
  flex: 1 1 0;
  min-width: 0;
}

.pattern-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
}

.pattern-cell {
  width: 24px;
  height: 24px;
  border: 1.4px solid #334155;
  border-radius: 5px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pattern-cell.pattern-blank {
  border-style: dashed;
  border-color: #1d4ed8;
  background: #eff6ff;
}

.cal-card-box {
  width: 100%;
  max-width: 196px;
  border: 1.4px solid #334155;
  border-radius: 5px;
  overflow: hidden;
  background: #ffffff;
}

.cal-title {
  background: #e2e8f0;
  color: #0f172a;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
  border-bottom: 1px solid #334155;
}

.cal-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  text-align: center;
}

.cal-mini-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  padding: 1px 2px;
  border-bottom: 1px solid #cbd5e1;
}

.cal-mini-table td {
  padding: 1px 2px;
  font-weight: 600;
  color: #0f172a;
  border-top: 1px solid #f1f5f9;
}

.cal-mini-table td.cal-wknd {
  color: #b91c1c;
  font-weight: 700;
}

.estimate-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.est-op {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.est-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: #475569;
}

.est-slots {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.est-slots u {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  text-decoration: none;
  border-bottom: 1.4px solid #334155;
}

.pictograph-table {
  width: 100%;
  max-width: 240px;
  border-collapse: collapse;
  font-size: 10.5px;
  background: #ffffff;
}

.pictograph-table th,
.pictograph-table td {
  border: 1px solid #64748b;
  padding: 2px 5px;
  text-align: left;
  vertical-align: middle;
}

.pictograph-table th {
  background: #f1f5f9;
  font-weight: 800;
  color: #0f172a;
}

.pictograph-table td.picto-icons {
  white-space: nowrap;
}

.pictograph-table td.picto-icons svg {
  vertical-align: middle;
  margin-right: 2px;
}

.picto-note {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #1e293b;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 4px;
  padding: 1px 6px;
}

/* --------------------------------------------------------------------------
   ŞİFRELİ MESAJ & DOĞRU YOL LABİRENTİ (OYUNLAŞTIRILMIŞ BULMACALAR)
   -------------------------------------------------------------------------- */
.cipher-card,
.maze-card {
  width: 100%;
  gap: 5px;
}

.cipher-clue,
.maze-rule-bar {
  width: 100%;
  font-size: 10.6px;
  line-height: 1.25;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #2563eb;
  border-radius: 4px;
  padding: 3px 6px;
}

.cipher-key-bar {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 4px;
  background: #fffbeb;
  border: 1px dashed #d97706;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 10px;
}

.cipher-key-title {
  font-weight: 800;
  color: #92400e;
  margin-right: 2px;
}

.cipher-key-pill {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #0f172a;
}

.cipher-slots-grid {
  width: 100%;
  display: grid;
  gap: 4px;
}

.cipher-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  padding: 3px 2px 4px;
  min-width: 0;
}

.cipher-slot-num {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
}

.cipher-expr {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.cipher-res {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
}

.cipher-letter-box {
  width: 24px;
  height: 24px;
  border: 2px solid #0f172a;
  border-radius: 5px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #1d4ed8;
}

/* --------------------------------------------------------------------------
   FAVORİLERİM & AKILLI TAHTA MODU (FAZ 4)
   -------------------------------------------------------------------------- */
.btn-fav {
  border: 1px solid #f59e0b;
  background: #fef3c7;
  color: #92400e;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  cursor: pointer;
}
.btn-fav:hover {
  background: #fde68a;
}

.favorites-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
}

.btn-fav-del {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  font-weight: 800;
  cursor: pointer;
}

.board-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.board-modal.open {
  display: flex;
}

.board-modal-card {
  width: min(1050px, 96vw);
  min-height: min(640px, 90vh);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 26px;
  gap: 18px;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.board-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.board-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
}

.board-title {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
}

.board-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.board-counter {
  font-size: 16px;
  font-weight: 800;
  color: #334155;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 8px;
}

.board-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 28px;
  overflow: auto;
}

.board-draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  touch-action: none;
}

.board-draw-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.board-tool-btn {
  min-height: 44px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.board-pen-red.active {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

.board-pen-blue.active {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af;
}

.board-question-box {
  transform: scale(2.1);
  transform-origin: center center;
  margin: 44px 0;
}

.board-question-box:has(.rhythmic-row) {
  transform: scale(1.25);
  width: 78%;
}

.board-answer-banner {
  background: #dcfce7;
  border: 2px solid #22c55e;
  color: #14532d;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.board-nav-btn,
.board-ans-btn,
.board-close-btn {
  min-height: 52px;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 700;
}

.board-timer-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 3px 6px;
}

.board-timer-badge {
  font-size: 14px;
  font-weight: 800;
  color: #334155;
  padding: 2px 6px;
  cursor: pointer;
}

.board-timer-badge.timer-running {
  color: #1d4ed8;
}

.board-timer-badge.timer-expired {
  color: #dc2626;
}

.board-mini-btn {
  min-height: 34px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.board-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 8px 16px;
}

.board-team {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.team-score {
  font-size: 24px;
  font-weight: 900;
  color: #1d4ed8;
  min-width: 28px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   4. SORU KİTAPÇIĞI OLUŞTURUCU
   -------------------------------------------------------------------------- */
.teacher-efficiency-bar {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
}

.teacher-eff-btn {
  width: 100%;
  min-height: 42px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #1d4ed8;
  justify-content: center;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.teacher-eff-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

/* Soru Kitapçığı Oluşturucu Modal */
.teacher-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 23, 42, 0.72);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.teacher-modal.open {
  display: flex;
}

.teacher-modal-card {
  width: min(740px, 95vw);
  max-height: 88vh;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.teacher-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.teacher-modal-header h2 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.teacher-modal-header p {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.teacher-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booklet-preset-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.booklet-topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 6px;
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.booklet-topic-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}

.teacher-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
}

/* A4 Fasikül Kapak Sayfası & İçindekiler */
.booklet-cover-sheet {
  min-height: 264mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8mm 6mm;
  border: 3px double #1e293b;
  border-radius: 10px;
}

.booklet-top-banner {
  text-align: center;
  padding: 14px 10px;
  background: #f8fafc;
  border: 1.5px solid #94a3b8;
  border-radius: 10px;
}

.booklet-school {
  font-size: 21px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.booklet-grade-pill {
  display: inline-block;
  margin: 8px 0;
  padding: 4px 14px;
  background: #dbeafe;
  border: 1px solid #2563eb;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  color: #1e3a8a;
}

.booklet-main-title {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  margin: 6px 0;
}

.booklet-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.booklet-student-card {
  border: 1.5px dashed #64748b;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
}

.booklet-field-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.booklet-toc-box h3 {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.booklet-toc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.booklet-toc-table th,
.booklet-toc-table td {
  border: 1px solid #94a3b8;
  padding: 6px 8px;
  text-align: left;
}

.booklet-toc-table th {
  background: #f1f5f9;
  font-weight: 800;
}

.booklet-cover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding-top: 10px;
  border-top: 1.5px solid #cbd5e1;
}

/* A4 Başarı Sertifikası */
.certificate-sheet {
  min-height: 264mm;
  padding: 6mm;
  border: 5px double #b45309;
  border-radius: 12px;
  background: #fffbeb;
  display: flex;
}

.certificate-inner-border {
  flex: 1;
  border: 2px dashed #d97706;
  border-radius: 8px;
  padding: 14mm 10mm;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.certificate-school {
  font-size: 16px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
}

.certificate-grade-tag {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  color: #92400e;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 16px;
  border-radius: 99px;
}

.certificate-title {
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.4px;
}

.certificate-student-block {
  width: 100%;
  margin: 8px 0;
}

.certificate-student-label {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 10px;
}

.certificate-student-line {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
}

.certificate-desc {
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
  color: #334155;
  max-width: 90%;
}

.certificate-math-icons {
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 16px;
  border-radius: 99px;
}

.certificate-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 16px;
  border-top: 1.5px solid #e2e8f0;
}

.cert-sign-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   MOBİL & AKILLI TAHTA UYUMLULUĞU (320px - 1024px)
   -------------------------------------------------------------------------- */
.drawer-backdrop {
  display: none;
}

.mobile-bottom-bar {
  display: none;
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .mobile-only {
    display: inline-flex;
  }

  .header-actions {
    display: none;
  }

  .sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw);
    max-height: 100vh;
    z-index: 60;
    box-shadow: -8px 0 25px rgba(15, 23, 42, 0.2);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s ease;
  }

  .sidebar-panel.open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
  }

  .drawer-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 55;
  }

  .preview-workspace {
    padding: 12px 8px calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .a4-sheet {
    width: 100%;
    min-height: auto;
    padding: 5mm;
  }

  .ws-header-top {
    flex-direction: column;
  }

  .ws-student-box {
    width: 100%;
    min-width: 0;
  }

  .ws-grid.cols-4,
  .ws-grid.cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 8px;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 480px) {
  .grade-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .grade-tab {
    flex: 1;
    padding: 6px 4px;
    font-size: 12.5px;
  }

  .ws-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .mc-options.cols-opt-3,
  .mc-options.cols-opt-2 {
    grid-template-columns: 1fr;
  }

  .ws-self-eval {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   YAZICI (A4 BASKI) KURALLARI — SIFIR TAŞMA, TAM SAYFA, NET BASKI
   -------------------------------------------------------------------------- */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .no-print {
    display: none !important;
  }

  .app-layout,
  .preview-workspace,
  .pages-container {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .a4-sheet {
    display: block !important;
    width: 100% !important;
    max-width: 194mm !important;
    height: auto !important;
    min-height: 277mm !important;
    padding: 0 !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-after: always;
    break-after: page;
    overflow: visible !important;
  }

  .a4-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .a4-inner-frame {
    display: block !important;
    width: 100% !important;
    min-height: 277mm !important;
    height: auto !important;
    padding: 4mm 5mm !important;
  }

  .ws-header {
    margin-bottom: 8px !important;
    padding-bottom: 5px !important;
  }

  .ws-student-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .ws-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 218mm !important;
    min-height: 218mm !important;
    padding: 4px 0 !important;
  }

  .ws-grid {
    flex: 1 !important;
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    gap: 7px 10px !important;
    align-items: stretch !important;
    align-content: stretch !important;
  }

  .ws-grid.cols-1 { grid-template-columns: 1fr !important; }
  .ws-grid.cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .ws-grid.cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
  .ws-grid.cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
  .ws-grid.cols-5 { grid-template-columns: repeat(5, 1fr) !important; }

  .q-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    border: 1px solid #64748b !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 6px 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .vertical-op {
    display: inline-flex !important;
    margin: 2px auto 2px !important;
  }

  .ws-footer {
    margin-top: 8px !important;
    padding-top: 5px !important;
  }
}
