.bmh-result-search-output:not(:empty),
.bmh-latest-result-output:not([hidden]),
.mo-result-output:not([hidden]) {
    width: 100%;
    min-width: 0;
    margin-top: 14px;
    padding: clamp(14px, 2vw, 18px);
    border: 1px solid var(--bmh-border) !important;
    border-radius: var(--bmh-radius);
    background: var(--bmh-white);
    box-shadow: var(--bmh-shadow) !important;
}

.mo-result-sheet--legacy {
    width: min(100%, 1234px);
    max-width: 1234px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
}

.bmh-edmc-print-header,
.bmh-edmc-print-footer {
    display: none;
}

.mo-result-sheet--legacy > #search-result-backbtn,
.mo-result-sheet--legacy > #print-page-btn {
    display: inline-flex;
    min-height: 40px;
    margin: 0 7px 14px 0;
    padding: 8px 14px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #cfe3d8;
    border-radius: 10px;
    color: #0b4f31;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.mo-result-sheet--legacy > #search-result-backbtn {
    background: #eaf5ef;
}

.mo-result-sheet--legacy > #print-page-btn {
    border-color: #168653;
    background: #168653;
    color: #fff;
}

.mo-result-sheet--legacy > #search-result-backbtn:hover,
.mo-result-sheet--legacy > #search-result-backbtn:focus-visible {
    border-color: #168653;
    background: #dceee4;
}

.mo-result-sheet--legacy > #print-page-btn:hover,
.mo-result-sheet--legacy > #print-page-btn:focus-visible {
    border-color: #0b4f31;
    background: #0b4f31;
}

.mo-result-sheet--legacy > #search-result-backbtn:hover,
.mo-result-sheet--legacy > #print-page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(14, 74, 45, 0.14);
}

.mo-result-sheet--legacy > #search-result-backbtn:focus-visible,
.mo-result-sheet--legacy > #print-page-btn:focus-visible {
    outline: 3px solid rgba(22, 134, 83, 0.2);
    outline-offset: 2px;
}

.mo-result-sheet--legacy > #search-result-backbtn i,
.mo-result-sheet--legacy > #print-page-btn i {
    margin: 0;
}

.mo-result-sheet--legacy .dmc-header {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 12px;
    background: #0b4f31;
    color: #fff;
    font-size: 1rem;
    line-height: 1.35;
    text-align: center;
}

.mo-result-sheet--legacy .bmh-table-wrap,
.mo-result-sheet--legacy .table-responsive {
    width: 100%;
    margin-bottom: 12px;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
}

.mo-result-sheet--legacy .bmh-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: #fff;
}

.mo-result-sheet--legacy .bmh-table th,
.mo-result-sheet--legacy .bmh-table td {
    padding: 8px 9px;
    border-right: 1px solid #dce8e1;
    border-bottom: 1px solid #dce8e1;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: left;
    vertical-align: top;
}

.mo-result-sheet--legacy .bmh-table th {
    background: #eaf5ef;
    color: #0b4f31;
    font-weight: 800;
}

.mo-result-sheet--legacy .result-class-header {
    width: 100%;
    margin: 0 0 6px !important;
    padding: 8px 10px;
    border-radius: 9px;
    background: #eaf5ef;
    color: #0b4f31;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.mo-result-sheet--legacy .mo-result-parts {
    display: grid;
    width: 100%;
    margin: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    overflow: visible;
}

.mo-result-sheet--legacy .mo-result-parts > .col-md-6 {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
}

.mo-result-sheet--legacy .mo-result-parts .bmh-table th,
.mo-result-sheet--legacy .mo-result-parts .bmh-table td {
    padding: 7px 6px;
    font-size: 0.74rem;
}

.mo-result-sheet--legacy .instruct-border {
    margin: 12px 0 !important;
    padding: 10px 12px;
    border: 1px solid #ead28a;
    border-radius: 10px;
    background: #fff8df;
    color: #5d4a08;
    font-size: 0.8rem;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .mo-result-sheet--legacy .mo-result-parts {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .bmh-result-search-output:not(:empty),
    .bmh-latest-result-output:not([hidden]),
    .mo-result-output:not([hidden]) {
        margin-top: 10px;
        padding: 8px;
        border-radius: 13px;
    }

    .mo-result-sheet--legacy {
        padding: 10px;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 14mm 16mm;
    }

    html,
    body {
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
        color: #000 !important;
        font: 9pt/1.25 Arial, Helvetica, sans-serif !important;
    }

    .bmh-header,
    .bmh-topbar,
    .bmh-brandbar,
    .bmh-mainnav,
    .bmh-nav,
    .bmh-urgent,
    .bmh-ticker,
    .bmh-footer,
    .bmh-updates-dock,
    .mo-header,
    .mo-page__header,
    .mo-search-card,
    #mo-search-area,
    .mo-footer,
    .result-form-wrapper,
    .bmh-inner-title,
    .mo-result-sheet--legacy > #search-result-backbtn,
    .mo-result-sheet--legacy > #print-page-btn,
    .mo-result-sheet--legacy .modal {
        display: none !important;
    }

    .bmh-shell,
    .bmh-container,
    .content-area,
    .inner-cont,
    .mo-page,
    .mo-result-output,
    #result-show,
    .mo-result-sheet--legacy {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .mo-result-sheet--legacy,
    .mo-result-sheet--legacy *,
    .mo-result-sheet--legacy *::before,
    .mo-result-sheet--legacy *::after {
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .bmh-edmc-print-header {
        display: block !important;
        margin: 0 0 0.5mm;
        padding: 0;
        border: 0 !important;
    }

    .bmh-edmc-print-brand {
        display: flex !important;
        width: max-content;
        max-width: 100%;
        margin: 0 auto;
        align-items: center;
        justify-content: center;
        gap: 0.5mm;
        transform: translateX(-8.25mm);
        color: #000 !important;
        text-decoration: none !important;
    }

    .bmh-edmc-print-brand::after {
        display: none !important;
        content: none;
    }

    .bmh-edmc-print-brand > img {
        width: 16mm !important;
        height: 16mm !important;
        flex: 0 0 16mm;
        object-fit: contain;
    }

    .bmh-edmc-print-brand .bmh-brand-copy {
        display: grid !important;
        width: max-content;
        min-width: 0;
        align-content: center;
        text-align: center;
    }

    .bmh-edmc-print-brand strong {
        font-size: 13pt !important;
        font-weight: 700;
        line-height: 1.08;
        white-space: nowrap;
    }

    .bmh-edmc-print-brand .site-urdu-name {
        display: block !important;
        margin-top: 0.5mm;
        font-size: 12pt !important;
        line-height: 1.1;
        white-space: nowrap;
        text-align: center;
    }

    .bmh-edmc-print-footer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex !important;
        align-items: flex-end;
        justify-content: space-between;
        gap: 8mm;
        padding-top: 1.5mm;
        border-top: 1px solid #000;
        background: #fff !important;
        font-size: 7pt;
        text-align: left;
    }

    .bmh-edmc-print-footer > span {
        display: block;
        min-width: 0;
        max-width: 50%;
        overflow-wrap: anywhere;
    }

    .bmh-edmc-print-footer > span:last-child {
        text-align: right;
    }

    .mo-result-sheet--legacy .dmc-header {
        margin: 0 0 3mm;
        padding: 0;
        border: 0 !important;
        border-radius: 0;
        background: #fff !important;
        font-size: 10pt;
        line-height: 1.2;
    }

    .mo-result-sheet--legacy .bmh-table-wrap,
    .mo-result-sheet--legacy .table-responsive {
        width: 100% !important;
        margin: 0 0 2mm !important;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        break-inside: avoid;
    }

    .mo-result-sheet--legacy .bmh-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
    }

    .mo-result-sheet--legacy .bmh-table th,
    .mo-result-sheet--legacy .bmh-table td,
    .mo-result-sheet--legacy .mo-result-parts .bmh-table th,
    .mo-result-sheet--legacy .mo-result-parts .bmh-table td {
        overflow-wrap: anywhere;
        padding: 2.5px 4px;
        border-color: #000 !important;
        background: #fff !important;
        font-size: 7pt;
        line-height: 1.18;
    }

    .mo-result-sheet--legacy .mo-result-parts {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 2.5mm;
    }

    .mo-result-sheet--legacy .mo-result-parts > .col-md-6 {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .mo-result-sheet--legacy .result-class-header {
        display: block !important;
        width: 100% !important;
        margin: 0 0 1mm !important;
        padding: 2px 4px;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0;
        background: #fff !important;
        font-size: 8pt;
        line-height: 1.2;
        text-align: left;
        white-space: normal;
    }

    .mo-result-sheet--legacy .instruct-border {
        margin: 2mm 0 !important;
        padding: 4px;
        border: 1px solid #000 !important;
        border-radius: 0;
        background: #fff !important;
        font-size: 7pt;
    }

    .mo-result-sheet--legacy .failed-sub {
        font-weight: 900;
        text-decoration: underline;
    }
}
