/* Al Qalam Community — white paper, navy ink, a touch of pen gold. Mobile first. */
:root {
  --bg: #ffffff;
  --bg-2: #f6f5f2;
  --bg-3: #eeece7;
  --ink: #1b2033;
  --ink-2: #3b4157;
  --muted: #646879;
  --line: rgba(27, 32, 51, 0.1);
  --line-2: rgba(27, 32, 51, 0.18);
  --gold: #a07a2c;
  --gold-text: #82611d;
  --gold-soft: #f5edda;
  --danger: #b3392b;
  --ok: #2f6b3a;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Amiri", "Noto Naskh Arabic", serif;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- liquid glass (enhanced light refraction) ---------- */
.glass, .glass-panel {
  position: relative;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.34) 48%,
    rgba(246, 245, 242, 0.56) 100%
  );
  -webkit-backdrop-filter: blur(20px) saturate(2.1) brightness(1.04);
  backdrop-filter: blur(20px) saturate(2.1) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.98),
    inset 1px 0 1px rgba(255, 255, 255, 0.65),
    inset 0 -1.5px 2px rgba(27, 32, 51, 0.08),
    inset 0 0 0 0.5px rgba(27, 32, 51, 0.06),
    0 14px 36px rgba(27, 32, 51, 0.12),
    0 2px 6px rgba(27, 32, 51, 0.06);
}
.refract .glass, .refract .glass-panel {
  -webkit-backdrop-filter: url(#lg) blur(6px) saturate(2.2) brightness(1.06);
  backdrop-filter: url(#lg) blur(6px) saturate(2.2) brightness(1.06);
}
.glass-panel { border-radius: 26px; padding: 22px; }

/* ---------- mandatory cookie gate ---------- */
.cookie-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 22px;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}
.cookie-box { max-width: 460px; display: grid; gap: 14px; }
.cookie-box h2 { font-size: 1.7rem; line-height: 1.15; }
.cookie-box p { color: var(--ink-2); }
.form-step { display: grid; gap: 14px; }
.code-ok {
  font-size: 0.84rem; color: var(--ok); background: rgba(47, 107, 58, 0.09);
  border: 1px solid rgba(47, 107, 58, 0.24); border-radius: 12px; padding: 8px 12px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 500; text-decoration: none; cursor: pointer; border: 0; background: none;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn.ink { background: var(--ink); color: #fff; box-shadow: 0 6px 18px rgba(27, 32, 51, 0.22), inset 0 1px 0 rgba(255,255,255,.14); }
.btn.ink:hover { background: #272d45; }
.btn.glass { color: var(--ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.btn.wide { width: 100%; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 0.92rem; }
.btn.danger { color: var(--danger); border-color: rgba(179, 57, 43, 0.35); }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; cursor: pointer; padding: 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; display: inline-grid; place-items: center; cursor: pointer; flex: none; color: var(--ink-2);
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; margin-top: 18px; }
.form label { display: grid; gap: 6px; font-size: 0.9rem; color: var(--ink-2); font-weight: 500; }
.form label small { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line-2);
  font-size: 16px; /* no iOS zoom */
}
textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(27, 32, 51, 0.08); }
.form-msg { min-height: 1.2em; font-size: 0.9rem; color: var(--danger); }
.form-msg:empty { min-height: 0; }
.form-msg.ok { color: var(--ok); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-3); }
.seg button { flex: 1; min-height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; padding: 0 10px; }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(27,32,51,.12), inset 0 1px 0 #fff; }

/* =========================================================
   INTRO (public)
   ========================================================= */
.lnav {
  position: fixed; z-index: 20; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 6px 6px 18px; border-radius: 999px;
}
.lnav-brand { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; }
.lnav-brand span { color: var(--muted); font-weight: 400; }

.intro { position: relative; height: 340svh; }
.intro-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#introCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro-start {
  position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 44px)); text-align: center; pointer-events: none;
  display: grid; gap: 12px; justify-items: center;
}
.intro-start-title {
  font-family: var(--serif); font-size: clamp(2rem, 7.5vw, 3.6rem); line-height: 1.08;
  letter-spacing: -0.015em; color: var(--ink);
}
.scroll-cue {
  position: absolute; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); letter-spacing: .02em;
  transition: opacity .3s ease;
}
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(var(--ink), transparent); transform-origin: top; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.intro-copy {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 22px calc(34px + var(--safe-b));
  opacity: 0; transform: translateY(24px); pointer-events: none;
}
.intro-copy.on { pointer-events: auto; }
.lead { font-family: var(--serif); font-size: clamp(1.3rem, 5.4vw, 1.75rem); line-height: 1.3; max-width: 28ch; color: var(--ink); }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* feature tour */
.tour { position: relative; height: 560svh; }
.tour-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; isolation: isolate; }
.tour-demo {
  position: absolute; left: 16px; right: 16px; top: calc(72px + var(--safe-t)); height: 46svh; max-width: 460px; margin: 0 auto;
  overflow: hidden; padding: 18px;
}
.tour-stage::before { /* soft ink wash behind the glass so the refraction has something to bend */
  content: ""; position: absolute; left: 50%; top: calc(72px + 23svh); width: min(560px, 120vw); height: 52svh;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(160, 122, 44, .16), transparent 70%) 20% 30% / 60% 60% no-repeat,
    radial-gradient(closest-side, rgba(27, 32, 51, .14), transparent 70%) 80% 70% / 70% 70% no-repeat;
  filter: blur(6px); z-index: -1;
}
.tour-stage::after {
  content: "القلم"; position: absolute; left: 50%; top: calc(72px + 23svh); transform: translate(-50%, -50%);
  font-family: var(--arabic); font-size: min(46vw, 260px); line-height: 1; color: rgba(27, 32, 51, 0.07); z-index: -1; pointer-events: none;
}
.demo-label { position: absolute; top: 14px; right: 16px; font-size: 0.7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.demo-pane { position: absolute; inset: 18px; opacity: 0; transition: opacity .35s ease, transform .45s var(--ease); transform: translateY(10px); }
.demo-pane.on { opacity: 1; transform: none; }
.demo-head { font-family: var(--serif); font-size: 1.25rem; display: grid; margin-bottom: 14px; padding-right: 70px; }
.demo-head small { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }
.demo-chat { display: grid; gap: 8px; align-content: start; }
[data-at] { transition: opacity .35s ease, transform .4s var(--ease); }
[data-at]:not(.in) { opacity: 0; transform: translateY(8px); }
.bub { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 0.86rem; line-height: 1.4; }
.bub b { display: block; font-size: 0.74rem; color: var(--gold-text); font-weight: 600; margin-bottom: 1px; }
.bub.them { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; justify-self: start; }
.bub.me { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; justify-self: end; }
.bub.me s { opacity: .6; }
.bub-meta { justify-self: end; font-size: 0.72rem; color: var(--muted); margin-top: -4px; }
.demo-salah { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.demo-salah span { display: grid; justify-items: center; gap: 4px; padding: 14px 2px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 0.72rem; color: var(--muted); }
.demo-salah b { font-family: var(--arabic); font-weight: 400; font-size: 1.15rem; color: var(--ink-2); line-height: 1.1; }
.demo-salah span::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); margin-top: 2px; }
.demo-salah span[data-at] { opacity: 1; transform: none; } /* salah chips always visible, only the tick changes */
.demo-salah span.in { background: var(--gold-soft); border-color: rgba(160,122,44,.45); color: var(--ink); }
.demo-salah span.in::after { background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--gold); }
.demo-note { font-size: 0.8rem; color: var(--muted); margin-top: 14px; }
.demo-goals { list-style: none; margin: 0; padding: 0; }
.demo-goals li { display: flex; align-items: center; gap: 10px; min-height: 46px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.demo-goals li:first-child { border-top: 0; }
.demo-goals i { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); flex: none; }
.demo-goals li.in i { background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/13px no-repeat; border-color: var(--gold); }
.demo-goals li[data-at] { opacity: 1; transform: none; }
.demo-goals em { margin-left: auto; font-style: normal; font-size: 0.7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.demo-rem, .demo-ram { margin-top: 14px; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 0.86rem; }
.demo-rem b, .demo-ram b { font-weight: 600; color: var(--gold-text); }
.demo-ar { font-family: var(--arabic); font-size: 1.5rem; line-height: 1.8; text-align: right; }
.demo-de { font-family: var(--serif); font-size: 1.08rem; line-height: 1.45; margin-top: 4px; }

.tour-text { list-style: none; margin: 0; padding: 0; position: absolute; left: 22px; right: 22px; bottom: calc(36px + var(--safe-b)); top: calc(72px + 46svh + 22px); }
.chap { position: absolute; inset: 0; opacity: 0; transform: translateY(16px); transition: opacity .4s ease, transform .5s var(--ease); pointer-events: none; display: grid; align-content: start; gap: 10px; max-width: 520px; }
.chap.on { opacity: 1; transform: none; pointer-events: auto; }
.num { font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; }
.chap h2 { font-size: clamp(1.45rem, 6vw, 2.6rem); line-height: 1.15; }
.chap p { color: var(--ink-2); max-width: 46ch; }
.tour-progress { position: absolute; left: 22px; right: 22px; bottom: calc(18px + var(--safe-b)); height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tour-progress i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* access + auth */
.access { padding: 80px 22px 56px; display: grid; gap: 36px; max-width: 1180px; margin: 0 auto; }
.access h2 { font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.05; margin-top: 10px; }
.facts { margin: 26px 0 0; }
.facts div { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--ink-2); }
.auth-wrap { position: relative; }
.auth-mark { position: absolute; z-index: 0; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--arabic); font-size: min(46vw, 230px); line-height: 1; color: var(--ink); opacity: .07; pointer-events: none; white-space: nowrap; }
.auth { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; }
.foot { padding: 28px 22px calc(28px + var(--safe-b)); color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); text-align: center; }

@media (min-width: 900px) {
  .lnav { left: 24px; right: 24px; top: 16px; }
  .intro-copy { left: 50%; right: auto; transform: translate(-50%, 24px); width: min(760px, 90vw); text-align: center; padding-bottom: 44px; }
  .intro-copy .lead { margin: 0 auto; max-width: 34ch; }
  .intro-actions { justify-content: center; }
  .tour-demo { left: auto; right: max(48px, calc(50vw - 560px)); top: 50%; transform: translateY(-50%); width: 440px; height: 440px; margin: 0; max-width: none; }
  .tour-stage::before, .tour-stage::after { left: calc(100vw - max(48px, calc(50vw - 560px)) - 220px); top: 50%; }
  .tour-text { left: max(48px, calc(50vw - 560px)); right: auto; width: min(520px, 42vw); top: 50%; bottom: auto; height: 340px; transform: translateY(-50%); }
  .chap h2 { font-size: clamp(2rem, 3.2vw, 2.9rem); }
  .chap p { font-size: 1.08rem; }
  .tour-progress { left: max(48px, calc(50vw - 560px)); right: auto; width: min(520px, 42vw); bottom: 48px; }
  .access { grid-template-columns: 1fr 1fr; align-items: center; padding: 120px 48px 96px; gap: 64px; }
}

/* ---------- pending ---------- */
.pending { min-height: 100svh; display: grid; place-items: center; padding: 22px; background: radial-gradient(90% 60% at 50% 30%, var(--gold-soft), var(--bg)); }
.pending-box { max-width: 440px; }
.pending-box h2 { font-size: 1.8rem; margin-bottom: 10px; }
.pending-box p { color: var(--ink-2); }
.brand-ar { font-family: var(--arabic); font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }

/* =========================================================
   APP (after login)
   ========================================================= */
.app { min-height: 100svh; padding-bottom: calc(100px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 18px 10px; border-radius: 0; border-width: 0 0 1px; border-color: var(--line);
  box-shadow: none;
}
.brand { font-family: var(--serif); font-size: 1.15rem; display: flex; gap: 8px; align-items: baseline; font-weight: 500; }
.brand [lang="ar"] { font-family: var(--arabic); font-size: 1.35rem; }
.dates { text-align: right; font-size: 0.76rem; color: var(--muted); display: grid; line-height: 1.35; }
.view { max-width: 720px; margin: 0 auto; padding: 8px 18px 24px; outline: none; }

.tabbar {
  position: fixed; z-index: 10; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b));
  max-width: 560px; margin: 0 auto; border-radius: 28px;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px;
}
.tabbar a {
  display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; padding: 4px 0;
  text-decoration: none; color: var(--muted); font-size: 0.66rem; border-radius: 22px; font-weight: 500; min-width: 0;
}
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--ink); background: rgba(255, 255, 255, 0.85); box-shadow: 0 1px 4px rgba(27,32,51,.12), inset 0 1px 0 #fff; }

.sec { padding: 22px 0; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: 1.5rem; }
.sec-head .aside { color: var(--muted); font-size: 0.85rem; }
a.aside { min-height: 44px; display: inline-flex; align-items: center; padding-left: 12px; }
.hello { font-size: 2.1rem; line-height: 1.1; padding-top: 10px; }
.hello em { font-style: normal; color: var(--gold-text); }

/* salah */
.salah { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.prayer {
  min-height: 94px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2);
  display: grid; align-content: center; justify-items: center; gap: 4px; cursor: pointer; padding: 8px 2px;
  transition: background-color .25s ease, border-color .25s ease, transform .15s ease;
}
.prayer:active { transform: scale(0.96); }
.prayer .ar { font-family: var(--arabic); font-size: 1.25rem; line-height: 1.1; color: var(--ink-2); }
.prayer .de { font-size: 0.76rem; color: var(--muted); }
.prayer .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.prayer .dot svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 2.6; fill: none; opacity: 0; }
.prayer[aria-pressed="true"] { background: var(--gold-soft); border-color: rgba(160, 122, 44, 0.5); }
.prayer[aria-pressed="true"] .dot { background: var(--gold); border-color: var(--gold); }
.prayer[aria-pressed="true"] .dot svg { opacity: 1; }
.prayer[aria-pressed="true"] .ar { color: var(--ink); }
.week-strip { display: flex; gap: 6px; margin-top: 14px; align-items: flex-end; }
.week-strip .d { flex: 1; display: grid; gap: 4px; justify-items: center; font-size: 0.7rem; color: var(--muted); }
.week-strip .bar { width: 100%; height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.week-strip .bar i { display: block; height: 100%; background: var(--gold); }
.note { font-size: 0.8rem; color: var(--muted); margin-top: 10px; }

/* checklist */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.check {
  flex: none; width: 28px; height: 28px; border-radius: 9px; border: 1.5px solid var(--line-2); background: #fff;
  display: grid; place-items: center; cursor: pointer; position: relative;
}
.check::after { content: ""; position: absolute; inset: -9px; }
.check svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 2.6; fill: none; opacity: 0; }
.check[aria-checked="true"] { background: var(--gold); border-color: var(--gold); }
.check[aria-checked="true"] svg { opacity: 1; }
.checks .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.checks .done .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(160,122,44,.6); }
.tag { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.cat-head { font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-text); margin: 18px 0 2px; font-weight: 600; }

/* hadith */
.hadith { padding: 20px 0; border-top: 1px solid var(--line); }
.hadith:first-child { border-top: 0; }
.hadith .ar, .hadith-today .ar { font-family: var(--arabic); font-size: 1.55rem; line-height: 1.9; direction: rtl; text-align: right; }
.hadith .de, .hadith-today .de { font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; margin-top: 8px; }
.hadith .src, .hadith-today .src { font-size: 0.82rem; color: var(--muted); margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hadith-today { border-radius: var(--r); padding: 20px; }
.callout { border: 1px solid rgba(160,122,44,.38); background: rgba(245, 237, 218, 0.72); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); border-radius: var(--r); padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.callout.warn-red { border-color: rgba(179, 57, 43, 0.38); background: rgba(179, 57, 43, 0.08); color: var(--ink); }
.callout.warn-red b { color: var(--danger); }

/* badges, pins, prizes, tutorial */
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid rgba(160, 122, 44, 0.45); background: var(--gold-soft); color: var(--gold-text);
}
.badge.ink { border-color: rgba(27, 32, 51, 0.25); background: rgba(27, 32, 51, 0.08); color: var(--ink); }
.badge.sage { border-color: rgba(47, 107, 58, 0.35); background: rgba(47, 107, 58, 0.1); color: var(--ok); }
.badge button { background: none; border: 0; padding: 0 0 0 3px; cursor: pointer; color: inherit; font-weight: 700; line-height: 1; }
.msg .who { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }

.pin-bar { display: grid; gap: 8px; margin-bottom: 12px; }
.pin-item { border-radius: 18px; padding: 12px 14px; display: grid; gap: 4px; }
.pin-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--gold-text); font-weight: 600; }
.pin-body { font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.chat-notice { border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; display: grid; gap: 10px; }
.chat-notice p { font-size: 0.9rem; color: var(--ink-2); }

.prize-card { border-radius: 22px; padding: 18px; display: grid; gap: 8px; margin-top: 12px; }
.prize-card h3 { font-size: 1.25rem; }
.prize-reward { font-size: 0.86rem; font-weight: 600; color: var(--gold-text); }

.tut-video-wrap {
  border-radius: 26px; overflow: hidden; margin: 16px 0;
  border: 1px solid var(--line); background: var(--bg-2);
  display: grid; place-items: center;
}
.tut-video-wrap video { width: 100%; max-height: 520px; display: block; background: #f6f5f2; }
.tut-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tut-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.tut-steps li:first-child { border-top: 0; }
.tut-steps b { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; }
.dm-thread { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.dm-thread:first-child { border-top: 0; }
.dm-thread .preview { display: block; font-size: 0.84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* ---------- chats ---------- */
.chat-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 6px 0 10px; }
.chat-head h1 { font-size: 1.45rem; text-align: center; flex: 1; line-height: 1.2; }
.chat-head h1 small { display: block; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.chat { display: grid; gap: 6px; padding-bottom: 12px; }
.sys { justify-self: center; text-align: center; font-size: 0.78rem; color: var(--muted); background: var(--bg-2); border-radius: 999px; padding: 5px 12px; margin: 8px 0; max-width: 92%; }
.sys.warn { background: var(--gold-soft); color: var(--gold-text); }
.msg { max-width: min(84%, 520px); display: grid; gap: 2px; justify-self: start; }
.msg.mine { justify-self: end; }
.msg .bubble {
  padding: 9px 13px 7px; border-radius: 18px; border-bottom-left-radius: 6px;
  background: var(--bg-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; text-align: left;
  font: inherit; color: inherit; border: 0; cursor: default; width: 100%;
}
.msg.mine .bubble { background: var(--ink); color: #fff; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.msg .who { font-size: 0.76rem; font-weight: 600; color: var(--gold-text); padding: 0 6px; }
.msg .meta { font-size: 0.72rem; color: var(--muted); padding: 0 6px; display: flex; gap: 6px; align-items: center; justify-content: flex-start; }
.msg.mine .meta { justify-content: flex-end; }
.msg.gone .bubble { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); font-style: italic; }
.msg.plan .bubble { padding: 12px 15px 10px; font-size: 1rem; }
.msg.plan { max-width: min(92%, 560px); }
.msg-acts { display: flex; gap: 6px; padding: 4px 0; justify-content: flex-end; }
.msg:not(.mine) .msg-acts { justify-content: flex-start; }
button.bubble { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.like { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 0.8rem; }
.like svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.like[aria-pressed="true"] { color: var(--gold-text); }
.like[aria-pressed="true"] svg { fill: var(--gold); stroke: var(--gold); }
.composer {
  position: fixed; z-index: 9; left: 10px; right: 10px; bottom: calc(84px + var(--safe-b)); max-width: 700px; margin: 0 auto;
  border-radius: 26px; padding: 6px; display: flex; gap: 6px; align-items: flex-end;
}
.composer textarea { flex: 1; min-height: 46px; max-height: 40svh; border-radius: 20px; resize: none; padding: 11px 14px; background: rgba(255,255,255,.9); border-color: var(--line); }
.composer .send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.composer .send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.composer .send:disabled { opacity: .4; }
.composer-bar { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 12px; font-size: 0.88rem; color: var(--ink-2); min-height: 46px; }
.composer .cancel { min-height: 46px; }
.has-composer .view { padding-bottom: 96px; }
.editing-note { position: absolute; left: 22px; top: -22px; font-size: 0.74rem; color: var(--gold-text); font-weight: 600; }

/* admin / lists */
.member { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.member .who { min-width: 0; }
.member .who b { font-weight: 600; }
.member .who span { display: block; color: var(--muted); font-size: 0.82rem; }
.member .who span.pill { display: inline-block; }
.member .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); margin-left: 6px; color: var(--ink-2); }
.pill.warn { border-color: rgba(160,122,44,.5); color: var(--gold-text); background: var(--gold-soft); }
.pill.bad { border-color: rgba(179,57,43,.4); color: var(--danger); }
.keybox { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85rem; word-break: break-all; background: #fff; border: 1px dashed rgba(160,122,44,.6); border-radius: 12px; padding: 12px; margin: 10px 0; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 0.82rem; cursor: pointer; font-weight: 400; }
.days input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.days input:focus-visible + span { outline: 2px solid var(--gold); }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
details.more { border-top: 1px solid var(--line); padding: 6px 0; }
details.more summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 500; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; margin-left: auto; color: var(--gold-text); font-size: 1.3rem; }
details.more[open] summary::after { content: "–"; }
.sec > details.more:first-child { border-top: 0; }
.empty { color: var(--muted); padding: 10px 0; }
.list-links a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; border-top: 1px solid var(--line); text-decoration: none; }
.list-links a:first-child { border-top: 0; }
.list-links a::after { content: "›"; color: var(--muted); font-size: 1.3rem; }

.toast {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  top: calc(12px + var(--safe-t)); max-width: calc(100% - 24px);
  padding: 12px 18px; border-radius: 18px; font-size: 0.95rem;
}

@media (min-width: 720px) {
  .view { padding: 12px 24px 24px; }
  .hello { font-size: 2.6rem; }
  .prayer { min-height: 104px; }
  .tabbar a { font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Pflichtaufgaben ---------- */
a.check { text-decoration: none; }
.checks.alerts li.is-new .txt::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 8px; vertical-align: 1px; }

/* ---------- wide screens and the Windows app: navigation on the left ---------- */
@media (min-width: 1100px) {
  .in-app .app { padding: 0 0 32px 252px; }
  .in-app .tabbar { top: 70px; bottom: auto; left: 16px; right: auto; width: 220px; margin: 0; max-width: none; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 14px 10px; border-radius: 28px; transform: none; }
  .in-app .tabbar a { flex: 0 0 auto; width: 100%; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; font-size: 0.95rem; border-radius: 16px; }
  .in-app .view { max-width: 760px; }
  .in-app .composer { left: 262px; right: 10px; bottom: 16px; }
  .in-app .toast { bottom: 100px; }
}
