/* Infographics on the Profit screen (see profitcharts.js). Light theme, the app's own colours. */
.vgrid { --viz-gray:#7f95a6; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; margin-bottom:16px; }
.vwide { grid-column:1 / -1; }
.vcard { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:16px 18px 14px; min-width:0; }
.vhead { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.vcard h3 { margin:0; font-size:15px; color:var(--acc); font-weight:600; }
.vsub { margin:2px 0 0; font-size:12px; color:var(--mute); }
.vnote { margin:10px 0 0; font-size:12px; color:var(--mute); }
.vtog { flex:none; font:inherit; font-size:12px; padding:3px 10px; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--acc); cursor:pointer; }
.vtog:hover { background:var(--tint-soft); }
.vtable[hidden], .vchart[hidden] { display:none; }
.vtable table { font-size:13px; }

/* where each rupee goes: a donut (thick ring, centre figure) with its legend beside it */
.dn { display:flex; align-items:center; gap:28px; flex-wrap:wrap; }
.dn-svg { flex:none; width:200px; height:200px; }
.dn-seg { cursor:default; outline:none; }
.dn-seg.profit { stroke:var(--acc); } .dn-seg.cost { stroke:var(--viz-gray); }
.dn-seg:hover, .dn-seg:focus { filter:brightness(1.18); }
.dn-big { font-family:inherit; font-size:34px; font-weight:700; fill:var(--acc); }
.dn-sub { font-family:inherit; font-size:12px; fill:var(--mute); }
.dn-side { flex:1; min-width:230px; }
.dn-legend { list-style:none; margin:0; padding:0; font-size:13px; }
.dn-legend li { display:grid; grid-template-columns:14px minmax(0, 1fr) auto 52px; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--line); }
.dn-legend .dn-total { grid-template-columns:minmax(0, 1fr) auto 52px; border-bottom:0; color:var(--mute); }
.dn-legend b { font-variant-numeric:tabular-nums; } .dn-legend small { color:var(--mute); font-size:12px; text-align:right; }
.dn-legend .sw { width:10px; height:10px; border-radius:2px; display:inline-block; }
.sw.cost { background:var(--viz-gray); } .sw.profit { background:var(--acc); }
.vhero { margin:14px 0 2px; font-size:15px; color:var(--ink); } .vhero b { font-size:22px; color:var(--acc); }

/* time columns */
.vsvg { display:block; width:100%; height:auto; overflow:visible; }
.vsvg text { font-family:inherit; font-size:11px; fill:var(--mute); }
.vsvg text.vl { fill:var(--ink); font-weight:600; }
.vsvg .grid { stroke:var(--line); stroke-width:1; }
.vsvg .axis { stroke:#9db4c6; stroke-width:1; }
.vsvg .viz-hit { fill:transparent; }
.viz-g { outline:none; }
.viz-mark.pos { fill:var(--acc); } .viz-mark.neg { fill:var(--bad); }
.viz-g:hover .viz-mark, .viz-g:focus .viz-mark { filter:brightness(1.3); }
.viz-g:hover .viz-hit, .viz-g:focus .viz-hit { fill:rgba(0,72,124,.06); }

/* ranked horizontal bars */
.hb-row { display:grid; grid-template-columns:minmax(90px, 190px) minmax(0, 1fr) 150px; align-items:center; gap:12px; padding:5px 6px; border-radius:6px; outline:none; }
.hb-row:hover, .hb-row:focus { background:var(--tint-soft); }
.hb-row:focus-visible { box-shadow:0 0 0 2px var(--acc); }
.hb-name { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hb-track { position:relative; height:14px; }
.hb-bar { position:absolute; top:0; height:14px; background:var(--acc); }
.hb-bar.pos { border-radius:0 4px 4px 0; } .hb-bar.neg { background:var(--bad); border-radius:4px 0 0 4px; }
.hb-bar.mute { background:var(--viz-gray); border-radius:0 4px 4px 0; }
.hb-zero { position:absolute; top:-3px; bottom:-3px; width:1px; background:#9db4c6; }
.hb-val { display:flex; justify-content:flex-end; align-items:baseline; gap:8px; font-size:13px; font-variant-numeric:tabular-nums; }
.hb-val small { color:var(--mute); font-size:12px; min-width:42px; text-align:right; }
.hb-row:hover .hb-bar, .hb-row:focus .hb-bar { filter:brightness(1.25); }

/* tooltip: value first, name second; a short key stroke in the series colour */
#vtip { position:fixed; z-index:60; display:none; pointer-events:none; max-width:280px; background:#fff; border:1px solid var(--line); border-radius:6px;
  box-shadow:0 4px 14px rgba(0,40,70,.18); padding:8px 11px; font-size:12px; color:var(--mute); }
#vtip .vt-title { color:var(--ink); font-weight:600; margin-bottom:4px; }
#vtip .vt-row { display:flex; align-items:center; gap:2px; line-height:1.55; }
#vtip .vt-row b { color:var(--ink); font-size:13px; font-variant-numeric:tabular-nums; }
#vtip .vt-key { display:inline-block; width:12px; height:3px; margin-right:6px; border-radius:2px; background:var(--viz-gray, #7f95a6); }
#vtip .vt-key.profit { background:var(--acc); } #vtip .vt-key.neg { background:var(--bad); } #vtip .vt-key.cost, #vtip .vt-key.mute { background:#7f95a6; }

@media (max-width:900px) { .vgrid { grid-template-columns:1fr; } .hb-row { grid-template-columns:minmax(80px, 130px) minmax(0, 1fr) 130px; } }
