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

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

.container {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

main {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

aside {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

aside h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.guide-content {
    font-size: 0.9rem;
}

.guide-content p {
    margin-bottom: 10px;
}

.format-example {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    line-height: 1.6;
    border-left: 3px solid #667eea;
    margin: 10px 0;
    white-space: pre-wrap;
}

.guide-note {
    color: #666;
    font-style: italic;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.diagnosis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.progress-indicator {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-text {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.progress-bar-container {
    width: 150px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 10px;
}

.progress-bar-fill.complete {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.info-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-card .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.info-card .info-item {
    font-size: 0.9rem;
}

.info-card .info-label {
    opacity: 0.8;
    font-size: 0.8rem;
}

.question-card {
    background: white;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.question-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.question-card .question-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.6;
}

.answer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-btn {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 1rem;
    color: #333;
}

.answer-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.answer-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.history-list {
    margin-top: 20px;
}

.history-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.history-item .question {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.history-item .answer {
    color: #667eea;
    font-weight: 600;
}

.diagnosis-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

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

.step {
    display: none;
}

.step.active {
    display: block;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
}

.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    margin-top: 8px;
    color: #888;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.job-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-bottom: 20px;
}

.job-summary h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.job-summary .info-row {
    display: flex;
    margin-bottom: 8px;
}

.job-summary .label {
    font-weight: 600;
    min-width: 150px;
    color: #555;
}

.job-summary .value {
    color: #333;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.question-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.question-item label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.question-item input,
.question-item textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

.diagnostic-step {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.diagnostic-step h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.diagnostic-step .component {
    font-weight: 600;
    color: #764ba2;
    margin-bottom: 10px;
}

.diagnostic-step .instructions {
    margin-bottom: 15px;
    line-height: 1.8;
}

.diagnostic-step .result-form {
    margin-top: 15px;
}

.estimate-items {
    margin-top: 20px;
}

.estimate-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 10px;
}

.estimate-item.header {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.item-kind {
    display: inline-block;
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

.item-description {
    color: #666;
    line-height: 1.4;
}

.estimate-total {
    margin-top: 20px;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 5px;
    text-align: right;
}

.estimate-total .total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.estimate-total .total-row.grand {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    border-top: 2px solid #667eea;
    padding-top: 10px;
}

.info-empty {
    color: #999;
    font-style: italic;
}

.info-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.info-value {
    color: #333;
}

@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }

    aside {
        position: relative;
        top: 0;
    }
}
