:root {
    --bg-color: #f8f9fb;
    --accent-green: #1e293b; /* ТЕПЕРЬ ОН ЧЕРНЫЙ ПО УМОЛЧАНИЮ */
    --text-main: #2d3748;
    --card-bg: #ffffff;
    --border-color: #edf2f7;
    --gray-text: #a0aec0;
    
    --tint-bg: #f1f5f9; 
    --hover-bg: #f8fafc;
    --danger-bg: #fff5f5;
    --danger-text: #c53030;
    --danger-border: #feb2b2;
}
/* Подключаем ваш новый шрифт */
@font-face { 
    font-family: 'Diwani-Bent'; 
    src: url('../fonts/Diwani-Bent.ttf') format('truetype'); 
}

/* Специальный класс-исключение */
div.arabic-text1.Diwani-Bent {
    font-family: 'Diwani-Bent', serif !important;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none; /* Скрывает полосу в Firefox */
    -ms-overflow-style: none; /* Скрывает полосу в старых браузерах Microsoft */
}

/* Скрывает полосу в Chrome, Safari, Яндекс, Edge и на всех смартфонах */
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

/* ФИКС ПРОКРУТКИ (ПРИЛОЖЕНИЕ БОЛЬШЕ НЕ БУДЕТ ПРЫГАТЬ) */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #e2e8f0; 
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center; 
}

.app-wrapper {
    width: 100%;
    max-width: 480px; 
    background-color: var(--bg-color);
    height: 100%;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Важно для боковой страницы и фиксации экрана */
}

/* --- ШАПКА --- */
header {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 100;
    padding: 0 20px;
    flex-shrink: 0;
}

header h1 { font-size: 19px; font-weight: 800; margin: 0; color: var(--text-main); }
.menu-btn { position: absolute; right: 20px; font-size: 22px; cursor: pointer; color: var(--text-main); }

/* --- КОНТЕНТ (ПРОКРУТКА РАЗРЕШЕНА ТОЛЬКО ЗДЕСЬ) --- */
main { 
    padding: 15px; 
    padding-bottom: 90px; 
    flex: 1; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 25px 20px;
    text-align: center;
    margin-bottom: 20px;
}
.arabic-text1 { font-size: 36px; color: var(--accent-green); direction: rtl; margin-bottom: 12px; margin-top: -24px;}
.arabic-text { font-size: 36px; color: var(--accent-green); direction: rtl; margin-bottom: 12px; margin-top: -24px;}
.translation { font-size: 13px; color: var(--text-main); font-weight: 500; margin-bottom: 20px; line-height: 1.4; }
.date-hijri { font-weight: 700; font-size: 16px; color: var(--accent-green); margin-bottom: 5px; }
.date-gregorian { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--text-main); letter-spacing: 0.5px; }
.arabic-weekday { margin-top: 5px; font-size: 13px; color: var(--gray-text); }

/* --- СЕТКА ПЛИТОК --- */
.grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-item {
    background: var(--card-bg); border-radius: 18px; padding: 20px 5px;
    text-align: center; text-decoration: none; color: var(--text-main);
    border: 1px solid var(--border-color); transition: transform 0.1s, background-color 0.2s;
    display: flex; flex-direction: column; align-items: center;
}
.grid-item:active { transform: scale(0.94); background-color: var(--hover-bg); }
.grid-item svg { width: 26px; height: 26px; color: var(--accent-green); margin-bottom: 8px; }
.grid-item span { font-size: 12px; font-weight: 600; }

/* --- ФУТЕР --- */
footer {
    position: absolute; bottom: 0; width: 100%; height: 70px;
    background: var(--card-bg); border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-around; align-items: center; z-index: 100;
}
footer a { color: var(--gray-text); font-size: 22px; text-decoration: none; transition: 0.2s; }
footer a.active, footer a:active { color: var(--accent-green); }

/* --- МОДАЛЬНЫЕ ОКНА (ОБЩЕЕ) --- */
.modal-overlay {
    position: absolute; /* ИСПРАВЛЕНО: теперь окно привязано к рамке телефона, а не к монитору */
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 2000; display: none;
}
.modal-overlay.open { display: flex; }
.modal-content { background: var(--card-bg); position: relative; display: flex; flex-direction: column; }

.modal-right { justify-content: flex-end; }
.modal-right .modal-content {
    width: 85%; max-width: 400px; height: 100%; border-radius: 30px 0 0 30px;
    padding: 20px; animation: slideLeft 0.3s ease-out;
}

/* Выезд НА ВЕСЬ ЭКРАН справа налево (Стиль нативного приложения) */
.modal-full-right { justify-content: flex-end; }
.modal-full-right .modal-content {
    width: 100%;
    height: 100%;
    max-width: 480px;
    border-radius: 0;
    padding: 20px 20px 40px 20px;
    animation: slideLeft 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
}

@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-shrink: 0; }
.modal-header h2 { margin: 0; font-size: 22px; font-weight: 800; }
.close-btn {
    background: transparent; border: 1px solid var(--border-color); border-radius: 50%;
    width: 36px; height: 36px; font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--text-main);
}

.settings-list { flex: 1; }
.settings-item {
    display: flex; align-items: center; padding: 15px;
    border: 1.5px solid var(--border-color); border-radius: 20px; margin-bottom: 12px;
}
.item-icon {
    width: 45px; height: 45px; background: var(--tint-bg); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-green); margin-right: 15px; font-weight: bold;
}
.item-text { flex: 1; }
.item-title { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.item-subtitle { font-size: 12px; font-weight: 600; color: var(--gray-text); }
.item-action { color: var(--gray-text); }
.item-action.active-check { color: var(--accent-green); }

.modal-footer { margin-top: auto; padding-top: 20px; text-align: center; }
.offline-text { font-size: 13px; font-weight: 600; color: var(--gray-text); margin-top: 12px; }

.selection-group { margin-bottom: 25px; }
.group-title { font-size: 12px; font-weight: 800; color: var(--gray-text); text-transform: uppercase; margin-bottom: 10px; margin-left: 10px; }
.selection-item {
    display: flex; justify-content: space-between; padding: 18px 20px; background: var(--card-bg);
    border: 1.5px solid var(--border-color); border-radius: 18px; margin-bottom: 8px; text-decoration: none;
    color: var(--text-main); font-weight: 700; font-size: 15px; transition: 0.1s;
}
.selection-item:active { transform: scale(0.98); background: var(--bg-color); }
.selection-item svg { width: 18px; height: 18px; color: var(--gray-text); }

/* --- НОВАЯ СТРАНИЦА (ВНУТРЕННЯЯ) --- */
.page-view {
    position: absolute; /* Держим внутри телефона */
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 3000;
    display: flex; flex-direction: column;
    
    transform: translateX(100%) !important; 
    
    /* ВОТ ОНА МАГИЯ: плавное скольжение в ОБЕ стороны! */
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
    overflow: hidden;
}

/* Когда скрипт добавляет класс active или page-animated, окно едет влево на центр (0) */
.page-view.active,
.page-view.page-animated {
    transform: translateX(0) !important;
}

.page-header {
    height: 60px;
    display: flex; 
    align-items: center; 
    justify-content: center; /* Центрируем заголовок "Рузнама", "Вирды" и т.д. */
    background: var(--bg-color);
    position: sticky; top: 0; z-index: 10;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color); /* Красивая линия снизу */
}

.back-btn {
    position: absolute; /* Прибиваем кнопку строго к левому краю */
    left: 15px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; 
    transition: background 0.2s;
}

.back-btn:active { background: var(--border-color); }

.page-header h2 { font-size: 19px; font-weight: 800; margin: 0; color: var(--text-main); }

.page-content {
    flex: 1; 
    overflow-y: auto; 
    padding: 15px 15px 50px 15px;
    -webkit-overflow-scrolling: touch;
}

.page-animated, 
.app-wrapper.page-animated {
    animation: none !important;
}

/* Когда окно открывается, оно едет ровно в центр */
.page-view.active {
    transform: translateX(0) !important;
}


/* --- СТИЛИ ДЛЯ СУР (АРАБСКИЙ ТЕКСТ) --- */
.sura-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.sura-header {
    text-align: center;
    border-bottom: 1.5px dashed var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.sura-title-text { font-size: 24px; font-weight: 800; color: var(--accent-green); }
.basmalah { text-align: center; font-size: 22px; color: var(--text-main); margin-bottom: 15px; }
.sura-text { font-size: 26px; line-height: 1.9; text-align: justify; direction: rtl; color: var(--text-main); }
.ayah-number { color: var(--accent-green); font-size: 18px; margin: 0 4px; font-weight: bold; }

/* --- СТИЛИ ДЛЯ 99 ИМЕН АЛЛАХА --- */
.names-container { display: flex; flex-direction: column; gap: 12px; }
.name-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 15px 20px; display: flex; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.02); transition: transform 0.1s;
}
.name-card:active { transform: scale(0.97); background-color: var(--bg-color); }
.name-number { width: 32px; height: 32px; background: var(--tint-bg); color: var(--accent-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; margin-right: 15px; flex-shrink: 0; }
.name-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.name-translit { font-size: 15px; font-weight: 800; color: var(--text-main); margin-bottom: 2px; }
.name-meaning { font-size: 12px; font-weight: 600; color: var(--gray-text); }
.name-arabic { font-size: 24px; color: var(--accent-green); margin-left: 15px; text-align: right; font-family: serif; }

/* --- СТИЛИ ДЛЯ АЗКАРОВ И ДУА --- */
.step-badge { display: inline-block; background: var(--accent-green); color: white; padding: 6px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; margin-bottom: 15px; box-shadow: 0 2px 6px rgba(104, 133, 115, 0.3); }
.dua-translit { font-size: 15px; font-weight: 700; color: var(--text-main); margin: 12px 0 5px 0; line-height: 1.5; }
.dua-translate { font-size: 14px; color: var(--gray-text); line-height: 1.5; margin-bottom: 10px; font-style: italic; }
.instruction { font-size: 13px; background: var(--tint-bg); padding: 12px 15px; border-radius: 12px; color: var(--text-main); border-left: 3px solid var(--accent-green); margin-top: 15px; font-weight: 500; }
.instruction-box { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }

/* --- СТИЛИ ДЛЯ СТИХОВ (ТАВБУ) --- */
.poem-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 30px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); margin-bottom: 20px; }
.poem-text { font-size: 16px; line-height: 1.8; color: var(--text-main); text-align: center; font-style: italic; font-weight: 500; }
.poem-text br { margin-bottom: 5px; }
.poem-stanza-break { display: block; height: 15px; }

/* --- СТИЛИ ДЛЯ САЛАВАТОВ --- */
.salavat-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.salavat-header { border-bottom: 1.5px dashed var(--border-color); padding-bottom: 12px; margin-bottom: 15px; }
.salavat-title { font-size: 18px; font-weight: 800; color: var(--accent-green); margin-bottom: 3px; }
.salavat-subtitle { font-size: 13px; font-weight: 600; color: var(--gray-text); }
.salavat-arabic { font-size: 26px; color: var(--text-main); text-align: center; line-height: 1.8; direction: rtl; margin: 15px 0 20px 0; font-family: serif; }
.salavat-translit { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; line-height: 1.6; }
.salavat-translate { font-size: 14px; color: var(--gray-text); font-style: italic; line-height: 1.6; margin-bottom: 15px; }
.salavat-benefits { background: var(--tint-bg); padding: 15px; border-radius: 12px; font-size: 13px; color: var(--text-main); line-height: 1.6; }
.salavat-benefits strong { display: block; color: var(--accent-green); margin-bottom: 5px; font-size: 14px; }
.salavat-benefits i { margin-right: 5px; }

/* --- СТИЛИ ДЛЯ ДУА --- */
.dua-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.dua-header { border-bottom: 1.5px dashed var(--border-color); padding-bottom: 12px; margin-bottom: 15px; }
.dua-title { font-size: 17px; font-weight: 800; color: var(--accent-green); line-height: 1.4; }
.dua-arabic { font-size: 26px; color: var(--text-main); text-align: center; line-height: 1.8; direction: rtl; margin: 15px 0; font-family: serif; }
.dua-translit { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; line-height: 1.6; }
.dua-translate { font-size: 14px; color: var(--gray-text); font-style: italic; line-height: 1.6; margin-bottom: 15px; }
.dua-benefits { background: var(--tint-bg); padding: 15px; border-radius: 12px; font-size: 13px; color: var(--text-main); line-height: 1.6; }
.dua-benefits strong { display: block; color: var(--accent-green); margin-bottom: 5px; font-size: 14px; }
.dua-benefits li { margin-bottom: 6px; }

/* --- СТИЛИ ДЛЯ ТАЙМЕРА --- */
.timer-container { display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.timer-display {
    font-size: 70px; font-weight: 800; font-variant-numeric: tabular-nums; 
    color: var(--accent-green); background: var(--card-bg); border: 3px solid var(--border-color);
    border-radius: 50%; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(104, 133, 115, 0.1); transition: all 0.3s;
}
.timer-display.finished { color: var(--danger-text); border-color: var(--danger-text); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4); } 70% { box-shadow: 0 0 0 20px rgba(229, 62, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0); } }
.buttons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin-bottom: 30px; }
.time-btn { background: var(--card-bg); border: 1.5px solid var(--border-color); color: var(--text-main); padding: 15px 0; border-radius: 16px; font-size: 15px; font-weight: 700; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.time-btn:active { transform: scale(0.95); }
.time-btn.active { background: var(--accent-green); color: white; border-color: var(--accent-green); }

.settings-group { background: var(--card-bg); width: 100%; border-radius: 20px; padding: 10px 20px; border: 1px solid var(--border-color); margin-bottom: 25px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 16px; font-weight: 600; color: var(--text-main); }
.toggle-label i { width: 20px; color: var(--gray-text); margin-right: 10px; }

/* iOS-подобный Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-green); }
input:checked + .slider:before { transform: translateX(22px); }

.reset-btn { width: 100%; background: var(--tint-bg); color: var(--text-main); border: none; padding: 18px; border-radius: 18px; font-size: 16px; font-weight: 700; cursor: pointer; transition: 0.1s; }
.reset-btn:active { background: var(--border-color); transform: scale(0.98); }

/* --- СТИЛИ ДЛЯ ИСТИХАРЫ --- */
.card-title { font-size: 19px; font-weight: 800; color: var(--accent-green); margin-bottom: 15px; border-bottom: 1.5px solid var(--border-color); padding-bottom: 8px; }
.intent-marker { display: block; background: var(--danger-bg); color: var(--danger-text); padding: 10px; border-radius: 10px; font-weight: 700; margin: 15px 0; border: 1px dashed var(--danger-border); text-align: center; font-size: 13px; }
.translit-box { background: var(--hover-bg); border: 1px solid var(--border-color); padding: 18px; border-radius: 15px; margin: 10px 0; }
.hadith-box { border-left: 4px solid var(--accent-green); padding: 15px; font-style: italic; background: var(--tint-bg); border-radius: 0 12px 12px 0; margin: 15px 0; }
.results-box { display: flex; flex-direction: column; gap: 12px; }
/* ИСПРАВЛЕНИЕ: Был жесткий white, заменен на var(--card-bg) */
.result-item { display: flex; align-items: center; background: var(--card-bg); padding: 12px 15px; border-radius: 14px; border: 1px solid var(--border-color); font-weight: 600; }
.result-nums { background: var(--accent-green); color: white; padding: 4px 12px; border-radius: 10px; font-weight: 800; margin-right: 15px; min-width: 75px; text-align: center; box-shadow: 0 2px 5px rgba(104, 133, 115, 0.2); }

/* --- СТИЛИ ДЛЯ РУЗНАМЫ (ВРЕМЯ НАМАЗОВ) --- */
.custom-dropdown { position: relative; width: 100%; }
.dropdown-header { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.02); font-weight: 700; font-size: 16px; color: var(--text-main); transition: 0.2s; }
.dropdown-header-left i { color: var(--accent-green); margin-right: 10px; }
.custom-dropdown.open .dropdown-header { border-radius: 16px 16px 0 0; border-bottom: none; }
.custom-dropdown.open .fa-chevron-down { transform: rotate(180deg); }
/* ИСПРАВЛЕНИЕ: Был жесткий white, заменен на var(--card-bg) */
.dropdown-list { position: absolute; top: 100%; left: 16px; right: 16px; background: var(--card-bg); border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 16px 16px; box-shadow: 0 10px 15px rgba(0,0,0,0.05); z-index: 100; list-style: none; padding: 0; margin: 0; display: none; max-height: 250px; overflow-y: auto; }
.custom-dropdown.open .dropdown-list { display: block; animation: fadeInDown 0.2s ease-out; }
.dropdown-item { padding: 14px 20px; cursor: pointer; font-weight: 500; color: var(--text-main); transition: background 0.1s; border-bottom: 1px solid var(--border-color); }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item:active { background: var(--hover-bg); }
.dropdown-item.selected { color: var(--accent-green); font-weight: 800; background: var(--tint-bg); }
.times-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.time-card { background: var(--card-bg); border: 1px solid var(--border-color); padding: 20px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.time-label { font-size: 16px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; }
.time-label i { width: 25px; color: var(--accent-green); font-size: 18px; margin-right: 10px; }
.time-value { font-size: 22px; font-weight: 800; color: var(--accent-green); font-variant-numeric: tabular-nums; transition: opacity 0.3s; }

/* --- СТИЛИ ДЛЯ ТАСБИХА --- */
.tasbih-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 65vh; position: relative; touch-action: manipulation; }
.tap-area { position: absolute; top: -20px; left: -20px; right: -20px; bottom: -20px; z-index: 10; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.count-display { font-size: 110px; font-weight: 800; color: var(--accent-green); z-index: 1; font-variant-numeric: tabular-nums; transition: transform 0.1s cubic-bezier(0.25, 1, 0.5, 1), color 0.1s; user-select: none; }
.count-display.pulse { transform: scale(1.1); }
.reset-btn-tasbih { position: absolute; bottom: -30px; z-index: 20; background: var(--tint-bg); color: var(--text-main); border: none; padding: 14px 28px; border-radius: 20px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: 0.2s; }
.reset-btn-tasbih:active { transform: scale(0.95); background: var(--border-color); }

/* --- СТИЛИ ДЛЯ ХИЗБУ --- */
.book-container { 
    display: flex; flex-direction: column; align-items: center; gap: 15px; padding-top: 10px; 
}

/* ИЗМЕНЕНИЕ 1: Убрали белый фон и тень. Теперь картинка полностью прозрачная! */
.book-page-img { 
    width: 100%; 
    max-width: 500px; 
    height: auto; 
    display: block; 
    background: transparent !important; /* Было var(--card-bg) */
    box-shadow: none !important; /* Убрали тень, так как нет фона */
}

/* ИЗМЕНЕНИЕ 2: Идеальная инверсия текста. В темных темах черный текст станет белым. */
body.dark-mode .book-page-img,
body.theme-red .book-page-img,
body.theme-purple .book-page-img,
body.theme-gold .book-page-img,
body.theme-brown .book-page-img { 
    filter: invert(1) brightness(1.5) !important; /* Черный текст превращается в яркий белый */
}

/* --- СТИЛИ ДЛЯ КОМПАСА (КИБЛА) --- */
.qibla-main-container { display: flex; flex-direction: column; align-items: center; gap: 25px; padding: 10px 0; }
.compass-card { width: 280px; height: 280px; background: var(--card-bg); border-radius: 50%; box-shadow: 0 10px 30px rgba(104, 133, 115, 0.15); display: flex; align-items: center; justify-content: center; position: relative; border: 4px solid var(--border-color); }
.compass-rim { width: 230px; height: 230px; position: relative; border-radius: 50%; border: 2px dashed #cbd5e1; }
.c-label { position: absolute; font-weight: 800; font-size: 20px; color: var(--text-main); }
.c-n { top: -8px; left: 50%; transform: translateX(-50%); color: #e53e3e; }
.c-s { bottom: -8px; left: 50%; transform: translateX(-50%); }
.c-e { right: -5px; top: 50%; transform: translateY(-50%); }
.c-w { left: -5px; top: 50%; transform: translateY(-50%); }
.c-center { width: 14px; height: 14px; background: var(--accent-green); border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10; border: 3px solid var(--card-bg); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.qibla-arrow-group { position: absolute; top: 5px; left: 50%; width: 40px; height: 220px; transform-origin: center center; margin-left: -20px; transition: transform 0.1s linear; will-change: transform; z-index: 5; }
.status-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 24px; padding: 25px 20px; width: 100%; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.deg-display { font-size: 50px; font-weight: 800; color: var(--text-main); display: none; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.q-angle-val { font-size: 16px; font-weight: 700; color: var(--accent-green); margin-bottom: 20px; display: none; }
.activate-btn { background: var(--accent-green); color: white; border: none; padding: 18px 30px; border-radius: 16px; font-size: 16px; font-weight: 800; cursor: pointer; width: 100%; transition: 0.2s; box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3); }
.activate-btn:active { transform: scale(0.96); }
.instr-text { font-size: 13px; color: var(--gray-text); line-height: 1.6; margin-top: 15px; }

/* --- СТИЛИ ДЛЯ АУДИОКНИГ --- */
.audio-books-container { display: flex; flex-direction: column; gap: 15px; }
.book-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; padding: 16px; display: flex; align-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.02); transition: all 0.2s ease; }
.book-card:active { transform: scale(0.97); background: var(--hover-bg); }
.book-card.playing { border-color: var(--accent-green); background: var(--tint-bg); box-shadow: 0 4px 15px rgba(74, 222, 128, 0.15); }
.book-cover { width: 50px; height: 50px; background: var(--border-color); color: var(--text-main); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-right: 15px; flex-shrink: 0; transition: 0.3s; }
.book-card.playing .book-cover { background: var(--accent-green); color: white; }
.book-info { flex: 1; overflow: hidden; }
.book-title { font-size: 16px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-author { font-size: 13px; font-weight: 600; color: var(--gray-text); margin-bottom: 2px; }
.book-desc { font-size: 12px; color: #94a3b8; font-style: italic; }
/* ИСПРАВЛЕНИЕ: Был жесткий white, заменен на var(--card-bg) */
.play-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--card-bg); border: 1.5px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--accent-green); font-size: 16px; margin-left: 10px; flex-shrink: 0; transition: 0.2s; }
.book-card.playing .play-btn { background: var(--accent-green); color: white; border-color: var(--accent-green); }

/* --- СТИЛИ ДЛЯ ДВОЙНОГО КАЛЕНДАРЯ --- */
.today-card { background: linear-gradient(135deg, var(--accent-green), #3bba6c); border-radius: 20px; padding: 25px 20px; color: white; text-align: center; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3); position: relative; overflow: hidden; }
.today-card::after { content: '\f651'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: -20px; bottom: -20px; font-size: 100px; color: white; opacity: 0.1; z-index: 0; }
.today-title { font-size: 14px; font-weight: 600; opacity: 0.9; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; position: relative; z-index: 1; }
.today-hijri { font-size: 26px; font-weight: 800; margin-bottom: 5px; position: relative; z-index: 1; }
.today-gregorian { font-size: 16px; font-weight: 500; opacity: 0.9; position: relative; z-index: 1; }
.calendar-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cal-nav-btn { background: var(--tint-bg); border: none; width: 36px; height: 36px; border-radius: 12px; color: var(--text-main); font-size: 16px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.cal-nav-btn:active { transform: scale(0.9); background: var(--border-color); }
.cal-month-titles { text-align: center; }
.cal-month-gregorian { font-size: 17px; font-weight: 800; color: var(--text-main); text-transform: capitalize; }
.cal-month-hijri { font-size: 13px; font-weight: 600; color: var(--accent-green); text-transform: capitalize; }
.weekdays-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; font-weight: 700; color: var(--gray-text); margin-bottom: 10px; }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.day-cell { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: var(--hover-bg); color: var(--text-main); font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.day-cell.empty { background: transparent; }
.day-gregorian { font-size: 16px; font-weight: 700; }
.day-hijri { font-size: 11px; font-weight: 600; color: var(--accent-green); margin-top: -2px; }
.day-cell.today { background: var(--accent-green); color: white; box-shadow: 0 4px 10px rgba(74, 222, 128, 0.4); }
.day-cell.today .day-hijri { color: rgba(255, 255, 255, 0.9); }

/* --- СТИЛИ ДЛЯ НАСТРОЕК АЗАНА --- */
.azan-card { background: var(--card-bg); border-radius: 20px; padding: 22px 20px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border-color); }
.azan-info { flex: 1; padding-right: 15px; }
.azan-info h3 { margin: 0 0 5px 0; font-size: 17px; font-weight: 800; color: var(--text-main); }
.azan-info p { margin: 0; font-size: 13px; color: var(--gray-text); line-height: 1.4; }

.toggle-switch { position: relative; display: inline-block; width: 54px; height: 30px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .3s; border-radius: 34px; }
.toggle-slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 4px; bottom: 4px; background: var(--card-bg); transition: .3s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background-color: var(--accent-green); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }

/* --- СТИЛИ ДЛЯ СПИСКА АЗАНОВ --- */
.azan-list-card { background: var(--card-bg); border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid var(--border-color); overflow: hidden; margin-bottom: 20px; }
/* ИСПРАВЛЕНИЕ: Был жесткий white, заменен на var(--card-bg) */
.azan-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--card-bg); transition: background 0.2s; }
.azan-item:last-child { border-bottom: none; }
.azan-item:active { background: var(--hover-bg); }
.azan-item-left { display: flex; flex-direction: column; }
.azan-name { font-size: 17px; font-weight: 800; color: var(--text-main); }
.azan-time { font-size: 14px; font-weight: 700; color: var(--accent-green); margin-top: 4px; }

/* ==========================================================================
   ИММЕРСИВНЫЕ ТЕМЫ (ПОЛНОЦЕННОЕ ОФОРМЛЕНИЕ ВСЕГО ПРИЛОЖЕНИЯ)
========================================================================== */

/* 1. Светлый (Классический зеленый) - берет цвета по умолчанию из :root */
body.theme-green { --accent-green: #688573; }

/* 2. Глубокий Синий (Ночной Океан) */
body.theme-blue {
    --bg-color: #f0f9ff;          /* Нежнейший небесный фон страницы */
    --card-bg: #ffffff;           /* Белоснежные карточки (выделяются на фоне) */
    --text-main: #0c4a6e;         /* Глубокий темно-синий текст (для чтения) */
    --gray-text: #64748b;         /* Серый текст с синим отливом */
    --border-color: #e0f2fe;      /* Мягкие, едва заметные голубые границы */
    
    --accent-green: #0284c7;      /* Насыщенный синий акцент (кнопки, ползунки) */
    
    /* Умные оттенки для ховеров и выделений */
    --tint-bg: rgba(2, 132, 199, 0.08);
    --hover-bg: rgba(2, 132, 199, 0.04);
    
    /* Фон краев приложения (когда Wrapper по центру) - оставляем стандартный серый */
    background-color: #e2e8f0; 
    color: var(--text-main);
}
/* Специальная настройка для арабского текста в инфо-карточке для этой темы */
body.theme-blue .info-card .arabic-text1 { color: #0284c7; }

/* 3. Глубокий Красный (Рубин) */
body.theme-red {
    --bg-color: #271011;          /* Темно-бордовый фон */
    --card-bg: #3f181a;           /* Карточки с красным отливом */
    --text-main: #fff1f2;         /* Светло-розовый текст */
    --gray-text: #fecdd3;         /* Приглушенный текст */
    --border-color: #6a282c;      /* Красные границы */
    --accent-green: #fb7185;      /* Яркий рубиновый акцент */
    --tint-bg: rgba(251, 113, 133, 0.15);
    --hover-bg: rgba(251, 113, 133, 0.08);
    background-color: #170809;
    color: var(--text-main);
}

/* 4. Глубокий Фиолетовый (Аметист) */
body.theme-purple {
    --bg-color: #1e1b4b;          /* Темно-фиолетовый фон */
    --card-bg: #2e2a68;           /* Карточки */
    --text-main: #f5f3ff;         /* Светло-фиолетовый текст */
    --gray-text: #c4b5fd;         /* Приглушенный текст */
    --border-color: #4c1d95;      /* Фиолетовые границы */
    --accent-green: #a78bfa;      /* Яркий аметист */
    --tint-bg: rgba(167, 139, 250, 0.15);
    --hover-bg: rgba(167, 139, 250, 0.08);
    background-color: #110e2b;
    color: var(--text-main);
}

/* 1. Классический Зеленый (Полный блок) */
body.theme-green { 
    --bg-color: #f8f9fb;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --gray-text: #a0aec0;
    --border-color: #edf2f7;
    --accent-green: #688573; 
    --tint-bg: rgba(104, 133, 115, 0.1);
    --hover-bg: rgba(104, 133, 115, 0.05);
    background-color: #e2e8f0;
    color: var(--text-main);
}

/* 5. Темный режим (Белый акцент на черном фоне) */
body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --gray-text: #94a3b8;
    --border-color: #334155;
    --accent-green: #f8fafc; /* В темной теме текст/иконки белые */
    --tint-bg: rgba(255, 255, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.02);
    background-color: #020617; 
    color: var(--text-main);
}

/* ----------------------------------------------------------------------
   НОВЫЕ ИММЕРСИВНЫЕ ТЕМЫ (ЗОЛОТАЯ, ОРАНЖЕВАЯ, КОРИЧНЕВАЯ)
   ---------------------------------------------------------------------- */

/* 6. Премиальный Золотой (Глубокий темный фон с золотом) */
body.theme-gold {
    --bg-color: #241f12;          /* Темный с золотым отливом */
    --card-bg: #332d1d;           /* Карточки под темное золото */
    --text-main: #fef3c7;         /* Светло-желтый текст */
    --gray-text: #d4d4d8;         /* Приглушенный текст */
    --border-color: #52472d;      /* Границы */
    --accent-green: #fbbf24;      /* Яркое золото для акцентов */
    --tint-bg: rgba(251, 191, 36, 0.15);
    --hover-bg: rgba(251, 191, 36, 0.08);
    background-color: #1a160d;
    color: var(--text-main);
}


/* 7. Уютный Коричневый (Кофе и темное дерево) */
body.theme-brown {
    --bg-color: #3e2723;          /* Цвет темного шоколада */
    --card-bg: #4e342e;           /* Кофейные карточки */
    --text-main: #efebe9;         /* Светлый кремовый текст */
    --gray-text: #bcaaa4;         /* Приглушенный песочный */
    --border-color: #5d4037;
    --accent-green: #e6b17e;      /* Мягкая карамель/дерево */
    --tint-bg: rgba(230, 177, 126, 0.15);
    --hover-bg: rgba(230, 177, 126, 0.08);
    background-color: #261612;
    color: var(--text-main);
}

/* 8. Теплый Оранжевый (Светлая осенняя тема) */
body.theme-orange {
    --bg-color: #fff7ed;          /* Очень светлый оранжевый фон */
    --card-bg: #ffffff;           /* Белые карточки */
    --text-main: #7c2d12;         /* Темно-оранжевый/коричневый текст */
    --gray-text: #9a3412;         /* Приглушенный оранжевый */
    --border-color: #ffedd5;
    --accent-green: #f97316;      /* Сочный оранжевый */
    --tint-bg: rgba(249, 115, 22, 0.1);
    --hover-bg: rgba(249, 115, 22, 0.05);
    background-color: #f8fafc;
    color: var(--text-main);
}

/* ИНВЕРСИЯ КАРТИНОК (ХИЗБУ) ДЛЯ ВСЕХ ТЕМНЫХ ТЕМ */
body.dark-mode .book-page-img,
body.theme-red .book-page-img,
body.theme-purple .book-page-img,
body.theme-gold .book-page-img,
body.theme-brown .book-page-img { 
    filter: invert(0.9) hue-rotate(180deg); 
}

/* --- СТИЛИ ДЛЯ НОВОГО ДИЗАЙНА МЕНЮ НАСТРОЕК (КАК НА СКРИНШОТЕ) --- */
.settings-section { margin-bottom: 25px; }
.settings-title { font-size: 13px; font-weight: 800; color: var(--gray-text); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* Карточки режимов (Компактная сетка 3х3) */
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 12px 5px;
    border-radius: 16px; border: 2px solid transparent;
    background: var(--card-bg); cursor: pointer; transition: 0.2s;
    border: 1px solid var(--border-color);
}
.mode-card.active { border-color: var(--accent-green); background: var(--tint-bg); }
.mode-icon {
    width: 36px; height: 36px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 8px; flex-shrink: 0;
    margin-right: 0 !important; /* Убираем старый отступ, чтобы иконка была по центру */
}
.mode-text { text-align: center; }
.mode-name { font-size: 13px; font-weight: 700; color: var(--text-main); margin: 0; }
.mode-radio, .mode-desc { display: none !important; } /* Прячем лишний текст и кружочки */

/* Цвета кружочков */
.bg-green { background-color: #688573; }
.bg-blue { background-color: #55a5c6; }
.bg-red { background-color: #d1645a; }
.bg-gold { background-color: #da9c20; }
.bg-purple { background-color: #9575cd; }
.bg-turquoise { background-color: #569b97; }

/* Кнопка установки */
.install-btn { 
    width: 100%; padding: 16px; border-radius: 16px; 
    background: var(--text-main); color: var(--card-bg); 
    font-weight: 800; font-size: 16px; border: none; 
    cursor: pointer; display: none; align-items: center; 
    justify-content: center; gap: 10px; transition: 0.2s; 
}
.install-btn:active { transform: scale(0.96); }
.install-btn.visible { display: flex; }

/* ==========================================================================
   ПОДКЛЮЧЕНИЕ АРАБСКИХ ШРИФТОВ
========================================================================== */
@font-face { font-family: 'Uthmani'; src: url('../fonts/Uthmani.ttf') format('truetype'); }
@font-face { font-family: 'IndoPak'; src: url('../fonts/IndoPak.ttf') format('truetype'); }
@font-face { font-family: 'Amiri'; src: url('../fonts/Amiri.ttf') format('truetype'); }

/* Переменная шрифта (по умолчанию Усмани) */
body { --arabic-font: 'Uthmani', serif; }
body.font-uthmani { --arabic-font: 'Uthmani', serif; }
body.font-indopak { --arabic-font: 'IndoPak', serif; }
body.font-amiri   { --arabic-font: 'Amiri', serif; }

/* ПРИМЕНЯЕМ ШРИФТ КО ВСЕМ АРАБСКИМ ТЕКСТАМ */
.arabic-text, 
.sura-text, 
.name-arabic, 
.dua-arabic, 
.salavat-arabic, 
.basmalah {
    font-family: var(--arabic-font) !important;
}

/* --- СТИЛИ ДЛЯ ВЫБОРА ШРИФТА --- */
.font-selector { display: flex; flex-direction: column; gap: 8px; }
.font-btn {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: 16px;
    cursor: pointer; transition: 0.2s; color: var(--text-main);
}
.font-btn.active { border-color: var(--accent-green); background: var(--tint-bg); }
.font-btn-name { font-size: 15px; font-weight: 700; }
.font-btn-preview { font-size: 24px; color: var(--accent-green); }
.font-btn-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: transparent; font-size: 10px; }
.font-btn.active .font-btn-radio { background: var(--accent-green); border-color: var(--accent-green); color: white; }

/* ==========================================================================
   ГЛОБАЛЬНЫЙ МАСШТАБ ТЕКСТА (ИЗ НАСТРОЕК)
========================================================================== */
:root { --text-scale: 1; }

/* Дизайн окна превью в настройках */
.text-size-preview-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 15px;
    margin-bottom: 12px;
    text-align: center;
    min-height: 110px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.preview-arabic {
    font-family: var(--arabic-font), serif;
    color: var(--text-main);
    font-size: calc(24px * var(--text-scale)); /* Реагирует на ползунок */
    line-height: 1.5;
}

.preview-cyrillic {
    color: var(--gray-text);
    font-size: calc(13px * var(--text-scale)); /* Реагирует на ползунок */
}

/* Дизайн ползунка в настройках */
.global-text-slider {
    display: flex; align-items: center; gap: 15px;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 100px; padding: 12px 20px;
}
#globalTextScaleInput {
    flex: 1; -webkit-appearance: none; height: 6px;
    background: var(--border-color); border-radius: 5px; outline: none;
}
#globalTextScaleInput::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px;
    border-radius: 50%; background: var(--accent-green);
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ЖЕЛЕЗОБЕТОННОЕ ПРИМЕНЕНИЕ ТОЛЬКО К СТРАНИЦАМ ЧТЕНИЯ (Не трогает главную!) */
#dynamicContent .sura-text { font-size: calc(26px * var(--text-scale)) !important; }
#dynamicContent .arabic-text { font-size: calc(24px * var(--text-scale)) !important; }
#dynamicContent .cyrillic-text { font-size: calc(15px * var(--text-scale)) !important; }
#dynamicContent .translation { font-size: calc(13px * var(--text-scale)) !important; }
#dynamicContent .dua-translit { font-size: calc(15px * var(--text-scale)) !important; }
#dynamicContent .dua-translate { font-size: calc(14px * var(--text-scale)) !important; }
#dynamicContent .dua-arabic { font-size: calc(26px * var(--text-scale)) !important; }
#dynamicContent .salavat-arabic { font-size: calc(26px * var(--text-scale)) !important; }
#dynamicContent .salavat-translit { font-size: calc(15px * var(--text-scale)) !important; }
#dynamicContent .salavat-translate { font-size: calc(14px * var(--text-scale)) !important; }
#dynamicContent .poem-text { font-size: calc(16px * var(--text-scale)) !important; }
#dynamicContent .name-arabic { font-size: calc(24px * var(--text-scale)) !important; }
#dynamicContent .name-translit { font-size: calc(15px * var(--text-scale)) !important; }
#dynamicContent .name-meaning { font-size: calc(12px * var(--text-scale)) !important; }

/* ==========================================================================
   ПОДМЕНЮ С ВЫЕЗДОМ СПРАВА НАЛЕВО (ИДЕАЛЬНАЯ АНИМАЦИЯ)
========================================================================== */
.native-submenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color); /* Основной фон */
    z-index: 1500; 
    
    /* Окно спрятано на 100% ширины экрана вправо */
    transform: translateX(100%); 
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    
    display: flex;
    flex-direction: column;
}

/* Когда добавляется класс active, окно выезжает на 0 (встает по центру) */
.native-submenu.active {
    transform: translateX(0); 
}

/* Шапка выезжающего окна */
.submenu-header {
    display: flex; align-items: center; padding: 15px 20px;
    background: var(--card-bg); border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); gap: 15px;
    padding-top: env(safe-area-inset-top, 20px);
}
.submenu-back-btn {
    background: none; border: none; font-size: 20px; color: var(--text-main);
    cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center;
}
.submenu-title { font-size: 18px; font-weight: bold; color: var(--text-main); }
.submenu-content { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   МИНИ-ТАСБИХ ДЛЯ СТРАНИЦ ЧТЕНИЯ (ПЛАВАЮЩАЯ КАПСУЛА)
========================================================================== */
.mini-tasbih-widget {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 6px 6px 6px 16px;
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 100;
}

/* Кнопка сброса (слева) */
.mini-tasbih-reset {
    background: transparent;
    border: none;
    color: var(--gray-text);
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    outline: none;
}
.mini-tasbih-reset:active {
    background: var(--tint-bg);
    color: var(--text-main);
    transform: rotate(-45deg);
}

/* Сама кнопка счета (справа) */
.mini-tasbih-btn {
    background: var(--accent-green);
    color: white;
    padding: 10px 30px;
    border-radius: 100px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.1s, background-color 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.mini-tasbih-btn:active {
    transform: scale(0.92);
}

.mini-tasbih-count {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums; /* Цифры не прыгают при изменении ширины */
}
.mini-tasbih-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 600;
}


/* ==========================================================================
   ОТМЕТКИ БЛАГОПРИЯТНЫХ/НЕБЛАГОПРИЯТНЫХ ДНЕЙ В КАЛЕНДАРЕ
========================================================================== */
.calendar-dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    height: 6px;
}
.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.cal-dot.blue { background-color: #0ea5e9; }   /* Синий (П) */
.cal-dot.red { background-color: #ef4444; }    /* Красный (К) */
.cal-dot.orange { background-color: #f97316; } /* Оранжевый (Т) */

/* Легенда под календарем */
.calendar-legend {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 15px 20px;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.legend-item:last-child { margin-bottom: 0; }
.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 3px;
    flex-shrink: 0;
}
.legend-text {
    font-size: 13px;
    color: var(--gray-text);
    line-height: 1.4;
}
.legend-text strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}
