/* منظّمي — الشاشات الخمس من لوحة التصميم حرفياً (الرئيسية، صفحة المادة، لوح إجراءات الملف، الحركة، أسبوعك)
   وما يلزم ليلبس الموقع كله الشكل نفسه على الجوال: لا ترويسة علوية، عنوان كبير، شريط سفلي عائم بخمس خانات.
   قيم نظام التصميم فقط (css/base.css). الحركة transform/opacity/stroke-dashoffset. */

/* ══ الهيكل على الجوال: iOS بلا ترويسة؛ البحث والإضافة والأقسام الأخرى في «المزيد» و«إضافة» ══ */
@media (max-width: 767px) {
  .global-header { display: none; }
  main {
    padding-inline: var(--space-4);
    padding-top: calc(var(--space-8) + env(safe-area-inset-top));
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }
  .mobile-nav {
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
    padding-block-end: calc(var(--space-3) + env(safe-area-inset-bottom));
  }
  .mobile-nav-list {
    height: 68px;
    align-items: center;
    padding: 0 6px;
    border-radius: var(--radius-pill);
  }
  .mobile-nav-item { gap: 3px; font-size: var(--fs-micro); }
  .mobile-nav-item svg {
    width: 22px;
    height: 22px;
    padding: 4px 15px;
  }
  .mobile-nav-item.active svg { background-color: var(--accent-subtle-bg); }
  button.mobile-nav-item { border: none; background: transparent; font-family: inherit; cursor: pointer; }
  .home-avatar { display: inline-flex; }
  /* التبويب المقسّم لا يحتاج تلاشياً؛ ما يطول منه يتمرر والتبويب النشط يُظهَر تلقائياً (router.revealActiveTab) */
  .tab-bar { -webkit-mask-image: none; mask-image: none; padding-inline-end: 3px; }
}
@media (min-width: 768px) {
  .home, .week-page { max-width: 760px; margin-inline: auto; }
  .home-avatar { display: inline-flex; }
}

/* ══ عنوان كل صفحة: سطر صغير فوقه وعنوان كبير (كل الصفحات تستخدم .type-h1/.type-display في h1) ══ */
.home-eyebrow { font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); letter-spacing: 0.2px; }
.home-title { margin: 0; font-size: var(--fs-hero); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.home-summary, .home-muted { font-size: var(--fs-body); color: var(--text-muted); }
@media (max-width: 767px) {
  #app-root h1.type-h1, #app-root h1.type-display { font-size: var(--fs-display); line-height: 1.15; }
}

/* ══ 1 · الرئيسية ══ */
.home { display: flex; flex-direction: column; gap: 22px; }
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.home-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background-color: var(--accent-subtle-bg);
  color: var(--accent-primary);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
/* غير مسجّل: حلقة واضحة حول الأيقونة تدعو لتسجيل الدخول بدل شكل زر عام. */
.home-avatar.is-guest { border-color: var(--border-strong); }
/* مسجّل الدخول: دائرة معبّأة بحرف بريده الأول، أقرب لصورة حساب فعلية من أيقونة عامة. */
.home-avatar.is-signed-in { background-color: var(--accent-primary); color: var(--on-accent); }
.home-avatar-initial { font-weight: 700; font-size: var(--fs-body); line-height: 1; }

.next-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background-color: var(--accent-primary);
  color: var(--on-accent);
  box-shadow: var(--accent-shadow);
}
.next-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.next-eyebrow { font-size: var(--fs-caption); font-weight: 600; opacity: 0.85; }
.next-title { margin: 0; font-size: var(--fs-card-title); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.next-meta { font-size: var(--fs-small); opacity: 0.85; }
.next-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.next-pill {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-pill);
  background-color: color-mix(in srgb, var(--on-accent) 18%, transparent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out);
}
.next-pill.is-primary { background-color: var(--on-accent); color: var(--accent-primary); font-weight: 700; }
.next-ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.next-ring-track { stroke: color-mix(in srgb, var(--on-accent) 22%, transparent); }
.next-ring-fill { stroke: var(--on-accent); transition: stroke-dashoffset var(--dur-3) var(--ease-out); }
.next-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.next-ring-num { font-size: var(--fs-title); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.next-ring-cap { font-size: var(--fs-nano); opacity: 0.85; }

.quick-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quick-tile-icon {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  transition: transform var(--dur-1) var(--ease-out);
}
.quick-tile-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background-color: var(--accent-primary);
  color: var(--on-accent);
  font-size: var(--fs-micro);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.quick-tile-label { font-size: var(--fs-caption); font-weight: 500; }
.quick-tile:active .quick-tile-icon, .next-pill:active, .home-avatar:active, .sheet-tile:active, .sheet-primary:active, .sheet-cancel:active { transform: scale(0.95); }

.home-section { display: flex; flex-direction: column; gap: 10px; }
.home-section-head { display: flex; justify-content: space-between; align-items: baseline; }
.home-section-title { margin: 0; font-size: var(--fs-title); font-weight: 700; }
.home-section-link { font-size: var(--fs-callout); font-weight: 600; color: var(--accent-primary); text-decoration: none; }

/* قائمة واحدة بإطار واحد (القاعدة 5): صفوف الأسبوع، الملفات، والإنجازات */
.week-list, .file-list, .sheet-group {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.week-row { display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-4) 6px 6px; min-height: 64px; }
.week-row + .week-row, .week-list .week-more { border-top: 1px solid var(--border-subtle); }
.week-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.week-row-title { font-size: var(--fs-body); font-weight: 600; transition: opacity var(--dur-2) ease; overflow-wrap: anywhere; }
.week-row-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--text-muted); }
.week-row-meta .course-dot { margin: 0; }
.week-row.is-done .week-row-title { text-decoration: line-through; opacity: 0.5; }
.week-empty { padding: var(--space-4); font-size: var(--fs-callout); color: var(--text-muted); }
.week-more { display: block; padding: var(--space-3) var(--space-4); font-size: var(--fs-callout); color: var(--accent-primary); text-decoration: none; }
.when-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background-color: var(--muted-bg);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  font-weight: 700;
}
.when-badge.is-warn { background-color: var(--warn-bg); color: var(--warn-fg); }
.when-badge.is-danger { background-color: color-mix(in srgb, var(--semantic-danger) 12%, transparent); color: var(--semantic-danger); }

/* ══ 4 · الحركة: دائرة الإنجاز تمتلئ وتنبض علامتها (هدف لمس 44px حول دائرة 24px) ══ */
.check-circle {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--on-color);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.check-circle::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-check);
  border: 2px solid var(--border-strong);
  background-color: transparent;
  transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}
.check-circle svg { position: relative; transform: scale(0); transition: transform var(--dur-3) var(--ease-spring); }
.check-circle.is-done::before { background-color: var(--semantic-success); border-color: var(--semantic-success); }
.check-circle.is-done svg { transform: scale(1); }
.check-circle:active::before { transform: scale(0.9); }
/* خانات خطة المراجعة بنفس الشكل */
.task-check { width: 24px; height: 24px; border-radius: var(--radius-check); transition: background-color var(--dur-2) ease, border-color var(--dur-2) ease; }

/* ══ 2 · صفحة المادة: رأس ممتلئ بلون المادة ══ */
.course-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  padding: var(--space-4) var(--space-5) 22px;
  border-radius: var(--radius-2xl);
  background-color: var(--course-accent, var(--accent-primary));
  color: var(--on-color);
}
@media (max-width: 767px) {
  .course-hero {
    margin-inline: calc(-1 * var(--space-4));
    margin-top: calc(-1 * (var(--space-8) + env(safe-area-inset-top)));
    padding-top: calc(var(--space-3) + env(safe-area-inset-top));
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}
.course-hero-bar { display: flex; justify-content: space-between; align-items: center; }
.course-hero-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: inherit; text-decoration: none; font-size: var(--fs-button); font-weight: 500; }
.course-hero-actions { display: flex; gap: var(--space-2); }
.hero-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--on-color-soft);
  color: inherit;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out);
}
.hero-btn:active { transform: scale(0.92); }
.course-hero-eyebrow { font-size: var(--fs-small); font-weight: 600; opacity: 0.95; }
.course-hero-title { margin: 2px 0 0; font-size: var(--fs-headline); line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.course-hero-sub { font-size: var(--fs-small); opacity: 0.95; margin-top: 2px; }
.course-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.course-stat { padding: 10px var(--space-3); border-radius: var(--radius-btn); background-color: var(--on-color-soft); }
.course-stat-num { font-size: var(--fs-title); font-weight: 700; font-variant-numeric: tabular-nums; }
.course-stat-label { font-size: var(--fs-caption); opacity: 0.95; }

.tab-bar.course-tabs {
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr);
  gap: 2px;
  background-color: var(--border-subtle);
}
.tab-bar.course-tabs .tab-btn { height: 34px; justify-content: center; padding-inline: var(--space-3); font-size: var(--fs-small); }
@media (max-width: 767px) {
  /* ستة تبويبات تتسع كلها للشاشة (بلا تمرير ولا تلاشٍ) */
  .tab-bar.course-tabs { padding: 3px; -webkit-mask-image: none; mask-image: none; overflow: visible; grid-auto-columns: minmax(0, 1fr); }
  .tab-bar.course-tabs .tab-btn { padding-inline: 2px; font-size: var(--fs-caption); }
}
.tab-bar.course-tabs .tab-btn.active { font-weight: 700; }

.section-caption { margin: 0 4px 10px; font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }
.file-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px var(--space-4);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.file-row + .file-row { border-top: 1px solid var(--border-subtle); }
.file-row:active, .sheet-row:active { background-color: var(--bg-surface-2); }
.file-row .file-icon, .sheet-file-head .file-icon { width: 44px; height: 44px; border-radius: var(--radius-md); }
.file-row .file-icon svg { width: 22px; height: 22px; }
.file-icon.is-image { background-color: var(--success-bg); color: var(--success-fg); }
.file-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-row-name { font-size: var(--fs-body); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.file-row-meta { font-size: var(--fs-caption); color: var(--text-muted); }
.row-chevron { display: inline-flex; color: var(--border-strong); flex-shrink: 0; }
.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-4);
  padding: 14px var(--space-4);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-tile);
  color: var(--text-muted);
  font-size: var(--fs-callout);
  cursor: pointer;
}
.upload-row svg { color: var(--accent-primary); flex-shrink: 0; }
.upload-row.dragover { border-color: var(--accent-primary); background-color: var(--accent-subtle-bg); }

/* ══ 3 · لوح إجراءات الملف (واللوح العام كله) ══ */
.sheet-panel { border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; padding: 10px var(--space-4) calc(34px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .sheet-panel { border-radius: var(--radius-2xl); padding-bottom: var(--space-6); } }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.sheet-file-head { display: flex; align-items: center; gap: var(--space-3); padding: 4px 4px 0; }
.sheet-file-head .file-icon { width: 52px; height: 52px; border-radius: var(--radius-md); }
.sheet-file-head .file-icon svg { width: 26px; height: 26px; }
.sheet-file-text { flex: 1; min-width: 0; }
.sheet-file-name { font-size: var(--fs-sheet-title); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.sheet-file-meta { font-size: var(--fs-small); color: var(--text-muted); }
.sheet-primary {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-btn);
  background-color: var(--accent-primary);
  color: var(--on-accent);
  font-family: inherit;
  font-size: var(--fs-button);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out);
}
.sheet-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.sheet-tile {
  height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-tile);
  background-color: var(--bg-surface-1);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out);
}
.sheet-tile svg { color: var(--accent-primary); }
.sheet-group { border-radius: var(--radius-tile); }
.sheet-row {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-body);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.sheet-row + .sheet-row { border-top: 1px solid var(--border-subtle); }
.sheet-row-icon { display: inline-flex; color: var(--text-secondary); }
.sheet-row-label { flex: 1; }
.sheet-row-chevron { display: inline-flex; color: var(--border-strong); }
.sheet-row.is-danger { color: var(--semantic-danger); font-weight: 600; }
.sheet-row.is-danger .sheet-row-icon { color: currentColor; }
.sheet-cancel {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-btn);
  background-color: var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out);
}
.sheet-search .form-control { height: 44px; }

/* ══ 5 · أسبوعك ══ */
.week-page { display: flex; flex-direction: column; gap: 14px; }
.week-page .home-title { font-size: var(--fs-display); }
.week-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.streak-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background-color: var(--accent-primary);
  color: var(--on-accent);
}
.streak-num { font-size: var(--fs-stat-lg); font-weight: 700; line-height: 1; }
.streak-label { font-size: var(--fs-small); opacity: 0.9; }
.goal-card, .week-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.goal-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-3); }
.goal-ring { position: relative; width: 86px; height: 86px; }
.goal-track { stroke: var(--muted-bg); }
.goal-fill { stroke: var(--semantic-success); transition: stroke-dashoffset var(--dur-3) var(--ease-out); }
.goal-ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-ring); font-weight: 700; }
.goal-caption { font-size: var(--fs-small); color: var(--text-secondary); text-align: center; }
.week-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.week-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.week-card-title { font-size: var(--fs-button); font-weight: 700; }
.week-card-sub { font-size: var(--fs-small); color: var(--text-muted); }
.wk-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); align-items: end; height: 120px; }
.wk-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.wk-bar {
  width: 100%;
  max-width: 26px;
  height: calc(var(--bar) * 92px);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-xs) var(--radius-xs);
  background-color: color-mix(in srgb, var(--accent-primary) 32%, var(--bg-surface-1));
}
.wk-bar.is-today { background-color: var(--accent-primary); }
.wk-bar.is-empty { background-color: var(--border-subtle); }
.wk-label { font-size: var(--fs-micro); color: var(--text-muted); font-weight: 500; }
.wk-label.is-today { font-weight: 700; color: var(--text-primary); }
.week-start-link { align-self: flex-start; }
.week-wins { padding: 0; gap: 0; overflow: hidden; }
.win-row { display: flex; align-items: center; gap: var(--space-3); padding: 13px var(--space-4); }
.win-row + .win-row { border-top: 1px solid var(--border-subtle); }
.win-icon { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); }
.win-icon.is-accent { background-color: var(--accent-subtle-bg); color: var(--accent-primary); }
.win-icon.is-success { background-color: var(--success-bg); color: var(--success-fg); }
.win-icon.is-muted { background-color: var(--muted-bg); color: var(--warn-fg); }
.win-text { flex: 1; display: flex; flex-direction: column; }
.win-title { font-size: var(--fs-callout); font-weight: 600; }
.win-sub { font-size: var(--fs-caption); color: var(--text-muted); }
.color-row { flex-direction: row; align-items: center; padding: 14px var(--space-4); color: var(--text-primary); text-decoration: none; }
.color-row-text { flex: 1; }
.color-row-dot { width: 28px; height: 28px; border-radius: var(--radius-pill); background-color: var(--accent-primary); box-shadow: var(--swatch-ring); }

/* ══ الموقع كله: رأس الصفحة الموحّد، المواد صفوفاً، شارات الحالة، صفوف المواعيد ══ */
.page-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.page-top-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-top-title { margin: 0; }
.page-top-sub { font-size: var(--fs-body); color: var(--text-muted); margin: 2px 0 0; }
.page-top-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.page-top-actions .form-control { width: auto; max-width: 180px; }
@media (max-width: 767px) {
  .page-action { width: 44px; height: 44px; padding: 0; border-radius: var(--radius-pill); }
  .page-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .page-top-sub { font-size: var(--fs-callout); }
}
.page-filters { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.page-select { width: auto; height: 34px; padding-inline: var(--space-3); border-radius: var(--radius-pill); font-size: var(--fs-small); }
a.course-row { text-decoration: none; }
.course-row-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background-color: var(--course-color, var(--accent-primary));
  color: var(--on-color);
}
.task-row { padding-inline-start: 6px; gap: var(--space-2); }
.task-row.is-done .task-title { text-decoration: line-through; opacity: 0.5; }
.row-edit {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.row-edit:active { background-color: var(--bg-surface-2); }
.row-edit.is-danger { color: var(--semantic-danger); }
a.row-edit { text-decoration: none; }
.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-bottom: var(--space-1); color: var(--accent-primary); font-size: var(--fs-button); font-weight: 500; text-decoration: none; }
.page-search { margin-bottom: var(--space-5); }
.reminder-chip { border-color: transparent; border-radius: var(--radius-md); background-color: var(--muted-bg); color: var(--text-secondary); font-weight: 700; }
.reminder-chip.warning { background-color: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.reminder-chip.success { background-color: var(--success-bg); color: var(--success-fg); border-color: transparent; }
.reminder-chip.danger { background-color: color-mix(in srgb, var(--semantic-danger) 12%, transparent); color: var(--semantic-danger); border-color: transparent; }
.reminder-chip.is-next { border-color: transparent; }

/* أيام الجدول على الجوال: نفس التبويب المقسّم (Segmented) */
.schedule-tabs { gap: 2px; padding: 3px; border-radius: var(--radius-md); background-color: var(--border-subtle); }
.schedule-tab { min-height: 38px; border: none; border-radius: calc(var(--radius-md) - 3px); background-color: transparent; font-size: var(--fs-small); transition: background-color var(--dur-1) ease, color var(--dur-1) ease; }
.schedule-tab.is-today { color: var(--accent-primary); }
.schedule-tab.active { background-color: var(--bg-surface-1); color: var(--text-primary); box-shadow: var(--shadow-soft); font-weight: 700; }
/* نص الملاحظة في صفها: معاينة قصيرة لا مساحة محرّر */
.post-row-content.md-preview { min-height: 0; }

/* تركيز لوحة المفاتيح بلون التطبيق على كل عناصر الشاشات */
.next-pill:focus-visible, .quick-tile:focus-visible, .home-avatar:focus-visible, .check-circle:focus-visible, .hero-btn:focus-visible,
.file-row:focus-visible, .upload-row:focus-visible, .sheet-primary:focus-visible, .sheet-tile:focus-visible, .sheet-row:focus-visible,
.sheet-cancel:focus-visible, .color-row:focus-visible, .mobile-nav-item:focus-visible, .row-edit:focus-visible, .back-link:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.sheet-primary:focus-visible { outline-color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
  .check-circle::before, .check-circle svg, .next-ring-fill, .goal-fill, .week-row-title,
  .quick-tile-icon, .next-pill, .hero-btn, .sheet-tile, .sheet-primary, .sheet-cancel, .home-avatar { transition: none; }
  .quick-tile:active .quick-tile-icon, .next-pill:active, .home-avatar:active, .sheet-tile:active, .sheet-primary:active,
  .sheet-cancel:active, .hero-btn:active, .check-circle:active::before { transform: none; }
}
