/* Savings by month (run F-HS1): D-HS1's page (design/history/src/history.css),
 * on the pages' palettes (pages.css's --lp- tokens, Plaster and Lamplit,
 * whichever the phone is on). Linked after pages.css. Clean type throughout;
 * nothing scrolls sideways; every list in full. */

/* The page: a detail page with its own jump strip under its bar. */
.lpdetail.hist .jump {
  flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 9px 12px;
  background: var(--lp-ground); border-bottom: 1px solid var(--lp-edge); position: relative; z-index: 2;
}
.lpdetail.hist .jump[hidden] { display: none; }
.lpdetail.hist .jump::-webkit-scrollbar { display: none; }
.lpdetail.hist .chip {
  flex: none; position: relative; height: 26px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: 13px;
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); background: var(--lp-card); border: 1px solid var(--lp-edge);
  white-space: nowrap; cursor: pointer;
}
.lpdetail.hist .chip::before { content: ''; position: absolute; inset: -9px -3px; }
.lpdetail.hist .chip[aria-current="true"] { color: var(--lp-accent); background: var(--lp-accentBg); border-color: transparent; }
.lpdetail.hist .dscroll { overflow-x: hidden; }
.lpdetail.hist .big.money { color: var(--lp-money); }

/* The legend under a chart: drawn keys, faint words. */
.hlegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-faint); }
.hlegend i { display: inline-block; vertical-align: -2px; margin-right: 5px; }
.hlegend .k-bar { width: 12px; height: 10px; border-radius: 3px 3px 0 0; background: var(--lp-bar); }
.hlegend .k-now { width: 12px; height: 10px; border-radius: 3px 3px 0 0; border: 1.5px dashed var(--lp-bar); border-bottom: 0; box-sizing: border-box; }
.hlegend .k-plan, .hlegend .k-allow { width: 14px; height: 0; border-top: 1.5px dashed var(--lp-soft); vertical-align: 3px; }
.hlegend .k-over { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--lp-over); vertical-align: 0; }

/* The chart's marks: one bar colour; the live month dashed; the plan a reference. */
.chart .slotbg { fill: var(--lp-accentBg); }
.chart .barx { fill: var(--lp-bar); }
.chart .barx.dim, .chart .overbar.dim { opacity: .42; }
.chart .nowbar { fill: color-mix(in srgb, var(--lp-bar) 16%, transparent); stroke: var(--lp-bar); stroke-width: 1.5; stroke-dasharray: 3 2.5; }
.chart .fy { stroke: var(--lp-edge); stroke-width: 1; }
.chart .fyl { font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); fill: var(--lp-faint); }
.chart .overbar { fill: var(--lp-over); }
.chart .mk-over { fill: var(--lp-over); }
.chart .brk { stroke: var(--lp-card); stroke-width: 2; fill: none; }
.chart .cm.sel, .chart .cv.sel { fill: var(--lp-accent); font-weight: 700; }
.chart .hit { fill: transparent; cursor: pointer; }
/* Labels sit over the plan line and the dashes: a card-coloured halo keeps them legible. */
.hchart .cv, .bchart .cv, .hchart .cl0 { paint-order: stroke; stroke: var(--lp-card); stroke-width: 3.5px; stroke-linejoin: round; }

/* The chosen month, under the chart. */
.readout { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--lp-ground); font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); overflow-wrap: anywhere; }
.readout b { color: var(--lp-ink); font-weight: 700; }
.readout .rt { color: var(--lp-ink); font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); }
.readout.idle { color: var(--lp-faint); }

/* A bucket's block: its name, its usual, its allowance and how often past it, its chart. */
.lpdetail.hist .bk { padding: 10px 0 2px; border-top: 1px solid var(--lp-edge); }
.lpdetail.hist .grp + .bk { border-top: 0; padding-top: 4px; }
.lpdetail.hist .bk .top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.lpdetail.hist .bk .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.lpdetail.hist .bk .us { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }
.lpdetail.hist .bk .sm { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); }
.lpdetail.hist .bk .sm .ot { margin-left: auto; }
.lpdetail.hist .bk .chart { margin-top: 6px; }

/* Every month: the chosen row lit; a month's note quieter. */
.lpdetail.hist .rows li.sel { background: var(--lp-accentBg); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; border-top-color: transparent; }
.lpdetail.hist .rows li.sel + li { border-top-color: transparent; }
.lpdetail.hist .rows .s2 { color: var(--lp-soft); }

/* Under three months: how many of three, and what comes after. */
.hearly { margin: 12px 0 0; font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); color: var(--lp-soft); }
.hearly .lbtn { margin-left: 8px; }
.step3 { display: flex; gap: 6px; margin-top: 10px; }
.step3 i { flex: 1; height: 6px; border-radius: 3px; background: var(--lp-track); }
.step3 i.on { background: var(--lp-bar); }

/* The doors: Saved this year's chart is a tap too. */
.lpage .tapchart { cursor: pointer; }
