:root {
  --bg: #f6efe1;
  --bg-2: #efe4cd;
  --card: #fffcf5;
  --ink: #1d2733;
  --muted: #6a6f76;
  --line: #e7dcc4;
  --nile: #0d5566;
  --nile-2: #13788d;
  --nile-soft: #dcecef;
  --gold: #c38a1e;
  --gold-2: #e0ad45;
  --gold-soft: #f5e6c2;
  --ok: #2e7d4f;
  --ok-soft: #dff1e5;
  --danger: #b83a2f;
  --danger-soft: #f8e0dc;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 6px 20px rgba(60, 40, 10, .07);
  --radius: 18px;
  --font: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f171c; --bg-2: #141f25; --card: #17232a; --ink: #edf1f2; --muted: #9db0b8; --line: #243640;
    --nile: #5cc4d6; --nile-2: #7fd3e2; --nile-soft: #16343c; --gold: #e6b24c; --gold-2: #f0c46a; --gold-soft: #3a2f18;
    --ok: #6fcf97; --ok-soft: #173427; --danger: #ff8a7a; --danger-soft: #3a1d19;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171c; --bg-2: #141f25; --card: #17232a; --ink: #edf1f2; --muted: #9db0b8; --line: #243640;
  --nile: #5cc4d6; --nile-2: #7fd3e2; --nile-soft: #16343c; --gold: #e6b24c; --gold-2: #f0c46a; --gold-soft: #3a2f18;
  --ok: #6fcf97; --ok-soft: #173427; --danger: #ff8a7a; --danger-soft: #3a1d19;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.6; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--nile-2); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- layout ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 16px 16px 110px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card, .card + .section-title, .section-title + .card { margin-top: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 10px; }
.section-title h2 { margin: 0; font-size: 1.1rem; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; min-height: 48px;
  font-weight: 700; cursor: pointer; background: var(--nile); color: #fff; text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2b1d02; }
.btn.ghost { background: transparent; color: var(--nile); border: 1.5px solid var(--line); }
.btn.soft { background: var(--nile-soft); color: var(--nile); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 11px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.gold):not(.ghost):not(.soft):not(.danger):not(.ok) { color: #06222a; } }
:root[data-theme="dark"] .btn:not(.gold):not(.ghost):not(.soft):not(.danger):not(.ok) { color: #06222a; }

label.field { display: block; font-weight: 700; font-size: .95rem; }
label.field > span.hint { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.input, textarea.input, select.input {
  width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); outline: none; min-height: 48px;
}
.input:focus { border-color: var(--nile-2); box-shadow: 0 0 0 3px var(--nile-soft); }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.7; }
.input[dir="ltr"] { text-align: left; }

/* ---------- login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; }
.login-hero { text-align: center; margin-bottom: 18px; }
.login-hero img { width: 92px; height: 92px; border-radius: 26px; box-shadow: var(--shadow); }
.login-hero h1 { margin-top: 14px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(120% 90% at 85% 0%, #1b8aa0 0%, #0d5566 55%, #093d4a 100%);
  padding: 18px 18px 16px;
}
.hero::after {
  content: ""; position: absolute; left: -30px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 196, 106, .55), rgba(240, 196, 106, 0) 70%);
}
.hero .greet { font-size: 1.3rem; font-weight: 800; margin: 0; }
.hero .sub { opacity: .88; font-size: .93rem; margin: 2px 0 14px; }
.energy-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.energy-badge {
  width: 74px; height: 74px; flex: none; border-radius: 22px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); font-size: 2rem;
}
.energy-num { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.energy-label { font-size: .85rem; opacity: .9; }
.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), #ffe39a); transition: width .6s ease; }
.card .bar { background: var(--bg-2); }
.hero .bar { background: rgba(255, 255, 255, .2); }
.hero-foot { position: relative; z-index: 1; margin-top: 12px; font-size: .88rem; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--nile-soft); color: var(--nile); }
.hero .pill { background: rgba(255, 255, 255, .16); color: #fff; }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.check {
  width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: .95rem; color: transparent;
}
.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.done .grow { color: var(--muted); }

/* ---------- notifications ---------- */
.notif { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif .ico { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--nile-soft); font-size: 1.25rem; }
.notif.prayer .ico { background: var(--gold-soft); }
.notif .t { font-weight: 800; }
.notif .b { color: var(--ink); opacity: .85; font-size: .93rem; white-space: pre-line; }
.notif .when { font-size: .78rem; color: var(--muted); }
.notif.highlight { background: var(--gold-soft); margin: 0 -16px; padding: 12px 16px; }

.banner { display: flex; gap: 12px; align-items: flex-start; }
.banner .ico { font-size: 1.6rem; line-height: 1; }
.banner.gold { background: var(--gold-soft); border-color: transparent; }
.banner.nile { background: var(--nile-soft); border-color: transparent; }

/* ---------- ledger ---------- */
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.ledger li:last-child { border: 0; }
.ledger ul { list-style: none; padding: 0; margin: 0; }
.plus { color: var(--ok); font-weight: 800; white-space: nowrap; }
.minus { color: var(--danger); font-weight: 800; white-space: nowrap; }

/* ---------- day tabs ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day-chip {
  flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 6px 12px; text-align: center; cursor: pointer; min-width: 64px;
}
.day-chip b { display: block; font-size: 1rem; }
.day-chip small { color: var(--muted); font-size: .72rem; }
.day-chip.active { border-color: var(--nile); background: var(--nile); color: #fff; }
.day-chip.active small { color: rgba(255,255,255,.85); }
.day-chip.has::after { content: "✓"; display: block; font-size: .7rem; color: var(--ok); font-weight: 800; line-height: 1; }
.day-chip.active.has::after { color: #c9ffd9; }
.day-chip:disabled { opacity: .45; cursor: default; }

.reply { margin-top: 14px; background: var(--nile-soft); border-radius: 14px; padding: 12px 14px; }
.reply b { color: var(--nile); }

/* ---------- quiz ---------- */
.quiz-item { display: flex; align-items: center; gap: 12px; }
.quiz-item .ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); font-size: 1.4rem; flex: none; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; cursor: pointer;
  background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; min-height: 52px;
}
.option .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.option.sel { border-color: var(--nile-2); background: var(--nile-soft); }
.option.sel .dot { border-color: var(--nile-2); background: radial-gradient(circle, var(--nile-2) 45%, transparent 50%); }
.option.right { border-color: var(--ok); background: var(--ok-soft); }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.progress-dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0 12px; }
.progress-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.progress-dots i.on { background: var(--nile-2); width: 22px; border-radius: 99px; }
.result-big { font-size: 2.6rem; font-weight: 800; color: var(--nile); line-height: 1.2; }

/* ---------- gifts ---------- */
.gift { display: flex; gap: 14px; align-items: center; }
.gift .emoji { width: 58px; height: 58px; border-radius: 18px; flex: none; display: grid; place-items: center; font-size: 1.8rem; background: var(--gold-soft); }
.gift.locked .emoji { filter: grayscale(1); opacity: .55; background: var(--bg-2); }
.gift .bar { height: 7px; }

/* ---------- leaderboard ---------- */
.rank { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.rank:last-child { border: 0; }
.rank .n { width: 32px; text-align: center; font-weight: 800; color: var(--muted); }
.rank.me { background: var(--gold-soft); border-radius: 12px; padding-inline: 10px; border: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--nile-soft); color: var(--nile); flex: none; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; text-align: center; margin-bottom: 10px; }
.podium .p { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px; }
.podium .p .medal { font-size: 1.7rem; }
.podium .p.first { padding-block: 18px; background: var(--gold-soft); border-color: transparent; }
.podium .nm { font-weight: 800; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 20;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar nav { max-width: 560px; margin: 0 auto; display: flex; }
.tabbar a {
  flex: 1; text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: .74rem; font-weight: 700; padding: 6px 0; border-radius: 12px; position: relative;
}
.tabbar a .i { font-size: 1.35rem; line-height: 1.2; filter: grayscale(.9); opacity: .75; }
.tabbar a.active { color: var(--nile); }
.tabbar a.active .i { filter: none; opacity: 1; }
.tabbar a .dot { position: absolute; top: 4px; inset-inline-end: 28%; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.topbar .brand img { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 1.1rem; }

.demo-flag { background: var(--gold); color: #2b1d02; text-align: center; font-size: .8rem; font-weight: 700; padding: 4px 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translate(-50%, 20px); z-index: 50; opacity: 0; pointer-events: none;
  background: #1d2733; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow);
  transition: all .25s ease; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); }
.toast.err { background: #b83a2f; }

.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty .e { font-size: 2.4rem; display: block; margin-bottom: 6px; }

.pop { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.9); opacity: 0 } 60% { transform: scale(1.04) } 100% { transform: scale(1); opacity: 1 } }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--nile); border-radius: 50%; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100dvh; display: grid; place-items: center; }

/* ================= admin ================= */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.side { background: var(--card); border-inline-start: 0; border-inline-end: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.side .brand { display: flex; gap: 10px; align-items: center; font-weight: 800; margin: 0 6px 18px; }
.side .brand img { width: 38px; height: 38px; border-radius: 12px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.side a:hover { background: var(--bg); }
.side a.active { background: var(--nile); color: #fff; }
.main { padding: 22px 26px 60px; min-width: 0; }
.main > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .card + .card { margin-top: 0; }
.kpi .v { font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.kpi .l { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.t th { background: var(--bg-2); font-size: .82rem; color: var(--muted); position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.wrap { white-space: normal; min-width: 180px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: embed; letter-spacing: .5px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 700; }
.tabs button.active { background: var(--nile); color: #fff; border-color: var(--nile); }
.qbox { border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px; margin-top: 12px; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.opt-row input[type=radio] { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
dialog { border: 0; border-radius: 20px; padding: 0; max-width: min(640px, calc(100% - 24px)); width: 100%; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 20, 25, .5); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
dialog .db { padding: 16px 18px; max-height: 70vh; overflow: auto; }
dialog .df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.note-card .q { font-weight: 800; color: var(--nile); font-size: .85rem; margin-top: 10px; }
.note-card .a { white-space: pre-line; }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 14px 14px 100px; }
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.k2, .grid.k3 { grid-template-columns: 1fr; }
  .mobile-nav { display: block; }
  .mobile-nav nav { max-width: none; overflow-x: auto; }
  .mobile-nav a { min-width: 64px; }
}
@media (max-width: 860px) {
  .mobile-nav a { flex: none; min-width: 74px; white-space: nowrap; }
  #y-search { max-width: none !important; flex-basis: 100%; }
}

/* ================= نيلو 🦁 ================= */
.hero.has-nilo { min-height: 236px; padding-inline-end: 46%; }
.hero-main { position: relative; z-index: 1; }
.hero.has-nilo .greet { font-size: 1.2rem; }
.hero.has-nilo .hero-foot { margin-top: 8px; }
.hero-nilo {
  position: absolute; z-index: 2; inset-inline-end: 0; bottom: -2px; height: 96%; max-height: 300px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.hero-nilo img { height: 100%; width: auto; display: block; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); transform-origin: 50% 100%; }
.admin-hero { min-height: 190px; padding-inline-end: 190px !important; }
.admin-hero .hero-nilo { height: 104%; }

.nilo-speech {
  position: relative; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--card); border: 2px solid var(--gold-soft); box-shadow: var(--shadow); outline: none;
}
.nilo-speech:focus-visible { border-color: var(--gold); }
.nilo-speech::before {
  content: ""; position: absolute; top: -11px; inset-inline-end: 22%; width: 18px; height: 18px;
  background: var(--card); border-top: 2px solid var(--gold-soft); border-inline-start: 2px solid var(--gold-soft); transform: rotate(45deg);
}
[dir="rtl"] .nilo-speech::before { transform: rotate(-45deg); }
.nilo-speech .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nilo-speech .who img { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-soft); object-fit: cover; }
.nilo-speech p { margin: 8px 0; font-size: 1.02rem; font-weight: 600; }

.nilo-pop {
  position: fixed; z-index: 70; inset-inline-end: 4px; bottom: calc(74px + env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 0; pointer-events: none;
  transform: translateY(150%); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.nilo-pop.show { transform: translateY(0); pointer-events: auto; cursor: pointer; }
.nilo-pop img { width: 96px; height: auto; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .3)); }
.nilo-bubble {
  position: relative; max-width: min(250px, calc(100vw - 120px)); margin-bottom: 70px; margin-inline-end: -8px;
  background: var(--card); color: var(--ink); border: 2px solid var(--gold); border-radius: 18px; padding: 10px 14px;
  box-shadow: var(--shadow); font-size: .93rem; line-height: 1.55;
}
.nilo-bubble small { color: var(--muted); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px; animation: nilo-fall linear forwards; }
@keyframes nilo-fall { to { transform: translate(var(--x), 106vh) rotate(var(--r)); } }

.nilo-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 110px 16px 16px;
  background: rgba(8, 18, 38, .6); backdrop-filter: blur(3px); overflow: auto;
}
.nilo-modal {
  position: relative; width: 100%; max-width: 380px; text-align: center; background: var(--card); color: var(--ink);
  border-radius: 26px; padding: 0 20px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); border: 2px solid var(--gold-soft);
}
.nilo-modal h2 { font-size: 1.3rem; margin-top: 4px; }
.nilo-big { display: block; height: 220px; width: auto; margin: -120px auto 4px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); transform-origin: 50% 100%; }
.nilo-badge {
  position: absolute; top: 14px; inset-inline-start: 14px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.7rem; background: var(--gold-soft); border: 2px solid var(--gold);
}
.tour-icon { font-size: 2rem; }
.nilo-result { display: block; height: 180px; width: auto; margin: 0 auto 6px; transform-origin: 50% 100%; }
.nilo-empty img { width: 86px; height: 86px; border-radius: 50%; background: var(--gold-soft); object-fit: cover; display: block; margin: 0 auto 8px; }

.nilo-hide {
  position: fixed; z-index: 40; width: 84px; height: 84px; border: 0; padding: 0; background: none; cursor: pointer;
  animation: nilo-peek .8s cubic-bezier(.34, 1.56, .64, 1) both, nilo-wiggle 2.4s 1s ease-in-out infinite;
}
.nilo-hide img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.nilo-hide.left { left: -30px; --rot: 28deg; }
.nilo-hide.right { right: -30px; --rot: -28deg; }
.nilo-hide.right img { transform: scaleX(-1); }
.nilo-hide.found { animation: nilo-found .7s ease forwards; }
@keyframes nilo-peek { from { opacity: 0; transform: translateX(var(--from, 0)) rotate(var(--rot)) scale(.4); } to { opacity: 1; transform: rotate(var(--rot)); } }
@keyframes nilo-wiggle { 0%, 100% { transform: rotate(var(--rot)); } 50% { transform: rotate(calc(var(--rot) * .6)) translateY(-4px); } }
@keyframes nilo-found { to { transform: scale(2.2) rotate(0); opacity: 0; } }

.float { animation: nilo-float 3s ease-in-out infinite; }
.wave { animation: nilo-wave .7s ease-in-out 3; }
.jump { animation: nilo-jump .6s cubic-bezier(.34, 1.56, .64, 1); }
.spin { animation: nilo-spin 1s ease-in-out; }
.think { animation: nilo-think 1.1s ease-in-out infinite alternate; }
@keyframes nilo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes nilo-wave { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-7deg); } 70% { transform: rotate(6deg); } }
@keyframes nilo-jump { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-26px) scale(1.04, .97); } 70% { transform: translateY(0) scale(1.03, .96); } 100% { transform: none; } }
@keyframes nilo-spin { 0% { transform: rotate(0); } 60% { transform: rotate(380deg) scale(1.05); } 100% { transform: rotate(360deg); } }
@keyframes nilo-think { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .float, .wave, .jump, .spin, .think, .nilo-hide, .pop { animation: none !important; }
  .nilo-pop { transition: none; }
}

/* الدخول */
.poster { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; border: 3px solid var(--card); }
.poster img { display: block; width: 100%; height: auto; }
.login-hero img.nilo-login { width: auto; height: 190px; border-radius: 0; box-shadow: none; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }

/* شريط التجربة */
.demobar {
  position: sticky; top: 0; z-index: 80; display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none;
  background: #1d2f6b; color: #f3d48a; padding: 7px 10px; font-size: .82rem; font-weight: 700;
}
.demobar::-webkit-scrollbar { display: none; }
.demobar .lbl { white-space: nowrap; margin-inline-end: 2px; }
.demobar button {
  flex: none; border: 1px solid rgba(243, 212, 138, .4); background: transparent; color: #fff; border-radius: 99px;
  padding: 4px 11px; font-weight: 700; cursor: pointer; white-space: nowrap; font-size: .82rem;
}
.demobar button.on { background: #e0ad45; color: #1d2f6b; border-color: #e0ad45; }

body:has(.demobar) .side { top: 38px; height: calc(100dvh - 38px); }
.nilo-overlay.ask { padding-top: 16px; z-index: 110; }

/* النوتة: خانات العلامات */
.note-h { margin: 6px 0 0; font-size: 1rem; color: var(--nile); }
.note-checks { display: grid; gap: 8px; }
.note-check {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; cursor: pointer;
  background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 56px;
  transition: background .15s, border-color .15s;
}
.note-check .box {
  width: 28px; height: 28px; flex: none; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center;
  color: transparent; font-weight: 800; background: var(--card);
}
.note-check small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.note-check.on { border-color: var(--ok); background: var(--ok-soft); }
.note-check.on .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.note-check.bump .box { animation: nilo-jump .45s ease; }
.note-check:disabled { opacity: .5; cursor: default; }
.pts { font-size: .78rem; font-weight: 800; color: var(--gold); background: var(--gold-soft); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.pts.got { color: var(--ok); background: var(--ok-soft); }

/* النوتة: الأيام اللي فاتت واللي جاية مقفولة */
.day-chip.past { opacity: .45; filter: grayscale(.7); }
.day-chip.past.active { opacity: .8; }
.day-chip.today:not(.active) { border-color: var(--gold); }
.day-chip.past b::after, .day-chip:disabled b::after { content: " 🔒"; font-size: .7rem; }
.lock-note { background: var(--bg-2); color: var(--muted); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: .9rem; }
form.locked .note-check, form.locked textarea { opacity: .6; cursor: default; }
.hero-nilo.static { position: static; height: 190px; flex: none; }
.nilo-preview .nilo-speech::before { display: none; }
.nilo-preview > .row { margin-top: 18px; }
.nilo-preview .hero-nilo.static { height: 170px; }

/* تنزيل التطبيق */
.install-card { align-items: center; }
.install-nilo { width: 58px; height: 58px; border-radius: 50%; background: var(--gold-soft); object-fit: cover; flex: none; }
.nilo-modal.sheet { text-align: start; }
.nilo-modal.sheet h2 { text-align: center; }
.install-steps { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 10px; }
.install-steps li { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.install-steps .n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--nile); color: #fff; font-weight: 800; }
.install-steps small { color: var(--muted); }
.ios-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--nile-soft); }
/* الشاشات الطويلة: متتقصش من فوق */
.nilo-overlay { display: flex; flex-direction: column; align-items: center; }
.nilo-overlay > .nilo-modal { margin: auto 0; flex: none; }
.nilo-modal.sheet .nilo-big { height: 150px; margin-top: -85px; }
.nilo-overlay:has(.sheet) { padding-top: 96px; }

/* الإشعارات المقروءة */
.notif.is-read { opacity: .6; }
.read-list { margin-top: 6px; }
/* خانة النوتة اللي جاي لها من إشعار الصلاة */
.note-check.focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); animation: note-pulse 1s ease-in-out 3; }
@keyframes note-pulse { 50% { transform: scale(1.02); } }
/* الصور الشخصية */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 34px; height: 34px; font-size: .9rem; }
.avatar.lg { width: 58px; height: 58px; font-size: 1.3rem; border: 3px solid var(--card); box-shadow: var(--shadow); }
.avatar.xl { width: 120px; height: 120px; font-size: 2.6rem; border: 4px solid var(--gold-soft); margin: 0 auto; }
.me-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.podium-av { position: relative; width: 58px; margin: 0 auto 4px; }
.podium-av .medal { position: absolute; bottom: -6px; inset-inline-end: -8px; font-size: 1.3rem; }
.podium .p .medal { font-size: 1.3rem; }
.nilo-modal.profile { text-align: center; }
/* طلب الصورة */
.photo-drop { display: block; cursor: pointer; margin: 6px auto 0; width: 120px; }
.photo-drop .avatar.xl { border-style: dashed; background: var(--gold-soft); }
.me-btn { position: relative; }
.add-badge { position: absolute; bottom: -3px; inset-inline-end: -3px; width: 17px; height: 17px; border-radius: 50%; background: var(--gold); color: #fff; font-size: .8rem; font-weight: 800; display: grid; place-items: center; line-height: 1; border: 2px solid var(--card); }
/* الترتيب على شاشة كبيرة */
.rank-big .rank { padding: 14px 8px; font-size: 1.25rem; }
.rank-big .avatar { width: 52px; height: 52px; font-size: 1.3rem; }
.rank-big .podium .avatar.lg { width: 84px; height: 84px; }
.rank-big .podium-av { width: 84px; }
.rank-big .podium .nm { font-size: 1.15rem; }
.rej-msg { margin-top: 6px; background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 8px 10px; font-size: .85rem; font-weight: 600; }
