  :root {
    --emerald-deep: #0b4a33;
    --emerald-main: #0f5c40;
    --emerald-soft: #ecfdf5;
    --gold-main: #b78533;
    --gold-bright: #fbbf24;
    --gold-soft: #fffbeb;
    --red-err: #dc2626;
    --yellow-err: #ca8a04;
    --green-ok: #16a34a;
    --header-height: 215px;
    --overlay-alpha: 0.78;
    --brand-color: #0b4a33;
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-family: "Tajawal", sans-serif;
    background-color: #f6f7f5;
    color: #0f172a;
    direction: rtl;
    overflow-x: hidden;
  }

  .quran-font {
    font-family: "Amiri Quran", serif;
    line-height: 2.6;
  }

  /* الترويسة الرسمية وصورة المدرسة كخلفية واحدة */
  .official-header {
    position: relative;
    min-height: var(--header-height);
    background-color: var(--brand-color);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-bottom: 4px solid var(--gold-bright);
    transition: min-height 0.25s ease;
  }

  .official-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-color) 82%, transparent), rgba(15, 23, 42, 0.75));
    z-index: 1;
  }

  .header-content {
    position: relative;
    z-index: 2;
  }

  /* شريط الاختصارات السريعة */
  .shortcuts-ribbon {
    background: linear-gradient(90deg, var(--brand-color), color-mix(in srgb, var(--brand-color) 75%, white));
    border-bottom: 2px solid #d97706;
  }

  .shortcut-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(253, 230, 138, 0.45);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
  }

  .shortcut-pill:hover, .shortcut-pill.active-surah {
    background: #fbbf24;
    color: #0f172a;
    border-color: #fde68a;
  }

  .kbd-tag {
    background: rgba(15, 23, 42, 0.55);
    color: #fde68a;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
  }

  .shortcut-pill:hover .kbd-tag {
    background: #0f172a;
    color: #fbbf24;
  }

  /* إطار الكلمة والآية */
  .ayah-card-frame {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  }

  .word-chip {
    display: inline-block;
    padding: 3px 9px;
    margin: 2px 3px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.18s ease;
  }

  .word-chip:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
  }

  .word-chip.active-word-box {
    border-color: #15803d;
    background: #f0fdf4;
    color: #0b4a33;
  }

  .underline-red {
    border-bottom: 4px solid #dc2626 !important;
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    font-weight: 800;
  }

  .underline-yellow {
    border-bottom: 4px solid #ca8a04 !important;
    background-color: #fefce8 !important;
    color: #854d0e !important;
    font-weight: 800;
  }

  .underline-green {
    border-bottom: 4px solid #16a34a !important;
    background-color: #f0fdf4 !important;
    color: #166534 !important;
    font-weight: 800;
  }

  .error-circle {
    border: 3px solid #dc2626 !important;
    border-radius: 999px !important;
    background: #fff1f2 !important;
    color: #991b1b !important;
  }

  .ayah-range-quick { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .55rem; padding: .55rem .7rem; border: 1px solid #d7eee4; border-radius: 14px; background: #f8fffb; }
  .ayah-range-title { color: #07553d; font-size: .78rem; font-weight: 900; }
  .range-chip { border: 1px solid #b9dfcf; background: #fff; color: #07553d; border-radius: 999px; padding: .3rem .65rem; font-size: .75rem; font-weight: 900; cursor: pointer; }
  .range-chip:hover, .range-chip.active { background: #0b6b4b; color: #fff; }
  .analysis-legend { display: flex; flex-wrap: wrap; gap: .6rem 1rem; padding: .55rem .7rem; border-radius: 12px; background: #f8fafc; border: 1px dashed #cbd5e1; color: #334155; font-size: .75rem; font-weight: 800; }
  .legend-item { display: inline-flex; align-items: center; gap: .3rem; }
  .legend-line { display: inline-block; width: 20px; height: 4px; border-radius: 5px; }
  .legend-red { background: #dc2626; }
  .legend-yellow { background: #ca8a04; }
  .legend-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; }
  .legend-circle-red { border: 2px solid #dc2626; background: #fff1f2; }

  .ayah-number-ornament {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b78533;
    font-family: "Amiri Quran", serif;
    font-size: 1.45rem;
    padding: 0 8px;
  }

  /* الأزرار الثلاثة الكبيرة المطابقة للصورة */
  .action-btn-primary-green {
    width: 100%;
    background: var(--brand-color);
    color: #ffffff;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(11, 74, 51, 0.22);
    transition: transform 0.15s ease, background 0.15s ease;
    cursor: pointer;
  }
  .action-btn-primary-green:hover {
    filter: brightness(.88);
    transform: translateY(-1px);
  }

  .action-btn-slow-soft {
    width: 100%;
    background: #edf8f3;
    color: #0b4a33;
    border: 1.5px solid #bfe3d2;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 800;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s ease, background 0.15s ease;
    cursor: pointer;
  }
  .action-btn-slow-soft:hover {
    background: #def2e9;
  }

  .action-btn-gold-mic {
    width: 100%;
    background: #b78533;
    color: #ffffff;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(183, 133, 51, 0.25);
    transition: transform 0.15s ease, background 0.15s ease;
    cursor: pointer;
  }
  .action-btn-gold-mic:hover {
    background: #9f7126;
    transform: translateY(-1px);
  }

  /* نبض الميكروفون */
  @keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
  }

  .mic-live-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #16a34a;
    animation: pulseRing 1.6s infinite;
  }

  .hidden-sec {
    display: none !important;
  }

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


.student-advanced-panel { transition: opacity 0.2s ease; }
.student-more-btn { width: 100%; margin-top: 0.5rem; border: 1px dashed #94a3b8; background: #f8fafc; color: #334155; border-radius: 12px; padding: 9px 12px; font-weight: 800; cursor: pointer; }
.student-more-btn:hover { background: #eef2f7; }
.teacher-voice-card { display: flex; align-items: flex-start; gap: 12px; border: 2px solid #f1df9e; background: linear-gradient(135deg, #fffdf2, #fffbeb); border-radius: 18px; padding: 14px; box-shadow: 0 3px 12px rgba(120, 83, 18, .08); }
.teacher-voice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #fef3c7; font-size: 1.35rem; flex: 0 0 auto; }
@media (max-width: 640px) { .teacher-voice-card { padding: 12px; } .student-more-btn { font-size: .85rem; } }

.compact-options-btn { display: none; }
.compact-select { width: 100%; min-height: 42px; border: 2px solid #0f5c40; border-radius: 13px; background: #ecfdf5; color: #064e3b; padding: 9px 12px; font-size: .9rem; font-weight: 900; outline: none; cursor: pointer; }
.compact-select:focus { box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }

#adminTabSelect { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.admin-field-label { display: block; margin-bottom: 4px; color: #334155; font-size: .75rem; font-weight: 800; }
.admin-compact-field { width: 100%; border: 1px solid #cbd5e1; border-radius: 11px; background: #fff; padding: 8px 10px; color: #0f172a; font-size: .85rem; font-weight: 700; outline: none; }
.admin-compact-field:focus { border-color: #0f5c40; box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }

@media (max-width: 640px) {
  #sec_controls { padding: 12px !important; }
  #sec_controls > .grid:first-of-type { gap: 6px; margin-bottom: 10px; }
  #modeBtn_listen, #modeBtn_self_a, #modeBtn_self_b { padding: 10px 12px; border-radius: 14px; }
  #modeBtn_listen > div:last-child, #modeBtn_self_a > div:last-child, #modeBtn_self_b > div:last-child { display: none; }
  #appStatusPanel { margin-bottom: 8px !important; padding: 8px 10px !important; font-size: .72rem; line-height: 1.6; }
  .compact-options-btn { display: flex; width: 100%; align-items: center; justify-content: center; margin: 0 0 8px; padding: 8px 10px; border: 1px dashed #94a3b8; border-radius: 11px; background: #f8fafc; color: #334155; font-size: .78rem; font-weight: 800; cursor: pointer; }
  #studentControlGrid { gap: 8px; }
  .compact-select { min-height: 40px; padding: 8px 10px; font-size: .82rem; }
  #studentControlGrid .compact-extra { display: none; }
  #sec_controls.compact-options-open #studentControlGrid .compact-extra { display: block; }
  #sec_controls.compact-options-open #studentControlGrid { margin-bottom: 2px; }
  #sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 { margin-top: 10px; padding-top: 10px; }
}

/* تجربة الطفل المختصرة: خطوة واحدة، زر واضح، وصوت بلا إزعاج */
:root { --child-green: #0b6b4b; --child-mint: #effcf5; --child-gold: #f5b942; }
body { background: #f4faf7; }
.official-header.child-header { min-height: 112px; background: linear-gradient(135deg, #07553d, #0b8060); border-bottom: 3px solid var(--child-gold); }
.child-header::before { display: none; }
.child-header .header-content { padding-top: 1rem; padding-bottom: 1rem; }
.child-header h1 { letter-spacing: -.02em; }
.child-header .bg-white\/10 { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.child-hidden-tools { display: none !important; }
#sec_ticker { border-radius: 18px; padding: .8rem 1rem; box-shadow: 0 4px 14px rgba(11,107,75,.08); }
#sec_ticker #topSyncTicker { min-height: 34px; font-size: 1.25rem; }
#sec_controls { border: 2px solid #d7eee4; border-radius: 22px; padding: 1rem; box-shadow: 0 6px 20px rgba(11,107,75,.06); }
#sec_controls .compact-mode-select { margin-bottom: .7rem; }
#sec_controls .compact-mode-select label { color: var(--child-green); font-size: .82rem; }
#modeSelect, #workspaceSelect, #surahSelect, #reciterSelect, #studentSelect { min-height: 46px; border-radius: 14px; border-width: 2px; border-color: #b9dfcf; background: #fbfffd; }
#studentControlGrid { gap: .65rem; }
#studentControlGrid label { color: #356354; }
#studentControlGrid .compact-extra { display: none; }
#compactOptionsBtn { display: none; }
#sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 { justify-content: center; border-top: 0; padding-top: .25rem; }
#sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 button { min-height: 44px; border-radius: 14px; }
#sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 button:nth-child(n+2) { display: inline-flex !important; }
.ayah-card-frame { border: 2px solid #d7eee4; border-radius: 24px; box-shadow: 0 8px 24px rgba(11,107,75,.07); }
#focusedAyahDisplay { min-height: 116px; background: #fffdf5; border-color: #f4df9c; }
#quickMatchSignal { margin-bottom: .8rem; }
.action-btn-primary-green, .action-btn-gold-mic { min-height: 52px; border-radius: 16px; font-size: 1.02rem; }
.action-btn-slow-soft { min-height: 46px; border-radius: 16px; }
#btnHearSheikhSlow { display: flex; }
.teacher-voice-card { border-radius: 18px; }
.student-advanced-panel { border-radius: 20px; }
#studentAnalysisPanel.hidden, #studentLabPanel.hidden { display: none; }
#studentAudioPlaybackBox { border-radius: 16px; }
#sec_records, #workspace_notebook { border-radius: 20px; }
@media (max-width: 640px) {
  .official-header.child-header { min-height: 96px; }
  .child-header .header-content { padding: .7rem .85rem; gap: .55rem; }
  .child-header .header-content > div:first-child { font-size: .68rem; line-height: 1.35; }
  .child-header h1 { font-size: 1.45rem; }
  .child-header p { font-size: .72rem; }
  .child-header .bg-white\/10 { padding: .4rem .5rem; }
  .child-header .bg-white\/10 button { margin-top: 0; padding: .35rem .55rem; font-size: .68rem; }
  main#mainSectionsContainer { padding: .7rem .65rem 1.2rem; gap: .7rem; }
  #sec_ticker { padding: .65rem .75rem; }
  #sec_ticker #topSyncTicker { font-size: 1.05rem; }
  #sec_controls { padding: .8rem; }
  #modeSelect, #workspaceSelect, #surahSelect, #reciterSelect, #studentSelect { min-height: 44px; font-size: .86rem; }
  .action-btn-primary-green, .action-btn-gold-mic { min-height: 50px; font-size: .95rem; }
}

/* شاشة الطالب فائقة الاختصار: الآية أولاً، ثم طريقة التعلم والقارئ والسورة */
#sec_ticker { display: none !important; }
#mainSectionsContainer { padding-top: .75rem !important; }
#sec_controls { padding: .75rem !important; }
#sec_controls #appStatusPanel { display: none !important; }
#studentControlGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem !important; }
#studentControlGrid #rosterSelectWrap,
#studentControlGrid #freeNameWrap,
#studentControlGrid #studentClassWrap { display: block !important; }
#studentControlGrid #fromAyahWrap,
#studentControlGrid #toAyahWrap { display: block !important; }
  #compactOptionsBtn { display: flex !important; width: 100%; align-items: center; justify-content: center; margin: .35rem 0 .55rem; padding: .45rem .7rem; border: 1px dashed #94a3b8; border-radius: 11px; background: #f8fafc; color: #334155; font-size: .78rem; font-weight: 800; cursor: pointer; }
.school-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; background: rgba(255,255,255,.88); padding: 3px; }
.school-logo-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 16px; background: white; border: 2px solid #0b4a33; padding: 4px; }
.signature-preview { width: 170px; height: 70px; object-fit: contain; border: 1px dashed #64748b; border-radius: 10px; background: white; padding: 4px; }
.stamp-preview { width: 110px; height: 110px; object-fit: contain; border-radius: 50%; border: 2px dashed #64748b; background: white; padding: 5px; }
#sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 { margin-top: .45rem !important; padding-top: 0 !important; }
#sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 button { min-height: 40px !important; padding: .45rem .75rem !important; }
#sec_controls > .flex.flex-wrap.items-center.gap-2.mt-3\.5 button:nth-child(n+2) { display: inline-flex !important; }
#focusedAyahDisplay {
  min-height: 132px !important;
  padding: 1.15rem .75rem !important;
  line-height: 2.15 !important;
  direction: rtl;
  text-align: center;
  font-variant-ligatures: contextual;
  text-rendering: optimizeLegibility;
}
#focusedAyahDisplay .word-chip { margin: .12rem .18rem; }
.student-more-btn { margin-top: .55rem; border-color: #b9dfcf; background: #effcf5; color: #07553d; }
.student-advanced-panel { margin-top: .65rem; }
#audioComparisonCard { display: none !important; }
#allRangeAyahsContainer { display: none !important; }
.official-header.child-header { min-height: 78px !important; }
.child-header .header-content { padding-top: .55rem !important; padding-bottom: .55rem !important; gap: .5rem !important; }
.child-header h1 { font-size: 1.35rem !important; }
.child-header p { display: none; }
.mastery-status-circle { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; min-height: 28px; padding: .25rem .55rem; border: 2px solid #cbd5e1; border-radius: 999px; background: #f8fafc; color: #64748b; font-size: .7rem; font-weight: 900; }
.mastery-status-circle.mastered { min-width: 66px; min-height: 66px; border: 4px solid #000; background: #000; color: #fff; box-shadow: 0 0 0 5px rgba(0,0,0,.12), 0 0 18px rgba(245,185,66,.55); font-size: .8rem; }
.mastery-student-badge { display: block; width: fit-content; margin-top: .5rem; padding: .45rem 1rem; border: 3px solid #cbd5e1; border-radius: 999px; background: #f8fafc; color: #64748b; font-size: .9rem; font-weight: 900; }
.mastery-student-badge.mastered { border-color: #16a34a; background: #dcfce7; color: #166534; box-shadow: 0 0 0 5px rgba(34,197,94,.14); font-size: 1.05rem; }
.color-preset { border: 1px solid #cbd5e1; border-radius: 999px; padding: .18rem .45rem; color: white; font-size: .62rem; font-weight: 900; cursor: pointer; }
.color-green { background: #0b4a33; }.color-red { background: #b91c1c; }.color-blue { background: #1d4ed8; }
.mastery-celebration { position: relative; overflow: hidden; margin: -.35rem 0 .8rem; padding: .85rem 1rem; text-align: center; border: 2px solid #f2c94c; border-radius: 18px; background: linear-gradient(135deg, #fffbea, #ecfdf5); color: #07553d; }
.mastery-stars { position: relative; z-index: 1; color: #d49b16; letter-spacing: .35rem; font-size: 1.35rem; text-shadow: 0 1px 0 #fff; }
.mastery-balloons { position: absolute; inset: 0; display: flex; justify-content: space-around; pointer-events: none; opacity: .75; }
.mastery-balloons span { font-size: 1.6rem; animation: floatBalloon 2.6s ease-in-out infinite; }
.mastery-balloons span:nth-child(2) { animation-delay: .35s; }
.mastery-balloons span:nth-child(3) { animation-delay: .7s; }
.mastery-celebration > :not(.mastery-balloons) { position: relative; z-index: 1; }
@keyframes floatBalloon { 0%,100% { transform: translateY(16px); } 50% { transform: translateY(-4px); } }
@media (max-width: 640px) {
  #studentControlGrid { grid-template-columns: 1fr; }
  #studentControlGrid > div:has(#surahSelect), #studentControlGrid > div:has(#reciterSelect) { display: block !important; }
  #modeSelect, #surahSelect, #reciterSelect, #fromAyahInput, #toAyahInput { min-height: 40px !important; font-size: .8rem !important; }
  #focusedAyahDisplay { min-height: 118px !important; font-size: 1.55rem !important; }
}

/* إعادة تصميم الواجهة: بطاقة هادئة، تباين واضح، ولمسات مناسبة للطفل */
:root {
  --brand-color: #0b4a33;
  --surface: #ffffff;
  --surface-soft: #f4faf7;
  --ink: #16312a;
  --muted: #5d746d;
  --line: #d7e8e0;
  --gold-bright: #f5c451;
  --radius-lg: 22px;
  --shadow-soft: 0 10px 30px rgba(11, 74, 51, .08);
}

body {
  background: linear-gradient(180deg, #f6fbf8 0%, #eef7f3 52%, #f8fbfa 100%);
  color: var(--ink);
}

.official-header {
  min-height: 150px;
  border-bottom-width: 3px;
  background-image: linear-gradient(135deg, var(--brand-color), #123d35 68%, #244e43);
}

.official-header::before { background: linear-gradient(135deg, rgba(3, 45, 31, .16), rgba(4, 25, 20, .38)); }
.header-content { padding-top: 18px !important; padding-bottom: 18px !important; }
.header-content > div:first-child { max-width: 230px; }
#platformMainTitle { letter-spacing: -.03em; text-shadow: 0 2px 0 rgba(0,0,0,.12); }
#platformSubTitle { opacity: .9; }

.shortcuts-ribbon {
  background: #103f31;
  border-bottom: 1px solid rgba(245,196,81,.55);
}
.shortcuts-ribbon .shortcut-pill { padding: 6px 10px; font-size: .76rem; }

main#mainSectionsContainer { max-width: 1080px; padding-top: 18px; }
#workspace_recitation { gap: 18px; }
#sec_ticker {
  background: linear-gradient(135deg, #0b4a33, #11694a);
  border-right-width: 6px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
#sec_controls, .ayah-card-frame, #sec_records, #studentAnalysisPanel, #studentLabPanel {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
#sec_controls { background: rgba(255,255,255,.94); }
#appStatusPanel { border-radius: 14px; background: #f0f9f5; border-color: #cce9da; color: #164d3a; }
.compact-options-btn, .compact-select {
  border-radius: 14px;
  border: 1px solid #b8d8ca;
  background: #f4fbf7;
  color: #164d3a;
  font-weight: 900;
  min-height: 42px;
}
.compact-options-btn:hover, .compact-select:hover { background: #e4f4ec; border-color: #7bb99d; }
#studentControlGrid label { color: #49665c; }
#studentControlGrid select, #studentControlGrid input {
  min-height: 42px;
  border-color: #c7ddd4;
  border-radius: 13px;
  color: #173a2f;
  background: #fbfefd;
}
#studentControlGrid select:focus, #studentControlGrid input:focus, textarea:focus {
  outline: 3px solid rgba(245,196,81,.32);
  border-color: #2e8b68;
}
#studentMasteryBadge, .mastery-status-circle { box-shadow: 0 4px 14px rgba(22, 163, 74, .1); }

#sec_quran .ayah-card-frame { background: #fffef9; }
#currentAyahText, .quran-font { color: #1d332d; }
#sec_quran .action-btn-primary-green, #sec_quran .action-btn-gold-mic, #sec_quran .action-btn-slow-soft { min-height: 48px; border-radius: 15px; }
#sec_quran button, #sec_controls button { transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; }
#sec_quran button:hover, #sec_controls button:hover { transform: translateY(-1px); }

/* لوحة المعلم أكثر هدوءًا وأوضح في الهاتف */
#adminModal { backdrop-filter: blur(7px); }
#adminModal > div, #adminDashboardContent { border-radius: 24px !important; border: 1px solid var(--line) !important; box-shadow: 0 18px 60px rgba(6, 49, 35, .2) !important; }
#adminDashboardContent input, #adminDashboardContent select, #adminDashboardContent textarea { border-radius: 12px; border-color: #c7ddd4; min-height: 40px; }
#adminDashboardContent button { border-radius: 12px; }

@media (max-width: 640px) {
  .official-header { min-height: 128px; }
  .header-content { gap: 10px !important; padding: 12px 14px !important; }
  .header-content > div:first-child { display: none; }
  .header-content > div:nth-child(2) { min-width: 0 !important; flex-basis: 58%; }
  .header-content > div:last-child { padding: 8px 10px !important; flex: 1; min-width: 132px; }
  #platformMainTitle { font-size: 1.45rem !important; }
  #platformSubTitle { font-size: .72rem !important; }
  #supervisorText { font-size: .72rem !important; }
  #supervisorText span { display: inline !important; }
  .shortcuts-ribbon { display: none; }
  main#mainSectionsContainer { padding: 12px 10px 24px; }
  #sec_ticker { padding: 12px !important; }
  #topSyncTicker { min-height: 40px; font-size: 1.15rem !important; }
  #sec_controls { padding: 12px !important; }
  #studentControlGrid { gap: 8px !important; }
  #studentControlGrid > div { min-width: 0; }
  #sec_controls > div:last-child { gap: 6px; }
  #sec_controls > div:last-child button { flex: 1 1 44%; min-height: 42px; padding: 8px 9px !important; }
  #sec_controls > div:last-child button:last-child { flex-basis: 100%; margin-right: 0 !important; }
  .ayah-card-frame { padding: 14px !important; }
  #currentAyahText { font-size: 1.55rem !important; line-height: 2.25 !important; }
  .action-btn-primary-green, .action-btn-slow-soft, .action-btn-gold-mic { min-height: 46px; }
  #adminModal > div { width: calc(100vw - 18px) !important; max-height: 94vh; border-radius: 20px !important; }
}

@media (min-width: 641px) {
  #sec_controls { padding: 20px !important; }
  #sec_quran .ayah-card-frame { padding: 28px !important; }
}
