* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--outside-bg-color); /* ИЗМЕНЕНИЕ: используем переменную */
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding: 0;
}

/* ОГРАНИЧЕНИЕ ШИРИНЫ 768px ДЛЯ ВСЕГО САЙТА */
.app-container {
    width: 100%;
    min-height: 100vh;
    max-width: 768px; /* Ограничиваем ширину */
    margin: 0 auto; /* Центрируем */
    background: var(--bg-primary); /* ФОН ВНУТРИ 768px (из темы) */
}

.container {
    width: 100%;
}

/* ХЕДЕР */
.content-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--header-height);
    flex-wrap: wrap;
    border-radius: 0; /* Убрано закругление */
    width: 100%;
}

.selected-transport-display {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.selected-transport-icon {
    width: 48px;
    height: 48px;
    border-radius: 0; /* Убрано закругление */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background: var(--accent-blue);
    flex-shrink: 0;
}

.selected-transport-info {
    flex: 1;
    min-width: 0;
}

.selected-transport-info h1,
.selected-transport-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-transport-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0; /* Убрано закругление */
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    text-decoration: none;
}

.back-button:hover {
    background: var(--bg-input);
    border-color: var(--accent-blue);
    transform: translateX(-2px);
}

.back-button i {
    font-size: 16px;
}

/* ПУСТОЕ СОСТОЯНИЕ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 0; /* Убрано закругление */
    color: var(--text-secondary);
    font-style: italic;
    border: 2px dashed var(--border-color);
    margin: 0 0 20px 0;
}

.empty-state h3 {
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

/* ИНФО КАРТОЧКА */
.info-card {
    background: var(--bg-card);
    border-radius: 0; /* Убрано закругление */
    padding: 16px;
    margin: 0 0 20px 0;
    border-left: 4px solid var(--accent-blue);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.info-item i {
    color: var(--accent-blue);
    width: 16px;
}

/* УВЕДОМЛЕНИЯ */
.notification-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0; /* Убрано закругление */
    padding: 16px;
    width: 100%;
}

.notification-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    
    .content-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .days-panel {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .content-header {
        padding: 10px 12px;
    }
    
    .selected-transport-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .selected-transport-info h1,
    .selected-transport-info h2 {
        font-size: 1.1rem;
    }
}

/* PWA индикаторы */
.pwa-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

.pwa-indicator:hover {
    background: rgba(0, 122, 255, 0.2);
    transform: scale(1.1);
}

.offline-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    margin-right: 10px;
}

/* Загрузчик PWA */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.pwa-loading .loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.pwa-loading .loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Уведомление PWA */
.pwa-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    z-index: 10000;
    display: none;
    animation: slideUp 0.3s ease;
}

.pwa-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pwa-notification-content i {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

.pwa-notification-text {
    flex: 1;
    min-width: 0;
}

.pwa-notification-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pwa-notification-text span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pwa-notification-btn {
    padding: 8px 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.pwa-notification-btn:hover {
    background: var(--accent-blue-dark);
}

.pwa-notification-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

/* Стили для оффлайн режима */
[data-theme="dark"] .pwa-notification {
    background: #2d2d3e;
    border-color: #3d3d4e;
}

/* Адаптивность */
@media (max-width: 768px) {
    .pwa-notification {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 12px;
    }
    
    .pwa-notification-content {
        gap: 10px;
    }
    
    .pwa-notification-content i {
        font-size: 1.2rem;
    }
    
    .pwa-notification-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* Стили для оффлайн уведомлений */
.offline-data-message {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Индикатор оффлайн режима */
.offline-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    margin-right: 10px;
    cursor: help;
}

/* Оффлайн страница */
.offline-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
}

.offline-page h1 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.offline-page p {
    margin-bottom: 30px;
    color: var(--text-secondary);
    max-width: 500px;
}

/* Для темной темы */
[data-theme="dark"] .offline-indicator {
    background: rgba(255, 59, 48, 0.2);
}