.agreement-modal {
    position: fixed;
    inset: 0;
    background: var(--tds-alpha-black-55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.agreement-modal.is-open {
    display: flex;
}

.agreement-modal-content {
    width: min(860px, 100%);
    height: min(68vh, 760px);
    max-height: min(68vh, 760px);
    background: var(--tds-color-bg-surface);
    border-radius: 14px;
    box-shadow: 0 18px 56px var(--tds-alpha-black-30);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agreement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tds-color-border-main);
}

.agreement-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agreement-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--tds-color-border-main);
    background: transparent;
    color: var(--tds-color-text-muted);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.agreement-modal-close:hover {
    border-color: var(--tds-color-brand);
    color: var(--tds-color-brand);
    background: var(--tds-alpha-brand-08);
}

.agreement-modal-close svg {
    width: 16px;
    height: 16px;
}

.agreement-modal-body {
    flex: 1;
    min-height: 0;
}

.agreement-modal-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 18px 20px 28px;
}

.agreement-content {
    max-width: 760px;
    margin: 0 auto;
    color: var(--tds-color-text-main);
    font-size: 14px;
}

.agreement-content h1 {
    margin: 0 0 14px;
    font-size: 1.35rem;
}

.agreement-content h2 {
    margin: 20px 0 10px;
    font-size: 1.06rem;
}

.agreement-content p,
.agreement-content li {
    line-height: 1.72;
}

.agreement-content ul,
.agreement-content ol {
    margin: 0 0 12px;
    padding-left: 1.25rem;
}

.agreement-loading {
    color: var(--tds-color-text-muted);
}

.agreement-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agreement-skeleton span {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: var(--tds-color-bg-subtle);
}

.agreement-skeleton span:nth-child(1) { width: 68%; }
.agreement-skeleton span:nth-child(2) { width: 92%; }
.agreement-skeleton span:nth-child(3) { width: 86%; }
.agreement-skeleton span:nth-child(4) { width: 94%; }
.agreement-skeleton span:nth-child(5) { width: 88%; }
.agreement-skeleton span:nth-child(6) { width: 80%; }

@media (max-width: 767px) {
    .agreement-modal {
        padding: 0;
        align-items: initial;
        justify-content: initial;
    }

    .agreement-modal-content {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        width: 100%;
        height: 56vh;
        max-height: 56vh;
        border-radius: 12px 12px 0 0;
    }

    .agreement-modal-header {
        padding: 12px 14px;
    }

    .agreement-modal-scroll {
        padding: 16px 16px 24px;
    }
}

@media (max-width: 1024px) {
    .agreement-modal-content {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
    }
}
