/* Coupon page mobile layout. Mirrors the approved desktop Federation coupon page. */
@media (max-width: 767px) {
    html:has(.w_coupon) body.gundam-skin #ajax-content.contents { padding-inline: 0 !important; }

    html:has(.w_coupon) body.gundam-skin #ajax-content.contents > .page.w_coupon {
        --coupon-mobile-navy: #082d57;
        --coupon-mobile-cyan: #22b9df;
        --coupon-mobile-line: #9db1c2;
        gap: 0 !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: -12px 0 0 !important;
        padding: 0 0 24px !important;
        background:
            linear-gradient(90deg, rgb(91 119 143 / 10%) 1px, transparent 1px) 0 0 / 48px 100%,
            #edf2f6 !important;
        color: #173653 !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 12px 10px !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 14px !important;
        border: 1px solid var(--coupon-mobile-line) !important;
        border-radius: 0 !important;
        background: linear-gradient(180deg, #fff, #eef3f6) !important;
        box-shadow: inset 0 0 0 4px #e5ebf0, 0 5px 12px rgb(20 48 73 / 9%) !important;
        color: #173653 !important;
        clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px) !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-toolbar > * { transform: none !important; }

    html:has(.w_coupon) body.gundam-skin .w_coupon .cpmenu {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
        width: 100% !important;
        height: 46px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #91a8bb !important;
        border-radius: 1px !important;
        background: #f7f9fa !important;
        box-shadow: none !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .cpmenu a {
        display: flex !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 8px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #526b83 !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        align-items: center !important;
        justify-content: center !important;
        flex-basis: auto !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .cpmenu a.on {
        background: linear-gradient(180deg, #245f90, #0b3159) !important;
        box-shadow: inset 0 -3px #20bae1, inset 0 1px rgb(255 255 255 / 20%) !important;
        color: #fff !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary {
        display: flex !important;
        min-width: 0 !important;
        color: #5c7185 !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        text-align: left !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary__available,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary__used,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary__expired,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary__divider { display: none !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary__total { display: inline !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-summary strong {
        color: #0a315b !important;
        font-size: 17px !important;
        font-weight: 900 !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-delete-action {
        display: inline-flex !important;
        min-width: 0 !important;
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 10px !important;
        border: 1px solid #9d1821 !important;
        border-radius: 0 !important;
        background: linear-gradient(180deg, #df2730, #b30d17) !important;
        box-shadow: inset 0 1px rgb(255 255 255 / 28%), 0 2px 4px rgb(65 10 13 / 18%) !important;
        color: #fff !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-shell,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-card {
        display: flex !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 16px 12px 18px !important;
        overflow: hidden !important;
        border: 1px solid var(--coupon-mobile-line) !important;
        border-radius: 0 !important;
        background:
            linear-gradient(135deg, transparent 0 96%, #dbe4eb 96% 97%, transparent 97%),
            #f8fafb !important;
        box-shadow: inset 0 0 0 4px #e5ebf0, 0 5px 12px rgb(20 48 73 / 9%) !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px) !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-card.u-hidden { display: none !important; }

    html:has(.w_coupon) body.gundam-skin .w_coupon .couponwrap {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        gap: 10px !important;
        flex-direction: column !important;
        transform: none !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket:nth-child(4) {
        position: relative !important;
        isolation: isolate !important;
        overflow: hidden !important;
        display: grid !important;
        grid-column: auto !important;
        grid-template-columns: minmax(0, 1fr) clamp(72px, 25%, 88px) !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: 319 / 223 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent url('/skin/gundam_main/images/coupon/gundam-ticket-v3.png?v=1') center / 100% 100% no-repeat !important;
        box-shadow: none !important;
        color: #173451 !important;
        clip-path: none !important;
        transform: none !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket::before,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket::after { display: none !important; content: none !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__serial { display: none !important; }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__body {
        position: relative !important;
        z-index: 1 !important;
        display: flex !important;
        min-width: 0 !important;
        padding: clamp(20px, 7vw, 28px) 8px clamp(17px, 5vw, 22px) clamp(24px, 8vw, 34px) !important;
        flex-direction: column !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__code {
        order: 1 !important;
        overflow: hidden !important;
        margin: 0 0 10px !important;
        color: #2c6d9d !important;
        font: 800 10px/1.2 Arial, sans-serif !important;
        letter-spacing: 0 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__code::before { display: none !important; content: none !important; }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__title {
        order: 2 !important;
        display: -webkit-box !important;
        overflow: hidden !important;
        margin: 0 !important;
        color: #0c315a !important;
        font-size: clamp(14px, 4vw, 16px) !important;
        font-weight: 900 !important;
        line-height: 1.32 !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__meta {
        order: 3 !important;
        display: grid !important;
        gap: 4px !important;
        margin-top: auto !important;
        color: #60788d !important;
        font-size: 9px !important;
        line-height: 1.35 !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__meta > span::before {
        margin-right: 5px !important;
        color: #17a9d2 !important;
        content: "■" !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__time::before {
        margin-right: 5px !important;
        color: #17a9d2 !important;
        content: "◷" !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__time p { display: inline !important; margin: 0 !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__time:empty { display: none !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__time:empty::before { content: none !important; }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__benefit {
        order: 4 !important;
        display: flex !important;
        margin-top: 9px !important;
        color: #678198 !important;
        align-items: baseline !important;
        gap: 4px !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__benefit-label {
        padding: 1px 3px !important;
        border: 1px solid #55a6cf !important;
        color: #1677a6 !important;
        font-size: 9px !important;
        line-height: 1.15 !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__benefit-value {
        color: #6b8296 !important;
        font-size: 15px !important;
        font-weight: 500 !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__benefit-unit { font-size: 10px !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__condition {
        order: 5 !important;
        margin-top: 3px !important;
        color: #7b8e9f !important;
        font-size: 8px !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__action {
        position: relative !important;
        z-index: 1 !important;
        display: grid !important;
        padding: 0 !important;
        border: 0 !important;
        background: rgb(233 240 244 / 24%) !important;
        place-items: center !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-status,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket.is-available .coupon-status {
        display: flex !important;
        width: clamp(48px, 15vw, 56px) !important;
        min-width: 0 !important;
        height: clamp(48px, 15vw, 56px) !important;
        min-height: 0 !important;
        padding: 0 !important;
        border: 2px solid #169b91 !important;
        border-radius: 50% !important;
        background: rgb(255 255 255 / 82%) !important;
        box-shadow: inset 0 0 0 3px #e3efed, 0 0 0 1px rgb(21 123 116 / 20%) !important;
        color: #13877f !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1.1 !important;
        text-shadow: none !important;
        transform: rotate(-8deg) !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: normal !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-status--used {
        border-color: #297cb5 !important;
        box-shadow: inset 0 0 0 3px #e2edf4 !important;
        color: #276ea0 !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-status--expired {
        border-color: #cf555d !important;
        box-shadow: inset 0 0 0 3px #f4e5e6 !important;
        color: #bd3942 !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-empty-state {
        width: 100% !important;
        min-height: 180px !important;
        padding: 32px 18px !important;
        border: 1px dashed #9db1c2 !important;
        border-radius: 0 !important;
        background: #f8fafc !important;
        color: #718699 !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-empty-state__title { color: #123a5d !important; font-size: 16px !important; }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-list {
        display: grid !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 7px !important;
    }

    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto !important;
        gap: 4px 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 82px !important;
        padding: 8px !important;
        overflow: hidden !important;
        border: 1px solid #b4c4d1 !important;
        background: #fff !important;
        color: #29465f !important;
        clip-path: none !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row:nth-child(even) { background: #edf2f5 !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__serial {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;
        display: flex !important;
        height: 100% !important;
        border: 0 !important;
        border-right: 1px solid #c8d4de !important;
        background: transparent !important;
        color: #7890a4 !important;
        font: 800 18px/1 Arial, sans-serif !important;
        align-items: center !important;
        justify-content: center !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__code,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__content,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__amount,
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__date { padding: 0 !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__code {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: end !important;
        color: #17658f !important;
        font-size: 10px !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__code span { display: none !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__content {
        grid-column: 2 !important;
        grid-row: 2 !important;
        color: #29465f !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__amount {
        position: static !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        color: #17658f !important;
        font-size: 9px !important;
        white-space: nowrap !important;
    }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__amount-label { display: none !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__amount strong { color: #0d598a !important; font-size: 14px !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-history-row__date {
        grid-column: 3 !important;
        grid-row: 2 !important;
        display: flex !important;
        height: auto !important;
        border: 0 !important;
        color: #788c9e !important;
        font-size: 8px !important;
        align-items: flex-end !important;
        justify-content: center !important;
        flex-direction: column !important;
        text-align: right !important;
    }
}

/* Beat legacy ID-level dark coupon surfaces while preserving tab visibility. */
@media (max-width: 767px) {
    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > .coupon-toolbar {
        border: 1px solid var(--coupon-mobile-line) !important;
        background: linear-gradient(180deg, #fff, #eef3f6) !important;
        box-shadow: inset 0 0 0 4px #e5ebf0, 0 5px 12px rgb(20 48 73 / 9%) !important;
    }

    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > #couponbox_list.coupon-shell,
    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > #coupon_list.coupon-history-card {
        border: 1px solid var(--coupon-mobile-line) !important;
        background:
            linear-gradient(135deg, transparent 0 96%, #dbe4eb 96% 97%, transparent 97%),
            #f8fafb !important;
        box-shadow: inset 0 0 0 4px #e5ebf0, 0 5px 12px rgb(20 48 73 / 9%) !important;
    }

    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > #couponbox_list.coupon-shell.u-hidden,
    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > #coupon_list.coupon-history-card.u-hidden {
        display: none !important;
    }

    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > .coupon-toolbar .cpmenu a {
        border: 0 !important;
        background: #f7f9fa !important;
        box-shadow: none !important;
        color: #526b83 !important;
    }

    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > .coupon-toolbar .cpmenu a.on {
        background: linear-gradient(180deg, #245f90, #0b3159) !important;
        box-shadow: inset 0 -3px #20bae1, inset 0 1px rgb(255 255 255 / 20%) !important;
        color: #fff !important;
    }

    html:has(.w_coupon) body.gundam-skin.gundam-skin #ajax-content.contents > .page.w_coupon > .coupon-toolbar .coupon-delete-action {
        border: 1px solid #9d1821 !important;
        background: linear-gradient(180deg, #df2730, #b30d17) !important;
        box-shadow: inset 0 1px rgb(255 255 255 / 28%), 0 2px 4px rgb(65 10 13 / 18%) !important;
        color: #fff !important;
    }
}

@media (max-width: 340px) {
    html:has(.w_coupon) body.gundam-skin #ajax-content.contents > .page.w_coupon { margin-top: -10px !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-toolbar { padding-inline: 10px !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-shell { padding-inline: 8px !important; }
    html:has(.w_coupon) body.gundam-skin .w_coupon .coupon-ticket__body { padding-left: 23px !important; }
}
