/* Velix phone-first skin.
   Extra chrome is hidden on desktop; layout rules live in max-width queries. */

.m-dock,
.home-m { display: none; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (max-width: 860px), (max-width: 1024px) and (pointer: coarse) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        --dash-header-h: 52px;
        --m-dock-h: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    body {
        overflow-x: clip;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: none;
        height: auto;
        padding-bottom: calc(var(--m-dock-h) + 8px);
        -webkit-tap-highlight-color: rgba(61, 232, 255, 0.16);
    }

    body.nav-open { overflow: hidden; }

    main {
        padding-bottom: 16px;
        min-width: 0;
    }

    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* ----- Header: logo | avatar | hamburger ----- */
    .dash-header {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        height: auto;
        min-height: var(--dash-header-h);
        max-height: none;
        max-width: 100%;
        min-width: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(8px, env(safe-area-inset-right, 0px));
        gap: 8px;
        overflow: visible;
        z-index: 90;
    }

    .dash-header__user .theme-wrap,
    .theme-wrap_bar,
    .dash-header__auth_bar,
    .dash-header__user > .dash-header__auth,
    .dash-header__msg-btn,
    .dash-header__actions > a.dash-header__icon-btn,
    .dash-header__search-pop {
        display: none !important;
    }

    .dash-header__sheet-foot,
    .theme-wrap_sheet {
        display: flex !important;
        align-items: center;
        gap: 10px;
        width: 100%;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--line);
    }

    .dash-header__menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
        border-radius: var(--radius-sm, 10px);
        border: 1px solid var(--line);
        background: var(--panel);
        color: var(--text);
    }

    .theme-wrap_sheet .theme-toggle,
    .theme-wrap_sheet .theme-switch__btn,
    .dash-header__cta {
        min-height: 44px;
        min-width: 44px;
    }

    button,
    .btn,
    .chip,
    .platform,
    .tag {
        min-height: 44px;
    }

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select,
    textarea,
    .input,
    .textarea {
        font-size: 16px !important;
    }

    a, button, .btn, .chip, .platform, .m-dock a, .home-m a, .tool-tile, .home-dest a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(61, 232, 255, 0.16);
    }

    .nav-sheet-overlay {
        top: calc(var(--dash-header-h) + env(safe-area-inset-top, 0px));
        z-index: 50;
    }
    .dash-header__menu-btn {
        position: relative;
        z-index: 96;
    }

    .dash-header__tabs {
        display: none;
    }
    .dash-header__tabs.open {
        display: flex !important;
        position: absolute;
        top: calc(100% + 6px);
        right: 8px;
        left: auto;
        bottom: auto;
        width: min(380px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
        height: auto;
        max-height: min(72dvh, calc(100dvh - var(--dash-header-h) - 16px));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        pointer-events: auto;
        touch-action: pan-y;
        padding: 10px;
        z-index: 95;
        background: var(--bg-2, var(--panel));
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 4px;
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow, 0 18px 40px rgba(0,0,0,.45));
    }

    .dash-header__tab,
    .dash-header__tab-inner {
        min-height: 44px;
    }

    .dash-header__search {
        display: block;
        margin: 0 0 10px;
    }

    .dash-header__search .input {
        width: 100%;
        font-size: 16px;
        min-height: 44px;
    }

    /* ----- Bottom dock ----- */
    .m-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 70;
        align-items: stretch;
        justify-content: space-around;
        gap: 2px;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        background: color-mix(in srgb, var(--bg-2, #0c0c0e) 92%, transparent);
        border-top: 1px solid var(--line, #222);
        backdrop-filter: blur(16px) saturate(1.2);
        box-shadow: 0 -8px 28px rgba(0, 0, 0, .28);
    }

    .m-dock a {
        position: relative;
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 48px;
        padding: 6px 4px;
        border-radius: 12px;
        color: var(--text-dim, #8b8b93);
        text-decoration: none;
        font-size: .62rem;
        font-weight: 700;
        letter-spacing: .02em;
        line-height: 1.1;
    }

    .m-dock a i { font-size: 1.05rem; line-height: 1; }

    .m-dock__ico {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        min-height: 22px;
    }

    .m-dock__badge {
        position: absolute;
        top: -6px;
        right: -10px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--bad, #ff4d5a);
        color: #fff;
        font-size: .58rem;
        font-weight: 800;
        line-height: 16px;
        text-align: center;
    }

    .m-dock a.is-on,
    .m-dock a[aria-current="page"] {
        color: var(--text, #fff);
        background: var(--hover, rgba(255, 255, 255, .06));
    }

    html[data-theme="light"] .m-dock {
        background: color-mix(in srgb, var(--bg-2, #f2f3f7) 92%, transparent);
        box-shadow: 0 -8px 28px rgba(20, 20, 30, .08);
    }

    /* ----- Home ----- */
    .home-m { display: none !important; }

    .home-hero { padding-top: 18px; padding-bottom: 4px; }

    .home-hero h1 {
        font-size: clamp(1.55rem, 7.6vw, 2.15rem);
        letter-spacing: -0.045em;
        margin-bottom: 10px;
        line-height: 1.05;
    }

    .home-hero .lead,
    .home .lead,
    p.lead {
        display: block !important;
        font-size: .92rem;
        line-height: 1.5;
        margin-bottom: 16px;
        max-width: none !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        white-space: normal !important;
        text-overflow: unset !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-lead__more { display: inline !important; }

    .home-fetch {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        padding: 12px;
        border-radius: 16px;
    }

    .home-fetch__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }
    .home-fetch__platforms {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .home-fetch__platforms span { width: 28px; height: 28px; font-size: .78rem; }
    @media (min-width: 521px) {
        .home-fetch__top {
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
        }
        .home-fetch__platforms { justify-content: flex-end; }
    }

    .home-fetch__row {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 6px 6px 6px 10px;
    }

    .home-fetch__input {
        flex: 1 1 auto;
        width: auto;
        min-height: 44px;
        font-size: 16px !important;
        padding: 10px 6px;
    }

    .home-fetch__go {
        flex: 0 0 auto;
        width: auto;
        min-height: 44px;
        height: 44px;
        justify-content: center;
        border-radius: 12px;
        padding: 10px 16px;
    }

    .home-fetch-tip { font-size: .75rem; margin-top: 8px; }

    @media (max-width: 520px) {
        .home-fetch__row { flex-wrap: wrap; padding: 8px; }
        .home-fetch__ico { display: none; }
        .home-fetch__input { flex: 1 1 100%; width: 100%; }
        .home-fetch__go {
            flex: 1 1 100%;
            width: 100%;
            min-height: 48px;
            height: 48px;
            border-radius: 14px;
        }
    }

    .home-dest {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        margin-top: 22px;
    }

    .home-dest a {
        flex: none;
        min-width: 0;
        min-height: 64px;
        height: auto;
        padding: 10px 8px;
        justify-content: flex-start;
        overflow: hidden;
    }

    .home-dest strong {
        font-size: .88rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .home-dest span:not(.home-dest__ico) {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        font-size: .65rem;
        line-height: 1.3;
    }

    .home-dest__ico { font-size: .85rem; width: 22px; height: 22px; }

    .home-tool { min-height: 56px; padding: 12px 0; }
    .home-tool__go { display: none; }
    .home-tool::after {
        content: "";
        flex: 0 0 8px;
        width: 8px;
        height: 8px;
        margin-left: auto;
        border-right: 2px solid var(--text-dim, #8b8b93);
        border-bottom: 2px solid var(--text-dim, #8b8b93);
        transform: rotate(-45deg);
    }
    .home-row { min-height: 48px; }

    .home-split,
    .home-tools,
    .grid-2,
    .grid-3,
    .grid.grid-2,
    .grid.grid-3 {
        grid-template-columns: 1fr !important;
    }

    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .tool-tile {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 16px;
        grid-template-areas:
            "ico title chev"
            "ico blurb chev";
        column-gap: 12px;
        row-gap: 2px;
        align-items: center;
        min-height: 56px;
        height: auto;
        padding: 12px 12px 12px 14px;
    }

    .tool-tile__top {
        grid-area: ico;
        justify-content: center;
        align-items: center;
        margin: 0;
    }

    .tool-tile__meta { display: none; }

    .tool-tile h3 {
        grid-area: title;
        margin: 0;
        font-size: .95rem;
        line-height: 1.25;
    }

    .tool-tile p {
        grid-area: blurb;
        margin: 0;
        flex: none;
        -webkit-line-clamp: 1;
        font-size: .78rem;
    }

    .tool-stars,
    .tool-acts { display: none; }

    .tool-tile::after {
        content: "";
        grid-area: chev;
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--text-dim, #8b8b93);
        border-bottom: 2px solid var(--text-dim, #8b8b93);
        transform: rotate(-45deg);
        justify-self: end;
        align-self: center;
    }

    .tools-bar {
        top: calc(var(--dash-header-h) + env(safe-area-inset-top, 0px));
    }

    .tools-chips {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scrollbar-width: none;
        max-width: 100%;
        width: 100%;
        padding: 4px 0 10px;
        margin-bottom: 8px;
    }
    .tools-chips::-webkit-scrollbar { display: none; }
    .tools-chips button {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
        padding: 8px 12px;
    }

    .lab-grid,
    .lab-scripts { grid-template-columns: 1fr !important; }

    .lab-canvas,
    .lab-grid canvas,
    canvas.lab-canvas {
        max-width: 100%;
        height: auto;
    }

    #labRun {
        bottom: calc(var(--m-dock-h) + 8px);
        min-height: 48px;
        width: 100%;
        justify-content: center;
    }

    .profile-messenger,
    .profile-messenger__sidebar,
    .profile-messenger__chat {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .picker {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
        max-height: min(46vh, 340px);
        border-radius: 16px 16px 12px 12px;
    }
    .picker.show {
        position: fixed;
        bottom: calc(var(--m-dock-h) + 8px);
        z-index: 80;
    }

    .platforms { display: flex; flex-wrap: wrap; gap: 8px; }
    .platform {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 10px 14px;
    }
    .platforms a.platform:first-of-type {
        flex: 1 1 100%;
        min-height: 48px;
        justify-content: center;
        width: 100%;
    }

    .apps .card-body .grid.grid-2,
    .section .grid.grid-2 { grid-template-columns: 1fr !important; }

    .mkt-tabs,
    .mkt-venues,
    .mkt-risks,
    .mkt-modes,
    .mkt-picks,
    .mkt-set__chips,
    .mkt-ranges,
    .mkt-trade__chips,
    .cve-chips,
    .sol-nav__col > div,
    .lab-sibs,
    .tl-tabs,
    .tl-units {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        overflow-x: visible;
        overflow-y: visible;
    }

    .mkt-chart-wrap {
        height: min(42vh, var(--mkt-h, 220px));
        max-height: 42vh;
    }
    .mkt-chart-card { max-height: none; }

    .cve-search,
    .cve-more,
    .cve-hero__row,
    .sol-form,
    .sol-fields,
    form.stack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cve-search .input,
    .cve-more .input,
    .cve-search .btn,
    .sol-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .sol-form select,
    .sol-form textarea,
    .lab-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .lab-card select,
    .lab-card textarea,
    .tools-search .input {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .mkt-table-wrap,
    .table-wrap {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    footer.site {
        padding-top: 22px;
        padding-bottom: 20px;
        font-size: .82rem;
    }

    .foot-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px 18px;
    }
    .foot-grid > div:first-child { grid-column: 1 / -1; }
    .foot-grid h4 {
        font-size: .72rem;
        margin-bottom: 8px;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .foot-grid a { padding: 5px 0; font-size: .82rem; }
    .foot-grid p.muted { font-size: .8rem; }
    .foot-bottom { flex-direction: column; gap: 6px; font-size: .72rem; }
}

@media (max-width: 560px) {
    .home-m { display: none !important; }
    .home-dest {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .home-dest a { min-height: 64px; padding: 8px 6px; }
    .home-dest strong { font-size: .78rem; }
    .home-kicker { margin-bottom: 12px; }
    .dash-header__cta { padding: 0 12px; }
    .m-dock a { font-size: .58rem; }
    .foot-grid a { min-height: 36px; display: flex; align-items: center; }
}

/* === grok-home-ui-lock === */
@media (max-width: 860px), (max-width: 1024px) and (pointer: coarse) {
    html, body {
        overflow-x: clip;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: none;
        height: auto;
        max-width: 100%;
    }
    .home, .container, main { max-width: 100%; min-width: 0; }
    .dash-header { max-width: 100%; min-width: 0; overflow: visible; }

    .home-m { display: none !important; }

    .home-hero .lead,
    .home .lead,
    p.lead {
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        white-space: normal !important;
        text-overflow: unset !important;
        max-height: none !important;
        max-width: 100% !important;
    }
    .home-lead__more { display: inline !important; }

    /* bar: logo + search + hamburger */
    .theme-wrap_bar,
    .dash-header__user > .theme-wrap,
    .dash-header__auth_bar,
    .dash-header__user > .dash-header__auth,
    .dash-header__msg-btn,
    .dash-header__actions > a.dash-header__icon-btn,
    .dash-header__account {
        display: none !important;
    }
    .dash-header__actions { display: flex !important; }
    .dash-header__search-pop { display: none !important; }
    .dash-header__menu-btn {
        display: inline-flex !important;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .dash-header__sheet-foot,
    .theme-wrap_sheet {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--line);
    }
    .dash-header__sheet-label {
        font-size: .72rem;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--text-dim);
        font-weight: 700;
    }
    .theme-switch_sheet,
    .dash-header__sheet-foot .theme-switch {
        display: flex !important;
        width: 100%;
    }
    .dash-header__sheet-foot .theme-switch__btn {
        flex: 1 1 0;
        min-height: 44px;
        min-width: 44px;
    }
    .dash-header__auth_sheet { display: flex !important; }
    .m-dock { display: flex !important; }

    .home-fetch {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        flex-direction: column;
    }
    .home-fetch__input { font-size: 16px !important; min-height: 44px; }
    .home-fetch__go { min-height: 44px; }

    .home-dest {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    .home-dest a {
        min-width: 0 !important;
        min-height: 72px;
        height: auto;
        padding: 12px;
        overflow: visible !important;
        white-space: normal !important;
    }
    .home-dest strong,
    .home-dest span {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-split,
    .home-tools,
    .home .grid.grid-2,
    .home .grid.grid-3,
    .grid.grid-2,
    .grid.grid-3 {
        grid-template-columns: 1fr !important;
    }
}
@media (min-width: 861px) and (pointer: fine) {
    html.ui-desktop .m-dock { display: none !important; }
    html.ui-desktop .dash-header__sheet-foot { display: none !important; }
    html.ui-desktop .dash-header { flex-wrap: nowrap; }
    html.ui-desktop .dash-header__tabs { flex-wrap: nowrap; overflow-x: hidden; }
}
html.ui-phone .m-dock { display: flex !important; }
html.ui-desktop .m-dock { display: none !important; }

html.page-ai footer.site,
html.page-ai .m-dock,
html.page-ai.ui-phone .m-dock {
    display: none !important;
}
html.page-ai,
html.page-ai body,
html.page-ai.ui-phone,
html.page-ai.ui-phone body {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding-bottom: 0 !important;
}


/* === iphone-overflow-lock === */
html.ui-phone,
html.ui-phone body {
    overflow-x: clip !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    height: auto;
    max-width: 100% !important;
    width: 100%;
}
html.ui-phone img,
html.ui-phone video,
html.ui-phone canvas,
html.ui-phone svg,
html.ui-phone table,
html.ui-phone pre,
html.ui-phone iframe {
    max-width: 100% !important;
}
html.ui-phone .dash-header__logo { min-width: 0; flex: 0 1 auto; overflow: hidden; }
html.ui-phone .dash-header__search-pop,
html.ui-phone .dash-header__search-pop .input {
    min-width: 0 !important;
    max-width: 100% !important;
}
html.ui-phone .mkt-ticker,
html.ui-phone .mkt-ticker__track { max-width: 100%; overflow: hidden; }
html.ui-phone .home-acts { flex-wrap: wrap; }
html.ui-phone .home-acts .btn { white-space: normal; }
html.ui-phone .tools-bar { flex-wrap: wrap; max-width: 100%; }
html.ui-phone .container, html.ui-phone main, html.ui-phone .home, html.ui-phone .mkt, html.ui-phone .sol-page {
    max-width: 100%;
    min-width: 0;
}

html.ui-phone .dash-header__search-pop { display: none !important; min-width: 0 !important; width: 0 !important; overflow: hidden !important; }
html.ui-phone .dash-header {
    overflow: visible !important;
    max-width: 100%;
    z-index: 90;
}
html.ui-phone .dash-header__menu-btn {
    position: relative;
    z-index: 96;
    display: inline-flex !important;
    pointer-events: auto !important;
}
@media (max-width: 860px), (max-width: 1024px) and (pointer: coarse) {
    .dash-header__tabs { display: none; }
    .dash-header__tabs.open {
        display: flex !important;
        position: absolute !important;
        top: calc(100% + 6px) !important;
        right: 8px !important;
        left: auto !important;
        bottom: auto !important;
        width: min(380px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
        height: auto !important;
        max-height: min(72dvh, calc(100dvh - var(--dash-header-h) - 16px)) !important;
        z-index: 95;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        pointer-events: auto;
        touch-action: pan-y;
        padding: 10px;
        background: var(--bg-2, var(--panel));
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow, 0 18px 40px rgba(0,0,0,.45));
    }
    .nav-sheet-overlay {
        z-index: 50;
        top: calc(var(--dash-header-h) + env(safe-area-inset-top, 0px));
    }
}


/* === iphone-nav-scroll (last in this file so it wins) === */
html.ui-phone,
html.ui-phone body {
    overflow-x: clip !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    height: auto;
}

html.ui-phone .container,
html.ui-phone main,
html.ui-phone .home,
html.ui-phone .mkt,
html.ui-phone .sol-page {
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
    overflow-y: visible;
}

html.ui-phone .dash-header {
    overflow: visible !important;
    max-width: 100%;
}
html.ui-phone .dash-header__logo {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
}

html.ui-phone .dash-header__tabs {
    display: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    pointer-events: auto;
    touch-action: pan-y;
}
html.ui-phone .dash-header__tabs.open {
    display: flex !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    pointer-events: auto;
    touch-action: pan-y;
}

html.ui-phone .tools-bar { flex-wrap: wrap; max-width: 100%; }
html.ui-phone .tools-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    max-width: 100%;
    width: 100%;
    padding: 4px 0 10px;
    margin-bottom: 8px;
}
html.ui-phone .tools-chips::-webkit-scrollbar { display: none; }
html.ui-phone .tools-chips button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 44px;
}

@media (max-width: 860px), (max-width: 1024px) and (pointer: coarse) {
    html, body {
        overflow-x: clip;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: none;
        height: auto;
    }
    .container, main, .home, .mkt, .sol-page {
        max-width: 100%;
        min-width: 0;
        overflow-x: visible;
        overflow-y: visible;
    }
    .dash-header { overflow: visible; max-width: 100%; }
    .dash-header__logo { min-width: 0; overflow: hidden; }
    .dash-header__search-pop { display: none !important; }

    .dash-header__tabs { display: none; }
    .dash-header__tabs.open {
        display: flex !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        pointer-events: auto;
        touch-action: pan-y;
    }

    .tools-chips {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scrollbar-width: none;
        max-width: 100%;
        width: 100%;
        padding: 4px 0 10px;
        margin-bottom: 8px;
    }
    .tools-chips::-webkit-scrollbar { display: none; }
    .tools-chips button {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
    }
}


/* treebar: tiny traces next to wordmark; do not shove hamburger/search */
html.ui-phone .vx-treebar {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 92px;
    overflow: hidden;
    gap: 0;
    height: 14px;
}
html.ui-phone .vx-treebar__page { display: none; }
html.ui-phone .vx-treebar__svg {
    width: 64px;
    height: 14px;
    max-width: 72px;
}
@media (max-width: 380px) {
    html.ui-phone .vx-treebar { max-width: 72px; }
    html.ui-phone .vx-treebar__svg { width: 56px; height: 12px; max-width: 56px; }
}

/* === dash-nav-dropdown (last so it wins over earlier sheet rules) === */
.dash-header {
    overflow: visible !important;
}
.dash-header__menu-btn {
    position: relative;
    z-index: 130;
    pointer-events: auto;
}
.nav-sheet-overlay {
    z-index: 50;
    top: calc(var(--dash-header-h) + env(safe-area-inset-top, 0px));
}
.nav-sheet-overlay.show { display: block !important; }

html.ui-phone .dash-header__tabs {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 8px !important;
    left: auto !important;
    bottom: auto !important;
    width: min(380px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    max-height: min(72dvh, calc(100dvh - var(--dash-header-h) - 16px)) !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 4px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 125 !important;
    padding: 10px !important;
    background: var(--panel, var(--bg-2)) !important;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow, 0 18px 50px rgba(0,0,0,.45));
}
html.ui-phone .dash-header__tabs.open {
    display: flex !important;
}
html.ui-phone .dash-header__tabs .dash-header__search {
    display: block !important;
}

@media (max-width: 860px), (max-width: 1024px) and (pointer: coarse) {
    .dash-header__tabs {
        display: none !important;
        position: absolute !important;
        top: calc(100% + 6px) !important;
        right: 8px !important;
        left: auto !important;
        bottom: auto !important;
        width: min(380px, calc(100vw - 16px)) !important;
        max-width: calc(100vw - 16px) !important;
        height: auto !important;
        max-height: min(72dvh, calc(100dvh - var(--dash-header-h) - 16px)) !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 4px;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        z-index: 125 !important;
        padding: 10px !important;
        background: var(--panel, var(--bg-2)) !important;
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow, 0 18px 50px rgba(0,0,0,.45));
    }
    .dash-header__tabs.open {
        display: flex !important;
    }
    .dash-header__tabs .dash-header__search {
        display: block !important;
    }
    .dash-header__menu-btn {
        display: inline-flex !important;
    }
    .nav-sheet-overlay.show {
        display: block !important;
    }
}

/* === mobile-tools-tap-fix === */
@media (max-width: 860px), (max-width: 1024px) and (pointer: coarse) {
    .tools-layout {
        display: block !important;
        width: 100% !important;
    }
    .tools-main,
    .tools-grid,
    .tools-cat {
        width: 100% !important;
        max-width: 100% !important;
        justify-items: stretch !important;
    }
    .tools-grid {
        grid-template-columns: 1fr !important;
        justify-content: stretch !important;
    }
    .tool-tile {
        width: 100% !important;
        max-width: 100% !important;
        justify-self: stretch !important;
        position: relative !important;
        pointer-events: auto !important;
        text-align: left !important;
    }
    .tool-tile__hit {
        position: absolute !important;
        inset: 0 !important;
        z-index: 6 !important;
        pointer-events: auto !important;
    }
    .tool-tile::after {
        pointer-events: none !important;
        z-index: 1;
    }
    .tools-chips {
        justify-content: flex-start !important;
        scroll-snap-type: none !important;
    }
    .tools-chips button {
        scroll-snap-align: none !important;
    }
}
html.ui-phone .tools-grid { grid-template-columns: 1fr !important; }
html.ui-phone .tool-tile {
    width: 100% !important;
    justify-self: stretch !important;
    pointer-events: auto !important;
    text-align: left !important;
}
html.ui-phone .tool-tile__hit {
    position: absolute !important;
    inset: 0 !important;
    z-index: 6 !important;
    pointer-events: auto !important;
}
html.ui-phone .tool-tile::after { pointer-events: none !important; }
/* === cat-count-red === */
.tools-chips button em,
.tools-chips button.on em,
.tools-chips button:hover em,
h2 .tools-cat-n,
.tools-cat-n {
    font-style: normal !important;
    font-weight: 800 !important;
    color: #ff2d2d !important;
    opacity: 1 !important;
    margin-left: 6px;
}

html.page-ai footer.site,
html.page-ai .m-dock,
html.page-ai.ui-phone .m-dock {
    display: none !important;
}
html.page-ai,
html.page-ai body,
html.page-ai.ui-phone,
html.page-ai.ui-phone body {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding-bottom: 0 !important;
}
