/* Reports (0.5, B2): the Spending year view (C), Cash flow (B) and Forecast (A) pages, from the approved round-3 mock
   (hermes-finance-reports-cash-4c710f19113adaf6). Desktop rail on the right at 1024 px and up; at 390 px the KPIs come
   first, the heatmap becomes a category card with a 44 px header, the Sankey becomes labelled bars, and the balance line
   keeps its two named lines. No glow, no animation beyond the app's own fades; body 15 px, secondary 13 px. */

.rp-bar { display: flex; align-items: center; gap: 12px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.rp-views button { min-height: 34px; }
.rp-body { display: grid; gap: 18px; min-width: 0; }

/* --- Spending: the year heatmap + the KPI rail --------------------------------------------------------------- */
.rp-rc { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 18px; align-items: start; min-width: 0; }
.rp-heat { grid-column: 1; grid-row: 1; padding: 18px 22px; }
.rp-rail { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rp-head h2 { font-size: 18px; font-weight: 650; }
.rp-note { font-size: 13px; color: var(--dim); }
.rp-sub { font-size: 13px; color: var(--dim); }
.rp-kpi { padding: 18px; }
.rp-kpi h3 { font-size: 14px; margin-bottom: 6px; }
.rp-kpi .big { font-size: 34px; }
.rp-kpi .rp-name { font-size: 27px; letter-spacing: -.02em; }

.rp-hm { display: grid; grid-template-columns: minmax(192px, 1.15fr) repeat(var(--n, 12), minmax(0, 1fr)) 78px;
  gap: 4px 3px; align-items: center; min-width: 0; }
.rp-hh { font-size: 13px; color: var(--dim); text-align: center; padding-bottom: 2px; white-space: nowrap; }
.rp-hh.on { color: var(--fg); font-weight: 650; }
.rp-hh.rp-lab { text-align: left; }
.rp-hh.rp-tot { text-align: right; }
.rp-rl { display: flex; align-items: center; gap: 8px; font-size: 14.5px; min-width: 0; padding-right: 8px; }
.rp-rl > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-c { height: 30px; border-radius: 6px; border: 1px solid transparent; padding: 0; min-width: 0;
  background: rgba(142, 168, 255, var(--a, .06)); }
button.rp-c { cursor: pointer; }
button.rp-c:hover { border-color: var(--line2); }
.rp-c.refund { background: rgba(255, 123, 123, var(--a, .08)); }
.rp-c.nodata { background: repeating-linear-gradient(-45deg, var(--card2) 0 4px, var(--card3) 4px 8px); }
.rp-c.on { outline: 2px solid var(--fg); outline-offset: 1px; }
.rp-tv { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; font-size: 13px; color: var(--dim); }
.rp-ramp { display: inline-flex; align-items: center; gap: 8px; }
.rp-ramp i { width: 120px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(142, 168, 255, .08), rgba(142, 168, 255, .85)); }

.rp-drill { grid-column: 1 / -1; min-width: 0; }
.rp-drill:not(:empty) { background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin: 2px 0 8px; }
.rp-dh { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.rp-gnr { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px 26px;
  margin-bottom: 10px; }
.rp-gn { display: grid; gap: 1px; }
.rp-gn > span { font-size: 13px; color: var(--dim); }
.rp-gn > b { font-size: 15px; font-weight: 650; }
.rp-gn.net > b { font-size: 16px; }
.rp-tx { display: grid; gap: 2px; }
.rp-txr { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.rp-txr > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-d { color: var(--dim); font-size: 13px; margin-left: 8px; }
.rp-dfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.rp-cards { display: none; }

.rp-month { padding: 18px 20px; }
.rp-mhead { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.rp-mhead b { font-size: 16px; font-weight: 600; margin-right: 8px; }
.rp-mnow { font-size: 22px; font-weight: 700; }
.rp-mnow small { font-size: 13px; font-weight: 500; color: var(--dim); margin-left: 8px; }
.rp-msvg { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.rp-axis { stroke: var(--line2); stroke-width: 1; }
.rp-area { fill: rgba(142, 168, 255, .12); }
.rp-line { fill: none; stroke: var(--acc); stroke-width: 2; }
.rp-dot { fill: var(--acc); }
.rp-dot.now { fill: var(--fg); }
.rp-tick { fill: var(--dim); font-size: 13px; }

/* --- Cash flow: the Sankey on a desktop, labelled bars on a phone --------------------------------------------- */
.rp-flow { padding: 20px 22px; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.rp-svg { width: 100%; height: auto; display: block; }
.rp-sk-name { fill: var(--fg); font-size: 13.5px; font-weight: 600; }
.rp-sk-amt { fill: var(--dim); font-size: 13px; }
.rp-sk-cap { fill: var(--dim); font-size: 13px; }
.rp-sk-big { fill: var(--fg); font-size: 20px; font-weight: 700; }
.rp-sk-short { fill: var(--bad); font-size: 13.5px; font-weight: 650; }
.rp-sk-a, .rp-sk-lk { cursor: pointer; }   /* a Cash flow bar and its name open Transactions */
.rp-sk-a:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.rp-sk-lk:hover .rp-sk-name { text-decoration: underline; }
a.rp-fr { display: block; color: inherit; text-decoration: none; }
a.rp-fr:hover .rp-fl b { text-decoration: underline; }
a.rp-fr:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
.rp-bars { display: none; }
.rp-fr { padding: 8px 0; border-top: 1px solid var(--line); }
.rp-fl { display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; }
.rp-fl b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; align-self: center; }
.rp-fa { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.rp-track { height: 8px; border-radius: 4px; background: var(--card3); margin-top: 7px; overflow: hidden; }
.rp-track i { display: block; height: 100%; border-radius: 4px; }
.rp-mi, .rp-flh { display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 12px 0 6px; border-top: 1px solid var(--line2); font-size: 14px; }
.rp-mi b { font-size: 18px; }
.rp-flh.bal { color: var(--bad); border-top: 1px dashed rgba(255, 123, 123, .4); }
.rp-rem { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 12px 0 4px;
  border-top: 1px solid var(--line2); font-size: 14px; }
.rp-rem .v { font-size: 18px; font-weight: 700; margin-left: auto; }
.rp-rem small { font-size: 13px; color: var(--dim); flex-basis: 100%; }
.rp-rem.short .v { color: var(--bad); }
.rp-moves .li > .grow { display: flex; gap: 10px; align-items: baseline; flex: 1; min-width: 0; }
.rp-moves .li > .grow > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-moves .li > .grow > span { color: var(--dim); font-size: 13px; white-space: nowrap; }
.rp-tot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 14px; }

/* --- Forecast: accounts, KPIs, the ask card, the balance line -------------------------------------------------- */
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rp-acc { padding: 18px 20px; }
.rp-askwrap { display: grid; gap: 12px; }
.rp-ask { border-color: rgba(245, 180, 84, .42); }
.rp-q { font-size: 15px; color: var(--mut); margin-bottom: 12px; max-width: 74ch; }
.rp-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rp-warn { border-color: rgba(245, 180, 84, .34); }
.rp-chart { padding: 18px 20px; }
.rp-leg { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.rp-leg i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.rp-leg i.dash { height: 0; border-top: 2px dashed var(--fg); background: none; }
.rp-leg i.band { height: 12px; border-radius: 3px; background: rgba(142, 168, 255, .3); border: 1px solid rgba(142, 168, 255, .5); }
.rp-leg i.dot { width: 9px; height: 9px; border-radius: 50%; }
.rp-leg i.dot.in { background: var(--ok); }
.rp-leg i.dot.out { background: var(--bad); }
.rp-fsvg { margin: 4px 0 8px; }
.rp-gl { stroke: var(--grid); stroke-width: 1; }
.rp-band { fill: rgba(142, 168, 255, .3); stroke: rgba(142, 168, 255, .45); stroke-width: .8; }
.rp-line.lower, .rp-line.higher { stroke: rgba(142, 168, 255, .45); stroke-width: 1.5; }
.rp-line.exp { stroke: var(--fg); stroke-width: 2; stroke-dasharray: 5 5; }
.rp-ev.in { fill: var(--ok); }
.rp-ev.out { fill: var(--bad); }
.rp-ev.low { fill: var(--warn); }
.rp-ends { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 6px 0 8px; }
.rp-er { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.rp-er > i { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.rp-er b { display: grid; }
.rp-er small { font-size: 13px; font-weight: 500; color: var(--dim); }
.rp-er .v { font-weight: 700; margin-left: auto; }
.rp-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rp-lists .li > .grow { display: flex; gap: 10px; align-items: baseline; flex: 1; min-width: 0; }
.rp-lists .li > .grow > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-lists .li > .grow > span { color: var(--dim); font-size: 13px; white-space: nowrap; }

/* --- 390 px and the tablet middle ------------------------------------------------------------------------------ */
@media (max-width: 1319.98px) {
  /* the 12 month columns need the width: below this the rail moves above the heatmap instead of squeezing it */
  .rp-rc { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rp-heat { grid-column: 1; grid-row: 2; }
  .rp-rail { grid-column: 1; grid-row: 1; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .rp-rail .rp-kpi { flex: 1 1 calc(50% - 5px); }
  .rp-kpi .big { font-size: 28px; }
  .rp-kpi .rp-name { font-size: 23px; }
  .rp-hm { grid-template-columns: minmax(170px, 1fr) repeat(var(--n, 12), minmax(0, 1fr)) 72px; }
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-lists h3 small { display: none; }
}
@media (max-width: 1023px) {
  .rp-rc { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rp-heat { grid-column: 1; grid-row: 2; padding: 16px; }
  .rp-rail .rp-kpi { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .rp-hm { display: none; }
  .rp-cards { display: grid; gap: 12px; }
  .rp-cat { padding: 12px 14px 14px; }
  .rp-cat-b { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0;
    background: none; border: 0; color: inherit; text-align: left; font-size: 15px; }
  .rp-cat-b > b { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }   /* a long name wraps to a second line; cents in the amount made it clip at 360 */
  .rp-cat-b .amt { font-size: 15px; }
  .rp-cat-b > svg.i { transition: transform var(--mo-hover) ease-out; }
  .rp-cat.open .rp-cat-b > svg.i { transform: rotate(180deg); }
  .rp-spark { display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
  .rp-spark i { height: 34px; border-radius: 4px; background: rgba(142, 168, 255, var(--a, .12));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035); }
  .rp-spark i.nd { background: repeating-linear-gradient(-45deg, var(--card2) 0 3px, var(--card3) 3px 6px); }
  .rp-spark i.on { outline: 2px solid var(--fg); outline-offset: -2px; }
  .rp-flow .rp-svg { display: none; }
  .rp-bars { display: block; }
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-lists { grid-template-columns: minmax(0, 1fr); }
  .rp-month .rp-msvg { margin-top: 4px; }
  .rp-ask .btn.sm, .rp-ask .btn { min-height: 44px; padding: 10px 16px; }
  .rp-views { flex: 1 1 100%; }
  .rp-views button { flex: 1; }
}
@media (max-width: 460px) {
  .rp-rail .rp-kpi { flex: 1 1 calc(50% - 5px); padding: 13px 14px; }
  .rp-kpi .big { font-size: 24px; }
  .rp-kpi .rp-name { font-size: 19px; }
  .rp-kpi h3 { font-size: 13px; margin-bottom: 6px; min-height: 0; }
  .rp-chips .pill { font-size: 13px; }
  .rp-gnr { gap: 6px 18px; }
  .rp-views button { padding: 8px 4px; font-size: 13.5px; }
  .rp-month { padding: 14px; }
}
/* Desktop keeps the card list, the bars and the phone notes out of the way. */
@media (min-width: 1024px) { .rp-cards, .rp-bars { display: none; } }
@media (min-width: 1024px) { .rp-phonly { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .rp-cat-b > svg.i { transition: none; }
}

/* --- the ⓘ: a card's small text, behind an icon (round-4 mock board). A details popover that opens in place. ----- */
.rp-body .card h3 { display: flex; align-items: center; gap: 8px; }   /* this page only: other pages' card titles are theirs */
.vx-i { position: relative; margin-left: auto; display: inline-block; flex: none; }
.vx-i summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px;
  margin: -10px -10px -10px 0; color: var(--dim); border-radius: 50%; }
.vx-i summary::-webkit-details-marker { display: none; }
.vx-i summary svg { width: 18px; height: 18px; }
.vx-i[open] summary, .vx-i summary:hover { color: var(--acc); }
.vx-i summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 0; }
.vx-pop { position: absolute; right: 0; top: 40px; z-index: 30; width: min(268px, calc(100vw - 32px)); background: var(--card2);
  border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; color: var(--fg);
  font-weight: 400; text-align: left; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.vx-pop p { margin: 0 0 8px; }
.vx-pop p:last-child { margin: 0; }
/* hero cards: centred, the icon in the right corner, the popover opening toward the screen */
.vx-kpi { position: relative; overflow: visible; text-align: center; z-index: 1; }
.vx-kpi:has(details[open]) { z-index: 40; }
.vx-kpi h3 { justify-content: center; min-height: 32px; margin-bottom: 6px; font-size: 14px; }
.vx-kpi > .vx-hi { display: grid; width: 32px; height: 32px; margin: 0 auto 8px; }
/* the hero icon sits outside the card's h3, so it wears the same chip the title icons and category icons do: a tinted square, the glyph in its colour */
.vx-kpi > .vx-hi { --rgb: 142, 168, 255; place-items: center; border-radius: 10px; background: rgba(var(--rgb), .14); color: rgb(var(--rgb)); }
.vx-kpi > .vx-hi > svg { width: 56%; height: 56%; }
:root[data-theme=light] .vx-kpi > .vx-hi { color: color-mix(in srgb, rgb(var(--rgb)) 72%, #000); background: rgba(var(--rgb), .16); }
.vx-kpi .big, .vx-kpi .pill { margin-left: auto; margin-right: auto; }
.vx-kpi .rp-name { display: block; }
.vx-corner { position: static; display: block; height: 0; margin: 0; }
.vx-corner summary { position: absolute; top: 2px; right: 2px; z-index: 3; margin: 0; }
.vx-corner .vx-pop { top: calc(100% + 6px); right: 0; left: auto; width: 232px; max-width: calc(100vw - 32px); }
@media (max-width: 1319.98px) { .vx-kpi:nth-child(odd) .vx-corner .vx-pop { left: 0; right: auto; } }
.vx-pop { max-width: calc(100vw - 32px); }
/* Forecast accounts: a real checkbox in a row, never a coloured pill */
.vx-rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 4px; }
.vx-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 15px; cursor: pointer; position: relative; }
.vx-row:first-child { border-top: 0; }
.vx-row:has(input:checked) { color: var(--fg); }
.vx-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vx-bx { width: 22px; height: 22px; border: 2px solid var(--line2); border-radius: 6px; display: grid; place-items: center;
  background: transparent; flex: none; }
.vx-bx svg { width: 14px; height: 14px; stroke: var(--acc); stroke-width: 3.2; opacity: 0; }
.vx-row input:checked + .vx-bx { border-color: var(--acc); }
.vx-row input:checked + .vx-bx svg { opacity: 1; }
.vx-row input:focus-visible + .vx-bx { outline: 2px solid var(--acc); outline-offset: 2px; }
.vx-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-body .card { position: relative; }
.rp-chart:has(details[open]), .rp-flow:has(details[open]), .rp-heat:has(details[open]), .rp-acc:has(details[open]),
.rp-ask:has(details[open]), .rp-lists .card:has(details[open]) { z-index: 40; }
.rp-heat h3, .rp-flow h3, .rp-chart h3 { flex-wrap: nowrap; }
.rp-heat h3 small, .rp-flow h3 small, .rp-chart h3 small { min-width: 0; margin-left: auto; text-align: right; }
.rp-heat h3 small + .vx-i, .rp-flow h3 small + .vx-i, .rp-chart h3 small + .vx-i { margin-left: 0; }
/* beside the heat card (wide), the icon sits in the corner so every card title starts at the same height */
@media (min-width: 1320px) {
  .vx-kpi > .vx-hi { position: absolute; left: 14px; top: 13px; margin: 0; }
  .vx-kpi h3 { padding: 0 34px; }
}
@media (max-width: 600px) {   /* the period is already in the pill: a phone's card title keeps its whole name */
  .rp-flow h3 small, .rp-chart h3 small { display: none; }
}
