.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.modal[hidden] {
    display: none;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    animation: fadeIn 0.2s ease;
}

.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 28px 24px;
    animation: slideUp 0.25s ease;
}

.modal__close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: var(--fg-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.modal__close:hover {
    background: var(--bg);
    color: var(--fg);
}

.modal__title {
    font-size: 20px;
    font-weight: 400;
    color: var(--fg);
    margin-bottom: 16px;
    padding-right: 32px;
    letter-spacing: 0.5px;
}

.modal__content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--fg-muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal__content p {
    margin: 0;
}

.modal__content strong {
    color: var(--fg);
    font-weight: 500;
}

.modal__content code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--fg);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .modal {
        padding: 12px;
        align-items: flex-start;
    }
    .modal__dialog {
        max-height: 90vh;
        padding: 24px 18px;
    }
    .modal__title {
        font-size: 18px;
    }
}
