/* Install + notification screens (Tasks 19c/19d): the student's gentle bottom card, the update bar, the teacher's
   «التطبيق والإشعارات» panel and the send-notify switch. Colours come only from tokens.css. */

/* ---- the gentle card: one at a time, never covers the question ---- */
.app-card { position: fixed; z-index: 51; inset-inline: var(--s4); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); max-width: 460px; margin-inline: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); box-shadow: var(--pop-shadow, 0 12px 32px -8px rgb(0 0 0 / .3)); animation: appUp .22s cubic-bezier(.2, .8, .2, 1); max-height: 40vh; overflow: auto; }
.app-card[hidden] { display: none; }
body:has(#me-sheet:not(.hidden)) .app-card { display: none; }
.app-row { display: flex; align-items: center; gap: var(--s3); }
.app-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--tint); color: var(--on-tint); font-size: 24px; }
.app-t { flex: 1; min-width: 0; font-family: var(--f-head); font-weight: 700; font-size: 17.5px; line-height: 1.4; color: var(--text); }
.app-p { margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--muted); }
.app-acts { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-start; padding-block-start: var(--s1, 4px); }
.app-x { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--muted); font-size: 20px; cursor: pointer; }
.app-x:hover { background: var(--surface-2); color: var(--text); }
@keyframes appUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app-card { animation: none; } }
html[data-motion="off"] .app-card { animation: none; }

/* ---- iPhone steps ---- */
.app-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.app-steps li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-btn); background: var(--surface-2); font-size: 15.5px; line-height: 1.6; color: var(--text); }
.app-steps li > i { font-size: 24px; color: var(--on-tint); flex: none; }
html.dark .app-steps li > i { color: var(--primary); }
.app-n { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-family: var(--f-head); font-weight: 700; font-size: 14.5px; }

/* ---- the update bar ---- */
.app-update { position: fixed; z-index: 71; inset-inline: var(--s4); top: calc(var(--s4) + env(safe-area-inset-top, 0px)); max-width: 420px; margin-inline: auto; display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-card); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 12px 30px -8px rgb(0 0 0 / .35); font-family: var(--f-head); font-weight: 600; font-size: 16.5px; }
.app-update > i { font-size: 24px; color: var(--primary); }
.app-update > span { flex: 1; min-width: 0; }

/* ---- the teacher's panel ---- */
#t-app-root .app-state { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-btn); background: var(--tint); color: var(--on-tint); font-size: 15.5px; line-height: 1.7; }
#t-app-root .app-state > i { font-size: 22px; flex: none; margin-block-start: 2px; }
#t-app-root .app-state[hidden] { display: none; }
#t-app-root .app-state.ok { background: var(--ok-tint, var(--tint)); color: var(--ok, var(--on-tint)); }
#t-app-root .app-p { margin: 0; }
.app-count { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-btn); background: var(--surface-2); font-size: 16.5px; color: var(--text); }
.app-count[hidden] { display: none; }
.app-count > i { font-size: 24px; color: var(--primary); }
.app-count > span { flex: 1; }
.app-count small { color: var(--muted); font-size: 14.5px; }
#t-app-root .t-feat { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
#t-app-root .t-feat .lbl b { display: flex; align-items: center; gap: var(--s2); }
.app-disabled { opacity: .55; }
.app-disabled .t-sw-row { cursor: not-allowed; }

/* ---- «إرسال إشعار للجوال» next to a send button ---- */
.app-send { display: flex; flex-direction: column; gap: 2px; padding-block: var(--s2); }
.app-send[hidden] { display: none; }
.app-send .t-sw-row { color: var(--text); font-weight: 600; font-family: var(--f-head); }
.app-send-t { display: inline-flex; align-items: center; gap: var(--s2); }
.app-send-t > i { color: var(--primary); font-size: 22px; }
.app-send .help-text { margin: 0; }
@media (max-width: 520px) { .app-card { inset-inline: var(--s3); } }
.app-bell { color: var(--primary); margin-inline-start: 4px; font-size: 17.5px; vertical-align: -2px; }

/* «تذكير من معلمتكِ» card and the teacher's «تذكير البنات» rows */
.app-from { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--primary); }
#t-app-root .nudge-row { align-items: center; }
#t-app-root .nudge-btns { display: flex; gap: var(--s2); flex-shrink: 0; }
#t-app-root .nudge-sent { margin: 4px 0 0; font-size: 14.5px; color: var(--ok, var(--primary)); }
#t-app-root .nudge-sent:empty { display: none; }
@media (max-width: 520px) { #t-app-root .nudge-row { flex-wrap: wrap; } }
