:root {
    --green: #39705c;
    --green-dark: #245342;
    --green-soft: #e8f0eb;
    --accent: #d96845;
    --ink: #202c27;
    --muted: #64716b;
    --line: #dde5e0;
    --bg: #f7f3ea;
    --white: #fff;
    --radius: 16px;
    --shadow: 0 10px 28px rgba(36, 83, 66, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
}

button,
input,
select {
    font: inherit;
}

a {
    color: var(--green);
}

.mo-shell {
    width: min(calc(100% - 80px), 1479px);
    margin-inline: auto;
}

.mo-header {
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.mo-header__inner {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.mo-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: var(--green-dark);
    text-decoration: none;
}

.mo-brand img {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    object-fit: contain;
}

.mo-brand span {
    display: grid;
    min-width: 0;
}

.mo-brand strong {
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    line-height: 1.2;
}

.mo-brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.75rem;
}

.mo-header__links {
    display: flex;
    gap: 8px;
}

.mo-header__links a {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.mo-header__links a:hover,
.mo-header__links a:focus-visible {
    border-color: var(--green);
    background: var(--green);
    color: var(--white);
}

.mo-page {
    padding: 16px 0 32px;
}

.mo-page__header {
    margin: 0 0 12px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(36, 83, 66, 0.08);
}

.mo-page__header > span {
    display: block;
    margin-bottom: 3px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.mo-page__header h1 {
    margin: 0;
    color: var(--green-dark);
    font-size: clamp(1.25rem, 1.8vw, 1.7rem);
    font-weight: 650;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.mo-page__header p {
    max-width: 780px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.mo-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.mo-search-card {
    width: min(100%, 620px);
    margin: 0 auto 0 0;
    padding: 16px;
}

.mo-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 12px;
    background: var(--green-soft);
}

.mo-tabs button {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--green-dark);
    cursor: pointer;
    font-weight: 750;
}

.mo-tabs button[aria-selected="true"] {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(20, 108, 67, 0.2);
}

.mo-result-panel[hidden],
[hidden] {
    display: none !important;
}

.mo-search-card__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.mo-search-card__heading > span {
    display: inline-flex;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 850;
}

.mo-search-card__heading h2 {
    margin: 0;
    color: var(--green-dark);
    font-size: 1rem;
}

.mo-search-card__heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.mo-result-form {
    display: grid;
    gap: 7px;
}

.mo-result-form label {
    margin-top: 3px;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 750;
}

.mo-result-form input,
.mo-result-form select {
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid #cfded5;
    border-radius: 10px;
    background: var(--white);
    color: var(--ink);
    outline: 0;
}

.mo-result-form input:focus,
.mo-result-form select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(20, 108, 67, 0.12);
}

.mo-form-actions,
.mo-result-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mo-form-actions {
    margin-top: 8px;
}

.mo-form-actions button,
.mo-result-toolbar button {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--green);
    border-radius: 9px;
    background: var(--green);
    color: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 750;
}

.mo-form-actions button.is-secondary,
.mo-result-toolbar button.is-secondary {
    border-color: var(--line);
    background: var(--green-soft);
    color: var(--green-dark);
}

.mo-form-actions button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.mo-errors {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #efc2bb;
    border-radius: 10px;
    background: #fff1ef;
    color: #8f3024;
    font-size: 0.82rem;
}

.mo-errors ul {
    margin: 0;
    padding-left: 18px;
}

.mo-loading {
    padding: 30px;
    color: var(--green-dark);
    font-weight: 750;
    text-align: center;
}

.mo-loading::before {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 3px solid var(--line);
    border-top-color: var(--green);
    border-radius: 50%;
    content: "";
    vertical-align: -4px;
    animation: mo-spin 0.75s linear infinite;
}

@keyframes mo-spin {
    to {
        transform: rotate(360deg);
    }
}

.mo-result-output {
    width: 100%;
}

.mo-result-output:not([hidden]) {
    width: 100%;
    min-width: 0;
    margin-top: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.mo-result-sheet {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

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

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

.mo-result-sheet--legacy > #search-result-backbtn,
.mo-result-sheet--legacy > #print-page-btn {
    min-height: 38px;
    margin: 0 5px 12px 0;
    padding: 8px 13px;
    border: 1px solid var(--green);
    border-radius: 9px;
    background: var(--green);
    color: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 750;
}

.mo-result-sheet--legacy > #search-result-backbtn {
    border-color: var(--line);
    background: var(--green-soft);
    color: var(--green-dark);
}

.mo-result-sheet--legacy .dmc-header {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--green-dark);
    color: var(--white);
    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: 1px solid var(--line);
    border-radius: 11px;
}

.mo-result-sheet--legacy .bmh-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: var(--white);
}

.mo-result-sheet--legacy .bmh-table th,
.mo-result-sheet--legacy .bmh-table td {
    padding: 7px 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: left;
    vertical-align: top;
}

.mo-result-sheet--legacy .bmh-table th {
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 800;
}

.mo-result-sheet--legacy .bmh-table tr:last-child > * {
    border-bottom: 0;
}

.mo-result-sheet--legacy .bmh-table tr > *:last-child {
    border-right: 0;
}

.mo-result-sheet--legacy .vertical-table th {
    width: 18%;
}

.mo-result-sheet--legacy .vertical-table td {
    width: 32%;
}

.mo-result-sheet--legacy .result-class-header {
    margin: 0 0 6px;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.mo-result-sheet--legacy .mo-result-parts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

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

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

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

.mo-result-sheet--legacy .failed-sub {
    color: #b72e20;
    font-weight: 800;
}

.mo-result-sheet--legacy .search-res-text {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.8rem;
}

.mo-result-sheet--legacy .modal {
    display: none;
}

.mo-result-toolbar {
    justify-content: flex-end;
    margin-bottom: 12px;
}

.mo-result-heading {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--green-dark);
    color: var(--white);
    text-align: center;
}

.mo-result-heading strong,
.mo-result-heading span {
    display: block;
}

.mo-result-heading strong {
    font-size: 1rem;
}

.mo-result-heading span {
    margin-top: 3px;
    font-size: 0.76rem;
    opacity: 0.9;
}

.mo-table-wrap {
    width: 100%;
    margin-bottom: 12px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.mo-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.mo-table th,
.mo-table td {
    padding: 8px 9px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 0.76rem;
    text-align: left;
    vertical-align: top;
}

.mo-table th {
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 800;
}

.mo-table tr:last-child > * {
    border-bottom: 0;
}

.mo-table tr > *:last-child {
    border-right: 0;
}

.mo-table--details {
    min-width: 640px;
}

.mo-result-section-title {
    margin: 16px 0 7px;
    color: var(--green-dark);
    font-size: 0.92rem;
}

.mo-result-notice {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #ead28a;
    border-radius: 10px;
    background: #fff8df;
    color: #5d4a08;
    font-size: 0.75rem;
}

.mo-failed {
    color: #b72e20;
    font-weight: 800;
}

.mo-countdown-card {
    position: relative;
    width: min(100%, 760px);
    margin: 0 auto 0 0;
    padding: 24px;
    overflow: hidden;
    text-align: center;
}

.mo-countdown-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--accent);
    content: "";
}

.mo-countdown-card__head > span {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mo-countdown-card h2 {
    margin: 0;
    color: var(--green-dark);
    font-size: 1.08rem;
    font-weight: 650;
}

.mo-countdown-card__head p {
    margin: 4px 0 18px;
    color: var(--muted);
    font-size: 0.76rem;
}

.mo-countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mo-countdown div {
    position: relative;
    padding: 15px 6px 13px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--white), var(--green-soft));
}

.mo-countdown div::after {
    position: absolute;
    right: 18%;
    bottom: 0;
    left: 18%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--green);
    content: "";
}

.mo-countdown strong,
.mo-countdown span {
    display: block;
}

.mo-countdown strong {
    color: var(--green-dark);
    font-size: clamp(1.3rem, 5vw, 2rem);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    line-height: 1.15;
}

.mo-countdown span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mo-footer {
    padding: 16px 0 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

@media (max-width: 600px) {
    .mo-shell {
        width: min(calc(100% - 18px), 980px);
    }

    .mo-header__inner {
        min-height: 74px;
    }

    .mo-brand img {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }

    .mo-brand small,
    .mo-header__links a:first-child {
        display: none;
    }

    .mo-header__links a {
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .mo-page {
        padding-top: 12px;
    }

    .mo-page__header,
    .mo-search-card,
    .mo-result-sheet {
        padding: 12px;
        border-radius: 13px;
    }

    .mo-countdown-card {
        padding: 18px 12px 14px;
    }

    .mo-countdown {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    .mo-countdown div {
        padding: 12px 2px 10px;
        border-radius: 9px;
    }

    .mo-countdown strong {
        font-size: clamp(1.05rem, 7vw, 1.45rem);
    }

    .mo-countdown span {
        font-size: 0.52rem;
        letter-spacing: 0.03em;
    }

    .mo-result-output:not([hidden]) {
        margin-top: 10px;
        padding: 8px;
        border-radius: 13px;
    }

    .mo-result-output:not([hidden]) > .mo-result-sheet--legacy {
        padding: 10px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .mo-form-actions button {
        flex: 1 1 0;
    }

    .mo-result-sheet--legacy .mo-result-parts {
        grid-template-columns: 1fr;
    }

    .mo-result-sheet--legacy .vertical-table {
        min-width: 600px;
    }

    .mo-result-sheet--legacy .horizontal-table {
        min-width: 620px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    @page {
        margin: 8mm;
        size: A4 portrait;
    }

    body {
        background: #fff !important;
        color: #000;
        font-size: 9pt;
    }

    .mo-header,
    .mo-page__header,
    .mo-search-card,
    .mo-result-toolbar,
    .mo-footer {
        display: none !important;
    }

    .mo-shell,
    .mo-result-output {
        width: 100%;
        max-width: none;
    }

    .mo-page {
        padding: 0;
    }

    .mo-result-sheet {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: #fff !important;
        box-shadow: none;
    }

    .mo-result-heading {
        border: 1px solid #000;
        background: #fff;
        color: #000;
    }

    .mo-table-wrap {
        overflow: visible;
        break-inside: avoid;
        border-color: #777;
    }

    .mo-table {
        min-width: 0;
    }

    .mo-table th,
    .mo-table td {
        padding: 5px 6px;
        border-color: #999;
        font-size: 8.5pt;
    }

    .mo-table th {
        background: #eee !important;
        color: #000;
        print-color-adjust: exact;
    }

    .mo-result-notice {
        border-color: #777;
        background: #fff;
        color: #000;
    }

    .mo-result-sheet--legacy > #search-result-backbtn,
    .mo-result-sheet--legacy > #print-page-btn,
    .mo-result-sheet--legacy .modal {
        display: 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: flex !important;
        align-items: center;
        justify-content: center;
        gap: 4mm;
        margin-bottom: 4mm;
        padding-bottom: 3mm;
        border-bottom: 1.5px solid #000;
        text-align: left;
    }

    .bmh-edmc-print-header img {
        width: 17mm;
        height: 17mm;
        object-fit: contain;
    }

    .bmh-edmc-print-header div {
        display: grid;
    }

    .bmh-edmc-print-header strong {
        font-size: 13pt;
        line-height: 1.2;
    }

    .bmh-edmc-print-header span {
        margin-top: 1mm;
        font-size: 8pt;
    }

    .bmh-edmc-print-footer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        display: block !important;
        padding-top: 2mm;
        border-top: 1px solid #000;
        background: #fff !important;
        font-size: 7pt;
        text-align: right;
    }

    .mo-result-sheet--legacy .dmc-header,
    .mo-result-sheet--legacy .result-class-header,
    .mo-result-sheet--legacy .bmh-table th,
    .mo-result-sheet--legacy .bmh-table td,
    .mo-result-sheet--legacy .instruct-border {
        border-color: #000 !important;
        background: #fff !important;
    }

    .mo-result-sheet--legacy .dmc-header {
        padding: 5px;
        font-size: 10pt;
    }

    .mo-result-sheet--legacy .bmh-table-wrap,
    .mo-result-sheet--legacy .table-responsive {
        overflow: visible;
        margin-bottom: 5px;
        border-color: #000;
        break-inside: avoid;
    }

    .mo-result-sheet--legacy .bmh-table {
        min-width: 0;
        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: 3px 4px;
        border-color: #000;
        font-size: 6.5pt;
        line-height: 1.2;
    }

    .mo-result-sheet--legacy .vertical-table th,
    .mo-result-sheet--legacy .vertical-table td {
        width: auto;
    }

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

    .mo-result-sheet--legacy .result-class-header {
        margin-bottom: 3px;
        padding: 4px;
        font-size: 8pt;
    }

    .mo-result-sheet--legacy .instruct-border {
        padding: 5px;
        font-size: 7pt;
    }

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