* {
                box-sizing: border-box;
            }
            body {
                margin: 0;
                padding: 0;
                font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
                background: radial-gradient(circle at top, #1d4ed8 0, #020617 55%);
                min-height: 100vh;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #0f172a;
            }
            .container {
                width: 100%;
                max-width: 900px;
                padding: 24px;
            }
            .card {
                background: rgba(15, 23, 42, 0.96);
                color: #e5e7eb;
                border-radius: 18px;
                box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
                padding: 24px 24px 20px;
                display: grid;
                grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
                gap: 24px;
            }
            @media (max-width: 800px) {
                .card {
                    grid-template-columns: 1fr;
                }
            }
            .title {
                font-size: 24px;
                font-weight: 650;
                letter-spacing: 0.02em;
                margin-bottom: 4px;
            }
            .subtitle {
                font-size: 14px;
                color: #9ca3af;
                margin-bottom: 18px;
            }
            .upload-area {
                border: 1px dashed rgba(148, 163, 184, 0.8);
                border-radius: 14px;
                padding: 18px 16px;
                text-align: center;
                background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 55%);
                position: relative;
                cursor: pointer;
                transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
            }
            .upload-area.dragover {
                border-color: #60a5fa;
                background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.3), rgba(15, 23, 42, 0.9));
                transform: translateY(-1px);
            }
            .upload-icon {
                font-size: 32px;
                margin-bottom: 8px;
            }
            .upload-title {
                font-size: 15px;
                font-weight: 500;
                margin-bottom: 4px;
            }
            .upload-hint {
                font-size: 12px;
                color: #9ca3af;
                margin-bottom: 10px;
            }
            .upload-button {
                display: inline-flex;
                align-items: center;
                gap: 6px;
                padding: 7px 14px;
                border-radius: 999px;
                border: none;
                background: linear-gradient(to right, #2563eb, #4f46e5);
                color: white;
                font-size: 13px;
                font-weight: 500;
                cursor: pointer;
                box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
            }
            .upload-button span {
                font-size: 16px;
            }
            #file-input {
                display: none;
            }
            .preview-wrapper {
                margin-top: 14px;
                display: flex;
                gap: 10px;
                align-items: center;
            }
            .preview-thumb {
                width: 56px;
                height: 56px;
                border-radius: 12px;
                overflow: hidden;
                background: #020617;
                border: 1px solid #111827;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 24px;
                color: #4b5563;
            }
            .preview-thumb img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
            .preview-info-main {
                font-size: 13px;
                font-weight: 500;
            }
            .preview-info-sub {
                font-size: 11px;
                color: #9ca3af;
            }
            .actions {
                margin-top: 16px;
                display: flex;
                align-items: center;
                gap: 10px;
            }
            .analyze-button {
                padding: 9px 18px;
                border-radius: 999px;
                border: none;
                background: linear-gradient(to right, #22c55e, #16a34a);
                color: white;
                font-size: 14px;
                font-weight: 600;
                cursor: pointer;
                display: inline-flex;
                align-items: center;
                gap: 8px;
                box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
            }
            .analyze-button[disabled] {
                opacity: 0.45;
                cursor: default;
                box-shadow: none;
            }
            .spinner {
                width: 16px;
                height: 16px;
                border-radius: 999px;
                border: 2px solid rgba(209, 250, 229, 0.3);
                border-top-color: #bbf7d0;
                animation: spin 0.6s linear infinite;
            }
            @keyframes spin {
                to { transform: rotate(360deg); }
            }
            .status-text {
                font-size: 12px;
                color: #9ca3af;
            }
            .status-text strong {
                color: #e5e7eb;
            }
            /* Правая колонка — результаты */
            .results {
                background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.25), rgba(15, 23, 42, 0.95));
                border-radius: 14px;
                padding: 14px 16px 12px;
                border: 1px solid rgba(30, 64, 175, 0.7);
                display: flex;
                flex-direction: column;
                gap: 10px;
            }

.result-image {
    margin: 6px 0 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(30, 64, 175, 0.8);
    background: #020617;
    max-height: 180px;
    display: none; /* по умолчанию скрыто, управляем из JS */
    justify-content: center;
    align-items: center;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020617;
}
            
.results-header {
                display: flex;
                justify-content: space-between;
                align-items: baseline;
                gap: 8px;
            }
            .results-title {
                font-size: 14px;
                font-weight: 600;
                color: #dbeafe;
            }
            .results-tag {
                font-size: 11px;
                padding: 3px 8px;
                border-radius: 999px;
                background: rgba(37, 99, 235, 0.2);
                border: 1px solid rgba(129, 140, 248, 0.6);
                color: #bfdbfe;
            }
            .summary-chip {
                font-size: 16px;
                font-weight: 600;
                padding: 6px 10px;
                border-radius: 999px;
                display: inline-flex;
                align-items: center;
                gap: 8px;
            }
            .summary-chip.ai {
                background: rgba(37, 99, 235, 0.18);
                color: #bfdbfe;
                border: 1px solid rgba(56, 189, 248, 0.5);
            }
            .summary-chip.deepfake {
                background: rgba(220, 38, 38, 0.16);
                color: #fecaca;
                border: 1px solid rgba(248, 113, 113, 0.6);
            }
            .summary-chip.notai {
                background: rgba(22, 163, 74, 0.18);
                color: #bbf7d0;
                border: 1px solid rgba(52, 211, 153, 0.6);
            }
            .summary-dot {
                width: 10px;
                height: 10px;
                border-radius: 999px;
                background: #22c55e;
            }
            .summary-dot.ai {
                background: #22d3ee;
            }
            .summary-dot.deepfake {
                background: #f97373;
            }
            .score-blocks {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 8px;
            }
            .score-card {
                background: rgba(15, 23, 42, 0.7);
                border-radius: 10px;
                padding: 8px 8px 7px;
                border: 1px solid rgba(30, 64, 175, 0.8);
            }
            .score-label {
                font-size: 11px;
                color: #9ca3af;
                margin-bottom: 4px;
            }
            .score-value {
                font-size: 16px;
                font-weight: 600;
                color: #e5e7eb;
            }
            .score-bar {
                margin-top: 4px;
                width: 100%;
                height: 4px;
                border-radius: 999px;
                background: rgba(31, 41, 55, 0.9);
                overflow: hidden;
            }
            .score-bar-fill {
                height: 100%;
                border-radius: 999px;
                background: linear-gradient(to right, #22c55e, #22d3ee);
                width: 0%;
                transition: width 0.4s ease;
            }
            .score-bar-fill.deepfake {
                background: linear-gradient(to right, #ef4444, #f97316);
            }
            .raw-block {
                margin-top: 4px;
                padding: 7px 8px;
                border-radius: 10px;
                background: rgba(15, 23, 42, 0.9);
                border: 1px dashed rgba(55, 65, 81, 0.9);
                max-height: 130px;
                overflow: auto;
                font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
                font-size: 11px;
                color: #9ca3af;
                white-space: pre-wrap;
            }
            .muted {
                color: #6b7280;
                font-size: 12px;
            }
            .error {
                color: #fecaca;
                font-size: 12px;
                margin-top: 4px;
            }
            .badge {
                font-size: 11px;
                padding: 2px 8px;
                border-radius: 999px;
                border: 1px solid rgba(148, 163, 184, 0.7);
                color: #9ca3af;
            }



.models-block {
    margin-top: 8px;
}

.models-title {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
    font-size: 11px;
    color: #e5e7eb;
}

.tag-label {
    opacity: 0.9;
}

.tag-value {
    font-weight: 600;
    color: #bfdbfe;
}


.history {
    margin-top: 16px;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 18px;
    padding: 10px 14px 12px;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.history-title {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
}

.history-note {
    font-size: 11px;
    color: #6b7280;
}

.history-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(31, 41, 55, 0.9);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
}

.history-card:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.8);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.7);
}

.history-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    background: #020617;
    flex-shrink: 0;
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info-main {
    font-size: 11px;
    color: #e5e7eb;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-info-sub {
    font-size: 10px;
    color: #9ca3af;
}

/* ===================== */
/* Адаптация под планшеты */
/* ===================== */

@media (max-width: 900px) {
    .container {
        padding: 16px;
    }

    .card {
        grid-template-columns: 1fr;
        padding: 18px 16px 14px;
        gap: 16px;
    }

    .title {
        font-size: 20px;
    }

    .subtitle {
        font-size: 13px;
    }

    .results {
        margin-top: 4px;
    }

    .history {
        margin-top: 12px;
        padding: 8px 10px 10px;
    }

    .history-info-main {
        max-width: 120px;
    }
}

/* ===================== */
/* Адаптация под телефоны */
/* ===================== */

@media (max-width: 640px) {
    body {
        align-items: flex-start;
        padding-top: 16px;
    }

    .container {
        padding: 12px;
    }

    .card {
        padding: 14px 12px 10px;
        border-radius: 14px;
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
    }

    .title {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .subtitle {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .upload-area {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .upload-icon {
        font-size: 26px;
        margin-bottom: 4px;
    }

    .upload-title {
        font-size: 13px;
    }

    .upload-hint {
        font-size: 11px;
    }

    .preview-thumb {
        width: 48px;
        height: 48px;
    }

    .preview-info-main {
        font-size: 12px;
    }

    .preview-info-sub {
        font-size: 10px;
    }

    .actions {
        margin-top: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .analyze-button {
        width: 100%;
        justify-content: center;
        padding: 9px 12px;
    }

    .status-text {
        font-size: 11px;
    }

    .results {
        padding: 10px;
        border-radius: 12px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .score-blocks {
        grid-template-columns: 1fr;
    }

    .score-card {
        padding: 7px 8px 6px;
    }

    .raw-block {
        max-height: 100px;
        font-size: 10px;
    }

    .result-image {
        max-height: 35vh;
    }

    .history {
        border-radius: 12px;
        padding: 8px;
    }

    .history-strip {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .history-card {
        min-width: 180px;
    }

    .history-info-main {
        max-width: 110px;
    }
}

/* Чуть улучшим поведение на тач-устройствах */

button,
.upload-area {
    -webkit-tap-highlight-color: transparent;
}
