/* المكتبة and أسانيدي (sheikh/library.js). The preview sheet uses .overlay/.dialog from room.css. */

.lb-note { margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-md); background: var(--brand-soft); color: var(--brand); font-size: var(--text-base); }
.lb-note svg { flex: none; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lb-doc { justify-content: space-between; }
.lb-doc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lb-doc-top small { font-size: var(--text-sm); color: var(--ink-2); }
.lb-doc h3 { margin: 0; font-size: var(--text-input); font-weight: 600; line-height: 1.6; }
.lb-file { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-md); color: var(--ink-2); overflow-wrap: anywhere; }
.lb-file svg { flex: none; }
.lb-doc .btn { height: 36px; }
.lb-doc .btn[disabled] { opacity: .55; cursor: not-allowed; }
.lb-dl { font-size: var(--text-xs); color: var(--ink-2); }
.lb-remove { margin-inline-start: auto; width: 40px; padding: 0; }
.lb-upload { align-items: center; justify-content: center; gap: 6px; min-height: 190px; border: 1.5px dashed var(--line); background: var(--ground); text-align: center; cursor: pointer; }
.lb-upload:hover, .lb-upload:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.lb-upload:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.lb-upload b { font-size: var(--text-base); font-weight: 600; color: var(--brand); }
.lb-upload small { font-size: var(--text-sm); color: var(--ink-2); }
.lb-up-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--brand); display: grid; place-items: center; border: 1px solid var(--line); }

/* the preview sheet */
.lb-sheet { max-width: 560px; }
.lb-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lb-sheet-head h2 { font-size: var(--text-lg); line-height: 1.6; }
.lb-paper { aspect-ratio: 1 / 1.3; max-height: 60vh; margin: 4px auto; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 30px; border: 1px solid var(--gold-edge); border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 6px var(--surface), inset 0 0 0 7px var(--gold); }
.lb-paper-mark { color: var(--gold-ink); margin-bottom: 6px; }
.lb-paper i { display: block; width: 100%; height: 8px; border-radius: var(--radius-xs); background: var(--divider); }
.lb-paper i.short { width: 62%; }
.lb-paper-name { margin-top: auto; font-size: var(--text-sm); color: var(--ink-2); }

/* المكتبة (the shared library is in shelf.css): the page's buttons as pills, «رفعتها» (or «أرسلتها») as a card */
.page-actions > :is(.lb-viewer, .lb-up, .lb-act) { border-radius: var(--radius-pill); font-weight: 700; }
a.btn.lb-viewer { border-color: transparent; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); transition: transform 120ms ease-out, box-shadow 200ms ease-out; }
a.btn.lb-viewer:hover { border-color: transparent; box-shadow: 0 0 0 1px rgba(16, 27, 58, .07), 0 14px 30px -14px rgba(16, 27, 58, .22); }
.page-actions > .lb-no-send { height: 42px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.lb-up { cursor: pointer; }
@media (max-width: 760px) { .page-actions > :is(.lb-viewer, .lb-up, .lb-act) { gap: 6px; padding: 0 14px; font-size: var(--text-md); } }
.lb-up:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.lb-card { gap: 0; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.lb-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 18px 20px 6px; }
.lb-card-h h2 { margin: 0; font-size: var(--text-lg); font-weight: 700; line-height: 1.4; }
.lb-card-h small { font-size: var(--text-sm); font-weight: 500; color: var(--ink-3); }
.lb-card > .muted-p { padding: 4px 20px 20px; line-height: 1.7; }
.lb-ups { list-style: none; margin: 0; padding: 0 0 6px; }
.lb-ups li { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 20px; }
.lb-ups li + li { border-top: 1px solid var(--divider); }
.lb-ups-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--neutral-bg); color: var(--ink-2); display: grid; place-items: center; }
.lb-ups-ico svg { width: 17px; height: 17px; }
.lb-ups-t { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.lb-ups-t b { font-size: var(--text-base); font-weight: 700; overflow-wrap: anywhere; }
.lb-ups-t small, .lb-ups-later { font-size: var(--text-sm); color: var(--ink-2); }
.lb-ups-later { flex: 1 1 100%; order: 1; }
.lb-ups .btn { height: 36px; gap: 6px; padding: 0 12px; font-size: var(--text-sm); font-weight: 700; }
.lb-ups .btn svg { width: 14px; height: 14px; }
.lb-ups a.btn { border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.lb-ups .btn.primary { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.lb-ups .btn.primary:hover { filter: none; box-shadow: 0 0 0 1px rgba(16, 27, 58, .07), 0 14px 30px -14px rgba(16, 27, 58, .22); }
/* the poem on the sheikh's book page sits in a card like the page images */
.sf-wide .sf-col > .mt { padding: 6px 24px 20px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }

/* the «أرسل لطالب» sheet (.overlay/.dialog from room.css, .field from sheikh.css) */
.lb-send { max-width: 520px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.lb-send .dialog-actions .btn { font-weight: 700; }
.lb-who { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.lb-who li + li { border-top: 1px solid var(--divider); }
.lb-who label { display: flex; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; }
.lb-who label:hover { background: var(--navy-wash); }
.lb-who input { flex: none; width: 18px; height: 18px; accent-color: var(--brand); }
.lb-who span { display: flex; flex-direction: column; line-height: 1.4; }
.lb-who b { font-size: var(--text-base); font-weight: 600; }
.lb-who small, .lb-picked { font-size: var(--text-sm); color: var(--ink-2); }
.lb-who-none { padding: 12px; font-size: var(--text-md); color: var(--ink-2); }
.lb-send .err:empty { display: none; }

/* the poem reader (lib/mutoon.js); student/books.css has the same reader sized for the phone */
.mt { display: flex; flex-direction: column; }
.mt-head { padding: 14px 0 4px; }
.mt-head h2 { margin: 0; font-family: var(--quran); font-size: var(--text-3xl); font-weight: 700; line-height: 1.5; color: var(--brand); }
.mt-head p { margin: 2px 0 0; font-size: var(--text-md); color: var(--ink-2); }
.mt-head a { color: var(--brand); }
.mt-head .mt-partial { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); }
.mt-lines { display: flex; flex-direction: column; padding-top: 4px; }
.mt-ch { margin: 18px 0 6px; padding: 6px 12px; border-radius: var(--radius-md); background: var(--brand-soft); color: var(--brand); font-family: var(--quran); font-size: var(--text-xl); font-weight: 700; line-height: 1.6; text-align: center; }
.mt-line { margin: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; gap: 2px 32px; padding: 4px 8px; border-radius: var(--radius-sm); font-family: var(--quran); font-size: var(--text-2xl); line-height: 2; }
.mt-line:hover { background: var(--ground); }
.mt-s, .mt-a { text-align: justify; text-align-last: justify; }
.mt-n { font-family: var(--ui); font-size: var(--text-sm); color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.mt-here { animation: mt-here 2.4s ease-out; }
@keyframes mt-here { from { background: var(--gold); } to { background: transparent; } }
.mt-line:focus { outline: none; }
.mt-wait { margin: 16px 0; font-size: var(--text-base); color: var(--ink-2); }
.mt-err { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 16px 0; color: var(--danger); }
.mt-err p { margin: 0; }

@media (max-width: 1180px) {
  .mt-line { font-size: var(--text-xl); gap: 2px 18px; grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr); }
}
/* the real side: to whom he sent each item (a name taken off takes it back), and أسانيدي's form */
.lb-to { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lb-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--ground); font-size: var(--text-sm); color: var(--ink); }
.lb-chip svg { color: var(--ink-2); }
.lb-chip:hover { border-color: var(--danger); color: var(--danger); }
.lb-chip:hover svg { color: var(--danger); }
.lb-add { display: flex; flex-direction: column; gap: 10px; }
.lb-add h2 { margin: 0; font-size: var(--text-input); }
.lb-add .field { margin: 0; }
