@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Noto+Naskh+Arabic:wght@400;600;700&display=swap");

:root {
  --bg: #f5f4fb;
  --panel: #ffffff;
  --ink: #111322;
  --muted: #7a7d90;
  --line: #e0deec;
  --deen: #16a58a;
  --deen-soft: rgba(22, 165, 138, 0.15);
  --dunya: #3b82f6;
  --both: #a855f7;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;
  --fab-size: 56px;
  --adhkar-sans: "Plus Jakarta Sans", "Noto Naskh Arabic", sans-serif;
  --adhkar-display: "Plus Jakarta Sans", "Noto Naskh Arabic", sans-serif;
  --adhkar-bg: #f7f6f2;
  --adhkar-wash: #efefe8;
  --adhkar-surface: #ffffff;
  --adhkar-outline: rgba(17, 19, 34, 0.08);
  --adhkar-accent: #1b9c85;
  --adhkar-accent-2: #37b89f;
  --adhkar-glow: rgba(27, 156, 133, 0.14);
  --adhkar-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  --ui-scale: 1;
}   

body.theme-dark {
  --bg: #050509;
  --panel: #171521;
  --ink: #f3f1ff;
  --muted: #9e9ab5;
  --line: #343247;
  --deen: #27c4a5;
  --deen-soft: rgba(39, 196, 165, 0.2);
  --dunya: #7aa2ff;
  --both: #b26bff;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
  --adhkar-bg: #0b0d13;
  --adhkar-wash: #10131b;
  --adhkar-surface: #161a24;
  --adhkar-outline: rgba(243, 241, 255, 0.08);
  --adhkar-accent: #2cd1b2;
  --adhkar-accent-2: #4adcc0;
  --adhkar-glow: rgba(44, 209, 178, 0.2);
  --adhkar-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  zoom: var(--ui-scale);
}

body.font-scale-sm {
  --ui-scale: 0.94;
}

body.font-scale-md {
  --ui-scale: 1;
}

body.font-scale-lg {
  --ui-scale: 1.08;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  padding: 0 16px 96px;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 16px 6px;
  background:
    radial-gradient(circle at 0 0, rgba(22, 165, 138, 0.18), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(59, 130, 246, 0.18), transparent 55%),
    var(--bg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid rgba(224, 222, 236, 0.7);
  transition: transform 0.6s ease-out, background var(--transition-med), box-shadow var(--transition-med), padding 0.35s ease, gap 0.35s ease;
}

.topbar > .app-header,
.topbar > .topbar-verse,
.topbar > .tab-mode-row,
.topbar > .search-row {
  width: min(100%, 460px);
}

.tab-mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.35s ease, margin 0.35s ease;
}

.topbar:not(.topbar--compact) .tab-mode-row {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (min-width: 480px) {
  .topbar:not(.topbar--compact) .tab-mode-row {
    justify-content: center;
  }
}

.topbar:not(.topbar--compact) .tabs,
.topbar:not(.topbar--compact) .mode-row {
  justify-content: center;
}

body.theme-dark .topbar:not(.topbar--compact) .tab-mode-row {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.theme-dark .topbar:not(.topbar--compact) .search-row {
  background: rgba(23, 21, 33, 0.9);
  border-color: #343247;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.45);
}

body.theme-dark .topbar {
  background:
    radial-gradient(circle at 0 0, rgba(39, 196, 165, 0.14), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(178, 107, 255, 0.16), transparent 55%),
    #050509;
  border-bottom: 1px solid rgba(52, 50, 71, 0.9);
}

body.theme-dark .topbar-verse-toggle {
  background: #1d1a2a;
  border-color: #343247;
}

body.theme-dark .topbar-verse-toggle:hover {
  background: rgba(243, 241, 255, 0.08);
}

body.theme-dark .topbar-verse-icon {
  background: #0f0d17;
  border-color: #343247;
}

body.theme-dark .topbar-popover {
  background: #1d1a2a;
  border-color: #343247;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.5);
}

.topbar--hidden {
  transform: translateY(-120%);
}

.topbar--compact {
  padding: 10px 16px;
  gap: 8px;
}

.topbar:not(.topbar--compact) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "app-header tab-mode-row"
    "search-row search-row";
  align-items: center;
  gap: 4px 8px;
}

.topbar:not(.topbar--compact) > .app-header {
  grid-area: app-header;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  justify-self: center;
  display: flex;
  justify-content: center;
}

.topbar:not(.topbar--compact) > .tab-mode-row {
  grid-area: tab-mode-row;
  width: min(100%, 460px);
  max-width: none;
  min-width: 0;
  justify-self: center;
}

.topbar:not(.topbar--compact) > .search-row {
  grid-area: search-row;
  width: min(100%, 460px);
  max-width: none;
  min-width: 0;
}

.topbar:not(.topbar--compact) .app-header-right,
.topbar:not(.topbar--compact) .topbar-verse {
  display: none;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 0;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  transition: gap 0.3s ease, border 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

body.theme-dark .topbar--compact .app-header {
  background: rgba(23, 21, 33, 0.9);
  border-color: #343247;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-width: 0;
}

.topbar:not(.topbar--compact) .app-header-left {
  justify-content: center;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  max-height: 120px;
  max-width: 260px;
  overflow: visible;
  justify-self: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-toggle {
  border: 0;
  background: transparent;
  appearance: none;
  padding: 4px 6px;
  border-radius: 999px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}
.topbar-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.topbar-toggle:hover {
  background: rgba(17, 19, 34, 0.06);
}
body.theme-dark .topbar-toggle:hover {
  background: rgba(243, 241, 255, 0.08);
}

.topbar:not(.topbar--compact) .topbar-toggle {
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-logo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
  flex-shrink: 0;
  overflow: hidden;
}

.app-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

body.theme-dark .app-logo {
  background: #f3f1ff;
  color: #050509;
  box-shadow: 0 0 0 1px rgba(243, 241, 255, 0.18);
}

.app-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 240px;
  overflow: hidden;
  transition: max-width 0.35s ease, opacity 0.25s ease, transform 0.35s ease;
}

.app-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.app-subtitle {
  font-size: 11px;
  color: var(--muted);
}

.topbar-date-line {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}

.topbar-date-line--hijri {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.topbar-verse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  width: auto;
  align-self: center;
  opacity: 1;
  transform: translateY(0);
}

.topbar-verse-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.topbar-verse-toggle:hover {
  background: rgba(17, 19, 34, 0.06);
}

.topbar-verse-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.topbar-verse-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  box-shadow: none;
  transition: transform 0.2s ease;
}

.topbar-verse-toggle-label {
  font-weight: 600;
}

.topbar-popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 15, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 250;
}

.topbar-popover-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.topbar-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(360px, 92vw);
  max-height: min(70vh, 460px);
  overflow: hidden;
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.2);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 260;
  display: flex;
  flex-direction: column;
}

.topbar-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.topbar-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.topbar-popover__title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
}

.topbar-popover__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.topbar-popover__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.topbar-popover__line {
  font-size: 13px;
  color: var(--ink);
  text-align: center;
}

.adhkar-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 10px 16px 6px;
}

.adhkar-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.adhkar-date-line {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adhkar-date-line--hijri {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}


.topbar-verse-ar {
  font-family: var(--adhkar-display);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  text-align: center;
}

.topbar-verse-translation {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}

.topbar-verse-source {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.topbar-verse.topbar-verse--collapsed .topbar-verse-icon {
  transform: rotate(-12deg);
}

.topbar-verse.topbar-verse--collapsed .topbar-verse-toggle {
  border-color: var(--line);
}

.topbar--compact .tab-mode-row,
.topbar--compact .search-row {
  max-height: 0;
  max-width: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  margin: 0;
}

.topbar--compact .app-header-right {
  max-width: 220px;
}

.topbar--compact .app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.topbar--compact .app-header-right {
  gap: 4px;
  margin-left: 0;
  justify-content: center;
  flex-wrap: nowrap;
  justify-self: end;
  grid-column: 3;
}

.topbar--compact .app-header-right .pill {
  padding: 4px 10px;
  font-size: 12px;
}

.topbar--compact .topbar-verse-toggle {
  padding: 4px 8px;
  font-size: 9px;
}

.topbar--compact .app-title-group {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  opacity: 1;
  transform: translateY(0);
}

.topbar--compact .app-title {
  font-size: 13px;
  letter-spacing: 0.12em;
}

.topbar--compact .app-subtitle {
  display: none;
}

.topbar--compact .app-header-left {
  gap: 8px;
  justify-self: start;
  grid-column: 1;
}

.topbar--compact .app-logo {
  width: 32px;
  height: 32px;
}

.topbar--compact .app-header-left,
.topbar--compact .app-header-right {
  justify-content: center;
}

.topbar:not(.topbar--compact) .app-title-group {
  display: none;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  justify-content: center;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mode-switch {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
}

.mode-switch::-webkit-scrollbar {
  display: none;
}

.tab-toggle-btn,
.mode-toggle-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(22, 165, 138, 0.18), rgba(59, 130, 246, 0.16));
  border-color: rgba(17, 19, 34, 0.12);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
  min-width: 120px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toggle-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

body.theme-dark .toggle-badge {
  background: rgba(243, 241, 255, 0.12);
  color: #f3f1ff;
}

.tab-toggle-btn:focus-visible,
.mode-toggle-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

body.theme-dark .tab-toggle-btn,
body.theme-dark .mode-toggle-btn {
  background: linear-gradient(135deg, rgba(44, 209, 178, 0.22), rgba(124, 92, 255, 0.18));
  border-color: rgba(243, 241, 255, 0.16);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.search-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap; /* Erzwingt, dass alles in einer Zeile bleibt */
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.35s ease, margin 0.35s ease;
}

.topbar:not(.topbar--compact) .search-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
  justify-content: center;
}

.sort-row {
  margin-top: 6px;
}

.sort-select {
  flex: 0 1 auto; /* Erlaubt den Filtern, schmaler zu werden */
  min-width: 0;   /* Verhindert das Ausbrechen aus dem Container */
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 11px;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  max-width: 110px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
body.theme-dark .sort-select {
  background: rgba(23,21,33,0.96);
  border-color: #343247;
  color: var(--ink);
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 12px;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
}

body.theme-dark .search-input {
  background: rgba(23, 21, 33, 0.96);
  border-color: #343247;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
  color: var(--ink);
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pill-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  flex-shrink: 0;
}
.pill-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  display: block;
}
.pill--small { padding: 4px 10px; font-size: 12px; }
.pill--small .pill-icon {
  width: 12px;
  height: 12px;
  margin-right: 5px;
}
.pill.active { background: var(--ink); color: #fff; border-color: transparent; }

/* Language toggle button in header */
.lang-toggle-btn {
  min-width: 34px;
  padding-inline: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.theme-dark .lang-toggle-btn {
  background: #1d1a2a;
  border-color: #343247;
}
.pill--small { padding: 4px 10px; font-size: 12px; }
.pill.active { background: var(--ink); color: #fff; border-color: transparent; }

body.theme-dark .pill {
  background: #1d1a2a;
  border-color: #343247;
  color: var(--ink);
}

body.theme-dark .pill.active {
  background: #f3f1ff;
  color: #050509;
  border-color: transparent;
}

/* === Language Dropdown === */

.lang-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-dropdown {
  position: absolute;
  top: 120%;
  inset-inline-end: 0; /* Rechtsbündig in LTR, Linksbündig in RTL */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.lang-option:hover {
  background: rgba(120, 120, 128, 0.08);
}

body.theme-dark .lang-dropdown {
  background: #1d1a2a;
  border-color: #343247;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.theme-dark .lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-toggle-btn { min-width: 40px; padding-inline: 10px; }

.loading { margin-top: 32px; text-align: center; color: var(--muted); }

.task-section {
  position: relative;
  margin-top: 20px;
  padding: 18px 12px 12px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.section-title {
  position: absolute;
  top: -12px;
  inset-inline-start: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px 12px 10px 10px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  z-index: 2;
  margin: 0;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.section-title::after {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  bottom: -6px;
  width: 26px;
  height: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.section-title:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.section-title-label {
  display: inline-flex;
  align-items: center;
}

.section-title-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.section-tools {
  position: absolute;
  top: -12px;
  inset-inline-end: 12px;
  display: inline-flex;
  gap: 6px;
  z-index: 3;
}

.section-tool-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

.section-tool-btn:hover {
  color: var(--ink);
}

.section-tool-btn--danger {
  color: #dc2626;
}

.task-section-body {
  margin-top: 6px;
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}

.task-section.is-collapsed .task-section-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.task-section.is-collapsed .section-title {
  color: var(--muted);
}

.task-section.is-collapsed .section-title-icon {
  transform: rotate(-45deg);
}
.section-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
  margin-top: 6px;
  border-radius: 12px;
  background: rgba(17, 19, 34, 0.03);
  border: 1px dashed rgba(17, 19, 34, 0.08);
  text-align: center;
}

body.theme-dark .task-section {
  background: #1d1a2a;
  border-color: #343247;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55);
}
body.theme-dark .section-title,
body.theme-dark .section-title::after {
  background: #1d1a2a;
  border-color: #343247;
}
body.theme-dark .section-title {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}
body.theme-dark .section-empty {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(243, 241, 255, 0.12);
}

/* === Reminder Section (Collapsible) === */
.reminder-section {
  margin-top: 12px;
  margin-bottom: 8px;
}

.reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
  cursor: pointer;
  user-select: none;
}

.reminder-header-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.reminder-toggle {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.7;
}

.reminder-bar {
  display: flex;
  flex-wrap: nowrap; /* Kein Umbruch mehr -> alles in einer Zeile */
  gap: 8px;
  overflow-x: auto; /* Horizontales Scrollen aktivieren */
  /* Edge-to-Edge Effekt: Scrollt bis zum Bildschirmrand */
  margin-left: -16px;
  margin-right: -16px;
  padding: 4px 16px 12px; /* Padding unten, damit Schatten nicht abgeschnitten wird */
  -webkit-overflow-scrolling: touch; /* Weiches Scrollen auf iOS */
  scrollbar-width: none; /* Scrollbar ausblenden (Firefox) */
}

.reminder-bar::-webkit-scrollbar {
  display: none; /* Scrollbar ausblenden (Chrome/Safari) */
}

.reminder-pill {
  flex: 0 0 auto;
  background: var(--panel); /* Fallback */
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  white-space: nowrap; /* Verhindert, dass Text in der Pill umbricht */
  transition: transform 0.1s, box-shadow 0.1s;
  cursor: pointer;
}

.reminder-pill:active { transform: scale(0.98); }

/* Leichter Leucht-Effekt (Hintergrund + Border) je nach Tag */
.reminder-pill.deen {
  background: rgba(22, 165, 138, 0.12);
  border-color: rgba(22, 165, 138, 0.3);
  color: #0f5a4e; /* Dunkleres Grün für Text */
}
.reminder-pill.dunya {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1e40af; /* Dunkleres Blau für Text */
}
.reminder-pill.both {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
  color: #6b21a8; /* Dunkleres Lila für Text */
}

.reminder-pill-text {
  font-weight: 500;
  color: inherit; /* Nimmt die Farbe vom Parent (deen/dunya) an */
}

body.theme-dark .reminder-project {
  border-left-color: #343247;
}

/* Dark Mode Anpassungen für die Pills */
body.theme-dark .reminder-pill.deen {
  background: rgba(39, 196, 165, 0.15);
  border-color: rgba(39, 196, 165, 0.4);
  color: #5eead4;
}
body.theme-dark .reminder-pill.dunya {
  background: rgba(122, 162, 255, 0.15);
  border-color: rgba(122, 162, 255, 0.4);
  color: #93c5fd;
}
body.theme-dark .reminder-pill.both {
  background: rgba(178, 107, 255, 0.15);
  border-color: rgba(178, 107, 255, 0.4);
  color: #d8b4fe;
}

/* === Hifz Stats Card === */
.hifz-stats {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-top: 8px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--deen);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.hifz-stats:active {
  transform: scale(0.98);
}

.hifz-stats__icon { font-size: 24px; }
.hifz-stats__content { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.hifz-stats__top { display: flex; justify-content: space-between; align-items: flex-start; }
.hifz-stats__main { display: flex; align-items: baseline; gap: 6px; }
.hifz-stats__value { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1; }
.hifz-stats__label { font-size: 12px; color: var(--muted); }

.hifz-goal-divider { color: var(--muted); font-weight: 400; font-size: 14px; margin: 0 2px; }
.hifz-goal-total { color: var(--muted); font-size: 14px; font-weight: 500; }

.hifz-goal-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.hifz-goal-btn:hover { opacity: 1; }

.hifz-progress {
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
  margin-bottom: 2px;
}
body.theme-dark .hifz-progress { background: rgba(255,255,255,0.1); }

.hifz-progress-bar {
  height: 100%;
  background: var(--deen);
  border-radius: 99px;
  transition: width 0.4s ease-out;
}

.hifz-stats__breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hifz-pill {
  font-size: 10px;
  background: rgba(22, 165, 138, 0.1);
  color: var(--deen);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
body.theme-dark .hifz-pill {
  background: rgba(39, 196, 165, 0.15);
  color: #5eead4;
}

/* Hifz History List */
.hifz-history-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hifz-history-item:last-child { border-bottom: none; }
.hifz-history-item__content { flex: 1; }
.hifz-history-item__title { font-size: 14px; font-weight: 500; color: var(--ink); }
.hifz-history-item__meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.hifz-undo-btn {
  font-size: 16px;
  color: var(--muted);
}
.hifz-undo-btn:hover { color: var(--ink); background: rgba(0,0,0,0.05); }

/* === Routine Progress Card === */
.routine-progress-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--both);
  cursor: pointer;
}
.routine-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.routine-progress-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.routine-progress-val { font-size: 12px; color: var(--muted); font-weight: 500; }

.routine-onboard-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.routine-onboard-icon { font-size: 24px; }
.routine-onboard-text { font-weight: 600; color: var(--ink); }

/* === Routine Manager === */
.routine-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.routine-days-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.routine-days-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.routine-days-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.routine-days-grid label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
  background: rgba(0,0,0,0.03);
  padding: 4px 8px;
  border-radius: 6px;
}
body.theme-dark .routine-days-grid label { background: rgba(255,255,255,0.05); }

.routine-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.routine-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.routine-item:last-child { border-bottom: none; }
.routine-item__info { display: flex; flex-direction: column; gap: 2px; }
.routine-item__title { font-size: 14px; font-weight: 500; }
.routine-item__days { font-size: 11px; color: var(--muted); }
.routine-item__actions { display: flex; gap: 4px; }

.routine-item .delete-btn {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.routine-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.routine-type-label { font-size: 12px; color: var(--muted); font-weight: 500; }

.routine-sub-input-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.routine-sub-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 13px;
}
.routine-sub-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}

#adhkarModule .routine-add-form {
  background: var(--adhkar-surface);
  border: 1px solid var(--adhkar-outline);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--adhkar-shadow);
}

#adhkarModule .add-sheet__input,
#adhkarModule .add-sheet__select,
#adhkarModule .add-sheet__textarea {
  border-radius: 12px;
  border: 1px solid var(--adhkar-outline);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

#adhkarModule .add-sheet__input:focus,
#adhkarModule .add-sheet__select:focus,
#adhkarModule .add-sheet__textarea:focus {
  outline: none;
  border-color: var(--adhkar-accent);
  box-shadow: 0 0 0 3px rgba(27, 156, 133, 0.12);
}

body.theme-dark #adhkarModule .add-sheet__input,
body.theme-dark #adhkarModule .add-sheet__select,
body.theme-dark #adhkarModule .add-sheet__textarea {
  background: rgba(22, 25, 36, 0.9);
  border-color: rgba(243, 241, 255, 0.12);
}

#adhkarModule .routine-type-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

#adhkarModule .routine-type-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#adhkarModule .mode-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--adhkar-outline);
  background: rgba(0, 0, 0, 0.02);
}

#adhkarModule .mode-switch .pill {
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 6px 8px;
}

#adhkarModule .mode-switch .pill.active {
  background: var(--adhkar-accent);
  color: #fff;
  box-shadow: 0 8px 16px var(--adhkar-glow);
}

body.theme-dark #adhkarModule .mode-switch {
  background: rgba(255, 255, 255, 0.04);
}

#adhkarModule .routine-days-grid {
  gap: 6px;
}

#adhkarModule .routine-days-grid label {
  position: relative;
  background: transparent;
  border: 1px solid var(--adhkar-outline);
  border-radius: 999px;
  padding: 2px 4px;
}

#adhkarModule .routine-days-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#adhkarModule .routine-days-grid label span {
  min-width: 28px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}

#adhkarModule .routine-days-grid input:checked + span {
  background: var(--adhkar-accent);
  color: #fff;
}

#adhkarModule .routine-sub-list li {
  border-bottom: 1px dashed var(--adhkar-outline);
}

#adhkarModule .routine-list {
  gap: 10px;
}

#adhkarModule .routine-item {
  border-radius: 12px;
  border: 1px solid var(--adhkar-outline);
  padding: 10px 12px;
  background: var(--adhkar-surface);
  border-bottom: none;
}

#adhkarModule .routine-item--new {
  border-color: var(--adhkar-accent);
  box-shadow: 0 10px 20px var(--adhkar-glow);
  animation: adhkarNew 0.45s ease;
}

#adhkarModule .routine-item__actions .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--adhkar-outline);
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
}

#adhkarModule .routine-item__actions .edit-btn {
  border-color: rgba(27, 156, 133, 0.35);
  color: var(--adhkar-accent);
}

#adhkarModule .routine-item__actions .delete-btn {
  border-color: rgba(239, 68, 68, 0.35);
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
}

#adhkarModule .routine-form-actions {
  gap: 10px;
}

#adhkarModule .add-sheet__btn {
  border-radius: 12px;
  font-weight: 600;
}

#adhkarModule .add-sheet__btn--primary {
  background: var(--adhkar-accent);
  color: #fff;
}

#adhkarModule .add-sheet__btn--ghost {
  border-color: var(--adhkar-outline);
  color: var(--muted);
}

#adhkarModule .routine-filter-row,
#adhkarModule .adhkar-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

#adhkarModule .routine-filter-row .mode-switch,
#adhkarModule .adhkar-filter-bar .mode-switch {
  flex: 1 1 160px;
}

#adhkarModule .adhkar-status-switch .pill {
  text-align: center;
}

#adhkarModule .adhkar-sort-switch {
  flex: 1 1 220px;
}

#adhkarModule .adhkar-sort-switch .pill {
  width: 100%;
  text-align: center;
}

#adhkarModule .routine-filter-row .add-sheet__select {
  background: rgba(255, 255, 255, 0.96);
  flex: 1 1 200px;
  min-width: 160px;
}

body.theme-dark #adhkarModule .routine-filter-row .add-sheet__select {
  background: rgba(22, 25, 36, 0.9);
}

/* === Adhkar Execution View === */
.adhkar-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adhkar-group {
  background: var(--adhkar-surface);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--adhkar-outline);
  box-shadow: var(--adhkar-shadow);
}

.adhkar-group--solo {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.adhkar-group.is-done {
  border-color: rgba(27, 156, 133, 0.25);
}

.adhkar-group--new {
  border-color: var(--adhkar-accent);
  box-shadow: 0 12px 24px var(--adhkar-glow);
  animation: adhkarNew 0.45s ease;
}

body.theme-dark .adhkar-group {
  background: rgba(22, 25, 36, 0.85);
}

body.theme-dark .adhkar-group.is-done {
  border-color: rgba(44, 209, 178, 0.3);
}

.adhkar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.adhkar-group-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.adhkar-group-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.adhkar-group-state {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--adhkar-accent);
  border: 1px solid rgba(27, 156, 133, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

body.theme-dark .adhkar-group-state {
  border-color: rgba(44, 209, 178, 0.45);
  color: #b4f1e4;
}

.adhkar-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.adhkar-group-expand {
  border: 1px solid var(--adhkar-outline);
  background: transparent;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.adhkar-group-expand svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.adhkar-group-expand.is-collapsed svg {
  transform: rotate(-90deg);
}

.adhkar-group-expand:hover {
  border-color: var(--adhkar-accent);
  color: var(--adhkar-accent);
  background: rgba(27, 156, 133, 0.08);
}

.adhkar-group-expand:focus-visible {
  outline: 2px solid var(--adhkar-accent);
  outline-offset: 2px;
}

.adhkar-group--collapsed .adhkar-list,
.adhkar-group--collapsed .adhkar-notes {
  display: none;
}

.adhkar-group--collapsed {
  padding: 10px 12px;
}

.adhkar-group--collapsed .adhkar-group-title {
  color: var(--ink);
  font-size: 15px;
}

.adhkar-info-btn {
  border: 1px solid var(--adhkar-outline);
  background: transparent;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.adhkar-info-btn:hover {
  border-color: var(--adhkar-accent);
  color: var(--adhkar-accent);
  background: rgba(27, 156, 133, 0.08);
}

.adhkar-info-btn:focus-visible {
  outline: 2px solid var(--adhkar-accent);
  outline-offset: 2px;
}

.adhkar-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adhkar-group--solo .adhkar-list {
  margin-top: 0;
}

.adhkar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--adhkar-outline);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.adhkar-row:focus-within {
  border-color: rgba(27, 156, 133, 0.4);
  box-shadow: 0 0 0 2px rgba(27, 156, 133, 0.12);
}

.adhkar-row--count {
  grid-template-areas:
    "main actions"
    "progress progress";
  align-items: center;
}

.adhkar-row--count .adhkar-row-main { grid-area: main; }
.adhkar-row--count .adhkar-row-actions { grid-area: actions; }
.adhkar-row--count .adhkar-row-progress { grid-area: progress; }

.adhkar-row--count .adhkar-row-main,
.adhkar-row--count .adhkar-row-progress {
  cursor: pointer;
}

body.theme-dark .adhkar-row {
  background: rgba(22, 25, 36, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

body.theme-dark .adhkar-row:focus-within {
  border-color: rgba(44, 209, 178, 0.45);
  box-shadow: 0 0 0 2px rgba(44, 209, 178, 0.2);
}

.adhkar-row--swipe .adhkar-row-main,
.adhkar-row--swipe .adhkar-row-actions,
.adhkar-row--swipe .adhkar-row-progress {
  opacity: 0.2;
  pointer-events: none;
}

.adhkar-swipe {
  position: absolute;
  inset: 6px;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--adhkar-outline);
  background: var(--adhkar-wash);
}

.adhkar-row--swipe .adhkar-swipe {
  display: flex;
}

.adhkar-swipe-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.adhkar-swipe-range {
  flex: 1;
  accent-color: var(--adhkar-accent);
}

.adhkar-swipe-cancel {
  border: 1px solid var(--adhkar-outline);
  background: transparent;
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.adhkar-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adhkar-row-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.adhkar-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.adhkar-row-count {
  font-weight: 600;
  color: var(--ink);
}

.adhkar-row-state {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--adhkar-accent);
  white-space: nowrap;
}

.adhkar-row-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.adhkar-row-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.35) 0 1px,
    transparent 1px 8px
  );
  opacity: 0.3;
}

.adhkar-row-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--adhkar-accent), var(--adhkar-accent-2));
  transition: width 0.25s ease;
  position: relative;
  z-index: 1;
}

body.theme-dark .adhkar-row-progress {
  background: rgba(255, 255, 255, 0.12);
}

.adhkar-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--adhkar-outline);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.adhkar-toggle--group {
  width: 24px;
  height: 24px;
}

.adhkar-toggle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--adhkar-accent);
  transform: scale(0);
  transition: transform 0.2s ease;
}

.adhkar-toggle.is-on {
  border-color: var(--adhkar-accent);
  box-shadow: 0 8px 16px var(--adhkar-glow);
}

.adhkar-toggle.is-on::after {
  transform: scale(1);
}

.adhkar-toggle:active {
  transform: scale(0.95);
}

.adhkar-toggle:focus-visible {
  outline: 2px solid var(--adhkar-accent);
  outline-offset: 2px;
}

.adhkar-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.adhkar-counter-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--adhkar-outline);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.adhkar-counter-btn--primary {
  background: var(--adhkar-accent);
  border-color: var(--adhkar-accent);
  color: #fff;
  box-shadow: 0 8px 16px var(--adhkar-glow);
}

.adhkar-counter-btn:active {
  transform: scale(0.94);
}

.adhkar-counter-btn:focus-visible {
  outline: 2px solid var(--adhkar-accent);
  outline-offset: 2px;
}

body.theme-dark .adhkar-counter-btn {
  background: rgba(22, 25, 36, 0.9);
  border-color: rgba(243, 241, 255, 0.12);
}

.adhkar-row--pulse {
  animation: adhkarPulse 0.3s ease;
}

.adhkar-row.is-done {
  border-color: rgba(27, 156, 133, 0.25);
  box-shadow: 0 10px 18px rgba(27, 156, 133, 0.12);
}

.adhkar-row.is-done .adhkar-row-title {
  color: var(--muted);
}

body.theme-dark .adhkar-row.is-done {
  border-color: rgba(44, 209, 178, 0.3);
  box-shadow: 0 10px 18px rgba(44, 209, 178, 0.18);
}

.adhkar-empty-state {
  text-align: center;
  padding: 24px 20px;
  color: var(--muted);
  background: var(--adhkar-surface);
  border-radius: 16px;
  border: 1px dashed var(--adhkar-outline);
}

.adhkar-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.5;
  animation: adhkarFloat 2.6s ease-in-out infinite;
}

.adhkar-notes {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(27, 156, 133, 0.05);
  border: 1px solid rgba(27, 156, 133, 0.15);
  border-radius: 12px;
}

.adhkar-notes.visible {
  display: block;
  animation: adhkarFadeIn 0.2s ease-out;
}

body.theme-dark .adhkar-notes {
  background: rgba(44, 209, 178, 0.08);
  border-color: rgba(44, 209, 178, 0.18);
}

@keyframes adhkarFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes adhkarViewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes adhkarPulse {
  0% { box-shadow: 0 0 0 0 var(--adhkar-glow); }
  100% { box-shadow: 0 0 0 12px transparent; }
}

@keyframes adhkarNew {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes adhkarFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .adhkar-view,
  .adhkar-group,
  .adhkar-empty-icon {
    animation: none;
  }
  .adhkar-row--pulse {
    animation: none;
  }
  .adhkar-row,
  .adhkar-tab,
  .adhkar-toggle,
  .adhkar-counter-btn,
  .adhkar-row-progress-fill,
  .adhkar-group-expand svg {
    transition: none;
  }
}

@media (max-width: 480px) {
  .adhkar-view {
    padding: 16px 14px 22px;
  }

  .adhkar-group {
    padding: 12px;
  }

  .adhkar-group-title {
    font-size: 13px;
    letter-spacing: 0.03em;
  }

  .adhkar-row {
    padding: 10px;
  }

  .adhkar-row-title {
    font-size: 14px;
  }

  .adhkar-toggle {
    width: 24px;
    height: 24px;
  }

  .adhkar-counter-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}

/* === New Interactive Check Button (Single Item) === */
/* Used for Type A: Routine */
.routine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  padding: 16px 20px;
  border-radius: 18px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  cursor: pointer;
}
.routine-row.done {
  opacity: 0.6;
  background: rgba(0,0,0,0.01);
  box-shadow: none;
  border-color: transparent;
}

.check-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  color: transparent; /* Icon hidden initially */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 16px;
  flex-shrink: 0;
}
.check-btn.checked {
  background: var(--deen);
  border-color: var(--deen);
  color: #fff;
  cursor: pointer;
}

/* === Adhkar Module Tabs === */
.adhkar-module-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 12px auto 10px;
  padding: 4px;
  width: calc(100% - 32px);
  max-width: 560px;
  background: var(--adhkar-surface);
  border: 1px solid var(--adhkar-outline);
  border-radius: 999px;
  box-shadow: var(--adhkar-shadow);
}

.adhkar-tab {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.adhkar-tab:hover { color: var(--ink); }
.adhkar-tab.active {
  background: var(--adhkar-accent);
  color: #fff;
  box-shadow: 0 10px 16px var(--adhkar-glow);
}
.adhkar-tab:focus-visible {
  outline: 2px solid var(--adhkar-accent);
  outline-offset: 2px;
}

body.theme-dark .adhkar-module-tabs {
  background: rgba(20, 22, 32, 0.9);
}

/* === Adhkar Dashboard (Header im Modul) === */
.adhkar-dashboard {
  background: linear-gradient(135deg, var(--adhkar-accent) 0%, var(--adhkar-accent-2) 100%);
  border-radius: 24px;
  padding: 20px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 16px 30px var(--adhkar-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.adhkar-dash-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.adhkar-dash-greeting { font-size: 13px; opacity: 0.9; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.adhkar-dash-title {
  font-family: var(--adhkar-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.adhkar-dash-ring {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.adhkar-dash-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.adhkar-dash-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.adhkar-dash-bg { stroke: rgba(255,255,255,0.2); }
.adhkar-dash-progress { stroke: #fff; transition: stroke-dashoffset 0.5s ease; }
.adhkar-dash-percent { position: absolute; font-size: 14px; font-weight: 700; }

.routine-filter-row {
  margin-bottom: 12px;
}

/* === Full Screen Module === */
.full-screen-module {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden; /* Performance-Optimierung */
}

.full-screen-module.open {
  transform: translateX(0);
  visibility: visible;
}

#adhkarModule {
  font-family: var(--adhkar-sans);
  background: linear-gradient(180deg, var(--adhkar-bg), var(--adhkar-wash));
  color: var(--ink);
  overflow: hidden;
}

body.theme-dark #adhkarModule {
  background: linear-gradient(180deg, var(--adhkar-bg), var(--adhkar-wash));
}

#adhkarModule .module-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--adhkar-outline);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

body.theme-dark #adhkarModule .module-header {
  background: rgba(14, 16, 24, 0.92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

#adhkarModule .module-title {
  font-family: var(--adhkar-display);
  letter-spacing: 0.01em;
  font-size: 17px;
  font-weight: 600;
}

#adhkarModule .module-close-btn {
  background: transparent;
  border: 1px solid var(--adhkar-outline);
  width: 34px;
  height: 34px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

#adhkarModule .module-close-btn:hover {
  background: rgba(17, 19, 34, 0.08);
  border-color: rgba(17, 19, 34, 0.2);
  transform: translateY(-1px);
}

body.theme-dark #adhkarModule .module-close-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(243, 241, 255, 0.12);
}

#adhkarModule .module-content {
  padding-bottom: 24px;
}

#adhkarModule button,
#adhkarModule input,
#adhkarModule select,
#adhkarModule textarea {
  font-family: var(--adhkar-sans);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.module-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-logo {
  width: 28px;
  height: 28px;
  font-size: 14px; /* Fallback text size */
}

.module-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.module-close-btn {
  font-size: 18px;
  background: rgba(0,0,0,0.05);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
}

.module-content {
  flex: 1;
  overflow-y: auto;
  padding: 0; /* Padding moved to inner views */
  width: 100%;
}

.adhkar-view {
  padding: 18px 16px 24px;
  max-width: 600px;
  margin: 0 auto;
  animation: adhkarViewIn 0.35s ease;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-top: 8px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}
body.theme-dark .task-card,
body.theme-dark .project-card {
  background: #1d1a2a;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.65);
}
.task-card.tag-deen { border-left-color: var(--deen); }
.task-card.tag-dunya { border-left-color: var(--dunya); }
.task-card.tag-both { border-left-color: var(--both); }
.task-card--done { opacity: 0.5; }

.task-check input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  position: relative;
  cursor: pointer;
}
.task-check input[type="checkbox"]:checked {
  background: var(--ink);
  border-color: var(--ink);
}
.task-check input[type="checkbox"]:checked::after {
  content: "✓";
  font-size: 13px;
  color: #fff;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-title { font-size: 14px; font-weight: 500; }
.task-title.completed { text-decoration: line-through; color: var(--muted); }
.task-project { font-size: 11px; color: var(--muted); }

.project-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 Spalten */
  gap: 12px;
  padding-bottom: 16px;
}

.project-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--line); /* Oben statt links für Karteikarten-Look */
  border-left: none;
  display: flex;
  flex-direction: column; /* Untereinander statt nebeneinander */
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 100px; /* Mindesthöhe für einheitlichen Look */
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  min-width: 0;
}

.project-card:active { transform: scale(0.98); }

.project-card--deen { border-top-color: var(--deen); }
.project-card--dunya { border-top-color: var(--dunya); }
.project-card--both { border-top-color: var(--both); }

.project-card--active {
  /* Im Detail-Modus sieht die Karte etwas anders aus */
  cursor: default;
  transform: none !important;
  margin-bottom: 16px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

body.theme-dark .project-card--active {
  border-color: #343247;
  border-top-color: inherit; /* Farbe oben behalten */
}

.project-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.project-icon {
  font-size: 22px;
  line-height: 1;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
}

.project-actions {
  display: flex;
  flex-direction: row;
  gap: 4px;
}

.project-badge {
  background: var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.project-back-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  padding: 0;
}
.project-back-btn:hover {
  color: var(--ink);
}

.project-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.project-add-task-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

body.theme-dark .project-add-task-btn {
  background: #1d1a2a;
  border-color: #343247;
}

/* Projekt-Label unter Tasks farbig nach Kategorie */
.task-project--deen {
  color: var(--deen);
}

.task-project--dunya {
  color: var(--dunya);
}

.task-project--both {
  color: var(--both);
}

/* optional: eigenes Styling für das Project-Sheet */
.project-sheet .add-sheet__panel {
  border-radius: 24px 24px 0 0;
}

.section-chip {
  align-self: flex-start;
  margin-top: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.task-actions { display: flex; flex-direction: column; gap: 4px; }
.icon-btn {
  border-radius: 999px;
  border: none;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

/* Zeile unter dem Titel: Section-Chip + Info-Icon */
.task-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Rechts ausgerichtete Button-Gruppe in der Meta-Zeile */
.task-meta-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Copy-Button im gleichen Stil wie Info-Pill */
.task-copy-inline-btn {
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  cursor: pointer;
}

.task-copy-inline-btn:hover {
  background: rgba(148, 163, 184, 0.2);
}

body.theme-dark .task-copy-inline-btn {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(148, 163, 184, 0.18);
  color: #e5e7eb;
}

/* Info-Button in der Meta-Zeile – kleiner, dezent */
.info-btn--inline {
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 159, 64, 0.7);       /* Orange-Outline */
  background: rgba(255, 159, 64, 0.12);            /* leicht orange hinterlegt */
  color: #ff9f40;
  box-shadow: 0 0 0 1px rgba(255, 159, 64, 0.15);  /* leichter Glow-Effekt */
}

/* „Icon“ inside – drei Punkte als Detail-Icon */
.info-btn--inline::before {
  content: "i"; /* Explizites i statt Punkte */
  font-weight: 600;
  font-size: 11px;
  font-family: serif;
}

body.theme-dark .info-btn--inline {
  border-color: rgba(255, 184, 90, 0.9);
  background: rgba(255, 184, 90, 0.18);
  color: #ffd48a;
  box-shadow: 0 0 0 1px rgba(255, 184, 90, 0.35);
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 40px rgba(15,23,42,0.48);
  cursor: pointer;
  z-index: 30;
}

body.theme-dark .fab {
  background: #c6c1ea;
  color: #000000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

.snackbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med), transform var(--transition-med);
  z-index: 40;
}
body.theme-dark .snackbar {
  background: #696391;
}
.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 18, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 35;
}
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.add-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  transform: translateY(100%);
  transition: transform var(--transition-med);
  z-index: 36;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.add-sheet.open {
  transform: translateY(0%);
  pointer-events: auto;
}

.add-sheet__panel {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -14px 30px rgba(15,23,42,0.4);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
}

.add-sheet__header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
}
.add-sheet__title { font-size: 15px; font-weight: 600; margin: 4px 0; }

.add-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.add-sheet__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.add-sheet__label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.add-sheet__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.add-sheet__add-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 6px;
  cursor: pointer;
  height: 20px;
  display: flex;
  align-items: center;
}
.add-sheet__add-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.add-sheet__input,
.add-sheet__select {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 14px;
  background: var(--panel);
  color: var(--ink);
}
body.theme-dark .add-sheet__input,
body.theme-dark .add-sheet__select {
  background: #1d1a2a;
  border-color: #343247;
  color: var(--ink);
}

.add-sheet__textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.4;
}

@media (max-width: 600px) {
  /* Alle Form-Controls auf 16px, damit iOS nicht zoomt */
  input,
  textarea,
  select {
    font-size: 13px !important;
  }

  /* Optimierung für kleine Screens: Platz sparen */
  .search-row {
    gap: 4px;
  }
  .sort-select {
    max-width: 90px; /* Filter etwas kompakter machen */
    padding: 6px 6px;
  }
}

.add-sheet__pill-group { display: flex; gap: 6px; flex-wrap: wrap; }

.add-sheet__footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.add-sheet__btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 16px;
  font-size: 14px;
  cursor: pointer;
}

.add-sheet__btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.add-sheet__btn--primary {
  background: var(--ink);
  color: #fff;
}

body.theme-dark .add-sheet__btn--primary {
  color: #050509;
}

.add-sheet__field--reminder { display: none; }
.add-sheet.add-sheet--reminder .add-sheet__field--tab,
.add-sheet.add-sheet--reminder .add-sheet__field--section {
  display: none;
}
.add-sheet.add-sheet--reminder .add-sheet__field--reminder {
  display: flex;
}

/* Projekt-Feld: standardmäßig sichtbar, auch für Aufgaben */
.add-sheet__field--project {
  display: flex;
}

.add-sheet__field--project.add-sheet__field--project-locked select {
  opacity: 0.72;
}

.add-sheet__pill-group--locked {
  opacity: 0.55;
}

.add-sheet.add-sheet--reminder .add-sheet__field--project {
  display: flex;
}

/* Notes-Feld bei Reminder ausblenden */
.add-sheet.add-sheet--reminder .add-sheet__field--notes {
  display: none;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,14,18,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 37;
}
.confirm-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-med), transform var(--transition-med);
  z-index: 38;
}
.confirm-dialog.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.confirm-dialog__panel {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px 10px;
  max-width: 320px;
  width: calc(100% - 48px);
}
.confirm-dialog__text { margin: 0 0 10px; font-size: 14px; }
.confirm-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-dialog__btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.confirm-dialog__btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.confirm-dialog__btn--danger {
  background: #dc2626;
  color: #fff;
}
.confirm-dialog__btn--primary {
  background: var(--ink);
  color: #fff;
}

.info-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 18, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 37;
}

.info-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.info-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-med), transform var(--transition-med);
  z-index: 38;
}

.info-dialog.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.info-dialog__panel {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
  max-width: 360px;
  width: calc(100% - 48px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.info-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.info-dialog__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.info-dialog__body {
  overflow-y: auto;
  padding-right: 2px;
}

.info-dialog__content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.info-dialog__content a {
  color: var(--dunya);
  text-decoration: underline;
}

.info-dialog__close {
  flex-shrink: 0;
}

.info-dialog__footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.info-dialog__btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.info-dialog__btn--danger {
  background: #dc2626;
  color: #fff;
}

body.theme-dark .info-dialog__btn--danger {
  background: #ef4444;
  color: #fff;
}

body.theme-dark .confirm-dialog__btn--primary {
  background: #f3f1ff;
  color: #050509;
}


/* === Save-FAB unten links (Export / Import) === */

.fab-save {
  position: fixed;
  left: 20px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--panel);
  color: var(--ink);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  z-index: 30;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity var(--transition-med),
    transform var(--transition-med),
    box-shadow var(--transition-med),
    background var(--transition-med),
    color var(--transition-med);
}

/* Sichtbar erst, wenn JS .fab-save--visible setzt */
.fab-save.fab-save--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fab-save:hover {
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);
}

body.theme-dark .fab-save {
  background: #1d1a2a;
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
}

/* Damit sich Plus-FAB und Save-FAB nicht beißen */
@media (max-width: 380px) {
  .fab-save {
    left: 14px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 520px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* === Save-Menü (Export / Import) === */

.save-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 18, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 37;
}
.save-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.save-menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--transition-med),
    transform var(--transition-med);
  z-index: 38;
}

.save-menu.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.save-menu__panel {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 38px rgba(15, 23, 42, 0.5);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Header oben: Titel + Close-X */
.save-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.save-menu__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.save-menu__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.save-menu__section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.save-menu__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
}

.save-menu__row label {
  font-size: 12px;
  color: var(--muted);
}

.save-menu__row--file {
  justify-content: space-between;
  flex-wrap: wrap;
}

.save-menu__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.save-menu__row--font {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.save-menu-font-switch {
  width: 100%;
}

.save-menu__panel select,
.save-menu__panel input[type="file"] {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  max-width: 100%;
}

body.theme-dark .save-menu__panel select,
body.theme-dark .save-menu__panel input[type="file"] {
  background: #1d1a2a;
  border-color: #343247;
}

.save-menu__panel input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

/* Buttons im Save-Menü */

.save-menu__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.save-menu__btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.save-menu__btn--primary {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.save-menu__btn--danger {
  background: #dc2626;
  color: #fff;
  border-color: transparent;
}

.save-menu__btn:hover {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

body.theme-dark .save-menu__btn {
  background: #1d1a2a;
  border-color: #343247;
}

body.theme-dark .save-menu__btn--primary {
  background: #f3f1ff;
  color: #050509;
}

body.theme-dark .save-menu__btn--danger {
  background: #ef4444;
  color: #fff;
}

/* Close-Icon oben rechts im Panel */
.save-menu__close-btn {
  border-radius: 999px;
  border: none;
  background: transparent;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
}

.save-menu__close-btn:hover {
  color: var(--ink);
}

/* Kleiner roter Delete-Button im Add-Sheet (nur bei Reminder-Edit sichtbar) */
.add-sheet-delete-btn {
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: none; /* Standard: versteckt – wird per JS auf inline-flex gesetzt */
  align-items: center;
  justify-content: center;
  margin-right: auto; /* schiebt Cancel/Speichern nach rechts */
  background: #fee2e2;
  color: #b91c1c;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.26);
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.add-sheet-delete-btn:hover {
  background: #fecaca;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}

body.theme-dark .add-sheet-delete-btn {
  background: #7f1d1d;
  color: #fee2e2;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
}

body.theme-dark .add-sheet-delete-btn:hover {
  background: #991b1b;
}

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.help-overlay.open {
  display: flex;
}

.help-overlay__inner {
  max-width: 720px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 24px 20px 20px;
  background: var(--surface, #111822);
  color: var(--text, #f5f5f5);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.help-overlay__title {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.help-overlay__lead {
  font-size: 0.95rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

.help-overlay__section {
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.help-overlay__section h2 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.help-overlay__section p {
  margin: 0;
}

.help-overlay__section ul {
  margin: 6px 0 0 18px;
  padding: 0;
  font-size: 0.9rem;
}

.help-overlay__alpha {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 6px;
}

.help-overlay__close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.help-overlay__start {
  margin-top: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Topbar Help-Button */
.topbar-help-btn {
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
}

body.no-scroll-help {
  overflow: hidden;
}

/* Intro-Hilfe: Sprachumschaltung */

/* Wenn AR aktiv → deutsche Teile verstecken */
body.lang-ar .help-overlay__section--de,
body.lang-ar .help-overlay__install--de {
  display: none;
}

/* Wenn AR NICHT aktiv → arabische Teile verstecken */
body:not(.lang-ar) .help-overlay__section--ar,
body:not(.lang-ar) .help-overlay__install--ar {
  display: none;
}

/* === Language toggle & RTL support for Arabic === */

/* When app is in Arabic, use RTL layout */
html[lang="ar"] body {
  direction: rtl;
}

/* Reverse some core layout rows so the flow feels natural in RTL */
html[lang="ar"] .app-header,
html[lang="ar"] .tab-mode-row,
html[lang="ar"] .mode-row,
html[lang="ar"] .search-row {
  flex-direction: row-reverse;
}

html[lang="ar"] .topbar:not(.topbar--compact) {
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "tab-mode-row app-header"
    "search-row search-row";
}

/* Correct alignment for header right group in RTL */
html[lang="ar"] .app-header-right {
  margin-left: 0;
  margin-right: auto;
}

html[lang="ar"] .topbar--compact .app-header-left {
  grid-column: 3;
}

html[lang="ar"] .topbar--compact .app-header-right {
  grid-column: 1;
}

/* Text alignment for main titles, sections & items in Arabic */
html[lang="ar"] .app-title-group,
html[lang="ar"] .section-title,
html[lang="ar"] .task-title,
html[lang="ar"] .task-project,
html[lang="ar"] .project-title,
html[lang="ar"] .project-meta,
html[lang="ar"] .adhkar-group-title,
html[lang="ar"] .adhkar-row-title,
html[lang="ar"] .adhkar-row-meta {
  text-align: right;
}

/* Inputs / textareas: align text to the right in Arabic mode */
html[lang="ar"] .search-input,
html[lang="ar"] .add-sheet__input,
html[lang="ar"] .add-sheet__textarea {
  text-align: right;
}

/* Optional: make the language toggle look a bit tighter in Arabic */
html[lang="ar"] #langToggle {
  letter-spacing: 0.06em;
}
