* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
}

.container { max-width: 1400px; margin: 0 auto; }

header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

header h1 { font-size: 1.8em; margin-bottom: 4px; }
header p { font-size: 0.9em; opacity: 0.85; }

.refresh-btn {
    margin-top: 10px;
    padding: 6px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85em;
    transition: transform 0.2s;
}
.refresh-btn:hover { transform: scale(1.05); }

.category-group { margin-bottom: 20px; }

.category-title {
    color: white;
    font-size: 1.1em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.apps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.apps-grid:has(> .app-card:only-child) {
    grid-template-columns: 1fr;
}

.app-card {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.app-icon { font-size: 1.4em; margin-right: 8px; }

.app-info h2 { font-size: 1em; color: #333; }
.app-category { font-size: 0.75em; color: #aaa; }

.app-links {
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.download-link {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f4ff;
    color: #667eea;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8em;
    word-break: break-word;
    overflow-wrap: anywhere;
    transition: background 0.2s;
}
.download-link:hover { background: #dde4ff; }

.app-updated { color: #ccc; font-size: 0.7em; margin-top: 6px; }

.loading, .error {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
}
.error { background: #ffebee; color: #c62828; }

.links-hidden {
    flex-direction: column;
    gap: 4px;
}

.toggle-btn {
    margin-left: auto;
    padding: 3px 10px;
    background: #f0f4ff;
    color: #667eea;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}
.toggle-btn:hover { background: #dde4ff; }