#gcv {
    --gcv-white: #FFFFFF;
    --gcv-sand: #FFF5EC;
    --gcv-sand-3: #D8CFC7;
    --gcv-sand-6: #615D5A;
    --gcv-ink: #3A3735;
    --gcv-forest: #00402A;
    --gcv-green-1: #007F33;
    --gcv-green: #00A443;
    --gcv-green-4: #5BD38C;
    --gcv-blue-1: #007ACB;
    --gcv-blue-2: #0792E5;

    --gcv-font-title: "IberPangea", Arial, sans-serif;
    --gcv-font-body: "IberPangea Text", Arial, sans-serif;
    --gcv-font-italic: "IberPangea Text Italic", "IberPangea Text", Arial, sans-serif;

    container-type: inline-size;
    width: 100%;
    max-width: 980px;
    margin: 20px auto;
    box-sizing: border-box;
    text-align: left;
    background-color: var(--gcv-sand);
    border-radius: 15px;
    padding: 32px;
}

#gcv * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-style: normal;
}

#gcv ol {
    list-style: none;
}

#gcv em {
    font-family: var(--gcv-font-italic);
    font-style: italic;
}

/* ===== Título ===== */
#gcv .gcv__title {
    color: var(--gcv-green-1);
    font-family: var(--gcv-font-title);
    font-weight: 400;
    font-size: 32px;
    line-height: 36px;
}

#gcv .gcv__title strong {
    font-weight: 700;
}

/* ===== Bloque valor: barra + métricas + tarjeta ===== */
#gcv .gcv__value {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-top: 34px;
}

#gcv .gcv__bars {
    order: 1;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    gap: 16px;
}

#gcv .gcv__metrics {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 19px 0;
}

/* Conector horizontal con punto hacia la barra */
#gcv .gcv__metric {
    position: relative;
    padding-top: 16px;
}

#gcv .gcv__metric::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5px;
}

#gcv .gcv__metric::after {
    content: "";
    position: absolute;
    top: -3px;
    right: -8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

#gcv .gcv__metric--dividend::before { background-color: var(--gcv-green); }
#gcv .gcv__metric--dividend::after { background-color: var(--gcv-green); }
#gcv .gcv__metric--capital::before { background-color: var(--gcv-blue-2); }
#gcv .gcv__metric--capital::after { background-color: var(--gcv-blue-2); }

#gcv .gcv__metric-title {
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.15;
    color: var(--gcv-forest);
}

#gcv .gcv__metric-value {
    margin-top: 10px;
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.07;
}

#gcv .gcv__metric--dividend .gcv__metric-value { color: var(--gcv-green-1); }
#gcv .gcv__metric--capital .gcv__metric-value { color: var(--gcv-blue-1); }

#gcv .gcv__metric-unit {
    font-family: var(--gcv-font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.15;
    color: var(--gcv-forest);
}

#gcv .gcv__cylinder {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

#gcv .gcv__cylinder img {
    display: block;
    width: 55px;
    height: auto;
}

/* ===== Tarjeta Iberdrola ===== */
#gcv .gcv__card {
    order: 2;
    flex: 0 0 auto;
    width: 254px;
    background-color: var(--gcv-white);
    border-radius: 15px;
    padding: 24px 31px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#gcv .gcv__card-logo {
    display: block;
    width: 78px;
    height: auto;
    margin-bottom: 24px;
}

#gcv .gcv__card-body {
    display: flex;
    flex-direction: column;
}

#gcv .gcv__card-title {
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    color: var(--gcv-forest);
}

#gcv .gcv__card-total {
    margin-top: 4px;
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.07;
    color: var(--gcv-green-1);
}

#gcv .gcv__card-unit {
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 21px;
    line-height: 1.07;
    color: var(--gcv-green-1);
}

/* ===== Gráfico ===== */
#gcv .gcv__chart {
    position: relative;
    margin-top: 24px;
    background-color: var(--gcv-white);
    border-radius: 15px;
    padding: 24px;
}

#gcv .gcv__plot {
    width: 66%;
}

#gcv .gcv__plot-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

#gcv .gcv__peak {
    position: absolute;
    top: 18px;
    left: 69%;
    color: var(--gcv-green-1);
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    white-space: nowrap;
}

#gcv .gcv__legend {
    position: absolute;
    left: 69%;
    right: 18px;
    top: 24px;
    bottom: 24px;
}

#gcv .gcv__legend-item {
    position: absolute;
    left: 0;
    right: 0;
    display: block;
    color: var(--gcv-ink);
}

#gcv .gcv__legend-item--util { top: 20%; }
#gcv .gcv__legend-item--ibex { top: 55.5%; }
#gcv .gcv__legend-item--stoxx { top: 61.5%; }

#gcv .gcv__legend-num,
#gcv .gcv__legend-dot { display: none; }

#gcv .gcv__legend-text {
    display: block;
    font-family: var(--gcv-font-title);
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
}

#gcv .gcv__legend-pct {
    display: block;
    font-family: var(--gcv-font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
}

/* La leyenda de IBEX 35 va en una sola línea (texto + %) */
#gcv .gcv__legend-item--ibex .gcv__legend-text { display: inline; }
#gcv .gcv__legend-item--ibex .gcv__legend-pct { display: inline; margin-left: 8px; }

/* =========================================================================
   MÓVIL (vertical)
   ========================================================================= */
@container (max-width: 400px) {
    #gcv {
        padding: 16px;
    }

    #gcv .gcv__title {
        font-size: 26px;
        line-height: 30px;
    }

    #gcv .gcv__value {
        flex-direction: column;
        gap: 24px;
        margin-top: 24px;
    }

    /* Tarjeta arriba (logo izq + texto der), luego barra */
    #gcv .gcv__card {
        order: 0;
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 16px;
    }

    #gcv .gcv__card-logo {
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    #gcv .gcv__card-body {
        flex: 1 1 auto;
    }

    #gcv .gcv__card-title { font-size: 20px; line-height: 24px; }
    #gcv .gcv__card-total { font-size: 34px; }
    #gcv .gcv__card-unit { font-size: 17px; }

    #gcv .gcv__bars {
        order: 1;
    }

    /* ===== Gráfico móvil: leyenda numerada debajo ===== */
    #gcv .gcv__plot {
        width: 100%;
    }

    #gcv .gcv__peak {
        position: static;
        text-align: right;
        margin-bottom: 4px;
    }

    #gcv .gcv__legend {
        position: static;
        margin-top: 20px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    #gcv .gcv__legend-item {
        position: static;
        display: grid;
        grid-template-columns: auto auto 1fr;
        align-items: start;
        column-gap: 8px;
    }

    #gcv .gcv__legend-num {
        display: block;
        grid-row: 1 / span 2;
        font-family: var(--gcv-font-title);
        font-weight: 700;
        font-size: 16px;
        line-height: 20px;
        color: var(--gcv-ink);
    }

    #gcv .gcv__legend-dot {
        display: block;
        grid-row: 1 / span 2;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        margin-top: 2px;
    }

    #gcv .gcv__legend-item--util .gcv__legend-dot { background-color: var(--gcv-forest); }
    #gcv .gcv__legend-item--ibex .gcv__legend-dot { background-color: var(--gcv-forest); }
    #gcv .gcv__legend-item--stoxx .gcv__legend-dot { background-color: var(--gcv-forest); }

    #gcv .gcv__legend-text,
    #gcv .gcv__legend-pct {
        display: block;
        grid-column: 3;
    }

    #gcv .gcv__legend-item--ibex .gcv__legend-pct { margin-left: 0; }
}
