/* Keep the filters and benchmark comparison in equal, independently sized columns. */
.moat-list-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.moat-list-overview > * { min-width: 0; }
.moat-list-overview .control-card { align-content: start; }
.moat-list-overview .grade-filters { flex-wrap: wrap; overflow: visible; }
.moat-list-overview #homeComparison { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.moat-list-overview .section-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.moat-list-overview .hc-weighting-wrap { margin: 0; gap: 12px; }
.moat-list-overview .hc-chart-card { padding: 0; border-radius: 0; }
.moat-list-overview .hc-panel-heading h3 { display: flex; width: 100%; gap: 8px; align-items: stretch; }
.moat-list-overview .hc-panel-heading :is(.hc-title-bm, .hc-title-moat, .hc-title-my) { display: flex; flex-direction: column; align-items: flex-start; flex: 1 1 0; min-width: 0; padding: 10px; border-radius: 12px; background: #f4f7fc; font-size: 11px; gap: 8px; }
.moat-list-overview .hc-panel-heading .hc-title-moat { background: #eef6ef; }
.moat-list-overview .hc-panel-heading .hc-title-my { background: #f6f3fc; }
.moat-list-overview .hc-panel-heading .hc-title-my[hidden] { display: none; }
.moat-list-overview .hc-panel-heading .hc-vs { display: none; }
.moat-list-overview :is(.hc-val-bm, .hc-val-moat, .hc-val-my) { font-size: 24px; }
.moat-list-overview .hc-chart { height: 170px; }
.moat-list-overview .hc-weightings button[aria-pressed="true"],
.moat-list-overview .hc-ranges button[aria-pressed="true"] { background: #205c3e; color: #fff; }
@media (max-width: 900px) {
    .moat-list-overview { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
    .moat-list-overview #homeComparison { padding: 14px; }
    .moat-list-overview .hc-weighting-wrap { flex-basis: auto; }
    .moat-list-overview .hc-panel-heading .hc-title-my { flex-basis: 100%; }
}

/* Compact controls and chart keep the comparison close to the filter card height. */
.moat-list-overview .hc-control > span { display: none; }
.moat-list-overview .hc-weighting-wrap { gap: 8px; }
.moat-list-overview .hc-weightings { padding: 3px; border-radius: 9px; }
.moat-list-overview .hc-weightings button { padding: 5px 10px; font-size: 11px; }
.moat-list-overview .hc-panel-heading { margin-bottom: 10px; }
.moat-list-overview .hc-panel-heading :is(.hc-title-bm, .hc-title-moat) { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 6px; }
.moat-list-overview :is(.hc-val-bm, .hc-val-moat) { font-size: 22px; }
.moat-list-overview .hc-ranges-wrap { margin-bottom: 6px; }
.moat-list-overview .hc-ranges { width: 100%; }
.moat-list-overview .hc-ranges button { flex: 1; padding: 5px 2px; font-size: 11px; }
.moat-list-overview .hc-sector-details { margin-top: 8px; }
.moat-list-overview .hc-sector-details > summary { padding: 6px 0 0; }
.moat-list-overview .hc-sector-heading h4 { font-size: 12px; color: #64748b; font-weight: 600; }
.moat-list-overview .hc-sector-toggle { font-size: 11px; }
.moat-list-overview .hc-status { min-height: 260px; }

/* Plain search field and compact filter chips. */
.moat-list-overview .control-card { padding: 16px; gap: 14px; border-radius: 14px; box-shadow: none; }
.moat-list-overview .search-wrap input { min-height: 40px; padding: 0 36px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; font-size: 13px; font-weight: 500; }
.moat-list-overview .search-wrap input:focus-visible { border-color: #8aa8ca; outline: 2px solid #e7eff8; }
.moat-list-overview .search-icon { left: 12px; font-size: 19px; }
.moat-list-overview .clear-button { right: 10px; }
.moat-list-overview .filter-row { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.moat-list-overview .filter-label { padding-top: 7px; font-size: 12px; font-weight: 500; }
.moat-list-overview .grade-filters { gap: 6px; }
.moat-list-overview .grade-filters button,
.moat-list-overview #countryFilters button,
.moat-list-overview #gradeFilters button { min-width: 0; min-height: 30px; padding: 5px 9px; border: 1px solid #e5e8ef; border-radius: 6px; background: #fff; color: #596579; font-size: 12px; line-height: 1.4; font-weight: 500; white-space: nowrap; }
.moat-list-overview .grade-filters button:hover { background: #f5f7fa; border-color: #cbd5e1; }
.moat-list-overview .grade-filters button.active { background: #edf4ff; color: #2563a6; border-color: #b9d2f3; font-weight: 600; }
.moat-list-overview .grade-filters button:focus-visible { outline: 2px solid #8aa8ca; outline-offset: 2px; }
@media (max-width: 600px) {
    .moat-list-overview .control-card { padding: 12px; gap: 10px; }
    .moat-list-overview .filter-row { gap: 6px; }
    .moat-list-overview .grade-filters { gap: 5px; }
}

/* Match the two desktop panels and use the same quiet visual treatment. */
@media (min-width: 901px) {
    .moat-list-overview { align-items: stretch; }
    .moat-list-overview > .control-card,
    .moat-list-overview > #homeComparison { align-self: stretch; }
}
.moat-list-overview #homeComparison { padding: 16px; border-radius: 14px; box-shadow: none; }
.moat-list-overview .hc-weightings { padding: 0; gap: 4px; border-radius: 0; background: transparent; }
.moat-list-overview .hc-weightings button,
.moat-list-overview .hc-ranges button { border: 1px solid #e5e8ef; border-radius: 6px; background: #fff; color: #596579; font-weight: 500; }
.moat-list-overview .hc-weightings button[aria-pressed="true"],
.moat-list-overview .hc-ranges button[aria-pressed="true"] { background: #edf4ff; color: #2563a6; border-color: #b9d2f3; font-weight: 600; }
.moat-list-overview .hc-weightings button:hover,
.moat-list-overview .hc-ranges button:hover { background: #f5f7fa; }
.moat-list-overview .hc-panel-heading :is(.hc-title-bm, .hc-title-moat) { padding: 8px 10px; border-radius: 6px; background: #f8fafc; }
.moat-list-overview .hc-panel-heading .hc-title-moat { background: #f2f8f4; }
.moat-list-overview :is(.hc-val-bm, .hc-val-moat) { font-size: 20px; }
.moat-list-overview .hc-chart { height: 145px; }
.moat-list-overview .hc-sector-details { margin-top: 4px; }
.moat-list-overview .hc-sector-details > summary { padding-top: 4px; }

/* Selected countries must override the higher-specificity neutral chip styles. */
.moat-list-overview #countryFilters button.active,
.moat-list-overview #countryFilters button[aria-pressed="true"] { background: #edf4ff; color: #2563a6; border-color: #b9d2f3; font-weight: 600; }
.moat-list-overview .sector-row[hidden] { display: none; }
@media (max-width: 680px) {
    /* Let the document grow beyond the filters and chart instead of shrinking the table to zero. */
    body .page-shell { height: auto; min-height: 0; display: block; overflow: visible; }
    body .page-shell > .table-card { flex: none; min-height: 0; overflow: visible; }
    body .page-shell > .table-card .table-scroll { height: auto; max-height: none; overflow-x: auto; overflow-y: visible; }
}
