/* Only new cards are hidden by default. Existing desktop navigation is untouched. */
.cgosu-simple-card {
    display: none;
}

@media (max-width: 1023px) {
    #cgosuMenuPanel .cgosu-simple-mobile-industry,
    #cmlMenuPanel .cgosu-simple-mobile-industry,
    .cgosu-mobile-explorer.cgosu-simple-explorer-replaced {
        display: none !important;
    }

    .cgosu-simple-card {
        display: block;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        margin: 12px 0 0;
        padding: 16px;
        border: 1px solid #dce4eb;
        border-radius: 16px;
        background: #f4f9fc;
        color: #253c53;
        font-family: inherit;
        text-align: left;
    }

    .cgosu-simple-card[hidden] {
        display: none !important;
    }

    .cgosu-simple-inline {
        flex: 0 0 100%;
        margin: 0;
    }

    .cgosu-simple-card .cgosu-simple-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 0 0 12px;
    }

    .cgosu-simple-card .cgosu-simple-title {
        min-width: 0;
        color: #253c53;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.45;
        letter-spacing: -0.045em;
    }

    .cgosu-simple-card .cgosu-simple-reset {
        flex: 0 0 auto;
        min-height: 44px;
        margin: -8px -4px -8px 0;
        padding: 8px 4px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #536d84;
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

    .cgosu-simple-card .cgosu-simple-field {
        display: block;
        min-width: 0;
        margin: 0 0 12px;
    }

    .cgosu-simple-card .cgosu-simple-label {
        display: block;
        margin: 0 0 6px;
        color: #405a72;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.5;
    }

    .cgosu-simple-card .cgosu-simple-select {
        display: block;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        margin: 0;
        padding: 10px 12px;
        border: 1px solid #cfdbe5;
        border-radius: 10px;
        background: #fff;
        color: #253c53;
        font: inherit;
        font-size: 16px;
        line-height: 1.5;
    }

    .cgosu-simple-card .cgosu-simple-submit {
        display: block;
        box-sizing: border-box;
        width: 100%;
        min-height: 48px;
        margin: 4px 0 0;
        padding: 12px 10px;
        border: 0;
        border-radius: 11px;
        background: #2879cf;
        color: #fff;
        font: inherit;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.5;
        letter-spacing: -0.045em;
        text-align: center;
        cursor: pointer;
    }

    .cgosu-simple-card .cgosu-simple-select:focus-visible,
    .cgosu-simple-card .cgosu-simple-reset:focus-visible,
    .cgosu-simple-card .cgosu-simple-submit:focus-visible,
    #cgosuMenuPanel .cgosu-simple-toggle:focus-visible,
    #cmlMenuPanel .cgosu-simple-toggle:focus-visible {
        outline: 3px solid #1468b8;
        outline-offset: 3px;
    }

    #cgosuMenuPanel .cgosu-simple-toggle::after,
    #cmlMenuPanel .cgosu-simple-toggle::after {
        content: "+";
    }

    #cgosuMenuPanel .cgosu-simple-toggle[aria-expanded="true"]::after,
    #cmlMenuPanel .cgosu-simple-toggle[aria-expanded="true"]::after {
        content: "−";
    }
}
/* 20261202-search-dock: opt in on result pages only; desktop keeps its original UI. */
.cgosu-simple-dock,
.cgosu-simple-sheet {
    display: none;
}

@media (max-width: 1023px) {
    body.cgosu-simple-list-page .cgosu-filter-rail {
        display: none !important;
    }

    /* Dock height includes the safe area. JS adds its 8px bottom gap once. */
    body.cgosu-simple-list-page > .cgosu-simple-dock {
        position: fixed;
        z-index: 5400; /* Below recent items (5500), menu (9901), and consult modal (25000). */
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: 8px;
        left: max(12px, env(safe-area-inset-left, 0px));
        display: block;
        box-sizing: border-box;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        font-family: inherit;
    }

    body.cgosu-simple-list-page > .cgosu-simple-dock .cgosu-simple-dock-trigger {
        display: flex;
        box-sizing: border-box;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-width: 0;
        min-height: 68px;
        margin: 0;
        padding: 12px 16px;
        border: 1px solid #729cdb;
        border-radius: 16px;
        background: #123e83;
        color: #fff;
        box-shadow: 0 6px 20px rgba(18, 62, 131, .24), 0 0 0 1px rgba(127, 176, 239, .12);
        font: inherit;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        animation: cgosu-simple-dock-pulse 3.6s ease-in-out infinite;
    }

    body.cgosu-simple-list-page .cgosu-simple-dock-copy {
        display: block;
        min-width: 0;
    }

    body.cgosu-simple-list-page .cgosu-simple-dock-copy > strong,
    body.cgosu-simple-list-page .cgosu-simple-dock-copy > small {
        display: block;
        margin: 0;
        color: #fff;
        line-height: 1.5;
        white-space: normal;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    body.cgosu-simple-list-page .cgosu-simple-dock-copy > strong {
        font-size: 16px;
        font-weight: 800;
        letter-spacing: -.045em;
    }

    body.cgosu-simple-list-page .cgosu-simple-dock-copy > small {
        margin-top: 2px;
        font-size: 12px;
        font-weight: 500;
        letter-spacing: -.025em;
    }

    body.cgosu-simple-list-page .cgosu-simple-dock-arrow {
        display: flex;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: 1px solid #8aaede;
        border-radius: 50%;
        color: #fff;
        font-size: 23px;
        font-weight: 700;
        line-height: 1;
    }

    body.cgosu-simple-list-page.cgosu-simple-sheet-open {
        overflow: hidden;
        overscroll-behavior-y: none;
    }

    /* Retain measurable dimensions while the dialog owns focus. */
    body.cgosu-simple-list-page.cgosu-simple-sheet-open > .cgosu-simple-dock {
        visibility: hidden;
        pointer-events: none;
    }

    body.cgosu-simple-list-page.cgosu-simple-sheet-open .cgosu-simple-dock-trigger {
        animation-play-state: paused;
    }

    body.cgosu-simple-list-page > .cgosu-simple-sheet {
        position: fixed;
        z-index: 26000; /* Above the existing 25000 consult modal. */
        inset: 0;
        box-sizing: border-box;
        align-items: flex-end;
        justify-content: center;
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        isolation: isolate;
        font-family: inherit;
    }

    body.cgosu-simple-list-page > .cgosu-simple-sheet:not([hidden]) {
        display: flex;
    }

    body.cgosu-simple-list-page > .cgosu-simple-sheet[hidden],
    body.cgosu-simple-list-page > .cgosu-simple-dock[hidden] {
        display: none !important;
    }

    body.cgosu-simple-list-page .cgosu-simple-backdrop {
        position: absolute;
        z-index: 0;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(9, 24, 47, .58);
        cursor: pointer;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-panel {
        position: relative;
        z-index: 1;
        box-sizing: border-box;
        width: 100%;
        max-width: 600px;
        min-width: 0;
        min-height: 0;
        max-height: 90vh;
        max-height: min(90vh, calc(100vh - env(safe-area-inset-top, 0px) - 12px));
        max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 12px));
        margin: 0;
        padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #d5e2f2;
        border-bottom: 0;
        border-radius: 24px 24px 0 0;
        background: #fff;
        color: #253c53;
        box-shadow: 0 -12px 40px rgba(9, 24, 47, .2);
        text-align: left;
    }

    body.cgosu-simple-list-page > .cgosu-simple-sheet:not([hidden]) .cgosu-simple-sheet-panel {
        animation: cgosu-simple-sheet-enter 220ms cubic-bezier(.2, .8, .2, 1) both;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-handle {
        width: 36px;
        height: 4px;
        margin: 0 auto 10px;
        border-radius: 4px;
        background: #c6d6e8;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 44px;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-title {
        min-width: 0;
        color: #123e83;
        font-size: 18px;
        font-weight: 800;
        line-height: 1.5;
        letter-spacing: -.045em;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-close {
        display: inline-flex;
        box-sizing: border-box;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        margin: 0;
        padding: 8px;
        border: 1px solid #d4e1ef;
        border-radius: 10px;
        background: #f4f8fd;
        color: #123e83;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.4;
        cursor: pointer;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-note {
        margin: 6px 0 16px;
        color: #536d84;
        font-size: 13px;
        line-height: 1.6;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-panel > .cgosu-simple-card.cgosu-simple-inline {
        width: 100%;
        margin: 0;
        padding: 16px;
        border-color: #d5e3f2;
        background: #f2f7fd;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-panel .cgosu-simple-submit {
        background: #123e83;
    }

    body.cgosu-simple-list-page .cgosu-simple-dock-trigger:focus-visible,
    body.cgosu-simple-list-page .cgosu-simple-backdrop:focus-visible,
    body.cgosu-simple-list-page .cgosu-simple-sheet-panel:focus-visible,
    body.cgosu-simple-list-page .cgosu-simple-sheet-close:focus-visible {
        outline: 3px solid #4a93ef;
        outline-offset: 3px;
    }

    body.cgosu-simple-list-page .cgosu-simple-sheet-panel:focus-visible {
        outline-offset: -4px;
    }

    /* Add the measured search footprint; never overwrite the existing --cgm-* inputs.
       --cgosu-simple-dock-clearance includes safe area and the dock's bottom gap.
       Optional --cgosu-simple-footer-clearance is a TOTAL minimum, not an increment. */
    body.cgosu-simple-list-page .cgosu-mbti-dock {
        bottom: calc(var(--cgosu-simple-dock-clearance, 92px) + 8px) !important;
    }

    body.cgosu-address.cgosu-simple-list-page #cgrRail,
    body.cgosu-address.cgosu-simple-list-page #cgrRail.is-open {
        bottom: calc(var(--cgm-rail-lift, 38px) + var(--cgosu-simple-dock-clearance, 92px)) !important;
    }

    body.cgosu-address.cgosu-simple-list-page .cgosu-footer-shell {
        padding-bottom: calc(var(--cgm-footer-clearance, 150px) + var(--cgosu-simple-dock-clearance, 92px)) !important;
        padding-bottom: max(calc(var(--cgm-footer-clearance, 150px) + var(--cgosu-simple-dock-clearance, 92px)), var(--cgosu-simple-footer-clearance, 0px)) !important;
    }

    /* Keep the smaller measured visual-viewport room, but also cap stale values
       against the newly raised rail. Safe-area bottom is already in dock clearance. */
    body.cgosu-address.cgosu-simple-list-page #cgrRail .cgr-panel {
        max-height: max(0px, calc(min(var(--cgm-panel-room, 100vh), 100vh - var(--cgm-rail-lift, 38px) - var(--cgosu-simple-dock-clearance, 92px) - var(--cgm-panel-bottom, 108px) - 12px) - env(safe-area-inset-top, 0px))) !important;
    }

    @supports (height: 100dvh) {
        body.cgosu-address.cgosu-simple-list-page #cgrRail .cgr-panel {
            max-height: max(0px, calc(min(var(--cgm-panel-room, 100dvh), 100dvh - var(--cgm-rail-lift, 38px) - var(--cgosu-simple-dock-clearance, 92px) - var(--cgm-panel-bottom, 108px) - 12px) - env(safe-area-inset-top, 0px))) !important;
        }
    }

    body.cgosu-simple-list-page .cgosu-search-expert-section {
        margin-bottom: 20px !important;
    }

    /* JS moves this original section AFTER #cgosuSearchAfterResults as a sibling,
       not into its .is-pending subtree; no expert-load success is required. */
    body.cgosu-simple-list-page .cgosu-search-keywords.cgosu-simple-keywords-lower {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        display: block !important;
        box-sizing: border-box;
        width: calc(100% - 28px) !important;
        max-width: 1160px !important;
        min-width: 0;
        margin: 0 auto 20px !important;
        padding: 16px !important;
        transform: none !important;
        border: 1px solid #c6dcf4;
        border-radius: 18px !important;
        background: #edf6ff !important;
        box-shadow: none;
    }

    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keywords-head {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 5px 12px;
        min-width: 0;
        margin: 0 0 12px !important;
    }

    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keywords-head strong {
        min-width: 0;
        color: #123e83;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.5;
    }

    /* Use the real helper text rather than duplicating it with the old pseudo-copy. */
    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keywords-head strong::after {
        content: none !important;
    }

    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keywords-head span {
        display: block !important;
        flex: 1 1 150px;
        min-width: 0;
        color: #4b6d94;
        font-size: 12px;
        line-height: 1.6;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keyword-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px !important;
        width: 100%;
        min-width: 0;
        max-height: none;
        padding: 0;
        overflow: visible;
    }

    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keyword-list a,
    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keyword-list a.is-key,
    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keyword-list a.is-profit {
        display: inline-flex;
        box-sizing: border-box;
        flex: 0 1 auto;
        align-items: center;
        justify-content: center;
        max-width: 100%;
        min-width: 0;
        min-height: 40px !important;
        padding: 8px 12px !important;
        border: 1px solid #accbee !important;
        border-radius: 10px;
        background: #fff !important;
        color: #164f93 !important;
        font-size: 13px !important;
        font-weight: 700;
        line-height: 1.5;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
    }

    body.cgosu-simple-list-page .cgosu-simple-keywords-lower .cgosu-search-keyword-list a:focus-visible {
        outline: 3px solid #1468b8;
        outline-offset: 3px;
    }
}

/* Only border and shadow change. Text, opacity, and the blue fill stay constant. */
@keyframes cgosu-simple-dock-pulse {
    0%, 100% {
        border-color: #729cdb;
        box-shadow: 0 6px 20px rgba(18, 62, 131, .24), 0 0 0 1px rgba(127, 176, 239, .12);
    }
    50% {
        border-color: #b1d1fa;
        box-shadow: 0 6px 24px rgba(18, 62, 131, .3), 0 0 0 4px rgba(127, 176, 239, .24);
    }
}

@keyframes cgosu-simple-sheet-enter {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
    body.cgosu-simple-list-page > .cgosu-simple-dock,
    body.cgosu-simple-list-page > .cgosu-simple-dock *,
    body.cgosu-simple-list-page > .cgosu-simple-sheet,
    body.cgosu-simple-list-page > .cgosu-simple-sheet * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
