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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 8px;
}

header p {
    color: #7f8c8d;
    font-size: 14px;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
}

.input-panel, .result-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-panel h2, .result-panel h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.input-panel h3 {
    margin: 20px 0 10px 0;
    color: #34495e;
    font-size: 16px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

#piecesList {
    margin-bottom: 15px;
}

.piece-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.piece-row input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
}

.piece-row span {
    color: #7f8c8d;
    font-weight: bold;
}

.btn-remove {
    padding: 6px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.btn-remove:hover {
    background: #c0392b;
}

.btn-add, .btn-calculate {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-add {
    background: #95a5a6;
    color: white;
}

.btn-add:hover {
    background: #7f8c8d;
}

.btn-calculate {
    background: #3498db;
    color: white;
    font-size: 16px;
}

.btn-calculate:hover {
    background: #2980b9;
}

.status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.result-stats {
    margin-bottom: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 4px;
    font-size: 14px;
}

.result-stats div {
    margin-bottom: 8px;
}

.result-stats strong {
    color: #2c3e50;
}

.visualization {
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: auto;
    background: white;
}

.visualization svg {
    display: block;
    margin: 20px auto;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}
