.modal {
    display: none;
    position: fixed;
    z-index: 99999999999;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    align-items: center;
}

.modal.darken {
    background-color: rgba(0, 0, 0, 0.4);
}

.modal.open {
    display: flex;
}

.modal-content {
    position: relative;
    width: 994px;
    min-height: 445px;
    height: auto;
    padding: 32px 64px;
    background-color: #ffffff;
    border-radius: 10px;
    overflow-y: auto;
    opacity: 1;
    transform: rotate(0deg);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 40px;
    cursor: grab;
    box-sizing: border-box;
}

.modal-content :is(input, textarea, select) {
    cursor: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    color: var(--app-color-3);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close:hover {
    color: #00444d;
}

body.mobile .modal-content {
    width: 95%;
    padding: 1.5rem;
}

/* Modal pequeno de nombre de archivo para la descarga PNG */
#export-png-modal .modal-content {
    width: 24rem;
    min-height: unset;
    padding: 0;
    gap: 0;
    cursor: default;
}

#export-png-modal .export-png-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background-color: var(--app-color-3);
    color: var(--app-color-1);
    padding: 0.75rem 1rem;
    border-radius: 10px 10px 0 0;
}

#export-png-modal .export-png-header svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

#export-png-modal .export-png-header > div {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    transform: translateY(1px);
}

/* Misma X que las ventanas (.window-header > span.action) */
#export-png-modal .export-png-header > span.action {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#export-png-modal .export-png-header > span.action svg {
    width: 1.125rem;
    height: 1.125rem;
}

#export-png-modal .export-png-header > span.action:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* La X la aporta el propio header (span.action.close) */
#export-png-modal button.modal-close {
    display: none;
}

#export-png-modal #export-png-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 1.5rem;
}

#export-png-modal #export-png-name {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--app-color-4);
    border-radius: 0.3rem;
    font-family: inherit;
    font-size: 0.875rem;
}

#export-png-modal .export-png-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#export-png-modal .export-png-actions button {
    border: unset;
    border-radius: 0.3rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
}

#export-png-modal #export-png-accept {
    background-color: var(--app-color-2);
    color: var(--app-color-1);
}

#export-png-modal #export-png-accept:hover {
    filter: brightness(0.8);
}

#export-png-modal #export-png-cancel {
    background-color: var(--app-color-5);
    color: var(--app-color-4);
}

#export-png-modal #export-png-cancel:hover {
    filter: brightness(0.95);
}
