* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    padding: 20px;
    margin: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-top: 5px solid #0056b3;
}

.toolbar.bottom-toolbar {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.btn {
    background-color: #0056b3;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.btn:hover { background-color: #004494; }

header {
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

header h1 { margin: 0 0 10px 0; font-size: 24px; color: #0056b3; }
header p { margin: 0; color: #666; font-weight: bold; }

.worksheet-section { margin-bottom: 30px; }

/* Collapsible sections styling */
details.worksheet-section summary {
    list-style: none; /* Hide default arrow */
    cursor: pointer;
    outline: none;
}
details.worksheet-section summary::-webkit-details-marker {
    display: none;
}
details.worksheet-section summary h2 {
    font-size: 18px;
    background-color: #eef2f5;
    padding: 8px 12px;
    border-left: 4px solid #0056b3;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
}
details.worksheet-section summary h2::after {
    content: '▼';
    font-size: 14px;
    color: #0056b3;
}
details[open].worksheet-section summary h2::after {
    content: '▲';
}
.section-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.subsection h3 { font-size: 15px; color: #444; margin-bottom: 5px; }

.instruction-text {
    font-size: 13px;
    color: #666;
    margin-top: 0;
    margin-bottom: 10px;
}

.required {
    color: #d9534f;
    font-weight: bold;
    margin-left: 2px;
}

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

.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; font-weight: bold; margin-bottom: 5px; color: #555; }
.form-group input[type="text"], .form-group input[type="number"], .form-group input[type="date"], .form-group input[type="file"], .form-group select { 
    padding: 8px; 
    border: 1px solid #ccc; 
    border-radius: 3px; 
    font-size: 14px; 
}

/* Fix for input units overflowing */
.input-with-unit { 
    display: flex; 
    gap: 5px; 
    width: 100%;
}
.input-with-unit input { 
    flex: 1; 
    min-width: 0; 
}
.input-with-unit select { 
    width: auto; 
    flex-shrink: 0; 
} 

/* 3-Reading Input Styling */
.reading-group {
    background: #fafafa;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}
.reading-group label {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.reading-inputs { display: flex; gap: 5px; }
.reading-inputs input {
    width: 80px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
}
.avg-display {
    font-weight: bold;
    color: #0056b3;
    font-size: 14px;
}

.coeff-display {
    font-size: 13px;
    background: #eef2f5;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    color: #444;
}

.calc-result {
    font-weight: bold;
    color: #0056b3;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    text-align: right;
}

/* Table styling */
.table-container { width: 100%; overflow-x: auto; }
.dose-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.dose-table th, .dose-table td {
    border: 1px solid #ccc;
    padding: 6px 4px;
    text-align: center;
    vertical-align: middle;
}
.dose-table th { background: #eef2f5; color: #0056b3; }
.dose-table input, .dose-table select {
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    font-size: 12px;
}

.inp-energy { width: 45px; }
.inp-energy-mode { width: 55px; margin-left: 2px; }
.inp-kq, .inp-pdd, .inp-ref { width: 65px; }

.mraw-inputs { display: flex; gap: 3px; justify-content: center; margin-bottom: 4px; }
.mraw-inputs input { width: 60px; }
.mraw-avg-display { font-weight: bold; color: #0056b3; font-size: 12px; }
.td-result { font-weight: bold; color: #333; font-size: 14px; }
.remove-btn {
    background: #d9534f; color: #fff; border: none; padding: 4px 8px; border-radius: 3px; cursor: pointer;
}
.remove-btn:hover { background: #c9302c; }

.summary-box {
    background-color: #eef2f5;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #c8d9e6;
}
.summary-box .formula { font-size: 13px; color: #555; font-family: monospace; margin: 4px 0; }
