* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #3f4147 0%, #2e2b37 100%);
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Базовые стили для иконок, чтобы гарантировать правильное позиционирование */
i[data-lucide] {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -0.1em; /* Тонкая настройка оптического выравнивания */
}

.icon-header {
    width: 24px;
    height: 24px;
}

.icon-title {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

.icon-field {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    opacity: 0.7;
}

.icon-btn {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

.icon-inline {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    opacity: 0.8;
}

/* Дополнительный сброс для label, чтобы flex не ломал выравнивание */
label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.main-content {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.forms-section {
    padding: 30px 30px 24px;
    border-bottom: 1px solid #e8eaed;
}

.forms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.viewer-container {
    position: relative;
    background: #f0f2f5;
    min-height: 480px;
    overflow: hidden;
}

#canvas-container {
    width: 100%;
    height: 480px;
}

.scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.viewer-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.inertia-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
    cursor: default;
    user-select: none;
}

.inertia-control span:first-child {
    white-space: nowrap;
}

.inertia-control input[type="range"] {
    width: 120px;
    accent-color: #FF7500;
    cursor: pointer;
}

.inertia-value {
    min-width: 36px;
    font-weight: 600;
    color: #FF7500;
    text-align: right;
}

.tire-form {
    margin-bottom: 0;
}

.tire-form h2 {
    color: #FF7500;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #FF7500;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #FF7500;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FF7500 0%, #FF8C33 100%) !important;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 117, 0, 0.4);
}

button:active {
    transform: translateY(0);
}

.results-container {
    margin-top: 30px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.results-container h2 {
    color: #FF7500;
    margin-bottom: 20px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
    padding: 10px 14px;
    border: 1px solid #e4e7ec;
    vertical-align: top;
    text-align: center;
}

.compare-table th {
    background: #f0f2f8;
    color: #444;
    font-weight: 600;
    text-align: left;
    width: 28%;
}

.compare-table tr:nth-child(even):not(.section-row) td,
.compare-table tr:nth-child(even):not(.section-row) th {
    background: #fafbfc;
}

.compare-table .section-row td,
.compare-table .section-row th {
    background: #3f4147;
    color: white;
    text-align: center;
    font-size: 1rem;
}

.compare-table .section-label {
    width: 20%;
}

.stock-note {
    color: #666;
    font-size: 0.9rem;
    text-align: left !important;
}

.local-note {
    color: #664d03;
    background: #fff3cd;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.diff-note {
    margin-top: 6px;
    color: #555;
    font-size: 0.88rem;
}

.diff-danger {
    margin-top: 4px;
    color: #dc3545;
    font-weight: 600;
    font-size: 0.88rem;
}

.warnings-list {
    margin-top: 24px;
    padding: 16px 20px;
    background: #fff8e6;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.warnings-list h3 {
    color: #664d03;
    margin-bottom: 10px;
    font-size: 1rem;
}

.warnings-list ul {
    margin: 0;
    padding-left: 20px;
    color: #664d03;
}

.warnings-list li {
    margin-bottom: 6px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.result-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.result-card h3 {
    color: #FF7500;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-label {
    font-weight: 500;
    color: #666;
}

.result-value {
    font-weight: 600;
    color: #333;
}

.warning-card {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.warning-card .result-value {
    color: #664d03;
}

.danger-card {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.danger-card .result-value {
    color: #721c24;
}

.ok-card {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

/* Отладочная информация */
.debug-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #0f0;
    font-family: monospace;
    font-size: 10px;
    padding: 5px;
    border-radius: 5px;
    z-index: 1000;
    pointer-events: none;
}

@media (max-width: 900px) {
    .forms-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .viewer-container {
        min-height: 360px;
    }

    #canvas-container {
        height: 360px;
    }

    .compare-table {
        font-size: 0.85rem;
    }

    .compare-table th,
    .compare-table td {
        padding: 8px 10px;
    }
}