.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 1px 16px;
}
.history-heading p,.history-heading h1 { margin: 0; }
.history-heading p { color: #8794ad; font-size: .54rem; letter-spacing: .08em; }
.history-heading h1 { font-size: 1.28rem; }
.history-period-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 5px; margin-bottom: 10px; border-radius: 12px; background: #e9eef7; }
.history-period-tabs button { padding: 8px 6px; border-radius: 9px; background: transparent; color: #71809c; font-size: .61rem; font-weight: 600; }
.history-period-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 4px 12px #29447714; }
.history-calendar { position: relative; display: flex; align-items: center; margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.history-calendar label { display: grid; flex: 1; gap: 2px; color: #7b89a4; font-size: .5rem; }
.history-calendar label[hidden] { display: none; }
.history-calendar input,.history-calendar select { width: 100%; border: 0; outline: 0; background: transparent; padding: 1px 0; color: var(--ink); font: inherit; font-size: .74rem; font-weight: 600; }
.calendar-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: #edf3ff; font-size: 1rem; }
.history-summary { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 8px; }
.history-summary div { min-width: 0; padding: 11px 9px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.history-summary div:first-child { color: #fff; border: 0; background: linear-gradient(135deg,#2367e8,#6948d5); }
.history-summary small,.history-summary strong { display: block; }
.history-summary small { color: #8190aa; font-size: .48rem; }
.history-summary div:first-child small { color: #e0e7ff; }
.history-summary strong { margin-top: 3px; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-chart-card,.history-list-card { margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.history-card-head { display: flex; align-items: start; justify-content: space-between; }
.history-card-head p,.history-card-head h2 { margin: 0; }
.history-card-head p { color: #8995ad; font-size: .5rem; }
.history-card-head h2 { font-size: .82rem; }
.history-card-head>span,.history-card-head>strong { color: #63728f; font-size: .5rem; font-weight: 500; }
.history-bars { margin-top: 10px; padding: 6px 0 0; border-radius: 12px; background: linear-gradient(180deg,#fafbff,#fff); overflow: hidden; }
.history-chart-svg { display: block; width: 100%; height: auto; }
.chart-grid { stroke: #e5eaf3; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-baseline { stroke: #cfd7e6; stroke-width: 1.2; }
.chart-axis-text { fill: #8b97ad; font-family: "Kanit",sans-serif; font-size: 8px; }
.chart-bar { fill: url(#historyBarGradient); filter: drop-shadow(0 3px 4px rgba(66,78,210,.16)); transition: opacity .2s; }
.chart-bar:hover { opacity: .78; }
.chart-empty-svg { fill: #8b97ad; font-family: "Kanit",sans-serif; font-size: 11px; text-anchor: middle; }
.history-chart-insight { margin: 4px 0 0; padding: 8px 10px; border-radius: 9px; background: #f2f5ff; color: #526487; font-size: .54rem; text-align: center; }
.history-category-card { margin-top: 12px; }
.history-list-card { margin-bottom: 6px; }
.history-transactions { display: grid; margin-top: 8px; }
.history-transaction { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.history-transaction>span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #fff1da; font-size: .72rem; }
.history-transaction strong,.history-transaction small { display: block; }
.history-transaction strong { font-size: .61rem; }
.history-transaction small { color: #8995ad; font-size: .49rem; }
.history-transaction>b { color: #d83278; font-size: .63rem; }
.history-empty { margin: 18px 0 8px; color: #8995ad; text-align: center; font-size: .56rem; }
