/* ============================================================
   COMPONENTS.CSS — Проект «Икра» · v413
   ============================================================ */

/* === READ / ARABIC === */
.read-ayah-ar { 
  font-size: calc(var(--fs-ar) * var(--ar-scale)); 
  line-height: 2; 
  direction:rtl; 
  text-align:right; 
  padding: 8px 0; 
  margin-bottom: 12px; 
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3); 
  overflow-wrap: break-word; 
  word-break: normal; 
  word-spacing: normal; 
  letter-spacing: normal; 
  width: 100%; 
  max-width: 100%; 
  box-sizing: border-box; 
  display: block; 
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* === CARDS (Геометрия: отступы и защита от вылезания текста) === */
.content-card, .tasbih-card, .detail-hero, .settings-group, .bismillah-card, .modal, .read-ayah, .dash-quote, .dash-progress, .dash-greeting, .dash-stats, .dash-quick, .continue-card, .daily-goal, .cal-grid, .bar-chart, .stat, .stat-card, .spiritual-card, .mem-block { 
  border: 1px solid rgba(212,175,55,.25); 
  box-shadow: 0 4px 12px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.5); 
  background: var(--card); 
  border-radius: 20px; 
  padding: 24px 20px;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
[data-theme="dark"] .content-card, [data-theme="mono"] .content-card,
[data-theme="dark"] .tasbih-card, [data-theme="mono"] .tasbih-card,
[data-theme="dark"] .dash-quote, [data-theme="mono"] .dash-quote,
[data-theme="dark"] .dash-progress, [data-theme="mono"] .dash-progress,
[data-theme="dark"] .dash-quick, [data-theme="mono"] .dash-quick,
[data-theme="dark"] .dash-stats, [data-theme="mono"] .dash-stats,
[data-theme="dark"] .continue-card, [data-theme="mono"] .continue-card,
[data-theme="dark"] .read-ayah, [data-theme="mono"] .read-ayah,
[data-theme="dark"] .detail-hero, [data-theme="mono"] .detail-hero,
[data-theme="dark"] .bismillah-card, [data-theme="mono"] .bismillah-card,
[data-theme="dark"] .spiritual-card, [data-theme="mono"] .spiritual-card,
[data-theme="dark"] .mem-block, [data-theme="mono"] .mem-block,
[data-theme="dark"] .daily-goal, [data-theme="mono"] .daily-goal,
[data-theme="dark"] .bar-chart, [data-theme="mono"] .bar-chart,
[data-theme="dark"] .stat, [data-theme="mono"] .stat,
[data-theme="dark"] .stat-card, [data-theme="mono"] .stat-card,
[data-theme="dark"] .dash-greeting, [data-theme="mono"] .dash-greeting,
[data-theme="dark"] .settings-group, [data-theme="mono"] .settings-group,
[data-theme="dark"] .cal-grid, [data-theme="mono"] .cal-grid,
[data-theme="dark"] .modal, [data-theme="mono"] .modal {
  background: var(--card);
  border: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .content-card,
  html:not([data-theme]) .tasbih-card,
  html:not([data-theme]) .dash-quote,
  html:not([data-theme]) .dash-progress,
  html:not([data-theme]) .dash-quick,
  html:not([data-theme]) .dash-stats,
  html:not([data-theme]) .continue-card,
  html:not([data-theme]) .read-ayah,
  html:not([data-theme]) .detail-hero,
  html:not([data-theme]) .bismillah-card,
  html:not([data-theme]) .spiritual-card,
  html:not([data-theme]) .mem-block,
  html:not([data-theme]) .daily-goal,
  html:not([data-theme]) .bar-chart,
  html:not([data-theme]) .stat,
  html:not([data-theme]) .stat-card,
  html:not([data-theme]) .dash-greeting,
  html:not([data-theme]) .settings-group,
  html:not([data-theme]) .cal-grid,
  html:not([data-theme]) .modal {
    background: var(--card);
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
}

/* === PROGRESS BARS === */
.top-progress > div { height:100%; width:100%; transform: scaleX(0); transform-origin: left center; background: var(--gold-standard); transition: transform .3s ease; }
.dg-bar { height:8px; background:var(--card2); border-radius:4px; overflow:hidden; }
.dg-bar > div { height:100%; width:100%; transform: scaleX(0); transform-origin: left center; background:var(--accent); border-radius:4px; transition: transform .4s ease; }
.dash-progress .dp-bar { height:8px; background:var(--card2); border-radius:4px; overflow:hidden; margin-bottom: var(--space-2); }
.dash-progress .dp-bar > div { height:100%; width:100%; transform: scaleX(0); transform-origin: left center; background:var(--accent); border-radius:4px; transition: transform .4s ease; }
.mem-progress { height:4px; background:var(--card2); border-radius:2px; margin-bottom: var(--space-3); overflow:hidden; }
.mem-progress > div { height:100%; width:100%; transform: scaleX(0); transform-origin: left center; background:var(--accent); transition: transform .3s ease; }
.bar-chart .bars { display:flex; align-items:flex-end; gap:2px; height:100px; }
.bar-chart .bar { flex:1; height:100%; background:var(--accent); border-radius:3px 3px 0 0; transform: scaleY(0); transform-origin: bottom center; transition: transform .3s ease; }

/* === BUTTONS (v413) ===
   Единый блок вместо трёх наслоённых. Без !important: приоритет задаёт
   специфичность и ПОРЯДОК правил (hover, active, secondary, theme, danger). */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 48px; padding: 14px 18px; margin-bottom: var(--space-2);
  border-radius: 14px; font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.005em;
  background: var(--gold-gradient); color: #1c1917;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 13px rgba(212, 175, 55, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 17px rgba(212, 175, 55, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.52); }
.btn:active { transform: translateY(2px); box-shadow: var(--shadow-button-active); transition-duration: 60ms; }

/* Outline-кнопки (Читать суру полностью, Назад и т.д.) */
.btn.secondary, .btn-inline, .show-all-btn {
  background: transparent; color: var(--gold-text-light);
  border: 1.5px solid var(--gold-fill); box-shadow: none; font-weight: 650;
  transition: background 0.2s ease, transform 0.2s ease;
}
/* Тёмная, mono и системная тёмная темы: светлое золото, не чёрный на чёрном */
[data-theme="dark"] .btn.secondary, [data-theme="dark"] .btn-inline, [data-theme="dark"] .show-all-btn,
[data-theme="mono"] .btn.secondary, [data-theme="mono"] .btn-inline, [data-theme="mono"] .show-all-btn {
  color: var(--gold-text-dark); border-color: var(--gold-text-dark);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .btn.secondary, html:not([data-theme]) .btn-inline, html:not([data-theme]) .show-all-btn {
    color: var(--gold-text-dark); border-color: var(--gold-text-dark);
  }
}
.btn.secondary:hover, .btn-inline:hover, .show-all-btn:hover { background: rgba(212, 175, 55, 0.05); transform: translateY(-1px); }
.btn.secondary:active, .btn-inline:active, .show-all-btn:active { transform: scale(0.98); background: rgba(212, 175, 55, 0.1); }

.btn.danger { background: transparent; color: #ff4d4d; border: 1.5px solid rgba(255, 77, 77, 0.3); box-shadow: none; }

/* === FAB === */
.fab { position:fixed; right:24px; bottom:calc(100px + var(--nav-safe)); width:60px; height:60px; border-radius:50%; background: var(--gold-gradient); color:#0A0A0A; font-size:30px; display:flex; align-items:center; justify-content:center; box-shadow: 0 4px 15px rgba(212,175,55,0.4); z-index:100; transition: transform var(--dur-fast); border: 1px solid rgba(255,255,255,0.4); }
.fab:active { transform:scale(.92); }

/* === ICONS === */
.icon-btn { width:42px; height:42px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--card); color:var(--gold-standard); border: 1px solid rgba(212,175,55,0.2); }
.icon-btn:active { background:var(--card2); transform:scale(.95); }
.icon-btn.ghost { background:transparent; border:none; }
.btn svg, .btn-inline svg, .show-all-btn svg { color: inherit; fill: currentColor; stroke: currentColor; }
.btn svg.ico, .btn-inline svg.ico, .show-all-btn svg.ico { fill: none; stroke: currentColor; }
.ico { display: inline-block; width: clamp(20px, 6vw, 28px); height: clamp(20px, 6vw, 28px); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }

/* === SEARCH === */
.search-wrap { flex:1; min-width:160px; position:relative; }
.search-wrap input { width:100%; background:var(--card); border:1px solid var(--border); border-radius:16px; padding:11px var(--space-3) 11px 38px; font-size: var(--fs-sm); outline:none; }
.sort-select { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:11px 12px; font-size: var(--fs-sm); outline:none; min-width:110px; -webkit-appearance:none; appearance:none; text-align:center; }

/* === DAILY GOAL === */
.daily-goal { background:var(--card); border-radius:var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); box-shadow:0 2px 8px var(--shadow); }
.daily-goal .dg-top { display:flex; justify-content:space-between; align-items:baseline; margin-bottom: var(--space-2); gap: var(--space-2); flex-wrap:wrap; }
.daily-goal .dg-label { font-size: var(--fs-sm); color:var(--muted); }
.daily-goal .dg-num { font-size: var(--fs-lg); font-weight:700; font-variant-numeric:tabular-nums; }
.daily-goal .dg-num span { color:var(--muted); font-weight:400; font-size: var(--fs-sm); }

/* === CONTINUE CARD === */
.continue-card { 
  background:linear-gradient(135deg, rgba(var(--accent-rgb), .18), rgba(var(--accent-rgb), .06)); 
  border:1px solid var(--border); 
  border-radius:var(--radius); 
  padding: var(--space-3); 
  margin-bottom: var(--space-3); 
  cursor:pointer; 
  box-shadow:0 2px 8px var(--shadow); 
  min-height: 84px; 
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.continue-card:active { transform:scale(.98); }
.continue-card .cc-label { font-size: var(--fs-xs); color:var(--accent); text-transform:uppercase; letter-spacing:.5px; font-weight:700; margin-bottom:4px; }
.continue-card .cc-title { font-size: var(--fs-lg); font-weight:700; margin-bottom:2px; }
.continue-card .cc-sub { font-size: var(--fs-xs); color:var(--muted); }

/* === TASBIH CARD === */
.tasbih-card { background:var(--card); border-radius:var(--radius); padding: var(--space-3); margin-bottom: var(--space-2); cursor:pointer; display:flex; align-items:center; gap: var(--space-3); position:relative; transition: transform .2s ease; width:100%; max-width:100%; box-sizing:border-box; }
.tasbih-card:active { transform:scale(.98); }
.tasbih-card .body { flex:1; min-width:0; overflow-wrap: break-word; }
.tasbih-card .ar { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height:2; direction:rtl; text-align:right; margin-bottom:6px; padding-top: 4px; overflow-wrap: break-word; }
.tasbih-card .tr { font-size: var(--fs-sm); color:var(--muted); margin-bottom:1px; overflow-wrap: break-word; }
.tasbih-card .trn { font-size: var(--fs-sm); color:var(--muted); margin-bottom: var(--space-2); overflow-wrap: break-word; }
.tasbih-card .p-row { display:flex; justify-content:space-between; font-size: var(--fs-xs); color:var(--muted); margin-bottom:6px; gap: var(--space-2); flex-wrap:wrap; }
.tasbih-card .today-badge { position:absolute; top:12px; left:12px; background:var(--accent); color:var(--bg); font-size:10px; font-weight:700; padding:2px 7px; border-radius:8px; }
.tasbih-card.dragging { opacity:.6; box-shadow:0 12px 32px var(--shadow); transform:scale(1.02); pointer-events:none; }
.mini-ring { position:relative; width:52px; height:52px; flex-shrink:0; margin-top: 8px; }
.mini-ring svg { transform:rotate(-90deg); }
.mini-ring .ring-bg { stroke:var(--card2); }
.mini-ring .ring-fg { stroke:var(--accent); transition: stroke-dashoffset .35s ease; }
.mini-ring .ring-num { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size: var(--fs-xs); font-weight:700; }

/* === EMPTY === */
.empty { text-align:center; color:var(--muted); padding:60px var(--space-4); font-size: var(--fs-md); line-height:1.6; }

/* === COUNTER === */
.counter .ar { font-size: calc(var(--fs-ar-lg) * var(--ar-scale)); direction:rtl; padding:6px 0 16px 0; margin:0; max-width:90%; overflow-wrap: break-word; word-break: normal; }
.counter .tr { font-size: var(--fs-md); color:var(--muted); margin-bottom:4px; overflow-wrap: break-word; }
.counter .trn { font-size: var(--fs-sm); color:var(--muted); margin-bottom:20px; overflow-wrap: break-word; }
.counter .ring-wrap { position:relative; width:240px; height:240px; margin:8px 0; flex-shrink:0; }
.counter .ring-wrap svg { width:100%; height:100%; transform:rotate(-90deg); }
.counter .ring-bg { stroke:var(--card2); }
.counter .ring-fg { stroke:var(--accent); transition: stroke-dashoffset .35s ease; }
.counter .num { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:76px; font-weight:700; letter-spacing:-2px; }
.counter .num.pulse { animation:pulse .3s ease-out; }
@keyframes pulse { 0%{transform:scale(1);} 50%{transform:scale(1.06);} 100%{transform:scale(1);} }
.counter .num.done { color:var(--accent); }
.counter .target-label { font-size: var(--fs-sm); color:var(--muted); margin-top:8px; }
.counter .cycles { margin-top:14px; font-size: var(--fs-sm); color:var(--muted); }
.ripple { position:absolute; border-radius:50%; background:var(--ripple); pointer-events:none; width:120px; height:120px; transform:translate(-50%,-50%) scale(0); animation:ripple .55s ease-out; }
@keyframes ripple { to { transform:translate(-50%,-50%) scale(3.5); opacity:0; } }

/* === NEXT TOAST === */
.next-toast { position:fixed; left: var(--space-3); right: var(--space-3); bottom:calc(110px + env(safe-area-inset-bottom)); background:var(--card); border:1px solid var(--border); border-radius:16px; padding: var(--space-3); display:flex; align-items:center; gap: var(--space-3); box-shadow:0 8px 24px var(--shadow); z-index:50; transform:translateY(400%); transition: transform .35s ease; pointer-events:none; }
.next-toast.show { transform:translateY(0); pointer-events:auto; }
.next-toast .nt-label { font-size: var(--fs-xs); color:var(--muted); margin-bottom:2px; }
.next-toast .nt-name { font-size: var(--fs-md); font-weight:600; }
.next-toast .nt-ar { font-size: calc(var(--fs-ar) * var(--ar-scale) * 0.7); direction:rtl; margin-left:auto; overflow-wrap: break-word; }
.next-toast .nt-btn { width:36px; height:36px; border-radius:50%; background: var(--gold-gradient); color:#0A0A0A; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }

/* === FORMS === */
.field { margin-bottom: var(--space-3); }
.field label { display:block; font-size: var(--fs-sm); color:var(--muted); margin-bottom: var(--space-2); padding-left:4px; }
.field input, .field textarea, .field select { width:100%; background:var(--card); border:1px solid var(--border); border-radius:16px; padding: var(--space-3); font-size: var(--fs-md); outline:none; }
.field input:focus, .field textarea:focus { border-color:var(--accent); }
.field textarea { resize:none; min-height:78px; direction:rtl; font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height:2; overflow-wrap: break-word; }
.preview-card { background:var(--card); border-radius:var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); border:1px dashed var(--border); }
.preview-card .pv-label { font-size: var(--fs-xs); color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom: var(--space-2); }
.preview-card .pv-ar { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height:2; direction:rtl; text-align:right; margin-bottom:6px; min-height:1.8em; overflow-wrap: break-word; }
.preview-card .pv-tr { font-size: var(--fs-sm); color:var(--muted); min-height:1.2em; overflow-wrap: break-word; }
.preview-card .pv-trn { font-size: var(--fs-sm); color:var(--muted); margin-top:2px; min-height:1.2em; overflow-wrap: break-word; }
.presets { display:flex; flex-wrap:wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.preset-chip { padding: var(--space-2) var(--space-3); border-radius:24px; background:var(--card); border:1px solid var(--border); font-size: var(--fs-sm); }
.preset-chip:active { background:var(--card2); }
.stepper { display:flex; align-items:center; background:var(--card); border:1px solid var(--border); border-radius:16px; overflow:hidden; }
.stepper button { width:56px; height:52px; font-size:22px; flex-shrink:0; }
.stepper button:active { background:var(--card2); }
.stepper input { flex:1; text-align:center; background:transparent; border:none; font-size: var(--fs-lg); font-weight:600; outline:none; -moz-appearance:textfield; min-width:0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

/* === PROGRESS TABS === */
.prog-tabs { display:flex; gap:4px; background:var(--card2); border-radius:12px; padding:3px; margin-bottom: var(--space-3); }
.prog-tabs button { flex:1; padding:9px 6px; border-radius:9px; font-size: var(--fs-xs); color:var(--muted); font-weight:600; }
.prog-tabs button.active { background:var(--card); color:var(--text); }

/* === CALENDAR === */
.cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--space-2); gap: var(--space-2); flex-wrap:wrap; }
.cal-header .month { font-size: var(--fs-lg); font-weight:600; }
.cal-nav { display:flex; gap:6px; }
.cal-nav button { width:36px; height:36px; border-radius:50%; background:var(--card); color:var(--text); display:flex; align-items:center; justify-content:center; font-size: var(--fs-md); border:1px solid var(--border); }
.cal-dow { text-align:center; font-size: var(--fs-xs); color:var(--muted); padding:4px 0; font-weight:600; }
.cal-day { aspect-ratio:1; display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:8px; font-size: var(--fs-sm); cursor:pointer; }
.cal-day.empty { visibility:hidden; }
.cal-day .cnt { font-size:9px; color:var(--accent); font-weight:700; margin-top:1px; }
.cal-day.has-count { background:rgba(var(--accent-rgb), .12); }
.cal-day.today { outline:1.5px solid var(--accent); outline-offset:-2px; }
.cal-day.future { color:var(--border); }
.bar-chart { background:var(--card); border-radius:16px; padding: var(--space-3); margin-top: var(--space-3); }
.bar-chart .bc-title { font-size: var(--fs-sm); color:var(--muted); margin-bottom: var(--space-2); font-weight:600; }
.bar-chart .x-axis { display:flex; gap:2px; margin-top:6px; }
.bar-chart .x-axis span { flex:1; font-size:9px; text-align:center; color:var(--muted); }
.cal-summary { margin-top: var(--space-3); display:grid; grid-template-columns:1fr 1fr; gap: var(--space-2); }
.stat { background:var(--card); border-radius:16px; padding: var(--space-3); }
.stat .label { font-size: var(--fs-xs); color:var(--muted); margin-bottom:6px; }
.stat .value { font-size: var(--fs-xl); font-weight:700; }

/* === CONTENT CARD === */
.content-card { background:var(--card); border-radius:var(--radius); padding: 24px 20px; margin-bottom: var(--space-2); cursor:pointer; position:relative; width:100%; max-width:100%; box-sizing:border-box; }
.content-card:active { transform:scale(.98); }
.content-card .c-badge { position:absolute; top:16px; right:56px; font-size:10px; font-weight:700; padding:3px 9px; border-radius:8px; background:rgba(var(--accent-rgb), .15); color:var(--accent); }
.content-card .star-btn { position:absolute; top:12px; right:12px; width:34px; height:34px; padding:0; border-radius:50%; background:rgba(var(--accent-rgb),.10); display:flex; align-items:center; justify-content:center; font-size:17px; color:var(--muted); cursor:pointer; z-index:2; transition: transform var(--dur-fast) var(--ease-out); }
.content-card .star-btn.active { color: var(--gold-star); background: var(--gold-gradient); }
.icon-btn.starred { color:var(--gold-star); }
.content-card .c-num { position:absolute; top:16px; left:16px; width:34px; height:34px; border-radius:50%; background:rgba(var(--accent-rgb), .15); color:var(--accent); font-size: var(--fs-sm); font-weight:700; display:flex; align-items:center; justify-content:center; }
.content-card .c-title { font-size: var(--fs-md); font-weight:700; margin-bottom:4px; padding-right:110px; }
.content-card.has-num .c-title { margin-left:46px; }
.content-card .c-sub { font-size: var(--fs-xs); color:var(--muted); margin-bottom: var(--space-2); }
.content-card.has-num .c-sub { margin-left:46px; }
.content-card .c-ar { padding: 0; font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height:2; direction:rtl; text-align:right; margin-bottom: var(--space-2); max-height: 2.2em; overflow: hidden; text-overflow: clip; overflow-wrap: break-word; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.content-card .c-tr { font-size: var(--fs-sm); color:var(--muted); line-height:1.5; max-height: 3em; overflow: hidden; text-overflow: clip; overflow-wrap: break-word; }

/* === DETAIL HERO === */
.detail-hero { background:var(--card); border-radius:var(--radius); padding: 24px 20px; margin-bottom: var(--space-3); }
.detail-hero .dh-title { font-size: var(--fs-lg); font-weight:700; margin-bottom:6px; line-height:1.3; }
.detail-hero .dh-sub { font-size: var(--fs-sm); color:var(--muted); margin-bottom: var(--space-4); }
.detail-hero .dh-section { margin-bottom: var(--space-3); }
.detail-hero .dh-section:last-child { margin-bottom:0; }
.detail-hero .dh-label { font-size: var(--fs-xs); text-transform:uppercase; letter-spacing:.5px; color:var(--muted); font-weight:600; margin-bottom:6px; }
.detail-hero .dh-text { font-size: var(--fs-md); line-height:1.7; white-space:pre-line; }
.detail-hero .dh-text.muted { color:var(--muted); }

/* === READ AYAH === */
.read-surah-title { font-size: var(--fs-xl); font-weight:700; margin-bottom:4px; text-align:center; }
.read-surah-sub { font-size: var(--fs-sm); color:var(--muted); text-align:center; margin-bottom: var(--space-4); }
.read-ayah { background:var(--card); border-radius:16px; padding: 24px 20px; margin-bottom: var(--space-2); position:relative; width:100%; max-width:100%; box-sizing:border-box; scroll-margin-top: 72px; }
.read-ayah-num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 9px; margin-bottom: var(--space-2); border-radius: 16px; background: rgba(var(--accent-rgb), .12); color: var(--accent); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.read-ayah.ayat-mode .read-ayah-num { background: var(--accent2); color: var(--bg); }
.read-ayah-marker { display:inline-block;font-family:"Noto Naskh Arabic","Amiri","SF Arabic","Geeza Pro",serif; font-size:1em; line-height:1; color:var(--accent2); font-weight:400; margin:0 .25em; user-select:none; opacity:.95; vertical-align:middle; }
.read-ayah-tr { font-size: var(--fs-sm); color:var(--muted); line-height:1.55; margin-bottom:6px; font-style:italic; letter-spacing:0.01em; }
.read-ayah-trn { line-height: 1.55; }
.ayah-tajweed-info { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px dashed rgba(212,175,55,.3); font-weight: 500; }

/* === BISMILLAH === */
.bismillah-card { background: var(--card); border-radius: var(--radius); padding: 24px 20px; margin-bottom: var(--space-3); text-align: center; border: 1px dashed var(--border); }
.bismillah-card .b-ar { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height: 2; direction: rtl; margin-bottom: var(--space-2); }
.bismillah-card .b-tr { font-size: var(--fs-sm); color: var(--muted); font-style: italic; margin-bottom: 6px; }
.bismillah-card .b-trn { font-size: var(--fs-sm); color: var(--text); }

/* === NOTE BOX === */
.note-box { display:flex; gap: var(--space-2); align-items:flex-start; background: var(--nav-active-surface); border:1px solid var(--nav-active-border); border-radius:14px; padding: var(--space-3); margin-bottom: var(--space-3); font-size: var(--fs-sm); line-height:1.6; }
.note-box .note-icon { font-size: var(--fs-md); flex-shrink:0; line-height:1.3; }

/* === LEARNED TOGGLE === */
.learned-toggle { display:flex; align-items:center; gap: var(--space-2); width: 100%; text-align: left; font: inherit; color: inherit; background:var(--card); border:1px solid var(--border); border-radius:16px; padding: var(--space-3); cursor:pointer; margin-top: var(--space-2); }
.learned-toggle.done { background:rgba(var(--accent-rgb), .12); border-color: var(--accent); }
.learned-toggle .lt-icon { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--card2); font-size: var(--fs-md); flex-shrink:0; }
.learned-toggle.done .lt-icon { background:var(--accent); color:var(--bg); }
.learned-toggle .lt-body { flex:1; min-width:0; display: flex; flex-direction: column; justify-content: center; }
.learned-toggle .lt-title { font-size: var(--fs-md); font-weight:600; }
.learned-toggle .lt-sub { font-size: var(--fs-xs); color:var(--muted); margin-top:2px; }

/* === DETAIL ACTIONS === */
.detail-actions { display: flex; gap: 8px; width: 100%; margin-bottom: 16px; }
.detail-actions .btn { flex: 1 1 0%; min-width: 0; padding: 16px 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; justify-content: center; }

/* === SETTINGS === */
.settings-group { background:var(--card); border-radius:16px; margin-bottom: var(--space-3); overflow:hidden; padding: 0; }
.settings-group .sg-title { font-size: var(--fs-xs); color:var(--muted); text-transform:uppercase; letter-spacing:.5px; padding: var(--space-3) var(--space-3) 6px; font-weight:600; }
.setting-row { display:flex; align-items:center; justify-content:space-between; padding: var(--space-3); border-top:1px solid var(--border); gap: var(--space-2); flex-wrap:wrap; }
.setting-row:first-of-type { border-top:none; }
.setting-row .lbl { font-size: var(--fs-md); }
.setting-row .sub { font-size: var(--fs-xs); color:var(--muted); margin-top:2px; }

/* === TOGGLE === */
.toggle { position:relative; width:48px; height:32px; flex-shrink:0; }
.toggle input { opacity:0; width:100%; height:100%; position:absolute; cursor:pointer; z-index:2; }
.toggle .slider { position:absolute; inset:0; background:var(--card2); border-radius:16px; }
.toggle .slider::before { content:''; position:absolute; top:4px; left:4px; width:24px; height:24px; border-radius:50%; background:white; transition: transform .25s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .slider { background:var(--accent); }
.toggle input:checked + .slider::before { transform:translateX(16px); }

/* === SEG === */
.seg { display:flex; background:var(--card2); border-radius:8px; padding:4px; gap:4px; }
.seg button { flex: 1; padding: var(--space-2) var(--space-3); border-radius: 8px; font-size: var(--fs-sm); font-weight: 600; text-align: center; }
.seg button.active { background:var(--card); color:var(--text); font-weight:600; }
.ar-size-preview { display:flex; justify-content:center; padding:4px 0 0; }
.ar-size-preview .ar { color:var(--arabic-gold); font-size: calc(var(--fs-ar) * var(--ar-scale)); }

/* === SECURITY NOTE === */
.security-note { display:flex;gap: var(--space-2);align-items:flex-start;background:var(--card);border:1px dashed var(--border);border-radius:16px;padding: var(--space-3);margin-top: var(--space-3);margin-bottom: var(--space-3);font-size: var(--fs-xs);color:var(--muted);line-height:1.6; }
.security-note .icon { font-size: var(--fs-md); flex-shrink:0; }

/* === MODAL === */
.modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:10050; display:none; align-items:center; justify-content:center; padding: var(--space-4); }
.modal-bg.active { display:flex; animation:fadeIn .2s; }
.modal { background:var(--card); border-radius:24px; width:100%; max-width:440px; max-height:80vh; overflow-y:auto; padding: 24px 20px; }
.modal h2 { margin:0 0 var(--space-3); font-size: var(--fs-lg); }
.modal-row { display:flex; justify-content:space-between; padding: var(--space-2) 0; border-bottom:1px solid var(--border); font-size: var(--fs-md); gap: var(--space-2); flex-wrap:wrap; }
.modal-row:last-child { border-bottom:none; }
.modal-row .num { font-weight:700; color:var(--accent); }
.modal-total { display:flex; justify-content:space-between; padding: var(--space-3) 0; font-size: var(--fs-md); font-weight:700; border-top:1px solid var(--border); margin-top: var(--space-2); }

/* === TIME/REMINDER ROW === */
.time-row { display:flex; gap: var(--space-2); align-items:center; padding: var(--space-2) var(--space-3); border-top:1px solid var(--border); flex-wrap:wrap; }
.time-row input[type="time"] { flex:1; min-width:120px; background:var(--card2); border:none; border-radius:8px; padding: var(--space-2) var(--space-3); font-size: var(--fs-md); outline:none; color:var(--text); }
.time-row .del { width:36px; height:36px; border-radius:50%; background:var(--card2); color:#c96a5a; font-size: var(--fs-md); flex-shrink:0; }
.reminder-row { padding: var(--space-2) var(--space-3); border-top:1px solid var(--border); display:flex; flex-direction:column; gap: var(--space-2); }
.reminder-row > .rr-top { display:flex; gap: var(--space-2); align-items:center; }
.reminder-row input[type="time"] { flex:1; background:var(--card2); border:none; border-radius:8px; padding: var(--space-2) var(--space-3); font-size: var(--fs-md); outline:none; color:var(--text); }
.reminder-row .del { width:36px; height:36px; border-radius:50%; background:var(--card2); color:#c96a5a; font-size: var(--fs-md); flex-shrink:0; }
.reminder-row input[type="text"] { background:var(--card2); border:none; border-radius:8px; padding:9px 12px; font-size: var(--fs-sm); outline:none; color:var(--text); width:100%; }

/* === FS SCROLL TOP === */
.fs-scroll-top { position: absolute; right: 24px; bottom: calc(90px + env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--gold-accent); border: 1px solid var(--gold-accent); display: none; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.5); z-index: 90; transition: opacity .2s ease, transform .2s ease; }
.fs-scroll-top.visible { display: flex; }
.fs-scroll-top:active { transform: scale(.92); background: var(--gold-standard); color: #000; }

/* === MEMORIZE === */
.mem-step { font-size: var(--fs-xs); color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom: var(--space-2); font-weight:600; display:flex; justify-content:space-between; align-items:center; gap: var(--space-2); flex-wrap:wrap; }
.mem-step .phase { font-size:10px; padding:3px 8px; border-radius:8px; background:rgba(var(--accent-rgb), .15); color:var(--accent); }
.mem-block { background:var(--card); border-radius:var(--radius); padding: 24px 20px; margin-bottom: var(--space-3); }
.mem-block .mb-label { font-size: var(--fs-xs); text-transform:uppercase; letter-spacing:.5px; color:var(--muted); font-weight:600; margin-bottom: var(--space-2); }
.mem-block .mb-ar { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height: 2; direction:rtl; text-align:right; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mem-block .mb-ar.hidden { filter: blur(8px); user-select:none; transition: filter .3s; }
.mem-block .mb-text { font-size: var(--fs-md); line-height:1.75; white-space:pre-line; }
.mem-reveal-btn { display:block; width:100%; padding: var(--space-3); border-radius:16px; background:var(--card2); color:var(--text); font-size: var(--fs-md); font-weight:600; margin-top: var(--space-2); border:1px dashed var(--border); }
.mem-reveal-btn:active { background:var(--card); }

/* === NIGHT NOTE === */
.night-note { background:var(--card2); border-radius:16px; padding: var(--space-3); margin-bottom: var(--space-3); font-size: var(--fs-sm); line-height:1.6; color:var(--text); }
.night-note b { color:var(--accent2); }

/* === STAT CARD === */
.stat-card { background:var(--card); border-radius:16px; padding: var(--space-3); }
.stat-card .sc-label { font-size: var(--fs-xs); color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px; }
.stat-card .sc-value { font-size: var(--fs-xl); font-weight:800; letter-spacing:-1px; color:var(--accent); font-variant-numeric:tabular-nums; }
.stat-card .sc-sub { font-size: var(--fs-xs); color:var(--muted); margin-top:4px; }

/* === LEARNED ITEM === */
.learned-item { display:flex; justify-content:space-between; align-items:center; padding: var(--space-2) var(--space-3); border-bottom:1px solid var(--border); gap: var(--space-2); flex-wrap:wrap; }
.learned-item:last-child { border-bottom:none; }
.learned-item .li-title { font-size: var(--fs-sm); font-weight:500; }
.learned-item .li-sub { font-size: var(--fs-xs); color:var(--muted); margin-top:2px; }
.learned-item .li-check { color:var(--accent); font-size: var(--fs-md); }
.progress-section-title { font-size: var(--fs-xs); color:var(--muted); text-transform:uppercase; letter-spacing:.5px; font-weight:600; padding: var(--space-3) var(--space-3) var(--space-2); }

/* === TRANSCRIPTION NOTE === */
.transcription-note { display:flex; gap: var(--space-2); align-items:flex-start; background: var(--card); border:1px dashed var(--border); border-radius:16px; padding: var(--space-3); margin-top: var(--space-3); margin-bottom: var(--space-3); font-size: var(--fs-xs); color:var(--muted); line-height:1.6; }
.transcription-note .tn-icon { font-size: var(--fs-sm); flex-shrink:0; line-height:1.4; opacity:.75; }
.transcription-note b { color:var(--text); font-weight:600; }
.counter .transcription-note { margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3); font-size: 11px; opacity: .7; width: 100%; max-width: 460px; text-align: left; }
.counter .transcription-note .tn-icon { font-size: 13px; }

@media (max-height: 760px) {
  .counter .ar { font-size: calc(var(--fs-ar-lg) * var(--ar-scale) * 0.72); line-height: 2; padding: 4px 0 16px 0; }
  .counter .tr { font-size: var(--fs-sm); }
  .counter .trn { font-size: var(--fs-sm); margin-bottom: 16px; }
  .counter .ring-wrap { width: 190px; height: 190px; margin: 4px 0; }
  .counter .num { font-size: 58px; }
  .counter .target-label { font-size: var(--fs-sm); margin-top: 4px; }
  .counter .cycles { margin-top: 8px; font-size: var(--fs-sm); }
}
@media (max-height: 640px) {
  .counter .ar { font-size: calc(var(--fs-ar-lg) * var(--ar-scale) * 0.55); line-height: 2; padding: 4px 0 12px 0; }
  .counter .tr { font-size: var(--fs-sm); }
  .counter .trn { font-size: var(--fs-xs); margin-bottom: 8px; }
  .counter .ring-wrap { width: 150px; height: 150px; }
  .counter .num { font-size: 44px; letter-spacing: -1px; }
  .counter .target-label { font-size: var(--fs-xs); }
  .counter .cycles { margin-top: 8px; font-size: var(--fs-xs); }
}
.mem-body-note { margin-top: var(--space-4); }

/* === SAVE INDICATOR === */
.save-indicator { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .3s ease; z-index: 10010; pointer-events: none; }
.save-indicator.active { opacity: 1; animation: savePulse 1.2s ease-in-out infinite; }
@keyframes savePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.85); } }

/* === SEARCH FILTERS === */
.search-filters { display: flex; flex-direction: column; gap: 6px; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-filters .filter-group { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 0 6px 0; scrollbar-width: none; }
.search-filters .filter-group::-webkit-scrollbar { display: none; }
.search-filters .filter-chip { flex-shrink: 0; padding: var(--space-1) var(--space-3); border-radius: 16px; background: var(--card); border: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; cursor: pointer; }
.search-filters .filter-chip.active { 
  font-weight: 600; 
  transform: translateZ(0);
}

/* === ONBOARDING === */
#onboarding .ob-skip { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: var(--space-3); font-size: var(--fs-sm); color: var(--muted); padding: var(--space-2) var(--space-3); z-index: 2; }
#onboarding .ob-slide { display: none; width: 100%; max-width: 420px; }
#onboarding .ob-slide.active { display: block; animation: fadeIn .3s ease; }
#onboarding .ob-icon { font-size: 72px; margin-bottom: var(--space-4); line-height: 1; }
#onboarding .ob-title { font-size: var(--fs-xl); font-weight: 800; margin: 0 0 var(--space-2); letter-spacing: -.5px; }
#onboarding .ob-text { font-size: var(--fs-md); color: var(--muted); line-height: 1.6; margin: 0 0 var(--space-4); }
#onboarding .ob-option { padding: var(--space-2) var(--space-4); border-radius: 16px; background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }
#onboarding .ob-option.active { background: var(--gold-gradient); color: #0A0A0A; border-color: transparent; font-weight: 700; box-shadow: var(--gold-glow-sm); }
#onboarding .ob-ar-preview { font-size: calc(var(--fs-ar) * var(--ar-scale)); margin: var(--space-2) 0 4px; }
#onboarding .ob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .2s; }
#onboarding .ob-dot.active { background: var(--accent); }

/* === DASH GREETING === */
.dash-greeting { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); margin-bottom: var(--space-3); }
.dash-greeting .dg-hello { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.3px; margin-bottom: 6px; }
.dash-greeting .dg-time { font-size: var(--fs-sm); color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.dash-greeting .dg-hijri { font-size: var(--fs-sm); color: var(--muted); }

/* === SPIRITUAL CARD === */
.spiritual-card { background: var(--card); border: 1px solid var(--gold-standard); border-radius: var(--radius); padding: 24px 20px; margin-bottom: var(--space-3); box-shadow: 0 1px 2px rgba(0,0,0,0.15); text-align: center; }
.spiritual-card .sc-ar-bismillah { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height: 2; margin-bottom: var(--space-2); }
.spiritual-card .sc-tr-bismillah { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; }
.spiritual-card .sc-trn-bismillah { font-size: var(--fs-sm); color: var(--text); font-weight: 500; margin-bottom: var(--space-4); }
.spiritual-card .sc-divider { width: 40px; height: 1px; background: rgba(212,175,55,.3); margin: 0 auto var(--space-4) auto; }
.spiritual-card .sc-ar-alyaq { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height: 2; margin-bottom: var(--space-2); direction: rtl; }
.spiritual-card .sc-tr-alyaq { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; }
.spiritual-card .sc-trn-alyaq { font-size: var(--fs-sm); color: var(--text); font-weight: 500; margin-bottom: var(--space-4); line-height: 1.5; }

/* === DASH CALL / GRID ITEM === */
.dash-call-card { display: block; width: 100%; font: inherit; color: inherit; background: var(--card); border: 1.5px solid var(--gold-accent); box-shadow: var(--gold-glow); border-radius: var(--radius); padding: var(--space-4); text-align: center; margin-bottom: var(--space-3); cursor: pointer; transition: transform var(--dur-fast) var(--ease-out); }
.dash-call-card:active { transform: scale(0.97); }
.dash-call-card .dcc-title { display: block; font-size: var(--fs-lg); font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -0.5px; }
.dash-call-card .dcc-sub { display: block; font-size: var(--fs-sm); color: var(--muted); }

.dash-grid-item { width: 100%; font: inherit; color: inherit; background: var(--card); border: 1px solid rgba(212,175,55,.3); border-radius: var(--radius); padding: var(--space-3) var(--space-2); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; gap: var(--space-2); transition: transform var(--dur-fast) var(--ease-out); }
.dash-grid-item:active { transform: scale(0.96); border-color: var(--gold-accent); }
.dash-grid-item .dgi-icon { width: 32px; height: 32px; color: var(--gold-accent); }
.dash-grid-item .dgi-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); line-height: 1.2; }

/* === DASH PROGRESS === */
.dash-progress { background: var(--card); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); box-shadow: 0 2px 8px var(--shadow); }
.dash-progress .dp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-2); gap: var(--space-2); flex-wrap: wrap; }
.dash-progress .dp-label { font-size: var(--fs-sm); color: var(--muted); }
.dash-progress .dp-num { font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-progress .dp-num span { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }

/* === DASH QUOTE === */
.dash-quote { background: var(--card); border-radius: var(--radius); padding: 24px 20px; margin-bottom: var(--space-3); cursor: pointer; border: 1px dashed var(--border); position: relative; transition: transform .15s ease; }
.dash-quote:active { transform: scale(.98); }
.dash-quote .dq-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.dash-quote .dq-badge { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px; color: var(--accent); font-weight: 700; }
.dash-quote .dq-arrow { color: var(--muted); font-size: var(--fs-md); line-height: 1; }
.dash-quote .dq-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--space-2); }
.dash-quote .dq-ar { font-size: calc(var(--fs-ar) * var(--ar-scale)); line-height: 2; direction: rtl; text-align: right; margin-bottom: var(--space-2); }
.dash-quote .dq-tr { font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }

/* === DASH QUICK === */
.dash-quick { background: var(--card); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); box-shadow: 0 2px 8px var(--shadow); display: flex; align-items: center; gap: var(--space-2); cursor: pointer; border: 1px dashed var(--border); }
.dash-quick:active { transform: scale(.98); }
.dash-quick .dq-icon { width: 26px; height: 26px; flex-shrink: 0; }
.dash-quick .dq-body { flex: 1; min-width: 0; }
.dash-quick .dq-label { font-size: var(--fs-xs); color: var(--accent); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.dash-quick .dq-name { font-size: var(--fs-md); font-weight: 700; margin-top: 2px; }

/* === DASH STATS === */
.dash-stats { background: var(--card); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); box-shadow: 0 2px 8px var(--shadow); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); text-align: center; }
.dash-stats .ds-item .ds-num { font-size: var(--fs-lg); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.dash-stats .ds-item .ds-label { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .4px; }

.mark-item { display: flex; align-items: center; gap: var(--space-2); }
.mark-item .mi-del { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); color: var(--danger); font-size: var(--fs-md); flex-shrink: 0; cursor: pointer; border: none; }
.mark-item .mi-del:active { opacity: .7; }

/* === TOAST === */
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px); background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1.5px solid var(--gold-accent); border-radius: 30px; padding: var(--space-1) var(--space-4); font-size: var(--fs-sm); font-weight: 700; color: var(--gold-standard); box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 16px rgba(212,175,55,.2); opacity: 0; transition: opacity .3s var(--ease-out), transform .3s var(--ease-bounce); z-index: 99999; pointer-events: none; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.95); color: #0A0A0A; border: 1.5px solid var(--gold-accent); box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 0 16px rgba(212,175,55,.3); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === INSTALL BANNER === */
.install-banner { position: fixed; left: var(--space-3); right: var(--space-3); bottom: calc(72px + env(safe-area-inset-bottom)); background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: var(--space-2) var(--space-3); display: none; align-items: center; gap: var(--space-2); box-shadow: 0 8px 24px var(--shadow); z-index: 9997; font-size: var(--fs-sm); color: var(--text); }
.install-banner.show { display: flex; }
.install-banner .ib-text { flex: 1; min-width: 0; font-weight: 600; }
.install-banner .ib-install { padding: var(--space-2) var(--space-3); border-radius: 8px; font-size: var(--fs-sm); font-weight: 700; background: var(--gold-gradient); color: #0A0A0A; border: none; box-shadow: var(--gold-glow-sm); }
.install-banner .ib-later { padding: var(--space-2); border-radius: 8px; font-size: var(--fs-sm); background: transparent; color: var(--muted); border: none; }

/* === AYAH SHARE === */
.ayah-share-btn { display: inline-flex; align-items: center; justify-content: center; line-height: 1; gap: 6px; margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: 12px; font-size: var(--fs-sm); font-weight: 800; background: transparent; color: var(--gold-accent); border: 1.5px solid var(--gold-accent); cursor: pointer; transition: transform .1s var(--ease-out); }
.ayah-share-btn:active { transform: scale(.95); }

/* === DEBUG === */
#debug-fab { position: fixed; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 100000; background: var(--gold-standard); color: #0A0A0A; border: none; border-radius: 50%; width: 48px; height: 48px; font-size: 22px; display: none; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
#debug-fab.visible { display: flex; }
#debug-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 100001; display: none; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
#debug-overlay.active { display: flex; }
#debug-output { flex: 1; background: #0A0A0A; color: #7CFF7C; padding: 12px; border-radius: 12px; overflow: auto; font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; margin: 0 0 12px; border: 1px solid var(--gold-accent); }
#debug-actions { display: flex; gap: var(--space-2); }
#debug-actions button { flex: 1; padding: var(--space-3); border-radius: 12px; font-size: var(--fs-sm); font-weight: 700; }

/* === PATH === */
.path-fallback { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.path-chip { 
  flex: 0 0 auto; 
  min-width: 0; 
  box-sizing: border-box; 
  padding: var(--space-2) var(--space-4); 
  border-radius: 24px; 
  background: var(--card); 
  border: 1px solid rgba(212,175,55,.3); 
  font-size: var(--fs-sm); 
  color: var(--text); 
  white-space: nowrap; 
  cursor: pointer; 
  transition: transform var(--dur-fast) var(--ease-out); 
}
.path-chip.active { 
  font-weight: 700; 
  transform: translateZ(0);
}
.path-chip:active { transform: scale(0.95); }
.show-all-btn { display: flex; align-items: center; justify-content: center; gap: var(--space-2); width: 100%; padding: var(--space-3); margin-top: var(--space-2); margin-bottom: var(--space-4); border-radius: 16px; font-size: var(--fs-md); cursor: pointer; }
.path-empty { text-align: center; padding: 40px var(--space-4); color: var(--muted); font-size: var(--fs-md); line-height: 1.6; }
.btn-inline, .btn.btn-inline { display: inline-block; vertical-align: middle; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: var(--fs-sm); margin: 12px auto 0; }

/* === ЕДИНАЯ ГЕОМЕТРИЯ КАРТОЧЕК === */
.content-card, .tasbih-card, .detail-hero, .bismillah-card, .modal, .read-ayah,
.dash-quote, .dash-progress, .dash-greeting, .dash-stats, .dash-quick,
.continue-card, .daily-goal, .bar-chart, .stat, .stat-card, .spiritual-card, .mem-block {
  padding: 24px 20px;
  word-break: break-word;
  overflow-wrap: break-word;
}


/* ============================================================
   IQRA V412 — КОМПОНЕНТЫ ЧТЕНИЯ, КАРТОЧКИ И ПЕРЕКЛЮЧАТЕЛИ
   ============================================================ */

/* Единая глубина поверхностей; не добавляем тяжёлых чёрных теней. */
.content-card, .tasbih-card, .detail-hero, .bismillah-card, .modal,
.read-ayah, .dash-quote, .dash-progress, .dash-greeting, .dash-stats,
.dash-quick, .continue-card, .daily-goal, .bar-chart, .stat, .stat-card,
.spiritual-card, .mem-block, .dash-grid-item {
  border-color: var(--card-outline);
  box-shadow: var(--card-shadow);
}

[data-theme="dark"] .content-card,
[data-theme="dark"] .tasbih-card,
[data-theme="dark"] .detail-hero,
[data-theme="dark"] .bismillah-card,
[data-theme="dark"] .read-ayah,
[data-theme="dark"] .dash-quote,
[data-theme="dark"] .dash-progress,
[data-theme="dark"] .dash-greeting,
[data-theme="dark"] .dash-stats,
[data-theme="dark"] .dash-quick,
[data-theme="dark"] .continue-card,
[data-theme="dark"] .daily-goal,
[data-theme="dark"] .bar-chart,
[data-theme="dark"] .stat,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .spiritual-card,
[data-theme="dark"] .mem-block,
[data-theme="dark"] .dash-grid-item,
[data-theme="mono"] .content-card,
[data-theme="mono"] .tasbih-card,
[data-theme="mono"] .detail-hero,
[data-theme="mono"] .bismillah-card,
[data-theme="mono"] .read-ayah,
[data-theme="mono"] .dash-quote,
[data-theme="mono"] .dash-progress,
[data-theme="mono"] .dash-greeting,
[data-theme="mono"] .dash-stats,
[data-theme="mono"] .dash-quick,
[data-theme="mono"] .continue-card,
[data-theme="mono"] .daily-goal,
[data-theme="mono"] .bar-chart,
[data-theme="mono"] .stat,
[data-theme="mono"] .stat-card,
[data-theme="mono"] .spiritual-card,
[data-theme="mono"] .mem-block,
[data-theme="mono"] .dash-grid-item {
  background: var(--card);
  border-color: var(--card-outline);
  box-shadow: var(--card-shadow);
}

/* Высота строки одинакова для всех частей аята, включая огласовки. */
.read-ayah-ar {
  font-weight: 500;
  line-height: 2;
  padding-top: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.read-ayah-tr { line-height: 1.65; margin-bottom: 8px; }
.read-ayah-trn { line-height: 1.72; font-size: clamp(15px, 3.8vw, 17px); }
.detail-hero .dh-text { line-height: 1.75; }
.content-card .c-tr { line-height: 1.62; }

.btn.secondary svg.ico, .btn-inline svg.ico, .show-all-btn svg.ico,
.ayah-share-btn svg.ico {
  fill: none;
  stroke: currentColor;
}

/* Фильтры и вкладки образуют одну систему сегментированных контролов. */
.search-filters .filter-chip,
.path-chip {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-outline);
  color: var(--muted);
  font-weight: 550;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.search-filters .filter-chip.active,
.path-chip.active {
  background: var(--nav-active-surface);
  color: var(--gold-text-light);
  border: 1px solid var(--nav-active-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

[data-theme="dark"] .search-filters .filter-chip.active,
[data-theme="dark"] .path-chip.active,
[data-theme="mono"] .search-filters .filter-chip.active,
[data-theme="mono"] .path-chip.active {
  color: var(--gold-text-dark);
}

.seg, .prog-tabs {
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--card-outline);
  border-radius: 13px;
  background: var(--card2);
}

.seg button, .prog-tabs button {
  min-height: 36px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.seg button.active, .prog-tabs button.active {
  color: var(--gold-text-light);
  background: var(--card);
  border: 1px solid var(--card-outline);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .seg button.active,
[data-theme="dark"] .prog-tabs button.active,
[data-theme="mono"] .seg button.active,
[data-theme="mono"] .prog-tabs button.active {
  color: var(--gold-text-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* Ссылки-действия и иконки не теряют контраст при смене темы. */
.ayah-share-btn, .show-all-btn {
  min-height: 42px;
  border-radius: 13px;
  font-weight: 650;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-color: var(--card-outline);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.045);
}

.dash-grid-item {
  min-height: 104px;
  padding: 16px 12px;
  border-radius: 18px;
  gap: 10px;
}

.dash-grid-item .dgi-icon { width: 29px; height: 29px; }
.dash-grid-item .dgi-title { line-height: 1.35; font-weight: 600; }

@media (max-width: 520px) {
  .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .detail-actions .btn {
    flex: none;
    width: 100%;
    margin: 0;
    font-size: 13px;
    padding: 12px 6px;
    min-height: 46px;
  }
  .read-ayah { padding: 22px 16px; }
}


/* ============================================================
   IQRA V415 — СПИСКИ (Коран, Дуа, Хадисы): ЕДИНАЯ КОНЦЕПЦИЯ
   Золотая кромка-«слиток», медальон номера, золотые кнопки-акценты.
   Без !important: специфичность выше старых тем-блоков.
   ============================================================ */
html[data-theme] .content-card, html:not([data-theme]) .content-card {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(180deg, var(--card-edge-hi), var(--card-edge-lo)) border-box;
}

/* Медальон номера суры */
.content-card .c-num {
  background: radial-gradient(circle at 30% 25%, rgba(240, 204, 112, 0.20), rgba(240, 204, 112, 0.04));
  color: var(--gold-text-light);
  border: 1.5px solid var(--nav-active-border);
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px var(--card-outline);
}

/* Плашка «С аята 7» */
.content-card .c-badge {
  background: var(--nav-active-surface);
  color: var(--gold-text-light);
  border: 1px solid var(--nav-active-border);
  font-weight: 600;
}

/* Избранное: контурная золотая, активная заливается золотом с тёмной звездой */
.content-card .star-btn {
  background: transparent;
  color: var(--gold-text-light);
  border: 1px solid var(--card-outline);
}
.content-card .star-btn.active {
  background: var(--gold-gradient);
  color: #1c1917;
  border-color: transparent;
}

[data-theme="dark"] .content-card .c-num, [data-theme="mono"] .content-card .c-num,
[data-theme="dark"] .content-card .c-badge, [data-theme="mono"] .content-card .c-badge,
[data-theme="dark"] .content-card .star-btn, [data-theme="mono"] .content-card .star-btn { color: var(--gold-text-dark); }
[data-theme="dark"] .content-card .star-btn.active, [data-theme="mono"] .content-card .star-btn.active { color: #1c1917; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .content-card .c-num, html:not([data-theme]) .content-card .c-badge,
  html:not([data-theme]) .content-card .star-btn { color: var(--gold-text-dark); }
  html:not([data-theme]) .content-card .star-btn.active { color: #1c1917; }
}

/* Поле поиска: золотая лупа в зарезервированном слоте и видимый фокус */
.search-wrap::before {
  content: "";
  position: absolute; left: 14px; top: 50%;
  width: 18px; height: 18px; transform: translateY(-50%);
  background: var(--gold-text-light); opacity: 0.9; pointer-events: none; z-index: 1;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7.5'/%3E%3Cpath d='m21 21-4.5-4.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7.5'/%3E%3Cpath d='m21 21-4.5-4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-theme="dark"] .search-wrap::before, [data-theme="mono"] .search-wrap::before { background: var(--gold-text-dark); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .search-wrap::before { background: var(--gold-text-dark); } }

.search-wrap input {
  border-color: var(--card-outline);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.search-wrap input::placeholder { color: var(--muted); opacity: 0.8; }
.search-wrap input:focus {
  border-color: var(--gold-standard);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}


/* ============================================================
   IQRA V417 — АКЦЕНТНЫЕ КАРТОЧКИ СПИСКА (рукья)
   Вместо inline-стилей: та же золотая кромка, чуть сильнее и с золотой подложкой.
   ============================================================ */
html[data-theme] .content-card.content-card--feature, html:not([data-theme]) .content-card.content-card--feature {
  background:
    linear-gradient(var(--nav-active-surface), var(--nav-active-surface)) padding-box,
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(180deg, var(--card-edge-hi), var(--card-edge-hi)) border-box;
}


/* ============================================================
   IQRA V426 — СПРАВКА ПО ТАДЖВИДУ (pop-up, glassmorphism, плотный)
   Макет v4, согласован. Адаптировано под реальные токены проекта:
   --accent / --accent-rgb здесь — контрастный ч/б, НЕ золото,
   поэтому акценты таджвид-модалки используют --gold-accent и
   фиксированный золотой RGB (212,175,55), как в tajweed.css.
   ============================================================ */

/* Кнопка «Таджвид» под аятом: скрыта, пока правил нет */
.ayah-tajweed-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--space-2);
  margin-left: 8px;
  background: transparent;
  border: 1px solid var(--card-outline);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: var(--fs-sm);
  color: var(--gold-accent);
  cursor: pointer;
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out);
}
.ayah-tajweed-btn.visible { display: inline-flex; }
.ayah-tajweed-btn:active { background: rgba(212, 175, 55, 0.10); }

/* Лёгкая вуаль только для таджвид-модалки.
   У модалки учёного свои инлайн-стили (rgba(0,0,0,.45)+blur 8px) —
   их не перебиваем, это существующая фича. */
.modal-bg:has(.tajweed-modal) {
  background: rgba(20, 16, 10, 0.44);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .modal-bg:has(.tajweed-modal),
[data-theme="mono"] .modal-bg:has(.tajweed-modal) {
  background: rgba(0, 0, 0, 0.62);
}

/* Сама модалка: плотная читаемая поверхность с золотым акцентом */
.modal.tajweed-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 76vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(252, 251, 247, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.48);
  box-shadow:
    0 16px 40px rgba(20, 16, 10, 0.24),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.modal.tajweed-modal::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.8), transparent);
  pointer-events: none;
}
[data-theme="dark"] .modal.tajweed-modal,
[data-theme="mono"] .modal.tajweed-modal {
  background: rgba(22, 20, 17, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.36);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Сверхкомпактная шапка */
.modal.tajweed-modal .tm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(252, 251, 247, 0.98);
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
}
[data-theme="dark"] .modal.tajweed-modal .tm-head,
[data-theme="mono"] .modal.tajweed-modal .tm-head {
  background: rgba(22, 20, 17, 0.98);
  border-bottom: 1px solid rgba(212, 175, 55, 0.24);
}
.modal.tajweed-modal .tm-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  letter-spacing: 0.1px;
}
.modal.tajweed-modal .tm-title svg { width: 13px; height: 13px; }
.modal.tajweed-modal .tm-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.30);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}
.modal.tajweed-modal .tm-close svg { width: 13px; height: 13px; }
.modal.tajweed-modal .tm-close:active {
  transform: scale(0.92);
  background: rgba(212, 175, 55, 0.20);
}

/* Плотное тело */
.modal.tajweed-modal .tm-body {
  padding: 8px 12px 10px;
  overflow-y: auto;
  max-height: calc(72vh - 47px);
}
.modal.tajweed-modal .tm-ayah-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin: 0 0 4px;
  opacity: 0.85;
}
.modal.tajweed-modal .tm-list { display: flex; flex-direction: column; }
.modal.tajweed-modal .tm-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.20);
}
.modal.tajweed-modal .tm-item:last-child { border-bottom: none; }
.modal.tajweed-modal .tm-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  margin-top: 4px;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}
[data-theme="dark"] .modal.tajweed-modal .tm-item i,
[data-theme="mono"] .modal.tajweed-modal .tm-item i {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.09);
}
.modal.tajweed-modal .tm-item .tm-txt { min-width: 0; flex: 1; }
.modal.tajweed-modal .tm-item .tm-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}
.modal.tajweed-modal .tm-item .tm-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  margin: 1px 0 0;
}
.modal.tajweed-modal .tm-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(212, 175, 55, 0.20);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  font-style: italic;
}


/* ============================================================
   IQRA V440 — УМНАЯ КНИГА И ЭКОСИСТЕМА-СПРАВОЧНИК (#screen-path, .ecosystem-box)
   ============================================================ */

.path-header-sub {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.path-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 var(--space-3) 8px;
}

.path-mode-seg {
  width: 100%;
}

.path-search-wrap {
  width: 100%;
}

.path-search-wrap input {
  color: var(--text);
  padding-right: 40px;
}

.path-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--card-outline);
  background: var(--card2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.path-clear-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.path-type-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.path-type-filters::-webkit-scrollbar {
  display: none;
}

.path-type-filters .filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-outline);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.path-type-filters .filter-chip.active {
  background: var(--nav-active-surface);
  color: var(--gold-text-light);
  border-color: var(--nav-active-border);
  font-weight: 700;
}
[data-theme="dark"] .path-type-filters .filter-chip.active,
[data-theme="mono"] .path-type-filters .filter-chip.active {
  color: var(--gold-text-dark);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .path-type-filters .filter-chip.active {
    color: var(--gold-text-dark);
  }
}

#path-context-banner {
  padding: 4px var(--space-3) 10px;
}
#path-context-banner:empty {
  display: none;
}

.path-focus-banner {
  background: var(--card);
  border: 1px solid var(--nav-active-border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
}
.path-focus-banner .pfb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.path-focus-banner .pfb-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-text-light);
}
[data-theme="dark"] .path-focus-banner .pfb-kicker,
[data-theme="mono"] .path-focus-banner .pfb-kicker {
  color: var(--gold-text-dark);
}
.path-focus-banner .pfb-reset {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  background: var(--card2);
  border: 1px solid var(--card-outline);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.path-focus-banner .pfb-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.path-focus-banner .pfb-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}
.path-focus-banner .pfb-meta {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 8px;
  font-weight: 600;
}

.path-catalog-section {
  padding: 4px 0 18px;
}
.path-catalog-section .pcs-head {
  padding: 4px 2px 12px;
}
.path-catalog-section .pcs-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.path-catalog-section .pcs-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.45;
}

.path-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 440px) {
  .path-catalog-grid {
    grid-template-columns: 1fr;
  }
}

.path-catalog-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  padding: 14px 15px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-outline);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.path-catalog-card:active {
  transform: scale(0.98);
}
.path-catalog-card:hover {
  border-color: var(--nav-active-border);
}
.path-catalog-card .pcc-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.path-catalog-card .pcc-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.path-catalog-card .pcc-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--nav-active-surface);
  border: 1px solid var(--nav-active-border);
  color: var(--gold-text-light);
}
[data-theme="dark"] .path-catalog-card .pcc-count,
[data-theme="mono"] .path-catalog-card .pcc-count {
  color: var(--gold-text-dark);
}
.path-catalog-card .pcc-desc {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.45;
}

.path-empty-smart {
  background: var(--card);
  border: 1px solid var(--card-outline);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: left;
  box-shadow: var(--card-shadow);
}
.path-empty-smart .pes-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.path-heart-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.path-bismillah-kicker {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gold-text-light);
  line-height: 1.3;
}
[data-theme="dark"] .path-bismillah-kicker,
[data-theme="mono"] .path-bismillah-kicker {
  color: var(--gold-text-dark);
}
.path-heart-heading {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1.32;
  letter-spacing: -0.01em;
}
.path-empty-smart .pes-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px;
}
.path-empty-smart .pes-group-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-text-light);
  margin: 12px 0 8px;
}
[data-theme="dark"] .path-empty-smart .pes-group-label,
[data-theme="mono"] .path-empty-smart .pes-group-label {
  color: var(--gold-text-dark);
}
.path-empty-smart .pes-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.path-empty-smart .pes-mode-actions .btn-inline {
  margin: 0;
  width: auto;
  flex: 1 1 130px;
  padding: 10px 14px;
  text-align: center;
}

.path-matched-bar {
  background: var(--card);
  border: 1px solid var(--nav-active-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.path-matched-bar .pmb-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 8px;
}

.path-results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 600;
  margin: 2px 2px 10px;
}
.path-results-summary .prs-reset {
  background: transparent;
  border: none;
  color: var(--gold-text-light);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}
[data-theme="dark"] .path-results-summary .prs-reset,
[data-theme="mono"] .path-results-summary .prs-reset {
  color: var(--gold-text-dark);
}

.path-result-card .path-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.path-result-card .path-card-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold-text-light);
}
[data-theme="dark"] .path-result-card .path-card-type,
[data-theme="mono"] .path-result-card .path-card-type {
  color: var(--gold-text-dark);
}
.path-result-card .path-card-type svg.ico {
  stroke: currentColor;
  fill: none;
}
.path-result-card .path-ref-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.path-semantic-box {
  margin-top: 14px;
  padding: 13px 14px;
  background: var(--card2);
  border: 1px solid var(--card-outline);
  border-radius: 12px;
  text-align: left;
}
.path-semantic-box .psb-kicker {
  font-size: 11px;
  color: var(--gold-text-light);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 6px;
}
[data-theme="dark"] .path-semantic-box .psb-kicker,
[data-theme="mono"] .path-semantic-box .psb-kicker {
  color: var(--gold-text-dark);
}
.path-semantic-box .psb-row {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 4px;
}
.path-semantic-box .psb-key {
  font-weight: 700;
  color: var(--muted);
}
.path-semantic-box .psb-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 4px;
}
.path-semantic-box .psb-tafsir {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--card-outline);
  border-radius: 10px;
  padding: 10px 12px;
}
.path-semantic-box .psb-tafsir-sum {
  font-weight: 700;
  color: var(--gold-text-light);
  font-size: 13px;
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
[data-theme="dark"] .path-semantic-box .psb-tafsir-sum,
[data-theme="mono"] .path-semantic-box .psb-tafsir-sum {
  color: var(--gold-text-dark);
}
.path-semantic-box .psb-tafsir-body {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.path-semantic-box .psb-tafsir-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.path-semantic-box .psb-tafsir-src {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.path-semantic-box .psb-scholar-btn {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  min-height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.path-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.path-card-actions .btn-inline {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  width: auto;
}

/* === ЭКОСИСТЕМА-СПРАВОЧНИК (.ecosystem-box) === */
.ecosystem-box {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid var(--card-outline);
  text-align: left;
}
.ecosystem-box.ecosystem-detail {
  margin-top: 18px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  padding: 16px;
}
.ecosystem-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-text-light);
  margin-bottom: 10px;
}
[data-theme="dark"] .ecosystem-head,
[data-theme="mono"] .ecosystem-head {
  color: var(--gold-text-dark);
}
.ecosystem-head svg.ico {
  stroke: currentColor;
  fill: none;
}

.ecosystem-group + .ecosystem-group {
  margin-top: 10px;
}
.ecosystem-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.ecosystem-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ecosystem-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-outline);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ecosystem-detail .ecosystem-pill {
  background: var(--card2);
}
.ecosystem-pill:hover {
  border-color: var(--nav-active-border);
  background: var(--nav-active-surface);
}
.ecosystem-pill:active {
  transform: scale(0.97);
}
.ecosystem-pill svg.ico {
  flex-shrink: 0;
  stroke: var(--gold-accent);
  fill: none;
}
.ecosystem-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ecosystem-pill-theme,
.ecosystem-pill-mood {
  border-color: var(--nav-active-border);
}

.counter-ecosystem {
  width: 100%;
  max-width: 460px;
  margin-top: 14px;
}
.counter-ecosystem:empty {
  display: none;
}

.ayah-eco-details {
  margin-top: 12px;
  text-align: left;
  direction: ltr;
}
.ayah-eco-details .aed-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card2);
  border: 1px solid var(--card-outline);
  color: var(--gold-text-light);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ayah-eco-details .aed-summary::-webkit-details-marker {
  display: none;
}
[data-theme="dark"] .ayah-eco-details .aed-summary,
[data-theme="mono"] .ayah-eco-details .aed-summary {
  color: var(--gold-text-dark);
}
.ayah-eco-details .aed-summary svg.ico {
  stroke: currentColor;
  fill: none;
}
.ayah-eco-details[open] .aed-summary {
  border-color: var(--nav-active-border);
  background: var(--nav-active-surface);
}
.ayah-eco-details .ecosystem-box {
  margin-top: 8px;
}

.scholar-eco-wrap {
  margin-top: 14px;
}
.scholar-eco-wrap .ecosystem-box {
  margin-top: 0;
}

.search-smart-box {
  background: var(--card);
  border: 1px solid var(--nav-active-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.search-smart-box .ssb-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gold-text-light);
  margin-bottom: 8px;
}
[data-theme="dark"] .search-smart-box .ssb-label,
[data-theme="mono"] .search-smart-box .ssb-label {
  color: var(--gold-text-dark);
}


