/* =================================================================
   Sirat Talk – App-Oberfläche
   1 Tokens & Themes · 2 Basis · 3 Typografie · 4 App-Shell
   5 Navigation · 6 Buttons · 7 Formulare · 8 Bausteine
   9 Quran, Hadith, Duas · 10 Community · 11 Overlays · 12 Utilities
   ================================================================= */

/* ---------- 1 · Tokens & Themes --------------------------------- */
:root {
  color-scheme: light;

  /* Flächen – heller Modus ist ein ruhiges Grau, kein grelles Weiss.
     Der Grauton ist minimal ins Rot des Logos gezogen, damit Papier
     und Marke zusammengehören. */
  --bg: #f1eeed;
  --surface: #ffffff;
  --surface-2: #f8f5f4;
  --surface-3: #eae5e3;

  /* Marke */
  --red: #da1f26;
  --red-ink: #a5141a;
  --red-wash: #fdecec;
  --on-red: #ffffff;

  /* Schrift */
  --ink: #171413;
  --ink-soft: #3d3735;
  --muted: #675f5c;

  /* Linien & Schatten */
  --line: #e2dbd9;
  --line-soft: #ece6e4;
  --shadow-sm: 0 1px 2px rgba(35, 22, 20, 0.06);
  --shadow: 0 6px 24px rgba(35, 22, 20, 0.08);
  --shadow-lg: 0 18px 50px rgba(35, 22, 20, 0.14);

  /* Typografie */
  --font: "Schibsted Grotesk", "SiratSymbols", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Amiri ist die Schrift, in der der Quran gesetzt wird. Sie hat auch
     lateinische Buchstaben – so kommen Überschrift und Aya aus einer Feder. */
  --font-display: "Amiri", "SiratSymbols", Georgia, "Times New Roman", serif;
  --font-ar: "Amiri Quran", "Amiri", "Scheherazade New", "Traditional Arabic", serif;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1rem;
  --t-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --t-xl: clamp(1.1875rem, 1.1rem + 0.5vw, 1.4375rem);
  --t-2xl: clamp(1.4375rem, 1.25rem + 0.9vw, 2rem);
  --t-3xl: clamp(1.75rem, 1.4rem + 1.8vw, 2.75rem);

  /* Raum & Form */
  --gap: clamp(1rem, 3vw, 1.75rem);
  --section: clamp(2rem, 5vw, 3.5rem);
  --wrap: 1120px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --rail: 264px;
  --tabbar: 64px;

  /* Bewegung */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 140ms;
  --dur: 200ms;
  --dur-slow: 320ms;

  /* Ebenen */
  --z-rail: 50;
  --z-bar: 60;
  --z-menu: 70;
  --z-backdrop: 80;
  --z-drawer: 90;
  --z-overlay: 100;
  --z-note: 110;
}

/* Der dunkle Modus steht einmal hier und wird unten nur zugewiesen –
   so koennen die beiden Faelle (Umschalter, Systemeinstellung) nicht
   auseinanderlaufen. Warmes Schwarz, kein Blaugrau: die App soll bei
   Nacht wie Lampenlicht wirken, nicht wie ein Bildschirm. */
:root {
  --d-bg: #12100f;
  --d-surface: #1a1716;
  --d-surface-2: #211d1b;
  --d-surface-3: #2a2523;
  --d-red: #ff5a56;
  --d-red-ink: #ff8480;
  --d-red-wash: #2b1715;
  --d-on-red: #1a0908;
  --d-ink: #f1ece9;
  --d-ink-soft: #cdc5c1;
  --d-muted: #9d938e;
  --d-line: #332c2a;
  --d-line-soft: #262120;
  --d-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --d-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --d-shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--d-bg);
  --surface: var(--d-surface);
  --surface-2: var(--d-surface-2);
  --surface-3: var(--d-surface-3);
  --red: var(--d-red);
  --red-ink: var(--d-red-ink);
  --red-wash: var(--d-red-wash);
  --on-red: var(--d-on-red);
  --ink: var(--d-ink);
  --ink-soft: var(--d-ink-soft);
  --muted: var(--d-muted);
  --line: var(--d-line);
  --line-soft: var(--d-line-soft);
  --shadow-sm: var(--d-shadow-sm);
  --shadow: var(--d-shadow);
  --shadow-lg: var(--d-shadow-lg);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--d-bg);
    --surface: var(--d-surface);
    --surface-2: var(--d-surface-2);
    --surface-3: var(--d-surface-3);
    --red: var(--d-red);
    --red-ink: var(--d-red-ink);
    --red-wash: var(--d-red-wash);
    --on-red: var(--d-on-red);
    --ink: var(--d-ink);
    --ink-soft: var(--d-ink-soft);
    --muted: var(--d-muted);
    --line: var(--d-line);
    --line-soft: var(--d-line-soft);
    --shadow-sm: var(--d-shadow-sm);
    --shadow: var(--d-shadow);
    --shadow-lg: var(--d-shadow-lg);
  }
}

/* Fallback fuer islamische Sonderzeichen (ﷺ, ﷻ) */
@font-face {
  font-family: "SiratSymbols";
  src: local("Amiri"), local("Traditional Arabic"), local("Segoe UI Symbol"), local("Noto Naskh Arabic");
  unicode-range: U+FDFA-FDFD, U+0610-061A, U+06D6-06ED;
}

/* ---------- 2 · Basis ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, svg, video { max-width: 100%; height: auto; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--red); color: var(--on-red); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-note);
  background: var(--red); color: var(--on-red); padding: 0.85rem 1.25rem; font-weight: 600;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3 · Typografie -------------------------------------- */
h1, h2, h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
  text-wrap: balance;
  color: var(--ink);
}
h4 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--t-3xl); line-height: 1.12; }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.lead { font-size: var(--t-lg); line-height: 1.55; color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }

.prose { max-width: 68ch; color: var(--ink-soft); }
.prose h2 { margin-top: 1.8em; color: var(--ink); }
.prose h3 { margin-top: 1.5em; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--red); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  margin: 1.5rem 0; padding: 1rem 1.25rem;
  background: var(--surface-2); border-radius: var(--radius);
  font-size: var(--t-lg); line-height: 1.5; color: var(--ink);
}

a { color: var(--red); text-decoration: none; }
main :is(p, li, dd, td, .prose) a:not(.btn):not(.link-arrow):not(.plain),
.cookie-note a, .form-note a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--red) 40%, transparent);
  transition: text-decoration-color var(--dur) ease, color var(--dur) ease;
}
@media (hover: hover) and (pointer: fine) {
  main :is(p, li, dd, td, .prose) a:not(.btn):not(.link-arrow):hover,
  .cookie-note a:hover, .form-note a:hover { color: var(--red-ink); text-decoration-color: currentColor; }
}

/* ---------- 4 · App-Shell --------------------------------------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.app-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}

.wrap {
  width: 100%; max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.wrap-narrow { max-width: 780px; }

.screen { padding-block: clamp(1.25rem, 3vw, 2rem) var(--section); }
.section { padding-block: clamp(1.5rem, 4vw, 2.75rem); }
.section--tight { padding-block: clamp(1rem, 3vw, 1.75rem); }

.sec-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.4rem 1.5rem; margin-bottom: 1.15rem;
}
.sec-head h2 { margin: 0; }
.sec-head p { color: var(--muted); font-size: var(--t-sm); margin: 0; max-width: 48ch; }

.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: 1fr; }
.cols-3 { grid-template-columns: 1fr; }
.cols-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }

@media (min-width: 680px) { .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Kopfbereich eines Screens */
.screen-head { padding-block: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.5rem); }
.screen-head h1 { margin-bottom: 0.4rem; }
.screen-head .lead { margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.85rem; font-size: var(--t-xs); color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb svg { width: 12px; height: 12px; stroke-width: 2; }

/* ---------- 5 · Navigation -------------------------------------- */
.app-bar {
  position: sticky; top: 0; z-index: var(--z-bar);
  display: flex; align-items: center; gap: 0.4rem;
  min-height: 58px;
  padding: 0.4rem clamp(1rem, 4vw, 2rem);
  padding-top: calc(0.4rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) ease;
}
.app-bar.is-stuck { border-bottom-color: var(--line); }
.bar-spacer { flex: 1; }

.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-logo text { font-family: var(--font); letter-spacing: -0.035em; }
.brand-logo .lg-bubble { fill: var(--red); }
.brand-logo .lg-word { fill: #ffffff; }
.brand-logo .lg-talk { fill: var(--red); }
.brand-logo .lg-line { stroke: #ffffff; }
.hero-logo { height: clamp(44px, 8vw, 62px); }

.app-rail {
  display: none;
  width: var(--rail); flex: 0 0 var(--rail);
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  overflow-y: auto;
  padding: 1.1rem 0.8rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: var(--z-rail);
}
.rail-brand { display: flex; align-items: center; padding: 0.3rem 0.6rem 1.1rem; }
.rail-group { margin-bottom: 1.1rem; }
.rail-label {
  margin: 0 0 0.3rem; padding: 0 0.7rem;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}
.rail-link {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.7rem; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: var(--t-sm); font-weight: 500;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.rail-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.rail-link[aria-current="page"] { background: var(--red-wash); color: var(--red); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .rail-link:hover { background: var(--surface-3); color: var(--ink); }
  .rail-link[aria-current="page"]:hover { background: var(--red-wash); color: var(--red); }
}
.rail-foot { margin-top: auto; padding-top: 0.85rem; border-top: 1px solid var(--line); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar);
  display: flex;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 0.3rem 0.2rem;
  border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 0.6875rem; font-weight: 500;
  cursor: pointer; transition: color var(--dur-fast) ease;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"], .tab.is-active { color: var(--red); }
.tab:active { transform: scale(0.94); }

@media (min-width: 900px) {
  .app-rail { display: flex; flex-direction: column; }
  .tabbar { display: none; }
  .app-main { padding-bottom: 0; }
  .bar-brand { display: none; }
}

.drawer-backdrop {
  position: fixed; inset: 0; z-index: var(--z-backdrop);
  background: rgba(8, 10, 12, 0.45);
  opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
}
.drawer-backdrop.is-open { opacity: 1; }

.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-drawer);
  max-height: 84vh; overflow-y: auto;
  padding: 0 1rem calc(1.5rem + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-drawer);
  overscroll-behavior: contain;
}
.drawer.is-open { transform: translateY(0); }
.drawer-grip { width: 40px; height: 4px; margin: 0.6rem auto 0.9rem; border-radius: 999px; background: var(--line); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.drawer-title { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.drawer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.drawer-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.8rem 0.85rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
  color: var(--ink); font-size: var(--t-sm); font-weight: 500;
}
.drawer-item svg { width: 18px; height: 18px; color: var(--red); flex: 0 0 auto; }
.drawer-item[aria-current="page"] { background: var(--red-wash); color: var(--red); }
.drawer-label { margin: 1.1rem 0 0.5rem; font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- 6 · Buttons & Steuerelemente ------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.7rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: var(--t-sm); font-weight: 600; line-height: 1.2;
  text-align: center; cursor: pointer;
  transition: background-color var(--dur) ease, border-color var(--dur) ease,
              color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; stroke-width: 2; }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-soft { background: var(--surface-3); color: var(--ink); }
.btn-quiet { background: none; color: var(--red); padding-inline: 0.4rem; min-height: 42px; }
.btn-sm { min-height: 38px; padding: 0.4rem 0.85rem; font-size: var(--t-xs); }
.btn-lg { min-height: 54px; padding: 0.9rem 1.6rem; font-size: var(--t-base); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--red-ink); border-color: var(--red-ink); }
  .btn-ghost:hover { border-color: var(--red); color: var(--red); }
  .btn-soft:hover { background: var(--line); }
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink-soft); cursor: pointer;
  transition: color var(--dur) ease, background-color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { color: var(--red); background: var(--surface-3); } }

.link-arrow { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: var(--t-sm); }
.link-arrow svg { width: 16px; height: 16px; stroke-width: 2; transition: transform var(--dur) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover svg { transform: translateX(3px); } }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--radius-sm); }
.seg button {
  min-height: 36px; padding: 0.35rem 0.8rem;
  border: 0; border-radius: 6px; background: none;
  color: var(--muted); font: inherit; font-size: var(--t-xs); font-weight: 600;
  cursor: pointer; transition: background-color var(--dur) ease, color var(--dur) ease;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--red); box-shadow: var(--shadow-sm); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 34px; padding: 0.25rem 0.75rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-soft);
  font-size: var(--t-xs); font-weight: 500; cursor: pointer;
  transition: border-color var(--dur) ease, color var(--dur) ease, background-color var(--dur) ease;
}
.chip[aria-pressed="true"] { border-color: var(--red); background: var(--red-wash); color: var(--red); }
.chip:active { transform: scale(0.97); }

.tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
  font-size: var(--t-xs); white-space: nowrap;
}
.tag--red { background: var(--red-wash); color: var(--red); }

/* ---------- 7 · Formulare --------------------------------------- */
.form { max-width: 640px; }
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 620px) {
  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .full { grid-column: 1 / -1; }
}

.field > label, .label { display: block; margin-bottom: 0.35rem; font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.optional { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
input[type="url"], input[type="date"], input[type="number"], input[type="file"], select, textarea {
  width: 100%; min-height: 46px; padding: 0.65rem 0.85rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1rem;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
select {
  appearance: none; padding-right: 2.3rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f656e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 5.5 6-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 16px;
}
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23939aa4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 5.5 6-5.5'/%3E%3C/svg%3E");
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }

.hint { margin: 0.35rem 0 0; font-size: var(--t-xs); color: var(--muted); }
.field-error { display: flex; align-items: center; gap: 0.3rem; margin: 0.35rem 0 0; font-size: var(--t-xs); font-weight: 500; color: var(--red); }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 0.7rem; align-items: start; font-size: var(--t-sm); color: var(--ink-soft); cursor: pointer; }
.check input[type="checkbox"] {
  appearance: none; width: 22px; height: 22px; margin: 1px 0 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.check input[type="checkbox"]:checked {
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
  border-color: var(--red);
}

.radio-set { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.radio-set label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 42px; padding: 0.4rem 0.9rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: var(--t-sm); cursor: pointer;
  transition: border-color var(--dur) ease, color var(--dur) ease, background-color var(--dur) ease;
}
.radio-set input { position: absolute; opacity: 0; pointer-events: none; }
.radio-set label:has(input:checked) { border-color: var(--red); background: var(--red-wash); color: var(--red); font-weight: 600; }

.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.5rem; }
.form-note { margin: 0.5rem 0 0; font-size: var(--t-xs); color: var(--muted); }

.form-status { display: none; margin-top: 0.85rem; padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-size: var(--t-sm); line-height: 1.5; }
.form-status.is-visible { display: block; }
.form-status.ok { background: var(--red-wash); color: var(--ink); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.form-status.err { background: var(--surface); border: 1px solid var(--red); color: var(--red); }
.honey { position: absolute; left: -9999px; opacity: 0; height: 0; }

.role-cards { display: grid; gap: 0.6rem; }
@media (min-width: 620px) { .role-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.role-card {
  display: block; padding: 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  transition: border-color var(--dur) ease, background-color var(--dur) ease;
}
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card strong { display: block; margin-bottom: 0.2rem; }
.role-card span { display: block; font-size: var(--t-sm); color: var(--ink-soft); }
.role-card:has(input:checked) { border-color: var(--red); background: var(--red-wash); }
.scholar-only { display: none; }
.scholar-only.is-on { display: block; }

/* ---------- 8 · Bausteine --------------------------------------- */
.card { padding: clamp(1rem, 3vw, 1.4rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card--accent { border-color: color-mix(in srgb, var(--red) 32%, transparent); background: var(--red-wash); }
.card h3 { font-size: var(--t-lg); margin-bottom: 0.35rem; }
.card p { font-size: var(--t-sm); color: var(--ink-soft); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  transition: background-color var(--dur-fast) ease;
}
.list-item:last-child { border-bottom: 0; }
.li-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--red-wash); color: var(--red); }
.li-icon svg { width: 19px; height: 19px; }
.li-body { min-width: 0; flex: 1; }
.li-body strong { display: block; font-size: var(--t-sm); font-weight: 600; }
.li-body span { display: block; font-size: var(--t-xs); color: var(--muted); }
.li-go { flex: 0 0 auto; color: var(--muted); }
.li-go svg { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) { a.list-item:hover { background: var(--surface-2); } }

.tiles { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit;
  transition: border-color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.tile:active { transform: scale(0.985); }
.tile-icon { width: 24px; height: 24px; color: var(--red); }
.tile h3 { margin: 0; font-size: var(--t-lg); }
.tile p { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.tile .link-arrow { margin-top: auto; padding-top: 0.4rem; color: var(--red); }
@media (hover: hover) and (pointer: fine) { .tile:hover { border-color: var(--red); } }

.steps { counter-reset: step; display: grid; gap: 0.6rem; }
.step {
  display: grid; grid-template-columns: 30px 1fr; gap: 0.15rem 0.8rem;
  padding: 1rem 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--red-wash); color: var(--red);
  font-size: var(--t-xs); font-weight: 700;
}
.step h3 { margin: 0 0 0.2rem; font-size: var(--t-lg); }
.step p { grid-column: 2; margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }

.rows { display: grid; gap: 0.6rem; }
.row-item { padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.row-item h3 { margin: 0 0 0.25rem; font-size: var(--t-lg); }
.row-item p { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }

.banner {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  border-radius: var(--radius); background: var(--red-wash);
  font-size: var(--t-sm); line-height: 1.55; color: var(--ink-soft);
}
.banner svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 0.15rem; color: var(--red); }
.banner strong { color: var(--ink); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  padding: clamp(2rem, 5vw, 3rem) 1.25rem;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: center;
}
.empty svg { width: 28px; height: 28px; color: var(--red); }
.empty h3 { margin: 0; }
.empty p { max-width: 44ch; color: var(--muted); font-size: var(--t-sm); margin: 0; }

.cta-band {
  display: grid; gap: 1.1rem; align-items: center;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--red); border-radius: var(--radius-lg); color: var(--on-red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44' fill='none' stroke='%23ffffff' stroke-width='0.9' opacity='0.4'%3E%3Cpath d='M22 2 42 22 22 42 2 22Z'/%3E%3Crect x='9' y='9' width='26' height='26'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 44px 44px;
}
.cta-band h2 { color: var(--on-red); margin-bottom: 0.35rem; }
.cta-band p { color: color-mix(in srgb, var(--on-red) 88%, transparent); }
.cta-band .btn-ghost { background: var(--on-red); border-color: var(--on-red); color: var(--red); }
.cta-band .btn-outline { background: none; border-color: color-mix(in srgb, var(--on-red) 55%, transparent); color: var(--on-red); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (min-width: 820px) { .cta-band { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem; } .cta-actions { justify-content: flex-end; } }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--red-wash); border: 1px solid color-mix(in srgb, var(--red) 26%, transparent);
  color: var(--red); font-size: var(--t-sm); font-weight: 700; text-transform: uppercase; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--t-xs); }

.badge-verified {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.1rem 0.45rem; border-radius: 999px;
  background: var(--red); color: var(--on-red); font-size: 0.6875rem; font-weight: 700;
}
.badge-verified svg { width: 12px; height: 12px; stroke-width: 2.8; }

.accordion { display: grid; gap: 0.5rem; }
.acc-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.acc-trigger {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 1rem 1.15rem;
  border: 0; background: none; color: var(--ink);
  font: inherit; font-size: var(--t-lg); font-weight: 500; line-height: 1.35;
  text-align: left; cursor: pointer;
}
.acc-icon { flex: 0 0 auto; position: relative; width: 18px; height: 18px; margin-top: 0.28rem; }
.acc-icon::before, .acc-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 13px; height: 1.7px; background: var(--red); border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast) ease;
}
.acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc-trigger[aria-expanded="true"] .acc-icon::after { transform: translate(-50%, -50%); opacity: 0; }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease-out); }
.acc-panel > div { overflow: hidden; }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel p { padding: 0 1.15rem 1.15rem; margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }
.acc-panel p + p { padding-top: 0; margin-top: -0.6rem; }

.post-list { display: grid; gap: 0.6rem; }
.post {
  display: grid; gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; transition: border-color var(--dur) ease;
}
.post-meta { font-size: var(--t-xs); color: var(--muted); display: flex; gap: 0.6rem; flex-wrap: wrap; }
.post h3 { margin: 0; font-size: var(--t-lg); }
.post p { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }
@media (hover: hover) and (pointer: fine) { .post:hover { border-color: var(--red); } }

.glossary { display: grid; gap: 0.4rem; }
.gl-item { display: grid; gap: 0.2rem 1.5rem; padding: 0.9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gl-item dt { font-weight: 600; color: var(--ink); }
.gl-item dd { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }
.gl-item .arabic { font-family: var(--font-ar); font-size: 1.15em; color: var(--muted); margin-left: 0.35rem; }
@media (min-width: 760px) { .gl-item { grid-template-columns: 13rem minmax(0, 1fr); align-items: baseline; } }

.alpha-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1.15rem; }
.alpha-nav button {
  min-width: 34px; min-height: 34px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft);
  font: inherit; font-size: var(--t-xs); font-weight: 600; cursor: pointer;
}
.alpha-nav button[aria-pressed="true"] { border-color: var(--red); color: var(--red); background: var(--red-wash); }

.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); text-align: center; padding: 1rem;
}
.ph svg { width: 22px; height: 22px; color: var(--red); }
.ph span { font-size: var(--t-xs); }
.ph-16x9 { aspect-ratio: 16 / 9; }
.ph-4x5 { aspect-ratio: 4 / 5; }
.ph-1x1 { aspect-ratio: 1 / 1; }

.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
@media (min-width: 900px) { .ig-grid { grid-template-columns: repeat(6, 1fr); gap: 0.6rem; } }
.ig-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); display: block; }
.ig-item img { width: 100%; height: 100%; object-fit: cover; }
.ig-item .ph { border: 0; border-radius: 0; height: 100%; }

.member-photo { margin-bottom: 0.9rem; border-radius: var(--radius); }
.team { display: grid; gap: var(--gap); }
@media (min-width: 700px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.member .role { font-size: var(--t-sm); color: var(--red); font-weight: 600; margin-bottom: 0.5rem; }
.member p { color: var(--ink-soft); font-size: var(--t-sm); }

.prayer-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.prayer-table caption { text-align: left; font-size: var(--t-sm); color: var(--muted); padding: 0.85rem 1rem 0.5rem; }
.prayer-table th, .prayer-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: var(--t-sm); }
.prayer-table tr:last-child th, .prayer-table tr:last-child td { border-bottom: 0; }
.prayer-table th { font-weight: 600; color: var(--ink); }
.prayer-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.0625rem; }
.prayer-table tr.is-next th, .prayer-table tr.is-next td { color: var(--red); }
.next-prayer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.next-prayer .big { font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 600; letter-spacing: -0.03em; color: var(--red); font-variant-numeric: tabular-nums; }

.compass { position: relative; width: min(320px, 80vw); aspect-ratio: 1; margin-inline: auto; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.compass-dial, .compass-needle { position: absolute; inset: 0; transition: transform 260ms var(--ease-out); }
.compass svg { width: 100%; height: 100%; }
.qibla-stage { display: grid; gap: var(--gap); align-items: center; }
@media (min-width: 900px) { .qibla-stage { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); } }
.qibla-deg { font-size: clamp(2.2rem, 7vw, 3rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }

.countdown { display: flex; flex-wrap: wrap; gap: clamp(0.75rem, 3vw, 1.75rem); }
.cd-unit { min-width: 68px; padding: 0.75rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.cd-num { font-size: clamp(1.6rem, 5vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.cd-lbl { font-size: var(--t-xs); color: var(--muted); }

.finder-layout { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .finder-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.filters { display: grid; gap: 0.75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 760px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; } }
.mosque-list { display: grid; gap: 0.6rem; }
.mosque { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mosque h3 { margin: 0 0 0.2rem; font-size: var(--t-lg); }
.mosque .adr { font-size: var(--t-sm); color: var(--ink-soft); margin: 0 0 0.5rem; }
.mosque .meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.mosque .acts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: var(--t-sm); }
.mosque-count { font-size: var(--t-sm); color: var(--muted); margin: 0 0 0.6rem; }
.map-consent {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 340px; padding: 1.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center;
}
.map-consent p { max-width: 38ch; font-size: var(--t-sm); color: var(--ink-soft); }
#map { min-height: 340px; border: 1px solid var(--line); border-radius: var(--radius); z-index: 1; }
@media (min-width: 1000px) { #map, .map-consent { position: sticky; top: 5rem; min-height: 520px; } }

/* ---------- 9 · Quran, Hadith, Duas ----------------------------- */
.reader-bar {
  display: grid; gap: 0.6rem;
  padding: 0.85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 1rem;
}
@media (min-width: 860px) { .reader-bar { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: end; } }

.sura-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 1rem 1.2rem; margin-bottom: 0.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.sura-head h2 { margin: 0; font-size: var(--t-xl); }
.sura-meta { font-size: var(--t-xs); color: var(--muted); margin: 0.15rem 0 0; }
.sura-arabic { font-family: var(--font-ar); font-size: 1.5rem; line-height: 1.5; color: var(--red); direction: rtl; }

.bismillah {
  padding: 1.1rem 1rem; margin-bottom: 0.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-ar); font-size: clamp(1.3rem, 4vw, 1.7rem); line-height: 2;
  text-align: center; direction: rtl; color: var(--ink);
}

.ayah-list { display: grid; gap: 0.5rem; }
.ayah {
  display: grid; gap: 0.8rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  scroll-margin-top: 7rem;
}
.ayah-top { display: flex; align-items: center; gap: 0.3rem; }
.ayah-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.6rem; height: 1.6rem; padding: 0 0.5rem; margin-right: auto;
  border-radius: 999px; background: var(--surface-3);
  font-size: var(--t-xs); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.ayah-ar {
  margin: 0;
  font-family: var(--font-ar);
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  line-height: 2.2;
  direction: rtl; text-align: right; color: var(--ink);
}
.ayah-de { margin: 0; color: var(--ink-soft); line-height: 1.7; }
.ayah.is-marked { border-color: var(--red); }
.ayah.is-marked .ayah-num { background: var(--red-wash); color: var(--red); }
.ayah.is-playing { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent); }

@media (min-width: 1000px) {
  .quran-view--side .ayah { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .quran-view--side .ayah-top { grid-column: 1 / -1; }
  .quran-view--side .ayah-de { border-left: 1px solid var(--line-soft); padding-left: 1.5rem; }
}
.quran-view--ar .ayah-de { display: none; }
.quran-view--de .ayah-ar { display: none; }

.player {
  position: static; z-index: 45;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.65rem 0.8rem; margin-top: 0.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.player.is-live { position: sticky; bottom: calc(var(--tabbar) + 0.5rem); }
@media (min-width: 900px) { .player.is-live { bottom: 0.75rem; } }
.player .p-info { min-width: 0; flex: 1; font-size: var(--t-xs); color: var(--muted); }
.player .p-info strong { display: block; color: var(--ink); font-size: var(--t-sm); }

.juz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.5rem; }
.juz-btn {
  padding: 0.6rem 0.4rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-xs);
  cursor: pointer; text-align: center;
}
.juz-btn strong { display: block; font-size: var(--t-sm); }
.juz-btn span { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .juz-btn:hover { border-color: var(--red); color: var(--red); } }

.hadith { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hadith .h-source { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.hadith .h-ar { font-family: var(--font-ar); font-size: 1.35rem; line-height: 2; direction: rtl; text-align: right; color: var(--ink); margin: 0 0 0.6rem; }
.hadith .h-text { color: var(--ink); line-height: 1.7; margin: 0; }
.hadith .h-narrator { margin: 0.6rem 0 0; font-size: var(--t-xs); color: var(--muted); }

.dua { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dua-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; }
.dua-head h3 { margin: 0; font-size: var(--t-lg); }
.dua-ar { font-family: var(--font-ar); font-size: clamp(1.3rem, 3.2vw, 1.55rem); line-height: 2.1; direction: rtl; text-align: right; color: var(--ink); margin: 0 0 0.5rem; }
.dua-tr { font-size: var(--t-sm); font-style: italic; color: var(--muted); margin: 0 0 0.4rem; }
.dua-de { font-size: var(--t-sm); color: var(--ink-soft); margin: 0; }
.dua-src { margin: 0.5rem 0 0; font-size: var(--t-xs); color: var(--muted); }
.dua.is-saved { border-color: var(--red); }

.name-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.name-card { padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.n-num { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.n-ar { font-family: var(--font-ar); font-size: 1.5rem; line-height: 1.7; color: var(--red); direction: rtl; }
.n-tr { font-weight: 600; font-size: var(--t-sm); }
.n-de { font-size: var(--t-xs); color: var(--muted); }

.challenge { display: flex; align-items: flex-start; gap: 0.85rem; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.challenge .c-body { flex: 1; min-width: 0; }
.challenge strong { display: block; font-size: var(--t-sm); }
.challenge span { display: block; font-size: var(--t-xs); color: var(--muted); }
.challenge.is-on { border-color: var(--red); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 0.5rem; }
.progress > i { display: block; height: 100%; background: var(--red); border-radius: 999px; transition: width var(--dur-slow) var(--ease-out); }

/* ---------- 10 · Community -------------------------------------- */
.chat-layout { display: grid; gap: var(--gap); }
.chat-layout > * { min-width: 0; }  /* sonst dehnt die scrollbare Kanalleiste das Raster */
@media (min-width: 900px) { .chat-layout { grid-template-columns: 216px minmax(0, 1fr); align-items: start; } }

.channels { display: grid; gap: 2px; }
@media (max-width: 899px) {
  .channels { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.35rem; scrollbar-width: none; max-width: 100%; }
  .channels::-webkit-scrollbar { display: none; }
  .channel { border: 1px solid var(--line); background: var(--surface); }
}
.channel {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
  border: 0; background: none; color: var(--ink-soft);
  font: inherit; font-size: var(--t-sm); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.ch-hash { color: var(--muted); font-weight: 700; }
.ch-count { margin-left: auto; font-size: var(--t-xs); color: var(--muted); }
.channel[aria-pressed="true"] { background: var(--red-wash); color: var(--red); }
.channel[aria-pressed="true"] .ch-hash, .channel[aria-pressed="true"] .ch-count { color: var(--red); }
@media (hover: hover) and (pointer: fine) { .channel:hover { background: var(--surface-3); color: var(--ink); } }

.channel-head {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.85rem 1rem; margin-bottom: 0.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.channel-head h2 { margin: 0; font-size: var(--t-lg); }
.channel-head p { margin: 0; font-size: var(--t-xs); color: var(--muted); flex-basis: 100%; }

.feed { display: grid; gap: 0.6rem; }
.feed-item { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feed-head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.7rem; }
.feed-who { min-width: 0; }
.feed-name { font-weight: 600; font-size: var(--t-sm); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.feed-meta { font-size: var(--t-xs); color: var(--muted); }
.feed-item h3 { margin: 0 0 0.3rem; font-size: var(--t-lg); }
.feed-item p { color: var(--ink-soft); font-size: var(--t-sm); }
.feed-media { margin: 0.85rem 0 0; border-radius: var(--radius-sm); overflow: hidden; max-width: 520px; }
.feed-foot { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }

.answer {
  margin-top: 0.85rem; padding: 0.9rem 1.1rem;
  border-radius: var(--radius); background: var(--red-wash);
  border: 1px solid color-mix(in srgb, var(--red) 24%, transparent);
}
.answer p { color: var(--ink); }
.answer cite { display: block; margin-top: 0.5rem; font-size: var(--t-xs); font-style: normal; color: var(--muted); }

.composer {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.75rem 0.85rem; margin-bottom: 0.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.c-fake {
  flex: 1; min-height: 42px; display: flex; align-items: center;
  padding: 0 0.9rem; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-size: var(--t-sm);
}
@media (hover: hover) and (pointer: fine) { a.composer:hover .c-fake { background: var(--surface-3); } }

/* ---------- 11 · Overlays --------------------------------------- */
.search-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(1rem, 8vh, 5rem) 1rem 1rem;
  background: rgba(8, 10, 12, 0.4);
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.search-overlay.is-open { opacity: 1; }
.search-panel {
  width: min(660px, 100%); max-height: min(72vh, 620px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: scale(0.97) translateY(-6px); opacity: 0;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.search-overlay.is-open .search-panel { transform: none; opacity: 1; }
.search-field { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.4rem 0.4rem 0.9rem; border-bottom: 1px solid var(--line); }
.search-field > svg { width: 19px; height: 19px; color: var(--muted); flex: 0 0 auto; }
.search-field input { flex: 1; border: 0; background: none; min-height: 46px; padding: 0; font-size: 1.0625rem; }
.search-field input:focus { box-shadow: none; }
.search-results { overflow-y: auto; padding: 0.4rem; overscroll-behavior: contain; }
.search-results a { display: block; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); color: var(--ink); transition: background-color var(--dur-fast) ease; }
.search-results a strong { display: block; font-weight: 600; }
.search-results a span { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 0.1rem; }
.search-results a mark { background: color-mix(in srgb, var(--red) 22%, transparent); color: inherit; border-radius: 2px; }
.search-results a:hover, .search-results a.is-active { background: var(--surface-2); }
.search-hint { padding: 1.1rem 0.8rem; color: var(--muted); font-size: var(--t-sm); }

.cookie-note {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 0.75rem); z-index: var(--z-note);
  width: min(660px, calc(100vw - 1.5rem));
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 12px); opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
}
@media (min-width: 900px) { .cookie-note { bottom: 1rem; } }
.cookie-note.is-open { transform: translate(-50%, 0); opacity: 1; }
.cookie-note p { margin: 0; flex: 1 1 300px; font-size: var(--t-xs); line-height: 1.5; color: var(--ink-soft); }
.cookie-note strong { color: var(--ink); }

.app-foot {
  margin-top: auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem;
  border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--muted);
}
.foot-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; margin-bottom: 0.7rem; }
.app-foot a { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .app-foot a:hover { color: var(--red); } }

/* ---------- 12 · Utilities -------------------------------------- */
.reveal { opacity: 0; transform: translateY(10px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }

.hidden { display: none !important; }
.center { text-align: center; }
.mt-1 { margin-top: 0.6rem; }
.mt-2 { margin-top: 1.15rem; }
.mt-3 { margin-top: 1.75rem; }
.mt-4 { margin-top: 2.5rem; }
.mb-2 { margin-bottom: 1.15rem; }
.max-60 { max-width: 60ch; }

.spinner { width: 17px; height: 17px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin 620ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ornament { position: relative; isolation: isolate; overflow: hidden; }
.ornament::before {
  content: ""; position: absolute; z-index: -1;
  top: -80px; right: -80px; width: 300px; height: 300px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23da1f26' stroke-width='0.7'%3E%3Cpath d='M50 4 96 50 50 96 4 50Z'/%3E%3Crect x='17' y='17' width='66' height='66'/%3E%3Cpath d='M50 4v92M4 50h92M17.5 17.5l65 65M82.5 17.5l-65 65'/%3E%3Ccircle cx='50' cy='50' r='23'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.1; pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 13 · Altbestand & Kleinteile ------------------------ */
/* Diese Klassen stammen aus frueheren Seiten und verhalten sich wie
   die neuen Bausteine – so bleibt jede Seite konsistent. */
.callout {
  padding: clamp(1rem, 3vw, 1.4rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.callout--accent { border-color: color-mix(in srgb, var(--red) 32%, transparent); background: var(--red-wash); }
.callout h3 { font-size: var(--t-lg); margin-bottom: 0.35rem; }
.callout p { font-size: var(--t-sm); color: var(--ink-soft); }

.sec-head--single { display: block; }
.qibla-readout { font-variant-numeric: tabular-nums; }
.news-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.news-row input { flex: 1 1 180px; }

/* Auf dem Handy fuellen die Haupt-Schaltflaechen die Breite */
@media (max-width: 560px) {
  .screen-head .row .btn-lg,
  .empty .btn { width: 100%; }
  .cta-actions .btn { flex: 1 1 100%; }
  .brand-logo { height: 26px; }
  .app-bar { gap: 0.15rem; }
}

/* Abspielleiste: auf dem Handy zwei Zeilen statt Ueberlappung */
.player .p-info {
  flex: 1 1 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player .p-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player audio { flex: 1 1 100%; width: 100%; height: 36px; }
@media (min-width: 620px) {
  .player .p-info { flex: 1 1 auto; }
  .player audio { flex: 0 0 auto; width: auto; max-width: 320px; }
}

/* ---------- 14 · Gebetszeiten auf dem Startbildschirm ----------- */
.ort-zeile {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: var(--t-sm); color: var(--muted);
}
.ort-zeile svg { width: 17px; height: 17px; color: var(--red); }
.ort-zeile strong { color: var(--ink); font-weight: 600; }

.datum-greg { font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.datum-hijri { font-size: var(--t-sm); color: var(--muted); margin: 0.15rem 0 0; }

.prayer-card {
  padding: 0.4rem 0.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.prayer-row {
  position: relative;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.95rem 0.9rem;
  border-radius: var(--radius-sm);
}
.prayer-row + .prayer-row { box-shadow: inset 0 1px 0 var(--line-soft); }
.pt-name { flex: 1; font-size: 1.0625rem; font-weight: 500; }
.pt-time { font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-bell { width: 38px; height: 38px; color: var(--muted); }
.pt-bell svg { width: 19px; height: 19px; }
.pt-bell.is-on { color: var(--red); }

.prayer-row.is-next {
  margin: 0.5rem 0;
  border: 1px solid var(--red);
  box-shadow: none;
  background: var(--red-wash);
}
.prayer-row.is-next + .prayer-row { box-shadow: none; }
.prayer-row.is-next .pt-name,
.prayer-row.is-next .pt-time { color: var(--red); }
.pt-rest {
  position: absolute; top: -0.65rem; left: 50%; transform: translateX(-50%);
  padding: 0 0.5rem;
  background: var(--red-wash);
  color: var(--red);
  font-size: var(--t-xs); font-weight: 600;
  white-space: nowrap;
}

.quick-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.quick {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: var(--t-sm); font-weight: 500;
}
.quick svg { width: 17px; height: 17px; color: var(--red); }
@media (hover: hover) and (pointer: fine) { .quick:hover { border-color: var(--red); } }

/* Adhkar mit Zähler */
.dhikr {
  display: grid; gap: 0.6rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.dhikr.is-done { border-color: var(--red); }
.dhikr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.dhikr-top h3 { margin: 0; font-size: var(--t-base); }
.dhikr-ar { font-family: var(--font-ar); font-size: clamp(1.25rem, 3.2vw, 1.5rem); line-height: 2.05; direction: rtl; text-align: right; color: var(--ink); margin: 0; }
.dhikr-tr { font-size: var(--t-sm); font-style: italic; color: var(--muted); margin: 0; }
.dhikr-de { font-size: var(--t-sm); color: var(--ink-soft); margin: 0; }
.dhikr-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.zaehler {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; padding: 0.4rem 1rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.zaehler:active { transform: scale(0.97); }
.zaehler.is-done { background: var(--red-wash); border-color: var(--red); color: var(--red); }

/* =================================================================
   15 · Islamische Formsprache
   Drei Elemente, die sich durch die ganze App ziehen:
   der achtzackige Stern (Khatam) als Trenner, der Spitzbogen
   (Mihrab) ueber dem, was zuerst gelesen wird, und ein Girih-Band
   als Abschluss. Mehr braucht es nicht – Ornament ist hier
   Gliederung, keine Tapete.
   ================================================================= */

/* --- Khatam: Trenner zwischen zwei Gedanken -------------------- */
.orn-rule {
  display: flex; align-items: center; gap: 0.9rem;
  margin: clamp(1.75rem, 5vw, 2.75rem) 0;
  color: color-mix(in srgb, var(--red) 42%, transparent);
}
.orn-rule::before, .orn-rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 22%, var(--line) 78%, transparent);
}
.orn-rule svg { width: 22px; height: 22px; flex: none; stroke-width: 1.1; }

/* Jeder Bildschirm bekommt genau einen Stern unter dem Titel. */
.screen-head { position: relative; }
.screen-head::after {
  content: ""; display: block;
  width: 74px; height: 14px; margin-top: 1.1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 74 14' fill='none' stroke='%23da1f26' stroke-width='1'%3E%3Cpath d='M0 7h22M52 7h22'/%3E%3Cpath d='M37 1.2 41 7l-4 5.8L33 7Z'/%3E%3Cpath d='M31.2 7h11.6'/%3E%3Cpath d='m33.4 3.2 7.2 7.6M40.6 3.2l-7.2 7.6'/%3E%3C/svg%3E") left center / contain no-repeat;
  opacity: 0.55;
}
/* --- Mihrab: die Nische ueber der Basmala ---------------------
   Der Bogen ist kein gezeichnetes Bild, sondern die Form der Flaeche
   selbst – so bleibt er auf jedem Bildschirm gestochen scharf. */
.bismillah {
  position: relative;
  display: grid; justify-items: center; text-align: center;
  gap: 0.2rem;
  padding: clamp(2.4rem, 8vw, 3.4rem) clamp(1.25rem, 5vw, 2rem) clamp(1.2rem, 3vw, 1.5rem);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--red) 26%, var(--line));
  border-radius: 48% 48% var(--radius) var(--radius) / 34% 34% var(--radius) var(--radius);
  box-shadow: var(--shadow-sm);
}
/* Der Stern sitzt im Scheitel der Nische. */
.bismillah::before {
  content: ""; position: absolute;
  top: clamp(0.9rem, 3.5vw, 1.4rem); left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23da1f26' stroke-width='1.1'%3E%3Cpath d='M12 1.5 15 9l7.5 3-7.5 3-3 7.5-3-7.5L1.5 12 9 9Z'/%3E%3Cpath d='M12 4.5 14 12l-2 7.5L10 12Z' opacity='.5'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.8;
}
.bism-ar {
  font-family: var(--font-ar);
  font-size: clamp(1.4rem, 5.4vw, 1.95rem);
  line-height: 1.85; direction: rtl;
  color: var(--red); margin: 0;
}
.bism-de {
  font-family: var(--font-display);
  font-size: var(--t-sm); font-style: italic;
  color: var(--muted); margin: 0;
}

/* --- Girih: schmales Band als Abschluss ------------------------ */
.orn-band {
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12' fill='none' stroke='%23da1f26' stroke-width='0.9'%3E%3Cpath d='M0 6 6 0l6 6-6 6zM12 6h4M16 6l6-6 6 6-6 6zM28 6h4M32 6l6-6 6 6-6 6z'/%3E%3C/svg%3E") repeat-x left center / auto 12px;
  opacity: 0.28;
}

/* --- Sternchen vor Abschnittstiteln, wo es Struktur zeigt ------ */
.sec-head h2 { position: relative; }

/* Zitate aus Quran und Sunnah bekommen den Bogen als Anfuehrung. */
.prose blockquote,
.quote-plate {
  position: relative;
  font-family: var(--font-display);
  font-size: var(--t-lg);
  line-height: 1.55;
}
.prose blockquote { border-radius: var(--radius); }

/* --- Moschee-Eintrag mit Kachel und Kartenausschnitt ------------ */
.mosque { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.9rem 1rem; align-items: start; }
.mosque > .m-body { min-width: 0; }
.mosque > .m-extra { grid-column: 1 / -1; }

/* Die Kachel zeigt den Kanton – ein Schild, kein Schmuck. */
.m-plate {
  display: grid; place-items: center;
  width: 56px; height: 66px; flex: none;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: 0.02em;
  color: var(--red);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23da1f26' stroke-width='0.6'%3E%3Cpath d='M16 0 32 16 16 32 0 16Z'/%3E%3Cpath d='M0 0h32v32H0z'/%3E%3Cpath d='M16 0v32M0 16h32'/%3E%3C/svg%3E") center / 16px 16px repeat,
    var(--red-wash);
  border: 1px solid color-mix(in srgb, var(--red) 22%, var(--line));
  border-radius: 44% 44% var(--radius-sm) var(--radius-sm) / 30% 30% var(--radius-sm) var(--radius-sm);
}

.m-map {
  position: relative; overflow: hidden;
  height: 150px; margin-top: 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-3);
}
.m-map img { position: absolute; width: 256px; height: 256px; max-width: none; }
.m-map .m-pin {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px;
  transform: translate(-50%, -86%);
  color: var(--red); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.m-map .m-pin svg { fill: var(--red); stroke: #fff; stroke-width: 1.4; }
.m-credit {
  position: absolute; right: 0; bottom: 0;
  padding: 0.1rem 0.4rem; font-size: 0.6875rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent); color: var(--muted);
  border-top-left-radius: var(--radius-sm);
}
.m-credit a { color: inherit; }
.m-hint { font-size: var(--t-xs); color: var(--muted); margin: 0.45rem 0 0; }
.mosque .acts button.plain {
  font: inherit; color: var(--red); background: none;
  border: 0; padding: 0; cursor: pointer; text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .mosque .acts button.plain:hover { color: var(--red-ink); text-decoration: underline; text-underline-offset: 0.2em; }
}
/* Die Karte wird leicht entsaettigt, damit sie sich in die App fuegt
   und das Rot der Marke die einzige kraeftige Farbe bleibt. */
.m-map img { filter: saturate(0.68) contrast(0.97); }
html[data-theme="dark"] .m-map img { filter: invert(1) hue-rotate(180deg) brightness(0.92) saturate(0.5); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .m-map img { filter: invert(1) hue-rotate(180deg) brightness(0.92) saturate(0.5); }
}

/* --- Wer ist gerade da ------------------------------------------
   Der Punkt ist gruen, nicht rot. Rot ist die Marke – ein Zustand
   («da», «weg») braucht eine eigene Farbe, sonst liest man ihn als
   Auszeichnung. */
:root { --da: #1f9254; }
html[data-theme="dark"] { --da: #4ad07f; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) { --da: #4ad07f; } }

.praesenz {
  margin-top: 1.1rem; padding: 0.9rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pr-titel {
  display: flex; align-items: center; gap: 0.4rem;
  margin: 0 0 0.6rem; font-family: var(--font);
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.pr-zahl {
  padding: 0.05rem 0.4rem; border-radius: 999px;
  background: color-mix(in srgb, var(--da) 15%, transparent);
  color: var(--da); font-size: var(--t-xs); letter-spacing: 0;
}
.pr-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.pr-person { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.pr-punkt {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--da); box-shadow: 0 0 0 2px color-mix(in srgb, var(--da) 22%, transparent);
}
.pr-bild { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.pr-wer { display: grid; min-width: 0; line-height: 1.25; }
.pr-name {
  font-size: var(--t-sm); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pr-rolle { font-size: var(--t-xs); color: var(--red); }
.pr-du { color: var(--muted); }
.pr-fuss { margin: 0.7rem 0 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }

/* Auf dem Handy steht die Liste unter den Kanälen, nicht daneben. */
@media (max-width: 899px) {
  .praesenz { margin-top: 0.9rem; }
  .pr-liste { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---------- 21 · Konto, Community an der Datenbank --------------- */
/* Die Skripte melden mit is-ok / is-error / is-info. Ohne diese
   Regeln stehen Statusmeldungen auf display:none – ein Anmeldefehler
   waere dann unsichtbar. */
.form-status.is-ok,
.form-status.is-error,
.form-status.is-info { display: block; }

.form-status.is-ok {
  background: var(--red-wash); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
}
.form-status.is-error {
  background: var(--surface); border: 1px solid var(--red); color: var(--red);
}
.form-status.is-info {
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line);
}

/* Die freiwillige Angabe «muslimisch» / «lernt den Islam kennen».
   Bewusst leiser als die Rollen-Abzeichen: eine Einordnung, keine
   Auszeichnung. */
.tag--soft {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); font-weight: 400;
}

/* Knoepfe am Beitrag. Sie stehen im Markup immer, sichtbar werden sie
   erst durch die Klasse am <body> – gesetzt, nachdem die Datenbank
   gesagt hat, wer da ist. Erlaubt wird dadurch nichts: das entscheidet
   weiterhin die Datenbank. */
.feed-werkzeuge { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.feed-werkzeuge .nur-gelehrte,
.feed-werkzeuge .nur-pruefer { display: none; }
body.kann-antworten .feed-werkzeuge .nur-gelehrte,
body.kann-freigeben .feed-werkzeuge .nur-pruefer { display: inline-flex; }

.antwort-form {
  margin-top: 1rem; padding: 1rem;
  border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: var(--radius-sm); background: var(--surface);
}
.antwort-form .field { margin-bottom: 0.85rem; }
.antwort-form textarea { width: 100%; }

/* ---------- 22 · Die Community ist ein Chat ---------------------
   Der Rest der App ist bewusst weich und ruhig: runde Ecken, viel
   Luft, Kacheln. Die Community ist etwas anderes – dort wird
   geredet. Darum hier kantig, dicht und mit eigener Fläche: ein
   Fenster, das auf der Seite liegt, statt eines Abschnitts, der
   mitfliesst.

   Die eigenen Werte stehen als Variablen auf .chat-panel, damit
   heller und dunkler Modus aus derselben Quelle kommen. */

.chat-panel {
  --chat-flaeche: var(--surface);
  --chat-seite: var(--surface-2);
  --chat-linie: var(--line);
  --chat-linie-fein: var(--line-soft);
  --chat-hover: var(--surface-2);

  background: var(--chat-flaeche);
  border: 1px solid var(--chat-linie);
  border-radius: 0;                 /* kantig – das ist der Punkt */
  overflow: hidden;
}

/* Der rote Faden oben: die einzige Stelle in der App mit einer
   durchgehenden Markenkante. Sie sagt: hier bist du im Gespräch. */
.chat-panel { border-top: 2px solid var(--red); }

/* Dunkel: die Flaeche liegt tiefer als die Seite dahinter, damit
   sich der Chat abhebt statt mitzuschwimmen. */
html[data-theme="dark"] .chat-panel {
  --chat-flaeche: #141110;          /* tiefer als die Seite dahinter */
  --chat-seite: #100e0d;
  --chat-hover: #1b1716;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .chat-panel {
    --chat-flaeche: #141110;
    --chat-seite: #100e0d;
    --chat-hover: #1b1716;
  }
}

@media (min-width: 900px) {
  .chat-panel { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: min(74vh, 760px); }
  .chat-seite { border-right: 1px solid var(--chat-linie-fein); }
}

/* --- Seitenleiste: Kanäle ------------------------------------- */
.chat-seite {
  background: var(--chat-seite);
  padding: 0.55rem 0.5rem;
  display: flex; flex-direction: column; min-width: 0;
}

.chat-panel .channels { display: grid; gap: 1px; }

.chat-panel .channel {
  border-radius: 0; border: 0; background: none;
  padding: 0.45rem 0.6rem;
  font-size: var(--t-sm);
  border-left: 2px solid transparent;
}
.chat-panel .channel[aria-pressed="true"] {
  background: var(--chat-hover);
  border-left-color: var(--red);
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .chat-panel .channel:hover { background: var(--chat-hover); }
}

.chat-panel .praesenz {
  margin-top: auto; padding: 0.75rem 0.6rem 0.4rem;
  background: none; border: 0; border-top: 1px solid var(--chat-linie-fein);
  border-radius: 0;
}

/* --- Kopfleiste ----------------------------------------------- */
.chat-haupt { display: flex; flex-direction: column; min-width: 0; }

.chat-panel .channel-head {
  margin: 0; padding: 0.7rem 1rem;
  background: var(--chat-flaeche);
  border: 0; border-bottom: 1px solid var(--chat-linie-fein); border-radius: 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.chat-panel .channel-head h2 { font-size: 1rem; }

/* --- Der Strom ------------------------------------------------- */
.chat-strom { flex: 1; padding: 0; background: var(--chat-flaeche); }
@media (min-width: 900px) {
  .chat-strom { overflow-y: auto; scrollbar-width: thin; }
  .chat-strom::-webkit-scrollbar { width: 10px; }
  .chat-strom::-webkit-scrollbar-thumb {
    background: var(--chat-linie); border-radius: 0;
    border: 3px solid var(--chat-flaeche);
  }
}

/* Beiträge sind Zeilen, keine Kacheln. Kein Rahmen, keine runden
   Ecken, kein Abstand dazwischen – sie laufen untereinander weg
   wie Nachrichten. */
.chat-panel .feed { display: block; gap: 0; }

.chat-panel .feed-item {
  padding: 0.7rem 1rem 0.8rem;
  background: none; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--chat-linie-fein);
}
@media (hover: hover) and (pointer: fine) {
  .chat-panel .feed-item:hover { background: var(--chat-hover); }
}

.chat-panel .feed-head { margin-bottom: 0.3rem; gap: 0.55rem; }
.chat-panel .feed-item .avatar { width: 34px; height: 34px; border-radius: 0; font-size: var(--t-xs); }

/* Titel und Text hängen unter dem Namen, nicht unter dem Bild –
   das ist die Zeilenführung, die man aus Chats kennt. */
.chat-panel .feed-item > h3,
.chat-panel .feed-item > p,
.chat-panel .feed-item > .feed-media,
.chat-panel .feed-item > .answer,
.chat-panel .feed-item > .feed-werkzeuge,
.chat-panel .feed-item > .feed-foot,
.chat-panel .feed-item > .antwort-form { margin-left: calc(34px + 0.55rem); }

.chat-panel .feed-item h3 { font-size: 0.9375rem; margin: 0 0 0.15rem; }
.chat-panel .feed-item p { font-size: var(--t-sm); margin: 0; }
.chat-panel .answer { border-radius: 0; margin-top: 0.6rem; }
.chat-panel .antwort-form { border-radius: 0; }
.chat-panel .feed-werkzeuge { margin-top: 0.6rem; }
.chat-panel .feed-foot { margin-top: 0.5rem; }
.chat-panel .empty { padding: 2.5rem 1rem; }

/* --- Eingabeleiste unten --------------------------------------- */
.chat-panel .composer {
  margin: 0; border: 0; border-top: 1px solid var(--chat-linie);
  border-radius: 0; background: var(--chat-seite);
  padding: 0.6rem 0.8rem;
}
.chat-panel .c-fake { border-radius: 0; min-height: 38px; background: var(--chat-flaeche); }
.chat-panel .composer .avatar { border-radius: 0; }
@media (hover: hover) and (pointer: fine) {
  .chat-panel a.composer:hover .c-fake { background: var(--chat-hover); }
}

/* --- Handy: Kanäle oben, Präsenz unten ------------------------- */
@media (max-width: 899px) {
  .chat-panel { display: flex; flex-direction: column; min-height: 70vh; }
  .chat-seite { display: contents; }

  .chat-panel .channels {
    order: 1; margin: 0; display: flex; gap: 0;
    padding: 0; background: var(--chat-seite);
    border-bottom: 1px solid var(--chat-linie-fein);
  }
  .chat-panel .channel {
    background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 0.6rem 0.75rem;
  }
  .chat-panel .channel[aria-pressed="true"] {
    border-left-color: transparent; border-bottom-color: var(--red);
  }
  .chat-haupt { order: 2; flex: 1; }
  .chat-panel .praesenz {
    order: 4; margin: 0; padding: 0.75rem 0.85rem;
    background: var(--chat-seite);
    border-top: 1px solid var(--chat-linie-fein);
  }
  .chat-panel .composer { order: 3; }
}

/* --- Der Übergang zum Formular ---------------------------------
   Dasselbe Zeichen wie unter den Seitentiteln, waagrecht ausgelegt:
   ein Khatam-Stern zwischen zwei Haarlinien. Er sagt ohne Worte,
   dass hier ein Teil endet und ein anderer beginnt. */
.uebergang {
  display: flex; align-items: center; gap: 1rem;
  margin: clamp(2.25rem, 7vw, 3.5rem) auto clamp(1rem, 3vw, 1.5rem);
  max-width: 420px;
}
.ue-linie {
  flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
}
.ue-stern {
  flex: none; width: 18px; height: 18px; opacity: 0.6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23da1f26' stroke-width='1'%3E%3Cpath d='M9 1.5 12.5 9 9 16.5 5.5 9Z'/%3E%3Cpath d='M1.5 9h15'/%3E%3Cpath d='m3.7 3.7 10.6 10.6M14.3 3.7 3.7 14.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

#pfKonto { margin: 0 0 1.25rem; max-width: 62ch; }

/* --- Wer gerade da ist, in der Kopfleiste -----------------------
   Ein grüner Punkt und eine Zahl. Erscheint nur für Angemeldete –
   wer ohne Konto liest, sieht nie, wer da ist. Der Punkt ist
   derselbe wie in der Community-Liste (--da). */
.da-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.6rem; border-radius: 999px;
  background: color-mix(in srgb, var(--da) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--da) 28%, transparent);
  color: var(--da); font-size: var(--t-xs); font-weight: 700;
  text-decoration: none; line-height: 1;
  transition: background-color var(--dur-fast) ease;
}
.da-punkt-puls,
.da-chip .da-punkt {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--da);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--da) 22%, transparent);
}
@media (hover: hover) and (pointer: fine) {
  .da-chip:hover { background: color-mix(in srgb, var(--da) 22%, transparent); }
}

/* --- Konto verwalten: der Löschbereich ------------------------------
   Er sieht anders aus als die Formulare darüber, weil er etwas
   anderes tut. Kein Rot-in-Rot-Geschrei – eine Kante genügt, damit
   man ihn nicht mit «Speichern» verwechselt. */
.karte-gefahr { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.karte-gefahr h3 { color: var(--red); }

.btn-gefahr {
  background: var(--red); color: var(--on-red);
  border: 1px solid var(--red);
}
.btn-gefahr:disabled { opacity: 0.55; }
@media (hover: hover) and (pointer: fine) {
  .btn-gefahr:hover { background: var(--red-ink); border-color: var(--red-ink); }
}
