/* jarchi «حضور فعال» (presence.js): the student's check and roll-call card, the «… بیرون بودی» line and the note
   at the start; the teacher's count over the participants, the eye-off mark on a person (in place of the
   connection dot: one status per person), the top bar's eye-off count, the roll call's card, the setting sheet,
   and the attendance's «حضور فعال» column. Colour only for meaning: the eye-off and «جواب نداد» in the --warn
   family (attention, not alarm). */

/* ---------- the student ---------- */
.pres-ask {
  position: fixed; z-index: 40;
  inset-inline: 0; margin-inline: auto;
  bottom: calc(var(--bar-h, 76px) + 12px + env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 24px));
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 18px 18px 14px;
  border: 1px solid var(--accent-line); border-radius: var(--r-pop);
  background: var(--surface-raised); color: var(--ink);
  box-shadow: var(--shadow-3);
  text-align: center;
  animation: kit-pop var(--t-med) var(--ease);
}
.pres-ask-q { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-x); line-height: 1.4; }
.pres-ask-hint { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.pres-ask-hint:empty { display: none; }
.pres-ask-yes { min-height: var(--tap-lg); font-size: var(--fs-md); gap: 8px; }
.pres-ask-yes .ic { width: 22px; height: 22px; }
.pres-ask-time {
  display: block; height: 4px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--bg-sunken);
}
.pres-ask-bar {
  display: block; height: 100%; border-radius: inherit;
  background: var(--accent);
  transform-origin: right center;
  transition: transform 250ms linear;
}
.pres-ask-left { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.pres-ask[data-done="1"] { border-color: var(--speak-line); }
.pres-ask[data-done="1"] .pres-ask-q { color: var(--speak-ink); }
.pres-ask[data-done="1"] .pres-ask-yes,
.pres-ask[data-done="1"] .pres-ask-time,
.pres-ask[data-done="1"] .pres-ask-left { display: none; }
@media (prefers-reduced-motion: reduce) {
  .pres-ask { animation: none; }
  .pres-ask-bar { transition: none; }
}

/* Back from away; the note at the start: quiet cards among the room's messages. */
.pres-back, .pres-note, .pres-call {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 560px;
  padding: 6px; padding-inline-start: 14px;
  min-height: var(--tap);
  border: 1px solid var(--line); border-radius: var(--r-pop);
  background: var(--surface-raised); color: var(--ink);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-sm); line-height: 1.6;
}
.pres-back { border-color: var(--hand-line); }
.pres-back p, .pres-note p { flex: 1 1 auto; min-width: 0; margin: 0; padding-block: 6px; }
.pres-back-ic, .pres-note-ic { flex: none; width: 20px; height: 20px; color: var(--hand-ink); }
.pres-note-ic { color: var(--accent-ink); }
.pres-back-text { font-weight: var(--fw-b); }
.pres-back-call { font-weight: var(--fw); color: var(--muted); }
.pres-back-x, .pres-call-x { flex: none; width: var(--tap); height: var(--tap); min-height: var(--tap); padding: 0; color: var(--muted); }
.pres-back-x .ic, .pres-call-x .ic { width: 18px; height: 18px; }
.pres-note .btn { flex: none; width: auto; min-height: var(--tap); }

/* ---------- the teacher ---------- */
.pres-count {
  display: flex; align-items: center; gap: 8px;
  margin: 0 8px 4px; min-height: 28px;
  color: var(--ink-2); font-size: var(--fs-s); font-weight: var(--fw-b);
}
.pres-count[hidden] { display: none; }
.pres-count-ic { flex: none; width: 18px; height: 18px; color: var(--muted); }
.pres-count[data-out="1"] .pres-count-ic { color: var(--hand-ink); }

/* The top bar: the eye-off count while anyone is out (a tap opens the participants). */
.pres-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 4px;
  margin-inline-start: 8px; padding: 0 8px; min-height: 24px;
  border: 1px solid var(--hand-line); border-radius: var(--r-pill);
  background: var(--hand-soft); color: var(--hand-ink);
  font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-b);
  cursor: pointer; vertical-align: middle; position: relative;
}
.pres-chip::after { content: ""; position: absolute; inset: -10px -4px; } /* a 44 px target in a thin bar */
.room .rbar .rbar-sub > .pres-chip:not([hidden])::before { content: none; } /* the bar's «·» between items stays outside */
.pres-chip[hidden] { display: none; }
.pres-chip .ic { width: 14px; height: 14px; }

/* The person: the eye-off mark sits where the connection dot does (one status). */
.pres-eye {
  position: absolute; bottom: -3px; inset-inline-end: -3px;
  display: grid; place-items: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--hand); color: var(--on-hand);
  box-shadow: 0 0 0 2px var(--surface);
}
.pres-eye .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.conn-av[data-away] .conn-pdot { display: none; }
.conn-av[data-away] .pres-eye { bottom: 1px; inset-inline-end: 1px; }
.psub.pres-away { color: var(--hand-ink); font-weight: var(--fw-b); }

/* The roll call's card (the teacher). */
.pres-call { border-color: var(--accent-line); }
.pres-call[data-done="1"] { border-color: var(--line); }
.pres-call-ic { flex: none; width: 20px; height: 20px; color: var(--accent-ink); }
.pres-call-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-block: 6px; }
.pres-call-body small { color: var(--muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.pres-call-body .pres-ask-time { width: 100%; }

/* The setting sheet. */
.pres-opts { margin: 0 0 12px; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.pres-opts legend { margin-bottom: 8px; padding: 0; font-weight: var(--fw-b); font-size: var(--fs-sm); }
.pres-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  cursor: pointer;
}
.pres-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pres-opt input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.pres-opt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pres-opt-txt b { font-size: var(--fs-sm); }
.pres-opt-txt small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.6; }
.pres-every-row { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); }
.pres-every { min-height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; }
.pres-weekly { margin: 0 0 12px; }

/* After the class: the attendance's «حضور فعال» column. */
.pres-cell { white-space: nowrap; }
.pres-cell .pres-pct { display: block; font-variant-numeric: tabular-nums; }
.pres-cell small { display: block; color: var(--muted); font-size: var(--fs-xs); white-space: normal; min-width: 9em; }
.pres-cell[data-low="1"] .pres-pct { color: var(--hand-ink); }

/* Back from away: «بشنو» plays what was said meanwhile (catchup.js). */
.pres-back .pres-back-play { flex: none; width: auto; min-height: var(--tap); gap: 6px; }
.pres-back .pres-back-play .ic { width: 18px; height: 18px; }

/* The teacher: a student's participations beside the name. */
.pres-acts {
  display: inline-flex; align-items: center; gap: 2px;
  margin-inline-start: 6px; padding: 0 6px; min-height: 20px;
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-strong);
  font-size: var(--fs-xs); font-weight: var(--fw-b); font-variant-numeric: tabular-nums; vertical-align: middle;
}
.pres-acts .ic { width: 12px; height: 12px; stroke-width: 2.2; }

/* The school chose the setting. */
.pres-locked { display: flex; align-items: center; gap: 6px; }
.pres-locked .ic { width: 16px; height: 16px; flex: none; }
.pres-opt:has(input:disabled) { cursor: default; opacity: .75; }

/* After the class: «حاضر ناقص» (under the school's line) in the warn family. */
.st-partial { color: var(--warn); }

/* The note at the start steps aside while «بیشتر» (which says the same) or a phone's sheet is open. */
.room[data-more="1"] .pres-note { display: none; }
@media (max-width: 959px) {
  .room[data-panel]:not([data-panel=""]) .pres-note { display: none; }
}
