/* Your stats (design A, Overview): period switch and currency picker, four tiles, money in and out per day, week or
   month with the Rewards card beside it, then what you did, where the money came from and highlights.
   Colours and fonts come from /css/txlist.css (.ycp), like the history page. */
body { background-color: #11141A; }


.st { padding: 30px 32px 70px; max-width: 1240px; }
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.st-head h1 { margin: 0; font-family: "titles", sans-serif !important; font-weight: 400; font-size: 32px; color: #E4E8EF; }
.st-head p { margin: 8px 0 0; font-size: 15px; color: #A5ACB9; }

/* Period switch and currency picker */
.st-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.ycp .seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.ycp .seg button:hover { color: var(--text); }
.seg .s { display: none; }
.ycp .seg button.on { color: #fff; background: var(--surface-3); box-shadow: inset 0 0 0 1.5px rgba(155, 123, 255, .55); }
.ycp .cur-pick { position: relative; display: inline-flex; align-items: center; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text); }
.ycp .cur-pick:hover { border-color: #3A4257; }
.ycp .cur-pick:focus-within { outline: 2px solid #7E7BFF; outline-offset: 2px; }
.cur-face { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 10px; pointer-events: none; }
.cur-face .muted { font-weight: 400; }
/* The native list, invisible over the face, so phones get their own picker and keyboards work as usual. */
.ycp .cur-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }

/* Cards and tiles */
.card { position: relative; min-width: 0; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.card-h p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.card-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--link) !important; white-space: nowrap; }
.card .none { margin: 0; font-size: 13px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 98px; padding: 15px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.tile.lead { background: linear-gradient(135deg, rgba(155, 123, 255, .14), rgba(58, 141, 240, .07)), var(--surface); border-color: #2E3150; }
.tile > span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile b { font-size: 24px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b .cur { font-size: 15px; font-weight: 500; color: var(--text-2); }
.tile small { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tile small.held { color: var(--hold); }
.d-up { color: var(--in) !important; }
.d-down { color: #F5A3A3 !important; }

.a-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.a-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* The chart: money in above the line, money out below it */
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
/* The chart takes the card's height beside the Rewards card; the SVG sits on top so it never stretches the row. */
.a-chart { display: flex; flex-direction: column; }
.a-chart #chart { position: relative; flex: 1 0 auto; min-height: 264px; margin: 4px -4px 0 -8px; }
.a-chart #chart svg { position: absolute; left: 0; top: 0; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: 'YCP UI', Arial, sans-serif; font-variant-numeric: tabular-nums; }
.chart .ax.val { fill: var(--text-2); font-weight: 500; }
.tip { position: absolute; z-index: 5; min-width: 168px; padding: 10px 12px; border-radius: 11px; background: #0D1017; border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); pointer-events: none; font-size: 12.5px; }
.tip-h { margin-bottom: 6px; font-weight: 600; color: var(--text); }
.tip-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--muted); }
.tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip-row b { margin-left: auto; padding-left: 14px; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Rewards card */
.a-side { display: flex; flex-direction: column; }
.a-side .side-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(155, 123, 255, .16); color: #C9BEFF; margin-bottom: 14px; }
.a-side h3 { margin: 0; font-size: 15px; font-weight: 600; }
.a-side .side-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.a-side .side-big { margin: 14px 0 2px; font-size: 30px; font-weight: 600; letter-spacing: -.01em; color: var(--in); white-space: nowrap; }
.a-side .side-big .cur { font-size: 17px; font-weight: 500; color: var(--text-2); }
.a-side .side-of { min-height: 18px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.a-side .rows { display: flex; flex-direction: column; }
.a-side .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13.5px; color: var(--text-2); border-top: 1px solid var(--line); }
.a-side .row b { font-weight: 500; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.a-side .side-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Breakdowns */
.hb + .hb { margin-top: 13px; }
.hb-top { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.hb-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-top b { margin-left: auto; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-top em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 4px; }
.hb-track { margin-top: 7px; height: 6px; border-radius: 6px; background: var(--surface-3); }
.hb-track i { display: block; height: 100%; border-radius: 6px; background: #7A6CF0; }
.kic { flex: none; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--t); background: color-mix(in srgb, var(--t) 17%, transparent); }

.facts { display: flex; flex-direction: column; }
.fact { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.fact > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fact span { font-size: 12px; color: var(--muted); }
.fact b { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact b small { font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* Loading and errors */
.st-body.is-loading .tile, .st-body.is-loading .card { color: transparent; }
.st-body.is-loading .tile::after, .st-body.is-loading #chart::after, .st-body.is-loading .a-side::after { content: ""; display: block; height: 14px; width: 60%; margin-top: auto; border-radius: 6px; background: var(--surface-3); animation: st-pulse 1.2s ease-in-out infinite; }
.st-body.is-loading #chart::after { height: 200px; width: 100%; margin: 20px 0 0 8px; border-radius: 12px; }
.st-body.is-busy { opacity: .55; transition: opacity .15s; }
@keyframes st-pulse { 50% { opacity: .45; } }
.st-error { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 20px; margin-bottom: 14px; border-radius: 16px; background: var(--surface); border: 1px solid #4A2A33; font-size: 13.5px; color: var(--text-2); }
.st-error b { font-size: 15px; font-weight: 600; color: var(--text); }
.st-error .btn { margin-top: 6px; }

@media (max-width: 1180px) { .tiles { grid-template-columns: 1fr 1fr; } .a-row { grid-template-columns: 1fr 1fr; } .a-row > :last-child { grid-column: 1 / -1; } }
@media (max-width: 750px) {
  .st { padding: 22px 14px 120px; }
  .st-head { margin-bottom: 16px; }
  .st-head h1 { font-size: 26px; }
  .st-head p { font-size: 14px; }
  .st-head .btn { display: none; }
  .st-controls { flex-wrap: nowrap; gap: 8px; }
  .seg { flex: 1; min-width: 0; gap: 2px; padding: 3px; }
  .ycp .seg button { flex: auto; height: 34px; padding: 0 4px; font-size: 12.5px; }
  .seg .s { display: inline; } .seg .l { display: none; }
  .ycp .cur-pick { flex: none; }
  .cur-face { gap: 4px; padding: 0 8px; }
  .cur-face .code, .cur-face .muted { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .tile { min-height: 86px; padding: 12px; border-radius: 14px; }
  .tile b { font-size: 19px; }
  .tile b .cur { font-size: 13px; }
  .card { padding: 16px; border-radius: 16px; }
  .a-grid, .a-row { grid-template-columns: 1fr; gap: 10px; }
  .a-grid { margin-bottom: 10px; }
  .a-chart .card-h { flex-direction: column; gap: 10px; }
  .a-chart #chart { min-height: 210px; }
  .a-side .side-big { font-size: 26px; }
}
