.input-actions.is-visible .uiverse-button {
    animation: presetButtonMorph 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes presetButtonMorph {
    0% {
        transform: translateX(-16px) scaleX(0.58) scaleY(0.76);
    }
    55% {
        transform: translateX(3px) scaleX(1.08) scaleY(0.94);
    }
    78% {
        transform: translateX(-1px) scaleX(0.98) scaleY(1.03);
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

.animate-pop {
    animation: neoPop 0.25s cubic-bezier(0.2, 0, 0, 1) forwards;
}

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

@media (max-width: 680px) {
    .app-body {
        padding:
            max(18px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(32px, env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .app-header {
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }

    .title-lockup {
        gap: 12px;
    }

    .header-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .header-icon svg {
        width: 26px;
        height: 26px;
    }

    .app-title {
        font-size: clamp(24px, 8vw, 30px);
        line-height: 1.05;
    }

    .app-shell,
    .result-card {
        gap: 16px;
    }

    .input-panel {
        padding: 16px;
    }

    .uiverse-input {
        height: 52px;
        padding-left: 13px;
        font-size: 19px;
    }

    .input-actions,
    .input-actions.is-visible {
        width: 100%;
        max-height: 0;
        margin: 0;
        transform: translateY(-12px) scaleX(0.92) scaleY(0.7);
    }

    .input-actions.is-visible {
        max-height: 54px;
        margin-top: 14px;
        transform: translateY(0) scale(1);
    }

    .uiverse-button,
    .device-image-frame {
        width: 100%;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .result-panel {
        padding: 14px;
    }

    .copy-button {
        width: 44px;
        height: 44px;
    }

    .device-image-frame {
        height: 132px;
    }

    .password-value {
        font-size: clamp(34px, 12vw, 42px);
    }

    .direction-grid {
        gap: 6px;
    }

    .direction-badge {
        padding-inline: 2px;
    }

    .toast {
        bottom: max(18px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 28px);
    }
}

@media (max-width: 360px) {
    .app-body {
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .uiverse-panel {
        border-width: 1.5px;
    }

    .direction-grid {
        gap: 4px;
    }

    .direction-index {
        font-size: 8px;
    }

    .direction-symbol {
        font-size: 16px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .app-body {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .app-header {
        margin-bottom: 14px;
    }

    .device-image-frame {
        height: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
