/* Планшет */
@media (max-width: 1024px) {
    .cal-triple-view {
        grid-template-columns: 1fr;
    }

    .cal-side-month {
        display: none;
    }

    .cal-month-title {
        min-width: 240px;
    }

    .cal-bottom-section {
        grid-template-columns: 1fr;
    }
}

/* Мобильный */
@media (max-width: 768px) {
    .cal-main {
        padding: 16px 12px 32px;
    }

    .cal-month-nav {
        gap: 8px;
    }

    .cal-month-title {
        min-width: 0;
    }

    .cal-month-title-hijri {
        font-size: 1.25rem;
    }

    .cal-nav-arrow {
        width: 36px;
        height: 36px;
    }

    /* Сетка календаря */
    .cal-current-month {
        padding: 10px;
        border-radius: var(--radius-md, 12px);
    }

    .cal-day {
        min-height: 60px;
        padding: 4px 5px;
        border-radius: var(--radius-sm, 8px);
    }

    .cal-day-hijri {
        font-size: 1.05rem;
    }

    .cal-day-greg {
        font-size: 0.6rem;
    }

    .cal-event-dot {
        width: 5px;
        height: 5px;
    }

    /* Подменю */
    .cal-submenu-inner {
        flex-direction: column;
        height: auto;
        padding: 8px 0;
        flex-wrap: wrap;
    }

    .cal-submenu-left {
        width: 100%;
        justify-content: center;
        border-bottom: 1px solid var(--border-gray, #e5e7eb);
        padding-bottom: 4px;
        margin-bottom: 4px;
    }

    .cal-submenu-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .cal-submenu-tabs {
        width: auto;
        justify-content: center;
    }

    .cal-submenu-actions {
        width: auto;
        justify-content: center;
    }

    /* Лента дней */
    .cal-strip-day {
        min-width: 56px;
        padding: 6px 8px;
    }

    .cal-strip-day-hijri {
        font-size: 1.05rem;
    }

    /* Нижняя секция */
    .cal-bottom-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cal-events-panel {
        min-height: 120px;
    }

    /* Модальные окна */
    .cal-modal {
        max-width: 100%;
        border-radius: var(--radius-md, 12px);
        max-height: 90vh;
    }

    .cal-modal-overlay {
        padding: 12px;
    }

    /* Конвертер */
    .cal-converter-direction {
        flex-direction: column;
        gap: 8px;
    }

    .cal-converter-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .cal-conv-select,
    .cal-conv-input {
        width: 100%;
    }

    .cal-conv-input[type="number"] {
        width: 100%;
    }

    /* Хедер */
    .cal-header {
        height: 48px;
    }

    .cal-title {
        font-size: 1.25rem;
    }

    .cal-logo-link img {
        height: 30px;
    }
}

/* Маленький мобильный */
@media (max-width: 380px) {
    .cal-day {
        min-height: 50px;
        padding: 3px 4px;
    }

    .cal-day-hijri {
        font-size: 0.9375rem;
    }

    .cal-weekday-header {
        font-size: 0.625rem;
        padding: 4px 2px;
    }

    .cal-strip-day {
        min-width: 48px;
        padding: 4px 6px;
    }
}

/* Тач-устройства: свайп */
@media (hover: none) and (pointer: coarse) {
    .cal-grid {
        touch-action: pan-x;
    }

    .cal-day:hover {
        border-color: transparent;
        box-shadow: none;
        background: var(--light-gray, #fafafa);
    }

    .cal-day.today:hover {
        background: var(--emerald-50, #ECFDF5);
        border-color: var(--emerald, #059669);
    }
}
