.history-donut-intro { color: var(--muted); font-size: .9rem; margin-block: .25rem .8rem; }
.history-donut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 370px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.history-donut-card { min-width: 0; border: 1px solid var(--line, #dfe5ef); border-radius: 1rem; padding: clamp(.75rem, 2vw, 1.15rem); background: var(--surface, #fff); }
.history-donut-card h4 { margin: 0 0 .7rem; font-size: .95rem; }
.history-ring-layout { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.18fr); align-items: center; gap: .8rem; }
.history-ring-figure { position: relative; display: grid; place-items: center; width: min(100%, 220px); aspect-ratio: 1; margin-inline: auto; }
.history-ring-svg { width: 100%; height: 100%; overflow: visible; }
.history-ring-center { position: absolute; inset: 28%; display: grid; align-content: center; justify-items: center; text-align: center; pointer-events: none; }
.history-ring-center strong { font-size: clamp(.9rem, 2vw, 1.5rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-ring-center span { font-size: .76rem; color: var(--muted); }
.history-ring-slice { fill: none; stroke: var(--ring-color); stroke-width: 34; opacity: .79; cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.history-ring-slice.is-active { stroke-width: 43; opacity: 1; }
.ring-indigo { --ring-color: #4a45c6; }
.ring-teal { --ring-color: #088679; }
.ring-blue { --ring-color: #2372bc; }
.ring-plum { --ring-color: #9e4db0; }
.ring-amber { --ring-color: #ab6418; }
.ring-slate { --ring-color: #5d6b85; }
.history-ring-legend, .history-ring-product-list, .history-ring-product-list ul { margin: 0; padding: 0; list-style: none; }
.history-ring-legend { display: grid; gap: .28rem; }
.history-ring-key { display: grid; grid-template-columns: .7rem minmax(0, 1fr) auto; gap: .15rem .4rem; align-items: center; width: 100%; min-height: 44px; padding: .35rem .45rem; color: inherit; background: transparent; border: 1px solid transparent; border-radius: .55rem; cursor: pointer; text-align: start; font: inherit; font-size: .8rem; }
.history-ring-key.is-active { background: #eef0ff; border-color: #c6c9f4; }
.history-ring-key:focus-visible { outline: 2px solid #443dc5; outline-offset: 1px; }
.history-ring-key i { grid-row: span 2; width: .68rem; height: .68rem; border-radius: 50%; background: var(--ring-color); }
.history-ring-key span { grid-column: 2; font-weight: 650; overflow-wrap: anywhere; }
.history-ring-key b { grid-column: 2; grid-row: 2; color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
.history-ring-key strong { grid-column: 3; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; }
.history-ring-details { margin-top: .8rem; min-height: 8rem; padding: .65rem .75rem; border-radius: .7rem; background: #f5f7fd; }
.history-ring-detail-title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem .7rem; padding-bottom: .4rem; overflow-wrap: anywhere; }
.history-ring-detail-title span { color: var(--muted); font-size: .83rem; }
.history-ring-product-list { max-height: 9rem; overflow: auto; }
.history-ring-product-list > li + li { margin-top: .5rem; }
.history-ring-product-list ul > li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .2rem 1rem; border-top: 1px solid #dce2f0; padding: .4rem 0; font-size: .79rem; overflow-wrap: anywhere; }
.history-ring-product-list ul > li span { min-width: 0; }
.history-ring-product-list small { display: block; color: var(--muted); font-size: .76rem; }
@media (max-width: 550px) {
  .history-ring-layout { grid-template-columns: 1fr; }
  .history-ring-figure { width: min(100%, 162px); }
}
@media (prefers-reduced-motion: reduce) {
  .history-ring-slice { transition: none; }
}
