/* HistoryWidget — виджет «История операций» с графиком трат (буфер; ds/pending-hwidget.js, макет 20015:558674) */
.u-hw-host { position: relative; }
.u-hw-tap { display: block; -webkit-tap-highlight-color: transparent; outline: none; }
.u-hw-tap.is-tappable { cursor: pointer; }
.u-hw-tap .u-hw-box { transition: transform .12s ease; }
.u-hw-tap.is-tappable:active .u-hw-box { transform: scale(.97); }
.u-hw-tap:focus-visible .u-hw-box { box-shadow: 0 0 0 2px var(--c-graphic-accent); }

/* Слот: VSpacing s · TitleText · TitleText · VSpacing l · TitleText · VSpacing s; график — абсолютно справа, прижат к низу (12) */
.u-hw { --hw-g: clamp(118px, 43.73%, 150px); position: relative; min-height: 120px; }
/* текст может заходить на 7 px пустого поля графика (x 0…7 в Graph) + 4 px запаса: на 375 сумма из макета (168 px) в одну строку */
.u-hw__sub, .u-hw__pct { margin-right: calc(var(--hw-g) - 11px); }
/* заголовок — над пустым левым верхним углом графика (линии нарастающего итога начинаются снизу): на 320 «История операций» в одну строку */
.u-hw__title { margin-right: calc(var(--hw-g) - 40px); }
.u-hw__row { display: flex; align-items: center; min-height: 24px; padding: 2px 16px; color: var(--c-text-primary); overflow-wrap: anywhere; }
.u-hw__sub, .u-hw__pct { color: var(--c-text-secondary); }
/* сравнение с прошлым месяцем — текстом «Траты выше/ниже среднего», всегда $Text/Secondary (без красного/зелёного) */
.u-hw__sub { display: block; padding-top: 3px; padding-bottom: 3px; }
.u-hw.is-loading .u-hw__sub { display: flex; }

.u-hw__graph { position: absolute; right: 16px; bottom: 12px; width: var(--hw-g); height: 96px; pointer-events: none; }
.u-hw__svg { position: absolute; left: 0; top: 0; overflow: visible; display: block; }
.u-hw__prev, .u-hw__cur { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.u-hw__prev { stroke: var(--c-graphic-disabled); }
.u-hw__cur { stroke: var(--c-graphic-accent); }
.u-hw__g0 { stop-color: var(--c-text-accent-disabled); }
.u-hw__g1 { stop-color: var(--c-actions-transparent); }
.u-hw__dot { fill: var(--c-surface-widget); stroke: var(--c-graphic-accent); stroke-width: 2.2; }
/* нет трат (новая карта): линия на нуле и точка «сегодня» — серые, как линия прошлого месяца ($Graphic/Disabled) */
.u-hw__dot.is-empty { stroke: var(--c-graphic-disabled); }
/* загрузка: полоски-линии — шиммер ДС .u-sk (цвет и анимация u-shimmer как у остальных шиммеров), форма — маской из SVG (pending-hwidget.js, SK_LINES, SK_DOT) */
.u-hw__skl { position: absolute; inset: 0; }
.u-hw__skl > .u-sk { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* число сегодняшнего дня: низ 93 в Graph 96 (макет), у правого края — по правому краю, иначе по центру под точкой */
.u-hw__day { position: absolute; bottom: 3px; color: var(--c-text-secondary); white-space: nowrap; transform: translateX(-50%); }
.u-hw__day.is-end { right: 0; transform: none; }

/* загрузка → данные: линии прорисовываются слева направо, заливка и точка проявляются */
.u-hw.is-in .u-hw__sub, .u-hw.is-in .u-hw__pct, .u-hw.is-in .u-hw__day { animation: u-hw-fade .3s ease both; }
.u-hw__svg.is-draw .u-hw__prev, .u-hw__svg.is-draw .u-hw__cur { stroke-dasharray: 1; animation: u-hw-draw .7s cubic-bezier(.32, .72, 0, 1) both; }
.u-hw__svg.is-draw .u-hw__area { animation: u-hw-fade .5s ease .25s both; }
.u-hw__svg.is-draw .u-hw__dot { animation: u-hw-fade .25s ease .55s both; }
@keyframes u-hw-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes u-hw-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .u-hw * { animation: none !important; transition: none !important; } }

/* демо на странице буфера */
.u-hw-demo { max-width: 100%; margin: 0 auto; background: var(--c-surface-main); }
.u-hw-demo__note { margin: 0; padding: 0 16px 12px; color: var(--c-text-secondary); }
