:root {
    --hm-accent: #3060c9;
    --hm-border: #e2e5ea;
    --hm-label: #6c7280;
    --hm-ink: #222831;
}

.MainContainer {
    height: auto !important;
}

.MainContentArea {
    grid-template-columns: 1fr;
    gap: 0px !important;
}

    .MainContentArea > div {
        overflow: visible !important;
    }

#divStock, .divFlter {
    background: #fff !important;
    padding: 2px 2px;
}

/* Filter bar */
.hm-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--hm-border);
}

.hm-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .hm-field label {
        font-size: 10px;
        font-weight: 700;
        color: var(--hm-label);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin: 0;
    }

    .hm-field .dropdown-select {
        min-width: 170px;
        font-size: 12px;
        padding: 5px 8px;
    }

.hm-toggle-group {
    display: flex;
    border: 1px solid var(--hm-border);
    border-radius: 6px;
    overflow: hidden;
}

    .hm-toggle-group input.single {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .hm-toggle-group label,
    .hm-toggle-btn {
        padding: 5px 11px;
        border: none;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        background: #fff;
        color: var(--hm-ink);
        margin: 0;
    }

        .hm-toggle-group label + input.single + label,
        .hm-toggle-group .hm-toggle-btn + .hm-toggle-btn {
            border-left: 1px solid var(--hm-border);
        }

        .hm-toggle-group input.single:checked + label,
        .hm-toggle-btn.active {
            background: var(--hm-accent);
            color: #fff;
        }

.hm-search-wrap {
    position: relative;
}

.hm-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--hm-label);
}

#txtHmSearch {
    width: 100%;
    padding: 5px 8px 5px 25px;
    border: 1px solid var(--hm-border);
    border-radius: 6px;
    font-size: 12px;
}

.hm-actions {
    display: flex;
    gap: 5px;
}

#btnFilter, #btnClear {
    margin-top: 0;
    padding: 6px 16px;
    font-size: 12px;
}

/* Legend */
.hm-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 2px 4px;
    font-size: 11px;
    color: var(--hm-label);
}

.hm-legend-swatches {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
}

.hm-legend-swatch {
    width: 28px;
    height: 12px;
    display: block;
}

/* Sector cards */
.hm-card {
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--hm-border);
    border-radius: 10px;
    padding: 9px 12px;
}

.hm-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hm-sector-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--hm-ink);
}

    .hm-sector-name a {
        font-weight: 700;
        color: var(--hm-ink);
    }

.hm-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.hm-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
}

.hm-badge-adv {
    background: #dff3e6;
    color: #1e6b3c;
}

.hm-badge-dec {
    background: #fbe3df;
    color: #a13a26;
}

.hm-badge-flat {
    background: #ececee;
    color: #5c6068;
}

.hm-collapse-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--hm-border);
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    padding: 0;
}

.hm-chevron {
    display: inline-block;
    transition: transform .15s;
}

.hm-card.collapsed .hm-chevron {
    transform: rotate(-90deg);
}

.hm-card.collapsed .hm-tiles,
.hm-card.collapsed .hm-showall-btn {
    display: none;
}

.hm-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

    .hm-tiles:not(.expanded) .hm-tile-extra {
        display: none;
    }

.hm-tile {
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    min-height: 32px;
    min-width: fit-content;
    max-width: 300px;
    padding: 0 3px;
}

    .hm-tile.search-hide {
        display: none !important;
    }

.hm-tile-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--hm-ink);
    text-decoration: none;
    gap: 1px;
}

.hm-tile-sym, .hm-tile-chg, .hm-tile-cap {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-tile-sym {
    font-size: 9.5px;
}

.hm-tile-chg {
    font-size: 11px;
}

.hm-tile-cap {
    display: none;
}

.hm-showall-btn {
    margin-top: 8px;
    background: none;
    border: none;
    color: var(--hm-accent);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.hm-no-results {
    padding: 60px 20px;
    text-align: center;
    color: var(--hm-label);
    font-size: 14px;
}

/* Compact view: index panels (left) + full sector breakdown (right) as dense chip rows */
.hm-compact-view {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--hm-border);
}

.hm-compact-col-left {
    width: 40%;
    flex: none;
    border-right: 1px solid var(--hm-border);
}

.hm-compact-col-right {
    width: 60%;
    display: flex;
    flex-direction: column;
}

.hm-compact-panel {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--hm-border);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

    .hm-compact-panel.search-hide {
        display: none !important;
    }

.hm-compact-header {
    color: #fff;
    padding: 2px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-block;
}

.hm-compact-header-index {
    background: #6b2f8c;
}

.hm-compact-header-sector {
    background: #1f3f7a;
}

.hm-chip {
    display: inline-flex;
    align-items: baseline;
    padding: 3px;
    font-size: 9px;
    white-space: nowrap;
    border: 1px solid #999999;
    text-decoration: none;
    color: var(--hm-ink);
}

    .hm-chip i {
        font-style: normal;
        font-weight: 700;
        margin-left: 2px;
    }

    .hm-chip.search-hide {
        display: none !important;
    }

@media (max-width: 768px) {
    .hm-tiles {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .hm-compact-view {
        flex-direction: column;
    }

    .hm-compact-col-left, .hm-compact-col-right {
        width: 100%;
        border-right: none;
    }
}
