/* Teacher dashboard (spec 7.17, task 28b): laptop-first shell with a right-hand sidebar (RTL inline-start),
   the selected section in the pane, and every teacher component. Colours come only from tokens.css
   (html[data-design] × html.dark); nothing here needs a dark-mode twin except where noted. */

/* ===================== teacher mode: the page becomes the dashboard ===================== */
body.t-mode .site-head, body.t-mode #sync-status, body.t-mode #greeting-banner, body.t-mode .site-foot { display: none !important; }
body.t-mode #main { max-width: none; padding: 0; margin: 0; }
body.t-mode::before { display: none; }
body.t-mode { --pop-shadow: 0 2px 4px rgb(0 0 0 / .06), 0 16px 40px rgb(0 0 0 / .14); }
html.dark body.t-mode { --pop-shadow: 0 16px 40px rgb(0 0 0 / .5); }
.t-app [hidden], .t-menu[hidden], .t-menu-scrim[hidden] { display: none !important; }
.t-app { --side: 248px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); transition: grid-template-columns .2s ease; }
.t-app.hidden { display: none; }
.t-app h1, .t-app h2, .t-app h3, .t-app p { margin: 0; }
:where(.t-app) button { font: inherit; color: inherit; } /* zero specificity: .btn-primary etc. keep their colours */

/* ---- small shared bits ---- */
.btn-xs { min-height: 36px; padding-inline: var(--s3); font-size: 15.5px; gap: 6px; border-radius: 10px; }
.btn-xs i { font-size: 20px; }
.btn-xs.btn-icon { width: 36px; min-height: 36px; padding: 0; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.t-btn-danger { background: var(--error-tint); color: var(--error); border: 0; }
.t-btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--error) 16%, var(--error-tint)); }
.t-icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--muted); font-size: 22px; cursor: pointer; }
.t-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.av.s { width: 32px; height: 32px; font-size: 13px; }
.t-num { font-family: var(--f-head); font-weight: 600; }
.t-mu { color: var(--muted); }
.t-loading { color: var(--muted); text-align: center; padding: var(--s6) 0; }
.help-text.lead { font-weight: 400; padding-block-end: var(--s2); }
.t-app .help-text { font-weight: 400; font-size: 14.5px; line-height: 1.6; }

/* ===================== sidebar ===================== */
.t-side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: var(--s4); background: var(--surface); border-inline-end: 1px solid var(--border); padding: var(--s4) var(--s3); overflow: hidden; z-index: 20; }
html[data-design="c"] .t-side { border-inline-end-width: 1.5px; }
.t-brand { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding-inline: var(--s1); }
.t-logo { width: 44px; height: 44px; flex: none; border-radius: var(--r-btn); display: grid; place-items: center; background: var(--surface-2); border: 1.5px dashed var(--border); color: var(--primary); font-size: 26.5px; }
html[data-design="b"] .t-logo { border-style: solid; border-width: 1px; }
.t-brand-t { min-width: 0; flex: 1; }
.t-brand-t b { display: block; font-family: var(--f-head); font-weight: var(--hw); font-size: 17.5px; line-height: 1.3; white-space: nowrap; color: var(--text); }
.t-brand-t small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-collapse i { transform: scaleX(-1); }
.t-m-acts { display: none; gap: var(--s2); align-items: center; }
.t-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.t-nav::-webkit-scrollbar { display: none; }
.t-nav a { position: relative; display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding-inline: var(--s3); border-radius: var(--r-btn); color: var(--muted); text-decoration: none; font-family: var(--f-head); font-weight: 600; font-size: 16.5px; white-space: nowrap; transition: background-color .16s, color .16s; }
.t-nav a i { font-size: 24px; flex: none; }
.t-nav a:hover { background: var(--surface-2); color: var(--text); }
.t-nav a[aria-current="page"] { background: var(--tint); color: var(--on-tint); }
html.dark .t-nav a[aria-current="page"] { color: var(--text); }
html.dark .t-nav a[aria-current="page"] i { color: var(--primary); }
html[data-design="c"] .t-nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
html[data-design="c"] .t-nav a[aria-current="page"] i { color: var(--on-primary); }
html[data-design="b"] .t-nav a[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--border); }
.t-badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding-inline: 6px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-size: 13px; font-style: normal; display: grid; place-items: center; font-family: var(--f-head); }
html[data-design="c"] .t-nav a[aria-current="page"] .t-badge { background: var(--on-primary); color: var(--primary); }
.t-nav hr { border: 0; border-block-start: 1px solid var(--border); margin: var(--s2) var(--s3); }
.t-foot { display: flex; flex-direction: column; gap: var(--s2); padding-block-start: var(--s3); border-block-start: 1px solid var(--border); }
.t-me { display: flex; align-items: center; gap: var(--s3); padding-inline: var(--s1); }
.t-me b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; line-height: 1.3; white-space: nowrap; color: var(--text); }
.t-me small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; white-space: nowrap; }
.t-foot-acts { display: flex; gap: var(--s2); }
.t-foot-acts .btn { flex: 1; min-height: 40px; font-size: 14.5px; padding-inline: var(--s2); }
.t-foot-acts .btn i { font-size: 20px; }
.t-mode-btn.theme-toggle { width: 40px; height: 40px; min-width: 40px; min-height: 40px; font-size: 20px; }

/* the 76px icon rail (desktop only) */
@media (min-width: 1024px) {
    .t-app[data-rail] { --side: 76px; }
    .t-app[data-rail] .t-brand-t, .t-app[data-rail] .t-nav a span, .t-app[data-rail] .t-me div, .t-app[data-rail] .t-foot-acts .lbl, .t-app[data-rail] .t-nav .t-badge { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .t-app[data-rail] .t-brand { flex-direction: column; gap: var(--s2); }
    .t-app[data-rail] .t-collapse i { transform: none; }
    .t-app[data-rail] .t-nav a { justify-content: center; padding: 0; }
    .t-app[data-rail] .t-nav a::after { content: ""; position: absolute; inset-block-start: 8px; inset-inline-end: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: var(--dotd, none); }
    .t-app[data-rail] .t-nav a.has-badge { --dotd: block; }
    .t-app[data-rail] .t-me { justify-content: center; }
    .t-app[data-rail] .t-foot-acts { flex-direction: column; align-items: center; }
    .t-app[data-rail] .t-foot-acts .btn { flex: none; width: 40px; padding: 0; }
}

/* ===================== pane ===================== */
.t-pane { min-width: 0; padding: var(--s6) var(--s6) 120px; }
.t-pane-in { max-width: 1320px; margin-inline: auto; }
.t-view { display: flex; flex-direction: column; gap: var(--s5); }
.t-view:focus { outline: 0; }
.t-view-body { display: flex; flex-direction: column; gap: var(--s5); }
.t-ph { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.t-ph h1 { font-family: var(--f-head); font-weight: var(--hw); font-size: 26.5px; line-height: 1.35; color: var(--text); }
.t-ph p { color: var(--muted); font-size: 15.5px; }
.t-ph-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
/* the school logo on the left of «الرئيسية» (the light or dark version is picked by .logo-card rules in app.css) */
.t-ph .t-ph-logo { background: transparent; box-shadow: none; padding: 0; border-radius: 0; width: 190px; flex: none; animation: none; }
.t-ph .t-ph-logo::after { display: none; }
@media (max-width: 767.98px) { .t-ph .t-ph-logo { width: 130px; } }
@media (max-width: 479.98px) { .t-ph .t-ph-logo { display: none; } }
.t-panel { padding: var(--s4) var(--s5) var(--s5); }
.t-panel-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; margin-block-end: var(--s3); flex-wrap: wrap; }
.t-panel-h h2 { font-family: var(--f-head); font-weight: 600; font-size: 17.5px; display: flex; align-items: center; gap: var(--s2); color: var(--text); }
.t-panel-h h2 i { font-size: 22px; color: var(--primary); }
.t-panel-h .sub { color: var(--muted); font-size: 14.5px; font-weight: 400; font-family: var(--f-body); }

/* ---- KPI cards ---- */
.t-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.t-kpi { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
.t-kpi .ic { width: 40px; height: 40px; flex: none; border-radius: var(--r-btn); display: grid; place-items: center; background: var(--tint); color: var(--on-tint); font-size: 24px; }
.t-kpi .ic.gold { background: var(--reward-tint); color: var(--warn); }
html.dark .t-kpi .ic.gold { color: var(--reward); }
.t-kpi b { display: block; font-family: var(--f-head); font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--text); }
.t-kpi b small { font-size: 15.5px; color: var(--muted); font-weight: 600; }
.t-kpi > div > span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.t-duo { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.t-stage-pick { margin-block-end: var(--s2); }

/* ---- speed ranking ---- */
.t-rk { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.t-rk li { display: grid; grid-template-columns: 28px 32px minmax(0, 1fr) 96px 56px; align-items: center; gap: var(--s3); min-height: 52px; border-block-start: 1px solid var(--border); }
.t-rk li:first-child { border-block-start: 0; }
.t-pos { font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--muted); text-align: center; }
.t-pos.m { font-size: 22px; line-height: 1; }
.t-rk .nm { min-width: 0; }
.t-rk .nm b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.t-rk .nm small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-rk .pr { display: flex; flex-direction: column; gap: 3px; }
.t-rk .pr .bar { height: 6px; }
.t-rk .pr small { font-size: 12px; color: var(--muted); line-height: 1; }
.t-rk .tm { font-family: var(--f-head); font-weight: 600; font-size: 15.5px; text-align: end; color: var(--text); white-space: nowrap; }
.t-empty-line { color: var(--muted); font-size: 15.5px; text-align: center; padding: var(--s4) 0; list-style: none; }

/* ---- live answers: one compact line each ---- */
.t-live { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding-inline: 8px; border-radius: var(--r-pill); background: var(--success-tint); color: var(--on-success); font-size: 13px; font-family: var(--f-head); font-weight: 600; white-space: nowrap; }
.t-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: tPulse 1.8s ease-out infinite; }
.t-live.is-paused { background: var(--surface-2); color: var(--muted); }
.t-live.is-paused::before { animation: none; }
@keyframes tPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.t-feed { list-style: none; margin: 0 calc(var(--s2) * -1); padding: 0 var(--s2); max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.t-feed li { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, auto) auto auto; align-items: center; gap: var(--s3); min-height: 36px; padding-block: 2px; border-block-start: 1px solid var(--border); font-size: 15.5px; }
.t-feed li:first-child { border-block-start: 0; }
.t-feed .ok { color: var(--success); font-size: 22px; }
.t-feed .no { color: var(--error); font-size: 22px; }
.t-feed .who { font-family: var(--f-head); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.t-feed .q { font-size: 14.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 18ch; }
.t-feed .sec { font-family: var(--f-head); font-weight: 600; font-size: 14.5px; min-width: 40px; text-align: end; white-space: nowrap; }
.t-feed .sec i { color: var(--warn); font-size: 16.5px; }
.t-feed .ago { color: var(--muted); font-size: 13px; min-width: 64px; text-align: end; white-space: nowrap; }
/* a laptop: the rows breathe (a longer question, a longer progress bar) */
@media (min-width: 1280px) {
    .t-feed li { min-height: 40px; }
    .t-feed .q { max-width: 30ch; }
    .t-rk li { grid-template-columns: 28px 32px minmax(0, 1fr) 128px 56px; }
}

/* ---- podium card ---- */
.t-podcard { display: grid; grid-template-columns: minmax(0, 1fr) 360px minmax(0, 1fr); gap: var(--s5); align-items: end; padding: var(--s5); position: relative; overflow: hidden; isolation: isolate; }
.t-podcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(40% 70% at 50% 100%, color-mix(in srgb, var(--reward) 16%, transparent), transparent 70%); }
.t-pod-txt { align-self: center; display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.t-pod-txt h2 { font-family: var(--f-head); font-weight: var(--hw); font-size: 20px; color: var(--text); }
.t-pod-txt p { color: var(--muted); font-size: 15.5px; max-width: 34ch; }
.t-pod-txt .btn { margin-block-start: var(--s2); text-decoration: none; }
.t-mini-pod { display: flex; align-items: flex-end; justify-content: center; gap: var(--s2); min-height: 150px; }
.t-mini-pod .t-empty-line { align-self: center; }
.mp { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mp .who { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.3; }
.mp .av { position: relative; width: 44px; height: 44px; font-size: 15.5px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 2px var(--border); }
.mp .em { position: absolute; inset-block-end: -6px; inset-inline-end: -8px; font-size: 20px; line-height: 1; }
.mp b { font-family: var(--f-head); font-weight: 600; font-size: 14.5px; margin-block-start: 6px; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp small { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); }
.mp small i, .t-pod-rest small i, .t-stars i { color: var(--warn); }
html.dark .mp small i, html.dark .t-pod-rest small i, html.dark .t-stars i { color: var(--reward); }
.blk { width: 100%; border-radius: 12px 12px 0 0; display: flex; justify-content: center; padding-block-start: 6px; font-family: var(--f-head); font-weight: 700; font-size: 20px; background: var(--surface-2); color: var(--muted); box-shadow: inset 0 1px 0 rgb(255 255 255 / .25); }
.mp1 .blk { height: 84px; background: linear-gradient(180deg, color-mix(in srgb, var(--reward) 55%, #FFFFFF), var(--reward) 70%); color: var(--on-reward); }
html.dark .mp1 .blk { color: #2A1A05; }
.mp2 .blk { height: 60px; }
.mp3 .blk { height: 44px; }
html[data-design="a"] .mp2 .blk, html[data-design="a"] .mp3 .blk { background: var(--tint); color: var(--on-tint); }
html[data-design="b"] .blk { background: var(--bg); border: 1px solid var(--border); border-block-end: 0; }
html[data-design="b"] .mp1 .blk { background: var(--reward-tint); border-color: var(--reward); color: var(--on-reward); }
html[data-design="c"] .blk { border: 2px solid var(--text); border-block-end: 0; }
html[data-design="c"] .mp1 .av { box-shadow: 0 0 0 2px var(--reward); }
.crown { font-size: 22px; color: var(--reward); margin-block-end: -2px; }
.t-pod-rest { list-style: none; margin: 0; padding: 0; align-self: center; display: flex; flex-direction: column; gap: 2px; }
.t-pod-rest li { display: flex; align-items: center; gap: var(--s3); min-height: 40px; font-size: 15.5px; }
.t-pod-rest .t-pos { width: 24px; }
.t-pod-rest b { font-family: var(--f-head); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.t-pod-rest small { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.t-podium-rise .blk { animation: tRise .56s var(--spring) both; animation-delay: var(--d, 0s); transform-origin: bottom; }
.t-podium-rise .who { animation: tPopIn .42s var(--spring) both; animation-delay: calc(var(--d, 0s) + .3s); }
@keyframes tRise { from { transform: scaleY(0); } }
@keyframes tPopIn { from { opacity: 0; transform: translateY(10px) scale(.7); } }

/* ---- tables (results, students) ---- */
.t-tbl-wrap { position: relative; max-height: 520px; overflow: auto; margin-inline: calc(var(--s5) * -1); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.t-tbl-wrap.is-tall { max-height: none; }
.t-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; color: var(--text); }
.t-tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: start; font-family: var(--f-head); font-weight: 600; font-size: 14.5px; color: var(--muted); height: 40px; padding-inline: var(--s3); border-block-end: 1px solid var(--border); white-space: nowrap; }
.t-tbl td { height: 52px; padding-inline: var(--s3); border-block-end: 1px solid var(--border); white-space: nowrap; }
.t-tbl tr > *:first-child { padding-inline-start: var(--s5); }
.t-tbl tr > *:last-child { padding-inline-end: var(--s5); }
.t-tbl tbody tr:last-child td { border-block-end: 0; }
.t-tbl tbody tr { transition: background-color .12s; }
.t-tbl tbody tr:hover, .t-tbl tbody tr.sel { background: var(--surface-2); }
.t-tbl tbody tr.sel td:first-child { box-shadow: inset -3px 0 0 var(--primary); }
.t-tbl .c-pos { width: 44px; text-align: center; }
.t-who { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.t-who b { font-family: var(--f-head); font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; }
.t-who small { display: none; }
.t-who > div { min-width: 0; }
.t-stars { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-head); font-weight: 600; }
.t-stars i { font-size: 17.5px; }
.t-acts { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: nowrap; }
.t-tbl th.c-chk, .t-tbl td.c-chk { width: 44px; }
.chk { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; margin: 0; vertical-align: middle; }
.chk-hit { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -10px -13px; cursor: pointer; }
.brk { display: none; }
.t-badges { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; max-width: 220px; }
.t-badge-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding-inline: 8px; border-radius: var(--r-pill); background: var(--reward-tint); color: var(--on-reward); font-size: 13px; font-weight: 500; white-space: nowrap; }
.t-acc { font-family: var(--f-head); font-weight: 600; }
.t-acc.hi { color: var(--success); } .t-acc.mid { color: var(--warn); } .t-acc.lo { color: var(--error); }
html.dark .t-acc.mid { color: var(--reward); }
.tl-badge i { font-size: 15.5px; }
/* status pills */
.st { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding-inline: 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; white-space: nowrap; }
.st i { font-size: 16.5px; }
.st-done { background: var(--success-tint); color: var(--on-success); }
.st-live { background: var(--tint); color: var(--on-tint); }
.st-idle { background: var(--surface-2); color: var(--muted); }
.st-none { background: transparent; color: var(--muted); border: 1px dashed var(--border); }
/* «الإشعار» column: a small round mark only, so long names keep one line */
.s-tbl .c-push { text-align: center; width: 1%; white-space: nowrap; padding-inline: 6px; }
.s-tbl th.c-push i { font-size: 20px; vertical-align: -3px; }
/* the class is already written under each name: its own column only made long names wrap */
.s-tbl .c-class { display: none; }
.pmark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 16.5px; }
.pmark.on { background: var(--success-tint); color: var(--on-success); }
.pmark.off { background: var(--error-tint); color: var(--error); }
/* certificate chips under a name, each with «سحب» */
.t-cert-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 4px; white-space: normal; }
.cert-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding-inline: 8px 2px; border-radius: var(--r-pill); background: var(--reward-tint); color: var(--on-reward); font-size: 13px; font-weight: 500; white-space: nowrap; }
.cert-chip i { color: var(--warn); font-size: 15.5px; }
html.dark .cert-chip i { color: var(--reward); }
.cert-chip button { min-height: 22px; min-width: 36px; padding: 0 8px; border-radius: var(--r-pill); background: var(--surface); color: var(--error); font-size: 13px; font-weight: 600; border: 0; cursor: pointer; }

/* ---- toolbar, filter chips, search ---- */
.t-toolbar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.t-toolbar .field { width: 280px; max-width: 100%; min-height: 44px; padding-inline: var(--s3); }
.t-toolbar .field i { font-size: 22px; }
.t-toolbar .field input { font-size: 16.5px; padding-block: 6px; }
.t-toolbar .t-scroller { flex: 1; min-width: 0; }
.t-toolbar .t-tb-end { margin-inline-start: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }
.t-scroller { display: flex; flex-wrap: nowrap; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.t-scroller::-webkit-scrollbar { display: none; }
.t-scroller > * { flex: none; }
.fchip { min-height: 36px; padding-inline: var(--s4); border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 15.5px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; transition: background-color .16s, border-color .16s; }
.fchip i { font-size: 18.5px; }
.fchip:hover { border-color: var(--muted); }
.fchip[aria-pressed="true"], .fchip[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 500; }
.fchip .n { font-family: var(--f-head); font-size: 13px; opacity: .8; }

/* ---- bulk selection bar ---- */
.t-bulk { position: sticky; bottom: 24px; z-index: 15; align-self: center; display: flex; align-items: center; gap: var(--s2); padding: 6px; padding-inline: var(--s4) 6px; border-radius: var(--r-card); background: var(--text); color: var(--bg); box-shadow: var(--pop-shadow); animation: tUp .2s cubic-bezier(.2, .8, .2, 1); }
.t-bulk b { font-family: var(--f-head); font-weight: 600; font-size: 15.5px; margin-inline-end: var(--s3); white-space: nowrap; }
.t-bulk .btn-tonal { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
.t-bulk .t-icon-btn { color: var(--bg); }
.t-bulk .t-icon-btn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
@keyframes tUp { from { transform: translateY(16px); opacity: 0; } }

/* ---- row menu: popover on a laptop, bottom sheet on a phone ---- */
.t-menu { position: fixed; z-index: 48; width: 236px; padding: var(--s2); border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--pop-shadow, 0 16px 40px rgb(0 0 0 / .18)); animation: tPop .14s ease-out; }
html.dark .t-menu { background: var(--surface-2); }
@keyframes tPop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.t-menu .grab { display: none; }
.t-menu .sheet-h { padding: var(--s2) var(--s2) var(--s3); margin-block-end: var(--s1); }
.t-menu .sheet-h b { font-size: 16.5px; line-height: 1.3; display: block; }
.t-menu .sheet-h small { font-size: 13px; }
.t-menu .av { width: 32px; height: 32px; font-size: 13px; }
.t-menu ul { list-style: none; margin: 0; padding: 0; }
.t-menu li button { width: 100%; display: flex; align-items: center; gap: var(--s3); min-height: 40px; padding-inline: var(--s2); border: 0; background: none; border-radius: 10px; font-size: 16.5px; text-align: start; color: var(--text); cursor: pointer; }
.t-menu li button i { font-size: 22px; color: var(--on-tint); }
html.dark .t-menu li button i { color: var(--primary); }
.t-menu li button:hover, .t-menu li button:focus-visible { background: var(--tint); }
.t-menu li.sep { border-block-start: 1px solid var(--border); margin-block-start: var(--s1); padding-block-start: var(--s1); }
.t-menu li.danger button, html.dark .t-menu li.danger button i, .t-menu li.danger button i { color: var(--error); }
.t-menu li.danger button:hover, .t-menu li.danger button:focus-visible { background: var(--error-tint); }
.t-menu-scrim { z-index: 47; }

/* ---- PIN tools / folds ---- */
.t-fold > summary { display: flex; align-items: center; gap: var(--s3); min-height: 44px; cursor: pointer; list-style: none; font-family: var(--f-head); font-weight: 600; font-size: 17.5px; color: var(--text); }
.t-fold > summary::-webkit-details-marker { display: none; }
.t-fold > summary > i:first-child { font-size: 24px; color: var(--primary); }
.t-fold > summary .t-chev { margin-inline-start: auto; font-size: 20px; color: var(--muted); transition: transform .2s; }
.t-fold[open] > summary .t-chev { transform: rotate(180deg); }
.t-fold > summary .sub { color: var(--muted); font-size: 14.5px; font-weight: 400; font-family: var(--f-body); }
.t-fold-body { display: flex; flex-direction: column; gap: var(--s3); padding-block-start: var(--s3); }
.t-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.t-act { display: flex; flex-direction: column; gap: 4px; }
.t-act .btn { width: 100%; }

/* ---- question bank ---- */
.t-qlist { list-style: none; margin: 0; padding: 0; }
.t-qlist > li { display: grid; grid-template-columns: 32px minmax(0, 1.4fr) minmax(0, 1fr) auto auto; align-items: center; gap: var(--s4); min-height: 64px; padding-block: var(--s2); border-block-start: 1px solid var(--border); }
.t-qlist > li:first-child { border-block-start: 0; }
.t-qlist .qn { font-family: var(--f-head); font-weight: 600; color: var(--muted); text-align: center; }
.t-qlist .qe { font-family: var(--f-math); font-weight: var(--dw); font-size: 18.5px; color: var(--text); overflow-wrap: anywhere; }
.t-qlist .qm { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.t-qlist li.off .qe { color: var(--muted); }
.t-qlist .qa { display: flex; gap: var(--s2); }
.t-qlist .tl-editor { grid-column: 1 / -1; }
.t-vis { display: inline-flex; align-items: center; gap: var(--s2); font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.chip-soft { background: var(--surface-2); color: var(--muted); }
.chip.chip-sm { height: 26px; font-size: 13px; padding-inline: 10px; }
.t-stage-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.t-stage-head .bank-stage-icon { width: 44px; height: 44px; font-size: 26.5px; border-radius: var(--r-btn); background: var(--tint); box-shadow: none; }
.t-stage-head h2 { font-family: var(--f-head); font-weight: 600; font-size: 18.5px; color: var(--text); }
.t-stage-head p { color: var(--muted); font-size: 14.5px; }
.t-stage-head .t-acts { margin-inline-start: auto; }
/* the bank: help lines, the per-stage filter chips, the «تم استخدامه» mark */
.bank-help { padding-block-end: var(--s3); }
.bank-filter-row { margin-block-start: var(--s3); }
.bank-filter-row .choice-chips { padding-block-end: 4px; }
.bank-filter-row .help-text { margin-block-start: 2px; }
.chip.bank-usage.is-unused { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); font-weight: 500; }
.t-qlist .qa:empty { display: none; }
.bank-usage-reset { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding-inline: 8px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.bank-usage-reset i { font-size: 15.5px; }
@media (hover: hover) { .bank-usage-reset:hover { background: var(--surface-2); color: var(--text); } }
.bank-usage-reset:focus-visible { outline: 3px solid rgb(var(--ln-primary-400)); outline-offset: 2px; }
/* switch */
.t-sw { position: relative; width: 40px; height: 24px; flex: none; border-radius: var(--r-pill); border: 0; background: color-mix(in srgb, var(--muted) 60%, var(--surface)); padding: 0; cursor: pointer; transition: background-color .16s; }
.t-sw::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: inset-inline-start .18s ease; }
.t-sw[aria-checked="true"] { background: var(--primary); }
.t-sw[aria-checked="true"]::after { inset-inline-start: 19px; }
.t-sw:disabled { opacity: .6; cursor: progress; }
html.dark .t-sw::after { background: var(--text); }
html.dark .t-sw[aria-checked="true"]::after { background: var(--on-primary); }
.t-sw-row { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; border: 0; background: none; cursor: pointer; font-size: 15.5px; color: var(--muted); padding: 0; }
.t-sw-row .t-sw-txt { min-width: 3.5em; text-align: start; }

/* ---- certificates ---- */
.t-certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s4); }
.t-cert { padding: var(--s3); display: flex; flex-direction: column; gap: var(--s3); }
.t-paper { aspect-ratio: 1.414; border-radius: 10px; background: #FFFDF8; color: #2A2438; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; padding: var(--s3); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06); }
.t-paper::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid var(--primary); border-radius: 6px; opacity: .7; }
.t-paper::after { content: ""; position: absolute; inset: 12px; border: 1px solid var(--primary); border-radius: 4px; opacity: .3; }
html.dark .t-paper::before, html.dark .t-paper::after { border-color: var(--deep); }
.t-paper i { font-size: 24px; color: #B45309; }
.t-paper .pt { font-family: var(--f-head); font-weight: 700; font-size: 15.5px; }
.t-paper .pn { font-family: var(--f-head); font-weight: 600; font-size: 17.5px; color: #4C1D95; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-design="b"] .t-paper .pn { color: #115E59; }
html[data-design="c"] .t-paper .pn { color: #9A3412; }
.t-paper small { font-size: 11px; color: #5B5670; }
.t-paper.is-empty { opacity: .6; }
.t-cert-m { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.t-cert-m b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; line-height: 1.3; color: var(--text); }
.t-cert-m small { display: block; color: var(--muted); font-size: 13px; }
.t-cert .t-acts { justify-content: stretch; }
.t-cert .t-acts .btn { flex: 1; }
/* «شهادة تقدير لأي طالبة»: the dashed card after the stage cards (teacher-mockup .cert-new) */
.t-cert-new { border: 1.5px dashed var(--border); background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; color: var(--muted); min-height: 240px; padding: var(--s5); cursor: pointer; font: inherit; transition: border-color .16s, background-color .16s; }
.t-cert-new:hover { border-color: var(--primary); background: var(--tint); }
.t-cert-new span { display: grid; justify-items: center; gap: var(--s2); }
.t-cert-new i { font-size: 34px; color: var(--primary); }
.t-cert-new b { display: block; font-family: var(--f-head); font-weight: 600; color: var(--text); }
.t-cert-new small { font-size: 13px; }

/* the award window (teacher-awards.js) */
.aw-search { position: relative; }
.aw-search .field { min-height: 44px; }
.aw-search .ta-list .aw-none { min-height: 44px; color: var(--muted); cursor: default; font-size: 14px; }
.aw-search .ta-list .aw-none:hover { background: none; color: var(--muted); }
.aw-picked { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-start: var(--s2); }
.aw-picked > .t-mu { font-size: 14.5px; }
.aw-chip { display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; min-height: 40px; padding-inline: 4px 2px; border-radius: var(--r-pill); background: var(--tint); color: var(--on-tint); }
.aw-chip .av { width: 28px; height: 28px; font-size: 12px; flex: none; }
.aw-chip-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.aw-chip-t b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-chip-t small { font-size: 12px; opacity: .8; }
.aw-chip.is-free { background: var(--surface-2); color: var(--text); border: 1px dashed var(--border); }
.aw-chip button { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 17.5px; }
.aw-chip button:hover { background: var(--surface); }
.aw-grades { display: flex; flex-direction: column; gap: var(--s2); }
.aw-grade { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.aw-grade-name { min-width: 6.5rem; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.aw-grade-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.aw-grade .fchip:disabled { opacity: .5; cursor: not-allowed; }
.aw-free-row { display: flex; gap: var(--s2); align-items: stretch; }
.aw-free-row .t-txt { flex: 1; min-width: 0; }

/* ---- messages ---- */
.t-msg-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s4); align-items: start; } /* «رسالة جديدة» gets the room: the class chips stay on one or two rows */
.t-sent { display: flex; flex-direction: column; gap: var(--s2); max-height: 640px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.t-app .msg-row { border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); }
.t-app .msg-row-icon { font-size: 26.5px; }
.t-app .msg-row-text { font-weight: 500; font-size: 16.5px; }
.t-app .msg-row-meta, .t-app .msg-row-att { font-weight: 400; font-size: 14.5px; }
.t-app .msg-status { font-weight: 600; }
.t-app .msg-who summary { font-weight: 600; font-size: 15.5px; color: var(--on-tint); }
html.dark .t-app .msg-who summary { color: var(--primary); }
.t-app .msg-who li { background: var(--surface-2); font-weight: 400; font-size: 15.5px; }
.t-app .msg-del, .t-app .msg-dl { min-height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px; font-size: 14.5px; font-weight: 600; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.t-app .msg-meter, .msg-progress { background: var(--tint); }
.msg-progress span, .msg-meter span { background: var(--primary) !important; }

/* ---- empty state (homework) ---- */
.t-empty { padding: var(--s7) var(--s5); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); }
.t-empty h2 { font-family: var(--f-head); font-weight: var(--hw); font-size: 22px; color: var(--text); }
.t-empty p { color: var(--muted); max-width: 46ch; font-size: 16.5px; }
.t-math-ill { position: relative; width: 260px; height: 170px; margin-block-end: var(--s2); }
.t-math-ill span { position: absolute; inset-inline-start: var(--x); inset-block-start: var(--y); width: var(--z); height: var(--z); rotate: var(--r); display: grid; place-items: center; border-radius: 14px; font-family: var(--f-head); font-weight: 700; font-size: calc(var(--z) * .5); background: var(--surface-2); color: var(--on-tint); border: 1px solid var(--border); }
html.dark .t-math-ill span { color: var(--primary); }
.t-math-ill span.hero { background: var(--primary); color: var(--on-primary); border: 0; box-shadow: var(--btn-shadow); }
.t-math-ill span.gold { background: var(--reward-tint); color: var(--warn); border-color: transparent; }
html.dark .t-math-ill span.gold { color: var(--reward); }
.t-math-ill .page { position: absolute; inset-inline-start: 84px; inset-block-start: 26px; width: 92px; height: 118px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 9px; padding: 18px 14px; }
.t-math-ill .page i { display: block; height: 6px; border-radius: 3px; background: var(--border); }
.t-math-ill .page i:nth-child(2) { width: 70%; }
.t-math-ill .page i:nth-child(4) { width: 50%; }

/* ---- show launcher ---- */
/* laptop-first: the settings panel (stage cards, the three place cards with 8 shape chips) gets the larger share */
.t-show { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
/* «تتويج المعلمة» on a laptop: the settings take the room (every place card >= 560px, so the 8 shape chips keep
   their labels in one row) and the live preview is a slim column that stays in view while she picks */
@media (min-width: 1101px) {
    #show-mine { grid-template-columns: minmax(0, 1fr) clamp(300px, 30%, 400px); }
    #show-mine > section:last-child { position: sticky; inset-block-start: var(--s5); }
    #show-mine .t-stage { aspect-ratio: 5 / 6; } /* a portrait stage: the title and the podium both fit the slim column */
    #show-mine .t-stage-h { padding-block-start: 44px; } /* the title clear of the «معاينة» tag */
}
/* a narrow laptop: the preview sits above the settings, centred, and the settings get the whole pane */
@media (min-width: 1101px) and (max-width: 1240px) {
    #show-mine { grid-template-columns: minmax(0, 1fr); }
    #show-mine > section:last-child { position: static; order: -1; width: min(100%, 560px); justify-self: center; }
    #show-mine .t-stage { aspect-ratio: 16 / 10; }
    #show-mine .t-stage-h { padding-block-start: var(--s5); }
}
.t-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s5); }
.t-steps > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--s3); }
.t-steps .sn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--on-tint); font-family: var(--f-head); font-weight: 600; font-size: 14.5px; }
.t-steps h3 { font-family: var(--f-head); font-weight: 600; font-size: 16.5px; margin-block-end: var(--s2); line-height: 28px; color: var(--text); }
.t-steps .btn { margin-block-start: var(--s2); text-decoration: none; }
.t-stage { position: relative; border-radius: var(--r-card); overflow: hidden; background: radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--primary) 45%, #120F1F), #120F1F 70%); color: #F5F3FF; aspect-ratio: 16 / 10; display: flex; flex-direction: column; isolation: isolate; }
.t-stage-h { text-align: center; padding: var(--s5) var(--s4) 0; }
.t-stage-h b { display: block; font-family: var(--f-head); font-weight: 700; font-size: 24px; }
.t-stage-h small { color: #D9D4EC; font-size: 14.5px; }
.t-stage .t-mini-pod { flex: 1; padding-inline: var(--s5); }
.t-stage .t-empty-line { color: #D9D4EC; }
.t-stage .mp b { color: #F5F3FF; }
.t-stage .mp .av { background: #2D2747; color: #F5F3FF; box-shadow: 0 0 0 2px rgb(255 255 255 / .18); }
.t-stage .mp small { color: #D9D4EC; }
.t-stage .mp small i { color: var(--reward); }
.t-stage .blk { background: rgb(255 255 255 / .12); color: #F5F3FF; border: 0; box-shadow: inset 0 1px 0 rgb(255 255 255 / .15); }
.t-stage .mp1 .blk { background: linear-gradient(180deg, #FCD34D, var(--reward) 70%); color: #2A1A05; height: 120px; }
.t-stage .mp2 .blk { height: 88px; } .t-stage .mp3 .blk { height: 64px; }
.t-stage .tag { position: absolute; inset-block-start: var(--s3); inset-inline-start: var(--s3); font-size: 13px; padding: 2px 10px; border-radius: var(--r-pill); background: rgb(255 255 255 / .12); color: #F5F3FF; }
.t-show-go { display: flex; gap: var(--s2); margin-block: var(--s4) var(--s2); flex-wrap: wrap; }
.t-show-go .btn-primary { flex: 1; }
/* the two ceremonies + «تتويج المعلمة» (teacher-crown.js) */
.t-show-mode { margin-block-end: var(--s4); }
.t-show-mode .help-text { margin-block-start: var(--s2); }
.cr-slots { display: flex; flex-direction: column; gap: var(--s3); margin-inline-start: calc(-28px - var(--s3)); } /* the place cards take the panel's full width (under the step number too) */
.cr-slot { padding: var(--s3); border-radius: var(--r-card); border: 1.5px dashed var(--border); background: var(--surface); min-width: 0; }
.cr-slot.is-set { border-style: solid; background: var(--surface-2); }
.cr-slot-h { display: flex; align-items: center; gap: var(--s2); margin-block-end: var(--s2); }
.cr-slot-h h4 { font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--text); }
.cr-slot-h small { font-size: 13px; }
.cr-badge { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 18.5px; background: var(--reward-tint); color: var(--warn); }
html.dark .cr-badge { color: var(--reward); }
.cr-slot--2 .cr-badge, .cr-slot--3 .cr-badge { background: var(--tint); color: var(--on-tint); }
.cr-slot .aw-picked { margin-block-start: 0; }
.cr-sub { font-family: var(--f-head); font-weight: 600; font-size: 13px; color: var(--muted); margin-block: var(--s2) var(--s1); }
.cr-slots > .help-text { margin: 0; }
/* the 8 shapes: ONE row, never scrolled sideways, never clipped. The chips share the card's width; a card too
   narrow for 8 labels shows the icons only (the name stays in title / aria-label and beside «الشكل: …»). */
.cr-slot { container-type: inline-size; }
.cr-sub .cr-shape-name { color: var(--text); font-weight: 600; }
.cr-shapes.choice-chips { display: flex; flex-wrap: nowrap; overflow: visible; gap: 4px; padding: 2px 0 4px; }
.cr-shapes .cc-chip { flex: 1 1 0; min-width: 0; min-height: 36px; padding: 4px 6px; gap: 4px; justify-content: center; border-radius: 12px; font-size: 13px; white-space: nowrap; }
.cr-shapes .cc-chip.is-on { transform: none; }
.cr-shapes .cc-icon { font-size: 17.5px; }
.cr-shapes .cc-text { min-width: 0; }
/* room for the labels (a laptop): each chip as wide as its own label, the spare width shared */
@container (min-width: 520px) { .cr-shapes .cc-chip { flex-basis: auto; } }
@container (max-width: 519px) {
    .cr-shapes .cc-text { display: none; }
    .cr-shapes .cc-chip { padding: 4px 0; }
}
#crown-title { margin-block-end: var(--s1); }
/* «موسيقى الحفل» inside «تتويج المعلمة»: the settings card itself, moved here (teacher-show.js placeMusicCard) */
.cr-music { margin-block-start: var(--s2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 0 var(--s3); background: var(--surface); }
.cr-music > summary { font-size: 16.5px; }
.cr-music .t-fold-body { padding-block-end: var(--s3); min-width: 0; }
.t-pod-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-start: var(--s2); }
.t-pod-acts .btn { margin: 0; }
.t-pod-txt .t-pod-acts + .help-text { margin: 0; font-size: 14.5px; }
.t-stage .cr-shape-ic { font-size: 24px; }

/* ===================== settings: sub-list + panel ===================== */
.t-settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.t-subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--s6); }
.t-subnav a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding-inline: var(--s3); border-radius: var(--r-btn); font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.t-subnav a i { font-size: 22px; }
.t-subnav a:hover { background: var(--surface-2); color: var(--text); }
.t-subnav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.t-subnav a[aria-current="page"] i { color: var(--primary); }
.t-spanels { min-width: 0; }
.t-spanel { padding: var(--s2) var(--s5) var(--s4); }
.t-spanel > h2 { font-family: var(--f-head); font-weight: 600; font-size: 18.5px; padding-block: var(--s4) var(--s1); color: var(--text); }
.t-srow { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding-block: var(--s4); border-block-start: 1px solid var(--border); }
.t-srow.col { flex-direction: column; align-items: stretch; gap: var(--s3); }
.t-srow .lbl { min-width: 0; }
.t-srow .lbl b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 16.5px; line-height: 1.4; color: var(--text); }
.t-srow .lbl .help-text { margin-block-start: 2px; }
.t-srow > .btn, .t-srow > a.btn { flex: none; text-decoration: none; }
.t-danger-row .lbl b { color: var(--error); }
.t-txt { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-btn); background: var(--surface); color: var(--text); padding: var(--s2) var(--s3); font-size: 16.5px; line-height: 1.6; resize: vertical; min-height: 44px; }
.t-txt:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.t-field-h { display: flex; justify-content: space-between; gap: var(--s2); }
/* design tiles with live mini previews */
.t-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 1240px) { .t-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .t-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.t-tile { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); border-radius: var(--r-card); border: 1.5px solid var(--border); background: var(--surface); text-align: start; cursor: pointer; transition: border-color .16s, box-shadow .16s; color: var(--text); }
.t-tile:hover { border-color: var(--muted); }
.t-tile[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.t-tile .tn { display: flex; align-items: center; justify-content: space-between; padding-inline: var(--s1); font-family: var(--f-head); font-weight: 600; font-size: 15.5px; }
.t-tile .tn i { color: var(--primary); font-size: 22px; visibility: hidden; }
.t-tile[aria-checked="true"] .tn i { visibility: visible; }
.t-tile .td { padding-inline: var(--s1); color: var(--muted); font-size: 13px; line-height: 1.5; }
.prev { height: 96px; border-radius: 10px; background: var(--pb); display: grid; grid-template-columns: 28px 1fr; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06); }
.prev .ps { background: var(--pc); display: flex; flex-direction: column; gap: 5px; padding: 8px 6px; }
.prev .ps i { display: block; height: 6px; border-radius: 3px; background: var(--pl); }
.prev .ps i:first-child { background: var(--pp); opacity: .9; }
.prev .pm { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.prev .pk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.prev .pk i, .prev .pr2 i { display: block; height: 16px; border-radius: var(--prr); background: var(--pc); box-shadow: var(--psh); }
.prev .pr2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4px; flex: 1; }
.prev .pr2 i { height: auto; }
.prev .pbtn { height: 10px; width: 46%; border-radius: var(--prr); background: var(--pp); box-shadow: var(--pbs); }
/* the tile previews always show their own design (not the page's), in the page's mode */
.tile-a { --pb: #FAF7FF; --pc: #FFFFFF; --pp: #6D28D9; --pl: #EDE5FB; --prr: 6px; --psh: 0 2px 6px rgb(76 29 149 / .12); --pbs: 0 2px 6px rgb(109 40 217 / .3); }
.tile-b { --pb: #F4FBF9; --pc: #FFFFFF; --pp: #0F766E; --pl: #DDF3EF; --prr: 4px; --psh: 0 0 0 1px #D3E6E2; --pbs: none; }
.tile-d { --pb: #FDF4FF; --pc: #FFFFFF; --pp: linear-gradient(to left, #DB2777, #7E22CE); --pl: #FCE7F3; --prr: 6px; --psh: 0 0 0 1.5px #FBCFE8; --pbs: 0 2px 6px rgb(219 39 119 / .35); }
.tile-d .ps { background: linear-gradient(180deg, #6B21A8, #DB2777 60%, #0F766E); }
.tile-d .ps i { background: rgb(255 255 255 / .55); }
.tile-d .pk i:nth-child(1) { box-shadow: 0 0 0 1.5px #E9D5FF; } .tile-d .pk i:nth-child(2) { box-shadow: 0 0 0 1.5px #FBCFE8; } .tile-d .pk i:nth-child(3) { box-shadow: 0 0 0 1.5px #FDE68A; }
.tile-e { --pb: #F5EEFF; --pc: #FFFFFF; --pp: linear-gradient(to left, #C2389A, #8B3FE0, #3A66D0); --pl: #EFE7FF; --prr: 8px; --psh: 0 0 0 1.5px #D8C7F7; --pbs: 0 2px 6px rgb(139 63 224 / .35); }
.tile-e .ps { background: linear-gradient(180deg, #E9D5FF, #FBCFE8 55%, #BAE6FD); }
.tile-e .ps i { background: rgb(255 255 255 / .75); } .tile-e .ps i:first-child { background: #7B3FE4; opacity: .75; }
.tile-e .pk i:nth-child(1) { background: #F3EEFF; box-shadow: 0 0 0 1.5px #DDD0FB; } .tile-e .pk i:nth-child(2) { background: #FDECF5; box-shadow: 0 0 0 1.5px #FBCFE8; } .tile-e .pk i:nth-child(3) { background: #FFF0E6; box-shadow: 0 0 0 1.5px #FED7C3; }
.tile-c { --pb: #FFF8F4; --pc: #FFFFFF; --pp: #C2410C; --pl: #FDE6DA; --prr: 5px; --psh: 0 0 0 1.5px #EED8CC; --pbs: 0 2px 0 #9A3412; }
html.dark .tile-a { --pb: #17132A; --pc: #231E38; --pp: #A78BFA; --pl: #352C55; --psh: none; --pbs: none; }
html.dark .tile-b { --pb: #0E1A1A; --pc: #152625; --pp: #2DD4BF; --pl: #17393A; --psh: 0 0 0 1px #26413F; }
html.dark .tile-d { --pb: #241B3A; --pc: #33284F; --pl: #4A2A5E; --psh: 0 0 0 1px #5A4878; --pbs: none; }
html.dark .tile-d .ps { background: linear-gradient(180deg, #3B0764, #9D174D 60%, #0F766E); }
html.dark .tile-d .pk i:nth-child(1) { box-shadow: 0 0 0 1.5px rgb(216 180 254 / .4); } html.dark .tile-d .pk i:nth-child(2) { box-shadow: 0 0 0 1.5px rgb(249 168 212 / .4); } html.dark .tile-d .pk i:nth-child(3) { box-shadow: 0 0 0 1.5px rgb(252 211 77 / .4); }
html.dark .tile-e { --pb: #1B1838; --pc: #262150; --pl: #3B2F6E; --psh: 0 0 0 1px #4B4288; --pbs: none; }
html.dark .tile-e .ps { background: linear-gradient(180deg, #3B2470, #6B2160 55%, #233E7A); }
html.dark .tile-e .ps i { background: rgb(255 255 255 / .45); } html.dark .tile-e .ps i:first-child { background: #D8B4FE; }
html.dark .tile-e .pk i:nth-child(1) { background: #322A63; box-shadow: 0 0 0 1.5px rgb(196 181 253 / .35); } html.dark .tile-e .pk i:nth-child(2) { background: #3D2453; box-shadow: 0 0 0 1.5px rgb(249 168 212 / .35); } html.dark .tile-e .pk i:nth-child(3) { background: #3D2A3A; box-shadow: 0 0 0 1.5px rgb(253 186 116 / .35); }
html.dark .tile-c { --pb: #1C1311; --pc: #2A1D1A; --pp: #FB923C; --pl: #43281C; --psh: 0 0 0 1.5px #4A352E; --pbs: 0 2px 0 #C2410C; }
/* segmented mode chips */
.t-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-btn); padding: 4px; width: 340px; max-width: 100%; }
.t-seg button { border: 0; background: none; min-height: 36px; padding-inline: var(--s3); border-radius: 9px; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: var(--s2); cursor: pointer; }
.t-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 2px 6px rgb(0 0 0 / .06); }
html.dark .t-seg button[aria-checked="true"] { background: var(--tint); box-shadow: none; }
.t-seg button[aria-checked="true"] i { color: var(--primary); }
.t-save-row { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; padding-block: var(--s3); margin-block-start: var(--s2); border-block-start: 1px solid var(--border); background: var(--surface); }
html.dark .t-save-row { background: var(--surface); }
.t-save-row .ap-dirty { margin: 0 auto 0 0; margin-inline: 0 auto; font-weight: 500; }
.t-save-row .ap-dirty i { font-size: 17.5px; }
.t-feat-list { display: flex; flex-direction: column; }
.t-feat { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-block: var(--s3); border-block-start: 1px solid var(--border); }
.t-feat:first-child { border-block-start: 0; }
.t-feat .lbl b { display: flex; align-items: center; gap: var(--s2); font-family: var(--f-head); font-weight: 600; font-size: 16.5px; color: var(--text); }
.t-feat .lbl b i { color: var(--primary); font-size: 20px; }
.t-hist { display: flex; flex-direction: column; gap: var(--s2); }
.t-app .ap-row { border: 1px solid var(--border); border-radius: var(--r-btn); }
.t-app .ap-row .font-black, .t-app .ap-row .font-bold { font-weight: 500 !important; }
.t-app .ap-dates input { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-weight: 400; }
.t-app .ap-dates label { font-weight: 600; font-family: var(--f-head); font-size: 15.5px; }
.t-app .ap-msg { font-weight: 500; font-size: 15.5px; }
/* legacy ap-btn inside the dashboard speaks the new button language */
.t-app .ap-btn, .t-modal .ap-btn { min-height: 44px; padding-inline: var(--s4); border-radius: var(--r-btn); font-family: var(--f-head); font-weight: 600; font-size: 15.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; }
.t-app .ap-btn i, .t-modal .ap-btn i { font-size: 22px; }
.t-app .ap-btn--primary, .t-modal .ap-btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--btn-shadow); }
.t-app .ap-btn--soft, .t-modal .ap-btn--soft { background: var(--tint); color: var(--on-tint); }
.t-app .ap-btn--ghost, .t-modal .ap-btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.t-app .ap-btn--sm { min-height: 36px; padding-inline: var(--s3); font-size: 14.5px; }
.t-app .ap-box, .t-modal .ap-box { background: var(--surface-2); border: 0; border-radius: var(--r-btn); padding: var(--s3) var(--s4); }
.t-app .ap-input, .t-modal .ap-input, .t-modal .t-txt { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-btn); background: var(--surface); color: var(--text); padding: var(--s2) var(--s3); font-size: 16.5px; line-height: 1.6; min-height: 44px; }
.t-app .ap-input:focus, .t-modal .ap-input:focus, .t-modal .t-txt:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.t-app .bank-counter { font-weight: 400; font-size: 13px; }
/* music card */
.t-app .sm-note { background: var(--reward-tint); border: 0; border-radius: var(--r-btn); }
.t-app .sm-note .help-text { color: var(--on-reward); font-weight: 500; }
.t-app .sm-part h3 { display: flex; align-items: center; gap: var(--s2); font-family: var(--f-head); font-weight: 600; font-size: 16.5px; color: var(--text); }
.t-app .sm-part h3 i { color: var(--primary); font-size: 22px; }
.t-app .sm-sub { font-family: var(--f-head); font-weight: 600; font-size: 14.5px; color: var(--muted); }
/* security */
.t-app .key-meter span { height: 6px; }
.t-app [data-sec-strength] { font-weight: 500 !important; font-size: 15.5px !important; }

/* ===================== choice chips (radio groups): the new chip language ===================== */
.cc-chip { min-height: 40px; padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: var(--f-head); font-size: 15.5px; font-weight: 600; box-shadow: none; gap: 6px; }
.cc-chip .cc-icon { font-size: 20px; }
.cc-chip .cc-icon--ph i { font-size: 20px; }
@media (hover: hover) { .cc-chip:not(.is-on):hover { border-color: var(--muted); background: var(--surface); } }
.cc-chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); transform: none; box-shadow: none; }
.cc-chip.is-on .cc-sub { color: var(--on-primary); opacity: .85; }
.cc-chip.is-on .cc-count { background: color-mix(in srgb, var(--on-primary) 22%, transparent); color: var(--on-primary); }
.cc-chip .cc-count { background: var(--tint); color: var(--on-tint); font-size: 13px; font-weight: 600; }
.cc-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cc-chip .cc-sub { font-weight: 400; font-size: 13px; }
.cc-chip--card { border-radius: var(--r-card); width: 9rem; padding: 10px; }
.cc-chip--card .cc-icon { font-size: 29.5px; }
.choice-chips { gap: var(--s2); padding: 2px 2px 6px; }
.choice-chips--scroll { scrollbar-width: none; }
.choice-chips--scroll::-webkit-scrollbar { display: none; }
.choice-chips--icons .cc-chip { border-radius: var(--r-btn); min-height: 48px; }
.press-pop { animation: none; }

/* ===================== teacher modals: one dialog language ===================== */
.t-modal { background: var(--scrim) !important; -webkit-backdrop-filter: blur(6px) saturate(.8); backdrop-filter: blur(6px) saturate(.8); }
.t-dlg { background: var(--surface); border-radius: var(--r-sheet); box-shadow: var(--pop-shadow, 0 16px 40px rgb(0 0 0 / .18)); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); color: var(--text); border: var(--bw) solid var(--card-border); }
html.dark .t-dlg { background: var(--surface-2); box-shadow: 0 16px 40px rgb(0 0 0 / .5); }
.t-dlg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.t-dlg-h h3 { display: flex; align-items: center; gap: var(--s2); font-family: var(--f-head); font-weight: var(--hw); font-size: 21px; line-height: 1.4; color: var(--text); }
.t-dlg-h h3 i { color: var(--primary); font-size: 26.5px; }
.t-dlg-h p { color: var(--muted); font-size: 15.5px; }
.t-dlg-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.t-dlg-acts .btn-primary { flex: 1; }
.t-lbl { display: block; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--text); margin-block-end: 4px; }
.t-lbl .t-mu { font-family: var(--f-body); font-weight: 400; }
.t-dlg .ap-msg, .t-dlg [role="alert"] { font-size: 15.5px; font-weight: 500; color: var(--error); }
.t-dlg .t-sec { background: var(--surface-2); border-radius: var(--r-btn); padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
html.dark .t-dlg .t-sec { background: var(--surface); }
.t-dlg .t-sec h4 { display: flex; align-items: center; gap: var(--s2); font-family: var(--f-head); font-weight: 600; font-size: 16.5px; color: var(--text); }
.t-dlg .t-sec h4 i { color: var(--primary); }
.t-line { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 36px; font-size: 15.5px; }
.t-line + .t-line { border-block-start: 1px solid var(--border); }
.t-line .ok { color: var(--success); } .t-line .no { color: var(--error); }
.t-reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.t-reward-grid button { min-height: 52px; border-radius: var(--r-btn); background: var(--reward-tint); color: var(--on-reward); border: 1px solid transparent; font-family: var(--f-head); font-weight: 600; font-size: 16.5px; cursor: pointer; }
.t-reward-grid button:hover { border-color: var(--reward); }
.t-modal .bank-opt input[type="text"] { border: 1.5px solid var(--border) !important; border-radius: var(--r-btn) !important; font-weight: 500 !important; }
.t-modal .bank-opt.is-correct input[type="text"] { border-color: var(--success) !important; background: var(--success-tint); }
.t-modal .msg-preset { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 500; font-size: 15.5px; border-radius: var(--r-btn); }
.t-modal .msg-preset:hover { background: var(--tint); }
.t-pin-big { text-align: center; font-family: var(--f-head); font-size: 29.5px; letter-spacing: .4em; direction: ltr; }

/* ===================== responsive ===================== */
/* a long full name may wrap rather than push the row out of its card (1024 / 1366 beside the sidebar) */
@media (min-width: 768px) { .s-tbl td.c-name, .r-tbl td.c-name { white-space: normal; min-width: 10rem; } }
@media (min-width: 768px) and (max-width: 1100px) {
    .s-tbl .c-last { display: none; } /* too tight beside the sidebar; back from 1101px and on phones */
}
@media (max-width: 1240px) {
    .t-podcard { grid-template-columns: minmax(0, 1fr) 320px; }
    .t-pod-rest { display: none; }
}
@media (min-width: 768px) and (max-width: 1240px) {
    .s-tbl .c-class { display: none; }
    .s-tbl td.c-name { white-space: normal; min-width: 9rem; }
    .s-tbl .cert-chip { white-space: normal; } /* «المرحلة ١ · الثالث» may wrap instead of widening the table */
    .s-tbl .t-who small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
    .s-tbl .t-who b { display: block; line-height: 1.3; }
    .s-tbl .t-acts .btn:not(.btn-icon) { width: 36px; padding: 0; }
    .s-tbl .t-acts .bl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .r-tbl .c-class, .r-tbl .c-badges { display: none; }
}
@media (max-width: 1100px) {
    .t-duo, .t-show, .t-msg-grid { grid-template-columns: minmax(0, 1fr); }
    .t-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* below lg: the sidebar becomes a top bar with a single-row scrollable tab strip, and settings' sub-list a chip row */
@media (max-width: 1023.98px) {
    .t-app { display: block; }
    .t-side { position: sticky; top: 0; height: auto; padding: 0; gap: 0; border-inline-end: 0; border-block-end: 1px solid var(--border); overflow: visible; }
    .t-brand { min-height: 60px; padding-inline: var(--s4); }
    .t-logo { width: 36px; height: 36px; font-size: 22px; border-radius: 10px; }
    .t-brand-t small { display: none; }
    .t-collapse { display: none; }
    .t-m-acts { display: flex; }
    .t-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; gap: var(--s1); padding: 0 var(--s4) var(--s2); scroll-snap-type: x proximity; }
    .t-nav a { flex: none; min-height: 40px; padding-inline: var(--s3); font-size: 15.5px; gap: 6px; scroll-snap-align: start; }
    .t-nav a i { font-size: 22px; }
    .t-nav hr { display: none; }
    .t-badge { min-width: 20px; height: 20px; }
    .t-foot { display: none; }
    .t-pane { padding: var(--s5) var(--s4) 128px; }
    .t-settings { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
    .t-subnav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: var(--s2); margin-inline: calc(var(--s4) * -1); padding-inline: var(--s4); }
    .t-subnav::-webkit-scrollbar { display: none; }
    .t-subnav a { flex: none; min-height: 36px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 15.5px; }
    .t-subnav a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: none; }
    .t-subnav a[aria-current="page"] i { color: var(--on-primary); }
}
/* phone */
@media (max-width: 767.98px) {
    .t-view { gap: var(--s4); }
    .t-ph h1 { font-size: 23px; }
    .t-panel { padding: var(--s4); }
    .t-kpis { gap: var(--s2); }
    .t-kpi { padding: var(--s3); gap: var(--s2); }
    .t-kpi .ic { width: 34px; height: 34px; font-size: 21px; border-radius: 10px; }
    .t-kpi b { font-size: 20px; }
    .t-kpi > div > span { font-size: 13px; }
    .t-rk li { grid-template-columns: 24px 32px minmax(0, 1fr) 64px 48px; gap: var(--s2); }
    .t-feed li { grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: var(--s2); }
    .t-feed .q { display: none; }
    .t-feed .ago { min-width: 0; }
    .t-podcard { grid-template-columns: minmax(0, 1fr); padding: var(--s4); gap: var(--s4); }
    .t-pod-txt { order: 2; align-items: stretch; }
    .t-pod-txt .btn { width: 100%; }
    /* tables become stacked rows */
    .t-tbl-wrap { max-height: none; overflow: visible; margin-inline: 0; }
    .t-tbl, .t-tbl tbody { display: block; }
    .t-tbl thead { display: none; }
    .t-tbl tr > *:first-child, .t-tbl tr > *:last-child { padding-inline: 0; }
    .t-tbl tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-block: var(--s3); border-block-start: 1px solid var(--border); }
    .t-tbl tbody tr:first-child { border-block-start: 0; }
    .t-tbl tbody tr:hover { background: none; }
    .t-tbl tbody tr.sel td:first-child { box-shadow: none; }
    .t-tbl td { display: block; height: auto; padding: 0; border: 0; font-size: 14.5px; white-space: normal; }
    .t-tbl td[data-l]::before { content: attr(data-l) " "; color: var(--muted); font-family: var(--f-body); font-weight: 400; }
    .t-who small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; font-weight: 400; }
    .t-who b { display: block; line-height: 1.3; }
    .t-tbl .c-name { flex: 1 1 0; min-width: 0; }
    .t-tbl .brk { display: block !important; flex-basis: 100%; height: 0; }
    .t-tbl .c-class, .t-tbl .c-badges { display: none; }
    .t-tbl .c-act { flex-basis: 100%; }
    .t-tbl .c-pos { width: auto; }
    .t-acts { justify-content: flex-start; }
    .t-tbl .t-acts .btn-xs { min-height: 40px; }
    .t-tbl .t-acts .btn-xs:not(.btn-icon) { flex: 1; }
    .t-tbl .t-acts .btn-xs.btn-icon { width: 44px; }
    .s-tbl .c-meta { padding-inline-start: 32px; }
    .r-tbl td { order: 3; }
    .r-tbl td.c-pos { order: 0; }
    .r-tbl td.c-name { order: 0; }
    .r-tbl td.c-stars { order: 1; }
    .r-tbl td.brk { order: 2; }
    .r-tbl td.c-act { order: 4; flex-basis: auto; margin-inline-start: auto; }
    .t-toolbar .field { width: 100%; }
    .t-toolbar .t-scroller { flex-basis: 100%; order: 3; margin-inline: calc(var(--s4) * -1); padding-inline: var(--s4); }
    .t-toolbar .t-tb-end { order: 2; flex: 1; margin-inline-start: 0; }
    .t-toolbar .t-tb-end .btn { flex: 1; }
    .t-bulk { bottom: 16px; width: 100%; flex-wrap: nowrap; padding-inline: var(--s3) 4px; }
    .t-bulk b { margin-inline-end: auto; }
    .t-bulk .lbl { display: none; }
    .t-bulk .btn { width: 40px; padding: 0; }
    .t-menu { inset-inline: 0 !important; inset-block-end: 0 !important; top: auto !important; left: 0 !important; width: auto; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: var(--s2) var(--s4) calc(28px + env(safe-area-inset-bottom, 0px)); border: 0; animation: tSheet .22s cubic-bezier(.2, .8, .2, 1); }
    .t-menu li button { min-height: 48px; font-size: 17.5px; }
    .t-menu .grab { display: block; }
    @keyframes tSheet { from { transform: translateY(40px); opacity: 0; } }
    .t-qlist > li { grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--s2) var(--s3); }
    .t-qlist .qm { grid-column: 2 / -1; grid-row: 2; }
    .t-qlist .t-vis { grid-column: 3; grid-row: 1; }
    .t-qlist .qa { grid-column: 2 / -1; grid-row: 3; }
    .t-tiles { grid-template-columns: minmax(0, 1fr); }
    .t-tile { display: grid; grid-template-columns: 110px 1fr; align-items: center; }
    .t-tile .prev { grid-row: 1 / 3; height: 76px; }
    .t-srow { flex-direction: column; align-items: stretch; gap: var(--s3); }
    .t-srow > .btn, .t-srow > a.btn { align-self: flex-start; }
    .t-spanel { padding: var(--s1) var(--s4) var(--s3); }
    .t-certs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
    .t-math-ill { transform: scale(.85); }
    .t-seg { width: 100%; }
    .t-dlg { padding: var(--s4); }
}
@media (max-width: 400px) {
    .t-brand-t b { font-size: 16.5px; }
    .t-m-acts .btn { width: 40px; padding: 0; }
    .t-m-acts .btn .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .t-live::before, .t-podium-rise .blk, .t-podium-rise .who, .t-bulk, .t-menu { animation: none !important; }
}
html.no-motion .t-live::before, html.no-motion .t-podium-rise .blk, html.no-motion .t-podium-rise .who { animation: none !important; }
.t-msg-grid .t-panel:not(.t-fold) { display: flex; flex-direction: column; gap: var(--s2); }
.t-msg-grid .t-panel .t-panel-h { margin-block-end: 0; }
.t-sw-row[aria-checked="true"] .t-sw { background: var(--primary); }
.t-sw-row[aria-checked="true"] .t-sw::after { inset-inline-start: 19px; }
html.dark .t-sw-row[aria-checked="true"] .t-sw::after { background: var(--on-primary); }
.t-app .ap-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); }
.t-app .ap-row-t { flex: 1; min-width: 0; }
.t-app .ap-row-t b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--text); }
.t-app .ap-row-t small { display: block; color: var(--muted); font-size: 13px; }
.t-spanel .t-srow:first-of-type { border-block-start: 0; }
.t-spanel > .help-text.lead + div > .t-srow:first-child, .t-spanel > h2 + div > .t-srow:first-child { border-block-start: 0; }
.bank-opt-row { display: flex; align-items: center; gap: var(--s2); }
.bank-opt-row .t-txt { flex: 1; min-width: 0; }
.t-app .tl-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding-inline: 10px; border-radius: var(--r-pill); border: 1px dashed var(--border); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.t-app .tl-toggle.has-limit { border-style: solid; background: var(--tint); color: var(--on-tint); }
.t-app .tl-toggle i { font-size: 16.5px; }
.t-app .tl-editor { background: var(--surface-2); border-radius: var(--r-btn); padding: var(--s3); margin-block: var(--s2); }
.t-app .tl-label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-head); font-weight: 600; font-size: 15.5px; color: var(--text); }
.t-app .tl-chip { font-weight: 500; }
.t-panel > .t-stage-head + .tl-editor { margin-block: var(--s3); }
.t-panel > .btn-ghost:last-child { margin-block-start: var(--s2); }
.chip.chip-tint { background: var(--tint); color: var(--on-tint); }
.chip.chip-sm i { font-size: 15.5px; }
.t-qlist .bank-q { margin: 0; padding-inline: 0; border-radius: 0; box-shadow: none; background: none; }

/* small text helpers used by the security, music and confirm panels */
.t-confirm-text { margin: 0; font-size: 17.5px; line-height: 1.7; color: var(--text); }
.t-ok { margin: 0; min-height: 1.4em; font-size: 15.5px; font-weight: 600; color: var(--success); }
.t-ok:empty { min-height: 0; }
.sm-h { display: inline-flex; align-items: center; gap: 6px; font-size: 16.5px; font-weight: 700; color: var(--text); }
.sm-h i { color: var(--primary); }
.t-key { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; direction: ltr; text-align: left; }
.t-rk > li.spd-empty { display: block; min-height: 0; padding: var(--s4) var(--s2); border: 0; color: var(--muted); text-align: center; line-height: 1.8; }
/* the podium circle shows the place medal (🥇🥈🥉) instead of the name's letters */
.mp .av.av-medal { font-size: 27.5px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.mp1 .av.av-medal { font-size: 34px; }
/* «نتائج الطالبات»: the green «أرسلت» beside a girl who finished the latest challenge */
.t-sent { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 8px; padding: 1px 9px; border-radius: 999px; background: var(--success-tint); color: var(--success); font-size: 13px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.t-sent i { font-size: 15.5px; }
.t-sent.is-mid { background: var(--reward-tint); color: var(--on-reward); }
.r-tbl tr.is-sent .av { box-shadow: 0 0 0 2px var(--success); }
.t-ok { color: var(--success); font-weight: 700; }
.t-res-latest { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: 15px; color: var(--success); }
.t-res-latest:empty { display: none; }
.t-feed > li.spd-empty { display: block; min-height: 0; padding: var(--s4) var(--s2); border: 0; color: var(--muted); text-align: center; line-height: 1.8; }
.t-feed .q { max-width: 24ch; }
/* the six themes added on 2026-11-06: side strip = the theme's deep colour, button = its primary, chips = tint + accent */
.tile-f { --pb: #FBF7F0; --pc: #FFFFFF; --pp: #D4AF37; --pl: #F1EAFF; --prr: 7px; --psh: 0 0 0 1px #E9DFC7; --pbs: 0 2px 6px rgb(212 175 55 / .35); }
.tile-f .ps { background: #4C2A85; } .tile-f .ps i { background: rgb(255 255 255 / .35); } .tile-f .ps i:first-child { background: #D4AF37; }
.tile-g { --pb: #FFF6F7; --pc: #FFFFFF; --pp: #2F9C8F; --pl: #FFE3EA; --prr: 8px; --psh: 0 0 0 1.5px #F6D5DD; --pbs: 0 2px 6px rgb(47 156 143 / .3); }
.tile-g .ps { background: #F8C8D4; } .tile-g .ps i { background: rgb(255 255 255 / .7); } .tile-g .ps i:first-child { background: #2F9C8F; }
.tile-h { --pb: #F2F8FF; --pc: #FFFFFF; --pp: #F08A5D; --pl: #E3F0FF; --prr: 6px; --psh: 0 0 0 1px #D6E6FA; --pbs: 0 2px 6px rgb(240 138 93 / .3); }
.tile-h .ps { background: #3B6FB6; } .tile-h .ps i { background: rgb(255 255 255 / .35); } .tile-h .ps i:first-child { background: #FFB38A; }
.tile-i { --pb: #FBF4F8; --pc: #FFFFFF; --pp: #B8326F; --pl: #FBE3EF; --prr: 8px; --psh: 0 0 0 1.5px #EFD3E3; --pbs: 0 2px 6px rgb(184 50 111 / .35); }
.tile-i .ps { background: #6B1D4F; } .tile-i .ps i { background: rgb(255 255 255 / .35); } .tile-i .ps i:first-child { background: #F4A6C8; }
.tile-j { --pb: #F4F7F1; --pc: #FFFFFF; --pp: #C97B63; --pl: #E6F0DF; --prr: 6px; --psh: 0 0 0 1px #DDE7D6; --pbs: 0 2px 6px rgb(201 123 99 / .3); }
.tile-j .ps { background: #5E7D5A; } .tile-j .ps i { background: rgb(255 255 255 / .35); } .tile-j .ps i:first-child { background: #F2C6B4; }
.tile-k { --pb: #1E1B33; --pc: #2A2647; --pp: #F472B6; --pl: #3B3566; --prr: 7px; --psh: 0 0 0 1px #3B3566; --pbs: 0 2px 6px rgb(244 114 182 / .35); }
.tile-k .ps { background: #14122A; } .tile-k .ps i { background: rgb(255 255 255 / .2); } .tile-k .ps i:first-child { background: #F9A8D4; }
html.dark .tile-f { --pb: #19142A; --pc: #251E3C; --pl: #3A2F5E; --psh: 0 0 0 1px #56482E; --pbs: none; }
html.dark .tile-g { --pb: #24141B; --pc: #331D27; --pl: #4A2636; --psh: 0 0 0 1px #5E3646; --pbs: none; }
html.dark .tile-h { --pb: #101B2C; --pc: #18263D; --pl: #203A5E; --psh: 0 0 0 1px #34507A; --pbs: none; }
html.dark .tile-i { --pb: #1F0F19; --pc: #2E1626; --pl: #4A2140; --psh: 0 0 0 1px #5E3053; --pbs: none; }
html.dark .tile-j { --pb: #141B12; --pc: #1F2A1C; --pl: #2E4129; --psh: 0 0 0 1px #3C5236; --pbs: none; }

/* «تقرير للمديرة» window (teacher-report.js) */
.rp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin-block-end: var(--s3); }
.rp-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s3) var(--s2); border-radius: var(--r-card); background: var(--surface-2); text-align: center; }
.rp-tile i { font-size: 24px; color: var(--primary); }
.rp-tile b { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.2; }
.rp-tile span { font-size: 14.5px; color: var(--muted); }
.rp-tbl td, .rp-tbl th { white-space: nowrap; }
.rp-note { display: flex; align-items: flex-start; gap: 6px; margin: var(--s3) 0 0; font-size: 15.5px; color: var(--muted); }
.rp-note i { color: var(--primary); margin-block-start: 2px; }
@media (max-width: 559.98px) { .rp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* «بحاجة متابعة» on «الرئيسية» */
.fu-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s2); }
.fu-list li { display: flex; flex-direction: column; gap: 6px; padding: var(--s2) var(--s3); border-radius: var(--r-btn); border: 1px solid var(--border); background: var(--surface); }
.fu-list li.t-empty-line { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 6px; border: 0; background: none; padding: 0; }
.fu-list .nm { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.fu-list .nm small { color: var(--muted); font-size: 13px; }
.fu-why { display: flex; flex-wrap: wrap; gap: 6px; }
.fu-chip { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--error-tint); color: var(--error); }
.fu-card .chh-more { margin-block-start: var(--s2); }

/* «إضافة من ملف Excel» (teacher-import.js) */
.im-steps { list-style: none; margin: 0 0 var(--s3); padding: 0; counter-reset: im; display: grid; gap: var(--s2); }
.im-steps li { counter-increment: im; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "n b a" "n s a"; align-items: center; column-gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-btn); background: var(--surface-2); }
.im-steps li::before { content: counter(im); grid-area: n; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; font-size: 15.5px; }
.im-steps li > b { grid-area: b; }
.im-steps li > span { grid-area: s; font-size: 14.5px; color: var(--muted); }
.im-steps li > .btn, .im-steps li > .im-pick { grid-area: a; }
.im-pick { cursor: pointer; }
.im-pick:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
#im-preview { display: grid; gap: var(--s2); }
#im-preview p { margin: 0; display: flex; align-items: flex-start; gap: 6px; font-size: 15.5px; }
.im-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.im-plan li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r-btn); }
.im-plan .im-n { font-weight: 800; color: var(--success); }
.im-plan small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
@media (max-width: 559.98px) { .im-steps li { grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "n b" "n s" "n a"; row-gap: 6px; } .im-steps li > .btn, .im-steps li > .im-pick { justify-self: start; } }

/* ===== «رمز المشاهدة»: the principal only reads (the server refuses every change anyway) ===== */
.t-viewer-bar { display: none; }
html.t-viewer .t-viewer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--primary-soft, rgba(124, 58, 237, .1)); color: var(--ink, inherit); font-size: 15.5px; }
html.t-viewer .t-viewer-bar i { font-size: 22px; color: var(--primary); }
html.t-viewer .t-viewer-bar span { color: var(--muted, inherit); }
html.t-viewer #t-nav a[data-sec="questions"], html.t-viewer #t-nav a[data-sec="certs"], html.t-viewer #t-nav a[data-sec="messages"],
html.t-viewer #t-nav a[data-sec="show"], html.t-viewer #t-nav a[data-sec="wheel"], html.t-viewer #t-nav a[data-sec="groups"], html.t-viewer #t-nav a[data-sec="tq"], html.t-viewer #t-nav a[data-sec="race"], html.t-viewer #t-nav a[data-sec="settings"], html.t-viewer #t-nav hr,
html.t-viewer .t-me small,
/* الرئيسية */
html.t-viewer [data-chh="edit"], html.t-viewer [data-chh="cancel"], html.t-viewer [data-chh="crown"], html.t-viewer [data-chh="rank-crown"],
html.t-viewer [data-chh="rank-certs"], html.t-viewer [data-chh="results-crown"], html.t-viewer #sec-results a[href="#questions"],
html.t-viewer #sec-results a[href="#show"], html.t-viewer [data-msg-one], html.t-viewer [data-help="results.message"],
/* الطالبات */
html.t-viewer #st-add, html.t-viewer #st-file, html.t-viewer #sec-students .chk-hit, html.t-viewer #sec-students [data-more],
html.t-viewer #sec-students [data-act="message"], html.t-viewer #st-bulk, html.t-viewer #st-pins, html.t-viewer [data-pins],
html.t-viewer [data-revoke], html.t-viewer #sec-students .help-text, html.t-viewer #modal-student-details [data-act],
/* الواجبات */
html.t-viewer [data-hw="new"], html.t-viewer [data-hw-more], html.t-viewer [data-hw-grade], html.t-viewer [data-hw="remind"],
html.t-viewer [data-hw-filter="draft"], html.t-viewer .hw-card:has([data-to="edit"]), html.t-viewer #sec-homework .hw-helps { display: none !important; }
.t-viewer-hi { flex-basis: 100%; font-size: 20px; font-weight: 900; color: var(--primary); }
.t-viewer-hi[hidden] { display: none; }
.vw-hi-ideas { display: grid; gap: 6px; }
.vw-idea { display: block; width: 100%; text-align: start; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line, rgba(0, 0, 0, .1)); background: transparent; color: inherit; font: inherit; font-size: 15.5px; cursor: pointer; }
.vw-idea:hover, .vw-idea:focus-visible { border-color: var(--primary); background: var(--primary-soft, rgba(124, 58, 237, .08)); }
/* «الإعدادات ← الأمان ← رموز المشاهدة» */
.vw-card { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line, rgba(0, 0, 0, .1)); display: grid; gap: 12px; }
.vw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vw-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18.5px; font-weight: 800; }
.vw-card h3 i { color: var(--primary); font-size: 24px; }
.vw-card > p { margin: 0; }
.vw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vw-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line, rgba(0, 0, 0, .1)); border-radius: 14px; }
.vw-list > li.vw-empty { justify-content: flex-start; color: var(--muted, inherit); border-style: dashed; }
.vw-who { display: grid; gap: 3px; min-width: 0; }
.vw-who b { font-size: 17.5px; font-weight: 800; }
.vw-who small { display: flex; align-items: center; gap: 5px; font-size: 14.5px; color: var(--muted, inherit); }
.vw-visits.is-on { color: var(--success); font-weight: 700; }
.vw-row-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.vw-form { display: grid; gap: 8px; padding: 16px; border-radius: 14px; background: var(--primary-soft, rgba(124, 58, 237, .06)); }
.vw-form[hidden] { display: none; }
.vw-form h4 { margin: 0 0 4px; font-size: 16.5px; font-weight: 800; }
.vw-form .lbl { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.vw-name-ideas { display: flex; gap: 6px; flex-wrap: wrap; }
.vw-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.vw-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 2px dashed var(--primary); background: var(--primary-soft, rgba(124, 58, 237, .08)); }
.vw-code[hidden] { display: none; }
.vw-for { font-weight: 800; }
.vw-num { font-size: 29.5px; font-weight: 900; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.vw-code small { flex-basis: 100%; color: var(--muted, inherit); font-size: 14.5px; }

/* «رسالة الترحيب» box (view codes) */
.vh-dlg { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 28px 28px 24px; }
.vh-dlg .vh-logo.logo-card { width: min(260px, 80%); background: transparent; box-shadow: none; padding: 0; border: 0; animation: none; }
.vh-dlg .vh-logo.logo-card::after { display: none; }
.vh-logo img { width: 100%; height: auto; }
.vh-deco { margin: 4px 0 0; color: var(--gold, #d4a017); letter-spacing: .5em; font-size: 15.5px; }
.vh-text { margin: 0; font-size: 26.5px; line-height: 1.6; font-weight: 900; color: var(--primary); }
.vh-from { margin: 0; font-size: 16.5px; color: var(--muted, inherit); }
.vh-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--primary-soft, rgba(124, 58, 237, .08)); font-size: 14.5px; }
.vh-go { min-width: 160px; justify-content: center; }

/* «ملاحظتك تهمّني» (view codes) and «ملاحظات الزوار» (teacher-notes.js) */
html.t-viewer .t-viewer-bar .vn-open { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 800; font-size: 15.5px; box-shadow: 0 4px 12px -6px var(--primary); }
html.t-viewer .t-viewer-bar .vn-open i { color: inherit; font-size: 20px; }
html.t-viewer .t-viewer-bar .vn-open:hover { filter: brightness(1.08); }
html.t-viewer [data-vn-slot] { display: none !important; }
.vn-slot-msgs:not(:empty) { margin: 0 0 16px; }
.vn-form { display: grid; gap: 6px; }
.vn-text { width: 100%; min-height: 150px; resize: vertical; line-height: 1.8; }
.vn-left { margin: 0; font-size: 14.5px; color: var(--muted, inherit); }
.vn-thanks { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 8px 0 4px; }
.vn-thanks-ic { margin: 0; font-size: 46.5px; line-height: 1; }
.vn-thanks h4 { margin: 0; font-size: 22px; font-weight: 900; color: var(--primary); }
.vn-thanks p { margin: 0 0 6px; color: var(--muted, inherit); }
.vn-n { font-size: 14.5px; font-weight: 800; color: var(--primary); }
.vn-seen { display: inline-flex; align-items: center; gap: 6px; }
.vn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vn-item { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line, rgba(0, 0, 0, .1)); }
.vn-item.is-new { border-color: var(--primary); background: var(--primary-soft, rgba(124, 58, 237, .06)); }
.vn-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vn-meta b { font-weight: 800; }
.vn-meta small { color: var(--muted, inherit); font-size: 14.5px; }
.vn-new { padding: 1px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.vn-del { margin-inline-start: auto; }
.vn-sure { font-size: 14.5px; font-weight: 800; color: var(--error, #b42318); white-space: nowrap; padding-inline: 6px; }
.vn-body { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }

/* the red number on «الرسائل»: new visitor notes (teacher-notes.js) */
.t-nav .t-badge--new { background: #DC2626; color: #fff; margin-inline-start: 6px; box-shadow: 0 0 0 2px var(--surface, #fff); }
.t-nav #t-msg-badge:not([hidden]) + .t-badge--new { margin-inline-start: 4px; }
.t-nav #t-msg-badge[hidden] + .t-badge--new { margin-inline-start: auto; }
.t-nav a[aria-current="page"] .t-badge--new { background: #DC2626; color: #fff; }
@media (min-width: 1024px) {
    .t-app[data-rail] .t-nav .t-badge--new:not([hidden]) { position: absolute; width: auto; height: 18px; min-width: 18px; padding-inline: 4px; overflow: visible; clip: auto; top: 2px; inset-inline-start: 4px; font-size: 11px; }
}

/* «الشواهد» (teacher-evidence.js): the bar, the sections as small tables, «أضيفي شاهدًا» on the side */
#sec-evidence { font-size: 17.5px; }
.ev-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 18px; }
.ev-bar .ev-range { color: var(--muted); font-weight: 700; font-size: 15.5px; }
.ev-bar .ev-acts { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ev-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--tint); color: var(--primary); font-weight: 700; font-size: 15px; white-space: nowrap; }
.ev-pill.is-own, .ev-tag { background: #FDE7F3; color: #9D1F63; }
html.dark .ev-pill.is-own, html.dark .ev-tag { background: rgb(236 72 153 / .18); color: #F9A8D4; }
.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.ev-grid.is-view { grid-template-columns: minmax(0, 1fr); }
.ev-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 20px; padding: 16px 18px; margin-bottom: 16px; }
.ev-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 21px; }
.ev-card h2 em, .ev-secs em { font-style: normal; display: inline-grid; place-items: center; flex: none; border-radius: 50%; }
.ev-card h2 em { width: 32px; height: 32px; background: var(--primary); color: var(--on-primary); font-size: 16px; }
.ev-card h2 i { color: var(--primary); font-size: 24px; }
.ev-tbl { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden; font-size: 16.5px; }
.ev-tbl th { background: var(--tint); color: var(--primary); font-weight: 800; font-size: 15px; text-align: start; padding: 9px 14px; }
.ev-tbl td { padding: 10px 14px; border-top: 1px solid var(--card-border); vertical-align: middle; line-height: 1.6; overflow-wrap: anywhere; }
.ev-tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--tint) 30%, transparent); }
.ev-tbl tr.is-own td { background: color-mix(in srgb, #FDE7F3 55%, transparent); }
html.dark .ev-tbl tr.is-own td { background: rgb(236 72 153 / .08); }
.ev-tbl .ev-d { width: 100px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.ev-tbl .ev-a { width: 92px; text-align: end; white-space: nowrap; }
.ev-tag { display: inline-block; margin-inline-start: 6px; padding: 1px 10px; border-radius: 99px; font-size: 13.5px; font-weight: 700; vertical-align: 1px; }
.ev-ib { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 36px; height: 36px; padding: 0 8px; margin-inline-start: 4px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--surface); color: var(--primary); font: inherit; font-size: 18px; cursor: pointer; }
.ev-ib:hover { background: var(--tint); }
.ev-ib.is-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.ev-ib b { font-size: 13.5px; }
.ev-empty { margin: 0; padding: 14px; border: 1.5px dashed var(--card-border); border-radius: 14px; color: var(--muted); text-align: center; }
.ev-side { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 20px; padding: 18px; }
.ev-side h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 21px; }
.ev-side h2 i { color: var(--primary); }
.ev-lbl { display: block; margin: 12px 0 6px; font-weight: 800; font-size: 15.5px; }
.ev-secs { display: grid; gap: 6px; }
.ev-secs button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--card-border); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.ev-secs em { width: 26px; height: 26px; background: var(--tint); color: var(--primary); font-size: 14px; }
.ev-secs button[aria-checked="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--tint) 60%, var(--surface)); }
.ev-secs button[aria-checked="true"] em { background: var(--primary); color: var(--on-primary); }
.ev-side input, .ev-side textarea { width: 100%; box-sizing: border-box; font-size: 16.5px; }
.ev-side textarea { min-height: 88px; resize: vertical; font-family: inherit; line-height: 1.6; }
.ev-side .ev-save { width: 100%; justify-content: center; margin-top: 12px; }
.ev-side .ev-save + .ev-save { margin-top: 6px; }
.ev-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
@media (max-width: 1100px) {
    .ev-grid { grid-template-columns: minmax(0, 1fr); }
    .ev-side { position: static; order: -1; }
}
@media (max-width: 700px) {
    .ev-bar .ev-acts { margin-inline-start: 0; width: 100%; }
    .ev-bar .ev-acts .btn { flex: 1; justify-content: center; }
    .ev-tbl .ev-d { width: 84px; }
    .ev-tbl th, .ev-tbl td { padding-inline: 10px; }
}

/* a view code: «الشواهد» shows only with «تشوف الشواهد», and only to read */
html.t-viewer:not(.t-viewer-ev) #t-nav a[data-sec="evidence"], html.t-viewer:not(.t-viewer-ev) [data-rp="portfolio"],
html.t-viewer .ev-side { display: none !important; }
.vw-ev { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--card-border); cursor: pointer; }
.vw-ev input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.vw-ev b { display: block; }
.vw-ev small { color: var(--muted); }
.vw-ev-line { color: var(--primary); }

/* «تقرير المعلمة» page (teacher-report.js) */
#sec-report { font-size: 17.5px; }
.rp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 18px; }
.rp-bar .rp-range { color: var(--muted); font-weight: 700; }
#report-host #rp-body { background: var(--surface); border: 1px solid var(--card-border); border-radius: 20px; padding: 18px; }
#report-host .rp-acts { justify-content: flex-start; flex-wrap: wrap; }
#report-host .rp-acts .btn { flex: 0 0 auto; width: auto; }
