.start-panel {
    position: fixed;
    bottom: 100px;
    left: calc(50% - 200px);
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: #1c1c1c;
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100000;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    font-family: sans-serif;
      z-index: 9999;

}

.start-panel-search {
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    outline: none;
    background: #2e2e2e;
    color: white;
}

.start-panel-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-panel-section h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #ccc;
    padding-left: 4px;
}

.start-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 12px;
}

.start-panel-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.start-panel-app:hover {
    background: rgba(255, 255, 255, 0.08);
}

.start-panel-app img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.start-panel-app div {
    font-size: 12px;
    color: #ddd;
    text-align: center;
}

.start-panel-app.focused {
  outline: 2px solid #00bcd4;
  border-radius: 4px;
}

@media (max-width: 767px) and (pointer: coarse) and (hover: none) {
    /* Set base font size for consistency (optional, only if not already set) */
    html {
        font-size: 16px; /* Adjust to 14px if you want smaller scaling */
    }

    .start-panel {
        padding: 0; /* ~16px, reduced for smaller screens */
        left: 0; /* No unit needed for 0, unchanged */
        width: 100%; /* Unchanged, full-width is good */
        height: calc(100% - 100px); /* ~96px offset, reduced from 220px */
        /* height: 'calc(var(--vh) * 100)'; */

    }

    .start-panel-section h3 {
        font-size: 1.5rem; /* ~24px, prominent but not 64px huge */
    }

    .start-panel-section {
    }

    .start-panel-app > img {
        width: 3rem; /* ~48px, smaller but clear for app icons */
        height: 3rem;
    }

    .start-panel-app div {
        font-size: 0.875rem; /* ~14px, readable for app labels */
    }

    .start-panel-grid {
        gap: 1.2rem; /* ~32px, reduced from 128px for tighter layout */
    }

    .start-panel-search {
        font-size: 1.25rem; /* ~20px, readable for search input */
        padding: 0.75rem 1rem; /* ~12px 16px, reduced for compactness */
        width: 100%;
    }
}

/* Discord or low-height media query */
@media (max-height: 480px) {
    .start-panel {
        bottom: 5px; /* Close to the bottom, just above potential horizontal taskbar */
        left: 4.5rem; /* Align with vertical taskbar width from previous update */
        transform: none; /* Remove centering transform */
        width: calc(100% - 4rem); /* Full width minus taskbar and padding */
        max-width: 360px; /* Cap for readability */
        height: 300px; /* Reduced height for shorter displays */
        border-radius: 8px; /* Slightly smaller radius */
        padding: 12px; /* Reduced padding */
        gap: 12px; /* Reduced gap */
    }

    .start-panel-search {
        font-size: 0.875rem; /* ~14px, slightly smaller */
        padding: 8px; /* Reduced padding */
    }

    .start-panel-section h3 {
        font-size: 1rem; /* ~16px, slightly smaller */
        margin-bottom: 8px;
    }

    .start-panel-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); /* Smaller tiles */
        gap: 8px; /* Reduced gap */
    }

    .start-panel-app {
        padding: 8px; /* Reduced padding */
        font-size: 0.75rem; /* ~12px */
    }

    .start-panel-app img {
        width: 32px; /* Smaller icons */
        height: 32px;
    }
}