.card-apps-card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.card-apps-content {
    position: relative;
}

.card-apps-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    transition: background 0.2s;
}

.card-apps-close-btn:hover {
    background: #cbd5e0;
}

.card-apps-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 12px;
}

.card-apps-intro-text {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.card-apps-hint {
    font-style: italic;
}

.card-apps-hint code {
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.card-apps-commands {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
}

.card-apps-command {
    flex: 0 0 150px; /* Fixed width for each item */
    display: flex;
    align-items: center;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-apps-command:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-apps-command.card-apps-clicked {
    background: #e6fffa;
}

.card-apps-command-text {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #2b6cb0;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
}
/* Mobile media query */
@media (max-width: 767px) and (pointer: coarse) and (hover: none) {
    html {
        font-size: 16px; /* Base font size */
    }

    .card-apps-card {
        margin: 0.5rem auto; /* ~8px top/bottom, centered */
        padding: 0.5rem; /* ~8px, reduced from 15px */
        width: 95%; /* Maximize mobile viewport */
        max-width: none; /* Remove desktop constraint */
    }

    .card-apps-content h2 {
        font-size: 1.25rem; /* ~20px, reduced from 3.3rem */
    }

    .card-apps-intro-text {
        font-size: 0.875rem; /* ~14px, reduced from 2.2rem */
    }

    .card-apps-command-text,
    .card-apps-command-help {
        font-size: 0.875rem; /* ~14px, reduced from 2rem */
    }

    .card-apps-command {
        flex: 0 0 auto; /* Responsive, remove fixed 250px */
        min-height: auto; /* Flexible height, remove 200px */
        padding: 0.625rem; /* ~10px, for ~44px tap target */
        flex-direction: column; /* Stack for mobile */
        align-items: flex-start;
    }

    .card-apps-command-text {
        padding-left: 0;
        margin-bottom: 0.25rem; /* ~4px, separate from help text */
    }

    .card-apps-close-btn {
        width: 2rem; /* ~32px */
        height: 2rem;
        padding: 0.5rem; /* ~8px, for ~48px tap target */
        font-size: 1rem; /* ~16px */
    }

    .card-apps-command:hover,
    .card-apps-close-btn:hover {
        transform: none; /* Disable hover effects */
        box-shadow: none;
        background: #e2e8f0; /* Reset for close button */
    }

    .card-apps-commands {
        gap: 0.625rem; /* ~10px, increased for spacing */
    }
}