/* ركّز v66 — أداء وتجاوب «جدولي» + أيقونات الإجراءات
   1) ظهور فوري لعناصر جدولي (بلا حركة دخول) وتقليل كلفة التخطيط
   2) إخفاء زر «مساعد الجدول» على الهاتف واللوحي (يبقى على الحاسوب)
   3) عرض جدولي في الوضع العمودي والأفقي
   4) أزرار أيقونات: قلم (تعديل)، تشغيل (بدء المؤقت)، دائرة بداخلها صح (منجز) */

/* ---------- 1) أداء ---------- */
html body #view-schedule.active,
html body #view-schedule.active > * { animation: none !important; }
.schedule-page .sched-block { contain: layout style; transition: border-color .16s ease, box-shadow .16s ease; }
.schedule-page .sched-block:hover { transform: none; }
#view-schedule button,
#view-schedule .sched-tab,
#view-schedule .act-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.study-extra { display: contents; }

/* ---------- 4) أزرار الأيقونات ---------- */
.act-btn[disabled] { opacity: .45; cursor: not-allowed; }
.act-btn:focus-visible { outline: 3px solid rgba(128,128,128,.75); outline-offset: 2px; }
.act-btn.act-done { color: var(--text-muted); }
.act-btn.act-done .ic { stroke-width: 2.6; }
.act-btn.act-done.ok { color: var(--on-primary); }
.sched-block-actions { gap: .45rem !important; }
.sched-block-actions .act-btn { flex-shrink: 0; }
.sched-tpl-actions { align-items: center; }
.study-actions .act-btn { width: 2.2rem; height: 2.2rem; }
@media (pointer: coarse) {
  .sched-block-actions .act-btn,
  .sched-tpl-actions .act-btn,
  .study-actions .act-btn { width: 2.65rem; height: 2.65rem; }
  .sched-block-actions .act-btn .ic,
  .sched-tpl-actions .act-btn .ic,
  .study-actions .act-btn .ic { width: 1.2rem; height: 1.2rem; }
}

/* ---------- 2) زر مساعد الجدول: الحاسوب فقط ---------- */
@media (hover: none) and (pointer: coarse) {
  html body #sched-fab,
  html body #view-schedule .sched-fab,
  html body #sched-chat-panel { display: none !important; }
}

.sched-rotate66 { display:none; }
@media(max-width:600px){html body #view-schedule .sched-main{display:block;min-width:0;padding:.75rem .5rem 5rem}.sched-header{flex-wrap:wrap}.sched-header-actions{display:flex;flex-wrap:wrap;gap:.5rem}.sched-header-actions .btn{flex:1 1 auto}.sched-tabs{flex-wrap:wrap}.sched-timeline{min-width:0}}

/* الهاتف في الوضع الأفقي: تخطيط مضغوط واضح (الارتفاع قصير) */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  html body #view-schedule { max-width: none; }
  html body #view-schedule .sched-main {
    padding: .6rem max(1rem, env(safe-area-inset-right)) 1.2rem max(1rem, env(safe-area-inset-left));
  }
  html body .schedule-page .sched-header {
    display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between;
    gap: .8rem; min-height: 0; padding: .55rem .9rem; margin-bottom: .6rem; text-align: right; border-radius: 16px;
  }
  html body .schedule-page .sched-header > div:first-child { text-align: right; width: auto; flex: 1 1 auto; }
  html body .schedule-page .sched-header h2 { margin: 0; font-size: 1.15rem; }
  html body .schedule-page .sched-header p { display: none; }
  html body .schedule-page .sched-header-actions {
    display: flex !important; grid-template-columns: none; width: auto; margin: 0; gap: .4rem; flex: 0 0 auto;
  }
  html body .schedule-page .sched-header-actions .btn { width: auto; min-width: 0; padding: .4rem .8rem; white-space: nowrap; }
  html body .schedule-page .sched-tabs { margin: 0 auto .6rem !important; }
  html body .schedule-page .sched-day-nav { margin-bottom: .6rem; padding: .35rem .8rem; }
  html body .schedule-page .sched-block {
    grid-template-columns: 4rem minmax(0, 1fr) auto !important; gap: .7rem; padding: .6rem .8rem;
  }
  html body .schedule-page .sched-block > div:last-child { grid-column: auto !important; flex-wrap: nowrap; }
  html body .schedule-page .sched-block .t,
  html body .schedule-page .sched-block .title { font-size: .95rem; }
  html body .schedule-page .sched-load { margin: .4rem 0; padding: .55rem .8rem; }
  html body #sched-tpl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
