body {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-style: italic;
}

.input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    background: white;
}

.file-picker { position: relative; }
.file-picker input[type="file"] {
    position: absolute; width: 1px; height: 1px; padding: 0;
    border: 0; overflow: hidden; clip-path: inset(50%);
}
.file-picker-button {
    display: inline-block; background: #6c757d; color: white;
    border-radius: 5px; padding: 12px 24px; cursor: pointer;
}
.file-picker:focus-within .file-picker-button { outline: 3px solid #667eea; outline-offset: 3px; }
#selectedFileStatus { overflow-wrap: anywhere; }

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-docs {
    background: #28a745;
    color: white;
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    font-size: 16px;
}

.btn-docs:hover {
    background: #218838;
}

.results-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.result-label {
    font-weight: bold;
    color: #2c3e50;
}

.result-value {
    font-family: monospace;
    background: white;
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.interpretation {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
}

.interpretation.pass {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

.diagnostics {
    background: white;
    color: #2c3e50;
    font-weight: normal;
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}
.diagnostics table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.diagnostics th, .diagnostics td { border: 1px solid #ddd; padding: 7px; text-align: right; }
.diagnostics th:first-child, .diagnostics td:first-child { text-align: left; }
.diagnostics thead { background: #f0f2f5; }

.chart-container {
    margin-top: 20px;
    text-align: center;
}

canvas {
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    max-width: 100%;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

.info-box {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #bee5eb;
}

.parsing-info {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.parsing-info h4 {
    margin-top: 0;
    color: #856404;
}

.format-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.format-example {
    background: white;
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    border: 1px solid #ddd;
    text-align: center;
}

.column-info {
    background: #e9ecef;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 12px;
    font-family: monospace;
}

.success-info {
    background: #d4edda;
    color: #155724;
    padding: 8px;
    border-radius: 3px;
    font-weight: bold;
}

.warning-info {
    background: #fff3cd;
    color: #856404;
    padding: 8px;
    border-radius: 3px;
    font-weight: bold;
}

.documentation-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.documentation-section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.doc-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h3 {
    color: #495057;
    margin-bottom: 12px;
}

.doc-section h4 {
    color: #6c757d;
    margin-bottom: 8px;
    margin-top: 15px;
}

.doc-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.doc-section li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.interpretation-guide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

.guide-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.guide-pass {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.guide-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.guide-fail {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.guide-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.guide-item ul {
    margin-bottom: 0;
}

.copyright-footer {
    margin-top: 30px;
    padding: 20px;
    background: #e9ecef;
    border-radius: 5px;
    text-align: center;
    font-size: 12px;
}

.copyright-footer p {
    margin: 5px 0;
}

.file-notice {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
    border-left: 4px solid #bee5eb;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }

    button {
        min-width: auto;
    }
}

.site-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-radius: 8px;
    background: #17355e;
    text-align: center;
    color: white;
    font-size: 13px;
    line-height: 1.5;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: inherit; text-decoration: underline; }
