﻿html, body {
    height: auto;
    min-height: 90vh;
    margin: 0;
    padding: 0;
}

body {
    /* Без position: relative и height: auto !important */
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important; /* Можно оставить — безопасно */
    overflow-y: visible;
    /* Удалено: -webkit-overflow-scrolling: touch (устарело) */
}

    /* === ✅ БЛОКИРОВКА ПРОКРУТКИ ПРИ ОТКРЫТОМ МЕНЮ === */
    body.no-scroll {
        overflow: hidden !important;
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* ← 100vh, а не 100% — важно для iOS */
        padding-right: 0 !important;
        /* Сохраняем текущую прокрутку, не прыгаем вверх */
    }

/* === Сброс потенциально "выпирающих" элементов === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Скрываем скролл-бары визуально, но оставляем функциональность */
* {
    scrollbar-width: thin; /* Firefox — тонкий, но рабочий */
}

    *::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Edge — полностью скрыт */
    }

/* === ГЛОБАЛЬНЫЕ СБРОСЫ ДЛЯ КОНТЕЙНЕРОВ === */
.server-status-container,
.result,
#charts,
details,
details > div,
#history-list,
#history-container,
.conn-row,
.btn-group {
    overflow: visible !important;
    overflow-x: hidden !important;
    max-height: none !important;
    height: auto !important;
    min-height: auto !important;
    width: 100% !important;
}

.result {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
}

    .result::-webkit-scrollbar {
        display: none !important;
    }

/* === ТЕМА: ГАРАНТИРОВАННЫЕ ЦВЕТА ГРАНИЦ === */
.theme-dark {
    --border-color: #444;
}

.theme-light,
body.light-mode {
    --border-color: #ccc;
}

/* === ПОЛЕ ВВОДА И ВЫБОРА === */
#ip,
#port,
#type {
    background-color: var(--bg-main);
    color: var(--text-color);
    border: 1px solid var(--border-color, #444);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 1rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    width: 100%;
}

/* === ГРУППА ПОЛЕЙ ВВОДА === */
.conn-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

    .conn-row input,
    .conn-row select {
        flex: 1 1 120px;
        min-width: 0;
    }

#port {
    flex-basis: 80px;
    max-width: 80px;
}

/* === РЕЗУЛЬТАТЫ === */
.result {
    margin: 15px auto 25px auto;
    max-width: 800px;
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.5s ease;
    background-color: var(--page-bg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

    .result.visible {
        opacity: 1;
    }

    .result.online {
        background-color: rgba(76, 175, 80, 0.08);
        border-left: 4px solid #4caf50;
    }

    .result.offline {
        background-color: rgba(244, 67, 54, 0.08);
        border-left: 4px solid #f44336;
    }

/* === ГРАФИКИ === */
#charts {
    margin: 15px auto 25px auto;
    max-width: 800px;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

    #charts.visible {
        opacity: 1;
    }

canvas {
    margin-top: 15px;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    width: 100% !important;
}

/* === СПИННЕР === */
#spinner {
    display: none;
    width: 30px;
    height: 30px;
    border: 4px solid var(--border-color);
    border-top-color: #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === DETAILS (РАСКРЫВАЮЩИЕСЯ БЛОКИ) === */
details {
    margin: 10px auto 15px auto;
    max-width: 800px;
    width: 100%;
    background: var(--bg-main);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow-x: hidden;
}

    details summary {
        cursor: pointer;
        font-weight: bold;
        color: var(--text-color);
        list-style: none;
        position: relative;
        padding-left: 20px;
        min-height: 24px;
        display: flex;
        align-items: center;
        overflow-wrap: break-word;
    }

        details summary::before {
            content: '▶';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            transition: transform 0.3s ease;
            color: var(--text-color);
        }

    details[open] summary::before {
        transform: translateY(-50%) rotate(90deg);
    }

    details ul {
        padding-left: 20px;
        margin-top: 8px;
        color: var(--text-color);
        overflow-wrap: break-word;
    }

/* === КОНТЕЙНЕР СТАТУСА === */
.server-status-container {
    max-width: 800px;
    margin: 120px auto 0;
    padding: 0 16px;
    width: 100%;
}

    .server-status-container h2 {
        text-align: center;
        margin-bottom: 20px;
        color: var(--text-color);
        font-size: 1.95rem;
    }
#historyList .btn-sm {
    padding: 12px 16px;
    font-size: 16px;
    min-height: 44px;
    min-width: auto;
}
/* === КНОПКИ === */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 8px auto 20px auto;
    max-width: 800px;
    width: 100%;
}

    .btn-group button {
        padding: 8px 16px;
        font-size: 14px;
        cursor: pointer;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        background-color: var(--bg-main);
        color: var(--text-color);
        transition: background-color 0.2s, border-color 0.2s;
        flex: 1 1 auto;
        min-width: 100px;
        white-space: normal;
    }

        .btn-group button:hover {
            background-color: var(--hover-bg);
            border-color: var(--hover-border-color);
        }

/* === ИСТОРИЯ === */
#history-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}
.history-empty {
    padding: 8px 12px;
    color: var(--text-color);
    font-style: italic;
    text-align: center;
}
.history-item {
    cursor: pointer;
    padding: 6px 12px;
    margin: 2px 0;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
    color: var(--text-color);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

    .history-item:hover {
        background: var(--hover-bg);
        border-color: var(--hover-border-color);
    }

/* === СТАТИСТИКА === */
.stats {
    font-size: 0.9em;
    margin: 10px auto 20px auto;
    color: var(--text-color);
    opacity: 0.7;
    max-width: 800px;
    text-align: center;
    width: 100%;
    overflow-wrap: break-word;
}

/* === СОСТОЯНИЯ HOVER / FOCUS === */
input:hover,
select:hover,
button:hover {
    background-color: var(--hover-bg);
    border-color: var(--hover-border-color);
}

input:focus,
select:focus,
button:focus {
    outline: none;
    border-color: var(--hover-border-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.theme-light :is(input, select, button):focus,
body.light-mode :is(input, select, button):focus {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* === МОБИЛЬНАЯ АДАПТАЦИЯ (max-width: 768px) === */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }

    body {
        min-height: 100vh;
        margin: 0;
        padding: 0;
    }

    #ip, #port, #type {
        font-size: 16px; /* ← КРИТИЧНО для iOS */
        padding: 10px 12px;
    }

    .conn-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 16px;
    }

        .conn-row input,
        .conn-row select {
            flex: 1 1 100% !important;
            min-width: 0;
        }

    #port {
        max-width: none;
        flex-basis: auto;
    }

    .btn-group button {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
        min-width: auto;
    }
    

   .result,
    details {
        padding: 14px;
        font-size: 0.95rem;
    }

        details summary {
            font-size: 1.05rem;
            padding-left: 24px;
            min-height: 36px;
        }

            details summary::before {
                font-size: 14px;
            }

    .history-item {
        padding: 10px 14px;
        min-height: 44px;
        font-size: 0.95rem;
    }

    .server-status-container {
        margin-top: 80px;
        padding: 0 12px;
    }

        .server-status-container h2 {
            font-size: 1.6rem;
            margin-bottom: 16px;
        }

    #charts {
        margin: 12px auto 20px auto;
    }

    canvas {
        margin-top: 12px;
    }

    #spinner {
        width: 36px;
        height: 36px;
        margin: 16px auto;
    }

    * {
        -ms-overflow-style: none;
    }
}

/* === Очень маленькие экраны (до 480px) === */
@media (max-width: 480px) {
    html {
        scroll-behavior: smooth;
    }

    body {
        min-height: 100vh;
        margin: 0;
        padding: 0;
    }

    .server-status-container h2 {
        font-size: 1.4rem;
    }

    .btn-group {
        gap: 4px;
    }

        .btn-group button {
            padding: 10px 12px;
            font-size: 15px;
        }

    #ip {
        font-size: 16px; /* ← ОБЯЗАТЕЛЬНО */
    }

    .history-item,
    .result,
    details summary,
    details ul li {
        word-break: break-all;
        overflow-wrap: break-word;
    }
}


тут проблема такая html, body {
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}
