/* TABS DE FIGURA (#figuraTabs) */
#figuraTabs {
    gap: 0.35rem !important;
}

@media (min-width: 480px) {
    #figuraTabs {
        gap: 0.5rem !important;
    }
}

/* TABS (.modo-tab) */
.modo-tab {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1.5px solid var(--color-border, #e5e7eb);
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

@media (max-width: 479px) {
    .modo-tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.78rem;
    }
}

.modo-tab:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.modo-tab-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* DESCRIPCIÓN DE FIGURA (.modo-desc) */
.modo-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* SVG DE REPRESENTACIÓN VISUAL */
/* Contenedor del SVG */
.chart-wrap {
    width: 100%;
    overflow: hidden;
}

/* El SVG en sí */
#chartSvg {
    display: block;
    width: 100%;
    min-height: 180px;
}

@media (max-width: 479px) {
    #chartSvg text {
        font-size: 22px !important;
    }

    .chart-wrap {
        min-height: 200px;
    }

    #chartSvg {
        min-height: 200px;
    }
}

@media (min-width: 480px) and (max-width: 639px) {

    #chartSvg text {
        font-size: 17px !important;
    }

    /* Contenedor del SVG de visualización */
    .chart-wrap {
        width: 100%;
        /* Fuerza una altura mínima para que el SVG no colapse */
        min-height: 300px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .chart-wrap svg {
        display: block;
        width: 100%;
        /* La altura se calcula a partir del viewBox 700/300 ≈ 42.86% */
        height: auto;
        min-height: 260px;
    }

    .chart-heading-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-bottom: 0.5rem;
    }

    .chart-heading-row h2 {
        margin: 0;
    }

    .badge-demo {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        background: #f0f4ff;
        border: 1.5px solid #c7d6fb;
        color: #2563eb;
        border-radius: 20px;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 0.2rem 0.65rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .chart-demo-note {
        font-size: 0.82rem;
        color: var(--color-text-muted, #6b7280);
        margin: 0 0 1rem;
        line-height: 1.5;
    }

    .input-wrapper select {
        width: 100%;
        padding: 0.5rem 0.75rem;
        border: 1.5px solid var(--color-border, #e5e7eb);
        border-radius: 8px;
        background-color: var(--color-bg, #ffffff);
        color: var(--color-text, #374151);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        padding-right: 2.25rem;
        transition: border-color 0.18s;
    }

    .input-wrapper select:hover,
    .input-wrapper select:focus {
        border-color: #2563eb;
        outline: none;
    }
}