.h5states-widget {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.h5states-heading {
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
}

.h5states-map-wrapper {
    position: relative;
    width: 100%;
}

.h5states-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}


/* =================================
   STATES
================================= */

.h5states-state {
    cursor: pointer;

    transform-box: fill-box;
    transform-origin: center;

    stroke: #ffffff;
    stroke-width: 1.5;

    transition:
        fill 0.25s ease,
        stroke 0.25s ease,
        transform 0.25s ease,
        opacity 0.25s ease;
}


/* High5 covered states */

.h5states-state.h5states-covered {
    fill: #2271b1 !important;
    opacity: 1 !important;
}


/* States not covered by High5 */

.h5states-state.h5states-uncovered {
    fill: #d1d5db !important;
    opacity: 0.65 !important;
}


/* =================================
   HOVER
================================= */

@media (hover: hover) and (pointer: fine) {

    .h5states-state:hover {
        transform: scale(1.07);

        stroke: #111827;
        stroke-width: 2.5;
    }

}


/* =================================
   SELECTED
================================= */

.h5states-state.is-selected {
    transform: scale(1.07);

    stroke: #111827;
    stroke-width: 2.5;
}


/* =================================
   STATE NAMES
================================= */

.h5states-labels {
    pointer-events: none;
}

.h5states-label {
    fill: #ffffff;

    font-family: Arial, sans-serif;

    font-size: 10px;
    font-weight: 700;

    text-anchor: middle;
    dominant-baseline: middle;

    pointer-events: none;

    paint-order: stroke;

    stroke: rgba(17, 24, 39, 0.7);
    stroke-width: 2px;
    stroke-linejoin: round;
}


/* =================================
   TOOLTIP
================================= */

.h5states-tooltip {
    position: absolute;

    left: 0;
    top: 0;

    padding: 9px 14px;

    border-radius: 8px;

    background: #111827;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    white-space: nowrap;

    pointer-events: none;

    opacity: 0;

    transform: translateY(5px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;

    z-index: 100;
}

.h5states-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* =================================
   ERROR
================================= */

.h5states-error {
    padding: 20px;

    border: 1px solid #ef4444;
    border-radius: 10px;

    background: #fef2f2;
    color: #991b1b;

    text-align: center;
}


/* =================================
   MOBILE
================================= */

@media (max-width: 767px) {

    .h5states-heading {
        margin-bottom: 20px;
        font-size: 20px;
    }

    .h5states-state.is-selected {
        transform: scale(1.04);
    }

    .h5states-label {
        font-size: 7px;
        stroke-width: 1.5px;
    }

}


/* ==========================================
   STATE HOVER TOOLTIP
   ========================================== */

.h5states-tooltip {
    position: absolute;
    z-index: 100;
    width: 170px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    pointer-events: none;

    opacity: 0;
    visibility: hidden;

    transform: translateY(4px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;
}

.h5states-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* State preview */

.h5states-tooltip-map-wrapper {
    width: 100%;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.h5states-tooltip-map {
    width: 100%;
    height: 100%;
    overflow: visible;
}


/* State name */

.h5states-tooltip-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
    text-align: center;
}


/* State abbreviation */

.h5states-tooltip-code {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    letter-spacing: 1px;
}


/* Coverage */

.h5states-tooltip-status {
    margin-top: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.h5states-tooltip-status.covered {
    background: #e8f1f8;
    color: #2271b1;
}

.h5states-tooltip-status.uncovered {
    background: #f3f4f6;
    color: #6b7280;
}
.h5states-heading-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.h5states-state-list {
    font-weight: 400;
    line-height: 1.6;
}

.h5states-map {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.h5states-map > svg {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    min-width: 0;
}

@media (max-width: 767px) {

    .h5states-map > svg {
        width: 100%;
        max-width: 100%;
    }

}

.h5states-svg .h5states-state {
    stroke: #ffffff;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.2s ease, opacity 0.2s ease;
}

.h5states-label {
    font-size: 12px;
    font-weight: 600;
    fill: #ffffff;
    stroke: none;
    stroke-width: 0;
    pointer-events: none;
    user-select: none;
}

.h5states-label-code {
    font-size: 10px;
    font-weight: 600;
    fill: #ffffff;
    stroke: none;
    stroke-width: 0;
    
}

.h5states-label-outside {
    font-size: 12px;
    font-weight: 200;
    fill: #000000;
    stroke: none;
    stroke-width: 0;
}

.h5states-label-line {
    stroke: #000000;
    stroke-width: 1;
    fill: none;
}

/* =========================================================
   SHAPE-BASED STATE LABELS
   ========================================================= */

.h5states-labels {
    overflow: visible;
}

.h5states-shape-label {
    overflow: visible;
    pointer-events: none;
}

.h5states-shape-letter {
    fill: #ffffff;
    stroke: none;
    stroke-width: 0;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-weight: 700;

    pointer-events: none;

    user-select: none;

    text-rendering: geometricPrecision;
}

/* Keep the normal outside labels */
.h5states-label-outside {
    font-size: 12px;
    font-weight: 700;
    fill: #000000;
    stroke: none;
    stroke-width: 0;
}

.h5states-label-code {
    font-size: 10px;
    font-weight: 700;
    fill: #ffffff;
    stroke: none;
    stroke-width: 0;
}

.h5states-label-line {
    stroke: #000000;
    stroke-width: 1.5;
    fill: none;
}

/* Prevent browser selection */
.h5states-labels text {
    user-select: none;
    -webkit-user-select: none;
}

/* =========================================================
   SHAPE TEXT
   ========================================================= */

.h5states-labels {
    pointer-events: none;
    overflow: visible;
}

.h5states-shape-label {
    pointer-events: none;
    overflow: visible;
}

.h5states-shape-letter {
    fill: #ffffff;
    stroke: none;
    stroke-width: 0;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-weight: 700;

    pointer-events: none;
    user-select: none;

    text-rendering: geometricPrecision;
}


/* =========================================================
   SMALL STATE LABELS
   ========================================================= */

.h5states-label-outside {
    font-size: 12px;
    font-weight: 700;

    fill: #000000;

    stroke: none;
    stroke-width: 0;
}

.h5states-label-code {
    font-size: 10px;
    font-weight: 700;

    fill: #ffffff;

    stroke: none;
    stroke-width: 0;
}

.h5states-label-line {
    stroke: #000000;
    stroke-width: 1.5;
    fill: none;
}

/* TEST: hide the original covered state fill */
.h5states-svg .h5states-state.h5states-covered {
    fill: transparent !important;
}




/* Two independent tooltip boxes */
.h5states-tooltip-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: max-content;
    max-width: calc(100vw - 32px);
}

/* State information box */
.h5states-tooltip-wrapper > .h5states-tooltip-content {
    box-sizing: border-box;
    flex: 0 0 170px;
    width: 170px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #111827;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

/* State preview */
.h5states-tooltip-wrapper .h5states-tooltip-map-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    margin-bottom: 10px;
}

.h5states-tooltip-wrapper .h5states-tooltip-map {
    width: 100%;
    height: 100%;
}

/* State text */
.h5states-tooltip-wrapper .h5states-tooltip-name {
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.h5states-tooltip-wrapper .h5states-tooltip-code {
    margin-top: 3px;
    color: #6b7280;
    font-size: 12px;
}

.h5states-tooltip-wrapper .h5states-tooltip-status {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Licensed agents box */
.h5states-tooltip-agents-box {
    box-sizing: border-box;
    flex: 0 1 240px;
    width: 240px;
    min-width: 190px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #111827;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

/* Heading and agent count */
.h5states-tooltip-agents-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
}

.h5states-tooltip-agent-count {
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* Agent names arranged horizontally */
.h5states-tooltip-agent-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
}

.h5states-tooltip-agent-chip {
    display: inline-flex;
    max-width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    color: #111827;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Empty state */
.h5states-tooltip-no-agents {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

/* Narrow screens */
@media (max-width: 480px) {
    .h5states-tooltip-wrapper {
        gap: 8px;
    }

    .h5states-tooltip-wrapper > .h5states-tooltip-content {
        flex-basis: 145px;
        width: 145px;
    }

    .h5states-tooltip-agents-box {
        flex-basis: 190px;
        width: 190px;
        min-width: 190px;
    }
}


/* Remove the extra outer tooltip background */
.h5states-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Keep the two boxes aligned */
.h5states-tooltip-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: max-content;
    max-width: calc(100vw - 32px);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Give the licensed agents box more room */
.h5states-tooltip-agents-box {
    flex: 0 0 320px;
    width: 320px;
    min-width: 320px;
    box-sizing: border-box;
}

/* Let agent names wrap naturally into rows */
.h5states-tooltip-agent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Keep each name compact */
.h5states-tooltip-agent-chip {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Smaller screens */
@media (max-width: 480px) {
    .h5states-tooltip-agents-box {
        flex-basis: 260px;
        width: 260px;
        min-width: 260px;
    }
}




