:root {
  color-scheme: light;
  --bg: #fbfbfd;
  --surface: #ffffff;
  --hover: #f0f0f3;        
  --glass: rgba(255, 255, 255, 0.72);   
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-faint: #75757a;   
  --line: #e7e7ec;
  --accent: #0b7a57;   
  --accent-ink: #ffffff;   
  --fr: #0b7a57;
  --quran: #a06a1b;    
  --hadith: #7c6f9c;   
  --lang-fr: #0b7a57;  --lang-en: #2563eb;  --lang-es: #a85a2e;  --lang-ar: #1f6f54;
  --lang-de: #8a3d6b;  --lang-tr: #7a6320;  --lang-ur: #1f6f54;  --lang-hi: #c2410c;
  --lang-default: #0b7a57;
  --warn: #9a5b10;
  --warn-bg: rgba(180, 83, 9, 0.12);
  --warn-line: rgba(180, 83, 9, 0.4);
  --warn-solid: #9a5b10;   
  --danger: #b3261e;       
  --danger-line: #e5484d;  
  --danger-bg: rgba(229, 72, 77, 0.10);
  --ok-bg: rgba(5, 150, 105, 0.10);
  --ok-ink: #05714f;
  --neutral-bg: rgba(120, 120, 128, 0.12);   
  --scrollbar: rgba(0, 0, 0, 0.14);
  --scrim: rgba(0, 0, 0, 0.25);
  --scrim-strong: rgba(0, 0, 0, 0.35);
  --toast-bg: #1d1d1f;
  --toast-ink: #ffffff;
  --decor-1: rgba(11, 122, 87, 0.05);
  --decor-2: rgba(37, 99, 235, 0.05);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-pill: 0 6px 24px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(0, 0, 0, 0.06);
  --shadow-banner: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-panel: 0 20px 50px rgba(0, 0, 0, 0.14);
  --shadow-modal: 0 30px 70px rgba(0, 0, 0, 0.2);
  --shadow-toast: 0 14px 40px rgba(0, 0, 0, 0.22);
  --radius: 22px;
  --radius-field: 10px;
  --radius-pill: 16px;
  --text-scale: 1;
  --col-annotation: calc(clamp(0.95rem, 1.15vw, 1.2rem) * var(--text-scale));
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI", Roboto, "Noto Naskh Arabic", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1d1d1f;
  --hover: #2a2a2d;
  --glass: rgba(29, 29, 31, 0.72);
  --text: #f5f5f7;
  --text-soft: #a1a1a8;      
  --text-faint: #86868b;     
  --line: #38383b;           
  --accent: #34d399;
  --accent-ink: #04231a;     
  --fr: #34d399;
  --quran: #d4a03c;          
  --hadith: #a78bfa;         
  --lang-fr: #34d399;  --lang-en: #60a5fa;  --lang-es: #f0a06a;  --lang-ar: #5eead4;
  --lang-de: #e8a0c8;  --lang-tr: #d4b455;  --lang-ur: #5eead4;  --lang-hi: #fb923c;
  --lang-default: #34d399;
  --warn: #fbbf24;           
  --warn-bg: rgba(245, 158, 11, 0.16);
  --warn-line: rgba(251, 191, 36, 0.45);
  --warn-solid: #7a4a0d;
  --danger: #f87171;         
  --danger-line: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.14);
  --ok-bg: rgba(52, 211, 153, 0.14);
  --ok-ink: #34d399;
  --neutral-bg: rgba(245, 245, 247, 0.10);
  --scrollbar: rgba(245, 245, 247, 0.18);
  --scrim: rgba(0, 0, 0, 0.55);
  --scrim-strong: rgba(0, 0, 0, 0.68);
  --toast-bg: #2a2a2d;
  --toast-ink: #f5f5f7;
  --decor-1: rgba(52, 211, 153, 0.07);
  --decor-2: rgba(96, 165, 250, 0.07);
  --shadow-soft: none;
  --shadow-pill: 0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: none;
  --shadow-banner: none;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 30px 80px rgba(0, 0, 0, 0.7);
  --shadow-toast: 0 14px 40px rgba(0, 0, 0, 0.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  height: 100vh;   
  height: 100dvh;  
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.bg-decor {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 14% -8%, var(--decor-1), transparent 60%),
    radial-gradient(55% 38% at 100% -8%, var(--decor-2), transparent 60%);
}
.emblem { color: var(--fr); display: inline-flex; align-items: center; }
.emblem svg { display: block; }
.brand-name { font-size: clamp(1.05rem, 1.4vw, 1.35rem); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fr) 40%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.live-badge.off { background: var(--hover); color: var(--text-faint); }
.live-badge.off .live-dot { background: var(--text-faint); animation: none; }
.btn, .btn-icon {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font-family: inherit; font-weight: 600; color: var(--text);
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:focus-visible, .btn-icon:focus-visible, .pill-btn:focus-visible, .modal-close:focus-visible {
  outline: 2px solid var(--fr); outline-offset: 2px;
}
.btn { min-height: 44px; padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.88rem; }
.btn:hover { background: var(--hover); }
@keyframes pulse-rec { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger-line) 50%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@keyframes segIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes idleIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes haloPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.pill-btn { min-height: 44px;  border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 0.64rem 0.9rem; font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.pill-btn:hover { background: var(--hover); }
#mic-btn.testing { border-color: var(--fr); color: var(--fr); }
.lang-switch {
  display: inline-flex; align-items: center; gap: 0.15rem;
  padding: 0.15rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg);
}
.lang-switch-btn {
  min-width: 44px; height: 44px; padding: 0 0.7rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-soft); background: transparent; border: none; border-radius: 999px;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch-btn:hover { color: var(--text); }
.lang-switch-btn:focus-visible { outline: 2px solid var(--fr); outline-offset: 2px; }
.lang-switch-btn.active { background: var(--surface); color: var(--fr); box-shadow: var(--shadow-soft); }
.tab-btn.active { color: var(--fr); border-color: var(--fr); }
.theme-toggle {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { color: var(--text); background: var(--hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--fr); outline-offset: 2px; }
@media (max-width: 460px) {
  .brand-name { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; }
}
.page-header .emblem { color: var(--fr); }
.page-header .brand-name { font-size: 1.2rem; }
.copy-row .pill-btn { flex: 0 0 auto; }
.copy-row .pill-btn.copy-failed { background: var(--warn-solid); color: #fff; border-color: var(--warn-solid); }
.status-pill.off { background: var(--hover); color: var(--text-faint); }
