@media (max-width: 900px) {
    /* Keep the whole mobile detail flow away from the device edges. */
    .app-route-detail .app-product-layout.shell,
    .app-route-detail .fx-ebay-detail-shell.shell,
    .app-route-detail .app-similar-feed.shell,
    .app-route-detail .app-related-guides.shell {
        width: auto !important;
        max-width: none !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }

    .app-route-detail .app-product-summary {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Auction information should read like eBay: text hierarchy, not nested cards. */
    .app-route-detail .app-purchase-panel.fx-ebay-purchase-panel,
    .app-route-detail .fx-ebay-purchase-panel .auction-status,
    .app-route-detail .fx-ebay-purchase-panel .auction-status > div,
    .app-route-detail .fx-ebay-purchase-panel .fx-ebay-auction-main,
    .app-route-detail .fx-ebay-purchase-panel .fx-ebay-auction-meta,
    .app-route-detail .fx-ebay-purchase-panel .fx-ebay-auction-meta > span {
        min-height: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .auction-status {
        padding-top: 8px !important;
        padding-bottom: 18px !important;
    }

    .app-route-detail .fx-ebay-auction-price {
        font-size: clamp(2.25rem, 11vw, 3rem) !important;
        line-height: .98 !important;
        letter-spacing: -.045em !important;
    }

    .app-route-detail .fx-ebay-auction-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        gap: 5px 7px !important;
        margin-top: 4px !important;
        color: var(--fx-text, #f5f7fb) !important;
        font-size: 1rem !important;
        line-height: 1.35 !important;
    }

    .app-route-detail .fx-ebay-auction-meta .fx-ebay-ended {
        color: var(--fx-muted, #9eabba) !important;
    }

    .app-route-detail .fx-ebay-auction-breakdown {
        margin-top: 7px !important;
        color: var(--fx-muted, #9eabba) !important;
        font-size: .88rem !important;
        line-height: 1.45 !important;
    }

    /* Active bidding: compact input + action, not a large boxed widget. */
    .app-route-detail .fx-ebay-purchase-panel .bid-form {
        margin: 0 !important;
        padding: 18px 0 20px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--fx-line, rgba(127,145,170,.28)) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .bid-form > label {
        display: block !important;
        margin: 0 0 9px !important;
        color: var(--fx-text, #f5f7fb) !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .bid-form > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .bid-form input {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 50px !important;
        margin: 0 !important;
        padding: 10px 13px !important;
        border: 1px solid var(--fx-line-strong, #566171) !important;
        border-radius: 10px !important;
        background: transparent !important;
        color: var(--fx-text, #f5f7fb) !important;
        box-shadow: none !important;
        font-size: 1.05rem !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .bid-form .button {
        width: auto !important;
        min-width: 112px !important;
        min-height: 50px !important;
        margin: 0 !important;
        padding: 10px 18px !important;
        border-radius: 999px !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .proxy-bid-note,
    .app-route-detail .fx-ebay-purchase-panel .bid-form > .build-note {
        display: block !important;
        margin: 9px 0 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: var(--fx-muted, #9eabba) !important;
        text-align: left !important;
        font-size: .8rem !important;
        line-height: 1.45 !important;
    }

    /* Ended/sold state is informational text, not another shaded card. */
    .app-route-detail .fx-ebay-purchase-panel > .warning-box,
    .app-route-detail .fx-ebay-purchase-panel > .build-note {
        margin: 0 !important;
        padding: 18px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--fx-line, rgba(127,145,170,.28)) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .app-route-detail .fx-ebay-purchase-panel > .warning-box p {
        margin: 5px 0 0 !important;
    }

    /* Postage / condition rows use generous interior spacing but no surrounding box. */
    .app-route-detail .fx-ebay-fulfilment .fx-ebay-delivery-disclosure > summary,
    .app-route-detail .fx-ebay-fulfilment .fx-ebay-condition-link {
        padding-left: 0 !important;
        padding-right: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Lower disclosure area: remove the old coloured panels and keep row separators. */
    .app-route-detail .fx-ebay-detail-shell.shell {
        margin-top: 14px !important;
        padding-bottom: 32px !important;
    }

    .app-route-detail .fx-ebay-detail-section > summary {
        min-height: 72px !important;
        padding: 20px 0 !important;
    }

    .app-route-detail .fx-ebay-detail-panel {
        padding: 0 0 24px !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-detail-card,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .content-card,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .disclosure-panel,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .fault-card {
        width: 100% !important;
        margin: 0 !important;
        padding: 14px 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--fx-text, #f5f7fb) !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-detail-card + .app-detail-card,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .disclosure-panel + .app-detail-card,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-detail-card + .disclosure-panel {
        border-top: 1px solid var(--fx-line, rgba(127,145,170,.28)) !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] h2,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] h3 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .status-list {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .status-list > div {
        margin: 0 !important;
        padding: 13px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--fx-line, rgba(127,145,170,.28)) !important;
        background: transparent !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .status-list > div:last-child {
        border-bottom: 0 !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .warning-box {
        margin: 0 !important;
        padding: 18px 0 !important;
        border: 0 !important;
        border-top: 1px solid var(--fx-line, rgba(127,145,170,.28)) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-fault-disclosure {
        margin-top: 4px !important;
        padding-top: 20px !important;
        border-top: 1px solid var(--fx-line, rgba(127,145,170,.28)) !important;
        background: transparent !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-fault-disclosure .app-detail-label {
        margin: 0 0 10px !important;
        padding: 0 !important;
        color: #ff6878 !important;
        background: transparent !important;
        font-size: .76rem !important;
        font-weight: 800 !important;
        letter-spacing: .08em !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-fault-disclosure .prose,
    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .app-fault-disclosure p {
        color: var(--fx-muted, #9eabba) !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .tag-list {
        gap: 7px !important;
        margin: 11px 0 !important;
    }

    .app-route-detail .fx-ebay-detail-section[data-fx-section="about"] .tag-list span {
        padding: 7px 10px !important;
        border: 1px solid var(--fx-line-strong, #475364) !important;
        border-radius: 8px !important;
        background: transparent !important;
        color: var(--fx-text, #f5f7fb) !important;
        box-shadow: none !important;
    }

    .app-route-detail .fx-owner-manage-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 6px 0 12px;
        padding: 11px 0;
        color: var(--fx-blue, #62a2ff);
        border-top: 1px solid var(--fx-line, rgba(127,145,170,.28));
        border-bottom: 1px solid var(--fx-line, rgba(127,145,170,.28));
        text-decoration: none !important;
        font-weight: 700;
    }

    .app-route-detail .fx-owner-manage-link span:last-child {
        color: var(--fx-text, #f5f7fb);
        font-size: 1.55rem;
        font-weight: 300;
    }
}

@media (max-width: 390px) {
    .app-route-detail .app-product-layout.shell,
    .app-route-detail .fx-ebay-detail-shell.shell,
    .app-route-detail .app-similar-feed.shell,
    .app-route-detail .app-related-guides.shell {
        margin-left: 16px !important;
        margin-right: 16px !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .bid-form > div {
        grid-template-columns: minmax(0, 1fr) 104px !important;
    }

    .app-route-detail .fx-ebay-purchase-panel .bid-form .button {
        min-width: 104px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}


/* Auction eligibility: do not expose bid controls before the buyer qualifies. */
.app-route-detail .fx-ebay-purchase-panel .bid-eligibility-lock {
    margin: 14px 0 !important;
    padding: 14px 16px !important;
    border: 1px solid var(--fx-line-strong, #566171) !important;
    border-radius: 12px !important;
    background: rgba(255, 184, 77, .07) !important;
    text-align: left !important;
}
.app-route-detail .fx-ebay-purchase-panel .bid-eligibility-lock strong,
.app-route-detail .fx-ebay-purchase-panel .bid-eligibility-lock p {
    display: block;
    margin: 0;
}
.app-route-detail .fx-ebay-purchase-panel .bid-eligibility-lock p {
    margin-top: 6px !important;
    color: var(--fx-muted, #9eabba) !important;
}
