.price-history-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 2px; padding: 11px 8px; border: 1px solid var(--line); color: var(--ink); background: transparent; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.price-history-button:hover { background: var(--primary-color); border-color: var(--ink); }
.price-cover-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.price-history-open { overflow: hidden; }
.price-history-dialog { width: min(960px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; margin: auto; border: 1px solid var(--ink); color: var(--ink); background: var(--paper, #fff); box-shadow: 0 20px 80px #0003; }
.price-history-dialog[open] { display: flex; flex-direction: column; }
.price-history-dialog::backdrop { background: #17171799; }
.price-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 26px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.price-history-eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.price-history-header h2 { margin: 0; font-size: 23px; line-height: 1.3; }
.price-history-close { display: grid; place-content: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); background: transparent; font-size: 28px; color: inherit; cursor: pointer; }
.price-history-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 26px; }
.price-history-summary { display: flex; flex-wrap: wrap; gap: 20px 32px; padding-bottom: 20px; }
.price-history-summary p { margin: 0; display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.price-history-summary strong { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.price-history-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
#price-history-variant { width: 100%; min-width: 0; padding: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.price-history-notice { margin: 12px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.price-history-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.price-history-controls button { padding: 10px 14px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.price-history-controls button[aria-pressed="true"] { background: var(--primary-color); border-color: var(--ink); }
.price-history-chart { position: relative; margin: 18px 0; border: 1px solid var(--line); background: #fff; padding: 12px; }
.price-history-chart svg { display: block; width: 100%; height: auto; }
.price-history-chart-empty { margin: 0; padding: 28px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.price-history-legend { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.price-history-legend span { display: inline-flex; align-items: center; gap: 6px; }
.price-history-legend i { width: 12px; height: 3px; background: var(--series-color); }
.price-history-table-wrap { overflow: auto; border: 1px solid var(--line); }
.price-history-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.price-history-table caption { text-align: left; padding: 12px 14px; color: var(--muted); background: #f7f6f2; font-size: 11px; line-height: 1.5; }
.price-history-table th, .price-history-table td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.price-history-table th { background: #f7f6f2; font-weight: 600; }
.price-history-table th:first-child, .price-history-table td:first-child, .price-history-table th:last-child, .price-history-table td:last-child { text-align: left; }
.price-history-table a, .price-history-sources a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.price-history-table td:last-child { white-space: normal; min-width: 150px; }
.price-history-sources { margin-top: 20px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.price-history-sources summary { color: var(--ink); cursor: pointer; font-weight: 600; }
.price-history-sources p { margin: 10px 0; }
#price-history-sources { display: flex; flex-wrap: wrap; gap: 6px 18px; }
#price-history-all-sources { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.price-page-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 0 0 24px; padding-bottom: 12px; }
.price-page-tabs button { padding: 12px 18px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.price-page-tabs button[aria-selected="true"] { background: var(--primary-color); border-color: var(--ink); }
.price-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; margin: 24px 0; font-size: 13px; }
.price-pagination button, .price-history-selection-actions button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 10px 14px; font: inherit; font-size: 12px; cursor: pointer; }
.price-pagination button:disabled { opacity: .4; cursor: default; }
.price-pagination[hidden], [role="tabpanel"][hidden], .price-card-grid[hidden], .price-history-series-option[hidden] { display: none; }
.price-history-panel-title { margin: 0 0 14px; font-size: 22px; }
.price-history-comparison { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.price-history-comparison-main { min-width: 0; }
.price-history-selection { padding: 16px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.price-history-selection > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
#price-history-find { width: 100%; min-width: 0; border: 1px solid var(--line); padding: 10px; font: inherit; font-size: 12px; background: #fff; }
.price-history-selection-actions { display: flex; gap: 8px; margin: 10px 0; }
.price-history-selection-actions button { padding: 8px; font-size: 11px; }
#price-history-selection-count { margin: 10px 0; color: var(--muted); font-size: 12px; }
#price-history-selection-list { max-height: 460px; overflow-y: auto; overscroll-behavior: contain; }
#price-history-selection-list details { border-top: 1px solid var(--line); padding: 10px 0; }
#price-history-selection-list summary { font-size: 12px; font-weight: 600; cursor: pointer; }
.price-history-series-option { display: grid; grid-template-columns: 16px 8px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 0; cursor: pointer; font-size: 11px; line-height: 1.5; }
.price-history-series-option input { margin: 2px 0 0; accent-color: var(--ink); }
.price-history-series-option i { width: 8px; height: 8px; margin-top: 4px; background: var(--series-color); border-radius: 50%; }
.price-history-series-option small { display: block; color: var(--muted); margin-top: 3px; }
.price-history-chart-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.price-history-tooltip { position: absolute; z-index: 3; max-width: min(320px, calc(100% - 16px)); padding: 12px; border: 1px solid var(--ink); background: #fffef4; color: var(--ink); box-shadow: 0 4px 18px #0002; font-size: 12px; line-height: 1.5; pointer-events: none; }
.price-history-tooltip[hidden] { display: none; }
.price-history-tooltip strong, .price-history-tooltip span { display: block; }
.price-history-tooltip strong { margin-bottom: 5px; }
.price-history-tooltip-current { color: #655000; font-weight: 600; margin: 5px 0; }
.price-history-current-row { background: #fffbe2; }
.price-history-period { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.price-history-period label { display: grid; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 600; }
.price-history-period input { min-width: 0; width: 155px; border: 1px solid var(--line); padding: 9px; background: #fff; color: var(--ink); font: inherit; }
.price-history-period button { border: 1px solid var(--line); padding: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.price-history-period-error { margin: 0 0 12px; color: #9d2828; font-size: 12px; }
.price-page-tabs button:focus-visible, .price-pagination button:focus-visible, .price-history-series-option input:focus-visible, .price-history-chart svg:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (max-width: 900px) {
    .price-history-comparison { grid-template-columns: minmax(0, 1fr); }
    #price-history-selection-list { max-height: 220px; }
}
.price-history-footer { padding: 14px 26px; border-top: 1px solid var(--line); flex-shrink: 0; background: #f7f6f2; }
.price-history-footer p { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.price-history-dialog [hidden] { display: none !important; }
.price-history-button:focus-visible, .price-history-dialog button:focus-visible, .price-history-dialog select:focus-visible, .price-history-table-wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (max-width: 580px) {
    .price-history-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 24px); }
    .price-history-header, .price-history-body { padding: 18px 16px; }
    .price-history-header h2 { font-size: 19px; }
    .price-history-summary { gap: 14px 24px; }
    .price-history-summary strong { font-size: 17px; }
    .price-history-footer { padding: 12px 16px; }
    .price-history-chart { padding: 6px; }
}
