/* «إنهاء المرحلة» (teacher-stage-end.js): laptop-first, roomy; one column on a phone. Tokens only, so the
   light / dark modes and designs D and E follow by themselves. */

/* ---------- the entry: results header + the settings picker ---------- */
.se-now { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--tint); color: var(--on-tint); font-size: 14.5px; font-weight: 600; white-space: nowrap; max-width: 460px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 28px; }
.se-now[hidden] { display: none; }
html[data-design="d"] .t-ph .se-now, html[data-design="e"] .t-ph .se-now { background: rgb(255 255 255 / .16); color: inherit; border: 1px solid rgb(255 255 255 / .35); }
html[data-design="d"] .t-ph .t-ph-acts, html[data-design="e"] .t-ph .t-ph-acts { color: #FFFFFF; }
html[data-design="e"] .t-ph .t-ph-acts { color: var(--e-bar-fg); }
.se-entry { align-items: center; }
.se-entry .btn[disabled] { opacity: .55; cursor: not-allowed; }
.se-pick-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-block-start: var(--s3); }

/* ---------- the window ---------- */
.se-modal { position: fixed; inset: 0; z-index: 55; display: flex; overflow-y: auto; padding: var(--s5) var(--s4); }
.se-modal[hidden] { display: none; }
body.se-lock { overflow: hidden; }
.se-dlg { width: 100%; max-width: 940px; margin: auto; gap: var(--s4); padding: var(--s5) var(--s6, 28px); }
.se-dlg .t-dlg-h h3 { font-size: 24px; }
.se-dlg .t-dlg-h p { font-size: 16.5px; }
.se-body { display: flex; flex-direction: column; gap: var(--s4); }
.se-body .help-text { font-size: 14.5px; color: var(--muted); }

.se-grade { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.se-grade .t-lbl { margin: 0; }

/* summary: the ring and the line */
.se-top { display: flex; align-items: center; gap: var(--s5); padding: var(--s3) var(--s5); border-radius: var(--r-card); background: var(--surface-2); }
html.dark .se-top { background: var(--surface); }
.se-ring { position: relative; flex: none; width: 96px; height: 96px; }
.se-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.se-ring circle { fill: none; stroke-width: 12; }
.se-ring-bg { stroke: var(--tint); }
.se-ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dasharray .6s var(--spring, ease); }
.se-ring-n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.se-ring-n b { font-family: var(--f-head); font-weight: var(--hw); font-size: 23px; color: var(--text); }
.se-ring-n small { font-size: 13px; color: var(--muted); }
.se-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.se-line { font-family: var(--f-head); font-weight: var(--hw); font-size: 24px; color: var(--text); line-height: 1.4; }
.se-sub2 { color: var(--muted); font-size: 16.5px; }
.se-bar { display: block; height: 10px; border-radius: var(--r-pill); background: var(--tint); overflow: hidden; margin-block-start: 4px; }
.se-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .6s ease; }

/* two columns on a laptop: the girls | the two actions */
.se-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.se-side { display: flex; flex-direction: column; gap: var(--s4); }
.se-panel { display: flex; flex-direction: column; gap: 10px; padding: var(--s4); border-radius: var(--r-card); border: 1px solid var(--border); background: var(--surface); }
html.dark .se-panel { background: var(--surface-2); border-color: var(--border); }
html.dark .se-dlg .se-panel { background: var(--surface); }
.se-panel h4 { display: flex; align-items: center; gap: var(--s2); font-family: var(--f-head); font-weight: var(--hw); font-size: 18.5px; color: var(--text); }
.se-panel h4 i { color: var(--primary); font-size: 24px; }
.se-count { margin-inline-start: auto; min-width: 30px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--tint); color: var(--on-tint); font-size: 14.5px; text-align: center; }
.se-panel .t-lbl { margin: 0; }
.se-btn { min-height: 46px; width: 100%; justify-content: center; font-size: 16.5px; }
.se-btn i { font-size: 22px; }
.se-btn[disabled] { opacity: .55; cursor: not-allowed; }
.se-btn[aria-busy] { cursor: progress; }

/* the girls who have not finished: scrolls inside the window */
.se-list { list-style: none; margin: 0; padding: 2px; max-height: clamp(220px, calc(100vh - 390px), 440px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; border-radius: var(--r-btn); }
.se-list:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.se-list li { display: flex; align-items: center; gap: var(--s3); padding: 8px 10px; border-radius: var(--r-btn); background: var(--surface-2); }
html.dark .se-list li { background: var(--surface-2); }
.se-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--on-tint); font-family: var(--f-head); font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; }
.se-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.se-nm b { font-weight: 600; font-size: 16.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-nm small { font-size: 13px; color: var(--muted); }
.se-work { flex: none; font-size: 14.5px; font-weight: 600; color: var(--on-tint); background: var(--tint); padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.se-work.is-none { color: var(--muted); background: transparent; border: 1px dashed var(--border); }
.se-empty { display: flex; align-items: center; gap: var(--s2); padding: var(--s4); border-radius: var(--r-btn); background: var(--success-tint); color: var(--success); font-weight: 600; }
.se-empty i { font-size: 24px; }

/* the reminder preview */
.se-msg { display: flex; flex-direction: column; gap: 2px; padding: var(--s3); border-radius: var(--r-btn); background: var(--surface-2); border-inline-start: 4px solid var(--primary); }
html.dark .se-msg { background: var(--surface-2); }
.se-msg b { font-size: 15.5px; color: var(--text); }
.se-msg span { font-size: 14.5px; color: var(--muted); }
.se-next { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16.5px; color: var(--muted); }
.se-next b { color: var(--text); }
.se-next i { color: var(--primary); }

.se-foot { justify-content: flex-end; }
.se-foot .btn { min-width: 120px; }

/* confirm + done */
.se-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); padding: var(--s4) var(--s2); max-width: 560px; margin-inline: auto; }
.se-cf-ic { width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--primary); font-size: 40.5px; }
.se-cf-ic.ok { background: var(--success-tint); color: var(--success); }
.se-cf-q { font-family: var(--f-head); font-weight: var(--hw); font-size: 23px; color: var(--text); line-height: 1.5; }
.se-cf-note { color: var(--muted); font-size: 16.5px; line-height: 1.7; }
.se-confirm .t-dlg-acts { justify-content: center; width: 100%; margin-block-start: var(--s2); }
.se-confirm .t-dlg-acts .btn { min-height: 48px; padding-inline: var(--s5); }
.se-confirm .t-dlg-acts .btn-primary { flex: 0 1 auto; }

/* tablets and phones: one column */
@media (max-width: 819.98px) {
    .se-grid { grid-template-columns: 1fr; }
    .se-dlg { padding: var(--s5); }
}
@media (max-width: 519.98px) {
    .se-modal { padding: var(--s3) var(--s4); }
    .se-dlg { padding: var(--s4); gap: var(--s4); }
    .se-top { gap: var(--s3); padding: var(--s3); }
    .se-ring { width: 88px; height: 88px; }
    .se-ring-n b { font-size: 21px; }
    .se-line { font-size: 20px; }
    .se-list { max-height: 260px; }
    .se-confirm .t-dlg-acts .btn { width: 100%; }
    .se-now { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .se-ring-fg, .se-bar i { transition: none; } }
html.no-motion .se-ring-fg, html.no-motion .se-bar i { transition: none; }
