/* self-hosted Baloo Bhaijaan 2 (was: fonts.googleapis.com) — variable, wght 500..800 */
/* arabic */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan2-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* vietnamese */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan2-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan2-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan2-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ═══════════════════════════════════════════════════════════════════
   كراسي · الصف — نفس ستايل كراسي: حدود 1.5–2px، ظلال مسطّحة صغيرة،
   شبكة مربعات باهتة، لن فير — بلا ليل.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #fff4dd;
  --card: #fffdf6;
  --ink: #221b10;
  --ink-2: rgba(34, 27, 16, 0.62);
  --ink-3: rgba(34, 27, 16, 0.4);
  --line: #221b10;
  --sun: #ffd43b;
  --sky: #74c0fc;
  --rose: #ffa8ce;
  --leaf: #69db7c;
  --violet: #d0bfff;
  --shadow-c: #221b10;
}
* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Baloo Bhaijaan 2", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.7;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(34, 27, 16, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 27, 16, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  min-height: 100dvh;
}
a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { background: var(--sun); }
:focus-visible { outline: 2px dashed var(--line); outline-offset: 3px; }
.mono { font-family: inherit; font-variant-numeric: tabular-nums; }

.page { max-width: 780px; margin: 0 auto; padding: 22px 18px 64px; }

/* ── masthead ─────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 20px;
}
.masthead-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.masthead-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  padding: 7px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: -4px 4px 0 var(--shadow-c);
}
.masthead-title { font-size: 28px; font-weight: 700; margin: 0; line-height: 1.25; }
.masthead-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.masthead-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ── أزرار ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--sun);
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 11px 22px;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: -4px 4px 0 var(--shadow-c);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:hover { transform: translate(2px, -2px); box-shadow: -6px 6px 0 var(--shadow-c); }
.btn:active { transform: translate(-2px, 2px); box-shadow: 0 0 0 var(--shadow-c); }
.btn--sky { background: var(--sky); }
.btn--card { background: var(--card); }
.btn--small { font-size: 13.5px; padding: 7px 15px; border-radius: 12px; box-shadow: -3px 3px 0 var(--shadow-c); }
.btn--danger { background: var(--rose); }
.btn .btn-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; flex: 0 0 auto; }

/* ── البطاقات الكبيرة (شمس/سماء) ─────────────────────────────────── */
.big-card {
  background: var(--sun);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px 20px;
  box-shadow: -6px 6px 0 var(--shadow-c);
  margin-bottom: 16px;
}
.big-card--sky { background: var(--sky); }
.big-card--card { background: var(--card); }
.big-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-icon { width: 21px; height: 21px; color: var(--ink); flex: 0 0 auto; }
.big-figure { font-size: 34px; font-weight: 700; line-height: 1.3; }
.big-sub { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }

/* ── chips ────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--card);
  box-shadow: -2px 2px 0 var(--shadow-c);
}
.chip--sun { background: var(--sun); }
.chip--rose { background: var(--rose); }
.chip--sky { background: var(--sky); }
.chip--leaf { background: var(--leaf); }
.chip--violet { background: var(--violet); }
.chip--plain { box-shadow: none; }

/* خطوات مصغّرة (بطاقة «كيف تعمل») */
.mini-steps { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.mini-steps p { margin: 5px 0; font-size: 14.5px; font-weight: 600; line-height: 1.8; }
.mini-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-inline-end: 8px;
  font-size: 13px;
  font-weight: 700;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  box-shadow: -2px 2px 0 var(--shadow-c);
  vertical-align: middle;
}

/* ── أقسام ────────────────────────────────────────────────────────── */
.section { margin-top: 34px; }
.section-head h2 {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 5px 16px;
  box-shadow: -3px 3px 0 var(--shadow-c);
}
.section-sub { margin: 2px 0 16px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }

/* ── خطوات (بلايم الصفحة الرئيسية) ────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: -4px 4px 0 var(--shadow-c);
}
.step-num {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  background: var(--sun);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: -2px 2px 0 0 var(--shadow-c);
}
.step--sky .step-num { background: var(--sky); }
.step--rose .step-num { background: var(--rose); }
.step-main { min-width: 0; flex: 1; }
.step-name { font-size: 16.5px; font-weight: 700; line-height: 1.5; }
.step-sub { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }

/* ── يوم وواجباته (صفحة القسم) ────────────────────────────────────── */
.day-group {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: -5px 5px 0 var(--shadow-c);
  margin-bottom: 16px;
  overflow: hidden;
}
.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px 12px;
  border-bottom: 1.5px solid var(--line);
}
.day-title { font-size: 17px; font-weight: 700; }
.entry {
  padding: 12px 16px 13px;
  border-top: 1.5px dashed rgba(34, 27, 16, 0.25);
}
.entry:first-child { border-top: none; }
.entry-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-topic { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.entry-hw { margin: 7px 0 0; font-size: 15.5px; font-weight: 700; line-height: 1.75; white-space: pre-line; }
.entry-covered { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: pre-line; }
.entry-materials { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.entry-note {
  margin-top: 9px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}
.day-empty { padding: 12px 16px; font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* فروض/اختبارات */
.test-item {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  box-shadow: -4px 4px 0 var(--shadow-c);
  margin-bottom: 12px;
}
.test-date {
  flex: 0 0 auto;
  text-align: center;
  min-width: 64px;
  background: var(--ink);
  color: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px 6px;
  box-shadow: -2px 2px 0 0 var(--shadow-c);
}
.test-date .td-day { font-size: 22px; font-weight: 700; line-height: 1.1; }
.test-date .td-month { font-size: 11px; font-weight: 600; opacity: 0.85; }
.test-main { min-width: 0; flex: 1; }
.test-name { font-size: 16px; font-weight: 700; line-height: 1.5; }

/* أرشيف مضغوط */
.archive-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1.5px dashed rgba(34, 27, 16, 0.25);
  font-size: 13.5px;
}
.archive-item:first-child { border-top: none; }
.archive-date { flex: 0 0 auto; color: var(--ink-2); font-weight: 600; }
.archive-text { min-width: 0; color: var(--ink-2); font-weight: 600; }

/* ── أدوات العنوان (زر طباعة ونشر) ───────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; }

/* ── نماذج الإدخال ───────────────────────────────────────────────── */
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}
.field .hint { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.input, .textarea {
  width: 100%;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  transition: box-shadow 0.06s ease;
}
.input:focus, .textarea:focus { outline: none; box-shadow: -3px 3px 0 var(--shadow-c); }
.textarea { min-height: 74px; resize: vertical; line-height: 1.7; }
.input--pin { letter-spacing: 0.35em; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: -5px 5px 0 var(--shadow-c);
}
.form-flash { margin-top: 12px; font-size: 14px; font-weight: 700; min-height: 22px; }
.form-flash--ok { color: #1a7f37; }
.form-flash--err { color: #c2252f; }

/* نتيجة إنشاء القسم */
.result-block {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: -4px 4px 0 var(--shadow-c);
  margin-bottom: 14px;
}
.result-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.result-value { font-size: 17px; font-weight: 700; word-break: break-all; direction: ltr; text-align: left; }
.result-value--big { font-size: 26px; letter-spacing: 0.25em; }
.copy-btn { margin-inline-start: 8px; }

.footer { margin-top: 46px; padding-top: 18px; border-top: 2px solid var(--line); }
.footer p { margin: 4px 0; font-size: 12.5px; color: var(--ink-3); font-weight: 600; line-height: 1.9; }

/* ── ورقة الطباعة (PDF) ──────────────────────────────────────────── */
.print-only { display: none; }
@media print {
  :root { --bg: #ffffff; }
  body {
    background: #fff;
    background-image: none;
    font-size: 13.5px;
  }
  @page { size: A4; margin: 11mm; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .page { max-width: none; padding: 0; }
  .masthead { padding: 0 0 10px; }
  .big-card, .day-group, .test-item, .step, .form-card, .section-head h2, .result-block {
    box-shadow: none !important;
    break-inside: avoid;
  }
  .print-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 6px;
    margin-bottom: 10px;
  }
  .print-head .ph-right { font-size: 12px; color: var(--ink-2); }
  .archive-item { padding: 4px 12px; }
  .day-group, .test-item { margin-bottom: 8px; }
  .entry { padding: 8px 16px 9px; }
}

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page { padding: 16px 14px 48px; }
  .big-card { box-shadow: -4px 4px 0 var(--shadow-c); }
  .big-figure { font-size: 26px; }
  .masthead-sub { display: none; }
  .masthead-logo { width: 48px; height: 48px; box-shadow: -3px 3px 0 var(--shadow-c); }
  .two-col { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
}
