/* تحسينات P0+P1 فوق ستايل الأداة الأصلي — بلا تغيير في الهوية أو الألوان الأساسية */

/* 2) اتجاه الأرقام دائماً يسار→يمين */
.blink-code, .stack .num, .row-code, .r-code, .rep-count bdi, #resultsInfo bdi { direction: ltr; unicode-bidi: isolate; }

/* 8) تباين أعلى بالحد الأدنى + أهداف لمس */
:root { --muted: #5b6b82; --ring: #b9c8e6; }
[data-theme="dark"] { --primary: #4a8bea; --ring: #2c4570; }
.icon-btn, .lang-btn { min-width: 38px; min-height: 38px; }
.mob-pill { min-height: 34px; }
.tree-chapter:focus-visible, .tree-cat:focus-visible, .row-btn:focus-visible, .mob-pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 600px) {
  .row-acts { gap: 2px; }
  .row-btn { padding: 9px; }
  .row-btn svg { width: 17px; height: 17px; }
  .icon-btn, .lang-btn { width: 38px; height: 38px; }
}
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 8px; }

/* حساب/سلسلة في الرأس */
.acct-btn { width: auto; padding: 0 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.acct-btn.on { border-color: var(--primary); color: var(--primary); }
.acct-btn .streak { font-weight: 800; }

/* 3) صف التصنيفات الفرعية على الجوال */
.mob-sub { padding-top: 0; }
.mob-sub .mob-pill { font-size: 12px; padding: 5px 12px; }

/* 6) تمييز الصف القادم من رابط مباشر */
.row.hl { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* 10) كود اليوم — بنفس بنية الصف */
.daycode { margin: 8px 0 4px; }
.daycode-row { border-color: var(--primary-600); background: var(--soft); flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
.daycode-lbl { font-size: 12px; font-weight: 800; color: var(--primary-700); white-space: nowrap; }
.daycode-row .row-acts { gap: 6px; }
@media (max-width: 600px) { .daycode-row .row-title { width: 100%; } }

/* 5) خيارات الصوت + العدّاد */
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 6px; }
.opt-lbl { font-size: 12px; color: var(--muted); margin-inline-end: 2px; }
.mob-pill.opt { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 12px; font-size: 12px; }
.rep-count { text-align: center; font-size: 22px; font-weight: 800; color: var(--primary-700); margin: 2px 0 4px; }
.rep-count .rep-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }

/* 11) الوميض الهادئ */
.fullscreen { background: var(--overlay); }
[data-theme="dark"] .fullscreen { background: rgba(10,18,30,.96); }
.blink-code { opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.blink-close { position: absolute; top: 12px; inset-inline-end: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ring); background: var(--card-bg); color: var(--primary); font-size: 26px; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.blink-bar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; max-width: calc(100vw - 20px); background: var(--card-bg); border: 1px solid var(--ring); border-radius: 14px; padding: 8px 12px; z-index: 2; }
.blink-count { font-weight: 800; color: var(--primary-700); font-size: 14px; margin-inline-end: 4px; }
.blink-hint { font-size: 11px; color: var(--muted); width: 100%; text-align: center; }

/* 18-قليل) حركة مخفّضة */
@media (prefers-reduced-motion: reduce) {
  .blink-code { transition: none; }
  .sound-viz .bar { transition: none; }
}

/* قاعدة الموقع: الخط كاليبري دائماً */
body, button, input, select, textarea, .row-title, .blink-code, .stack .num { font-family: Calibri, Carlito, 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif !important; }
