.price-history {
    /* margin: 24px 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px; */
}
.price-history [hidden] {
    display: none !important;
}
.price-history__heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}
.price-history h2 {
    font-size: 24px;
    line-height: 1.4;
    margin: 0 0 12px;
}
.price-history p {
    font-size: 14px;
    color: #657080;
    line-height: 1.6;
}
.price-history select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}
.price-history__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.price-history__card {
    padding: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
}
.price-history__card strong {
    display: block;
    font-size: 25px;
    margin: 10px 0;
    color: #102233;
}
.price-history__card small {
    display: block;
    color: #657080;
}
.price-history__plot svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 220px;
}
.price-history__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.price-history__table {
    overflow: auto;
}
.price-history table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
.price-history th,
.price-history td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #eee;
}
.price-history th:first-child,
.price-history td:first-child {
    text-align: left;
}
.price-history summary,
.price-history button {
    cursor: pointer;
}
.price-history__heading label {
    font-size: 13px;
    flex-shrink: 0;
}
.price-history button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}
@media (max-width: 600px) {
    /* .price-history {
        padding: 16px;
    } */
    .price-history h2 {
        font-size: 20px;
    }
    .price-history__heading {
        display: block;
    }
    .price-history__cards {
        grid-template-columns: 1fr;
    }
    .price-history__card {
        padding: 12px;
    }
    .price-history__card strong {
        font-size: 20px;
    }
    .price-history__plot svg {
        min-width: 0;
    }
}
/* Price history follows the compact three-card reference layout. */
/* .price-history {
    border: 0;
    padding: 28px 24px;
    box-shadow: none;
} */
.price-history__heading {
    align-items: center;
}
.price-history__heading label {
    font-size: 0;
}
.price-history select {
    font-size: 13px;
    color: #657080;
}
.price-history__cards {
    gap: 10px;
    margin: 18px 0;
}
.price-history__card {
    padding: 16px 12px;
    border: 1px solid #f0f1f3;
    border-radius: 20px;
    box-shadow: 0 2px 6px #18273806;
}
.price-history__card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    flex-wrap: wrap;
}
.price-history__card-heading > span:first-child {
    font-size: 13px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #747e8c;
}
.price-history__badge {
    font-size: 12px;
    font-weight: 700;
    color: #109e9c;
    background: #edf8f7;
    padding: 5px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.price-history__card strong {
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.7px;
    margin: 18px 0 10px;
    line-height: 1.2;
}
.price-history__card small {
    font-size: 14px;
    line-height: 1.6;
    color: #929ba7;
}
.price-history__card.up strong {
    color: #009d71;
}
.price-history__card.down strong,
.price-history__card.peak strong {
    color: #e99c00;
}
.price-history__card.peak .price-history__badge {
    background: #f5f5f8;
    color: #717a88;
}
.price-history__card strong.price-history__empty {
    font-size: 21px;
    color: #89929d;
    letter-spacing: 0;
}
.price-history__plot {
    border: 1px solid #f1f2f4;
    border-radius: 20px;
    padding: 18px 12px 0;
}
.price-history__legend {
    justify-content: center;
    font-weight: 650;
    font-size: 14px !important;
    margin: 20px 0;
}
.price-history .price-history__note,
.price-history [data-estimate-note] {
    font-size: 12px;
    color: #8a929d;
}
.price-history details {
    font-size: 13px;
    color: #737d89;
}
.price-history__plot svg {
    min-height: 260px;
}
@media (max-width: 600px) {
    /* .price-history {
        padding: 20px 14px;
    } */
    .price-history h2 {
        font-size: 22px;
    }
    .price-history__heading label {
        display: block;
        margin: 8px 0;
    }
    .price-history__cards {
        gap: 10px;
    }
    .price-history__card {
        padding: 14px 12px;
    }
    .price-history__card strong {
        font-size: 20px;
        margin: 8px 0 6px;
    }
    .price-history__card-heading > span:first-child {
        font-size: 12px;
    }
    .price-history__card small {
        font-size: 12px;
    }
    .price-history__badge {
        font-size: 10px;
        padding: 4px 7px;
    }
    .price-history__plot {
        padding: 12px 4px 0;
    }
    .price-history__plot svg {
        width: 100%;
        min-width: 0;
        min-height: 0;
        height: auto;
        aspect-ratio: 900/330;
    }
    .price-history__legend {
        gap: 8px;
        font-size: 11px !important;
        margin: 14px 0;
    }
}

/* Tooltip theo tháng và cỡ chữ gọn cho các thẻ tổng quan. */
.price-history__card {
    min-width: 0;
}
.price-history__card strong {
    font-size: 20px;
    white-space: nowrap;
}
.price-history__card strong.price-history__empty {
    font-size: 18px;
    white-space: normal;
}
.price-history__card-heading > span:first-child {
    font-size: 12px;
    letter-spacing: 0.6px;
    white-space: nowrap;
}
.price-history__card small {
    font-size: 13px;
}
.price-history__plot {
    position: relative;
}
.price-history__tooltip {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
    max-width: calc(100% - 8px);
    padding: 16px;
    background: #fff;
    border: 1px solid #f0f1f3;
    border-radius: 16px;
    box-shadow: 0 8px 28px #10223320;
    color: #263442;
    font-size: 13px;
}
.price-history__tooltip > strong {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #edf0f3;
    font-size: 14px;
}
.price-history__tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    white-space: nowrap;
}
.price-history__tooltip-row b {
    margin-left: auto;
    padding-left: 8px;
}
.price-history__plot rect:focus-visible {
    outline: none;
    stroke: #657080;
    stroke-width: 1;
    stroke-dasharray: 4 4;
}
@media (max-width: 600px) {
    .price-history__card strong {
        font-size: 20px;
    }
    .price-history__card small {
        font-size: 12px;
    }
    .price-history__tooltip {
        padding: 12px;
        font-size: 11px;
    }
    .price-history__tooltip > strong {
        font-size: 12px;
    }
}

/* Nhấn mạnh giá đỉnh, tách rõ với phần trăm so sánh phía trên. */
.price-history__card .price-history__peak-price {
    color: #657080;
}
.price-history__peak-price b {
    font-size: 12px;
    font-weight: 700;
    color: #102233;
    white-space: nowrap;
}
