/* النور — نظام التصميم
   على نمط thenoor.org: خلفية ورقية دافئة (#F6F4EE)، بطاقات بيضاء بحد رفيع وحواف 16px،
   أزرار أساسية سوداء، وأخضر داكن (#0B5D45) للتمييز. خط IBM Plex Sans Arabic للواجهة،
   والأميري لنص القرآن فقط. كل قيمة لونية أو قياسية معرّفة هنا مرة واحدة. */


@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("fonts/plex-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("fonts/plex-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("fonts/plex-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("fonts/plex-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("fonts/plex-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("fonts/plex-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url("fonts/amiri-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Amiri"; font-weight: 700; font-display: swap; src: url("fonts/amiri-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url("fonts/amiri-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  /* الصفحة: ورق دافئ، بطاقات بيضاء بحد رفيع، وأخضر داكن للتمييز */
  --canvas: #f6f4ee;
  --surface: #ffffff;
  --surface-alt: #fbfaf7;
  --pill: #efede8;
  --ink: #1f1f1f;
  --ink-strong: #000000;
  --ink-soft: #4d4d4d;
  --ink-mute: #6e6c67;
  --rule: #e7e5e0;
  --rule-strong: #dbd9d5;
  --field-line: #cfccc6;

  /* الشريط الداكن: حفظ الكشف ولوحة الدخول */
  --cover: #0b3d2e;
  --cover-deep: #072a20;
  --cover-ink: #e1eee7;
  --cover-mute: #9dbfb0;
  --cover-line: rgba(225, 238, 231, .16);
  --on-dark: #f5efec;

  /* بقايا التذهيب القديم صارت درجات من الأخضر، فأي استعمال متبقٍّ ينسجم */
  --gold: #0e7a5a;
  --gold-ink: #0b5d45;
  --gold-soft: #bedbcc;
  --gold-wash: #eaf4ef;

  /* المعاني */
  --green: #0b5d45;
  --green-2: #0e7a5a;
  --green-deep: #083a2c;
  --green-wash: #e1eee7;
  --green-tint: #f4f9f6;
  --ochre: #9a6b17;
  --ochre-wash: #fbf1d8;
  --brick: #a23a28;
  --brick-wash: #f9e6e0;
  --slate: #33566e;
  --slate-wash: #e4ecf2;

  --font-ui: "Plex Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Amiri", "Traditional Arabic", "Times New Roman", serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* الحواف: البطاقات، ثم الأدوات، ثم الوسوم الصغيرة */
  --r-lg: 16px;
  --r-md: 8px;
  --r-sm: 6px;
  --wrap: 1180px;
  --topbar-h: 64px;
  --tabbar-h: 64px;
  --drawer-off: 100%; /* the mobile menu hides past the inline start edge: right in RTL */
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--green);
  --ease: 150ms cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.7 var(--font-ui);
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--green-wash); color: var(--ink-strong); }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: var(--s4); top: -60px; background: var(--ink-strong); color: var(--on-dark); padding: var(--s2) var(--s4); border-radius: var(--r-md); z-index: 60; }
.skip:focus { top: var(--s2); color: var(--on-dark); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.mute { color: var(--ink-mute); }
.nowrap { white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 3vw, 24px); }

/* ---------- الهيكل: سطر البسملة، ثم شريط علوي ثابت ---------- */
.basmala { padding: 10px var(--s4) 0; text-align: center; font: 400 17px/1.6 var(--font-display); color: var(--ink-soft); }
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(246, 244, 238, .92); border-bottom: 1px solid var(--rule-strong); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.topbar__row { display: flex; align-items: center; gap: var(--s4); height: var(--topbar-h); }
.topbar__end { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s2); }
.topbar .topbar__menu { display: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-strong); text-decoration: none; flex: none; }
.brand:hover { color: var(--ink-strong); }
/* The emblem from the public site (ن over an open mushaf), cropped and with a transparent background. */
.brand__logo { display: block; flex: none; width: auto; height: 40px; }
.brand__text { display: grid; line-height: 1.1; }
.brand__name { font: 700 22px/1.1 var(--font-ui); color: var(--ink-strong); }
.brand__sub { font: 400 11.5px/1.5 var(--font-ui); color: var(--ink-mute); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); cursor: pointer; transition: background var(--ease); }
.icon-btn:hover { background: var(--pill); }

/* Desktop navigation: the first group as plain links, the labelled groups as drop-downs. */
.nav { min-width: 0; }
.nav__head, .nav__who { display: none; }
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 500; color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background var(--ease), color var(--ease);
}
.nav__link > .icon:first-child { display: none; }
.nav__link:hover { color: var(--ink-strong); background: rgba(0, 0, 0, .035); }
.nav__link[aria-current="page"], .nav__link.is-current { background: var(--pill); color: var(--ink-strong); font-weight: 700; }
summary.nav__link { list-style: none; }
summary.nav__link::-webkit-details-marker { display: none; }
summary.nav__link .icon { transition: transform var(--ease); }
.dd[open] > summary .icon:last-child { transform: rotate(180deg); }
.nav__count { margin-inline-start: auto; min-width: 20px; padding: 0 6px; background: var(--brick); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; border-radius: 10px; }
.nav__link .nav__count { margin-inline-start: 2px; }
.nav__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brick); }

.dd { position: relative; }
.dd__menu {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 45; min-width: 232px;
  display: grid; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .28), 0 2px 6px -2px rgba(0, 0, 0, .06);
}
.dd--end .dd__menu { inset-inline-start: auto; inset-inline-end: 0; }
.dd__menu a, .dd__menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--r-md); background: none;
  font: 500 14.5px/1.5 var(--font-ui); color: var(--ink); text-decoration: none; text-align: start; cursor: pointer;
}
.dd__menu a .icon, .dd__menu button .icon { color: var(--ink-mute); }
.dd__menu a:hover, .dd__menu button:hover { background: var(--pill); color: var(--ink-strong); }
.dd__menu a[aria-current="page"] { background: var(--green-wash); color: var(--green-deep); font-weight: 600; }
.dd__menu a[aria-current="page"] .icon { color: var(--green); }
.dd__menu form { margin: 0; }

.user > summary { list-style: none; }
.user > summary::-webkit-details-marker { display: none; }
.userbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 6px; padding-inline: 4px 10px; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: background var(--ease); }
.userbtn:hover { background: var(--pill); }
.userbtn .icon { color: var(--ink-mute); }
.userbtn__name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; unicode-bidi: plaintext; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--green-wash); color: var(--green-deep); font-weight: 700; font-size: 14px; }
.user__menu { min-width: 248px; }
.user__card { display: grid; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.who__name { font-weight: 600; color: var(--ink-strong); font-size: 14.5px; }

.main { flex: 1 0 auto; min-width: 0; padding: var(--s6) 0 var(--s7); }
.page { max-width: var(--wrap); }
.foot { border-top: 1px solid var(--rule-strong); font-size: 13px; color: var(--ink-soft); }
.foot__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-block: var(--s4); }
.foot .mute { font-family: var(--font-display); font-size: 15px; }
.foot__links { border-top: 1px solid var(--rule); }
.foot__nav, .foot__contact { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.foot__links a { color: inherit; }
.foot__links a:hover { color: var(--ink); }
/* Under a centered card (sign-in pages, error page): same line, no page-wide rule. */
.foot__links--card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4); width: 100%; max-width: 560px; margin-top: var(--s5); padding-top: var(--s4); font-size: 13px; color: var(--ink-soft); }
.error-page .foot__links--card { justify-content: center; margin-inline: auto; }
.scrim { display: none; }
/* Phone tab bar: shown under 960px only. */
.tabbar { display: none; }

/* ---------- رأس الصفحة ---------- */
.head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4) var(--s5); flex-wrap: wrap;
  margin-bottom: var(--s6);
}
.head__crumb { font-size: 13px; color: var(--ink-mute); margin-bottom: var(--s1); }
.head__crumb a { color: inherit; }
.head__crumb a:hover { color: var(--ink-strong); }
.head h1 { font: 700 32px/1.3 var(--font-ui); color: var(--ink-strong); letter-spacing: -.2px; text-wrap: balance; }
.head__meta { color: var(--ink-soft); font-size: 14.5px; margin-top: var(--s1); }
.head__actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* Section titles: a short green bar at the start, as on the reference cards. */
h2.sec { font: 700 17px/1.4 var(--font-ui); color: var(--ink-strong); display: flex; align-items: center; gap: 10px; margin: var(--s6) 0 var(--s3); }
h2.sec::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--green); flex: none; }
h2.sec:first-child { margin-top: 0; }
h2.sec .mute { font-weight: 400; font-size: 13.5px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s6) 0 var(--s3); }
.sec-row h2.sec { margin: 0; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4);
  font: 600 14px/1 var(--font-ui); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-md);
  cursor: pointer; transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { color: var(--ink-strong); background: var(--pill); border-color: var(--rule-strong); }
.btn--primary { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--on-dark); }
.btn--primary:hover { background: #262626; border-color: #262626; color: var(--on-dark); }
.btn--accent { background: var(--green); border-color: var(--green); color: #fff; }
.btn--accent:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn--danger { color: var(--brick); border-color: #e6c3b9; }
.btn--danger:hover { background: var(--brick); border-color: var(--brick); color: #fff; }
.btn--quiet { background: none; border-color: transparent; color: var(--ink-soft); padding: 0 var(--s2); }
.btn--quiet:hover { background: rgba(0, 0, 0, .05); border-color: transparent; }
.btn--sm { min-height: 32px; padding: 0 var(--s3); font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.inline-form { display: inline; }

/* ---------- الحقول ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .req { color: var(--brick); }
.hint { font-size: 12.5px; color: var(--ink-mute); }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="date"], input[type="month"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 7px 12px;
  font: 400 15px/1.5 var(--font-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r-md);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
textarea { min-height: 120px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-mute); }
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
input[type="number"] { direction: ltr; text-align: center; }
/* Email, phone, username: typed left to right, aligned with the interface (RTL skill rule). Ayah boxes stay centred. */
[dir="rtl"] input[dir="ltr"]:not(.ayah) { text-align: right; }
/* Text people type takes its direction from its first letter, like dir="auto": an English note or name does not scramble the line. */
textarea, input[type="text"]:not([dir]), input[type="search"]:not([dir]) { unicode-bidi: plaintext; }
.cell-main, .cell-sub:not(.num), .who__name, .msg-body { unicode-bidi: plaintext; }
input.ayah { text-align: center; padding-inline: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: var(--s2); font-size: 14.5px; }
/* Country picker beside the national number; the picker sits first, on the right. */
.phone { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 6px; }
.phone select { text-overflow: ellipsis; }
.phone input { font-variant-numeric: tabular-nums; }
.phone-link { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px; white-space: nowrap; }
.phone-link:hover { color: var(--green-deep); text-decoration-color: currentColor; }
.form { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { border: 0; border-top: 1px solid var(--rule); padding: var(--s4) 0 0; margin: var(--s5) 0 0; }
fieldset:first-of-type { margin-top: 0; }
fieldset > .field + .field { margin-top: var(--s4); }
legend { padding-inline-end: var(--s3); font-weight: 700; font-size: 15.5px; color: var(--ink-strong); }
.form-actions { display: flex; gap: var(--s2); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule); }

.toolbar { display: flex; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar .field { flex: 0 1 190px; }
.toolbar .field--grow { flex: 1 1 240px; }
.toolbar__end { margin-inline-start: auto; display: flex; gap: var(--s2); }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px var(--s4); text-align: start; vertical-align: middle; }
thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-mute); white-space: nowrap; background: var(--surface-alt); border-bottom: 1px solid var(--rule); padding-block: 9px; }
thead th a { color: inherit; text-decoration: none; }
thead th a:hover { color: var(--ink); text-decoration: underline; }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--rule); }
tbody tr { transition: background var(--ease); }
tbody tr:hover td, tbody tr:hover th { background: var(--surface-alt); }
tbody th { font-weight: 500; white-space: nowrap; }
td.num, th.num { text-align: end; }
td.actions { text-align: end; white-space: nowrap; }
.cell-main { font-weight: 600; color: var(--ink); text-decoration: none; }
a.cell-main:hover { text-decoration: underline; color: var(--green-deep); }
.cell-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-mute); }
tfoot td { border-top: 1px solid var(--rule-strong); background: var(--surface-alt); font-weight: 600; }

.empty { padding: var(--s6) var(--s5); text-align: center; color: var(--ink-mute); background: var(--surface); border: 1px dashed var(--field-line); border-radius: var(--r-lg); }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: var(--s1); }

.sortbar { display: none; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); font-size: 13.5px; color: var(--ink-mute); }
.pager__links { display: flex; gap: var(--s2); }

/* ---------- الوسوم ---------- */
.tag { display: inline-block; padding: 1px 10px; font-size: 12.5px; font-weight: 600; line-height: 1.75; border-radius: 999px; background: var(--pill); color: var(--ink-soft); white-space: nowrap; }
.tag--ok { background: var(--green-wash); color: var(--green-deep); box-shadow: none; }
.tag--warn { background: var(--ochre-wash); color: #6b4a10; box-shadow: none; }
.tag--bad { background: var(--brick-wash); color: var(--brick); box-shadow: none; }
.tag--info { background: var(--slate-wash); color: var(--slate); box-shadow: none; }

/* ---------- شريط الأرقام ---------- */
.ledger { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); overflow: hidden; }
/* Dividers on every cell, pulled 1px under the frame so only the inner ones show, however the cells wrap. */
.ledger > div { padding: var(--s5) var(--s5) var(--s4); border-inline-start: 1px solid var(--rule); border-top: 1px solid var(--rule); margin-top: -1px; margin-inline-start: -1px; min-width: 0; }
.ledger dt { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.ledger dd { font: 700 32px/1.25 var(--font-ui); color: var(--ink-strong); margin-top: var(--s1); letter-spacing: -.3px; }
.ledger dd small { font: 400 13.5px/1 var(--font-ui); color: var(--ink-mute); margin-inline-start: 6px; }
.ledger .note { display: block; font-size: 12.5px; color: var(--ink-mute); margin-top: var(--s1); }

.panel { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s6); align-items: start; }
.ledger + .cols, .ledger + h2.sec { margin-top: var(--s6); }
.cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px var(--s5); font-size: 14.5px; }
.kv dt { color: var(--ink-mute); }
.kv dd { color: var(--ink); }

/* ---------- التنبيهات ---------- */
.notice { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s4); border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--surface); font-size: 14.5px; white-space: pre-line; }
.notice--success { border-color: #bedbcc; background: var(--green-wash); color: var(--green-deep); }
.notice--error { border-color: #ecc4b9; background: var(--brick-wash); color: #7d2a1c; }
.notice--info { border-color: #c9d7e2; background: var(--slate-wash); color: #24435a; }
.notice--secret { border-color: #ecd9a6; background: var(--ochre-wash); color: #5c3f0b; }
.notice code { font: 600 15px/1.4 ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; background: #fff; padding: 1px 6px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); user-select: all; }

/* ---------- الرسوم ---------- */
.juzmap { display: block; width: 100%; height: auto; }
.juzmap .cell { fill: var(--pill); }
.juzmap .fill { fill: var(--green); }
.juzmap .tick { fill: var(--ink-mute); font: 400 10px var(--font-ui); }
.spark { display: inline-block; vertical-align: middle; }
.spark .bar { fill: var(--green); }
.spark .zero { fill: var(--rule-strong); }
.range { display: block; width: 100%; height: 34px; }
.range line, .range rect { vector-effect: non-scaling-stroke; }
.range .axis { stroke: var(--rule-strong); stroke-width: 1; }
.range .band { fill: var(--green-wash); stroke: var(--green); stroke-width: 1; }
.range .mark { stroke: var(--green-deep); stroke-width: 3; }
.range .now { stroke: var(--ochre); stroke-width: 2; }
.range-plot { margin-block: var(--s2); }
.range-labels { display: block; overflow: visible; font-family: var(--font-ui); }
.range-labels--top { margin-bottom: var(--s1); }
.range-labels--bottom { margin-top: var(--s1); }
.range-label__name { font-size: 12px; fill: var(--ink-mute); }
.range-label__date { font-size: 13px; font-weight: 600; fill: var(--ink); }
.range-label--expected .range-label__name { fill: var(--green-deep); font-weight: 600; }
.range-label--expected .range-label__date { fill: var(--green-deep); }
.range-label--today .range-label__name { fill: var(--ochre); font-weight: 600; }
.range-label--today .range-label__date { font-weight: 400; fill: var(--ink-soft); }
.forecast__date { font: 700 30px/1.35 var(--font-ui); color: var(--green); letter-spacing: -.2px; }
.forecast__sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: var(--s4); }
.method { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-mute); }
.method-steps { list-style: decimal; padding-inline-start: 1.4em; max-width: 78ch; }
.method-steps li + li { margin-top: 6px; }
.meter { display: block; width: 96px; height: 6px; }
.meter .cell { fill: var(--pill); }
.meter .fill { fill: var(--green); }

/* ---------- كشف اليوم ---------- */
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 10px; font-size: 13px; color: var(--ink-soft); border-inline-start: 1px solid var(--rule); white-space: nowrap; transition: background var(--ease), color var(--ease); }
.seg label:first-child span { border-inline-start: 0; }
.seg label:hover span { background: var(--pill); }
.seg input:checked + span { background: var(--green); color: #fff; }
.seg input[value="absent"]:checked + span { background: var(--brick); }
.seg input[value="excused"]:checked + span { background: var(--slate); }
.seg input[value="late"]:checked + span { background: var(--ochre); }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--ink); }
.sheet td { padding: 8px var(--s2); }
.sheet th[scope="row"] { min-width: 150px; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.sheet tbody tr:hover th[scope="row"] { background: var(--surface-alt); }
.sheet select, .sheet input { min-height: 34px; padding: 3px 6px; font-size: 14px; }
.passage { display: grid; grid-template-columns: minmax(104px, 1fr) 54px 14px minmax(104px, 1fr) 54px; gap: 4px; align-items: center; }
.passage .to { color: var(--ink-mute); text-align: center; font-size: 12px; }
.sheet .measure { display: block; min-height: 17px; font-size: 12px; color: var(--ink-mute); }
.sheet .measure.bad { color: var(--brick); }

/* Daily sheet rows: the passage takes two lines ("from" above, "إلى" and the end below) with its
   grade beside it, so four columns fit the page without scrolling sideways. */
.sheet th[scope="row"] { min-width: 120px; width: 150px; white-space: normal; }
.sheet .att-cell { width: 1%; }
.sheet .sheet-note { display: block; width: 100%; margin-top: 6px; }
.sheet .work { display: flex; align-items: center; gap: var(--s2); }
.sheet .work__passage { flex: 1 1 auto; min-width: 176px; }
.sheet .passage { grid-template-columns: 24px minmax(96px, 1fr) 52px; grid-template-areas: ". fs fa" "to ts ta"; gap: 4px; }
.sheet .passage > :nth-child(1) { grid-area: fs; }
.sheet .passage > :nth-child(2) { grid-area: fa; }
.sheet .passage > :nth-child(3) { grid-area: to; }
.sheet .passage > :nth-child(4) { grid-area: ts; }
.sheet .passage > :nth-child(5) { grid-area: ta; }
.sheet .passage .to { text-align: start; }
.sheet .work__grade { flex: none; width: 88px; align-self: flex-start; }
/* The column header already says "وتقديره"; the word is for phones and screen readers. */
.sheet .work__grade > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sheet .work__grade select { width: 100%; }
.sheet tr.is-absent .work { opacity: .35; }
/* A hairline between memorization and review, so one column's "إلى" never reads as the other's grade. */
.sheet td.work-cell + td.work-cell { border-inline-start: 1px solid var(--rule); padding-inline-start: var(--s3); }
/* Laptops and tablets with the sidebar open: the grade goes under its passage, so the row still fits. */
@media (min-width: 721px) and (max-width: 1280px) {
  .sheet .work { display: block; }
  .sheet .work__passage { min-width: 150px; }
  .sheet .passage { grid-template-columns: 22px minmax(80px, 1fr) 48px; }
  .sheet .seg span { padding: 4px 7px; }
  .sheet .work__grade { width: auto; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px; margin-top: 4px; }
  .sheet .work__grade select { grid-column: 2; }
}
.savebar { position: sticky; bottom: var(--s3); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); margin-top: var(--s4); background: var(--cover); color: var(--cover-ink); border-radius: var(--r-lg); box-shadow: 0 14px 34px -14px rgba(5, 38, 29, .6); }
.savebar .mute, .savebar .hint { color: var(--cover-mute); }
.savebar .btn { background: transparent; border-color: rgba(255, 255, 255, .4); color: #fff; }
.savebar .btn:hover { background: rgba(255, 255, 255, .1); }
.savebar .btn--primary { background: #fff; border-color: #fff; color: #000; }
.savebar .btn--primary:hover { background: var(--pill); border-color: var(--pill); color: #000; }
.savebar__progress { font-size: 14px; color: var(--cover-ink); }
.savebar__progress .num { font-weight: 600; color: #fff; }
.savebar__progress.is-done, .savebar__progress.is-done .num { color: #bfe6d2; }
.savebar__actions { display: flex; gap: var(--s2); }
.sheet-hint { margin-bottom: var(--s3); }

/* ---------- شبكة الحضور ---------- */
.att { font-size: 13px; }
.att th, .att td { padding: 6px 4px; text-align: center; }
.att th[scope="row"] { text-align: start; white-space: nowrap; padding-inline: var(--s3); position: sticky; inset-inline-start: 0; background: var(--surface); }
.att .d { display: inline-block; width: 24px; line-height: 24px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.att .d--present { background: var(--green-wash); color: var(--green-deep); }
.att .d--absent { background: var(--brick); color: #fff; }
.att .d--excused { background: var(--slate-wash); color: var(--slate); }
.att .d--late { background: var(--ochre-wash); color: #6b4a10; }
.att .wk { color: var(--ink-mute); font-weight: 400; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin-top: var(--s3); }
.legend .d { display: inline-block; width: 20px; line-height: 20px; text-align: center; border-radius: 5px; font-size: 11px; font-weight: 600; margin-inline-end: 4px; }

/* ---------- الرسائل ---------- */
.msg-unread td, .msg-unread th { font-weight: 600; }
.msg-unread th::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: var(--s2); border-radius: 50%; background: var(--green); vertical-align: 2px; }
.msg-body { white-space: pre-wrap; font-size: 15.5px; line-height: 1.95; max-width: 70ch; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: var(--s4); background: var(--pill); border-radius: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 6px 14px; color: var(--ink-soft); font-size: 14px; font-weight: 500; text-decoration: none; border: 1px solid transparent; border-radius: var(--r-md); white-space: nowrap; }
.tabs a:hover { color: var(--ink-strong); }
.tabs a[aria-current="page"] { color: var(--ink-strong); font-weight: 700; background: var(--surface); border-color: var(--rule-strong); }

/* ---------- الدخول ---------- */
.auth { flex: 1 0 auto; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--canvas); }
.auth__form { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: var(--s7) clamp(20px, 6vw, 88px); }
.auth__form .brand { padding: 0; margin-bottom: var(--s6); }
.auth__card { width: 100%; max-width: 560px; padding: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); }
.auth__form h1 { font: 700 30px/1.3 var(--font-ui); color: var(--ink-strong); margin-bottom: var(--s1); letter-spacing: -.2px; }
.auth__form .lead { color: var(--ink-soft); margin-bottom: var(--s5); }
.auth__form form { display: grid; gap: var(--s4); max-width: 440px; }
.auth__form .btn { min-height: 46px; }
.auth__form .head__crumb { font-size: 13px; color: var(--ink-mute); margin-bottom: 2px; }
.auth__form form.auth__wide, .auth__form .choices, .auth__form .prose { max-width: 520px; }
.auth__form form.auth__wide ~ .auth__links, .auth__form .choices ~ .auth__links { max-width: 520px; }
.auth__form fieldset { margin: 0; padding-top: var(--s3); display: grid; gap: var(--s4); }
.auth__form fieldset > .field + .field { margin-top: 0; }
.auth__form .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.auth__form .check { align-items: flex-start; line-height: 1.6; }
.auth__form .check input { margin-top: 5px; flex: none; }
.choices { display: grid; gap: var(--s3); }
.choice { display: grid; gap: 6px; padding: var(--s4) var(--s5); background: var(--surface-alt); border: 1px solid var(--rule-strong); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color var(--ease), background var(--ease); }
.choice:hover { border-color: var(--green); background: var(--green-tint); color: var(--ink); }
.choice__title { display: flex; align-items: center; gap: var(--s2); font: 700 18px/1.4 var(--font-ui); color: var(--ink-strong); }
.choice__title .icon { color: var(--green); }
.choice__text { color: var(--ink-soft); font-size: 14.5px; }
.choice__meta { font-size: 12.5px; color: var(--ink-mute); }
.prose h2 { font: 700 16px/1.4 var(--font-ui); color: var(--ink-strong); margin: var(--s5) 0 var(--s2); }
.prose p { margin-bottom: var(--s2); color: var(--ink-soft); font-size: 14.5px; }
.prose strong { color: var(--ink); }
.entry { display: grid; gap: var(--s4); }
.entry .field > .label { font-size: 13.5px; font-weight: 500; color: var(--ink-soft); }
.entry .passage { max-width: 460px; }
.entry input[type="date"] { max-width: 200px; }
.kv--goal { margin: var(--s3) 0; }
.toolbar--spaced { margin-top: var(--s5); }
.panel.form { max-width: 760px; }
.panel.form .passage { max-width: 460px; margin: var(--s3) 0 var(--s1); }
.auth__form .notice { max-width: 520px; }
.auth__links { margin-top: var(--s4); font-size: 14.5px; }
.auth__foot { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-mute); }
.auth__form .pw button { min-height: 0; }

.auth__art {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: var(--s6);
  padding: var(--s7) clamp(24px, 5vw, 72px);
  background: var(--cover); color: var(--cover-ink); overflow: hidden; isolation: isolate;
}
/* Faint star lattice behind the verse, fading toward the bottom. */
.auth__art::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("pattern.svg") center top / 200px; opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
          mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.auth__basmala { text-align: center; font: 400 22px/1.6 var(--font-display); color: var(--on-dark); opacity: .9; }
.auth__art blockquote { margin: 0; text-align: center; padding: var(--s5) 0; border-block: 1px solid var(--cover-line); }
.auth__art blockquote p { font: 400 clamp(24px, 2.4vw, 34px)/2 var(--font-display); color: #fff; text-wrap: balance; }
.auth__art cite { display: block; margin-top: var(--s2); font: 400 13.5px/1.5 var(--font-ui); font-style: normal; color: var(--cover-mute); }
.auth__points { display: grid; gap: var(--s3); }
.auth__points li { display: grid; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--cover-line); border-radius: 12px; background: rgba(255, 255, 255, .04); }
.auth__points b { color: #fff; font-weight: 600; font-size: 15px; }
.auth__points span { color: var(--cover-mute); font-size: 13.5px; }
.pw { position: relative; }
/* The toggle sits at the inline end of the row (left in RTL); the LTR input keeps clear of it on that side. */\n.pw input { padding-inline-start: 64px; }
.pw button { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; border-radius: var(--r-sm); font: 400 13px var(--font-ui); color: var(--ink-mute); cursor: pointer; padding: 4px 6px; }
.pw button:hover { color: var(--ink); }

.error-page { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: var(--s6); }
.error-page > div { padding: var(--s7) clamp(20px, 6vw, 64px); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); }
.error-page .code { font: 700 96px/1 var(--font-ui); color: var(--green); letter-spacing: -2px; }
.error-page h1 { font: 700 26px/1.4 var(--font-ui); color: var(--ink-strong); margin: var(--s3) 0 var(--s2); }
.error-page p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto var(--s5); white-space: pre-line; }

/* ---------- الشاشات المتوسطة والصغيرة ---------- */
@media (max-width: 1240px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .brand__sub { display: none; }
  .userbtn__name { display: none; }
  .userbtn { padding-inline: 4px 8px; }
}
@media (max-width: 960px) {
  /* A backdrop filter would make the header the containing block of the fixed drawer inside it. */
  .topbar { background: var(--canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar .topbar__menu { display: inline-grid; }
  .topbar__cta { display: none; }
  .user { display: none; }
  .brand__sub { display: block; max-width: 52vw; }
  .basmala { font-size: 15px; padding-top: 6px; }

  /* The navigation becomes a drawer from the inline start edge (right in RTL). */
  .nav {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: min(86vw, 320px);
    display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
    background: var(--canvas); border-inline-end: 1px solid var(--rule-strong);
    transform: translateX(var(--drawer-off)); visibility: hidden;
    transition: transform var(--ease), visibility 0s linear 150ms;
  }
  body.nav-open .nav { transform: none; visibility: visible; transition: transform var(--ease); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity var(--ease); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule-strong); position: sticky; top: 0; background: var(--canvas); z-index: 1; }
  .nav__head .brand__name { font-size: 18px; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; padding: var(--s3); flex: 1; }
  .nav__link { display: flex; width: 100%; padding: 10px 12px; font-size: 15.5px; }
  .nav__link > .icon:first-child { display: inline-block; color: var(--ink-mute); }
  .nav__link[aria-current="page"] > .icon:first-child { color: var(--green); }
  summary.nav__link { margin-top: var(--s2); font-size: 12.5px; font-weight: 600; color: var(--ink-mute); padding-block: 6px; }
  summary.nav__link.is-current { background: none; color: var(--ink-mute); }
  summary.nav__link .icon:last-child { margin-inline-start: auto; }
  .nav .dd__menu { position: static; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .nav .dd__menu a { padding: 10px 12px; font-size: 15.5px; }
  .nav__who { display: grid; gap: 2px; margin: var(--s3); padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px; font-size: 13px; }
  .who__row { display: flex; gap: var(--s2); margin-top: var(--s2); }
  .main { padding: var(--s5) 0 calc(var(--tabbar-h) + var(--s6)); }
  .foot { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--rule-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .tabbar a, .tabbar button {
    position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font: 500 11.5px/1.3 var(--font-ui); color: var(--ink-mute); text-decoration: none; background: none; border: 0; cursor: pointer;
  }
  .tabbar a > span:last-child, .tabbar button > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 2px; }
  .tabbar [aria-current="page"] { color: var(--ink-strong); font-weight: 700; }
  .tabbar [aria-current="page"] .tabbar__icon { background: var(--green-wash); color: var(--green); }
  .tabbar__icon { padding: 3px 14px; border-radius: 999px; transition: background var(--ease); }
  .tabbar a:focus-visible, .tabbar button:focus-visible { box-shadow: inset 0 0 0 2px var(--green); border-radius: var(--r-md); }
  .tabbar__icon { position: relative; display: inline-flex; }
  .tabbar__count { position: absolute; top: -4px; inset-inline-end: 2px; min-width: 18px; padding: 0 5px; background: var(--brick); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 18px; text-align: center; border-radius: 9px; box-shadow: 0 0 0 2px var(--surface); }
  .savebar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s2)); }
  .cols, .cols--even, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .head { margin-bottom: var(--s5); }
  .head h1 { font-size: 26px; }
  .ledger dd { font-size: 27px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__art { display: none; }
  .auth__form { align-items: stretch; padding: var(--s5) var(--s4) var(--s6); justify-content: flex-start; }
  .auth__card { max-width: none; }
}
/* List tables on phones: one card per row. app.js labels each cell from its column header and adds
   .cards; a table it did not label stays a scrolling table. Row title first, then "label ... value" lines. */
@media (max-width: 720px) {
  .table-wrap--cards { background: none; border: 0; border-radius: 0; overflow: visible; }
  .cards, .cards tbody, .cards tfoot, .cards tr, .cards th, .cards td { display: block; }
  .cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cards tbody, .cards tfoot { display: grid; gap: var(--s2); }
  .cards tfoot { margin-top: var(--s2); }
  .cards tr { display: flex; flex-direction: column; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); }
  .cards tbody tr + tr td, .cards tbody tr + tr th { border-top: 0; }
  .cards tbody tr:hover td, .cards tbody tr:hover th { background: none; }
  .cards th[scope="row"] { order: -1; padding: 0 0 var(--s2); white-space: normal; font-size: 15.5px; }
  .cards th[scope="row"] .tag { margin-inline-start: var(--s2); }
  /* Label floats to the start, value sits at the end; flow-root keeps both inside the line. */
  .cards td { display: flow-root; padding: 6px 0; line-height: 1.55; text-align: end; white-space: normal; border-top: 1px solid var(--rule); }
  /* Number cells are LTR in the table; in a card the row follows the page, or label and value swap sides. */
  .cards td.num { direction: inherit; }
  .cards td[data-label]::before { content: attr(data-label); float: inline-start; max-width: 48%; margin-inline-end: var(--s3); text-align: start; font-size: 13px; color: var(--ink-mute); }
  .cards td .cell-sub { display: block; }
  /* Block charts would ignore the floated label; inline ones sit beside it. */
  .cards td .meter, .cards td .spark { display: inline-block; vertical-align: middle; }
  .cards td:empty, .cards td.cell-empty { display: none; }
  .cards tr.no-title > td:first-child { border-top: 0; padding-top: 0; }
  .cards td.actions { order: 10; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); padding-bottom: 0; }
  .cards td.actions .btn { min-height: 40px; }
  .cards tfoot tr { background: var(--surface-alt); }
  .cards tfoot td { border-top-color: var(--rule-strong); }
  .cards .msg-unread th[scope="row"]::before { vertical-align: 3px; }

  .sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--s3); font-size: 13px; color: var(--ink-mute); }
  .sortbar span { margin-inline-end: 2px; }
  .sortbar a { padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--ink-soft); text-decoration: none; }
  .sortbar a[aria-current] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--on-dark); }
}

/* Daily sheet on phones: one card per student instead of a table that scrolls sideways.
   Same form fields and names; only the layout changes. */
@media (max-width: 720px) {
  .sheet-wrap { background: none; border: 0; border-radius: 0; overflow: visible; }
  .sheet, .sheet tbody, .sheet tr, .sheet th, .sheet td { display: block; }
  .sheet thead { display: none; }
  .sheet tbody { display: grid; gap: var(--s3); }
  .sheet tr { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--s3) var(--s4) var(--s4); }
  .sheet tbody tr + tr td, .sheet tbody tr + tr th { border-top: 0; }
  .sheet tbody tr:hover td, .sheet tbody tr:hover th, .sheet tbody tr:hover th[scope="row"] { background: none; }
  .sheet th[scope="row"] { position: static; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 0 0 var(--s3); background: none; white-space: normal; }
  .sheet th[scope="row"] .cell-main { font-size: 16px; }
  .sheet th[scope="row"] .cell-sub { display: inline; }
  .sheet td { padding: 0; }
  .sheet td + td { margin-top: var(--s3); }
  .sheet td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--ink-mute); }
  /* Four equal attendance buttons, each a comfortable 44px tap target. */
  .sheet .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .sheet .seg span { padding: 11px 0; text-align: center; font-size: 14px; }
  /* Every passage picker (sheet, student page, personal log) stacks: sura | ayah, "إلى", sura | ayah. */
  .passage { grid-template-columns: minmax(0, 1fr) 68px; gap: 6px; }
  .passage .to { grid-column: 1 / -1; text-align: start; }
  /* 16px stops phones from zooming into the field on focus. */
  .sheet select, .sheet input { min-height: 44px; padding: 6px 10px; font-size: 16px; }
  .sheet .passage { grid-template-columns: minmax(0, 1fr) 68px; grid-template-areas: "fs fa" "to to" "ts ta"; gap: 6px; }
  /* Undo the desktop row sizing: in a card every part takes the full width. */
  .sheet th[scope="row"], .sheet .att-cell { width: auto; }
  .sheet td.work-cell + td.work-cell { border-inline-start: 0; padding-inline-start: 0; }
  .sheet .work { display: block; }
  .sheet .work__passage { min-width: 0; }
  .sheet .work__grade { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: auto; margin-top: 2px; }
  .sheet .work__grade > span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-size: 12.5px; color: var(--ink-mute); }
  .sheet .work__grade select { width: auto; min-width: 50%; }
  .sheet .sheet-note { margin-top: var(--s2); }
  /* Absent or excused: nothing to record but the note, so the card shrinks. */
  .sheet tr.is-absent td.work-cell { display: none; }
  .savebar { flex-wrap: wrap; gap: 6px; padding: var(--s2) var(--s3) var(--s3); }
  .savebar__progress { flex: 1 1 100%; font-size: 13px; }
  .savebar__actions { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .savebar .btn { min-height: 42px; }
  /* Circle and day side by side, so the first student shows sooner. */
  .toolbar .field { flex: 1 1 140px; }
}
@media (max-width: 560px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger > div { padding: var(--s4); }
  .head h1 { font-size: 23px; }
  th, td { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  body { background: #fff; font-size: 12px; }
  .basmala, .topbar, .foot, .scrim, .tabbar, .toolbar, .head__actions, .btn, .pager, .savebar, .skip, .notice { display: none !important; }
  .main { padding: 0; }
  .table-wrap, .panel, .ledger { border-color: #999; background: #fff; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- خطة الحفظ (صفحة عامة) ---------- */
.pubnav { display: flex; gap: 2px; }
.planner-page { max-width: 1040px; }
.hero { margin-bottom: var(--s5); }
.hero h1 { font: 700 clamp(28px, 4.2vw, 40px)/1.3 var(--font-ui); color: var(--ink-strong); letter-spacing: -.4px; text-wrap: balance; }
.hero__lead { margin-top: var(--s2); font-size: 16px; color: var(--ink-soft); }

/* Mode switch: two pills, the chosen one a white card. */
.modes { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: var(--s3); background: var(--pill); border-radius: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.modes button { padding: 7px 14px; font: 500 14px/1.4 var(--font-ui); color: var(--ink-soft); background: none; border: 1px solid transparent; border-radius: var(--r-md); white-space: nowrap; cursor: pointer; }
.modes button:hover { color: var(--ink-strong); }
.modes button[aria-selected="true"] { color: var(--ink-strong); font-weight: 700; background: var(--surface); border-color: var(--rule-strong); }

.planner { padding: clamp(18px, 3vw, 32px); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); }

/* The sentence: plain words with fill-in blanks underlined in green. */
.sentence { font: 500 clamp(19px, 2.3vw, 25px)/2.2 var(--font-ui); color: var(--ink-strong); }
.sentence .blank {
  width: auto; min-height: 0; display: inline-block; vertical-align: baseline;
  margin: 0 2px; padding: 0 2px 2px; padding-inline-end: 22px;
  font: inherit; font-weight: 600; color: var(--green); line-height: 1.5;
  background: transparent no-repeat left 2px center / 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7873' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  border: 0; border-bottom: 1.5px dashed var(--gold-soft); border-radius: 0;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.sentence .blank:hover { border-bottom-color: var(--green); background-color: var(--green-tint); }
.sentence .blank:focus { outline: none; box-shadow: none; border-bottom: 2px solid var(--green); background-color: var(--green-tint); }
.sentence .blank--num { width: 2.6em; padding-inline-end: 2px; text-align: center; background-image: none; cursor: text; -moz-appearance: textfield; }
.sentence .blank--num::-webkit-inner-spin-button, .sentence .blank--num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sentence .blank--date { padding-inline-end: 2px; background-image: none; font-size: .82em; direction: ltr; }
.sentence .blank[aria-invalid="true"] { color: var(--brick); border-bottom-color: var(--brick); }
.sentence select.blank option { color: var(--ink); font-size: 15px; font-weight: 400; }

.pauses { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule); }
.pauses__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.pauses__head b { display: block; font-size: 15px; color: var(--ink-strong); }
.pauses__head .check { font-size: 13.5px; color: var(--ink-soft); }
.pauses__list { display: grid; gap: var(--s2); margin-top: var(--s3); }
.pauses__list:empty { display: none; }
.pause { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s2) var(--s3); background: var(--surface-alt); border: 1px solid var(--rule); border-radius: 10px; font-size: 14px; }
.pause input[type="date"] { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; direction: ltr; }
.pause input[type="text"] { flex: 1 1 140px; width: auto; min-height: 36px; padding: 4px 10px; font-size: 14px; }
.pause .btn--quiet { margin-inline-start: auto; color: var(--brick); }
.linkbtn { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--s2); padding: 4px 0; font: 600 14px/1.5 var(--font-ui); color: var(--green); background: none; border: 0; cursor: pointer; }
.linkbtn:hover { color: var(--green-deep); text-decoration: underline; text-underline-offset: 4px; }

.adv { margin-top: var(--s4); border: 1px solid var(--rule); border-radius: 12px; background: var(--surface-alt); }
.adv > summary { display: flex; align-items: baseline; gap: var(--s2) var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); cursor: pointer; list-style: none; font-weight: 600; color: var(--ink-strong); }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary .icon { margin-inline-start: auto; align-self: center; color: var(--ink-mute); transition: transform var(--ease); }
.adv[open] > summary .icon { transform: rotate(180deg); }
.adv > summary .hint { font-weight: 400; }
.adv__body { display: grid; gap: var(--s4); padding: 0 var(--s4) var(--s4); }
.adv__group { margin: 0; padding: 0; border: 0; }
.adv__group legend { padding: 0; margin-bottom: var(--s2); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.adv__group .hint { margin-top: 6px; }
.adv .field { max-width: 320px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span { display: block; padding: 6px 12px; font-size: 14px; font-weight: 500; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--field-line); border-radius: 999px; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.chip:hover span { border-color: var(--ink-mute); }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chip input:focus-visible + span { box-shadow: var(--focus); }

/* The answer under the sentence, in the reference's soft green card. */
.result { display: block; margin-top: var(--s5); padding: var(--s4) var(--s5); background: var(--green-wash); border: 1px solid #bedbcc; border-radius: 12px; color: var(--green-deep); }
.result__title { display: block; font: 700 clamp(18px, 2vw, 22px)/1.5 var(--font-ui); color: var(--green-deep); }
.result__title strong { color: var(--green); }
.result__sub { display: block; margin-top: 2px; font-size: 14px; color: #2c5c4b; }
.result.is-error { background: var(--brick-wash); border-color: #ecc4b9; }
.result.is-error .result__title { color: #7d2a1c; font-size: 16px; }
.planner__actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }

.planout { margin-top: var(--s6); }
.planout, .how { scroll-margin-top: calc(var(--topbar-h) + var(--s4)); }
.planout .sec-row { align-items: flex-end; flex-wrap: wrap; margin-top: 0; }
.planout__sum { font-size: 14px; margin-top: 2px; }
.plan-table td { vertical-align: top; }
.plan-table .day { font-weight: 600; color: var(--ink-strong); white-space: nowrap; }
.plan-table .day small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-mute); }
.plan-table .pass { font-weight: 600; color: var(--ink-strong); }
.plan-table .pass small, .plan-table .rev small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-mute); }
.plan-table .rev { color: var(--ink-soft); font-size: 14px; }
.plan-table tr.is-pause td { background: var(--ochre-wash); color: #5c3f0b; font-size: 13.5px; text-align: center; }
.plan-table tr.is-month td { background: var(--surface-alt); color: var(--ink-strong); font-weight: 700; font-size: 13.5px; }
.plan-table tr.is-done td { opacity: .5; }
.plan-table input[type="checkbox"] { width: 18px; height: 18px; }

.how { margin-top: var(--s7); }
.faq { display: grid; gap: var(--s2); }
.faq details { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px; }
.faq summary { padding: var(--s3) var(--s4); font-weight: 600; color: var(--ink-strong); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--s3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--ink-mute); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { padding: 0 var(--s4) var(--s4); color: var(--ink-soft); font-size: 14.5px; max-width: 80ch; }

@media (max-width: 960px) {
  .is-public .main { padding-bottom: var(--s7); }
  .is-public .foot { padding-bottom: 0; }
  .pubnav .nav__link:not([aria-current]) { display: none; }
}
@media (max-width: 720px) {
  .pubnav, .pubnav__extra { display: none; }
  .sentence { line-height: 2.35; }
}
@media print {
  .is-public .hero, .is-public .modes, .is-public .planner, .is-public .how, .is-public .planout .head__actions, .is-public .pager, .no-print { display: none !important; }
  .is-public .planout { margin: 0; }
  .plan-table tr.is-done td { opacity: 1; }
}

/* ---------- البحث ---------- */
kbd { display: inline-block; min-width: 20px; padding: 0 5px; font: 600 11px/18px var(--font-ui); color: var(--ink-mute); text-align: center; background: var(--surface); border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 5px; direction: ltr; }

/* Top bar: looks like a field, opens the search panel. */
.searchbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 220px; padding: 0 10px 0 8px; padding-inline: 12px 8px;
  color: var(--ink-mute); text-decoration: none; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-md);
  transition: border-color var(--ease), background var(--ease);
}
.searchbtn:hover { color: var(--ink-soft); border-color: var(--field-line); background: var(--surface); }
.searchbtn__text { flex: 1; font-size: 14px; }
.searchbtn__kbd { flex: none; }

.palette { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; background: rgba(20, 20, 18, .38); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.palette[hidden] { display: none; }
body.palette-open { overflow: hidden; }
.palette__panel { width: min(640px, 100%); max-height: min(620px, 80vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .45); overflow: hidden; }
.palette__bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--rule); }
.palette__bar .icon { color: var(--ink-mute); }
.palette__bar input[type="search"] { flex: 1; min-height: 50px; padding: 0; font-size: 17px; border: 0; background: none; box-shadow: none; }
.palette__bar input[type="search"]:focus { box-shadow: none; }
.palette__bar input[type="search"]::-webkit-search-cancel-button { display: none; }
.palette.is-loading .palette__bar::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--green), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: palette-load 1s linear infinite; }
@keyframes palette-load { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.palette__esc { padding: 0; background: none; border: 0; cursor: pointer; }
.palette__body { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.palette__hint { display: grid; gap: 4px; padding: var(--s5) var(--s4); text-align: center; color: var(--ink-mute); font-size: 14px; }
.palette__hint b { color: var(--ink-strong); font-size: 15px; }
.palette__group + .palette__group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--rule); }
.palette__label { display: flex; justify-content: space-between; padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-mute); }
.palette__label span { font-weight: 400; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.pal-item.is-active { background: var(--green-wash); color: var(--green-deep); }
.pal-item__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--pill); color: var(--ink-soft); }
.pal-item.is-active .pal-item__icon { background: var(--surface); color: var(--green); }
.pal-item__text { display: grid; min-width: 0; }
.pal-item__title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.pal-item__sub { font-size: 12.5px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item--all { margin-top: 4px; border-top: 1px solid var(--rule); border-radius: 0 0 10px 10px; color: var(--green); }
.pal-item--all .pal-item__title { font-weight: 600; }
.palette__foot { display: flex; gap: var(--s4); flex-wrap: wrap; padding: 8px 14px; font-size: 12px; color: var(--ink-mute); background: var(--surface-alt); border-top: 1px solid var(--rule); }
.palette__foot kbd { margin-inline-end: 2px; }

/* Search results page */
.searchpage { display: flex; gap: var(--s2); max-width: 720px; margin-bottom: var(--s5); }
.searchpage__box { position: relative; flex: 1; }
.searchpage__box .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); pointer-events: none; }
.searchpage__box input { min-height: 48px; padding-inline-start: 42px; font-size: 16px; }
.searchpage .btn { min-height: 48px; }
.results { display: grid; gap: 6px; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color var(--ease), background var(--ease); }
.result-row:hover { border-color: var(--green); background: var(--green-tint); color: var(--ink); }
.result-row__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--pill); color: var(--ink-soft); }
.result-row__text { display: grid; min-width: 0; }
.result-row__title { font-weight: 600; color: var(--ink-strong); unicode-bidi: plaintext; }
.result-row__sub { font-size: 13px; color: var(--ink-mute); }

/* Searchable drop-downs: the popup that replaces a long native list. */
select.has-search { cursor: pointer; }
.combo {
  position: fixed; z-index: 80; top: var(--combo-top, auto); bottom: var(--combo-bottom, auto); right: var(--combo-right, 8px);
  width: var(--combo-w, 280px); max-width: calc(100vw - 16px); max-height: var(--combo-h, 380px);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px;
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .35), 0 2px 6px -2px rgba(0, 0, 0, .08); overflow: hidden;
  font: 400 15px/1.5 var(--font-ui); color: var(--ink);
}
.combo[hidden] { display: none; }
.combo__bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--rule); }
.combo__bar .icon { color: var(--ink-mute); }
.combo__bar input[type="search"] { flex: 1; min-height: 36px; padding: 0; border: 0; background: none; font-size: 15px; }
.combo__bar input[type="search"]:focus { box-shadow: none; }
.combo__count { flex: none; font-size: 12px; color: var(--ink-mute); white-space: nowrap; }
.combo__list { overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.combo__opt { padding: 7px 10px; border-radius: 8px; cursor: pointer; unicode-bidi: plaintext; text-align: start; }
.combo__opt.is-active { background: var(--pill); }
.combo__opt[aria-selected="true"] { font-weight: 600; color: var(--green-deep); }
.combo__opt[aria-selected="true"]::after { content: "✓"; float: inline-end; color: var(--green); }
.combo__opt[aria-disabled="true"] { color: var(--ink-mute); cursor: default; }
.combo__group { padding: 8px 10px 2px; font-size: 12px; font-weight: 600; color: var(--ink-mute); }
.combo__empty { padding: 14px 10px; text-align: center; color: var(--ink-mute); font-size: 14px; }
/* Phones: a sheet from the bottom edge, big enough to tap. */
.combo--sheet { inset: auto 0 0 0; width: 100%; max-width: none; max-height: 72vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.combo--sheet .combo__bar input[type="search"] { min-height: 46px; font-size: 16px; }
.combo--sheet .combo__opt { padding: 11px 12px; }

/* Quick filter above list tables */
.tfilter { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
.tfilter__box { position: relative; flex: 0 1 340px; }
.tfilter__box .icon { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); pointer-events: none; }
.tfilter__box input[type="search"] { min-height: 38px; padding-inline-start: 36px; font-size: 14px; background: var(--surface); }
.tfilter__count { font-size: 13px; color: var(--ink-mute); }
.tfilter__empty { margin-top: var(--s2); padding: var(--s4); }
.table-wrap.is-empty { display: none; }
tr.is-filtered-out { display: none !important; }

@media (max-width: 1280px) {
  .searchbtn { min-width: 0; }
  .searchbtn__kbd { display: none; }
}
@media (max-width: 1100px) {
  .searchbtn { width: 40px; padding: 0; justify-content: center; }
  .searchbtn__text { display: none; }
}
/* Steps app.js adds, in order, while the top bar's items do not fit (any width above the phone drawer). */
@media (min-width: 961px) {
  .topbar.fit-1 .searchbtn { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .topbar.fit-1 .searchbtn__text, .topbar.fit-1 .searchbtn__kbd { display: none; }
  .topbar.fit-2 .brand__sub { display: none; }
  .topbar.fit-3 .userbtn__name { display: none; }
  .topbar.fit-3 .userbtn { padding-inline: 4px 8px; }
  .topbar.fit-3 .nav__link { padding-inline: 8px; }
}

/* Jump to the top or bottom of a long page. Fixed at the inline end (left in RTL), above the phone tab bar and any save bar. */
.jump { position: fixed; inset-inline-end: 16px; bottom: 20px; z-index: 25; display: grid; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-md); box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .35); overflow: hidden; }
.jump[hidden] { display: none; }
.jump__btn { display: grid; place-items: center; width: 36px; height: 34px; padding: 0; border: 0; background: none; color: var(--ink-soft); cursor: pointer; transition: background var(--ease), color var(--ease), opacity var(--ease); }
.jump__btn + .jump__btn { border-top: 1px solid var(--rule); }
.jump__btn:hover { background: var(--pill); color: var(--ink-strong); }
.jump__btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.jump__btn[data-jump-to="top"] .icon { transform: rotate(180deg); }
.jump.at-top [data-jump-to="top"], .jump.at-bottom [data-jump-to="bottom"] { opacity: .35; }
body:has(.savebar) .jump { bottom: 104px; }
@media (max-width: 960px) {
  .jump { inset-inline-end: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  body:has(.savebar) .jump { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px); }
}
@media print { .jump { display: none !important; } }
@media (max-width: 720px) {
  .palette { padding: 0; align-items: stretch; }
  .palette__panel { max-height: none; height: 100%; border-radius: 0; border: 0; }
  .palette__foot { display: none; }
  .tfilter__box { flex: 1 1 100%; }
  .searchpage .btn { display: none; }
}
@media print {
  .searchbtn, .palette, .combo, .tfilter { display: none !important; }
}
