/* Stage A: condition value only. Native Phoenix modal appearance is unchanged. */
#chars .cart-char-table td.right .cs-condition-value {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1a8fe9;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    vertical-align: baseline;
    text-decoration: none;
    cursor: pointer;
}
#chars .cs-condition-value svg {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: #9c9c9c;
}
#chars .cs-condition-value:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 3px;
}
@media (max-width: 767px) {
    #chars .cs-condition-value svg {
        flex-basis: 18px;
        width: 18px;
        height: 18px;
    }
    #chars .cs-condition-value::before {
        content: '';
        position: absolute;
        inset: 50% 0 auto;
        height: max(100%, 44px);
        transform: translateY(-50%);
    }
}

/* Stage B: desktop only; the Stage A value/icon rules above remain unchanged. */
@media (min-width: 768px) {
    div.phoenix-modal.window-modal.cs-condition-modal {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        box-sizing: border-box;
        overflow: hidden;
        font-family: Inter, sans-serif;
    }
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog {
        position: relative;
        width: 100%;
        max-width: 520px;
        margin: 0;
        padding: 0;
        top: auto;
        left: auto;
        transform: none;
    }
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog div.dialog-content {
        position: relative;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        width: 100%;
        min-height: 0;
        max-height: calc(100vh - 48px);
        max-height: calc(100dvh - 48px);
        padding: 24px;
        border-radius: 20px;
        background: #fff;
        color: #2b3945;
        text-align: left;
        overflow: hidden;
    }
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog .content-in {
        min-height: 0;
        margin: 0;
        padding: 32px 0 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        overflow-wrap: anywhere;
        font-family: Inter, sans-serif;
        font-size: 15px;
        line-height: 1.5;
    }
    div.phoenix-modal.window-modal.cs-condition-modal .content-in :is(p, ul, ol, li) {
        font-family: inherit;
        font-size: 15px;
        line-height: 1.5;
    }
    div.phoenix-modal.window-modal.cs-condition-modal .content-in :is(h1, h2, h3, h4, h5, h6) {
        margin: 0 0 12px;
        font-family: inherit;
        font-size: 20px;
        font-weight: 600;
        line-height: 1.5;
    }
    .cs-condition-modal .content-in p { margin: 0 0 12px; }
    .cs-condition-modal .content-in :is(ul, ol) { margin: 0 0 16px; padding-left: 22px; }
    .cs-condition-modal .content-in li { margin: 0 0 6px; }
    .cs-condition-modal .content-in > :last-child { margin-bottom: 0; }
    .cs-condition-modal .content-in img { max-width: 100%; height: auto; }
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal {
        position: absolute;
        display: block;
        box-sizing: border-box;
        top: 8px;
        right: 8px;
        left: auto;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='m5 5 12 12M17 5 5 17' fill='none' stroke='%232b3945' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
        opacity: 1;
        cursor: pointer;
        z-index: 2;
    }
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal:hover { background-color: #f1f3f5; }
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal::before,
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal::after { display: none; }
}

/* Stage B continuation: links and the native close action, only for condition windows. */
/* Match main.css: a > span.bord-bot, * > span.bord-bot and its hover rule. */
#chars .cs-condition-value > span {
    color: #1a8fe9;
    text-decoration: none;
    border-bottom: 1px solid #dedede;
    transition: border-bottom-color .7s;
}
#chars .cs-condition-value:hover > span {
    border-bottom-color: #1a8fe9;
}
div.phoenix-modal.window-modal.cs-condition-modal button.cs-condition-understand {
    display: block;
    position: static;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 100%;
    height: 44px;
    margin: 24px 0 0;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: #293744;
    color: #fff;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, transform .18s ease;
}
div.phoenix-modal.window-modal.cs-condition-modal button.cs-condition-understand:hover {
    background: #354756;
}
div.phoenix-modal.window-modal.cs-condition-modal button.cs-condition-understand:active {
    background: #202c37;
    transform: translateY(1px);
}
div.phoenix-modal.window-modal.cs-condition-modal button.cs-condition-understand:focus-visible {
    outline: 2px solid #4285F4;
    outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
    div.phoenix-modal.window-modal.cs-condition-modal button.cs-condition-understand { transition: none; }
}

/* Mobile condition windows: centered, with a presentation-only entry animation. */
@media (max-width: 767px) {
    .modalAreaWindow.cs-condition-sheet-area {
        position: fixed;
        inset: 0;
        z-index: 11000;
        height: 100vh;
        height: 100dvh;
        background: rgba(0, 0, 0, .4);
        animation: cs-condition-mobile-backdrop 200ms ease-out;
    }
    .modalAreaWindow.cs-condition-sheet-area > .shadow-modal { display: none; }
    div.phoenix-modal.window-modal.cs-condition-modal {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        visibility: visible;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding: 12px;
        margin: 0;
        overflow: hidden;
        opacity: 1;
        transition: none;
        background: transparent;
        color: #2b3945;
        font-family: Inter, sans-serif;
    }
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog {
        position: relative;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        top: auto;
        left: auto;
        transform: none;
        transition: none;
        animation: cs-condition-mobile-enter 200ms cubic-bezier(.22, .61, .36, 1);
    }
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog div.dialog-content {
        position: relative;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        width: 100%;
        min-height: 0;
        max-height: 85vh;
        max-height: 85dvh;
        padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
        border-radius: 20px;
        background: #fff;
        overflow: hidden;
    }
    div.phoenix-modal.window-modal.cs-condition-modal div.dialog-content::before { content: none; display: none; }
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog .content-in {
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        overflow-wrap: anywhere;
        font-family: Inter, sans-serif;
        font-size: 15px;
        line-height: 1.5;
    }
    /* Reserve the cross's horizontal space without an empty row above the title. */
    div.phoenix-modal.window-modal.cs-condition-modal .content-in > :first-child {
        box-sizing: border-box;
        min-height: 32px;
        padding-right: 48px;
    }
    div.phoenix-modal.window-modal.cs-condition-modal .content-in :is(p, ul, ol, li) { font: inherit; }
    div.phoenix-modal.window-modal.cs-condition-modal .content-in :is(h1, h2, h3, h4, h5, h6) {
        margin: 0 0 12px;
        font-family: Inter, sans-serif;
        font-size: 20px;
        font-weight: 600;
        line-height: 1.5;
    }
    .cs-condition-modal .content-in p { margin: 0 0 12px; }
    .cs-condition-modal .content-in :is(ul, ol) { margin: 0 0 16px; padding-left: 22px; }
    .cs-condition-modal .content-in li { margin: 0 0 6px; }
    .cs-condition-modal .content-in > :last-child { margin-bottom: 0; }
    .cs-condition-modal .content-in img { max-width: 100%; height: auto; }
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal {
        position: absolute;
        top: 12px;
        right: 12px;
        transform: none;
        left: auto;
        display: block;
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='m5 5 12 12M17 5 5 17' fill='none' stroke='%232b3945' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
        opacity: 1;
        z-index: 2;
        cursor: pointer;
    }
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal::before,
    div.phoenix-modal.window-modal.cs-condition-modal a.close-modal::after { display: none; }
    div.phoenix-modal.window-modal.cs-condition-modal button.cs-condition-understand { height: 48px; flex-shrink: 0; }
    @keyframes cs-condition-mobile-enter {
        from { opacity: 0; transform: scale(.97); }
        to { opacity: 1; transform: scale(1); }
    }
    @keyframes cs-condition-mobile-backdrop {
        from { background-color: rgba(0, 0, 0, 0); }
        to { background-color: rgba(0, 0, 0, .4); }
    }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .modalAreaWindow.cs-condition-sheet-area,
    div.phoenix-modal.window-modal.cs-condition-modal div.phoenix-modal-dialog { transition: none; animation: none; }
}
