/* مُستخرَج من student-session.html (كتلة <style> رقم 1، الجزء 2 من 2) — منقولٌ حرفيّاً، وموضعُ وسمَي الجزأين في الصفحة هو موضعُ الكتلة نفسُه (ترتيبُ التتالي كما كان). */
    /* و٣ — طباعةُ الآية: نُخفي عناصرَ الواجهةِ ونُظهِرُ نصَّ الآيةِ بخطٍّ مقروءٍ على الورقة. */
    @media print {
      body { background: #fff !important; color: #000 !important; }
      body * { visibility: hidden !important; }
      .quran-frame, .quran-frame * { visibility: visible !important; }
      .quran-frame {
        position: absolute; inset: 0; margin: auto; padding: 24px !important;
        background: #fff !important; border: none !important;
      }
    }

    .feedback {
      min-height: 36px;
      margin: 0;
      text-align: center;
      font-weight: 800;
      font-size: 1.15rem;
      color: #0f5b48;
    }

    .feedback.ok { color: var(--ok); }
    .feedback.warn { color: var(--warn); }
    .feedback.err { color: var(--err); }

    .mic-zone {
      display: grid;
      justify-items: center;
      gap: 8px;
    }

    .mic-pointer {
      display: grid;
      justify-items: center;
      gap: 2px;
      color: #0f997f;
      font-weight: 900;
      animation: micPointerFloat 1.25s ease-in-out infinite;
    }

    .mic-pointer[hidden] {
      display: none;
    }

    .mic-pointer svg {
      width: 54px;
      height: 54px;
      fill: currentColor;
      filter: drop-shadow(0 8px 12px rgba(15, 153, 127, 0.22));
    }

    .mic-btn {
      width: min(220px, 66vw);
      aspect-ratio: 1;
      border-radius: 50%;
      border: 0;
      cursor: pointer;
      display: grid;
      place-items: center;
      color: #fff;
      background: radial-gradient(circle at 30% 30%, #18c8a0, #0f997f);
      box-shadow: 0 16px 40px rgba(15, 153, 127, 0.34);
      transition: transform .15s ease, filter .2s ease;
    }

    .mic-btn:active { transform: scale(.98); }
    .mic-btn:disabled { opacity: .5; cursor: not-allowed; }

    .mic-btn.child-action-ready {
      animation: childMicGlow 1.9s ease-in-out infinite;
      box-shadow: 0 18px 48px rgba(15, 153, 127, 0.38), 0 0 0 8px rgba(23, 184, 145, 0.12);
    }

    .mic-btn svg {
      width: min(84px, 28vw);
      height: min(84px, 28vw);
      fill: currentColor;
    }

    .mic-btn.recording {
      animation: pulse 2s infinite;
    }

    .mic-btn.processing {
      background: radial-gradient(circle at 30% 30%, #7aa9ff, #3e6ac4);
      box-shadow: 0 16px 40px rgba(62, 106, 196, 0.3);
    }

    .mic-btn.success {
      background: radial-gradient(circle at 30% 30%, #3fcb86, #1a8850);
    }

    .mic-btn.retry {
      background: radial-gradient(circle at 30% 30%, #e39460, #ba6632);
    }

    .mic-state {
      min-height: 24px;
      font-size: 1rem;
      font-weight: 800;
      color: #215849;
      text-align: center;
    }

    .recording-countdown {
      min-height: 24px;
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(15, 153, 127, 0.1);
      color: #0d5c4a;
      font-size: 0.95rem;
      font-weight: 900;
      text-align: center;
    }

    .recording-countdown.warning {
      background: rgba(186, 102, 50, 0.14);
      color: #9a4d20;
    }

    .recording-countdown[hidden] {
      display: none;
    }

    .actions {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .actions.welcome-actions {
      width: 100%;
    }

    .btn {
      border: 1px solid #bfe6d9;
      background: #effcf7;
      color: #0d5c4a;
      border-radius: 14px;
      padding: 10px 14px;
      /* هدفُ لمسٍ ≥ ٤٤px لأصابعِ الأطفال (WCAG 2.5.5): كان الارتفاعُ ~٤٠px
         بلا حدٍّ أدنى، فتخطئ الأصابعُ أزرارَ الشهادةِ وإعادةِ المحاولة. */
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 1rem;
      font-weight: 800;
      cursor: pointer;
    }

    .btn.main {
      background: linear-gradient(135deg, #12a888, #0f997f);
      border-color: #0f997f;
      color: #fff;
    }

    .btn:disabled {
      opacity: .55;
      cursor: not-allowed;
    }

    .debug-panel {
      position: fixed;
      inset-inline: 16px;
      bottom: 16px;
      z-index: 20;
      display: grid;
      justify-items: center;
      gap: 8px;
      pointer-events: none;
    }

    .debug-panel[hidden] {
      display: none;
    }

    .debug-panel .btn,
    .debug-copy-status {
      pointer-events: auto;
      box-shadow: 0 10px 28px rgba(5, 33, 22, 0.16);
    }

    .debug-copy-status {
      max-width: min(560px, 100%);
      border-radius: 12px;
      padding: 8px 12px;
      background: rgba(255, 255, 255, 0.94);
      color: #0d5c4a;
      font-weight: 800;
      text-align: center;
    }

    .debug-copy-status.err {
      color: var(--err);
    }

    #welcomeStartBtn {
      width: min(560px, 100%);
      padding: 16px 20px;
      font-size: clamp(1.28rem, 3.3vw, 1.75rem);
      font-weight: 900;
      border-radius: 18px;
      box-shadow: 0 12px 26px rgba(15, 153, 127, 0.28);
      letter-spacing: .2px;
    }

    .success-star {
      font-size: clamp(4.5rem, 11vw, 6.5rem);
      line-height: 1;
      text-align: center;
    }

    .success-copy {
      text-align: center;
      color: #0d5c4a;
      font-size: 1.2rem;
      font-weight: 800;
      margin: 0;
    }

    /* و٢ — مؤشّرُ التحميل في شاشةِ الترحيب (لجنةُ تجربةِ الطفل ٢٠٢٦-٠٩): بدل «--» صامت. */
    .welcome-loading {
      display: flex; flex-direction: column; align-items: center; gap: 12px;
      padding: 32px 12px; text-align: center;
    }
    .welcome-loading-spinner {
      width: 44px; height: 44px; border-radius: 50%;
      border: 4px solid rgba(15,153,127,0.18);
      border-top-color: #0f997f;
      animation: welcomeSpin 900ms linear infinite;
    }
    .welcome-loading-text { color: #0d5c4a; font-weight: 800; font-size: 1.05rem; }
    @keyframes welcomeSpin { to { transform: rotate(360deg); } }
    @media (prefers-reduced-motion: reduce) {
      .welcome-loading-spinner { animation-duration: 2.4s; }
    }

    /* ت٦ — مؤشّرُ تقدّمِ الآيات (لجنةُ تجربةِ الطفل ٢٠٢٦-٠٩): شريطُ نجومٍ لطيفٌ يُريحُ
       الطفلَ برؤيةِ التقدّمِ داخلَ المهمّة، بلا نسبٍ مئويّة. */
    .ayah-progress {
      display: flex; flex-direction: column; align-items: center; gap: 8px;
      margin: 0 auto 14px; padding: 10px 14px;
      background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,253,239,0.75));
      border: 1px solid rgba(212,175,55,0.35); border-radius: 14px;
      box-shadow: 0 6px 18px rgba(160,120,20,0.10);
      max-width: min(100%, 520px);
    }
    .ayah-progress-stars { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
    .ayah-progress-stars .star {
      width: 18px; height: 18px; display: inline-block; line-height: 1;
      color: #d1d5db; transition: color 180ms ease, transform 180ms ease;
    }
    .ayah-progress-stars .star.done { color: #f59e0b; }
    .ayah-progress-stars .star.current { color: #10b981; transform: scale(1.15); }
    .ayah-progress-label { font-size: 0.95rem; font-weight: 800; color: #5b4a1f; letter-spacing: 0.2px; }
    @media (max-width: 480px) {
      .ayah-progress-stars .star { width: 15px; height: 15px; }
      .ayah-progress-label { font-size: 0.85rem; }
    }

    .cycle-celebration {
      display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
      margin: 0 auto 14px; padding: 14px 16px; max-width: min(100%, 520px);
      background: linear-gradient(135deg, #fffbeb, #fef3c7);
      border: 2px solid rgba(212,175,55,0.55); border-radius: 16px;
      box-shadow: 0 10px 26px rgba(160,120,20,0.18);
      animation: cycleCelebrationIn 360ms ease-out;
    }
    .cycle-celebration-title { font-size: 1.2rem; font-weight: 900; color: #7c5a10; }
    .cycle-celebration-body { font-size: 1rem; font-weight: 700; color: #5b4a1f; }
    @keyframes cycleCelebrationIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    @media (prefers-reduced-motion: reduce) { .cycle-celebration { animation: none; } }

    /* ⭐ شهادةُ إتقانِ السورة (لجنةُ تجربةِ الطفل ٢٠٢٦-٠٩) */
    .cert-wrap { margin: 22px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
    .cert-card {
      width: 100%; max-width: 420px; aspect-ratio: 1 / 1.32;
      background: linear-gradient(160deg, #fffdf6 0%, #fdf6e3 55%, #faedcf 100%);
      border: 2px solid #d4af37; border-radius: 16px;
      box-shadow: 0 14px 40px rgba(160, 120, 20, 0.22), inset 0 0 0 6px rgba(212, 175, 55, 0.14);
      padding: 22px; box-sizing: border-box; position: relative; overflow: hidden;
    }
    .cert-inner {
      height: 100%; border: 1px solid rgba(184, 134, 11, 0.55); border-radius: 12px;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      text-align: center; gap: 10px; padding: 16px;
    }
    .cert-brand { font-family: "KFGQPC Hafs", "Amiri Quran", serif; font-size: 2rem; font-weight: 800; color: #0d5c4a; letter-spacing: 1px; }
    .cert-title { font-size: 1.15rem; font-weight: 800; color: #b8860b; }
    .cert-rule { width: 64px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #d4af37, transparent); }
    .cert-lead { font-size: 0.95rem; color: #5b4a1f; font-weight: 700; }
    .cert-name { font-size: 1.7rem; font-weight: 900; color: #0f3d33; line-height: 1.2; word-break: break-word; }
    .cert-surah { font-family: "KFGQPC Hafs", "Amiri Quran", serif; font-size: 1.9rem; font-weight: 800; color: #114b3f; }
    .cert-parent { font-size: 0.88rem; color: #5b4a1f; font-weight: 600; margin-top: 2px; }
    .cert-stats { font-size: 0.82rem; color: #7a6a3a; font-weight: 600; line-height: 1.6; white-space: pre-line; margin-top: 4px; }
    .cert-date { font-size: 0.82rem; color: #7a6a3a; font-weight: 700; margin-top: 2px; }
    .cert-seal { margin-top: 4px; }
    .cert-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
    @media print {
      body * { visibility: hidden !important; }
      #surahCertificate, #surahCertificate * { visibility: visible !important; }
      #surahCertificate { position: absolute; inset: 0; margin: 0 auto; padding: 24px; }
      .cert-actions { display: none !important; }
    }

    @keyframes pulse {
      0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
      70% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
      100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
    }

    @keyframes childMicGlow {
      0%, 100% {
        transform: scale(1);
        box-shadow: 0 18px 48px rgba(15, 153, 127, 0.36), 0 0 0 6px rgba(23, 184, 145, 0.1);
      }
      50% {
        transform: scale(1.035);
        box-shadow: 0 22px 56px rgba(15, 153, 127, 0.46), 0 0 0 14px rgba(23, 184, 145, 0.05);
      }
    }

    @keyframes micPointerFloat {
      0%, 100% { transform: translateY(-2px); opacity: .88; }
      50% { transform: translateY(7px); opacity: 1; }
    }

    @media (max-width: 760px) {
      .view { padding: 14px; }
      .quran-frame { padding: 20px 12px; }
      .ayah { min-height: 150px; gap: 7px; }
      #welcomeStartBtn {
        width: 100%;
        font-size: 1.2rem;
        padding: 14px 16px;
      }
    }
