/* Legacy app chrome (舊畫面) — phones/tablets ≤992px only; avatar home & desktop unchanged.
 *
 * Rules:
 *  - header is in normal flow (no sticky, no high z-index, no nested scroll);
 *  - fixed controls (紀錄/複製, 功能, 阿基, page-2 dock) never cover each other;
 *  - tap targets ≥44px and visible text ≥14px, with enough specificity to beat
 *    engineering-dark `.bm-ios-chip { min-height:0 !important }` (see the
 *    `:not(#bm-legacy-a):not(#bm-legacy-b)` floors at the end of this file);
 *  - elements themselves fit the viewport (overflow-x:clip is only a safety net).
 */

@media (max-width: 992px) {
    html[data-avatar-home="0"] {
        overflow-x: clip !important;
        max-width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) {
        overflow-x: clip !important;
        max-width: 100% !important;
        width: 100% !important;
        /* bottom edge for the fixed control cluster (紀錄/複製, 功能, 阿基) */
        --legacy-fixed-base: calc(env(safe-area-inset-bottom, 0px) + 10px);
        --legacy-fixed-step: 52px;
        padding-bottom: calc(var(--legacy-fixed-base) + var(--legacy-fixed-step) * 2) !important;
    }

    html[data-avatar-home="0"] body.bg-wallpaper:not(#bm-legacy-a) {
        width: 100% !important;
        max-width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #wallpaperLayer {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
        left: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-page-switch,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .main-layout,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .drawing-panel,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #calcModePage,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeModePage,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #electricalModePage,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #convertModePage,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .cloud-account-bar,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #appUpdateMarquee,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .footer-bar {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* ---------- header: normal flow, compact ---------- */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
        display: flex;
        flex-wrap: wrap !important;
        align-items: center !important;
        align-content: flex-start !important;
        gap: 6px !important;
        padding: 6px 10px 8px !important;
        max-height: none !important;
        overflow: visible !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .work-switch { order: 1; }
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-brand { order: 2; }
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-actions { order: 3; }
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-logo-cluster { order: 4; }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #headerBlackholeLogo {
        display: none;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-subtitle .header-chip-secondary,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-subtitle #lidarMeasureGuideLink,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-subtitle .support-chip,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-subtitle #nativeArChip {
        display: none !important;
    }

    /* 計算／放樣／電機／轉換: one row of four */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .work-switch {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        gap: 6px !important;
        padding: 4px !important;
        box-sizing: border-box !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .work-switch .work-btn {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 6px 4px !important;
        box-sizing: border-box !important;
        line-height: 1.15 !important;
        white-space: nowrap !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .work-btn .work-btn__icon {
        font-size: 16px !important;
        line-height: 1 !important;
    }

    /* brand: kicker, title and LIVE badge on one line */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-brand {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 2px 8px !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-kicker {
        letter-spacing: 1px !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-title {
        font-size: max(14px, 1.05rem) !important;
        line-height: 1.2 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-subtitle {
        display: flex;
        flex-wrap: wrap !important;
        gap: 4px !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-subtitle .live-badge {
        padding: 2px 8px !important;
        min-height: 0 !important;
    }

    /* header buttons: wrapping row of auto-width chips */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-actions {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 6px !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-first-path {
        display: contents !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-first-path > :is(button, a):not([hidden]),
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-more-tools__summary {
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 44px !important;
        padding: 8px 12px !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-more-tools {
        flex: 0 1 auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-more-tools[open] {
        flex-basis: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-more-tools__panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        max-width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-more-tools__panel .mode-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 10px !important;
        box-sizing: border-box !important;
    }

    /* 會員註冊 (page 2): kept, but as a compact grid */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) header.app-chrome .header-logo-cluster {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-quick {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        padding: 8px 10px !important;
        gap: 6px !important;
        box-sizing: border-box !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-field {
        min-width: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-field input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-actions .tool-btn,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-actions .header-member-btn {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 6px 4px !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-list-panel summary {
        align-content: center !important;
    }

    /* page-1 status strip: wrap instead of clipping 「API：…」 chips */
    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="1"]:not(#bm-legacy-a) #page1StatusStrip {
        flex-wrap: wrap !important;
        overflow: visible !important;
        row-gap: 4px !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="1"]:not(#bm-legacy-a) #page1StatusStrip #cloudAccountBar {
        flex: 1 1 100% !important;
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="1"]:not(#bm-legacy-a) #page1StatusStrip :is(.cloud-account-bar__status, .cloud-account-bar__member) {
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
    }

    /* ---------- 第1頁／第2頁 ---------- */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-page-switch {
        position: relative !important;
        top: auto !important;
        z-index: auto !important;
        flex-wrap: wrap !important;
        padding: 6px max(10px, env(safe-area-inset-left, 0px)) 6px max(10px, env(safe-area-inset-right, 0px)) !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-page-btn {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
    }

    /* ---------- content: fit the viewport ---------- */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .drawing-panel .tool-bar,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .page2-sticky-toolbar,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .page2-stage-chrome,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .page2-core-jumps,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .page2-stage-chrome__actions,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .cloud-account-bar__actions,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .page2-export-row,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .btn-group {
        flex-wrap: wrap !important;
        align-content: flex-start !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .drawing-panel .tool-bar .tool-group,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .drawing-panel .tool-bar .tool-btn,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .control-grid,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .bim-grid,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .drawing-panel,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #canvas-container {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) #canvas-container {
        max-width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) input:not([type="checkbox"]):not([type="radio"]),
    html[data-avatar-home="0"] body:not(#bm-legacy-a) select,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) textarea {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal__fields {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal__fields label,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal > label {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal__fields input,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal__fields select,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal > label select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeCalibrationPanel .stake-cal__actions button {
        flex: 1 1 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel section,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel .glass-panel,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .qto-boq-sheet,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .formwork-check-sheet,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-table,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .bm-table-scroll,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .table-responsive {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel table,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-table table,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeModePage table,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #electricalModePage table,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #convertModePage table {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel table > thead,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel table > tbody,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .calc-panel table > tfoot,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-table table > thead,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .header-member-table table > tbody,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeModePage table > thead,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #stakeModePage table > tbody,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #electricalModePage table > thead,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #electricalModePage table > tbody,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #convertModePage table > thead,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) #convertModePage table > tbody {
        display: table;
        width: max-content !important;
        min-width: 100% !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) pre,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) code,
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .coach-ai-input {
        max-width: 100% !important;
        overflow-x: auto !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .footer-bar {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* ---------- page 2 quote dock: fixed, predictable height ---------- */
    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) {
        --page2-quote-dock-height: 158px;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not([data-mobile-blueprint-dock="1"]):not(#bm-legacy-a) {
        --legacy-fixed-base: calc(var(--page2-quote-dock-height) + env(safe-area-inset-bottom, 0px) + 8px);
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"][data-mobile-blueprint-dock="1"]:not(#bm-legacy-a) {
        --legacy-fixed-base: calc(var(--mobile-blueprint-dock-height, 176px) + env(safe-area-inset-bottom, 0px) + 8px);
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock {
        max-width: 100% !important;
        min-height: calc(var(--page2-quote-dock-height) + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box !important;
        align-content: start !important;
        gap: 8px !important;
        z-index: 2210 !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__stat {
        display: flex;
        align-items: baseline !important;
        justify-content: space-between !important;
        gap: 6px !important;
        padding: 6px 10px !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__stat span {
        flex: 0 0 auto !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__stat strong {
        margin-top: 0 !important;
        min-width: 0 !important;
        text-align: right !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    /* 越南文：報價列改 2×2，字可以換行；中文維持 4 欄 */
    html[data-avatar-home="0"][lang="vi"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) {
        --page2-quote-dock-height: 210px;
    }
    html[data-avatar-home="0"][lang="vi"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    html[data-avatar-home="0"][lang="vi"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__actions .tool-btn {
        width: 100% !important;
        max-width: 100% !important;
        justify-self: stretch !important;
        white-space: normal !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere;
        line-height: 1.2 !important;
        height: auto !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__actions .tool-btn {
        position: relative !important;
        z-index: 1 !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) .page2-quote-dock__actions .bm-ios-chip::before {
        pointer-events: none !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) #toast,
    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not(#bm-legacy-a) #toast.show {
        bottom: calc(var(--legacy-fixed-base) + var(--legacy-fixed-step) * 2) !important;
        z-index: 2205 !important;
    }

    html[data-avatar-home="0"] body[data-work-mode="calc"][data-calc-page="2"]:not([data-mobile-blueprint-dock="1"]):not(#bm-legacy-a) {
        padding-bottom: calc(var(--legacy-fixed-base) + var(--legacy-fixed-step) * 2) !important;
    }

    /* ---------- fixed control cluster ----------
     * 紀錄／複製: bottom-left. 功能: bottom-right. 阿基: right, one step above 功能.
     * On page 2 the whole cluster sits above the quote dock.
     */
    html[data-avatar-home="0"] body:not(#bm-legacy-a) .mobile-drawer {
        bottom: var(--legacy-fixed-base) !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .mobile-drawer .mobile-func-tab {
        bottom: 0 !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .mobile-drawer .drawer-shell {
        bottom: calc(var(--legacy-fixed-base) + var(--legacy-fixed-step)) !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) #akiEverywhereFab.bm-ios-chip {
        bottom: calc(var(--legacy-fixed-base) + var(--legacy-fixed-step)) !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .mobile-test-log {
        right: auto !important;
        left: max(8px, env(safe-area-inset-left, 0px)) !important;
        bottom: var(--legacy-fixed-base) !important;
        z-index: 2215 !important;
        max-width: min(60vw, 200px) !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a) .mobile-test-log-btn {
        padding: 6px 10px !important;
    }

    /* ---------- floors: tap ≥44px, text ≥14px ----------
     * `:not(#bm-legacy-a):not(#bm-legacy-b)` never matches anything away; it only adds
     * id-level specificity so these floors beat engineering-dark's `.bm-ios-chip`
     * (`min-height:0 !important`, up to 0-6-2) and page-level `font-size` rules.
     */
    html[data-avatar-home="0"] body:not(#bm-legacy-a):not(#bm-legacy-b) :is(
        button,
        label.tool-btn,
        a.tool-btn,
        a.mode-btn,
        summary,
        [role="button"],
        .calc-page-btn,
        .work-btn,
        .mobile-func-tab,
        .mobile-test-log-btn
    ) {
        min-height: 44px !important;
        min-width: 44px !important;
        box-sizing: border-box !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a):not(#bm-legacy-b) :is(label.tool-btn, a.tool-btn, a.mode-btn) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a):not(#bm-legacy-b) :is(label.tool-btn, a.tool-btn, a.mode-btn)[hidden] {
        display: none !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a):not(#bm-legacy-b) summary {
        align-content: center !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a):not(#bm-legacy-b) :is(
        summary,
        .work-btn__name,
        .mobile-toolbar-core,
        #btnWarRoom,
        .header-more-tools__panel .mode-btn,
        .page2-quote-dock__actions .tool-btn,
        .page2-sheet-close,
        .action-cluster-title,
        .field-simulator-upload-label,
        #stakeCalibrationPanel button,
        .feature-demo-replay-btn,
        #btnOpenBlueprint3dHub,
        #newbieFlowNext,
        #page1OpenPlanStructure,
        #cloudLoginBtn,
        #cloudRegisterBtn,
        #cloudPayBtn,
        .cloud-account-bar__photo,
        .mobile-func-tab,
        .mobile-test-log-btn,
        .header-kicker,
        .live-badge,
        .header-meta-chip,
        .header-member-quick__title,
        .header-member-field label,
        .header-member-hint,
        .header-member-table th,
        .header-member-table td,
        .calc-panel table th,
        .calc-panel table td,
        .ticker-label,
        #globalWeatherTickerText,
        .stake-mode-kicker,
        .stake-flow-step,
        .newbie-flow-step,
        .convert-flow-step,
        .action-cluster-chip,
        .bim-card,
        .bim-card span,
        .bim-note,
        .bim-unmatched-grid label,
        .unit-grid label,
        #unitConvertResult,
        #bimLayoutQaSummary,
        #bimSpecSummary,
        [id^="layout"][id$="Summary"],
        [id^="staking"][id$="Summary"],
        #stakingSuggestionHint,
        [id^="honestStake"],
        .honest-stake-label,
        #stakeProjectTitle span,
        .stake-cal__wide,
        .stake-cal__chip,
        .stake-cal__fields label,
        .hologram-mode-note__title,
        .hologram-mode-note p,
        .hologram-mode-note span,
        .hologram-mode-list li,
        .ar-guide-panel__steps li,
        .ar-guide-panel__free,
        .ar-feature-card__body,
        .ar-feature-card__free,
        .ar-feature-map__note,
        .electrical-footer-note,
        .mep-calc-result-card__k,
        .mep-dashboard-badge,
        .mep-live-card__k,
        .mep-pipeline-step__label,
        .mep-pipeline-step__num,
        .page1-media-fold__tone,
        .page1-news-feed__tag,
        .page2-quote-dock__stat span,
        .qto-card-badge,
        .qto-card-ui__note,
        .qto-card-ui__page-label,
        .tool-mini span,
        input:not([type="checkbox"]):not([type="radio"]),
        select,
        textarea,
        pre,
        code
    ) {
        font-size: 14px !important;
    }

    html[data-avatar-home="0"] body:not(#bm-legacy-a):not(#bm-legacy-b) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
        font-size: 16px !important;
    }
}
