/* APM Virtual Touchscreen Keyboard Styles */
body.apm-keyboard-active {
    padding-bottom: clamp(260px, 42vh, 400px) !important;
}

.apm-keyboard {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: #0f172a;
    padding: clamp(10px, 1.5vh, 18px) clamp(10px, 2vw, 24px);
    display: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
    border-top: 3px solid #3b82f6;
    touch-action: manipulation;
}

.apm-keyboard.apm-keyboard-open {
    display: block;
    animation: apmSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes apmSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.apm-keyboard-grid {
    max-width: 1050px;
    margin: 0 auto;
}

.apm-keyboard-numeric .apm-key-row {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.apm-key-row {
    display: flex;
    gap: clamp(6px, 1vw, 10px);
    justify-content: center;
    margin-bottom: clamp(6px, 1vh, 10px);
}

.apm-key {
    flex: 1 1 0;
    max-width: 100px;
    min-height: clamp(52px, 6.5vh, 70px);
    font-size: clamp(1.25rem, 1.7vw, 1.6rem);
    font-weight: 800;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.1s ease;
    touch-action: manipulation;
}

.apm-key:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

.apm-key:active {
    background: #cbd5e1;
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.apm-key-wide {
    max-width: 320px;
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 700;
}

.apm-key-warn {
    background: #f59e0b !important;
    color: #ffffff !important;
    max-width: 180px;
    font-weight: 800;
}

.apm-key-warn:hover {
    background: #d97706 !important;
}

.apm-key-close {
    background: #ef4444 !important;
    color: #ffffff !important;
    max-width: 180px;
    font-weight: 800;
}

.apm-key-close:hover {
    background: #dc2626 !important;
}
