/* A4 Page Setup */
body {
    margin: 0;
    padding: 0;
    background: #f0f0f0;
    font-family: Arial, sans-serif;
}

.result_body {
    width: 210mm;
    min-height: 297mm;
    padding: 5mm;
    margin: 20px auto;
    background: white;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Optional results-card watermark (image from Educare Card Settings → banner) */
.result_body.ect-result-watermark {
    position: relative;
    isolation: isolate;
}

.result_body.ect-result-watermark::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--ect-watermark-img, none);
    background-repeat: no-repeat;
    background-position: center 40%;
    background-size: clamp(140px, 58%, 420px) auto;
    opacity: 0.13;
}

.result_body.ect-result-watermark > .results-container {
    position: relative;
    z-index: 1;
}

/* Dompdf cannot paint ::before from var(--ect-watermark-img); PDF img lives in .ect-pdf-watermark-wrap (hidden on screen) */
.result_body .ect-pdf-watermark-wrap {
    display: none !important;
}

.results-container {
    width: 100%;
}

/* Banner and Header Styling */
.bos-banner img {
    width: 100%;
    height: auto;
}

.school-address {
    font-size: 9.5pt !important;
    margin: 5mm 0;
    margin-top: -2px;
    margin-bottom: 10px;
    text-align: center;
}

hr {
    margin-top: -8px !important;
    
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2mm;
}

td {
    border: 1px solid #000;
    padding: 2px;
    font-size: 9.5pt;
    line-height: 1.2;
}

/* Header Cells */
td[style*="background-color"] {
    background-color: #573b8a !important;
    color: #fff !important;
    font-size: 11pt;
    padding: 3px;
}

/* Student Details Table */
.student-details-table {
    margin-bottom: 2mm;
    border-collapse: collapse;
    max-width: 100%;
    table-layout: auto;
}

.student-details-table td {
    padding: 2px 4px;
    height: auto;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.1;
}

/* Keep label columns compact but readable */
.student-details-table td:nth-child(1),
.student-details-table td:nth-child(3),
.student-details-table td:nth-child(5) {
    width: 14%;
    max-width: 14%;
    font-weight: 600;
}

.student-details-table td:nth-child(2),
.student-details-table td:nth-child(4),
.student-details-table td:nth-child(6) {
    width: 16%;
    max-width: 16%;
}

/* Allow word wrapping for the last row */
.student-details-table tr:last-child td {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
}

/* Expand photo cell to make it more visible */
.student-details-table td[colspan="2"] {
    width: fit-content;
    min-width: fit-content;
    max-width: fit-content;
}

/* Keep photo column stable so text columns don't get clipped */
.student-details-table td:last-child {
    width: 90px;
    min-width: 90px;
}

.student-details-table img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* BOS legacy: less gap under banner / around sheet title */
.bos-legacy-results .school-address {
    margin-top: 4px;
    margin-bottom: 6px;
}

.results-container.bos-legacy-results,
.results-container.bos-legacy-results * {
    font-family: "Times New Roman", Times, serif !important;
}

/* BOS legacy: grade-sheet column header row (S/N, Subjects, CA..., Remarks) */
.results-container.bos-legacy-results .grade-sheet table tr:nth-child(2) td {
    font-size: 12.667px !important;
    font-weight: 700 !important;
}

/* BOS legacy: match skills/rating text size to 12.6667px */
.results-container.bos-legacy-results .skills table,
.results-container.bos-legacy-results .skills table th,
.results-container.bos-legacy-results .skills table td,
.results-container.bos-legacy-results .skills .skills-table td.skills-score,
.results-container.bos-legacy-results .skills .skills-table td.skills-score-cell {
    font-size: 12.6667px !important;
}

.bos-legacy-results .school-address hr {
    margin-top: -6px;
    margin-bottom: 0;
}

.header.bos-legacy-header {
    margin: 0;
    padding: 0;
}

.student-details-wrapper.bos-legacy-student-details-outer {
    margin-top: 0;
    padding-top: 0;
    overflow-x: visible;
}

/* BOS legacy: sheet title (plain block inside content column, not h1–h6) */
.bos-legacy-student-details-text .bos-legacy-result-sheet-title {
    width: 100%;
    margin: 0 0 6px 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
    font-size: 11pt;
    font-weight: bold;
    line-height: 1.25;
    text-align: center;
    text-align-last: center;
    text-justify: auto;
}

/* BOS legacy: paragraph layout + photo (replaces student-details table) */
.bos-legacy-student-details-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    font-family: 'Times New Roman', Times, serif;
    font-size: 9.5pt;
    line-height: 1.35;
    margin-top: 0;
    margin-bottom: 1.5mm;
}

/* Block-level justification: flush left and right edges within the text column */
.bos-legacy-student-details-text {
    display: block;
    flex: 1;
    min-width: 0;
    width: 100%;
    text-align: justify;
    text-justify: inter-word;
}

.bos-legacy-line {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: justify;
    text-justify: inter-word;
}

/* One paragraph for all label/value pairs: single “last line” so justify fills both margins evenly */
.bos-legacy-line--fields {
    margin-top: 0.2em;
}

.bos-legacy-line--fields .bos-legacy-pair {
    display: inline;
    margin-right: 0.6em;
    white-space: normal;
}

.bos-legacy-pair {
    display: inline;
    white-space: normal;
}

.bos-legacy-label {
    font-weight: bold;
}

.bos-legacy-value {
    font-weight: normal;
}

.bos-legacy-student-photo {
    flex-shrink: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px;
    background: #fff;
}

.bos-legacy-student-photo img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* Grade Sheet + skills: shared purple banner (matches skills category row) */
.result_body:not(.rtl-layout) .grade-sheet table tr:first-child td,
.result_body:not(.rtl-layout) .skills .skills-table tr:first-child td {
    background-color: #573b8a !important;
    color: #fff !important;
    text-align: center !important;
    font-weight: 700 !important;
}

.result_body:not(.rtl-layout) .grade-sheet table tr:first-child td {
    text-transform: uppercase;
}

/* Grade Sheet */
.grade-sheet table {
    margin-top: -10px;
    font-size: 8pt;
}

.grade-sheet td {
    padding: 1px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column headers (S/N, Subjects, CA %, etc.) — left-aligned */
.grade-sheet table tr:nth-child(2) td {
    font-size: 7pt;
    padding: 1px;
    text-align: left !important;
    vertical-align: top;
    white-space: normal;
}

.grade-sheet table td:nth-child(2) {
    min-width: 60px;
    white-space: normal;
}

.grade-sheet table td:nth-child(n+3) {
    min-width: 35px;
    text-align: left;
}

/* All grade-sheet data cells left-aligned */
.grade-sheet table tr:nth-child(n+3) td {
    text-align: left !important;
    white-space: normal;
}

/* Skill rating item column — title case (class skills-item on data rows) */
.skills .skills-table td.skills-item {
    text-transform: capitalize;
}

/* Skills Section — row of tables spans full result width (e.g. two 50% columns) */
.skills {
    margin-top: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Skills matrix — column widths match test.html (S/N 12%, Item 46%, scores 5×8%) */
.skills table.skills-table {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: none;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 9.5pt;
    margin-bottom: 2mm;
    margin-left: 0;
    margin-right: 0;
}

.skills table.skills-table th,
.skills table.skills-table td {
    border: 1px solid #ccc;
    padding: 4px 6px;
    line-height: 1.15;
    vertical-align: middle;
}

.skills table.skills-table td.skills-sn,
.skills table.skills-table th.skills-sn {
    width: 12%;
    text-align: left;
    padding-left: 8px;
    padding-right: 8px;
}

.skills table.skills-table td.skills-label,
.skills table.skills-table th.skills-label {
    width: 46%;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.skills table.skills-table td.skills-score,
.skills table.skills-table th.skills-score {
    width: 8%;
    text-align: center;
    font-weight: 700;
}

.skills table.skills-table td.skills-score-cell {
    width: 8%;
    text-align: center;
    vertical-align: middle;
    padding: 6px 4px;
}

/*
 * Educare results.css sets .result_body table { table-layout: unset !important; }
 * which disables fixed layout and makes score columns uneven (e.g. last column ~100px).
 */
.result_body .skills table.skills-table {
    table-layout: fixed !important;
}

.result_body .skills table.skills-table col.skills-col-sn {
    width: 12% !important;
}

.result_body .skills table.skills-table col.skills-col-label {
    width: 46% !important;
}

.result_body .skills table.skills-table col.skills-col-score {
    width: 8% !important;
}

.result_body .skills table.skills-table td.skills-sn,
.result_body .skills table.skills-table th.skills-sn {
    width: 12% !important;
    min-width: 0 !important;
    max-width: none;
    box-sizing: border-box;
    padding-left: 8px !important;
    padding-right: 8px !important;
    text-align: left !important;
}

.result_body .skills table.skills-table td.skills-label,
.result_body .skills table.skills-table th.skills-label {
    width: 46% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    text-align: left !important;
}

.result_body .skills table.skills-table td.skills-score,
.result_body .skills table.skills-table th.skills-score,
.result_body .skills table.skills-table td.skills-score-cell {
    width: 8% !important;
    min-width: 0 !important;
    max-width: none;
    box-sizing: border-box;
}

.skills table:not(.skills-table) {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    font-size: 9.5pt;
    margin-bottom: 2mm;
    margin-left: 0;
    margin-right: 0;
}

.skills tr td {
    font-size: 9pt;
    text-align: left;
    padding: 2px 4px;
}

/* Overview Section */
.overview {
    margin-bottom: 2mm;
}

.overview table {
    width: 100%;
    margin-bottom: 2mm;
}

.overview td {
    padding: 2px 4px;
    font-size: 9.5pt;
    font-weight: normal;
}

.overview td[colspan="6"] {
    font-size: 11pt;
    padding: 3px;
    background-color: #573b8a !important;
    color: #fff !important;
}

/* Ensure QUICK OVERVIEW header has proper styling */
.overview td[style*="background-color: #573b8a"] {
    background-color: #573b8a !important;
    color: #fff !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* Grading Key Section */
.grading-key {
    margin-bottom: 1rem;
}

/* Key to Grading — single paragraph (no table, no POINT column) */
.grading-key--text-block {
    margin: 4px 0 1rem 0;
    padding: 0;
}

.grading-key--text-block .grading-key-inline-body {
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
    font-size: 9.5pt;
    line-height: 1.35;
    font-weight: bold;
    text-align: left;
    color: #000;
}

.grading-key table {
    width: 100%;
    margin-bottom: 2mm;
    font-size: 9.5pt;
}

.grading-key td {
    padding: 2px 4px;
    font-size: 9pt;
    text-align: left;
    border: 1px solid #000;
}

.grading-key td[style*="background-color: #573b8a"] {
    background-color: #573b8a !important;
    color: #fff !important;
    font-weight: bold !important;
    text-align: center !important;
    font-size: 11pt;
    padding: 3px;
}

.grading-key td[style*="background-color: #f0f0f0"] {
    background-color: #f0f0f0 !important;
    color: black !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* Remarks Section */
.remarks {
    margin-bottom: 1.35rem;
}

.remarks table {
    width: 100%;
}

/* BOS legacy: comment above dotted rule; signature above solid rule; name & date centered under headings */
.remarks--legacy-text-layout {
    font-family: 'Times New Roman', Times, serif;
    font-size: 9.5pt;
    line-height: 1.35;
    color: #000;
}

.remarks-legacy-dotted-block {
    margin-bottom: 0.85rem;
}

.remarks-legacy-dotted-line {
    width: 100%;
    margin: 0 0 0.55em 0;
}

.remarks-legacy-dotted-text-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.35em 0.55em;
    margin-bottom: 3px;
    text-align: left;
}

.remarks-legacy-dotted-label {
    flex-shrink: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.remarks-legacy-dotted-comment {
    flex: 1 1 12rem;
    min-width: 8rem;
    font-weight: 400;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.remarks-legacy-dotted-rule-bar {
    width: 100%;
    border-bottom: 1px dotted #000;
    height: 0;
    margin: 0;
    line-height: 0;
}

.remarks-legacy-signatures {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.remarks-legacy-sign-col {
    flex: 1 1 50%;
    min-width: 0;
    text-align: center;
}

.remarks-legacy-sign-sig-above {
    min-height: 44px;
    margin-bottom: 0.35em;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.remarks-legacy-sign-rule {
    border-top: 1px solid #000;
    width: 100%;
    margin: 0 0 0.45em 0;
}

.remarks-legacy-sign-heading {
    margin: 0 0 0.4em 0;
    padding: 0;
    font-size: inherit;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.25;
    text-align: center;
}

.remarks-legacy-sign-name {
    margin: 0 0 0.25em 0;
    padding: 0;
    font-weight: 700;
    text-align: center;
}

.remarks-legacy-signature-img {
    display: block;
    max-height: 40px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
    border: none;
    border-radius: 0;
}

.remarks-legacy-date-line {
    margin: 0.3em 0 0 0;
    padding: 0;
    font-weight: 700;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Image Styling */
img {
    max-width: 100%;
    height: auto;
}

img[alt="Signature"],
img[alt*="Signature"],
img[alt*="signature"] {
    width: 60px;
    height: 30px;
    object-fit: contain;
    border: none;
    border-radius: 0;
}

img[alt="Student Image"],
img[alt*="Student Photo"],
img[alt*="student photo"] {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Responsive Design — wide tablets / narrow desktops */
@media screen and (max-width: 210mm) {
    .result_body {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 10px;
        box-sizing: border-box;
    }

    body {
        background: white;
    }

    .skills {
        width: 100%;
        max-width: 100%;
    }
}

/* Mobile Responsiveness - Tablets and Small Screens */
@media screen and (max-width: 768px) {
    .result_body {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 8px;
        box-shadow: none;
        box-sizing: border-box;
        -webkit-text-size-adjust: 100%;
    }

    .results-container {
        max-width: 100%;
    }
    
    /* Responsive banner */
    .bos-banner img {
        max-width: 100%;
        height: auto;
        max-height: 80px;
    }
    
    .school-address {
        font-size: 10px;
        margin: 6px 0;
        text-align: center;
    }
    
    /* Responsive student details table - make it scrollable horizontally */
    .student-details-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .student-details-wrapper.bos-legacy-student-details-outer {
        overflow-x: visible;
    }

    .student-details-wrapper.bos-legacy-student-details-outer::before {
        display: none !important;
    }

    .bos-legacy-student-details-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .bos-legacy-student-photo {
        align-self: center;
    }

    .remarks-legacy-signatures {
        flex-direction: column;
        gap: 1rem;
    }
    
    .student-details-table {
        font-size: 11px;
        min-width: 600px; /* Force horizontal scroll on smaller screens */
    }
    
    .student-details-table td {
        padding: 4px 6px;
        word-wrap: break-word;
        white-space: nowrap; /* Prevent wrapping to maintain table structure */
        min-width: 80px;
    }
    
    .student-details-table img {
        width: 80px;
        height: 100px;
        object-fit: cover;
    }
    
    /* Mobile scroll indicator for student details */
    .student-details-wrapper::before {
        content: "← Swipe left/right to view all details →";
        display: block;
        text-align: center;
        font-size: 10px;
        color: #666;
        padding: 5px;
        background: #f9f9f9;
        border: 1px solid #ddd;
        border-radius: 3px;
        margin-bottom: 5px;
    }
    
    .student-details-wrapper::-webkit-scrollbar {
        height: 8px;
    }
    
    .student-details-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .student-details-wrapper::-webkit-scrollbar-thumb {
        background: #573b8a;
        border-radius: 4px;
    }
    
    .student-details-wrapper::-webkit-scrollbar-thumb:hover {
        background: #3f2a63;
    }
    
    /* Responsive grade sheet - make it scrollable horizontally */
    .grade-sheet {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .grade-sheet table {
        min-width: 800px;
        font-size: 10px;
    }
    
    .grade-sheet td {
        padding: 2px 4px;
        min-width: 40px;
        white-space: nowrap;
    }
    
    .grade-sheet table td:nth-child(2) {
        min-width: 100px;
        white-space: normal;
    }
    
    /* Responsive skills section — stack full-width tables */
    .skills {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .skills table,
    .skills table.skills-table {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        font-size: 12px;
    }

    .skills table.skills-table td.skills-label {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    
    /* Inline grading key (text block) */
    .grading-key--text-block {
        max-width: 100%;
    }

    .grading-key--text-block .grading-key-inline-body {
        font-size: 10px;
        line-height: 1.45;
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }
    
    /* Responsive grading key (legacy table markup if present) */
    .grading-key table {
        font-size: 11px;
    }
    
    .grading-key td {
        padding: 4px 6px;
    }
    
    /* Responsive overview */
    .overview table {
        font-size: 11px;
    }
    
    .overview td {
        padding: 4px 6px;
    }
    
    /* Responsive remarks */
    .remarks table {
        font-size: 11px;
    }
    
    .remarks td {
        padding: 4px 6px;
        word-wrap: break-word;
    }

    /* Mobile scroll indicator for grade sheet */
    .grade-sheet::before {
        content: "← Swipe left/right to view all columns →";
        display: block;
        text-align: center;
        font-size: 10px;
        color: #666;
        padding: 5px;
        background: #f9f9f9;
        border: 1px solid #ddd;
        border-radius: 3px;
        margin-bottom: 5px;
    }
    
    .grade-sheet::-webkit-scrollbar {
        height: 8px;
    }
    
    .grade-sheet::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .grade-sheet::-webkit-scrollbar-thumb {
        background: #573b8a;
        border-radius: 4px;
    }
    
    .grade-sheet::-webkit-scrollbar-thumb:hover {
        background: #3f2a63;
    }

    /* BOS legacy: title + justified details — avoid horizontal page overflow */
    .bos-legacy-results .school-address {
        margin-bottom: 4px;
    }

    .bos-legacy-result-sheet-title {
        font-size: 10pt;
        line-height: 1.2;
    }

    .bos-legacy-student-details-wrap {
        max-width: 100%;
        gap: 8px;
    }

    .bos-legacy-student-details-text,
    .bos-legacy-line {
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }

    .bos-legacy-student-photo img {
        width: 72px;
        height: 72px;
    }
}

/* Hide scroll indicators on print */
@media print {
    .grade-sheet::before,
    .student-details-wrapper::before {
        display: none !important;
    }
}

/* Mobile Responsiveness - Small Mobile Screens */
@media screen and (max-width: 480px) {
    .result_body {
        padding: 5px;
        font-size: 12px;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Very compact banner for mobile */
    .bos-banner img {
        max-height: 60px;
    }
    
    .school-address {
        font-size: 9px;
        margin: 4px 0;
    }
    
    /* Mobile student details - horizontal scroll */
    .student-details-table {
        font-size: 10px;
        min-width: 500px; /* Smaller min-width for mobile */
    }
    
    .student-details-table td {
        padding: 2px 4px;
        font-size: 9px;
        min-width: 60px;
        white-space: nowrap;
    }
    
    .student-details-table img {
        width: 60px;
        height: 60px;
        object-fit: contain;
    }
    
    /* Mobile grade sheet */
    .grade-sheet table {
        min-width: 600px;
        font-size: 8px;
    }
    
    .grade-sheet td {
        padding: 1px 2px;
        min-width: 30px;
    }
    
    .grade-sheet table td:nth-child(2) {
        min-width: 80px;
    }
    
    /* Mobile skills - single column, full width */
    .skills {
        gap: 8px;
    }

    .skills table,
    .skills table.skills-table {
        font-size: 10px;
        margin-bottom: 8px;
        width: 100% !important;
    }

    .skills table.skills-table td.skills-sn,
    .skills table.skills-table td.skills-score,
    .skills table.skills-table td.skills-score-cell {
        padding: 3px 2px;
        font-size: 9px;
    }
    
    /* Mobile grading key (table) */
    .grading-key table {
        font-size: 10px;
    }
    
    .grading-key td {
        padding: 2px 4px;
        font-size: 9px;
    }

    .grading-key--text-block .grading-key-inline-body {
        font-size: 9px;
        line-height: 1.4;
    }

    .bos-legacy-result-sheet-title {
        font-size: 9pt;
    }

    .bos-legacy-student-details-text {
        font-size: 9px;
    }

    .bos-legacy-line {
        font-size: 9px;
    }
    
    /* Mobile overview */
    .overview table {
        font-size: 10px;
    }
    
    .overview td {
        padding: 2px 4px;
        font-size: 9px;
    }
    
    /* Mobile remarks */
    .remarks table {
        font-size: 10px;
    }
    
    .remarks td {
        padding: 2px 4px;
        font-size: 9px;
    }
    
    /* Mobile print buttons */
    .no_print {
        text-align: center;
        margin: 10px 0;
    }
    
    .no_print button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 5px;
    }
}

/* Landscape mobile orientation */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .result_body {
        padding: 5px;
        max-width: 100%;
    }
    
    .grade-sheet table {
        font-size: 9px;
    }
    
    .student-details-table {
        font-size: 10px;
    }

    .skills {
        flex-direction: column;
    }

    .skills table.skills-table {
        width: 100% !important;
    }
}

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
    .no_print button {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 15px;
        font-size: 14px;
    }
}

.remarks td:first-child {
    font-weight: 700;
}

/* Remark body text (second column and beyond) — not bold like the field label */
.remarks table td:not(:first-child) {
    font-weight: 400;
}

/* Print button styling */
.no_print {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.no_print button {
    background: #573b8a;
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no_print button:hover {
    background: #3f2a63;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.no_print button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no_print button i {
    margin-right: 8px;
}

/* Status indicators */
.passed {
    color: #28a745;
    font-weight: bold;
}

.failed {
    color: #dc3545;
    font-weight: bold;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .no_print button {
        transition: none;
    }
    
    .no_print button:hover {
        transform: none;
    }
} 