/* لوحة مدير المدرسة — هوية وزارة التعليم (25 نوفمبر 2026): فيروزي الشعار للهوية والأفعال فقط، رمادي الدليل للنصوص الثانوية،
   أسطح محايدة، وأحمر للغياب والحرج وحدهما. --accent فيروزي فاتح لا يظهر إلا فوق البطاقة الداكنة وفي العدّاد */
:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --ink: #14262a;
  --ink-2: #595c61;
  --muted: #686c71;   /* 4.7:1 or more on every tinted grey here (#f2f5f5, #f4f6f6, #eef2f2) */
  --grid: #e5e9ea;
  --axis: #cdd4d5;
  --track: #eef2f2;
  --seg-track: #eceff0;
  --m-950: #032e2a;
  --m-900: #00473f;
  --m-800: #00675e;
  --m-700: #007a70;
  --series: #00a396;
  --series-2: #595c61;
  --m-200: #bfe5df;
  --m-100: #e4edeb;
  --m-50: #f2f5f5;
  --accent: #2fd3bf;
  --good: #007a70;
  --good-bg: var(--m-50);
  --neutral: #595c61;
  --neutral-bg: #eef0f1;
  --crit: #b3282b;
  --crit-bg: #fbe8e8;
  --focus: #00675e;
  --r-card: 20px;
  --r-md: 12px;
  --r-sm: 6px;
  --shadow-card: 0 0 0 1px #e5e9ea, 0 1px 2px rgba(16,36,34,.04), 0 14px 32px -22px rgba(16,36,34,.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --z-sticky: 10;
  --z-sheet: 40;
  --z-toast: 50;
  --z-tip: 60;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Almarai', 'Segoe UI', Tahoma, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
iconify-icon { display: inline-block; width: 1em; height: 1em; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.hero :focus-visible { outline-color: var(--accent); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: var(--z-toast); background: var(--m-800); color: #fff; padding: 10px 16px; border-radius: var(--r-md); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ── الترويسة: اليوم الدراسي على أبيض ─────────────────────────── */
.top { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--grid); padding: 14px var(--gutter) 12px; position: relative; overflow: hidden; }
.top-in { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'brand now' 'day day'; gap: 10px 12px; align-items: center; }
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; min-width: 0; }
/* the school mark: a rising sun drawn as a line, not a coloured app tile */
.mark { width: 34px; height: 34px; flex: none; fill: none; stroke: var(--m-800); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-txt strong { font-size: 1.0625rem; font-weight: 700; }
.brand-txt span { font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
/* phones: the Gregorian date on its own line under the Hijri one; wider screens: one line with a dot between */
#today-date { display: flex; flex-direction: column; }
#today-date .sep { display: none; }
@media (min-width: 720px) { #today-date { flex-direction: row; } #today-date .sep { display: inline; white-space: pre; } }
@media (max-width: 360px) { .brand-txt #today-date span { font-size: .75rem; } }

/* the period and the minutes left sit in the strip's «الآن» marker below 1100px, and here on wide screens */
.now { grid-area: now; display: none; align-items: center; }
.now-txt { display: flex; flex-direction: column; align-items: flex-end; text-align: end; font-size: .8125rem; line-height: 1.35; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.now-txt b { color: var(--m-800); font-weight: 700; font-size: .875rem; }

.day { grid-area: day; min-width: 0; }
.rail { position: relative; display: flex; gap: 4px; align-items: flex-end; padding-top: 34px; direction: rtl; }
.seg-p { position: relative; flex: var(--w) 1 0; min-width: 0; }
.seg-p .bar { display: block; height: 8px; border-radius: 999px; background: #e6eeec; overflow: hidden; position: relative; }
.seg-p .fill { position: absolute; inset: 0; background: var(--m-800); transform-origin: 100% 50%; transform: scaleX(var(--f, 0)); border-radius: inherit; }
.seg-p.is-now .fill { background: var(--series); }
.seg-p.is-break .bar { background: repeating-linear-gradient(135deg, #dbe3e2 0 3px, #eef2f1 3px 6px); }
.seg-p.is-break .fill { background: rgba(0,103,94,.55); }
.seg-p .lbl { display: block; margin-top: 6px; font-size: .8125rem; min-height: 13px; color: var(--ink-2); text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.seg-p.is-now .lbl { color: var(--m-800); font-weight: 700; }
/* «فسحة» و«صلاة» أعرض من فترتيهما على الجوال: تتجاوزان الفترة إلى الجانبين ولا تمسّان رقمي الحصتين */
.seg-p .lbl.wd { font-size: .75rem; white-space: nowrap; margin-inline: -10px; }
/* علم «الآن»: زر بارتفاع ٤٤ شفاف، والشكل الظاهر في الحبة داخله */
.now-flag { position: absolute; bottom: 24px; inset-inline-start: -4px; min-height: 44px; min-width: 44px; padding: 0 4px 6px; display: flex; align-items: flex-end; border: 0; background: transparent; font: inherit; color: #fff; }
button.now-flag { cursor: pointer; }
.nf-pill { position: relative; display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .8125rem; font-weight: 700; line-height: 1.5; background: var(--m-800); color: #fff; padding: 2px 9px; border-radius: var(--r-sm); font-variant-numeric: tabular-nums; }
.nf-pill::after { content: ''; position: absolute; bottom: -4px; inset-inline-start: 12px; width: 8px; height: 8px; background: var(--m-800); transform: rotate(45deg); border-radius: 2px; }
.nf-dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.nf-dot i { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: 0; }
/* a hairline, not «·»: Almarai's middle dot looks like the Arabic-Indic zero «٠» beside digits */
.nf-left { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.92); font-weight: 400; }
.nf-sep { width: 1px; height: 11px; background: rgba(255,255,255,.45); margin-inline-start: 1px; }
.vpin { position: absolute; bottom: 4px; inset-inline-end: 50%; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0 0 10px; display: grid; place-items: end center; background: transparent; }
.vpin i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--surface); }
.vpin.done i { color: var(--m-800); }
.vpin.live i { color: var(--series); }
.vpin.next i { color: var(--ink-2); }
.rail-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: .8125rem; color: var(--ink-2); }
.rail-foot .rf-t { display: none; }
.rf-a { white-space: nowrap; }
.rf-key { display: flex; gap: 14px; margin-inline-start: auto; white-space: nowrap; }
@media (max-width: 379px) { .rail-foot { flex-wrap: wrap; row-gap: 4px; } .rf-key { gap: 12px; } }
.rf-key > span { display: inline-flex; align-items: center; gap: 5px; }
.vk { display: grid; place-items: center; font-size: 1rem; }
.vk.done { color: var(--m-800); }
.vk.next { color: var(--ink-2); }
/* the entrance (app.js intro) reveals these with autoAlpha; hidden before the first paint so they never flash */
html.js-anim .rail-foot, html.js-anim .brand, html.js-anim .now, html.js-anim .scope, html.js-anim #abs-split,
html.js-anim #dots-lab, html.js-anim .dots-key, html.js-anim #cta, html.js-anim #risk-card,
html.js-anim #trend-card, html.js-anim #alerts-card, html.js-anim #tea-card, html.js-anim .subj-card,
html.js-anim #cls-card, html.js-anim #vis-card { visibility: hidden; }

/* ── شريط النطاق ─────────────────────────── */
.scope { position: sticky; top: 0; z-index: var(--z-sticky); background: rgba(244,246,246,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--grid); padding: 10px var(--gutter); }
.scope-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.scope-sum { display: none; font-size: .875rem; color: var(--ink-2); }

.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0; padding: 4px; border: 0; background: var(--seg-track); border-radius: var(--r-md); min-width: 0; flex: 1; }
.seg label { position: relative; z-index: 1; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; padding: 6px 4px; font-size: .875rem; font-weight: 700; color: var(--ink-2); border-radius: 8px; white-space: nowrap; transition: color .18s var(--ease-out); }
.seg input:checked + span { color: var(--m-900); font-weight: 800; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-ind { position: absolute; top: 4px; bottom: 4px; inset-inline-start: 4px; width: calc((100% - 8px) / var(--n, 4)); background: var(--surface); border-radius: 8px; box-shadow: 0 1px 2px rgba(16,36,34,.08), 0 3px 10px -2px rgba(16,36,34,.12); }
.seg-sm { flex: none; }
.seg-sm span { padding: 6px 12px; font-size: .8125rem; }
.seg i { font-style: normal; }
.seg .sm { display: none; }
@media (hover: hover) { .seg label:hover input:not(:checked) + span { color: var(--ink); } }

/* ── اللوحة ─────────────────────────── */
.board { max-width: 1240px; margin: 0 auto; padding: 16px var(--gutter) 32px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.col-a, .col-b { display: contents; }
.risk-card { order: 1; } .trend-card { order: 2; } .alerts-card { order: 3; } .tea-card { order: 4; } .subj-card { order: 5; } .cls-card { order: 6; } .vis-card { order: 7; }
.card { overflow-x: clip; background: var(--surface); border-radius: var(--r-card); padding: 18px 16px; box-shadow: var(--shadow-card); min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; display: flex; align-items: center; gap: 8px; text-wrap: balance; }
.nw { white-space: nowrap; }
.card-sub { margin-top: 3px; font-size: .8125rem; color: var(--muted); }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--m-950); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* بطاقة الصباح: الكتلة الداكنة الوحيدة، بعمق ضوء من الزاوية */
.hero {
  background: radial-gradient(120% 90% at 100% 0%, #00796e 0%, transparent 55%), linear-gradient(170deg, #00564e 0%, #032e2a 100%);
  color: #fff; border-radius: 24px; padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.04), 0 2px 4px rgba(3,46,42,.12), 0 28px 56px -30px rgba(3,46,42,.6);
}
.news { font-size: 1.75rem; font-weight: 800; line-height: 1.28; letter-spacing: -0.01em; text-wrap: balance; min-height: 2.56em; }
.abs-split { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.abs-split li { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border-radius: var(--r-sm); background: rgba(255,255,255,.1); font-size: .8125rem; color: rgba(255,255,255,.86); white-space: nowrap; }
.abs-split b { color: #fff; font-weight: 700; font-size: .875rem; font-variant-numeric: tabular-nums; }
.abs-split .late { background: rgba(47,211,191,.16); }
.dots-fig { margin: 0; }
.dots { display: block; width: 100%; height: auto; overflow: visible; }
.dots .cls-hit { fill: transparent; cursor: pointer; }
.dots .dots-tap { fill: transparent; cursor: pointer; }
.dots circle, .dots text { pointer-events: none; }
.dots .cls-hit:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.2; }
.dots .cls-g.is-sel .cls-hit { fill: rgba(255,255,255,.07); }
.dots-lab { position: relative; height: 42px; margin-top: 6px; pointer-events: none; }
.dots-lab span { position: absolute; top: 0; transform: translateX(50%); font-size: .8125rem; line-height: 1.3; font-weight: 700; color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dots-lab .grade-t { top: 21px; color: #fff; }
.dots .on { fill: rgba(255,255,255,.5); }
.dots .off { fill: var(--accent); }
.dots-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .8125rem; color: rgba(255,255,255,.8); align-items: center; }
.dots-key span { display: inline-flex; align-items: center; gap: 6px; }
.dots-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.k-on { background: rgba(255,255,255,.5); }
.k-off { background: var(--accent); }
.dots-hint { flex-basis: 100%; color: rgba(255,255,255,.72); }
.cta { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 18px; border-radius: var(--r-md); background: #fff; color: var(--m-900); font-weight: 700; font-size: 1rem; text-decoration: none; box-shadow: 0 10px 24px -14px rgba(0,0,0,.5); transition: scale .18s var(--ease-out), background-color .18s; }
.cta iconify-icon { font-size: 1.25rem; }
.cta:active { scale: .97; }

/* المعرّضون للتعثر: البطاقة كلها زر يفتح قائمة الطلاب */
.risk-card { position: relative; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .2s var(--ease-out); }
.risk-card h2 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.kpi-v { font-size: 2.25rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 6px; margin-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-v small { font-size: .9375rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
@media (max-width: 419px) { .seg#grade-seg span { font-size: .8125rem; } }
.risk-lines { display: grid; gap: 2px; margin-top: 6px; }
.risk-lines li { display: flex; align-items: baseline; gap: 8px; font-size: .875rem; color: var(--ink-2); line-height: 1.5; }
.risk-lines b { min-width: 1.6em; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.risk-go { margin-top: 8px; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; margin-inline-start: -10px; border: 0; border-radius: 10px; background: transparent; color: var(--m-800); font-weight: 700; font-size: .9375rem; }
.risk-go iconify-icon { font-size: 1.125rem; transition: transform .2s var(--ease-out); }
/* the button's hit area stretches over the whole card */
.risk-go::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-card); }
.risk-go:focus-visible { outline: none; }
.risk-go:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.risk-card:active { box-shadow: 0 0 0 1px var(--m-200), 0 1px 2px rgba(16,36,34,.04); }
@media (hover: hover) {
  .risk-card:hover { box-shadow: 0 0 0 1px var(--m-200), 0 1px 2px rgba(16,36,34,.04), 0 18px 36px -22px rgba(16,36,34,.2); }
  .risk-card:hover .risk-go iconify-icon { transform: translateX(-3px); }
}

/* منحنى الحضور */
/* جدول القارئ الآلي لا يُختزل إلى 1px لأنه جدول، فيبقى داخل البطاقة المقصوصة لا خارج الصفحة */
.trend-card { position: relative; }
.trend-wrap { position: relative; touch-action: pan-y; }
.trend { display: block; width: 100%; height: 220px; overflow: visible; }
.trend:focus-visible { outline-offset: 6px; }
.trend:focus:not(:focus-visible), .trend.ptr:focus { outline: none; }
.trend .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.trend text { direction: rtl; }
.trend .grid text, .trend .xl text { fill: var(--muted); font-size: 13px; font-family: inherit; font-variant-numeric: tabular-nums; }
.trend .base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.trend .goal { stroke: var(--series-2); stroke-width: 1.5; }
.trend .ln { fill: none; stroke: var(--m-800); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend .ar { fill: url(#trend-fill); }
.trend .halo { fill: var(--series); opacity: .2; }
.trend .end { fill: var(--m-800); stroke: var(--surface); stroke-width: 2; }
.trend .end-t { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: inherit; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.trend .xh { stroke: var(--ink-2); stroke-width: 1; opacity: 0; shape-rendering: crispEdges; }
.trend .xd { fill: var(--surface); stroke: var(--m-800); stroke-width: 2.5; opacity: 0; }
.tip { position: absolute; z-index: var(--z-tip); top: 0; pointer-events: none; background: var(--m-950); color: #fff; border-radius: var(--r-md); padding: 8px 12px; min-width: 120px; box-shadow: 0 8px 24px rgba(3,46,42,.25); font-size: .8125rem; line-height: 1.45; }
.tip b { display: block; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tip span { color: rgba(255,255,255,.78); display: block; }

/* التنبيهات: صفوف على أبيض، وعلامة قصيرة بلون الخطورة عند بداية العنوان */
.alerts { display: grid; }
.alert { position: relative; display: grid; gap: 2px; padding: 12px 0 8px; padding-inline-start: 14px; border-bottom: 1px solid var(--grid); }
.alerts > .alert:last-child { border-bottom: 0; }
.alert::before { content: ''; position: absolute; inset-inline-start: 0; top: 17px; width: 3px; height: 16px; border-radius: 2px; background: var(--series); }
.alert.crit::before { background: var(--crit); }
.alert.warn::before { background: #8a9094; }
.alert.info::before { background: var(--series); }
.alert-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; align-items: start; padding: 4px 8px; margin-inline: -8px; width: calc(100% + 16px); border: 0; background: transparent; text-align: start; border-radius: 10px; transition: background-color .18s; }
.alert-main .t { font-size: .9375rem; font-weight: 700; line-height: 1.45; text-wrap: pretty; }
.alert-main .d { font-size: .8125rem; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
.alert-main .go { display: none; }
.alert-main:active { background: var(--m-50); }
@media (hover: hover) { .alert-main:hover { background: var(--m-50); } }
.alert-foot { display: flex; align-items: center; gap: 8px; }
/* the action sits at the start (right) of the row, clear of the floating course button in the bottom-left corner */
.ok-btn { min-height: 44px; padding: 0 10px; margin-inline-start: -10px; border-radius: 10px; border: 0; display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 700; background: transparent; color: var(--m-800); transition: scale .18s var(--ease-out), background-color .18s; white-space: nowrap; }
.ok-btn iconify-icon { font-size: 1.125rem; }
.ok-btn:active { scale: .95; background: var(--m-100); }
@media (hover: hover) { .ok-btn:hover { background: var(--m-50); color: var(--m-900); } }
.alert .lvl { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: var(--r-sm); line-height: 1.6; background: var(--good-bg); color: var(--good); margin-inline-start: auto; order: 1; }
.alerts-more { width: 100%; min-height: 44px; margin-top: 4px; display: none; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--r-md); background: var(--m-50); color: var(--m-800); font-weight: 700; font-size: .875rem; }
.alerts-more iconify-icon { font-size: 1.125rem; }
@media (max-width: 719px) {
  .alerts.is-clip > .alert:nth-child(n+5) { display: none; }
  .alerts.is-clip > .alert:nth-child(4) { border-bottom: 0; }
  .alerts.is-clip + .alerts-more { display: flex; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: var(--r-md); border: 0; font-size: .875rem; font-weight: 700; transition: scale .18s var(--ease-out), background-color .18s; text-decoration: none; }
.btn:active { scale: .96; }
.btn iconify-icon { font-size: 1.0625rem; }
.btn-p { background: var(--m-800); color: #fff; }
.btn-s { background: var(--surface); color: var(--m-800); box-shadow: inset 0 0 0 1px var(--m-200); }
.btn-g { background: transparent; color: var(--m-700); padding-inline: 8px; }
@media (hover: hover) {
  .btn-p:hover { background: var(--m-900); }
  .btn-s:hover { background: var(--m-50); }
  .cta:hover { background: #eef7f5; }
}
.done-wrap { margin-top: 8px; border-top: 1px solid var(--grid); padding-top: 6px; }
.done-tog { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 10px 4px; font-weight: 700; font-size: .875rem; color: var(--ink-2); border-radius: 10px; }
.done-tog .chev { margin-inline-start: auto; transition: transform .25s var(--ease-out); }
.done-tog[aria-expanded="true"] .chev { transform: rotate(180deg); }
.alerts-done .alert::before { background: var(--axis); }
.alerts-done .alert-main .t { color: var(--ink-2); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 12px; border-radius: var(--r-md); background: var(--m-50); color: var(--m-800); }
.empty iconify-icon { font-size: 2rem; }
.empty b { font-size: .9375rem; font-weight: 700; }

/* المواد */
.subj { display: grid; gap: 16px; }
.subj li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: end; }
.subj .nm { font-size: .875rem; font-weight: 700; color: var(--ink); line-height: 1.35; }
.subj .vl { font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.subj .tr { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 999px; background: var(--track); }
.subj .fl { position: absolute; inset: 0; background: var(--m-800); border-radius: 999px; transform-origin: 100% 50%; transform: scaleX(0); }
.pw { position: absolute; inset: 0; pointer-events: none; }
.subj .tk { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; inset-inline-start: 0; margin-inline-start: -1px; }
.ref-key { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .8125rem; color: var(--ink-2); text-wrap: balance; }
.ref-key span, #cls-ref { text-wrap: balance; }
.ref-key i { width: 2px; height: 14px; background: var(--ink); border-radius: 2px; display: inline-block; flex: none; }
.ref-key i.goal { width: 18px; height: 2px; border-radius: 0; background: repeating-linear-gradient(to left, var(--series-2) 0 4px, transparent 4px 8px); }

/* مقارنة الفصول */
.axis { position: relative; height: 18px; margin-inline-start: 78px; margin-inline-end: 92px; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; top: 0; transform: translateX(50%); }
.cls { display: grid; gap: 2px; }
@media (max-width: 719px) { .cls { gap: 10px; } }
.cls li { display: block; }
.cls button { width: 100%; display: grid; grid-template-columns: 66px 1fr 56px 16px; align-items: center; gap: 8px; min-height: 44px; padding: 4px 4px; border: 0; background: transparent; border-radius: 10px; text-align: start; transition: background-color .18s; }
.cls button:active { background: var(--m-50); }
@media (hover: hover) { .cls button:hover { background: var(--m-50); } }
.cls .nm { font-size: .875rem; font-weight: 700; white-space: nowrap; }
.cls .tr { position: relative; height: 24px; }
.cls .tr::before { content: ''; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--grid); }
.cls .stem { display: none; position: absolute; inset-inline: 0; top: calc(50% - 1px); height: 2px; background: var(--series); transform-origin: 100% 50%; transform: scaleX(0); opacity: .55; }
.cls .dotw { position: absolute; inset: 0; pointer-events: none; }
.cls .dot { position: absolute; top: 50%; inset-inline-start: 0; width: 12px; height: 12px; margin-top: -6px; margin-inline-start: -6px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 2px var(--surface); }
.cls .avg { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--ink); border-radius: 2px; inset-inline-start: 0; margin-inline-start: -1px; }
.cls .vl { font-size: .875rem; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cls .ch { color: var(--muted); font-size: 1rem; }
.cls li.low .dot { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--m-950), 0 0 0 2px var(--surface); }

/* الزيارات */
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; padding-top: 10px; }
.days button { border: 0; background: var(--m-50); border-radius: var(--r-md); padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; transition: background-color .18s; position: relative; }
.days button b { font-size: 1.125rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.days button span { font-size: .8125rem; color: var(--ink-2); }
.days button .dn { font-size: .75rem; white-space: nowrap; color: var(--m-800); font-weight: 700; }
.days button .dn.z { color: var(--muted); font-weight: 400; }
.days button[aria-pressed="true"] { background: var(--m-800); color: #fff; }
.days button[aria-pressed="true"] span, .days button[aria-pressed="true"] .dn { color: rgba(255,255,255,.88); }
.days .td { position: absolute; top: -12px; inset-inline-end: 50%; transform: translateX(-50%); font-size: .75rem; font-weight: 700; background: var(--m-800); color: #fff !important; padding: 0 7px; border-radius: var(--r-sm); line-height: 1.6; }
.vlist { display: grid; }
.visit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--grid); }
.visit:last-child { border-bottom: 0; }
.visit.live { margin-inline: -10px; padding-inline: 10px; border-radius: var(--r-md); background: var(--m-50); border-bottom-color: transparent; }
.visit .who { min-width: 0; }
.visit .who b { display: block; font-size: .9375rem; font-weight: 700; line-height: 1.35; }
.visit .who span { display: block; font-size: .8125rem; color: var(--ink-2); line-height: 1.4; text-wrap: balance; }
.visit .who span.nw { display: inline; }
.visit .when { grid-column: 1 / -1; font-size: .8125rem; color: var(--muted); }
.visit .when span { white-space: nowrap; }
.visit .acts { grid-column: 1 / -1; margin-top: 8px; }
.st { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-sm); white-space: nowrap; line-height: 1.6; }
.st iconify-icon { font-size: .875rem; }
.st.done { background: var(--good-bg); color: var(--good); }
.st.live { background: var(--m-800); color: #fff; }
.st.next { background: var(--neutral-bg); color: var(--neutral); }
.vempty { padding: 18px; text-align: center; color: var(--ink-2); font-size: .875rem; border-radius: var(--r-md); background: var(--m-50); }
.vgrid { display: none; }
.unv { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--grid); }
.unv h3 { font-size: .9375rem; font-weight: 700; margin-bottom: 6px; }
.unv-list { display: grid; grid-template-columns: 1fr; column-gap: 24px; }
.unv-g { font-size: .8125rem; font-weight: 700; color: var(--muted); margin: 14px 0 2px; }
.unv-g:first-of-type { margin-top: 0; }
.unv-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--grid); font-size: .8125rem; line-height: 1.35; }
.unv-list span b { display: block; font-weight: 700; font-size: .875rem; }
.unv-list span small { display: block; color: var(--muted); font-size: .8125rem; }
.unv-list span em { display: block; font-style: normal; color: var(--m-700); font-size: .8125rem; font-weight: 700; }

/* المعلمون اليوم: صفوف لا صناديق، والإطار لحصتي الانتظار المفتوحتين وحدهما */
.tea-people { display: grid; }
.tea-people li { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.tea-people li:last-child { border-bottom: 0; }
.tea-people li > span:not(.pst) { min-width: 0; flex: 1; line-height: 1.35; }
.tea-people b { display: block; font-size: .9375rem; font-weight: 700; }
.tea-people small { display: block; font-size: .8125rem; color: var(--ink-2); text-wrap: balance; }
.pst { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-sm); white-space: nowrap; line-height: 1.6; }
.tea-people .absent .pst { background: var(--crit-bg); color: var(--crit); }
.tea-people .excused .pst { background: var(--neutral-bg); color: var(--neutral); }
.tea-h3 { font-size: .9375rem; font-weight: 700; margin: 18px 0 8px; }
.tea-main .tea-h3 { margin-top: 18px; }
.tea-note { font-size: .8125rem; color: var(--muted); margin: -2px 0 6px; text-wrap: pretty; }
.subs { display: grid; }
.sub { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.sub:last-child { border-bottom: 0; }
.sub .pb { grid-row: span 2; align-self: start; width: 48px; height: 48px; border-radius: var(--r-md); background: var(--m-50); color: var(--m-800); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.sub .pb b { font-size: 1.1875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sub .pb small { font-size: .75rem; color: var(--ink-2); }
.sub.is-now .pb { background: var(--m-800); color: #fff; }
.sub.is-now .pb small { color: rgba(255,255,255,.9); font-weight: 700; }
.sub .si { min-width: 0; line-height: 1.35; }
.sub .si b { display: block; font-size: .9375rem; font-weight: 700; }
.sub .si small { display: block; font-size: .8125rem; color: var(--ink-2); }
.sub.is-past .pb { background: transparent; box-shadow: inset 0 0 0 1px var(--grid); color: var(--muted); }
.sub.is-past .si b { color: var(--ink-2); }
.sdone { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; color: var(--good); }
.sub.is-open { margin-block: 6px; padding: 10px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--m-100), 0 8px 20px -16px rgba(0,103,94,.35); }
.sub.is-open + .sub.is-open { margin-top: 0; }
.sub-pick { grid-column: 2; position: relative; display: block; min-width: 0; }
.sub-pick .sub-sel { position: absolute; inset: 0; opacity: 0; font-size: 16px; }
.sp-view { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 14px 6px 40px; border-radius: var(--r-md); line-height: 1.35; pointer-events: none; }
.sp-view b { font-size: .875rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-view small { font-size: .8125rem; color: var(--ink-2); }
.sub-pick:focus-within .sp-view { outline: 3px solid var(--focus); outline-offset: 2px; }
.sub-sel, .sp-view { width: 100%; min-height: 48px; appearance: none; -webkit-appearance: none; border: 0; border-radius: var(--r-md); font: inherit; font-size: .875rem; font-weight: 700; color: var(--ink); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m19 9-7 6-7-6' fill='none' stroke='%2300675e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat left 12px center / 18px; box-shadow: inset 0 0 0 1px var(--axis); cursor: pointer; text-overflow: ellipsis; }
.sub.is-open .sp-view { box-shadow: none; border: 1.5px dashed var(--series); background-color: var(--m-50); padding-inline: 12.5px 38.5px; }
.sub.is-open .sp-view b { color: var(--m-800); }
@media (hover: hover) { .sub-pick:hover .sp-view { box-shadow: inset 0 0 0 1px var(--m-700); } .sub.is-open .sub-pick:hover .sp-view { box-shadow: none; border-color: var(--m-800); } }
.sub-sel:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.duty { display: grid; }
.duty li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.duty li:last-child { border-bottom: 0; }
.dt { flex: 1; min-width: 0; line-height: 1.35; }
.dt small { display: block; font-size: .8125rem; color: var(--ink-2); font-weight: 700; }
.dt b { display: block; font-size: .9375rem; font-weight: 700; }
.dt .dd { display: block; font-size: .8125rem; color: var(--muted); }

/* اللوحة المنزلقة */
.sheet { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: transparent; color: var(--ink); overflow: hidden; }
.sheet::backdrop { background: rgba(3,46,42,.5); }
.sheet[open] { display: flex; align-items: flex-end; }
.sheet-in { width: 100%; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 24px 24px 0 0; padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom)); }
.sheet-top { position: sticky; top: 0; z-index: 3; background: var(--bg); margin: 0 calc(-1 * var(--gutter)) 14px; padding: 8px var(--gutter) 0; border-bottom: 1px solid var(--grid); }
.sheet-grab { width: 44px; height: 5px; border-radius: 999px; background: var(--axis); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; }
.sheet-head h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.35; text-wrap: balance; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.5rem; color: var(--ink-2); box-shadow: 0 0 0 1px var(--grid); flex: none; }
.sheet-body { display: grid; gap: 14px; }
.sh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-stat { background: var(--surface); border-radius: var(--r-md); padding: 12px 10px; box-shadow: 0 0 0 1px var(--grid); }
.sh-stat b { display: block; font-size: 1.375rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sh-stat span { display: block; font-size: .8125rem; color: var(--ink-2); line-height: 1.4; margin-top: 4px; text-wrap: balance; }
.sh-stat span.nw { display: inline; margin: 0; }
.sh-box { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: 0 0 0 1px var(--grid); }
.sh-box h3 { font-size: .9375rem; font-weight: 700; margin-bottom: 6px; }
.sh-room { display: flex; align-items: center; gap: 12px; }
.sh-room b { display: block; font-size: .9375rem; font-weight: 700; }
.sh-room span { font-size: .8125rem; color: var(--ink-2); }
.sh-subj { display: grid; gap: 12px; overflow-x: clip; margin-top: 4px; }
.sh-subj li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: .8125rem; align-items: end; }
.sh-subj .tr { grid-column: 1 / -1; position: relative; height: 8px; background: var(--track); border-radius: 999px; }
.sh-subj .fl { position: absolute; inset: 0; background: var(--m-800); border-radius: 999px; transform-origin: 100% 50%; }
.sh-subj .tk { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.sh-subj b { font-weight: 700; font-variant-numeric: tabular-nums; }
.stu { display: grid; }
.stu li { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.stu li:last-child { border-bottom: 0; }
.stu b { font-size: .9375rem; font-weight: 700; }
.stu .tags { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.stu-g { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--axis); font-size: .875rem; font-weight: 700; color: var(--m-800); }
.stu-g:first-child { margin-top: 0; }
.stu-g span { font-weight: 400; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.tag { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-sm); background: var(--m-50); color: var(--m-800); line-height: 1.6; }
.tag.rep { background: var(--neutral-bg); color: var(--neutral); }
.tag.rep.crit { background: var(--crit-bg); color: var(--crit); }
.tag.fail { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--axis); }
.tag.abs-now { background: var(--crit-bg); color: var(--crit); }
.sh-abs { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-abs li { padding: 4px 10px; border-radius: var(--r-sm); background: var(--surface); box-shadow: 0 0 0 1px var(--grid); font-size: .8125rem; color: var(--ink-2); }
.sh-abs b { color: var(--ink); font-weight: 700; }
.sh-legend { display: flex; gap: 16px; font-size: .8125rem; color: var(--ink-2); margin: 0 0 10px; }
.sh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sh-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.lg-c { background: var(--m-800); }
.lg-s { background: var(--series-2); height: 2px !important; }
.sh-chart { position: relative; margin-inline: 44px; }
.sh-end { position: absolute; transform: translateY(-50%); font-size: .8125rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a = 11 weeks ago (the line's right end in RTL), b = this week (its left end): each value outside its own end */
.sh-end.a { inset-inline-end: calc(100% + 6px); }
.sh-end.b { inset-inline-start: calc(100% + 6px); }
.sh-axis { display: flex; justify-content: space-between; margin: 6px 44px 0; font-size: .8125rem; color: var(--muted); }
.sh-spark { width: 100%; height: 70px; display: block; overflow: visible; }
.sh-note { font-size: .8125rem; color: var(--ink-2); }
.stu + .sh-note { margin-top: 12px; }

/* الإشعار */
.toast { position: fixed; z-index: var(--z-toast); bottom: calc(80px + env(safe-area-inset-bottom));   /* above the shared floating course button */ inset-inline: 16px; margin: 0 auto; max-width: 420px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--m-950); color: #fff; font-size: .875rem; box-shadow: 0 12px 32px rgba(3,46,42,.3); }
.toast[hidden] { display: none; }
.toast button { border: 0; background: rgba(255,255,255,.12); color: var(--accent); font-weight: 700; padding: 8px 14px; border-radius: 10px; min-height: 44px; }

.foot { max-width: 1240px; margin: 0 auto; padding: 8px var(--gutter) 88px;   /* the last line clears the shared floating course button */ display: grid; gap: 6px; font-size: .8125rem; color: var(--ink-2); }

/* ── 360 وما دون ─────────────────────────── */
@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .news { font-size: 1.5rem; }
  .seg span { font-size: .8125rem; padding-inline: 2px; }
  .seg-sm span { padding-inline: 8px; font-size: .8125rem; }
  .seg .lg { display: none; }
  .seg .sm { display: inline; }
  .cls button { grid-template-columns: 58px 1fr 50px 12px; gap: 6px; }
  .axis { margin-inline-start: 68px; margin-inline-end: 78px; }
  .sh-stat b { font-size: 1.125rem; }
  .brand-txt span { font-size: .8125rem; }
}

/* ── اللوحي ─────────────────────────── */
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .board { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
  .hero { grid-column: span 6; display: grid; grid-template-columns: 1fr 1.2fr; grid-template-rows: auto 1fr; align-items: start; column-gap: 28px; }
  .hero-head { grid-column: 1; }
  .dots-fig { grid-column: 2; grid-row: 1 / span 2; }
  .cta { grid-column: 1; align-self: end; justify-self: start; }
  .risk-card { grid-column: span 6; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 40px; }
  .risk-card h2, .risk-card .kpi-v { grid-column: 1; }
  .risk-card .risk-lines { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: 0; }
  .risk-card .risk-go { grid-column: 2; grid-row: 3; }
  .trend-card, .alerts-card, .vis-card { grid-column: span 6; }
  .subj-card, .cls-card { grid-column: span 3; }
  .unv-list { grid-template-columns: 1fr 1fr; }
  .scope-sum { display: block; }
  .seg#grade-seg { flex: 0 1 460px; }
  .card { padding: 22px; }
  .trend { height: 260px; }
  .rail-foot .rf-t { display: inline; }
  .tea-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: auto 1fr; grid-template-areas: 'side main' 'duty main'; column-gap: 32px; align-items: start; }
  .tea-side { grid-area: side; } .tea-main { grid-area: main; } .tea-duty { grid-area: duty; align-self: start; }
  .tea-main .tea-h3 { margin-top: 0; }
  .tea-card { grid-column: span 6; }
}

/* ── سطح المكتب ─────────────────────────── */
@media (min-width: 1100px) {
  :root { --gutter: 32px; }
  html { scroll-padding-top: 84px; }
  .top { padding: 16px var(--gutter) 14px; }
  .top-in { grid-template-columns: 300px minmax(0, 1fr) auto; grid-template-areas: 'brand day now'; gap: 40px; }   /* 300px: the Hijri and Gregorian dates on one line */
  .now { display: flex; }
  .nf-left { display: none; }
  .rail { padding-top: 28px; }
  .board { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; padding-top: 22px; }
  .hero { padding: 30px 32px 28px; align-items: center; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); column-gap: 32px; }   /* the headline keeps two lines at 38px */
  .hero-head { align-self: center; }
  .news { font-size: 2.375rem; }
  /* the alerts sit beside the hero here, so the jump button has nothing to do */
  .cta { display: none; }
  .risk-card { display: flex; }
  .kpi-v { font-size: 2.75rem; }
  .trend-card { grid-column: span 8; }

  .subj-card { grid-column: span 4; }
  .cls-card { grid-column: span 4; }
  .vis-card { grid-column: span 12; }
  .col-a, .col-b { display: flex; flex-direction: column; gap: 22px; min-width: 0; align-self: start; }
  .col-a { grid-column: span 8; }
  .col-b { grid-column: span 4; }
  .col-a > .card, .col-b > .card { grid-column: auto; grid-row: auto; order: 0; }
  .unv-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trend { height: 300px; }
  .days, .vlist { display: none; }
  .vgrid { display: grid; grid-template-columns: 136px repeat(5, minmax(0, 1fr)); border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--grid); }
  .vg-h, .vg-p, .vg-c { padding: 10px 12px; border-bottom: 1px solid var(--grid); border-inline-start: 1px solid var(--grid); min-height: 56px; }
  .vg-c.has-v { padding-block: 12px; }
  .vg-h { min-height: 0; background: var(--m-50); font-size: .875rem; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
  .vg-h span { font-weight: 400; color: var(--ink-2); font-size: .8125rem; }
  .vg-h.is-today { background: var(--m-800); color: #fff; }
  .vg-h.is-today span { color: rgba(255,255,255,.86); font-weight: 700; }
  .vg-p { font-size: .8125rem; color: var(--ink-2); display: flex; flex-direction: column; justify-content: center; border-inline-start: 0; }
  .vg-p b { color: var(--ink); font-size: .875rem; font-weight: 700; }
  .vg-c.is-today { background: var(--m-50); }
  .vg-c.is-past { background: #fafbfb; }
  .vchip { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--grid), 0 4px 12px -10px rgba(16,36,34,.25); }
  .vchip b { font-size: .8125rem; font-weight: 700; line-height: 1.35; }
  .vchip span { font-size: .8125rem; color: var(--ink-2); line-height: 1.35; }
  .vchip .btn span { color: inherit; font-size: .8125rem; }
  .vchip .st { grid-column: 1 / -1; justify-self: start; margin-top: 6px; font-size: .75rem; }
  .vchip .st.done { color: var(--good); } .vchip .st.live { color: #fff; } .vchip .st.next { color: var(--neutral); }
  .vchip.live { box-shadow: 0 0 0 1.5px var(--series), 0 8px 20px -14px rgba(0,103,94,.45); }
  .vchip .btn { grid-column: 1 / -1; margin-top: 6px; min-height: 44px; padding: 6px 10px; font-size: .8125rem; }
  .sheet[open] { justify-content: flex-end; align-items: stretch; }
  .sheet-in { width: 480px; max-height: none; height: 100%; border-radius: 0 24px 24px 0; padding: 22px 26px 30px; }
  .sheet { direction: ltr; }
  .sheet-in { direction: rtl; }
  .sheet[open] { justify-content: flex-start; }
  .sheet-grab { display: none; }
  .sheet-top { margin-inline: -26px; padding-inline: 26px; }   /* matches .sheet-in's 26px, so the sheet does not scroll sideways */
  .toast { inset-inline: auto 32px; left: 32px; right: auto; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* small phones: the chart with its class numbers comes before the button, and the button keeps to the start (right),
   so the floating «النماذج» button rests in the empty left corner beside it, never over the class numbers */
@media (max-width: 360px) {
  .hero { gap: 14px; padding-top: 18px; }
  .scope { padding-block: 7px; }
  .board { padding-top: 12px; }
  .dots-key { margin-top: 8px; }
  .hero .cta { align-self: flex-start; padding-inline: 16px; min-height: 48px; }
  .dots-hint { flex-basis: auto; margin-inline-start: auto; }
  /* class rows further apart, so the floating button can rest between two of them hiding under 12% of each */
  .cls { gap: 16px; } .cls button { min-height: 48px; }
}
