:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f0f0f0;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    -webkit-user-select: none;
    user-select: none;
}

input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background: #e8ecf1;
    color: var(--tg-theme-text-color);
    min-height: 100vh;
}

/* Desktop: decorative background behind the app shell */
@media (min-width: 700px) {
    body {
        background:
            linear-gradient(135deg, rgba(36,129,204,0.06) 0%, transparent 50%),
            linear-gradient(225deg, rgba(118,75,162,0.06) 0%, transparent 50%),
            #e8ecf1;
    }
}

/* App shell — mobile-like container */
.app-shell {
    max-width: 640px;
    margin: 0 auto;
    padding: 15px;
    padding-bottom: 60px;
    min-height: 100vh;
    background: inherit;
}

@media (min-width: 700px) {
    .app-shell {
        margin-top: 0;
        border-left: 1px solid rgba(0,0,0,0.06);
        border-right: 1px solid rgba(0,0,0,0.06);
        box-shadow: 0 0 40px rgba(0,0,0,0.08);
    }

    /* Fixed bottom-панели: центрируем и ограничиваем шириной */
    .action-sheet,
    .pr-action-sheet {
        max-width: 640px;
        left: 50% !important;
        right: auto !important;
    }

    /* action-sheet (akt) — центрируем через translateX(-50%) */
    .action-sheet {
        transform: translateX(-50%);
    }
    .action-sheet.show {
        transform: translateX(-50%);
    }

    /* pr-action-sheet (photo_reports) — прячется через translateY(100%) */
    .pr-action-sheet {
        transform: translateX(-50%) translateY(100%);
    }
    .pr-action-sheet.show {
        transform: translateX(-50%) translateY(0) !important;
    }

    /* Футеры — НЕ fixed, центрируются через margin */
    .app-footer,
    .fill-footer {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
}

/* Красивый хедер и кнопка Назад */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    /* Уменьшил отступ чтобы поднять всё выше */
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2481cc, #35a2e6);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(36, 129, 204, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.back-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(36, 129, 204, 0.4);
}

.back-button:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 2px 8px rgba(36, 129, 204, 0.25);
}

.back-icon {
    font-size: 18px;
    line-height: 1;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    margin-left: 15px;
    color: var(--tg-theme-text-color);
    letter-spacing: -0.5px;
}

/* Красивые кнопки (общие) */
.btn-premium {
    background: linear-gradient(135deg, var(--tg-theme-button-color), #3598db);
    color: var(--tg-theme-button-text-color);
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-premium:active {
    transform: scale(0.98);
}

.version {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    text-align: center;
    margin-top: 40px;
    opacity: 0.6;
    font-weight: 500;
}

/* Toast Уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 2.7s forwards;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.toast.success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.toast.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.toast.info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

@keyframes toast-in {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Скелетон загрузка */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    width: 100%;
    margin-bottom: 5px;
}

.skeleton-row {
    height: 40px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 8px;
}

/* --- Global Footer --- */
.app-footer {
    text-align: center;
    padding: 30px 20px 40px;
    margin-top: 20px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.app-footer:hover {
    opacity: 1;
}

.footer-version {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 4px;
    font-weight: 400;
}

.footer-copyright {
    font-size: 10px;
    color: var(--tg-theme-hint-color);
    font-family: sans-serif;
    letter-spacing: 0.5px;
}