* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    background: #0e141b;
    color: #e6f0fa;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.wrap {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}
/* iOS/Android: корректная динамическая высота вьюпорта */
@supports (height: 100dvh) {
    .wrap { min-height: 100dvh; }
}


.el {
    position: absolute;
    box-sizing: border-box;
    transition: none;
}

/* Текстовые элементы */
.el.text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.el.text p,
.el.text h1,
.el.text h2,
.el.text h3,
.el.text h4,
.el.text h5,
.el.text h6,
.el.text ul,
.el.text ol {
    margin: 0;
    padding: 0;
}

.el.text li {
    margin: 0 0 0.35em;
}

.el.text p + p {
    margin-top: 0.35em;
}

.el.text a {
    color: inherit;
}

/* Изображения */
.el.image {
    overflow: hidden;
}

.el img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
    display: block;
}

/* Видео */
.el.video {
    overflow: hidden;
}

.el video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

/* Блоки */
.el.box {
    pointer-events: none;
}

/* Кнопки */
.el.linkbtn,
.el.filebtn {
    overflow: hidden;
    cursor: pointer;
}

.el.linkbtn a, 
.el.filebtn a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    gap: 8px;
}

.el.linkbtn a:hover, 
.el.filebtn a:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.el.linkbtn a:active,
.el.filebtn a:active {
    transform: scale(0.98);
}

/* Языковой переключатель (как в редакторе) */
.el.langbadge { background: transparent !important; border: none !important; padding: 0 !important; }
.lang-selector { position: relative; cursor: pointer; display: inline-block; }
.lang-chip { padding: 8px 16px; border-radius: 12px; border: 1px solid #2ea8ff; background: #0f1723; color: #fff; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.lang-chip:hover { background: #2ea8ff; transform: scale(1.05); }
.lang-flag { font-size: 20px; line-height: 1; }
.lang-dropdown { position: absolute; top: calc(100% + 8px); left: 0; display: none; min-width: 220px; max-height: 280px; overflow-y: auto; background: rgba(12, 18, 26, 0.96); border: 1px solid rgba(46,168,255,0.25); border-radius: 12px; padding: 10px; box-shadow: 0 8px 24px rgba(46,168,255,0.2); backdrop-filter: blur(8px); z-index: 9999; }
.lang-dropdown.show { display: block !important; }
.lang-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #e8f2ff; transition: background .2s ease; }
.lang-option:hover { background: rgba(46, 168, 255, 0.12); }
.lang-option.active { background: #2ea8ff; color: #fff; }
.lang-dropdown::-webkit-scrollbar { width: 8px; }
.lang-dropdown::-webkit-scrollbar-track { background: #0b111a; border-radius: 4px; }
.lang-dropdown::-webkit-scrollbar-thumb { background: #2a3f5f; border-radius: 4px; }
.lang-dropdown::-webkit-scrollbar-thumb:hover { background: #3a5070; }
/* Встраиваемый контент */
.el.embed {
    overflow: hidden;
}

.el.embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: inherit;
}

/* Адаптивность для планшетов */
@media (max-width: 768px) and (min-width: 481px) {
    .wrap {
        min-height: 100vh;
    }
    
    .el.text {
        font-size: calc(100% - 2px) !important;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    .wrap {
        min-height: 100vh;
    }
    
    .el {
        transition: none !important;
    }
    
    .el.text {
        font-size: max(14px, calc(100% - 4px)) !important;
        line-height: 1.4 !important;
    }
    
    .el.langbadge .lang-chip {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }
}

/* Анимации при загрузке */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.el {
    animation: fadeIn 0.5s ease-out;
}

/* Печать */
@media print {
    .el.langbadge {
        display: none !important;
    }
    
    .wrap {
        min-height: auto;
    }
}