:root {
    /* Цвета Telegram (адаптируются под тему, но мы зададим светлую базу) */
    --bg-color: #ebedf0; /* Светло-серый фон как в чатах */
    --card-bg: #ffffff;
    --text-primary: #000000;
    --text-secondary: #8e8e93;
    --accent: #2481cc; /* Telegram Blue */
    --separator: #e1e1e6;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Header */
.app-header {
    height: 56px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05); /* Легкая тень */
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: center; /* Заголовок по центру */
    align-items: center;
    position: relative;
}

h1 { 
    margin: 0; 
    font-size: 17px; 
    font-weight: 600; 
}

#back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 17px;
    cursor: pointer;
    font-weight: 400;
    position: absolute;
    left: 0; /* Кнопка слева */
    padding: 10px 0;
}

.hidden { display: none !important; }

/* Views */
main {
    margin-top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding-top: 10px;
}

.view { display: none; }
.view.active { display: block; animation: slideIn 0.2s ease-out; }

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Catalog Styles */
.category-section { 
    margin-bottom: 24px; 
}

.category-title {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    margin: 0 16px 8px 16px;
    font-weight: 500;
}

/* Список карточек как в настройках iOS/Telegram */
.app-list {
    background: var(--card-bg);
    border-top: 1px solid var(--separator);
    border-bottom: 1px solid var(--separator);
}

.app-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.1s;
    background: var(--card-bg);
}

.app-card:active { background: #f0f0f0; }

.app-card:not(:last-child) .app-inner {
    border-bottom: 1px solid var(--separator);
}

.app-icon { 
    font-size: 28px; 
    margin-right: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-color); /* Кружок под иконкой */
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-info { 
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-name { 
    font-size: 17px; 
    font-weight: 500; 
    margin-bottom: 2px;
}

.app-desc { 
    font-size: 13px; 
    color: var(--text-secondary); 
    line-height: 1.3;
}

/* Стрелочка справа */
.app-card::after {
    content: '›';
    color: #c7c7cc;
    font-size: 24px;
    font-weight: 300;
    margin-left: 10px;
}

/* Убираем кнопку "Открыть" (теперь вся карточка кликабельна) */
.app-btn { display: none; }

/* App Container */
#app-mount-point { width: 100%; height: 100%; }
