.src-calculator {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}
.src-calculator * { box-sizing: border-box; }

.src-calculator h3 {
    margin-top: 0;
    font-size: 20px;
}

.src-field { margin-bottom: 4px; }

.src-calculator label {
    font-weight: 600;
    display: block;
    margin: 16px 0 6px;
    font-size: 14px;
}

.src-calculator select,
.src-calculator input[type="text"] {
    width: 100%;
    padding: 12px 10px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}

/* File input — the default browser control is tiny and unstyled on mobile.
   Wrapping it gives a full-width, comfortably tappable control on all screens. */
.src-file-wrap {
    display: block;
    width: 100%;
    padding: 14px 12px;
    border: 2px dashed #b9b9b9;
    border-radius: 8px;
    background: #fafafa;
    text-align: center;
    cursor: pointer;
}
.src-file-wrap:hover { border-color: #2271b1; background: #f4f8fb; }
.src-calculator input[type="file"] {
    width: 100%;
    font-size: 14px;
    padding: 8px 0;
}
.src-file-hint {
    font-size: 12px;
    color: #777;
    margin-top: 6px;
    display: block;
}

.src-calculator button[type="submit"] {
    width: 100%;
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}
.src-calculator button[type="submit"]:hover { background: #1a5a8a; }
.src-calculator button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

#src-result {
    margin-top: 24px;
    padding: 20px;
    background: #fbfdfb;
    border: 1px solid #dcece0;
    border-radius: 8px;
}
#src-result h3 {
    color: #1e7e34;
    margin-top: 0;
    font-size: 22px;
}
.src-total-score {
    font-size: 32px;
    font-weight: 700;
    color: #1e7e34;
    margin: 4px 0 16px;
}
.src-summary-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.src-summary-chip {
    flex: 1;
    min-width: 90px;
    text-align: center;
    padding: 10px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.src-summary-chip .src-chip-num { display: block; font-size: 20px; margin-bottom: 2px; }
.src-chip-correct { background: #e6f4ea; color: #1e7e34; }
.src-chip-wrong { background: #fce8e6; color: #c5221f; }
.src-chip-unattempted { background: #f1f3f4; color: #5f6368; }

.src-qualifying-box {
    background: #f0f4ff;
    border: 1px solid #c3d4fa;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
}
.src-qualifying-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #3949ab;
    background: #e3e7ff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    letter-spacing: 0.3px;
}
.src-qualifying-row { background: #fafaff; }
.src-qualifying-row td { color: #555; }

.src-rank-box {
    background: #fff8e1;
    border: 1px solid #ffe0a3;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 15px;
}

.src-section-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 8px;
}
.src-section-table th,
.src-section-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}
.src-section-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}
.src-section-table td.src-num { text-align: right; font-variant-numeric: tabular-nums; }
.src-section-table tr:last-child td { border-bottom: none; }
.src-section-table tr.src-section-total td {
    font-weight: 700;
    border-top: 2px solid #ddd;
    background: #fafafa;
}
.src-correct-text { color: #1e7e34; }
.src-wrong-text { color: #c5221f; }

.src-error {
    color: #c0392b;
    font-weight: 600;
}
.src-warning {
    color: #966a00;
    font-size: 13px;
    background: #fff8e5;
    padding: 10px 12px;
    border-radius: 6px;
    margin: 14px 0;
    line-height: 1.5;
}
.src-disclaimer {
    font-size: 12px;
    color: #888;
    margin-top: 18px;
    line-height: 1.5;
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .src-calculator { padding: 16px; border-radius: 0; }
    .src-summary-row { gap: 6px; }
    .src-summary-chip { min-width: 80px; padding: 8px 6px; }
    .src-total-score { font-size: 26px; }
    .src-section-table { font-size: 13px; }
    .src-section-table th, .src-section-table td { padding: 8px 5px; }
}
