@import url('https://fonts.googleapis.com/css2?family=Hind:wght@300;400;500;600;700&display=swap');

/* =============================================================
   Math List Hub – Styles  v2.0
   ============================================================= */

/* Hide the theme footer on pages that contain the table.
   (This stylesheet only loads where the [mlh_table] shortcode is present.) */
.site-footer { display: none !important; }
#primary { margin-top: 96px !important; }
@media (max-width: 766px) {
    #primary { margin-top: 60px !important; }
}

/* ---- Reset / Base ---- */
.mlh-wrap *,
.mlh-wrap *::before,
.mlh-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.mlh-wrap {
    --mlh-navy:     #1B3A5C;
    --mlh-teal:     #2A9D8F;
    --mlh-teal-dk:  #1f7a6e;
    --mlh-yellow:   #FFB529;
    --mlh-gray-bg:  #F7F7F5;
    --mlh-gray-bd:  #E4E4E0;
    --mlh-gray-txt: #6B6B6B;
    --mlh-dot-fill: #1B3A5C;
    --mlh-white:    #FFFFFF;
    --mlh-font:     'Hind', 'Arial', sans-serif;
    --mlh-radius:   6px;
    --mlh-shadow:   0 4px 24px rgba(0,0,0,.12);

    font-family: var(--mlh-font);
    font-size: 14px;
    color: var(--mlh-navy);
    background: var(--mlh-white);
    position: relative;
    overflow: hidden;              /* contain panels/overlays to the widget */
    margin-top: 40px;
}

/* Ensure every element (incl. buttons/inputs) uses the widget font */
.mlh-wrap,
.mlh-wrap * {
    font-family: var(--mlh-font);
}

/* =============================================================
   CONTROLS BAR
   ============================================================= */
.mlh-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 14px 8px 16px;
    border: none;
    background: var(--mlh-white);
    position: relative;
    z-index: 120;                  /* above the sticky table header */
}

/* Search */
.mlh-search-wrap {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.mlh-search-wrap input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--mlh-gray-bd);
    border-radius: 24px;
    font-size: 14px;
    font-family: var(--mlh-font);
    outline: none;
    background: var(--mlh-gray-bg);
    color: var(--mlh-navy);
    transition: border-color .2s;
}

.mlh-search-wrap input:focus {
    border-color: var(--mlh-navy);
    background: var(--mlh-white);
}

.mlh-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Autocomplete */
.mlh-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--mlh-white);
    border: 1px solid var(--mlh-gray-bd);
    border-radius: var(--mlh-radius);
    box-shadow: var(--mlh-shadow);
    z-index: 200;
    max-height: 260px;
    overflow-y: auto;
}

.mlh-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--mlh-gray-bd);
}

.mlh-autocomplete-item:last-child { border-bottom: none; }
.mlh-autocomplete-item:hover { background: var(--mlh-gray-bg); }

/* Expandable search-result items */
.mlh-ac-item { border-bottom: 1px solid var(--mlh-gray-bd); }
.mlh-ac-item:last-child { border-bottom: none; }
.mlh-ac-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
}
.mlh-ac-head:hover { background: var(--mlh-gray-bg); }
.mlh-ac-main { flex: 1; min-width: 0; }
.mlh-ac-toggle {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mlh-gray-txt);
    padding: 4px;
    display: flex;
    transition: transform .18s;
}
.mlh-ac-item.is-expanded .mlh-ac-toggle { transform: rotate(90deg); }
.mlh-ac-detail {
    padding: 4px 14px 12px;
    background: var(--mlh-gray-bg);
}
.mlh-ac-detail .mlh-sp-criteria-list { margin: 0; }

.mlh-ac-main { display: flex; flex-direction: column; gap: 2px; }

.mlh-ac-pub {
    display: block;
    font-size: 11px;
    color: var(--mlh-gray-txt);
}

.mlh-ac-name {
    display: block;
    font-weight: 600;
    color: var(--mlh-navy);
}

.mlh-ac-grade {
    display: block;
    font-size: 11px;
    color: var(--mlh-gray-txt);
}

/* Right side controls */
.mlh-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.mlh-mylist-btn,
.mlh-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-family: var(--mlh-font);
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--mlh-gray-bd);
    background: var(--mlh-white);
    color: var(--mlh-navy);
    transition: all .18s;
    white-space: nowrap;
}

.mlh-mylist-btn:hover { border-color: var(--mlh-navy); }

.mlh-filter-btn {
    background: var(--mlh-navy);
    color: var(--mlh-white);
    border-color: var(--mlh-navy);
}

.mlh-filter-btn:hover { background: #142d48; }

/* =============================================================
   TABLE
   ============================================================= */
.mlh-table-outer {
    position: relative;
    margin-top: 18px;              /* gap so the sticky header clears the search bar */
}

.mlh-table-scroll {
    overflow: auto;                 /* vertical + horizontal scroll */
    overscroll-behavior: none;      /* no rubber-band white space / chaining */
    max-height: 70vh;               /* fit the rows in between per screen size */
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--mlh-gray-bd);
    border-radius: var(--mlh-radius);
}

.mlh-table {
    width: 100%;
    border-collapse: separate;      /* required so sticky cells keep borders */
    border-spacing: 0;
    min-width: 900px;
}

/* Cell borders (separate-border model) */
.mlh-table th,
.mlh-table td {
    border-bottom: 1px solid var(--mlh-gray-bd);
}

/* --- Header --- */
.mlh-table thead tr {
    background: var(--mlh-white);
    border-bottom: 2px solid var(--mlh-gray-bd);
}

.mlh-table th {
    padding: 12px 30px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--mlh-navy);
    line-height: 18px;
    vertical-align: middle;
    position: sticky;
    top: 0;                         /* stick to top of the scroll box */
    background: var(--mlh-gray-bg); /* all header cells grey */
    z-index: 10;
    border-bottom: 2px solid var(--mlh-gray-bd);
}

/* Alternating body column shading (one white, one grey) */
.mlh-table tbody td.mlh-col-alt {
    background: var(--mlh-gray-bg);
}

/* ---- Frozen left columns (Compare + Program) ---- */
.mlh-th-select,
.mlh-td-select {
    position: sticky;
    left: 0;
    min-width: 92px;
    max-width: 92px;
    background: var(--mlh-white);
    z-index: 8;                     /* above the Program column */
    box-shadow: 6px 0 8px -6px rgba(0,0,0,.12);
}

.mlh-th-program,
.mlh-td-program {
    position: sticky;
    left: var(--mlh-select-w, 92px); /* = actual width of the Select column */
    background: var(--mlh-white);
    z-index: 6;
    box-shadow: 6px 0 8px -6px rgba(0,0,0,.12);
}

/* Top-left corner cells must sit above everything */
.mlh-table thead .mlh-th-select {
    z-index: 22;
}
.mlh-table thead .mlh-th-program {
    z-index: 20;
}

/* Keep frozen cells opaque on hover / selection */
.mlh-table tbody tr:hover .mlh-td-select,
.mlh-table tbody tr:hover .mlh-td-program {
    background: #F0F4F8;
}
.mlh-table tbody tr.mlh-row-selected .mlh-td-select,
.mlh-table tbody tr.mlh-row-selected .mlh-td-program {
    background: #FFF8E6;
}

.mlh-th-select {
    width: 92px;
    text-align: center;
    font-size: 11px;
    color: var(--mlh-gray-txt);
}

/* Override the wide global TH padding so the label isn't pushed out */
.mlh-table th.mlh-th-select {
    padding: 10px 8px;
}

.mlh-select-note { display: none; }

/* Hidden for now */
/* (View Publisher Materials is shown) */

.mlh-th-program {
    text-align: left;
    min-width: 280px;
    padding-left: 14px;
}

.mlh-th-criteria {
    min-width: 190px;
    max-width: 190px;
    width: 190px;
    position: relative;
}

/* LMS Integration column hidden */
.mlh-table th[data-col="lms_integration"],
.mlh-table td[data-col="lms_integration"] {
    display: none;
}

/* keep the dot cells aligned to the same width */
.mlh-td-dot {
    min-width: 190px;
}

.mlh-th-label {
    display: inline;
    font-size: 14px;
    line-height: 18px;
}

/* Tooltip button */
.mlh-tooltip-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mlh-gray-txt);
    padding: 0;
    margin: 0;
    vertical-align: middle;
    position: relative;
}
.mlh-tooltip-btn:hover { color: var(--mlh-navy); }

/* Floating tooltip — appended to <body>, position:fixed so it is never
   clipped by the scrolling table container. Positioned by JS. */
/* Floating tooltip — core look is applied inline via JS (see mlh-scripts.js)
   so theme/cache conflicts can't break it. This block is a harmless fallback. */
.mlh-tip-float {
    position: fixed;
    z-index: 99999;
    max-width: 300px;
    pointer-events: none;
}

/* --- Rows --- */
.mlh-table tbody tr {
    border-bottom: 1px solid var(--mlh-gray-bd);
    transition: background .12s;
}

.mlh-table tbody tr:hover {
    background: #F0F4F8;
}

.mlh-table tbody tr.mlh-row-selected {
    background: #FFF8E6;
    border-color: #E8C44A;
    outline: 1px solid #E8C44A;
}

/* All cells of a selected row need a solid background so they stay opaque
   when pinned (sticky) over the scrolling rows below. */
.mlh-table tbody tr.mlh-row-selected td {
    background: #FFF8E6;
}

/* Subtle divider beneath the last pinned row */
.mlh-table tbody tr.mlh-row-pinned-last td {
    box-shadow: inset 0 -2px 0 #E8C44A;
}

/* Select cell */
.mlh-td-select {
    text-align: center;
    padding: 14px 8px;
}

.mlh-compare-cb {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--mlh-navy);
}

/* Program cell */
.mlh-td-program {
    padding: 14px 14px 14px 14px;
    vertical-align: middle;
}

.mlh-publisher-sub {
    display: block;
    font-size: 11px;
    color: var(--mlh-gray-txt);
    margin-bottom: 2px;
}

.mlh-program-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--mlh-navy);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--mlh-font);
    text-decoration: none;
    transition: color .15s;
    line-height: 1.4;
}

.mlh-program-name:hover { color: var(--mlh-teal); text-decoration: underline; }

.mlh-grade-sub {
    display: block;
    font-size: 11px;
    color: var(--mlh-gray-txt);
    margin-top: 2px;
}

/* Dot cells */
.mlh-td-dot {
    text-align: center;
    padding: 12px 8px;
    vertical-align: middle;
}

.mlh-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mlh-dot-na {
    font-size: 18px;
    color: var(--mlh-gray-txt);
    font-weight: 400;
    line-height: 1;
}

/* =============================================================
   KEY BAR
   ============================================================= */
.mlh-key-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 16px;
    border-top: 1px solid var(--mlh-gray-bd);
    font-size: 12px;
    color: var(--mlh-navy);
    background: var(--mlh-white);
    flex-wrap: wrap;
    min-height: 0;
}

.mlh-key-label {
    font-weight: 700;
    padding-right: 8px;
    border-right: 1px solid var(--mlh-gray-bd);
}

.mlh-key-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mlh-key-na {
    color: var(--mlh-gray-txt);
}

.mlh-key-updated {
    margin-left: auto;
    font-size: 11px;
    color: var(--mlh-gray-txt);
    font-weight: 600;
    letter-spacing: .04em;
}

/* =============================================================
   COMPARE BAR
   ============================================================= */
.mlh-compare-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 108px;                  /* fixed — independent of the info text */
    overflow: hidden;
    background: var(--mlh-navy);
    color: var(--mlh-white);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 500;
    flex-wrap: nowrap;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}

.mlh-compare-bar-left {
    flex: 0 0 260px;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    font-size: 13px;
    line-height: 1.35;
}

.mlh-compare-info {
    font-size: 12px;
    color: rgba(255,255,255,.75);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mlh-compare-sub {
    font-size: 14px;
    font-weight: 700;
    color: var(--mlh-white);
}

.mlh-compare-slots {
    display: flex;
    gap: 10px;
    flex: 1 1 auto;                /* fill all space so nothing is left empty on the right */
    align-items: center;           /* fixed-height slots, not stretched */
    flex-wrap: nowrap;
    min-width: 0;
}

.mlh-slot {
    background: var(--mlh-white);
    border-radius: var(--mlh-radius);
    padding: 6px 30px 6px 14px;
    flex: 1 1 0;                   /* equal widths, spread to fill the bar */
    width: auto;
    max-width: none;
    min-width: 0;
    height: 80px;                  /* fixed — independent of the info text */
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.mlh-slot-pub {
    font-size: 11px;
    color: var(--mlh-gray-txt);
    display: block;
}

.mlh-slot-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--mlh-navy);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 15px;
}

.mlh-slot-grade {
    font-size: 11px;
    color: var(--mlh-teal);
    display: block;
    margin-top: 2px;
}

.mlh-slot-remove {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--mlh-gray-txt);
    line-height: 1;
    padding: 2px;
}

.mlh-slot-empty {
    background: rgba(255,255,255,.12);
    border-radius: var(--mlh-radius);
    padding: 6px 14px;
    flex: 1 1 0;                   /* equal widths, spread to fill the bar */
    width: auto;
    max-width: none;
    min-width: 0;
    height: 80px;                  /* fixed — matches filled slots */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    font-size: 13px;
    text-align: center;
    gap: 4px;
    border: 1.5px dashed rgba(255,255,255,.3);
}

.mlh-slot-empty .mlh-slot-plus {
    font-size: 22px;
    line-height: 1;
    color: rgba(255,255,255,.5);
}

.mlh-compare-action-btn {
    background: var(--mlh-yellow);
    color: var(--mlh-navy);
    border: none;
    border-radius: var(--mlh-radius);
    padding: 12px 16px;
    flex: 0 0 130px;               /* fixed — Compare + View Summary same width */
    width: 130px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--mlh-font);
    transition: background .18s;
}

.mlh-compare-action-btn:hover:not(:disabled) { background: #e0b020; }
.mlh-compare-action-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* =============================================================
   OVERLAY
   ============================================================= */
.mlh-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 600;
}

/* =============================================================
   FILTER PANEL
   ============================================================= */
.mlh-filter-panel {
    position: absolute;
    top: 0;
    right: -480px;
    bottom: 0;
    width: 460px;
    max-width: 100%;
    background: var(--mlh-white);
    z-index: 700;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    transition: right .3s ease;
}

.mlh-filter-panel.mlh-panel-open {
    right: 0;
}

.mlh-filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--mlh-gray-bd);
}

.mlh-filter-panel-head h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--mlh-navy);
}

.mlh-filter-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mlh-filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.mlh-filter-col h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--mlh-navy);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.mlh-filter-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--mlh-navy);
    margin-bottom: 10px;
    cursor: pointer;
    line-height: 1.4;
}

.mlh-filter-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--mlh-navy);
    cursor: pointer;
}

.mlh-filter-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--mlh-gray-bd);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.mlh-filter-panel-footer .mlh-btn-outline,
.mlh-filter-panel-footer .mlh-btn-primary {
    flex: 1 1 0;
}
.mlh-filter-download-btn {
    flex: 1 1 100%;
    justify-content: center;
    border: 1px solid var(--mlh-gray-bd);
    border-radius: var(--mlh-radius);
    padding: 10px;
}

/* =============================================================
   SUMMARY PANEL
   ============================================================= */
.mlh-summary-panel {
    position: absolute;
    top: 0;
    right: -420px;
    bottom: 0;
    width: 400px;
    max-width: 100%;
    background: var(--mlh-white);
    z-index: 700;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    transition: right .3s ease;
}

.mlh-summary-panel.mlh-panel-open {
    right: 0;
}

.mlh-summary-panel-head {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--mlh-gray-bd);
}

.mlh-summary-panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.mlh-sp-publisher {
    font-size: 12px;
    color: var(--mlh-gray-txt);
    margin-bottom: 4px;
}

.mlh-sp-program {
    font-size: 18px;
    font-weight: 700;
    color: var(--mlh-navy);
    line-height: 1.3;
    margin-bottom: 4px;
}

.mlh-sp-grade {
    font-size: 12px;
    color: var(--mlh-gray-txt);
}

.mlh-summary-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mlh-sp-criteria-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.mlh-sp-criteria-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 13px;
    color: var(--mlh-navy);
    border-bottom: 1px solid var(--mlh-gray-bd);
    line-height: 1.4;
}

.mlh-sp-criteria-list li:last-child { border-bottom: none; }

.mlh-sp-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.mlh-sp-dot-yes { background: var(--mlh-dot-fill); }
.mlh-sp-dot-no  { background: transparent; border: 1.5px solid #aaa; }
.mlh-sp-dot-na  { background: transparent; }

.mlh-sp-dot-na-text {
    font-size: 12px;
    color: var(--mlh-gray-txt);
    flex-shrink: 0;
    margin-top: 0;
    width: 12px;
    text-align: center;
}

.mlh-sp-criteria-label { color: var(--mlh-navy); }
.mlh-sp-criteria-label.is-no { color: var(--mlh-gray-txt); }

.mlh-sp-validation {
    font-size: 13px;
    font-weight: 600;
    color: var(--mlh-navy);
    margin-top: 12px;
}

.mlh-summary-panel-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--mlh-gray-bd);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =============================================================
   COMPARE VIEW (full overlay)
   ============================================================= */
.mlh-compare-view {
    position: absolute;
    inset: 0;
    background: var(--mlh-white);
    z-index: 800;
    overflow-y: auto;
    padding: 0 24px 24px 24px;
}

.mlh-compare-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.mlh-compare-card {
    border: 1px solid var(--mlh-gray-bd);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mlh-compare-card-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--mlh-gray-bd);
}

.mlh-compare-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.mlh-compare-card-pub {
    font-size: 11px;
    color: var(--mlh-gray-txt);
    display: block;
    margin-bottom: 4px;
}

.mlh-compare-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--mlh-navy);
    display: block;
    margin-bottom: 2px;
}

.mlh-compare-card-grade {
    font-size: 12px;
    color: var(--mlh-gray-txt);
    display: block;
}

.mlh-compare-card-body {
    flex: 1;
    padding: 16px;
}

.mlh-compare-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.mlh-compare-card-body li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.4;
    border-bottom: 1px solid var(--mlh-gray-bd);
}

.mlh-compare-card-body li:last-child { border-bottom: none; }

.mlh-compare-validation {
    font-size: 13px;
    font-weight: 600;
    color: var(--mlh-navy);
    margin-top: 8px;
}

.mlh-compare-card-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--mlh-gray-bd);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mlh-compare-view-close {
    position: static;
    background: var(--mlh-white);
    border: 1px solid var(--mlh-gray-bd);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 810;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* =============================================================
   BUTTONS
   ============================================================= */
.mlh-btn-primary {
    background: var(--mlh-teal);
    color: var(--mlh-white);
    border: none;
    border-radius: var(--mlh-radius);
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--mlh-font);
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: background .18s;
}

.mlh-btn-primary:hover { background: var(--mlh-teal-dk); }

.mlh-btn-outline {
    background: transparent;
    color: var(--mlh-teal);
    border: 1.5px solid var(--mlh-teal);
    border-radius: var(--mlh-radius);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--mlh-font);
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: all .18s;
}

.mlh-btn-outline:hover { background: var(--mlh-teal); color: var(--mlh-white); }

.mlh-link-btn {
    background: none;
    border: none;
    color: var(--mlh-teal);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--mlh-font);
    padding: 0;
    text-align: center;
    text-decoration: underline;
}

.mlh-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mlh-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background .15s;
}

.mlh-icon-btn:hover { background: var(--mlh-gray-bg); }

/* =============================================================
   DOWNLOAD BANNER
   ============================================================= */
.mlh-download-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--mlh-navy);
    color: var(--mlh-white);
    font-size: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.mlh-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mlh-yellow);
    color: var(--mlh-navy);
    border: none;
    border-radius: var(--mlh-radius);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--mlh-font);
    transition: background .18s;
}

/* Compact "Download Report" button (summary panel + compare view) */
.mlh-download-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--mlh-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--mlh-font);
    padding: 6px 8px;
    white-space: nowrap;
}
.mlh-download-report-btn:hover { color: var(--mlh-teal); }

.mlh-download-btn:hover { background: #e0b020; }

/* =============================================================
   NO RESULTS
   ============================================================= */
.mlh-no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--mlh-gray-txt);
    font-size: 15px;
}

/* =============================================================
   ADD CURRICULUM POPUP
   ============================================================= */
.mlh-add-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, 92%);
    max-height: 90%;
    background: var(--mlh-white);
    border-radius: 10px;
    box-shadow: var(--mlh-shadow);
    z-index: 750;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.mlh-add-modal.mlh-modal-open { display: flex; }

.mlh-add-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--mlh-gray-bd);
}
.mlh-add-modal-head h2 { font-size: 17px; font-weight: 700; }

.mlh-add-modal-search {
    position: relative;
    padding: 16px 22px;
}
.mlh-add-modal-search .mlh-search-icon { left: 34px; }
.mlh-add-modal-search input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--mlh-gray-bd);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--mlh-font);
}

.mlh-add-modal-body { overflow-y: auto; padding: 0 22px 18px; }

/* Grade filter tabs */
.mlh-add-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 22px 14px;
    border-bottom: 1px solid var(--mlh-gray-bd);
    margin-bottom: 4px;
}
.mlh-add-tab {
    border: 1px solid var(--mlh-gray-bd);
    background: var(--mlh-white);
    color: var(--mlh-navy);
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 13px;
    font-family: var(--mlh-font);
    cursor: pointer;
    transition: all .15s;
}
.mlh-add-tab:hover { border-color: var(--mlh-teal); }
.mlh-add-tab.is-active {
    background: var(--mlh-teal);
    color: var(--mlh-white);
    border-color: var(--mlh-teal);
}
.mlh-add-list { list-style: none; margin: 0; padding: 0; }
.mlh-add-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 6px;
    border-bottom: 1px solid var(--mlh-gray-bd);
    cursor: pointer;
}
.mlh-add-list li:hover { background: var(--mlh-gray-bg); }
.mlh-add-list li.is-disabled { opacity: .45; cursor: not-allowed; }
.mlh-add-list .mlh-add-pub   { font-size: 11px; color: var(--mlh-gray-txt); }
.mlh-add-list .mlh-add-name  { font-weight: 700; }
.mlh-add-list .mlh-add-grade { font-size: 11px; color: var(--mlh-gray-txt); }

/* Empty compare slot becomes obviously clickable */
.mlh-slot-empty { cursor: pointer; }

/* Compare-view header bar */
.mlh-compare-view-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 26px;
    margin-bottom: 20px;
    background: var(--mlh-white);
    border-bottom: 1px solid var(--mlh-gray-bd);
    z-index: 2;
}
.mlh-compare-view-head h2 { font-size: 18px; font-weight: 700; }
.mlh-compare-view-head-actions { display: flex; align-items: center; gap: 14px; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
/* Mid-range: let the compare bar wrap gracefully instead of cramming
   the 400px info block next to the slots (fixes the awkward breakpoint). */
@media (max-width: 768px) {
    .mlh-th-select,
    .mlh-td-select,
    .mlh-th-program,
    .mlh-td-program,
    .mlh-table th {
        position: static !important;
        left: auto !important;
        top: auto !important;
        box-shadow: none;
    }

    /* Mobile hugs content and free-scrolls (no full-height fill) */
    .mlh-wrap {
        height: auto;
        min-height: 0;
    }
    .mlh-table-outer {
        flex: 0 0 auto;
    }
    .mlh-table {
        min-width: 0;
        width: auto;
    }
    .mlh-table-scroll {
        flex: 0 0 auto;
        min-height: 0;
        max-height: 74vh;
    }

    /* Compact columns so several fit with horizontal scroll */
    .mlh-th-program,
    .mlh-td-program {
        min-width: 170px;
        width: 170px;
    }
    .mlh-th-criteria,
    .mlh-td-dot {
        min-width: 115px;
        max-width: 115px;
        width: 115px;
    }
    .mlh-table th,
    .mlh-table td {
        padding: 10px 12px;
    }
    .mlh-program-name { font-size: 13px; }
    .mlh-publisher-sub,
    .mlh-grade-sub { font-size: 11px; }

    /* Controls on one row: full-width search + compact buttons */
    .mlh-controls {
        flex-wrap: nowrap;
        gap: 8px;
    }
    .mlh-search-wrap {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }
    .mlh-controls-right {
        flex: 0 0 auto;
        gap: 8px;
    }
    .mlh-mylist-btn,
    .mlh-filter-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    /* Download Report = icon only on mobile to save room */
    .mlh-download-list-btn .mlh-dl-label { display: none; }
    .mlh-download-list-btn { padding: 8px 6px; }

    /* KEY + LAST UPDATED on a single row */
    .mlh-key-bar {
        gap: 5px;
        font-size: 9px;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
        padding: 5px 12px;
    }
    .mlh-key-bar .mlh-key-item,
    .mlh-key-label { white-space: nowrap; }
    .mlh-key-updated {
        width: auto;
        margin-left: auto;
        text-align: right;
        white-space: nowrap;
        font-size: 9px;
    }

    /* Panels leave a strip of the table visible on the left */
    .mlh-filter-panel,
    .mlh-summary-panel {
        width: calc(100% - 48px);
        right: -100%;
    }
    .mlh-filter-panel.mlh-panel-open,
    .mlh-summary-panel.mlh-panel-open {
        right: 0;
    }
    .mlh-filter-panel-body {
        grid-template-columns: 1fr;
    }

    /* Compare bar: text + action button on row 1, slots stacked on row 2 */
    .mlh-compare-bar {
        flex-wrap: wrap;
        padding: 14px 16px;
        gap: 12px;
        height: auto;
        overflow: visible;
    }
    .mlh-compare-bar-left {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: none;
        order: 0;
    }
    .mlh-compare-action-btn {
        order: 1;
        flex: 0 0 auto;
    }
    .mlh-compare-slots {
        order: 2;
        width: 100%;
        flex-direction: column;
        max-height: 38vh;
        overflow-y: auto;
    }
    .mlh-slot,
    .mlh-slot-empty {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        padding: 7px 30px 7px 12px;
    }
    .mlh-slot-empty { padding: 8px 12px; }
    .mlh-compare-bar { padding: 12px 14px; }
}
