/* ==========================================================================
   ترتيل (Tarteel) — Ornamental design system (Mushaf-inspired)
   رقّ (parchment) · عنابي (burgundy) · ذهبي عتيق (antique gold) · حبر (ink)
   يُحمَّل بعد ../../shared/css/base.css ويعيد تعريف الرموز.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Readex+Pro:wght@300;400;500;600&display=swap");

:root {
  --parchment: #f6f0e4;
  --parchment-2: #efe5d2;
  --paper: #fffaf1;
  --paper-2: #fbf4e6;
  --rose: #efe2d6;
  --rose-2: #e8d3c3;
  --wine: #6e1f35;
  --wine-600: #5a1829;
  --wine-700: #46121f;
  --wine-soft: #f5e4e3;
  --gold: #b8892d;
  --gold-600: #96701f;
  --gold-2: #d6b46c;
  --gold-3: #ecd9a8;
  --gold-soft: #f6ecd2;
  --ink: #2b2320;
  --ink-2: #6b5d55;
  --ink-3: #a39486;
  --line: #e6d8bf;
  --line-gold: rgba(184, 137, 45, .42);
  --olive: #5b7a3a;
  --olive-soft: #e7eedb;
  --amber: #b7791f;
  --amber-soft: #f8ebcf;
  --blue-ink: #3c5a78;
  --blue-soft: #e4eaf0;
  --red: #a32a2a;
  --red-soft: #f6dcd6;

  /* base.css overrides */
  --brand: var(--wine);
  --brand-600: var(--wine-600);
  --brand-soft: var(--wine-soft);
  --accent: var(--gold);
  --gradient: linear-gradient(135deg, #7a2440 0%, #6e1f35 55%, #4d1526 100%);
  --bg: var(--parchment);
  --surface: var(--paper);
  --surface-2: var(--paper-2);
  --border: var(--line);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --muted: var(--ink-3);
  --navy: var(--wine-700);
  --success: var(--olive); --success-soft: var(--olive-soft);
  --warning: var(--amber); --warning-soft: var(--amber-soft);
  --danger: var(--red); --danger-soft: var(--red-soft);
  --info: var(--blue-ink); --info-soft: var(--blue-soft);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(74, 44, 20, .06);
  --shadow: 0 10px 28px -18px rgba(74, 44, 20, .45);
  --shadow-lg: 0 28px 60px -28px rgba(60, 30, 20, .55);
  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-head: "Amiri", "Traditional Arabic", "Times New Roman", serif;

  /* ornaments (8-point star lattice) */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23b8892d' stroke-width='1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 0l10 10M72 0L62 10M0 72l10-10M72 72L62 62M36 0v8M36 64v8M0 36h8M64 36h8'/%3E%3C/g%3E%3C/svg%3E");
  --pattern-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23e8cf93' stroke-width='1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 0l10 10M72 0L62 10M0 72l10-10M72 72L62 62M36 0v8M36 64v8M0 36h8M64 36h8'/%3E%3C/g%3E%3C/svg%3E");
  --star-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23b8892d'%3E%3Crect x='5' y='5' width='14' height='14' rx='1'/%3E%3Crect x='5' y='5' width='14' height='14' rx='1' transform='rotate(45 12 12)'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='3' fill='%23fffaf1'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ Base */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(184, 137, 45, .10), transparent 60%),
    repeating-linear-gradient(0deg, rgba(110, 80, 40, .018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(110, 80, 40, .012) 0 1px, transparent 1px 5px);
  background-attachment: fixed;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0; background: var(--pattern) 0 0 / 72px 72px; opacity: .07; pointer-events: none; z-index: -1; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--ink); letter-spacing: 0; }
a { color: var(--wine); }
::selection { background: var(--gold-3); color: var(--ink); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.amiri { font-family: var(--font-head); }
.text-wine { color: var(--wine); } .text-gold { color: var(--gold-600); } .text-olive { color: var(--olive); } .text-red { color: var(--red); }
.fw-5 { font-weight: 500; } .fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.fs-xs { font-size: 12px; } .fs-sm { font-size: 13px; } .fs-lg { font-size: 17px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.center { text-align: center; }
.is-hidden, [hidden] { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.split-wide { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split, .split-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .g-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g-2 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ Shell: slim top bar + floating nav panel */
.tr-shell { position: relative; z-index: 1; max-width: 1480px; margin: 0 auto; padding: 14px 20px 0; }
.topbar {
  position: sticky; top: 12px; z-index: 40;
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 14px 8px 12px;
  background: rgba(255, 250, 241, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-gold); border-radius: 20px;
  box-shadow: inset 0 0 0 3px rgba(255, 250, 241, .9), inset 0 0 0 4px rgba(184, 137, 45, .18), 0 12px 30px -22px rgba(74, 44, 20, .6);
}
.tb-mark { display: none; width: 40px; height: 40px; color: var(--wine); }
.tb-mark svg { width: 100%; height: 100%; }
.tb-mark .brand-logo { width: 100%; height: 100%; }
.tb-title { min-width: 0; flex: 1 1 auto; }
.tb-title h1 { font-size: 23px; margin: 0; line-height: 1.25; color: var(--wine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title small { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--ink-2); font-size: 12.5px; }
.tb-title .dot { color: var(--gold); font-size: 9px; align-self: center; }
.tb-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tb-center { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-600); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line-gold); }
.tb-center svg { width: 15px; height: 15px; }
.icon-btn, .btn-icon {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; transition: .15s;
}
.icon-btn:hover, .btn-icon:hover { color: var(--wine); border-color: var(--gold-2); background: var(--gold-soft); }
.icon-btn svg, .btn-icon svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }
.dot-count { position: absolute; top: -3px; left: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--wine); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--paper); }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: inherit; color: var(--ink); }
.user-btn:hover { border-color: var(--gold-2); }
.user-btn .meta { display: flex; flex-direction: column; text-align: start; line-height: 1.25; max-width: 170px; }
.user-btn .meta b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn .meta small { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn > svg { width: 16px; height: 16px; color: var(--ink-3); }

.tr-body { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 24px; margin-top: 20px; align-items: start; }
.tr-main { min-width: 0; }
.content { min-width: 0; }

.navcard {
  position: sticky; top: 92px; z-index: 30;
  display: flex; flex-direction: column; max-height: calc(100vh - 110px);
  border-radius: 28px; color: #f3e6d4; overflow: hidden;
  background: linear-gradient(170deg, #7d2642 0%, #641c32 48%, #4b1425 100%);
  box-shadow: 0 30px 50px -30px rgba(70, 18, 31, .8), 0 0 0 1px rgba(184, 137, 45, .55);
}
.navcard::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(214, 180, 108, .38); border-radius: 23px; pointer-events: none; }
.nc-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px 18px; text-align: center; color: inherit; isolation: isolate; }
.nc-head::before { content: ""; position: absolute; inset: 0; background: var(--pattern-light) center / 54px 54px; opacity: .16; z-index: -1; -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
.nc-head::after { content: ""; position: absolute; bottom: 0; inset-inline: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); }
.nc-mark { width: 58px; height: 58px; color: var(--gold-2); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.nc-mark svg { width: 100%; height: 100%; }
.brand-logo { display: block; object-fit: contain; }
.nc-mark .brand-logo { width: 100%; height: 100%; background: #fbf5ea; padding: 5px; border-radius: 16px; box-shadow: 0 0 0 1px rgba(214, 180, 108, .6); }
.nc-brand b { display: block; font-family: var(--font-head); font-size: 32px; line-height: 1.1; color: #f2d99c; }
.nc-brand small { display: block; font-size: 11.5px; color: rgba(243, 230, 212, .75); margin-top: 3px; }
.nc-user { display: flex; align-items: center; gap: 10px; margin: 14px 14px 6px; padding: 9px 10px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(214, 180, 108, .2); }
.nc-user > div { min-width: 0; line-height: 1.3; }
.nc-user b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-user small { display: block; font-size: 11px; color: rgba(243, 230, 212, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-nav { flex: 1 1 auto; overflow-y: auto; padding: 8px 12px; scrollbar-width: thin; scrollbar-color: rgba(214, 180, 108, .35) transparent; }
.nc-section { display: flex; align-items: center; gap: 8px; margin: 14px 6px 6px; font-size: 11px; color: var(--gold-2); letter-spacing: .3px; }
.nc-section::before, .nc-section::after { content: ""; flex: 1; height: 1px; background: rgba(214, 180, 108, .28); }
.nc-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 13px; margin: 2px 0; border-radius: 14px; color: #f3e6d4; font-size: 14px; transition: .15s; }
.nc-link svg { width: 19px; height: 19px; color: var(--gold-2); flex-shrink: 0; }
.nc-link span:not(.count) { flex: 1; min-width: 0; }
.nc-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nc-link.active { background: var(--parchment); color: var(--wine); font-weight: 600; box-shadow: inset 0 0 0 1px var(--gold-2), 0 6px 16px -8px rgba(0, 0, 0, .5); }
.nc-link.active svg { color: var(--wine); }
.nc-link.active::after { content: ""; width: 10px; height: 10px; background: var(--star-gold) center / contain no-repeat; flex-shrink: 0; }
.nc-link .count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold-2); color: var(--wine-700); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.nc-foot { padding: 10px 14px 16px; border-top: 1px solid rgba(214, 180, 108, .2); display: flex; flex-direction: column; gap: 2px; }
.nc-foot a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; color: rgba(243, 230, 212, .82); font-size: 12.5px; }
.nc-foot a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nc-foot a svg { width: 16px; height: 16px; color: var(--gold-2); }
.nc-by { justify-content: center; margin-top: 6px; background: rgba(255, 250, 241, .94); color: var(--ink-2) !important; border-radius: 999px !important; font-size: 11.5px !important; }
.nc-by img { height: 16px; width: auto; }
.nav-overlay { display: none; }

.app-foot { margin: 34px 0 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.app-foot p { margin: 6px 0 0; }
.app-foot a { color: var(--gold-600); font-weight: 500; }

/* bottom pill navigation (phones) */
.pillnav { display: none; }

@media (max-width: 1080px) {
  .tr-body { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-grid; }
  .tb-mark { display: block; }
  .navcard { position: fixed; top: 12px; bottom: 12px; right: 12px; width: 286px; max-height: none; z-index: 90; transform: translateX(calc(100% + 30px)); transition: transform .28s ease; }
  body.nav-open .navcard { transform: none; }
  .nav-overlay { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(43, 35, 32, .45); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: .2s; }
  body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
}
@media (max-width: 860px) { .hide-md { display: none !important; } }
@media (max-width: 720px) {
  .tr-shell { padding: 10px 12px 0; }
  .topbar { top: 8px; min-height: 56px; padding: 6px 8px; gap: 8px; border-radius: 18px; }
  .menu-toggle { display: none; }
  .tb-mark { width: 34px; height: 34px; }
  .tb-title h1 { font-size: 19px; }
  .tb-title small span:first-child, .tb-title small .dot { display: none; }
  .user-btn .meta, .user-btn > svg { display: none; }
  .user-btn { padding: 3px; }
  .tr-body { margin-top: 14px; }
  .hide-sm { display: none !important; }
  body.has-pillnav { padding-bottom: 96px; }
  .pillnav {
    display: flex; position: fixed; z-index: 70; bottom: 12px; left: 12px; right: 12px; margin: 0 auto; max-width: 480px;
    padding: 6px; gap: 4px; border-radius: 999px;
    background: linear-gradient(170deg, #7d2642, #521628); box-shadow: 0 18px 36px -14px rgba(70, 18, 31, .7), 0 0 0 1px rgba(214, 180, 108, .55);
  }
  .pillnav a, .pillnav button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border-radius: 999px; color: rgba(243, 230, 212, .85); background: none; border: 0; font: inherit; cursor: pointer; }
  .pillnav svg { width: 20px; height: 20px; color: var(--gold-2); }
  .pillnav small { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .pillnav a.active { background: var(--parchment); color: var(--wine); font-weight: 600; }
  .pillnav a.active svg { color: var(--wine); }
  .app-foot { margin-bottom: 10px; }
}

/* ------------------------------------------------------------------ Dropdown & notifications */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; width: 290px; padding: 8px; display: none;
  background: var(--paper); border: 1px solid var(--line-gold); border-radius: 18px; box-shadow: var(--shadow-lg), inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(184, 137, 45, .18);
}
.dropdown.open .dropdown-menu { display: block; animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px dashed var(--line); margin-bottom: 6px; }
.dd-head > div { min-width: 0; flex: 1; }
.dd-head b { display: block; font-size: 14px; }
.dd-head small { display: block; color: var(--ink-2); font-size: 12px; }
.dropdown-menu .item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: 12px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: start; }
.dropdown-menu .item:hover { background: var(--gold-soft); }
.dropdown-menu .item svg { width: 17px; height: 17px; color: var(--gold-600); }
.dropdown-menu .item.danger, .dropdown-menu .item.danger svg { color: var(--red); }
.notif-menu { width: 340px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 14px; color: var(--ink); }
.notif-item:hover { background: var(--paper-2); }
.notif-item.unread { background: var(--gold-soft); }
.notif-item b { display: block; font-size: 13px; font-weight: 600; }
.notif-item p { margin: 2px 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.notif-item small { font-size: 11px; color: var(--ink-3); }
.n-ic { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-ink); }
.n-ic svg { width: 16px; height: 16px; }
.n-ic.t-success { background: var(--olive-soft); color: var(--olive); }
.n-ic.t-warning { background: var(--amber-soft); color: var(--amber); }
.n-ic.t-danger { background: var(--red-soft); color: var(--red); }
.dd-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }
@media (max-width: 520px) { .dropdown-menu, .notif-menu { position: fixed; top: 74px; left: 10px; right: 10px; width: auto; } }

/* ------------------------------------------------------------------ Ornaments */
.orn-divider { display: flex; align-items: center; gap: 10px; color: var(--gold); margin: 14px 0; }
.orn-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-2) 30%, var(--gold-2) 70%, transparent); }
.orn-divider svg { width: 16px; height: 16px; flex-shrink: 0; }
.orn-divider.small { max-width: 240px; margin: 0 auto; }
.orn-divider.small svg { width: 12px; height: 12px; }

/* surah-title cartouche band (like the surah headers in the Mushaf) */
.surah-head { display: grid; grid-template-columns: minmax(16px, 1fr) auto minmax(16px, 1fr); align-items: center; gap: 0; margin: 0 0 16px; }
.sh-wing { height: 16px; border-block: 1px solid var(--gold-2); background:
  linear-gradient(45deg, transparent 42%, rgba(184, 137, 45, .55) 43% 57%, transparent 58%) 0 0 / 16px 16px,
  linear-gradient(-45deg, transparent 42%, rgba(184, 137, 45, .55) 43% 57%, transparent 58%) 0 0 / 16px 16px, var(--gold-soft); }
.sh-box { position: relative; margin: 0 -1px; padding: 9px 38px; text-align: center; border: 1.5px solid var(--gold); border-radius: 8px; background: linear-gradient(180deg, #fffaf0, var(--gold-soft)); box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 4px var(--gold-2); }
.sh-box::before, .sh-box::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--star-gold) center / contain no-repeat; }
.sh-box::before { right: 12px; } .sh-box::after { left: 12px; }
.sh-box b { display: block; font-family: var(--font-head); font-size: 22px; line-height: 1.3; color: var(--wine); white-space: nowrap; }
.sh-box small { display: block; font-size: 12px; color: var(--ink-2); }
.surah-head.on-dark .sh-wing { border-color: rgba(214, 180, 108, .7); background:
  linear-gradient(45deg, transparent 42%, rgba(232, 207, 147, .5) 43% 57%, transparent 58%) 0 0 / 16px 16px,
  linear-gradient(-45deg, transparent 42%, rgba(232, 207, 147, .5) 43% 57%, transparent 58%) 0 0 / 16px 16px, rgba(0, 0, 0, .12); }
.surah-head.on-dark .sh-box { background: rgba(0, 0, 0, .14); border-color: var(--gold-2); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .05), inset 0 0 0 4px rgba(214, 180, 108, .55); }
.surah-head.on-dark .sh-box b { color: #f2d99c; }
.surah-head.on-dark .sh-box small { color: rgba(243, 230, 212, .85); }
@media (max-width: 520px) { .sh-box { padding: 8px 30px; } .sh-box b { font-size: 19px; white-space: normal; } }

.cartouche { display: inline-flex; align-items: center; gap: 8px; padding: 4px 20px; border: 1px solid var(--gold); border-radius: 999px; background: linear-gradient(180deg, #fffaf0, var(--gold-soft)); box-shadow: inset 0 0 0 2px #fffaf0, inset 0 0 0 3px var(--gold-3); font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--wine); position: relative; }
.cartouche::before, .cartouche::after { content: ""; width: 9px; height: 9px; background: var(--star-gold) center / contain no-repeat; }

/* rosette — ayah-number marker (8-point star) */
.rosette { --rs: 40px; --rc: var(--gold); --rbg: #fbf1da; --rink: var(--wine); position: relative; isolation: isolate; display: inline-grid; place-items: center; width: var(--rs); height: var(--rs); flex-shrink: 0; font-family: var(--font-head); font-weight: 700; font-size: calc(var(--rs) * .38); line-height: 1; color: var(--rink); }
.rosette::before, .rosette::after { content: ""; position: absolute; inset: 15%; border: 1.4px solid var(--rc); background: var(--rbg); border-radius: 3px; z-index: -1; }
.rosette::after { transform: rotate(45deg); }
.rosette.r-sm { --rs: 30px; }
.rosette.r-lg { --rs: 58px; }
.rosette.r-xl { --rs: 82px; }
.rosette.r-wine { --rc: var(--wine); --rbg: var(--wine); --rink: #f6e3b4; }
.rosette.r-olive { --rc: var(--olive); --rbg: var(--olive-soft); --rink: var(--olive); }
.rosette.r-ink { --rc: var(--blue-ink); --rbg: var(--blue-soft); --rink: var(--blue-ink); }
.rosette.r-amber { --rc: var(--amber); --rbg: var(--amber-soft); --rink: var(--amber); }

/* seal — grade rosette with label */
.seal { --ss: 58px; --gc: var(--gold); --gbg: var(--gold-soft); --gink: var(--gold-600); position: relative; isolation: isolate; display: inline-grid; place-items: center; width: var(--ss); height: var(--ss); flex-shrink: 0; }
.seal::before, .seal::after { content: ""; position: absolute; inset: 14%; background: var(--gbg); border: 1.5px solid var(--gc); border-radius: 4px; z-index: -1; }
.seal::after { transform: rotate(45deg); }
.seal > span { display: grid; place-items: center; width: 70%; height: 70%; border-radius: 50%; border: 1px dashed var(--gc); text-align: center; font-family: var(--font-head); font-weight: 700; font-size: calc(var(--ss) * .2); line-height: 1.05; color: var(--gink); padding: 2px; }
.seal > span svg { width: 50%; height: 50%; }
.seal-sm { --ss: 44px; } .seal-sm > span { font-size: 9.5px; }
.seal-lg { --ss: 84px; }
.seal.g-excellent { --gc: var(--olive); --gbg: var(--olive-soft); --gink: var(--olive); }
.seal.g-vgood { --gc: var(--gold); --gbg: var(--gold-soft); --gink: var(--gold-600); }
.seal.g-good { --gc: var(--amber); --gbg: var(--amber-soft); --gink: var(--amber); }
.seal.g-repeat { --gc: var(--red); --gbg: var(--red-soft); --gink: var(--red); }
.seal.g-none { --gc: var(--line); --gbg: var(--paper-2); --gink: var(--ink-3); }

/* ------------------------------------------------------------------ Framed panels */
.panel {
  position: relative; background: var(--paper); border: 1px solid var(--line-gold); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(184, 137, 45, .26), var(--shadow);
}
.panel.ornate::before, .panel.ornate::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--star-gold) center / contain no-repeat; opacity: .9; }
.panel.ornate::before { top: 10px; right: 10px; }
.panel.ornate::after { bottom: 10px; left: 10px; }
.panel.tint { background: linear-gradient(180deg, var(--paper), var(--paper-2)); }
.panel.rose { background: var(--rose); box-shadow: inset 0 0 0 4px var(--rose), inset 0 0 0 5px rgba(184, 137, 45, .3), var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > .panel-head { padding: 16px 20px 12px; margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.panel-head h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 20px; color: var(--wine); }
.panel-head h3::before { content: ""; width: 12px; height: 12px; background: var(--star-gold) center / contain no-repeat; flex-shrink: 0; }
.panel-head h3 svg { width: 19px; height: 19px; color: var(--gold); }
.panel-head small, .panel-head .sub { color: var(--ink-2); font-size: 12.5px; }
.panel-dark {
  position: relative; overflow: hidden; color: #f3e6d4; border-radius: 24px; padding: 22px;
  background: linear-gradient(160deg, #7d2642 0%, #631c31 50%, #4b1425 100%);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .0), inset 0 0 0 7px rgba(214, 180, 108, .4), var(--shadow-lg);
}
.panel-dark::before { content: ""; position: absolute; inset: 0; background: var(--pattern-light) center / 64px 64px; opacity: .12; pointer-events: none; }
.panel-dark > * { position: relative; }
.panel-dark h2, .panel-dark h3 { color: #f2d99c; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 30px; color: var(--wine); line-height: 1.25; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Stats (KPI) */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 20px; }
.stat { --tc: var(--wine); --tbg: var(--wine-soft); position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--paper); border: 1px solid var(--line-gold); border-radius: 18px; color: var(--ink); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(184, 137, 45, .2), var(--shadow-sm); }
a.stat:hover { box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--gold-2), var(--shadow); }
.stat-ic { position: relative; isolation: isolate; width: 52px; height: 52px; display: grid; place-items: center; color: var(--tc); flex-shrink: 0; }
.stat-ic::before, .stat-ic::after { content: ""; position: absolute; inset: 14%; border-radius: 4px; background: var(--tbg); border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent); z-index: -1; }
.stat-ic::after { transform: rotate(45deg); }
.stat-ic svg { width: 21px; height: 21px; }
.stat-b { min-width: 0; }
.stat-b small { display: block; font-size: 12.5px; color: var(--ink-2); }
.stat-b b { display: block; font-family: var(--font-head); font-size: 28px; line-height: 1.15; color: var(--ink); }
.stat-foot { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.s-wine { --tc: var(--wine); --tbg: var(--wine-soft); }
.s-gold { --tc: var(--gold-600); --tbg: var(--gold-soft); }
.s-olive { --tc: var(--olive); --tbg: var(--olive-soft); }
.s-ink { --tc: var(--blue-ink); --tbg: var(--blue-soft); }
.s-amber { --tc: var(--amber); --tbg: var(--amber-soft); }
.s-red { --tc: var(--red); --tbg: var(--red-soft); }

/* ------------------------------------------------------------------ Buttons */
.btn { border-radius: 12px; font-family: var(--font); font-weight: 500; padding: 10px 18px; font-size: 14px; }
.btn-primary { background: linear-gradient(180deg, #7d2642, var(--wine)); color: #fff6e6; border-color: var(--wine-600); box-shadow: inset 0 0 0 1px rgba(214, 180, 108, .45), 0 6px 14px -8px rgba(110, 31, 53, .8); }
.btn-primary:hover { background: linear-gradient(180deg, #6e1f35, var(--wine-600)); color: #fff; }
.btn-gold { background: linear-gradient(180deg, #d0a650, var(--gold)); color: var(--wine-700); border-color: var(--gold-600); box-shadow: inset 0 0 0 1px rgba(255, 246, 220, .5); }
.btn-gold:hover { background: var(--gold-600); color: #fff; }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--line-gold); }
.btn-outline:hover { border-color: var(--gold); color: var(--wine); background: var(--gold-soft); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--gold-soft); color: var(--wine); }
.btn-olive { background: var(--olive); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8a2020; }
.btn-soft { background: var(--wine-soft); color: var(--wine); }
.btn-soft:hover { background: var(--rose-2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-locked { opacity: .5; cursor: not-allowed; }
.btn-pill { border-radius: 999px; }

/* ------------------------------------------------------------------ Badges & chips */
.badge { font-weight: 500; font-size: 11.5px; padding: 2px 10px; border: 1px solid transparent; }
.badge svg { width: 13px; height: 13px; }
.b-wine { background: var(--wine-soft); color: var(--wine); border-color: rgba(110, 31, 53, .15); }
.b-gold { background: var(--gold-soft); color: var(--gold-600); border-color: rgba(184, 137, 45, .25); }
.b-olive { background: var(--olive-soft); color: var(--olive); border-color: rgba(91, 122, 58, .2); }
.b-ink { background: var(--blue-soft); color: var(--blue-ink); border-color: rgba(60, 90, 120, .18); }
.b-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(183, 121, 31, .2); }
.b-rose { background: var(--rose); color: #8a4a4a; }
.b-muted { background: var(--parchment-2); color: var(--ink-3); }
.b-solid { background: var(--wine); color: #f6e3b4; }
.badge.grade.g-excellent { background: var(--olive-soft); color: var(--olive); }
.badge.grade.g-vgood { background: var(--gold-soft); color: var(--gold-600); }
.badge.grade.g-good { background: var(--amber-soft); color: var(--amber); }
.badge.grade.g-repeat { background: var(--red-soft); color: var(--red); }
.type-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.type-chip svg { width: 13px; height: 13px; }
.t-hifz { background: var(--wine-soft); color: var(--wine); }
.t-review { background: var(--gold-soft); color: var(--gold-600); }
.t-tathbeet { background: var(--olive-soft); color: var(--olive); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.chip svg { width: 14px; height: 14px; color: var(--gold); }

/* mistake counters (read-only) */
.mistakes { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mk { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); background: var(--paper); }
.mk small { color: var(--ink-2); }
.mk b { min-width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-size: 14px; color: #fff; }
.mk-hifz b { background: var(--wine); } .mk-tajweed b { background: var(--gold); } .mk-tanbih b { background: var(--blue-ink); }
.mk.zero { opacity: .55; } .mk.zero b { background: var(--ink-3); }
.mistakes.compact .mk { padding: 2px 3px 2px 8px; } .mistakes.compact .mk b { min-width: 19px; height: 19px; font-size: 12.5px; }

/* ------------------------------------------------------------------ Avatars & people */
.avatar { --av: var(--wine); width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; background: var(--av); color: #fff4dc; font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: .5px; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--gold-2); }
.avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--gold); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-t { min-width: 0; line-height: 1.35; }
.person-t b { display: block; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-t small { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ Progress */
.pbar { position: relative; height: 8px; border-radius: 999px; background: var(--rose); overflow: hidden; box-shadow: inset 0 1px 2px rgba(74, 44, 20, .12); }
.pbar span { position: absolute; inset-block: 0; right: 0; border-radius: inherit; background: linear-gradient(270deg, var(--gold-2), var(--wine)); transition: width .5s ease; }
.pbar.thin { height: 5px; }
.pbar.pb-olive span { background: linear-gradient(270deg, #9bb27a, var(--olive)); }
.pbar.pb-gold span { background: linear-gradient(270deg, var(--gold-3), var(--gold)); }
.pbar.pb-ink span { background: linear-gradient(270deg, #9fb3c7, var(--blue-ink)); }
.pbar-l { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 4px; }

/* ------------------------------------------------------------------ 30-juz grid */
.juz-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.juz {
  --p: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1 / 1.16; min-width: 0;
  border: 1px solid var(--line-gold); border-radius: 10px; overflow: hidden; color: var(--ink-2);
  background: linear-gradient(to top, #ecd6a6 calc(var(--p) * 1%), var(--paper) calc(var(--p) * 1%));
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px rgba(184, 137, 45, .22);
}
.juz b { font-family: var(--font-head); font-size: 21px; line-height: 1; color: var(--ink); }
.juz small { font-size: 10px; margin-top: 3px; color: var(--ink-2); }
.juz.part b { color: var(--gold-600); }
.juz.done { background: linear-gradient(160deg, #7d2642, #5a1829); border-color: var(--wine-600); box-shadow: inset 0 0 0 2px #6e1f35, inset 0 0 0 3px rgba(214, 180, 108, .55); }
.juz.done b { color: #f2d99c; } .juz.done small { color: rgba(243, 230, 212, .8); }
.juz.done::after { content: ""; position: absolute; top: 4px; left: 4px; width: 8px; height: 8px; background: var(--star-gold) center / contain no-repeat; }
.juz-grid.compact { gap: 5px; }
.juz-grid.compact .juz { aspect-ratio: 1 / 1; border-radius: 7px; }
.juz-grid.compact .juz b { font-size: 14px; }
@media (max-width: 720px) { .juz-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; } .juz b { font-size: 18px; } }
@media (max-width: 380px) { .juz-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.juz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 12px; }
.juz-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-inline-end: 5px; border: 1px solid var(--line-gold); background: var(--paper); }
.juz-legend .l-done { background: var(--wine); } .juz-legend .l-part { background: linear-gradient(to top, #ecd6a6 50%, var(--paper) 50%); }

/* ------------------------------------------------------------------ 114-surah map */
.surah-map { display: flex; flex-wrap: wrap; gap: 4px; }
.sm {
  --p: 0; --w: 1; position: relative; flex: var(--w) 1 calc(var(--w) * 12px + 30px); min-width: 0; height: 44px; padding: 3px 6px;
  display: flex; flex-direction: column; justify-content: center; border-radius: 7px; border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(to left, #ecd6a6 calc(var(--p) * 1%), var(--paper) calc(var(--p) * 1%)); cursor: default;
}
.sm i { font-style: normal; font-family: var(--font-head); font-weight: 700; font-size: 12px; line-height: 1; color: var(--gold-600); }
.sm em { font-style: normal; font-size: 10.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sm.done { background: var(--wine); border-color: var(--wine-600); }
.sm.done i { color: var(--gold-2); } .sm.done em { color: #f3e6d4; }
.sm:hover { outline: 2px solid var(--gold-2); outline-offset: 1px; z-index: 1; }
.surah-map.mini .sm { height: 22px; flex-basis: calc(var(--w) * 6px + 12px); padding: 0; }
.surah-map.mini .sm i, .surah-map.mini .sm em { display: none; }

/* ------------------------------------------------------------------ Recitation cards */
.recite-card { --gc: var(--line); position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line-gold); border-radius: 18px; border-inline-start: 4px solid var(--gc); box-shadow: var(--shadow-sm); }
.recite-card.g-excellent { --gc: var(--olive); } .recite-card.g-vgood { --gc: var(--gold); } .recite-card.g-good { --gc: var(--amber); } .recite-card.g-repeat { --gc: var(--red); } .recite-card.pending { --gc: var(--rose-2); background: var(--paper-2); }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-top small { color: var(--ink-3); font-size: 11.5px; }
.rc-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rc-sura { min-width: 0; }
.rc-sura > b { display: block; font-family: var(--font-head); font-size: 23px; line-height: 1.3; color: var(--wine); }
.rc-sura > small { display: block; font-size: 12px; color: var(--ink-2); }
.rc-ayat { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0; }
.rc-ayat i { font-style: normal; color: var(--gold); }
.rc-ayat small { font-size: 11px; color: var(--ink-2); }
.rc-note { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 12.5px; color: var(--ink-2); background: var(--paper-2); border-radius: 10px; padding: 7px 10px; }
.rc-note svg { width: 14px; height: 14px; color: var(--gold); flex-shrink: 0; margin-top: 3px; }
.recite-card.compact { padding: 10px 12px; gap: 6px; }
.recite-card.compact .rc-sura > b { font-size: 18px; }
.recite-card.compact .seal { --ss: 46px; }

/* plan chip (today's assignment) */
.plan-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 12px; background: var(--paper-2); border: 1px dashed var(--line-gold); font-size: 13px; max-width: 100%; }
.plan-chip b { font-family: var(--font-head); font-size: 16px; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.plan-chip small { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.plan-chip em { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.plan-chip em.g-excellent { background: var(--olive-soft); color: var(--olive); } .plan-chip em.g-vgood { background: var(--gold-soft); color: var(--gold-600); }
.plan-chip em.g-good { background: var(--amber-soft); color: var(--amber); } .plan-chip em.g-repeat { background: var(--red-soft); color: var(--red); }
.plan-chip.done { border-style: solid; background: var(--paper); }
.plan-chip.done b { color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(184, 137, 45, .7); }

/* ------------------------------------------------------------------ Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-inline-start: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; transition: .15s; box-shadow: inset 0 1px 2px rgba(74, 44, 20, .05);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 137, 45, .18); }
.select { appearance: none; -webkit-appearance: none; padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b8892d' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }
.textarea { resize: vertical; min-height: 70px; }
.search-box { position: relative; }
.search-box svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-right: 38px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .search-box { flex: 1 1 220px; }
.toolbar .select { width: auto; min-width: 150px; }
.hint { font-size: 12.5px; color: var(--ink-2); background: var(--gold-soft); border: 1px dashed var(--line-gold); border-radius: 12px; padding: 9px 12px; }

/* segmented */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 999px; background: var(--rose); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--wine); }
.seg button.active { background: var(--wine); color: #fff6e6; box-shadow: 0 4px 10px -6px rgba(110, 31, 53, .8); }
.seg.seg-lg { display: flex; }
.seg.seg-lg button { flex: 1; justify-content: center; padding: 10px 14px; font-size: 14.5px; }

/* stepper & counter */
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.stepper button { width: 42px; border: 0; background: var(--paper-2); color: var(--wine); font-size: 20px; cursor: pointer; font-family: var(--font); }
.stepper button:hover { background: var(--gold-soft); }
.stepper input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; text-align: center; font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--ink); padding: 6px 2px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--gold-soft); }
.counter { --cc: var(--wine); --cbg: var(--wine-soft); display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); transition: .15s; }
.counter.c-tajweed { --cc: var(--gold-600); --cbg: var(--gold-soft); }
.counter.c-tanbih { --cc: var(--blue-ink); --cbg: var(--blue-soft); }
.counter.has { border-color: var(--cc); background: var(--cbg); }
.counter-l b { display: block; font-size: 13.5px; font-weight: 600; color: var(--cc); }
.counter-l small { display: block; font-size: 11px; color: var(--ink-3); }
.counter-c { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.counter-c button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-gold); background: var(--paper); color: var(--cc); font-size: 22px; line-height: 1; cursor: pointer; font-family: var(--font); transition: .12s; }
.counter-c button[data-d="1"] { background: var(--cc); color: #fff; border-color: var(--cc); }
.counter-c button:active { transform: scale(.92); }
.counter-c output { font-family: var(--font-head); font-weight: 700; font-size: 30px; color: var(--ink); min-width: 40px; text-align: center; }

/* ------------------------------------------------------------------ Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: start; font-weight: 500; font-size: 12px; color: var(--gold-600); padding: 10px 12px; white-space: nowrap; background: var(--paper-2); border-bottom: 3px double var(--line-gold); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: rgba(239, 226, 214, .45); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.pager { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.pager button { min-width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font: inherit; cursor: pointer; color: var(--ink-2); }
.pager button.active { background: var(--wine); color: #fff; border-color: var(--wine); }
.pager span { align-self: center; color: var(--ink-3); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; font-size: 12.5px; color: var(--ink-2); }

/* list rows */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px dashed var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow small { display: block; color: var(--ink-2); font-size: 12px; }

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { position: relative; padding: 10px 16px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.tab.active { color: var(--wine); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; bottom: -1px; inset-inline: 10px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--gold), var(--wine)); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* empty */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; text-align: center; color: var(--ink-2); }
.empty-ic { position: relative; isolation: isolate; width: 62px; height: 62px; display: grid; place-items: center; color: var(--gold-600); margin-bottom: 4px; }
.empty-ic::before, .empty-ic::after { content: ""; position: absolute; inset: 14%; border: 1px solid var(--gold-2); background: var(--gold-soft); border-radius: 4px; z-index: -1; }
.empty-ic::after { transform: rotate(45deg); }
.empty-ic svg { width: 24px; height: 24px; }
.empty b { font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.empty small { font-size: 12.5px; }

/* ------------------------------------------------------------------ Modal */
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(43, 35, 32, .5); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal { position: relative; width: 100%; max-width: 620px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--gold); border-radius: 24px; box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--gold-3), var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .2s; }
.modal-backdrop.show .modal { transform: none; }
.modal.sm { max-width: 440px; } .modal.lg { max-width: 840px; } .modal.xl { max-width: 1040px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px dashed var(--line); }
.modal-head h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 21px; color: var(--wine); min-width: 0; }
.modal-head h3 > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-ic { position: relative; isolation: isolate; width: 38px; height: 38px; display: grid; place-items: center; color: var(--wine); flex-shrink: 0; }
.mh-ic::before, .mh-ic::after { content: ""; position: absolute; inset: 14%; background: var(--gold-soft); border: 1px solid var(--gold-2); border-radius: 3px; z-index: -1; }
.mh-ic::after { transform: rotate(45deg); }
.mh-ic svg { width: 17px; height: 17px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 20px; border-top: 1px dashed var(--line); }
.success-box { text-align: center; padding: 6px 0; }
.success-mark { display: flex; justify-content: center; margin-bottom: 8px; }
.success-box h3 { font-size: 22px; color: var(--wine); margin-bottom: 4px; }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.sm, .modal.lg, .modal.xl { max-width: none; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
}

/* recitation entry modal */
.rm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rm-head b { display: block; font-size: 15px; }
.rm-head small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
.rm-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.rm-plan > small { color: var(--gold-600); font-weight: 500; font-size: 12px; }
.rm-range { display: grid; grid-template-columns: 1.5fr 1fr 1.5fr 1fr; gap: 12px; margin-top: 14px; align-items: end; }
.rm-range .rm-to-surah.is-hidden { display: none !important; }
.rm-range:has(.rm-to-surah.is-hidden) { grid-template-columns: 2fr 1fr 1fr; }
.rm-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(180deg, #fffaf0, var(--gold-soft)); border: 1px solid var(--line-gold); }
.rm-label { font-family: var(--font-head); font-size: 21px; font-weight: 700; color: var(--wine); }
.rm-pages { font-size: 12.5px; color: var(--ink-2); }
.rm-mistakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.rm-grade { display: flex; align-items: center; gap: 16px; padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; border: 1px dashed var(--line-gold); }
.rm-grade-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rm-grade-b .rule { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; }
.rm-grade-b .rule svg { width: 13px; height: 13px; }
.grade-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.grade-pick button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.grade-pick button.g-excellent.active { background: var(--olive); border-color: var(--olive); color: #fff; }
.grade-pick button.g-vgood.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.grade-pick button.g-good.active { background: var(--amber); border-color: var(--amber); color: #fff; }
.grade-pick button.g-repeat.active { background: var(--red); border-color: var(--red); color: #fff; }
.quick-notes { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-notes button { padding: 4px 11px; border-radius: 999px; border: 1px dashed var(--line-gold); background: var(--paper-2); font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.quick-notes button:hover { color: var(--wine); border-color: var(--gold); }
@media (max-width: 720px) {
  .rm-range, .rm-range:has(.rm-to-surah.is-hidden) { grid-template-columns: 1fr 1fr; }
  .rm-range .field:first-child, .rm-range .rm-to-surah { grid-column: 1 / -1; }
  .rm-mistakes { grid-template-columns: minmax(0, 1fr); }
  .counter { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ------------------------------------------------------------------ Toast */
.toast-wrap { position: fixed; z-index: 300; top: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #f6ecd8; font-size: 13.5px; line-height: 1.6; box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(214, 180, 108, .45); animation: toastIn .25s ease; pointer-events: auto; }
.toast b { color: #f2d99c; }
.toast.hide { opacity: 0; transform: translateY(-6px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
.t-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--olive); color: #fff; }
.t-icon svg { width: 15px; height: 15px; }
.toast.warning .t-icon { background: var(--amber); } .toast.error .t-icon { background: var(--red); } .toast.info .t-icon { background: var(--blue-ink); }

.is-locked { opacity: .5; cursor: not-allowed !important; }

/* ------------------------------------------------------------------ Teacher circle (reference page) */
.circle-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 20px; }
.circle-hero .surah-head { margin-bottom: 10px; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: rgba(243, 230, 212, .88); }
.ch-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ch-meta svg { width: 15px; height: 15px; color: var(--gold-2); }
.ch-stats { display: flex; gap: 14px; }
.ch-stat { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 74px; }
.ch-stat .rosette { --rs: 66px; --rc: var(--gold-2); --rbg: rgba(0, 0, 0, .18); --rink: #f2d99c; font-size: 19px; }
.ch-stat small { font-size: 11.5px; color: rgba(243, 230, 212, .85); }
@media (max-width: 900px) { .circle-hero { grid-template-columns: minmax(0, 1fr); } .ch-stats { justify-content: space-between; } }
@media (max-width: 420px) { .ch-stats { gap: 4px; } .ch-stat { min-width: 0; flex: 1; } .ch-stat .rosette { --rs: 56px; font-size: 16px; } }

.st-list { display: flex; flex-direction: column; gap: 12px; }
.st-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) auto; gap: 14px 18px; align-items: center;
  padding: 14px 16px; background: var(--paper); border: 1px solid var(--line-gold); border-radius: 18px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(184, 137, 45, .14), var(--shadow-sm); transition: .2s;
}
.st-card.is-done { background: linear-gradient(90deg, var(--paper) 60%, var(--olive-soft)); }
.st-card.is-absent { opacity: .62; background: var(--paper-2); }
.st-card.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(184, 137, 45, .7); } 100% { box-shadow: 0 0 0 14px rgba(184, 137, 45, 0); } }
.st-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-id .grow b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-id .grow b a { color: var(--ink); }
.st-id .grow small { display: block; font-size: 12px; color: var(--ink-2); }
.st-id .pbar { margin-top: 6px; max-width: 200px; }
.st-plan { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-act { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.st-done { display: flex; align-items: center; gap: 4px; }
.att-toggle { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--rose); border: 1px solid var(--line); }
.att-toggle button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-3); display: grid; place-items: center; }
.att-toggle button:hover { background: var(--paper); color: var(--ink); }
.att-toggle button.on[data-status="حاضر"] { background: var(--olive); color: #fff; }
.att-toggle button.on[data-status="متأخر"] { background: var(--amber); color: #fff; }
.att-toggle button.on[data-status="غائب"] { background: var(--red); color: #fff; }
.att-toggle button.on[data-status="مستأذن"] { background: var(--blue-ink); color: #fff; }
.btn-recite { padding: 11px 20px; border-radius: 14px; font-size: 15px; }
@media (max-width: 1100px) { .st-card { grid-template-columns: minmax(0, 1fr) auto; } .st-plan { grid-column: 1 / -1; grid-row: 2; } .st-act { grid-row: 1; grid-column: 2; } }
@media (max-width: 560px) {
  .st-card { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .st-act { grid-row: auto; grid-column: auto; justify-content: space-between; }
  .st-plan { grid-row: auto; }
  .btn-recite { flex: 1; }
}

.lb-list { display: flex; flex-direction: column; gap: 4px; }
.lb-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; }
.lb-item:nth-child(-n+3) { background: var(--gold-soft); }
.lb-item .rosette { --rs: 32px; }
.lb-item:nth-child(1) .rosette { --rc: var(--wine); --rbg: var(--wine); --rink: #f6e3b4; }
.lb-item .grow b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-item .grow small { display: block; font-size: 11.5px; color: var(--ink-2); }
.lb-item .pts { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--wine); white-space: nowrap; }
.lb-item.me { outline: 2px solid var(--gold-2); }

.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-stat { padding: 10px 12px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.mini-stat small { display: block; font-size: 11.5px; color: var(--ink-2); }
.mini-stat b { font-family: var(--font-head); font-size: 24px; color: var(--ink); line-height: 1.2; }

/* QR */
.qr { display: grid; grid-template-columns: repeat(21, 1fr); width: 84px; height: 84px; padding: 4px; background: #fff; border: 1px solid var(--line); }
.qr i { display: block; } .qr i.on { background: var(--ink); }

/* ------------------------------------------------------------------ Certificate (print-ready) */
.certificate { padding: 10px; background: var(--paper); }
.cert-frame { position: relative; padding: 34px 34px 26px; text-align: center; border: 2px solid var(--gold); border-radius: 6px; outline: 6px double var(--wine); outline-offset: 4px; margin: 12px;
  background: radial-gradient(circle at 50% 40%, #fffdf6, var(--paper-2)), var(--paper); }
.cert-frame::before { content: ""; position: absolute; inset: 0; background: var(--pattern) center / 60px 60px; opacity: .06; pointer-events: none; }
.cert-top { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; color: var(--wine); }
.cert-top svg { width: 50px; height: 50px; }
.cert-top b { display: block; font-family: var(--font-head); font-size: 20px; }
.cert-top small { color: var(--ink-2); font-size: 12px; }
.cert-lead { position: relative; color: var(--ink-2); margin: 8px 0; font-size: 15px; }
.cert-name { position: relative; font-size: 38px; color: var(--wine); margin: 6px 0; }
.cert-meta { position: relative; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 18px 0; }
.cert-meta span { padding: 8px 18px; border: 1px solid var(--line-gold); border-radius: 12px; background: var(--paper); min-width: 120px; }
.cert-meta small { display: block; font-size: 11.5px; color: var(--ink-2); }
.cert-meta b { font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.cert-sign { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 22px; }
.cert-sign > div { min-width: 0; flex: 1; border-top: 1px dashed var(--gold); padding-top: 6px; }
.cert-sign small { display: block; font-size: 11.5px; color: var(--ink-2); }
.cert-sign b { font-family: var(--font-head); font-size: 16px; }
.cert-no { position: relative; display: block; margin-top: 12px; color: var(--ink-3); font-size: 11px; }
@media (max-width: 560px) { .cert-frame { padding: 22px 14px; margin: 8px; } .cert-name { font-size: 28px; } .cert-sign { flex-wrap: wrap; justify-content: center; } }

@media print {
  body { background: #fff !important; padding: 0 !important; }
  body::before, .topbar, .navcard, .pillnav, .nav-overlay, .app-foot, .toast-wrap, .no-print { display: none !important; }
  .tr-body { display: block; margin: 0; }
  .panel, .stat, .st-card { box-shadow: none !important; break-inside: avoid; }
  body.modal-open > *:not(.modal-backdrop) { display: none !important; }
  .modal-backdrop { position: static; background: none; padding: 0; backdrop-filter: none; opacity: 1; }
  .modal { max-width: none !important; max-height: none; border: 0; box-shadow: none; transform: none; }
  .modal-head, .modal-foot { display: none; }
  .modal-body { padding: 0; overflow: visible; }
  .certificate { padding: 0; }
  .cert-frame { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ------------------------------------------------------------------ Login */
.login-page { min-height: 100vh; }
.login-wrap { position: relative; max-width: 1200px; margin: 0 auto; padding: 18px 20px 30px; }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.brand-row { display: flex; align-items: center; gap: 12px; color: var(--wine); }
.brand-row .bm { width: 50px; height: 50px; display: block; }
.brand-row svg { width: 50px; height: 50px; }
.brand-row .brand-logo { width: 50px; height: 50px; object-fit: contain; }
.brand-row b { display: block; font-family: var(--font-head); font-size: 30px; line-height: 1.05; }
.brand-row small { display: block; font-size: 12px; color: var(--ink-2); }
.login-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 960px) { .login-grid { grid-template-columns: minmax(0, 1fr); } }
.users-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
.user-card {
  --c: var(--wine); position: relative; display: flex; flex-direction: column; text-align: start; padding: 0; overflow: hidden; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-gold); border-radius: 20px;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(184, 137, 45, .25), var(--shadow-sm); transition: transform .18s, box-shadow .18s;
}
.user-card:hover, .user-card:focus-visible { transform: translateY(-3px); box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--gold), var(--shadow); outline: none; }
.uc-band { position: relative; height: 62px; background: var(--c); border-radius: 16px 16px 0 0; margin: 5px 5px 0; overflow: hidden; }
.uc-band::before { content: ""; position: absolute; inset: 0; background: var(--pattern-light) center / 46px 46px; opacity: .3; }
.uc-band .uc-role { position: absolute; top: 10px; right: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 250, 241, .9); color: var(--ink); font-size: 11.5px; font-weight: 500; }
.uc-band .uc-role svg { width: 13px; height: 13px; color: var(--c); }
.uc-body { padding: 0 16px 14px; margin-top: -30px; position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.uc-body .avatar { width: 58px; height: 58px; font-size: 20px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--gold); margin-bottom: 6px; }
.uc-body b { font-family: var(--font-head); font-size: 20px; line-height: 1.3; }
.uc-body small { color: var(--wine); font-size: 12.5px; font-weight: 500; }
.uc-body p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.uc-go { display: flex; align-items: center; justify-content: space-between; margin: 0 5px 5px; padding: 9px 14px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--gold-600); font-weight: 500; }
.uc-go svg { width: 16px; height: 16px; }
.user-card:hover .uc-go { color: var(--wine); }
.login-form .field label { color: #f3e6d4; }
.login-form .input { background: rgba(255, 250, 241, .96); }
.login-note { font-size: 12px; color: rgba(243, 230, 212, .78); }
.login-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.by-almgrat { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; }
.by-almgrat img { height: 18px; width: auto; }

/* segmented controls never widen the page on phones */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > * { flex-shrink: 0; }
