* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f5f7fa;
}

h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.back-button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.back-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.header-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #1a1a1a;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.panel-title {
    font-size: 1.3em;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
}

.section-title {
    font-size: 1.2em;
    color: #1a1a1a;
    margin-bottom: 16px;
    font-weight: 600;
}

/* Панель управления */
.control-panel {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.panel-section:last-of-type {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 1em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    color: #6b7280;
    font-size: 0.85em;
}


.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.version-selector-container {
    margin-top: 12px;
}

.custom-prompts-container {
    margin-top: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.custom-prompts-editor textarea {
    width: 100%;
    min-height: 200px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    resize: vertical;
}

.info-text {
    padding: 10px 12px;
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 4px;
    color: #1e40af;
    font-size: 0.85em;
    margin-bottom: 12px;
    line-height: 1.5;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    margin-top: 12px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Loader */
.loader {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: #6b7280;
    font-size: 1.1em;
}

/* Результаты */
.results-container {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.call-result {
    margin-bottom: 30px;
}

.call-result:last-child {
    margin-bottom: 0;
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 16px;
}

.call-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
}

.tokens-info {
    font-size: 0.8em;
    color: #6b7280;
    font-family: 'JetBrains Mono', monospace;
}

.view-call-link {
    padding: 6px 12px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s;
}

.view-call-link:hover {
    background: #1d4ed8;
}

.section-title {
    font-size: 1em;
    font-weight: 600;
    color: #1f2937;
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e7eb;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.85em;
}

.comparison-table th,
.comparison-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
    font-size: 0.85em;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background: #f9fafb;
}

.error-message {
    padding: 16px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #991b1b;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 12px 16px;
    }

    .header-title {
        font-size: 1.2em;
    }

    .control-panel,
    .results-container {
        padding: 16px;
    }

    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .call-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .comparison-table {
        font-size: 0.9em;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px;
    }
}
