/* Preview layout only. Loaded by compatible-new.php. */
body.compat-v2 .container {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

body.compat-v2 .container > * {
    min-width: 0;
    max-width: 100%;
}

body.compat-v2 .container > .header { order: 1; width: 100%; }
body.compat-v2 .container > #site-nav { order: 2; width: 100%; }
body.compat-v2 .container > .portal-main { order: 3; width: 100%; }
body.compat-v2 .container > .portal-showcase { order: 4; width: 100%; }

body.compat-v2 .header {
    padding: 18px 20px;
    min-width: 0;
    max-width: 100%;
}

body.compat-v2 .brand,
body.compat-v2 .action-buttons-container,
body.compat-v2 .lang-switcher,
body.compat-v2 .lang-switcher-container,
body.compat-v2 .devices-panel,
body.compat-v2 .devices-panel-row,
body.compat-v2 .portal-section,
body.compat-v2 .download-section,
body.compat-v2 .download-buttons,
body.compat-v2 .download-btn {
    min-width: 0;
    max-width: 100%;
}

body.compat-v2 .trust-strip {
    flex-wrap: wrap !important;
    overflow: visible !important;
    width: 100%;
    max-width: 100%;
}

body.compat-v2 .trust-pill {
    max-width: 100%;
    white-space: normal;
    flex-wrap: wrap !important;
}

body.compat-v2 #site-nav {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap !important;
    overflow: visible !important;
    justify-content: center;
}

body.compat-v2 #site-nav a {
    flex: 0 1 auto;
    white-space: normal;
}

body.compat-v2 #site-nav a[href*="t.me"] {
    display: inline-flex !important;
}

body.compat-v2 .tool-filter-chips {
    display: flex;
    flex-wrap: wrap !important;
    overflow: visible !important;
    max-width: 100%;
    gap: 6px;
}

body.compat-v2 .tool-filter-chip {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: normal;
}

body.compat-v2 .action-buttons {
    flex-wrap: wrap;
}

body.compat-v2 .action-buttons .btn,
body.compat-v2 .fmi-btn-text {
    white-space: normal;
}

body.compat-v2 .portal-showcase__track {
    animation: none !important;
}

.v2-help {
    margin: 12px 0 0;
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.v2-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0 4px;
}

.v2-answer {
    margin: 14px 0 8px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(45, 200, 95, 0.4);
    background: rgba(45, 200, 95, 0.08);
}

.v2-answer[hidden] {
    display: none !important;
}

.v2-answer h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.v2-kicker {
    margin: 0 0 4px;
    color: #86efac;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.v2-range-line,
.v2-answer p {
    margin: 0 0 10px;
    color: #e2e8f0;
    line-height: 1.45;
}

.v2-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-one + .v2-one {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.v2-actions a,
.v2-jump {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    background: #0a84ff;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
}

.v2-jump {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    cursor: pointer;
}

.v2-dl-note {
    margin: 8px 0 14px;
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body.compat-v2 #models-grid {
    grid-auto-rows: auto !important;
}

body.compat-v2 #models-grid > .model-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    content-visibility: visible;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
}

body.compat-v2 #models-grid > .model-card:hover {
    transform: none !important;
}

body.compat-v2 .model-titles h3,
body.compat-v2 .model-id,
body.compat-v2 .v2-range,
body.compat-v2 .ver-item {
    overflow-wrap: anywhere;
}

body.compat-v2 .versions-container {
    display: none;
    max-height: 240px;
    overflow: auto;
}

body.compat-v2 .model-card.is-open .versions-container {
    display: block;
}

.v2-range {
    margin: 8px 0 0;
    color: #d1fae5;
    font-size: 0.92rem;
    line-height: 1.4;
}

.v2-builds {
    margin-top: 8px;
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.v2-builds:hover {
    border-color: rgba(45, 200, 95, 0.45);
}

.v2-hit {
    background: #3b82f6 !important;
    color: #fff !important;
}

body.compat-v2 .container {
    padding-right: 84px !important;
    box-sizing: border-box;
}

body.compat-v2 .download-btn {
    flex-wrap: wrap !important;
    justify-content: center;
    height: auto !important;
    max-width: 100%;
    white-space: normal !important;
}

body.compat-v2 .fab-stack {
    align-items: flex-end;
    width: auto;
}

body.compat-v2 .apps-fab {
    position: relative;
    width: 52px;
    height: 52px;
    min-width: 0;
    padding: 0;
    justify-content: center;
}

body.compat-v2 .telegram-fab {
    position: relative;
    width: 52px;
    height: 52px;
    min-width: 0;
    padding: 0;
    justify-content: center;
}

body.compat-v2 .apps-fab .fab-label,
body.compat-v2 .telegram-fab .fab-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 768px) {
    body.compat-v2 .lang-switcher {
        flex-wrap: wrap !important;
        max-width: 100%;
    }

    body.compat-v2 .action-buttons {
        width: 100%;
        max-width: 100%;
    }

    body.compat-v2 .portal-hero h1 {
        font-size: 1.35rem !important;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    body.compat-v2 .tool-ios-range,
    body.compat-v2 .download-subtitle,
    body.compat-v2 .download-subtitle-main {
        white-space: normal !important;
        overflow-wrap: anywhere;
        max-width: 100%;
    }

    body.compat-v2 .portal-main,
    body.compat-v2 .portal-showcase {
        padding-left: 14px;
    }

    body.compat-v2 .header {
        padding-top: 14px;
        padding-bottom: 14px;
        padding-left: 14px;
    }

    body.compat-v2 .portal-main {
        padding-bottom: 188px;
    }

    body.compat-v2 .fab-stack {
        right: 10px;
        bottom: 10px;
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
    }

    body.compat-v2 .action-buttons {
        grid-template-columns: 1fr;
    }

    body.compat-v2 .v2-toolbar .reset-btn {
        width: 100%;
        white-space: normal;
    }
}

/* Safari iOS 7–9: unprefixed flex and overflow-wrap:anywhere are ignored. */
body.compat-v2 .container {
    -webkit-box-sizing: border-box;
}

body.compat-v2 h1,
body.compat-v2 h2,
body.compat-v2 h3,
body.compat-v2 p,
body.compat-v2 a,
body.compat-v2 button,
body.compat-v2 .trust-pill,
body.compat-v2 .tool-ios-range,
body.compat-v2 .download-subtitle {
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
}

body.compat-v2 #models-grid > .model-card,
body.compat-v2 #models-grid > .model-card:hover {
    -webkit-transform: none !important;
}

body.compat-v2 .tool-filter-chips,
body.compat-v2 .fab-stack,
body.compat-v2 .apps-fab,
body.compat-v2 .telegram-fab,
body.compat-v2 #site-nav,
body.compat-v2 .lang-switcher,
body.compat-v2 .trust-strip,
body.compat-v2 .download-btn {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

body.compat-v2 .fab-stack,
body.compat-v2 .apps-fab,
body.compat-v2 .telegram-fab {
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
}

/* Laptop widths at 100% were one step too tight: the last hero and dock
   controls dropped onto a second row. Laying the column out a little wider
   and scaling it to 90% matches the browser zoom that already fits them.
   Phones and small tablets stay on the layout tuned for them. */
@media (min-width: 1100px) and (max-width: 1680px) {
    body.compat-v2 .container {
        width: 100% !important;
        max-width: none !important;
        zoom: 0.9;
        padding-right: 64px !important;
    }
}

@media (min-width: 1681px) {
    body.sm-portal.compat-v2 {
        --sm-shell: min(1240px, calc(100% - 24px));
    }

    body.compat-v2 .container {
        padding-right: 20px !important;
    }
}

/* Phones and small tablets: the dock was sticky, so while scrolling its
   tall wrapped menu stayed on screen and covered the cards. It now scrolls
   away. The right inset is only the lane used by the round corner buttons. */
@media (max-width: 1099px) {
    body.compat-v2 .container {
        padding-left: 12px !important;
        padding-right: 64px !important;
    }

    body.compat-v2 .portal-main,
    body.compat-v2 .portal-showcase {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.compat-v2 #site-nav {
        position: relative !important;
        top: auto !important;
        z-index: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 16px !important;
        justify-content: stretch;
        align-items: stretch;
        gap: 8px;
        border-radius: 22px !important;
        overflow: hidden !important;
    }

    body.compat-v2 #site-nav a,
    body.compat-v2 #site-nav button {
        -webkit-flex: 1 0 auto;
        flex: 1 0 auto;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        min-height: 40px;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }

    body.compat-v2 .fab-stack {
        right: 16px;
    }
}
