/* My history tab. Phone-width safe: nothing forces the page wider than 375px. */
.hist{display:flex;flex-direction:column;gap:14px;min-width:0;max-width:100%;overflow-wrap:anywhere}
.hist *{box-sizing:border-box;min-width:0}
.hist-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.hist-top .seg{flex-wrap:wrap;max-width:100%}
.hist-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
@media (min-width:860px){.hist-grid{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}}
.hist-panel{min-width:0;max-width:100%;padding:16px}
.hist-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.hist-h{margin:0;font-size:16px;font-weight:600;color:var(--ink)}

/* chart */
.hist-plot{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px;align-items:end;height:170px;margin-top:12px}
.hist-col{appearance:none;border:0;background:transparent;padding:0;margin:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;cursor:pointer;color:var(--muted);font:inherit;border-radius:8px;min-width:0}
.hist-col:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.hist-stack{display:flex;flex-direction:column-reverse;width:100%;max-width:26px;height:100%;justify-content:flex-start;border-radius:6px 6px 3px 3px;overflow:hidden;background:var(--panel-2);transition:opacity .2s}
.hist-col[aria-pressed="true"] .hist-stack{box-shadow:0 0 0 2px var(--green)}
.hist-col:not([aria-pressed="true"]) .hist-stack{opacity:.85}
.hist-col:hover .hist-stack{opacity:1}
.hist-bar-part{display:block;width:100%;min-height:2px}
.hist-bar-wc{background:var(--wc)}
.hist-bar-gl{background:var(--gl)}
.hist-bar-auto{background:var(--auto)}
.hist-bar-other{background:var(--other)}
.hist-xl{font-size:10px;line-height:1;white-space:nowrap}
.hist-legend{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px;font-size:12px;color:var(--soft)}
.hist-legend span{display:inline-flex;align-items:center;gap:6px}
.hist-sw{display:inline-block;width:10px;height:10px;border-radius:3px}

/* detail */
.hist-nav{display:flex;align-items:center;gap:6px;min-width:0}
.hist-navlabel{font-size:14px;font-weight:600;color:var(--ink);text-align:center;min-width:0;overflow-wrap:anywhere}
.hist-navbtn{appearance:none;border:1px solid var(--edge-2);background:var(--panel-2);color:var(--ink);width:34px;height:34px;border-radius:50%;font-size:18px;line-height:1;cursor:pointer;flex:0 0 auto}
.hist-navbtn:disabled{opacity:.35;cursor:default}
.hist-navbtn:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.hist-total{font-size:30px;font-weight:700;color:var(--ink);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.hist-delta{font-size:13px;color:var(--muted);margin-top:2px}
.hist-up{color:var(--green)}
.hist-down{color:var(--red,#FF8A80)}
.hist-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0}
.hist-stat{background:var(--panel-2);border:1px solid var(--edge);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:2px;min-width:0}
.hist-stat b{font-size:17px;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.hist-stat span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.hist-feed{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.hist-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 0;border-top:1px solid var(--line);font-size:14px}
.hist-item-day{color:var(--muted);font-size:12px;white-space:nowrap}
.hist-item-line{color:var(--ink);overflow-wrap:anywhere}
.hist-item-amt{font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
.hist-none{margin:8px 0 0;color:var(--muted);font-size:14px}
.hist-more{appearance:none;border:0;background:transparent;color:var(--green);font:inherit;font-size:13px;padding:8px 0 0;cursor:pointer}
.hist-more:focus-visible{outline:2px solid var(--green);outline-offset:2px;border-radius:4px}
.hist-empty{margin:0;padding:24px 16px;text-align:center;color:var(--muted);font-size:14px;border:1px dashed var(--edge-2);border-radius:14px}

/* table */
.hist-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:10px}
.hist-table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums;min-width:520px}
.hist-table th,.hist-table td{padding:9px 8px;text-align:right;border-top:1px solid var(--line);white-space:nowrap}
.hist-table th{font-size:11px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;border-top:0}
.hist-table th:first-child,.hist-table td:first-child{text-align:left}
.hist-table td{color:var(--ink)}
.hist-table tr.hist-sel td{background:var(--green-a05)}

@media (max-width:480px){
  .hist-plot{gap:3px;height:150px}
  .hist-xl{font-size:9px}
  .hist-total{font-size:26px}
  .hist-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .hist-stat{padding:8px}
  .hist-stat b{font-size:15px}
}
