/* ============================================
   МирПитомца v2.0 — Стиль для Android
   Адаптировано под сенсорное управление
   Оптимизировано: min-width 320px, max-width 480px
   ============================================ */

:root {
    --primary: #FF6B35;
    --primary-rgb: 255,107,53;
    --primary-dark: #E55A20;
    --secondary: #FF9A00;
    --bg-gradient: linear-gradient(135deg, #FF6B35, #FF9A00);
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 24px);
    --nav-height: 76px;
    --header-height: 56px;
    --ad-banner-height: 50px;
    --ad-banner-top-height: 0px;
    --transition: 0.2s ease;
    --border: #e0e0e0;
    --surface: #f5f5f5;
    /* z-index шкала: modal(500) < drawer(2000) < fab(3000) < ad(4000) < dialog(5000) < auth(6000) < confirm(9000) */
    --z-modal:       500;
    --z-drawer:      2000;
    --z-drawer-panel: 2001;
    --z-fab:         3000;
    --z-ad:          4000;
    --z-dialog:      5000;
    --z-auth:        6000;
    --z-onboarding:  6001;
    --z-confirm:     9000;
}

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

/* ===== ОНБОРДИНГ ===== */
.onboarding-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: var(--z-onboarding);
    background: var(--bg-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 48px 24px 40px;
    overflow: hidden;
}
.onboarding-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    width: 100%;
    animation: obFadeIn 0.35s ease;
}
.onboarding-slide.active { display: flex; }
@keyframes obFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.onboarding-icon { margin-bottom: 20px; color: #FF6B35; }
.onboarding-icon svg {
    width: 90px;
    height: 90px;
    display: block;
    background: white;
    border-radius: 22px;
    padding: 18px;
    box-sizing: border-box;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.onboarding-logo {
    width: 90px;
    height: 90px;
    box-sizing: border-box;
    object-fit: contain;
    background: white;
    border-radius: 22px;
    padding: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.onboarding-title {
    font-size: 1.6em;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    line-height: 1.2;
}
.onboarding-desc {
    font-size: 0.95em;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    max-width: 300px;
}
.onboarding-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.onboarding-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transition: all 0.25s;
}
.onboarding-dot.active {
    width: 24px;
    border-radius: 4px;
    background: white;
}
.onboarding-btn {
    width: 100%;
    max-width: 320px;
    padding: 16px;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 14px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.onboarding-skip {
    font-size: 0.85em;
    color: rgba(255,255,255,0.65);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

/* ========== ШТОРКА АВТОРИЗАЦИИ ========== */
/* ===== ЭКРАН СОГЛАСИЯ ===== */
.consent-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10001;
    background: var(--bg-gradient);
    overflow-y: auto;
    padding: 24px 16px 40px;
}
.consent-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}
.consent-logo { font-size: 3.5em; margin-bottom: 8px; }
.consent-title {
    font-size: 1.5em;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
}
.consent-intro {
    color: rgba(255,255,255,0.85);
    font-size: 0.9em;
    margin-bottom: 20px;
}
.consent-block {
    background: rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: left;
}
.consent-block-required { border-left: 3px solid #ff6b6b; }
.consent-block-optional { border-left: 3px solid rgba(255,255,255,0.4); }
.consent-block-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.consent-block-header strong { color: white; font-size: 0.9em; }
.consent-badge {
    font-size: 0.68em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.consent-badge-required { background: #ff6b6b; color: white; }
.consent-badge-optional { background: rgba(255,255,255,0.25); color: white; }
.consent-text {
    font-size: 0.8em;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    margin-bottom: 12px;
}
.consent-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: white;
    font-size: 0.85em;
    line-height: 1.4;
}
.consent-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #FF6B35;
}
.consent-checkbox-label a { color: #FFD4C2; }
.consent-links {
    font-size: 0.78em;
    color: rgba(255,255,255,0.6);
    margin: 12px 0 16px;
}
.consent-links a { color: #b3c7ff; }
.consent-btn {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 12px;
    transition: opacity 0.2s;
    box-sizing: border-box;
    border: 2px solid rgba(255,255,255,0.85);
}
.consent-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* ========================== */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-auth);
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    visibility: visible;
}
.auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.auth-overlay-content {
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.auth-overlay-logo {
    margin-bottom: 8px;
}
.auth-overlay-logo img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: white;
    border-radius: 22px;
    padding: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.auth-overlay-title {
    font-size: 2em;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
}
.auth-overlay-subtitle {
    font-size: 1em;
    color: rgba(255,255,255,0.8);
    margin-bottom: 32px;
}
.auth-overlay-form {
    text-align: left;
}
.auth-overlay-form .m-form-group {
    margin-bottom: 12px;
}
.auth-overlay-form .m-input {
    background: rgba(255,255,255,0.95);
    border: none;
    padding: 14px 16px;
    font-size: 1em;
    border-radius: 12px;
}
.auth-overlay-form .m-input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
    outline: none;
}
.auth-overlay-btn {
    width: 100%;
    padding: 14px !important;
    font-size: 1.05em !important;
    margin-bottom: 8px;
    border-radius: 12px !important;
    box-sizing: border-box;
    border: 2px solid rgba(255,255,255,0.85) !important;
}

/* Чекбокс "Запомнить меня" в оверлее авторизации */
.auth-overlay-form .remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px 0;
}
.auth-overlay-form .remember-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary, #FF6B35);
    flex-shrink: 0;
}
.auth-overlay-form .remember-row label {
    font-size: 0.9em;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    user-select: none;
}
.auth-overlay-error {
    color: #ffcdd2;
    font-size: 0.85em;
    text-align: center;
    margin-top: 8px;
    padding: 8px;
    background: rgba(255,0,0,0.15);
    border-radius: 8px;
}
/* ========== /ШТОРКА АВТОРИЗАЦИИ ========== */

/* ========== АДАПТИВНЫЕ РАЗМЕРЫ ШРИФТОВ ========== */
/* Базовый размер шрифта — плавно масштабируется от ширины экрана:
   14px на 320px → 16px на 411px → 18px на 480px+ */
:root {
    --font-base: clamp(14px, 4vw, 18px);
    --font-sm: clamp(12px, 3.5vw, 15px);
    --font-xs: clamp(11px, 3vw, 13px);
}

/* Сброс */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: #f5f6fa;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--font-base);
}

/* Маленькие экраны (<360px) — чуть меньше отступы и шрифты */
@media (max-width: 359px) {
    :root {
        --font-base: 13px;
        --font-sm: 11.5px;
        --font-xs: 10.5px;
    }
}

/* Большие экраны (≥430px, фаблеты) — чуть крупнее */
@media (min-width: 430px) {
    :root {
        --font-base: clamp(16px, 4vw, 20px);
        --font-sm: clamp(14px, 3.5vw, 17px);
        --font-xs: clamp(12px, 3vw, 14px);
    }
}

body {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
    background: transparent;
}

/* Запрет зума на инпутах */
input, select, textarea, button {
    font-size: 16px;
}

/* ========== СТАТУС-БАР (имитация) ========== */
.status-bar {
    height: 0;
    background: transparent;
    flex-shrink: 0;
}

/* ========== ВЕРХНИЙ ХЕДЕР ========== */
.mobile-header {
    position: fixed;
    top: var(--ad-banner-top-height);
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, #FFD4C2 0%, #FFFFFF 100%);
    padding: 0 16px;
    /* --header-inset-top отдельно от --safe-top: когда нативный рекламный баннер уже включает
       высоту статус-бара в свой сдвиг (--ad-banner-top-height = safe-top + высота баннера),
       повторное добавление safe-top здесь задваивало отступ и создавало пустую полосу под
       баннером (жалоба пользователя со скриншотом, 19.09.2026, только в бесплатном режиме с
       баннером — без баннера --header-inset-top остаётся var(--safe-top) через фолбэк). */
    padding-top: var(--header-inset-top, var(--safe-top));
    height: calc(var(--header-height) + var(--header-inset-top, var(--safe-top)));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(255,107,53,0.10);
    /* Собственный GPU-слой — без него при быстрой прокрутке мобильный браузер иногда не успевает
       перерисовать fixed-шапку синхронно со скроллящимся контентом (см. mobile/styles.css). */
    transform: translateZ(0);
    will-change: transform;
}

.mobile-header .logo {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.mobile-header .logo svg {
    flex-shrink: 0;
}

.mobile-header .header-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--primary);
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header .header-btn {
    background: none;
    border: none;
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.mobile-header .header-btn:active {
    background: rgba(255,107,53,0.10);
}

/* Кнопка "←" назад */
.header-back-btn {
    font-size: 1.3em;
    padding: 4px 6px 4px 10px;
    margin-right: 0;
    min-width: 36px;
    justify-content: flex-start;
    color: var(--primary);
}

/* ========== ДРОПДАУН АВТОРИЗАЦИИ (прижат к правому краю) ========== */
#mobileAuthDropdown {
    position: fixed;
    top: calc(var(--safe-top) + var(--header-height));
    right: 12px;
    left: auto;
    width: 280px;
    max-width: calc(100vw - 24px);
    z-index: 99;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.mobile-content {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: calc(var(--header-height) + var(--header-inset-top, var(--safe-top)) + var(--ad-banner-top-height));
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--ad-banner-height) + 8px);
    padding-left: 0;
    padding-right: 0;
    background: transparent;
}

.mobile-content::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* ========== НИЖНЯЯ НАВИГАЦИЯ (Bottom Tab Bar) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    height: calc(var(--nav-height) + var(--safe-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
    /* Тот же класс бага, что и у .mobile-header — свой GPU-слой (см. mobile/styles.css). */
    transform: translateZ(0);
    will-change: transform;
}

/* ========== ЯНДЕКС БАННЕР 320x50 (sticky) ========== */
.ad-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    z-index: 101;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner.hidden {
    display: none;
}

/* ========== БАННЕР ПРОДЛЕНИЯ ПОДПИСКИ ========== */
.renewal-banner {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom));
    left: 0;
    right: 0;
    z-index: 98;
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
}
.renewal-banner.hidden {
    display: none;
}

.ad-banner-rsya {
    width: 100%;
    max-width: 728px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-banner-rsya.hidden {
    display: none;
}

.ad-banner-inner {
    width: 320px;
    height: 50px;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    box-sizing: border-box;
    position: relative;
    background: #fff;
}

.ad-label {
    position: absolute;
    top: 3px;
    right: 6px;
    font-size: 9px;
    color: #aaa;
    line-height: 1;
    pointer-events: none;
    letter-spacing: 0.1px;
}

.ad-yandex-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fc3f1d;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    font-family: Arial, sans-serif;
    letter-spacing: -0.5px;
    user-select: none;
}

.ad-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f0f4ff;
}

.ad-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ad-title {
    font-size: 12px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ad-sub {
    font-size: 10px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 1px;
}

.ad-cta {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #fc3f1d;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}


.nav-item {
    flex: 1;
    height: 100%;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: #999;
    font-size: 0.6em;
    cursor: pointer;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    padding: 8px 4px;
    padding-bottom: calc(8px + var(--safe-bottom));
    box-sizing: border-box;
}

.nav-item .nav-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), box-shadow var(--transition);
}

.nav-item .nav-label {
    font-weight: 500;
    font-size: 10px;
    line-height: 1;
}

.nav-item:active .nav-icon-wrap {
    opacity: 0.75;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* Активный кружок подсвечивается и имеет тень */
.nav-item.active .nav-icon-wrap {
    box-shadow: 0 3px 8px rgba(255,107,53,0.25);
}

/* Бейдж уведомлений */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    margin-right: -22px;
    min-width: 18px;
    height: 18px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    font-size: 0.6em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}

/* ========== КАРТОЧКИ ========== */
.m-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition);
    width: 100%;
}

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

.m-calendar-card {
    padding-left: 6px;
    padding-right: 6px;
}

.m-calendar-card:active {
    transform: none;
}

.m-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.m-card-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--primary);
}

.m-card-subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.m-card-body {
    font-size: 0.95em;
    color: var(--text);
    line-height: 1.5;
}

/* ========== СЕТКА ГЛАВНОЙ СТРАНИЦЫ ========== */

/* Строка с двумя блоками (Мои питомцы + Калькулятор) */
.m-home-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

/* Сетка карточек-инструментов главной страницы (веб) — ровно 4 колонки,
   растягиваются на всю ширину контента (8 карточек = 2 полных ряда по 4) */
.m-home-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
@media (max-width: 420px) {
    .m-home-tools-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Мини-карточка для главной */
.m-home-mini {
    background: white;
    border-radius: var(--radius);
    padding: 18px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.m-home-mini:active {
    transform: scale(0.95);
}

.m-home-mini-icon {
    line-height: 1;
    flex-shrink: 0;
}

/* ===== ВЫПАДАЮЩИЙ СПИСОК ПОРОД В КАЛЬКУЛЯТОРЕ ===== */
.calc-breed-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    z-index: 300;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    background: white;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 4px;
}

.calc-breed-letter {
    padding: 4px 12px;
    font-size: 0.72em;
    font-weight: 700;
    color: var(--primary);
    background: #f8f8ff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.calc-breed-item {
    padding: 11px 14px;
    font-size: 0.9em;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.calc-breed-item:last-child { border-bottom: none; }
.calc-breed-item:active { background: #fff0eb; }
.calc-breed-item.selected { background: rgba(255,107,53,0.1); font-weight: 600; }

/* ===== КАЛЬКУЛЯТОР ВОЗРАСТА — ДИЗАЙН ===== */
.calc-source-tabs {
    display: flex;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 20px;
}
.calc-src-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    background: transparent;
    color: #888;
    transition: all 0.2s;
}
.calc-src-tab--active {
    border-color: transparent;
    background: var(--bg-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}
.calc-age-label {
    text-align: center;
    font-size: 0.78em;
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 4px;
}
.calc-age-input {
    text-align: center;
    font-size: 1.05em !important;
    font-weight: 700 !important;
    padding: 8px 8px !important;
}
.calc-calculate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.92em;
    font-weight: 700;
    padding: 11px;
    margin-top: 4px;
}
.calc-result-card {
    background: var(--bg-gradient);
    border-radius: 14px;
    padding: 13px 16px;
    margin-bottom: 12px;
    color: white;
}
.calc-result-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.88em;
    margin-bottom: 6px;
    opacity: 0.95;
}
.calc-result-years {
    font-size: 1.35em;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}
.calc-result-stage {
    font-size: 0.82em;
    opacity: 0.92;
    margin-bottom: 2px;
}
.calc-result-size {
    font-size: 0.76em;
    opacity: 0.8;
    margin-bottom: 8px;
}
.calc-result-lifespan {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78em;
    font-weight: 600;
}
.calc-tab-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.calc-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid #FF6B35;
    color: #FF6B35;
    background: white;
}
.calc-tab-btn--active {
    background: var(--bg-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}
.calc-breed-info-section {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 12px;
}
.calc-tab-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78em;
    color: #FF6B35;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ===== КАСТОМНЫЙ ПИКЕР ПОРОД (мобильная форма) ===== */
.mob-breed-picker {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 400;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    margin-top: 4px;
    max-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mob-breed-picker-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mob-breed-letter {
    padding: 4px 12px;
    font-size: 0.72em;
    font-weight: 700;
    color: var(--primary);
    background: #f8f8ff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mob-breed-item {
    padding: 11px 14px;
    font-size: 0.9em;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.mob-breed-item:last-child { border-bottom: none; }
.mob-breed-item:active { background: #f0eeff; }
.mob-breed-item.selected { background: rgba(110,142,251,0.1); font-weight: 600; }

.mob-breed-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85em;
}

/* ===== КАРТОЧКИ ПОРОД С ФОТО НА ВЕСЬ РАЗМЕР ===== */
.breed-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition: transform 0.15s;
    background: #f0f0f0;
}
.breed-card:active {
    transform: scale(0.96);
}
.breed-card-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.breed-card-image img,
.breed-card-image div {
    width: 100% !important;
    height: 100% !important;
    font-size: 3em !important;
}
.breed-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 22px 10px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.breed-card-meta {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.breed-card-meta span {
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.68em;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    backdrop-filter: blur(2px);
}
/* Паспорт породы */
.breed-passport-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.87em;
    gap: 8px;
}
.breed-passport-row:last-child { border-bottom: none; }
.breed-passport-row span:first-child {
    color: var(--text-light);
    flex-shrink: 0;
}
.breed-passport-row span:last-child {
    color: var(--text);
    font-weight: 500;
    text-align: right;
}
/* Рейтинги */
.breed-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.87em;
    min-height: 20px;
}
.breed-rating-row > span:first-child {
    color: var(--text-light);
    white-space: nowrap;
}
.breed-letter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.breed-size-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.breed-size-filters::-webkit-scrollbar { display: none; }
.breed-size-chip {
    flex-shrink: 0;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.breed-size-chip.active {
    background: var(--primary);
    color: #fff;
}
.breed-size-chip:active { opacity: 0.7; }

.m-home-mini-title {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
}

.m-home-mini-sub {
    font-size: 0.68em;
    color: var(--text-light);
    line-height: 1.2;
}

/* Плитка функции "в разработке" — закрыта до готовности, см. TRACKER_LOCKED в app.js */
.m-home-mini--locked {
    position: relative;
    overflow: hidden;
}

.m-home-mini-lockfill {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(120,120,120,0.32);
}

.m-home-mini-lock-label {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    background: rgba(255,255,255,0.95);
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Карточка-баннер (feature card) — для страницы "Ещё" */
.m-feature-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
}

.m-feature-card:active {
    transform: scale(0.97);
}

.m-feature-image {
    background: var(--bg-gradient);
    padding: 16px;
    text-align: center;
    font-size: 2em;
    color: white;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-feature-content {
    padding: 12px 14px;
}

.m-feature-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.m-feature-desc {
    font-size: 0.8em;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ========== КНОПКИ (увеличенные под палец) ========== */
.m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.1s ease, transform 0.1s ease;
    min-height: 48px;
    width: 100%;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.m-btn:active,
.m-btn.btn-pressed {
    transform: scale(0.95);
    opacity: 0.85;
}

.m-btn-primary {
    background: var(--bg-gradient);
    color: white;
}

.m-btn-secondary {
    background: #f0f0f0;
    color: var(--text);
    border: 2px solid #e0e0e0;
}

.m-btn-danger {
    background: #ff4444;
    color: white;
}

.m-btn-small {
    padding: 10px 16px;
    font-size: 0.9em;
    min-height: 40px;
    width: auto;
}

/* ========== ВЫБОР ПОЛА (подсветка) ========== */
.selected-male {
    background: linear-gradient(135deg, #29B6F6, #0288D1) !important;
    border-color: transparent !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(2,136,209,0.3) !important;
}

.selected-female {
    background: linear-gradient(135deg, #FF6FA5, #E91E63) !important;
    border-color: transparent !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(233,30,99,0.3) !important;
}

.m-gender-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    background: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
}

.m-gender-btn:active {
    transform: scale(0.97);
}

.m-gender-row {
    display: flex;
    gap: 10px;
}

/* ========== ПОЛЯ ВВОДА ========== */
.m-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 1em;
    background: white;
    transition: border-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.m-input:focus {
    outline: none;
    border-color: var(--primary);
}

.m-input-orange {
    border-color: #FF6B35;
    border-width: 1.5px;
    background: #FFFAF8;
}

.m-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 1em;
    background: white;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.m-label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.m-form-group {
    margin-bottom: 16px;
}

/* ========== СЕКЦИЯ ЗАГОЛОВКА ========== */
.m-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px 8px;
}

.m-section-title {
    font-size: 1em;
    font-weight: 700;
    color: var(--text);
}

.m-section-link {
    font-size: 0.85em;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* ========== ПИТОМЦЫ (веб: компактная строка-сторис) ========== */
.m-pet-story-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 2px 2px 12px;
    margin-bottom: 6px;
}

.m-pet-story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
    width: 64px;
}

.m-pet-story-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 2.5px;
    background: var(--bg-gradient);
    display: flex;
    position: relative;
}

.m-pet-story-ring.add {
    background: #e6e6e6;
}

.m-pet-story-av {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-gradient);
    border: 2.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #fff;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.m-pet-story-ring.add .m-pet-story-av {
    background: #fff;
    color: var(--primary);
    font-size: 1.5em;
    font-weight: 700;
}

.m-pet-story-lock {
    position: absolute;
    right: -2px;
    bottom: -2px;
    background: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.m-pet-story span {
    font-size: 0.72em;
    font-weight: 600;
    color: var(--text);
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== БЕЙДЖИ ========== */
.m-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7em;
    font-weight: 600;
}

.m-badge-male {
    background: #e3f2fd;
    color: #1976d2;
}

.m-badge-female {
    background: #fce4ec;
    color: #c62828;
}

.m-badge-heat {
    background: #fff0f5;
    color: #e91e63;
    border: 1px solid #f8c8d8;
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.m-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.m-modal-overlay.open {
    display: flex;
    animation: mFadeIn 0.2s ease;
}

.m-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    animation: mFadeIn 0.2s ease;
}

.m-modal-handle {
    display: none;
}

.m-modal-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0;
}

@keyframes mFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== TOAST-УВЕДОМЛЕНИЯ ========== */
.m-toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    left: 16px;
    right: 16px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    font-size: 0.95em;
    z-index: 999;
    transform: translateY(100px);
    opacity: 0;
    /* B-3194: в скрытом состоянии translateY(100px) сдвигает тост на нижнюю часть кнопок
       навигации — без pointer-events:none элемент перехватывал тапы даже будучи невидимым */
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.m-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.m-toast-success { background: #4caf50; }
.m-toast-error { background: #ff4444; }
.m-toast-info { background: var(--primary); }

/* ========== ЭКРАН ЗАГРУЗКИ ========== */
.m-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.m-loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: mSpin 0.7s linear infinite;
}

@keyframes mSpin {
    to { transform: rotate(360deg); }
}

/* ========== ПУСТОЕ СОСТОЯНИЕ ========== */
.m-empty {
    text-align: center;
    padding: 30px 28px;
    color: var(--text-light);
}

.m-empty-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.m-empty-text {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.m-empty-sub {
    font-size: 0.8em;
    line-height: 1.3;
}

/* ========== ПОЛОСА ПРОГРЕССА ========== */
.m-progress {
    height: 6px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}

.m-progress-bar {
    height: 100%;
    background: var(--bg-gradient);
    border-radius: 6px;
    transition: width 0.3s ease;
}

/* ========== НОВОСТИ-БЕГУЩАЯ СТРОКА ========== */
.m-news-ticker {
    background: #E3F4FD;
    border-radius: var(--radius);
    margin: 6px 0 2px;
    overflow: hidden;
}

.m-news-ticker-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.m-news-ticker-track::-webkit-scrollbar {
    display: none;
}

.m-news-ticker-item {
    flex-shrink: 0;
    width: 100%;
    scroll-snap-align: start;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
}

.m-news-ticker-date {
    font-size: 0.68em;
    color: var(--primary);
    white-space: nowrap;
    font-weight: 600;
    flex-shrink: 0;
}

.m-news-ticker-text {
    font-size: 0.78em;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.m-news-ticker-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 3px 0 5px;
}

.m-news-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c0c8e0;
    transition: background 0.3s, transform 0.3s;
    display: inline-block;
}

.m-news-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

/* ========== РАСПОЛОЖЕНИЕ: КОНТЕНТ ВВЕРХУ, ЛЕНТА+AUTH ВНИЗУ ========== */
.m-home-push-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.m-home-push-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.m-home-push-bottom {
    padding-bottom: 4px;
}

/* ========== АВТОРИЗАЦИЯ ========== */
.m-auth-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.m-auth-row .m-btn {
    flex: 1;
    min-width: 0;
}

/* Панель уведомлений */
.notifications-panel {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: var(--z-drawer);
    display: flex;
    align-items: flex-end;
}

.notifications-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: var(--z-drawer);
}

.notifications-drawer {
    position: relative;
    z-index: var(--z-drawer-panel);
    background: white;
    width: 100%;
    max-height: 75vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUpNotif 0.25s ease;
}

@keyframes slideUpNotif {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    flex-shrink: 0;
}

.notifications-title {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text);
}

.notifications-close {
    width: 28px; height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: #999;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.notifications-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.15s;
}

.notif-item.notif-unread {
    background: rgba(var(--primary-rgb, 255,105,135), 0.05);
}

.notif-icon {
    font-size: 1.8em;
    flex-shrink: 0;
    line-height: 1;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text);
}

.notif-text {
    font-size: 0.8em;
    color: var(--text-light);
    margin-top: 2px;
}

.notif-time {
    font-size: 0.72em;
    color: #bbb;
    margin-top: 4px;
}

/* ========== СТИЛИ КАРТЫ (Leaflet) ========== */
.leaflet-control-attribution {
    font-size: 8px !important;
    opacity: 0.5 !important;
    background: rgba(255,255,255,0.5) !important;
    padding: 1px 4px !important;
}
.leaflet-control-attribution a {
    font-size: 8px !important;
}
/* Убираем флаги и лишние ссылки (оставляем только текст) */
.leaflet-control-attribution br,
.leaflet-control-attribution img {
    display: none !important;
}

/* ===== ТРЕКЕР — ДИЗАЙН ===== */
.tracker-add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1em;
    font-weight: 700;
    padding: 16px;
    margin-bottom: 16px;
}
.tracker-pet-section {
    background: #fff;
    border-radius: 14px;
    padding: 14px 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.tracker-pet-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FF6B35;
    font-weight: 700;
    font-size: 0.88em;
    margin-bottom: 12px;
}
.tracker-pet-row {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.tracker-pet-row:last-child { border-bottom: none; }
.tracker-pet-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}
.tracker-pet-avatar {
    width: 36px;
    height: 36px;
    background: #FFF0E8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15em;
    flex-shrink: 0;
}
.tracker-user-avatar {
    width: 36px;
    height: 36px;
    background: #E8F0FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tracker-pet-name {
    font-weight: 600;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tracker-pet-breed {
    font-size: 0.72em;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}
.tracker-pet-battery {
    font-size: 0.8em;
    font-weight: 700;
    border-radius: 6px;
    padding: 3px 8px;
    flex-shrink: 0;
    color: white;
}
.tracker-pet-remove {
    font-size: 0.8em;
    color: #ccc;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 4px;
    line-height: 1;
    user-select: none;
}
.tracker-map-placeholder {
    height: 240px;
    border-radius: 16px;
    margin-bottom: 12px;
    background: #FFF0E8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}
.tracker-map-title {
    font-weight: 700;
    font-size: 1em;
    color: #333;
}
.tracker-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 11px 22px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
}
.tracker-sim-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1em;
    font-weight: 700;
    padding: 15px;
    margin-bottom: 10px;
}
.tracker-speed-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.tracker-speed-select {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}
.tracker-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.tracker-stat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    transition: transform 0.15s;
}
.tracker-stat-card:active { transform: scale(0.95); }
.tracker-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tracker-stat-icon--orange { background: #FFF0E8; }
.tracker-stat-icon--pink   { background: #FFE8F0; }

/* ========== КАСТОМНЫЕ МАРКЕРЫ ПИТОМЦЕВ НА КАРТЕ ========== */
.pet-tracker-marker {
    background: transparent !important;
    border: none !important;
    text-align: center;
}
.pet-marker-emoji {
    font-size: 24px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    margin-bottom: -2px;
}
.pet-marker-name {
    font-size: 9px;
    font-weight: 700;
    color: #333;
    background: rgba(255,255,255,0.85);
    padding: 1px 5px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 auto;
    line-height: 1.3;
}

/* ========== КАЛЕНДАРЬ (компактный) ========== */

/* Навигация месяцев */
.m-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.m-calendar-nav button {
    background: var(--surface, #f0f0f0);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background 0.2s;
}

.m-calendar-nav button:active {
    background: #ddd;
}

.m-calendar-month-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

/* Сетка календаря */
.m-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 6px;
}

.m-calendar-day {
    padding: 6px 2px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 500;
    min-height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: background 0.15s;
}

.m-calendar-day.clickable {
    cursor: pointer;
}

.m-calendar-day.clickable:active {
    opacity: 0.7;
}

.m-calendar-day-header {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.7em;
    padding: 4px 0;
    text-align: center;
    cursor: default;
}

.m-calendar-day.today {
    background: transparent;
    color: #111;
    box-shadow: 0 0 0 5px rgba(46, 213, 115, 0.55);
    z-index: 1;
}

.m-calendar-day.today .event-dot {
    background: #90CAF9;
}

.m-calendar-day.heat-day {
    background: #fff0f5;
    color: #e91e63;
    border: 1px solid #f8c8d8;
}

.m-calendar-day.other-month {
    color: #ccc;
}

.m-calendar-day.other-month.heat-day {
    opacity: 0.4;
}

/* Heat phase backgrounds (monthly view) */
.m-calendar-day.heat-proestrus {
    background: rgba(255,112,67,0.12);
    border: 1px solid rgba(255,112,67,0.35);
}
.m-calendar-day.heat-estrus {
    background: rgba(233,30,99,0.12);
    border: 1px solid rgba(233,30,99,0.35);
}
.m-calendar-day.heat-diestrus {
    background: rgba(156,39,176,0.12);
    border: 1px solid rgba(156,39,176,0.35);
}

/* Heat phase dot indicator (monthly view) */
.heat-phase-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 2px auto 0;
}
.heat-dot-proestrus { background: #ff7043; }
.heat-dot-estrus    { background: #e91e63; }
.heat-dot-diestrus  { background: #9c27b0; }

/* Birthday dot indicator */
.birthday-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff9800;
    margin: 1px auto 0;
}

/* Birthday highlight on calendar day (monthly view) */
.m-calendar-day.has-vet {
    background: rgba(25,118,210,0.1);
}

.m-calendar-day.has-birthday {
    background: rgba(255,152,0,0.1);
    border: 1px solid rgba(255,152,0,0.4);
}

/* Birthday highlight in yearly view */
.year-month-day.has-birthday {
    background: rgba(255,152,0,0.35);
    color: #bf360c;
    font-weight: 700;
    border-radius: 3px;
}

/* Year view — base day cell */
.year-month-day {
    display: block;
    text-align: center;
    border-radius: 2px;
    line-height: 1.4;
}
.year-month-day.other-month { color: #ccc; }

/* Year view — heat phase highlights */
.year-month-day.heat-proestrus {
    background: rgba(255,112,67,0.35);
    color: #c63000;
    font-weight: 600;
    border-radius: 3px;
}
.year-month-day.heat-estrus {
    background: rgba(233,30,99,0.35);
    color: #880e4f;
    font-weight: 600;
    border-radius: 3px;
}
.year-month-day.heat-diestrus {
    background: rgba(156,39,176,0.35);
    color: #4a148c;
    font-weight: 600;
    border-radius: 3px;
}

/* Прошедшие дни течки — годовой вид */
.year-month-day.heat-past {
    background: rgba(160,160,160,0.22);
    color: #999;
    font-weight: 500;
    border-radius: 3px;
}

/* Прошедшие дни течки — месячный вид */
.m-calendar-day.heat-past {
    background: rgba(160,160,160,0.10);
    border: 1px solid rgba(160,160,160,0.28);
}
.heat-dot-past { background: #bbb; }

/* Дни беременности — светло-прозрачный зелёный (месячный вид), тот же приём, что у течки */
.m-calendar-day.pregnancy-active {
    background: rgba(76,175,80,0.12);
    border: 1px solid rgba(76,175,80,0.35);
}
.pregnancy-dot-active { background: #4caf50; }

/* Прошедшие дни беременности — серым, как и прошедшие дни течки (месячный вид) */
.m-calendar-day.pregnancy-past {
    background: rgba(160,160,160,0.10);
    border: 1px solid rgba(160,160,160,0.28);
}
.pregnancy-dot-past { background: #bbb; }

/* Дни беременности — годовой вид */
.year-month-day.pregnancy-active {
    background: rgba(76,175,80,0.35);
    color: #1b5e20;
    font-weight: 600;
    border-radius: 3px;
}

/* Прошедшие дни беременности — годовой вид (тот же серый, что и heat-past) */
.year-month-day.pregnancy-past {
    background: rgba(160,160,160,0.22);
    color: #999;
    font-weight: 500;
    border-radius: 3px;
}

.m-calendar-day.weekend {
    color: var(--text-light);
}

/* Эмодзи ветклиники под числом */
.vet-emoji {
    font-size: 14px;
    line-height: 1;
    margin-top: 1px;
}

/* Точка-индикатор событий под числом */
.event-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 1px;
}

.event-dot.heat {
    background: #e91e63;
}

.event-dot.vet {
    background: #1976d2;
}

.event-dot.custom {
    background: #388e3c;
}

/* ========== ЛЕГЕНДА КАЛЕНДАРЯ ========== */
.m-calendar-legend {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}

.m-calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7em;
    color: var(--text-secondary);
}

.m-calendar-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.m-calendar-legend-dot.heat {
    background: #e91e63;
}

.m-calendar-legend-dot.vet {
    background: #1976d2;
}

.m-calendar-legend-dot.custom {
    background: #388e3c;
}

/* ========== ПОПАП ДНЯ КАЛЕНДАРЯ ========== */
@keyframes calPopupIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cal-day-popup {
    position: fixed;
    z-index: 1500;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.16);
    border: 1px solid rgba(0,0,0,0.08);
    overflow: hidden;
    animation: calPopupIn 0.15s ease-out;
    min-width: 180px;
}

.cal-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    background: var(--bg-gradient, linear-gradient(135deg,#7b5ea7,#9b8ecb));
    color: #fff;
    font-weight: 600;
    font-size: 0.82em;
}

.cal-popup-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.9em;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.cal-popup-body {
    padding: 4px 8px 6px;
    max-height: 220px;
    overflow-y: auto;
}

.cal-popup-item {
    padding: 5px 0;
    border-bottom: 1px solid #f2f2f2;
    line-height: 1.4;
}

.cal-popup-item:last-child {
    border-bottom: none;
}

/* ========== МОДАЛКА СОБЫТИЙ КАЛЕНДАРЯ ========== */
.m-event-modal {
    position: fixed;
    inset: 0;
    background: var(--card-bg, #fff);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease-out;
}

.m-event-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border, #eee);
    background: var(--primary);
    color: #fff;
}

.m-event-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.m-event-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    line-height: 1;
}

.m-event-modal-close:active {
    background: rgba(255,255,255,0.2);
}

.m-event-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.m-event-modal-body .event-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 12px;
    background: var(--surface, #f5f5f5);
    margin-bottom: 10px;
}

.m-event-modal-body .event-item:active {
    opacity: 0.7;
}

.m-event-modal-body .event-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.m-event-modal-body .event-icon.heat {
    background: #fce4ec;
    color: #e91e63;
}

.m-event-modal-body .event-icon.vet {
    background: #e3f2fd;
    color: #1976d2;
}

.m-event-modal-body .event-icon.custom {
    background: #e8f5e9;
    color: #388e3c;
}

.m-event-modal-body .event-info {
    flex: 1;
    min-width: 0;
}

.m-event-modal-body .event-info h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--text, #222);
}

.m-event-modal-body .event-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #777);
}

.m-event-modal-body .event-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.m-event-modal-body .event-actions button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    background: var(--surface, #f5f5f5);
}

.m-event-modal-body .event-actions button:active {
    opacity: 0.6;
}

/* Кнопка "Добавить событие" снизу */
.m-event-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    margin: 0 16px 16px;
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
}

.m-event-add-btn:active {
    opacity: 0.85;
}

/* ========== АНИМАЦИИ ========== */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== ФУТЕР (компактный, без вылезания) ========== */
.m-footer {
    text-align: center;
    padding: 16px 4px;
    font-size: 0.7em;
    color: var(--text-light);
    word-break: break-word;
    overflow-wrap: break-word;
}

.m-footer a {
    color: var(--primary);
    text-decoration: none;
}

.m-footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.m-footer-links a {
    white-space: nowrap;
    font-size: 0.9em;
}

/* ========== РАЗДЕЛИТЕЛЬ НА ГЛАВНОЙ ========== */
.m-home-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 8px 0;
}

/* ========== RESPONSIVE ДЛЯ ПЛАНШЕТОВ ========== */
@media (min-width: 481px) and (max-width: 768px) {
    .mobile-content {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ========== КАСТОМНАЯ МОДАЛКА ПОДТВЕРЖДЕНИЯ ========== */
.m-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-confirm);
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: mConfirmFadeIn 0.2s ease;
}

@keyframes mConfirmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.m-confirm-box {
    background: white;
    border-radius: 16px;
    padding: 24px 20px 16px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    animation: mConfirmSlideIn 0.2s ease;
    text-align: center;
}

@keyframes mConfirmSlideIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.m-confirm-icon {
    font-size: 2.6em;
    margin-bottom: 8px;
}

.m-confirm-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.m-confirm-text {
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 20px;
}

.m-confirm-buttons {
    display: flex;
    gap: 10px;
}

.m-confirm-buttons button {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.m-confirm-buttons button:active {
    transform: scale(0.96);
    opacity: 0.85;
}

.m-confirm-cancel {
    background: #f0f0f0;
    color: var(--text);
}

.m-confirm-ok {
    background: var(--bg-gradient);
    color: white;
}

/* Веб-версия на широких экранах — растягиваем на всю ширину экрана
   (было зажато в мобильную колонку 480px, как в Android-приложении,
   где это уместно, но не на десктопе в браузере). Ограничения по
   ширине больше нет — только внутренние отступы. */
@media (min-width: 769px) {
    .mobile-content {
        padding-left: 32px;
        padding-right: 32px;
    }
    .bottom-nav, .mobile-header {
        left: 0;
        right: 0;
        transform: none;
    }
    .m-event-modal {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
        animation: slideUp 0.25s ease-out;
    }
}

/* ============================================================== */
/*  AI ASSISTANT WIDGET */
/* ============================================================== */

.ai-fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(118, 75, 162, 0.4);
    z-index: var(--z-fab);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ai-fab:active {
    transform: scale(0.92);
}

.ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    font-size: 0.55em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
}

/* Контейнер чата */
.ai-chat-container {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.ai-chat-visible {
    transform: translateY(0);
    opacity: 1;
}

.ai-chat-minimized {
    height: 56px !important;
    min-height: 56px !important;
}

.ai-chat-minimized .ai-chat-body,
.ai-chat-minimized .ai-chat-footer {
    display: none !important;
}

/* Шапка */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.ai-chat-title {
    font-weight: 700;
    font-size: 0.95em;
}

.ai-chat-status {
    font-size: 0.75em;
    opacity: 0.85;
    margin-top: 1px;
}

.ai-chat-header-actions {
    display: flex;
    gap: 4px;
}

.ai-btn-icon {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
    line-height: 1;
}

.ai-btn-icon:hover {
    background: rgba(255,255,255,0.15);
}

/* Тело чата */
.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 4px;
    background: #f5f6fa;
    scroll-behavior: smooth;
}

/* Нижняя панель */
.ai-chat-footer {
    padding: 8px 12px 12px;
    background: white;
    border-top: 1px solid #e8e8f0;
    flex-shrink: 0;
}

.ai-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-input {
    flex: 1;
    border: 2px solid #e0e0f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.88em;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.4;
    max-height: 120px;
    min-height: 42px;
    background: #f8f9ff;
}

.ai-input:focus {
    border-color: #667eea;
}

.ai-btn-send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-btn-send:active {
    opacity: 0.8;
}

/* ============================================
   AI-АССИСТЕНТ — Inline виджет (на главной)
   ============================================ */

.ai-inline-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin: 0;
}

.ai-inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 0.88em;
    background: var(--bg-gradient);
    color: white;
    transition: opacity 0.15s;
}

.ai-inline-header:active {
    opacity: 0.9;
}

.ai-inline-toggle-icon {
    font-size: 0.8em;
    transition: transform 0.2s ease;
    line-height: 1;
}

.ai-inline-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.ai-inline-body {
    display: flex;
    flex-direction: column;
    height: 380px;
    max-height: 60vh;
    background: #fafbff;
}

/* Шапка чата */
.ai-inline-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: white;
    border-bottom: 1px solid #e8e8f0;
    flex-shrink: 0;
}

.ai-inline-status {
    font-size: 0.78em;
    font-weight: 600;
}

.ai-inline-clear {
    font-size: 0.72em;
    color: var(--text-light);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.ai-inline-clear:active {
    background: #f0f0f0;
}

/* Сообщения */
.ai-inline-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.ai-message {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: aiMsgIn 0.2s ease-out;
}

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

.ai-message-bot {
    align-self: flex-start;
}

.ai-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    flex-shrink: 0;
    color: white;
}

.ai-message-avatar-user {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ai-message-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-message-user-content {
    align-items: flex-end;
}

.ai-message-bubble {
    background: white;
    border-radius: 12px 12px 12px 4px;
    padding: 8px 12px;
    font-size: 0.82em;
    line-height: 1.45;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    color: var(--text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ai-message-bubble-user {
    background: var(--bg-gradient);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.ai-message-time {
    font-size: 0.6em;
    color: var(--text-light);
    padding: 0 2px;
}

/* Индикатор печатания */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 16px;
}

.ai-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a0a0c0;
    animation: aiTyping 1.2s infinite;
}

.ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes aiTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
    30% { opacity: 1; transform: scale(1); }
}

/* Быстрые подсказки */
.ai-inline-suggestions {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    overflow-x: auto;
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #e8e8f0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ai-inline-suggestions::-webkit-scrollbar {
    display: none;
}

.ai-suggestion-chip {
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 16px;
    border: 1px solid #e0e0f0;
    background: #f8f9ff;
    font-size: 0.72em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}

.ai-suggestion-chip:active {
    background: var(--bg-gradient);
    color: white;
    border-color: transparent;
}

/* Нижняя панель */
.ai-inline-footer {
    padding: 6px 12px 10px;
    background: white;
    border-top: 1px solid #e8e8f0;
    flex-shrink: 0;
}

.ai-inline-footer .ai-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-inline-footer .ai-input {
    flex: 1;
    border: 2px solid #e0e0f0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.85em;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.4;
    max-height: 100px;
    min-height: 38px;
    background: #f8f9ff;
}

.ai-inline-footer .ai-input:focus {
    border-color: var(--primary);
}

.ai-inline-footer .ai-btn-send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--bg-gradient);
    color: white;
    font-size: 1em;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-inline-footer .ai-btn-send:active {
    opacity: 0.8;
}

/* Контейнер на главной */
.m-home-ai-inline {
    padding: 6px 0;
    margin: 0;
}

/* Mobile адаптация */
@media (max-width: 480px) {
    .ai-chat-container {
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .ai-fab {
        bottom: 72px;
        right: 12px;
        width: 50px;
        height: 50px;
        font-size: 1.4em;
    }
}

/* ========== REWARDED VIDEO OVERLAY ========== */
.rewarded-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.82);
    z-index: var(--z-ad);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rewardedFadeIn .2s ease;
}

@keyframes rewardedFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.rewarded-box {
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rewarded-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
}

.rewarded-ad-label {
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
}

.rewarded-skip {
    border: none;
    background: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
}

.rewarded-skip:disabled {
    color: #ccc;
    cursor: default;
}

.rewarded-skip:not(:disabled):hover {
    background: #eee;
}

.rewarded-timer {
    display: inline-block;
    min-width: 14px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rewarded-content {
    padding: 28px 20px 20px;
    text-align: center;
}

.rewarded-mock-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
}

.rewarded-mock-brand {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
}

.rewarded-mock-sub {
    font-size: 13px;
    color: #888;
    margin-bottom: 18px;
}

.rewarded-progress-wrap {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.rewarded-progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary, #4CAF50);
    border-radius: 2px;
    transition: width .1s linear;
}

.rewarded-footer {
    padding: 0 20px 20px;
}

.rewarded-open-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--primary, #4CAF50);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s;
}

.rewarded-open-btn:active {
    filter: brightness(.9);
}

/* ===== Раздел «Добро» — анимация кнопок ===== */
.dobro-btn {
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.13s ease, filter 0.13s ease, opacity 0.13s ease;
    cursor: pointer;
}
.dobro-btn.pressing {
    transform: scale(0.92) !important;
    filter: brightness(0.82);
    opacity: 0.85;
}
.store-cat-item:active { transform: scale(0.94); box-shadow: none !important; }

/* Без touch-action: none Android WebView после pinch-жеста (два пальца) на встроенной
   Яндекс.Карте перестаёт перерисовываться целиком (DOM и навигация продолжают работать,
   но экран визуально "замирает") - конфликт между нативным touch-handling браузера и
   JS-обработкой жестов ymaps. */
#vetMapContainerMobile { touch-action: none; }
