/* Charts and the cards several pages share (team, Me, a person, a project): charts, tokens per day, code
   changes, conversation size, projects & conversations, and one project's page. Loaded after board.css. */

/* ---------- charts ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart { position: relative; height: 170px; }
.chart.short { height: 100px; }
.chart.tiny { height: 64px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gl { stroke: var(--grid); }
.chart .bl { stroke: var(--axis); }
.chart text, .heat .hh, .heat .dl { fill: var(--muted); color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--wash); }
.chart .nodata { font-size: 12px; }
/* the newest bar rises into place, then glows */
.chart .now { transform-box: fill-box; transform-origin: bottom; animation: rise .7s cubic-bezier(.2,.8,.2,1), glow 1.4s ease-in-out .7s infinite alternate; }
@keyframes glow { from { opacity: 0.5; } to { opacity: 1; } }

@keyframes pop { from { transform: scale(0.85); background: color-mix(in srgb, var(--s1) 30%, transparent); } to { transform: scale(1); } }

.hbars { display: grid; gap: 4px; }
.hb { display: grid; grid-template-columns: 70px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: 11.5px; }
.hb .n { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .t { height: 10px; display: flex; gap: 2px; }
.hb .t i { display: block; height: 100%; border-radius: 0 3px 3px 0; min-width: 2px; }
.hb .t i.ok { background: var(--s1); }
.hb .t i.bad { background: var(--critical); border-radius: 0 3px 3px 0; }
.hb .c { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.donut-wrap { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; align-items: center; }
.donut-wrap svg { width: 68px; height: 68px; }
.donut-wrap .dv { font-size: 13px; font-weight: 700; fill: var(--ink); }
.donut-wrap .du { font-size: 8px; fill: var(--muted); }
.dl-list { display: grid; gap: 4px; font-size: 11.5px; min-width: 0; }
.dl-list span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.dl-list i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dl-list b { margin-left: auto; font-variant-numeric: tabular-nums; }

.heat { display: grid; grid-template-columns: 22px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; max-width: calc(22px + 24 * 18px); }
.heat .c { aspect-ratio: 1; border-radius: 4px; background: var(--wash); } /* always squares */
.heat .c:hover { outline: 2px solid var(--ink); outline-offset: 0; }
.heat .hh { text-align: center; font-size: 9px; }
.heat .dl { font-size: 9px; }
.ramp { display: flex; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); }
.ramp i { width: 10px; height: 10px; border-radius: 2px; }

/* Newest chart bar rises into place; timeline chips slide in */
@keyframes rise { from { transform: scaleY(0.2); opacity: .3; } }
@keyframes slide-in { from { transform: translateX(-24px) scale(.85); opacity: 0; background: color-mix(in srgb, var(--s1) 30%, transparent); } }

.projects-list { display: flex; flex-direction: column; gap: 6px; }
/* Code changes (lines.js): net lines per project over the range, with +added / −removed */
.cl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 34%); gap: 18px; align-items: start; }
.cl-chart svg { display: block; width: 100%; height: 170px; overflow: visible; }
.cl-zero { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cl-cursor { stroke: var(--axis); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cl-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.cl-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.cl-keys li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.cl-keys i { width: 10px; height: 10px; border-radius: 3px; }
.cl-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.cl-keys .add { color: var(--good); font-variant-numeric: tabular-nums; font-size: 12px; }
.cl-keys .del { color: var(--critical); font-variant-numeric: tabular-nums; font-size: 12px; }
@media (max-width: 720px) { .cl { grid-template-columns: minmax(0, 1fr); } }

/* Me: Conversation size (person.js sizeCard) */
.pv-size .sz { display: flex; flex-direction: column; gap: 6px; }
.pv-size .sz-b { position: relative; height: 10px; border-radius: 5px; background: var(--wash); }
.pv-size .sz-b i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--s1); }
.pv-size .sz.warm .sz-b i { background: var(--warn); }
.pv-size .sz.hot .sz-b i { background: var(--critical); }
.pv-size .sz-b em { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); opacity: .45; }
.pv-size .sz-v { font-size: 13px; color: var(--ink-2); }
.pv-size .sz-v b { font-size: 18px; color: var(--ink); }
.pv-size .sz-facts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-2); }

/* Tokens per day (calendar.js): month blocks of day squares, beige for none, blue for more */
.cal { --cell: 16px; }
.cal-months { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.cal-m b { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.cal-g { display: grid; grid-template-columns: repeat(7, var(--cell)); gap: 3px; }
.cal-d { display: block; width: var(--cell); height: var(--cell); border-radius: max(3px, calc(var(--cell) / 5)); background: var(--cal0); }
.cal-d.l1 { background: var(--seq1); } .cal-d.l2 { background: var(--seq2); } .cal-d.l3 { background: var(--seq3); }
.cal-d.l4 { background: var(--seq4); } .cal-d.l5 { background: var(--seq6); }
.cal-d.out:not(.l0) { opacity: .4; }
.cal-d.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.cal-g .cal-d:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-key { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 10px; font-size: 10.5px; color: var(--muted); }
.cal-key .cal-d { width: 10px; height: 10px; border-radius: 3px; }
.cal-key span { margin: 0 4px; }

/* Latest conversations (projects.js recentHTML): who, the title over person · project, how long, when; a row opens it */
.rcs { display: flex; flex-direction: column; container-type: inline-size; }
@container (max-width: 380px) { .rc-m { display: none; } } /* a small card: who, what, when */
.rc { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--grid); color: inherit; text-decoration: none; }
.rc:first-child { border-top: 0; padding-top: 2px; }
a.rc:hover .rc-t b { text-decoration: underline; text-underline-offset: 3px; }
.rc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-t b, .rc-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-t b { font-size: 13px; font-weight: 700; }
.rc-t small { font-size: 11.5px; color: var(--muted); }
.rc-m { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-a { min-width: 60px; text-align: right; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rc-all { align-self: flex-start; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.rc-all:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .rc-m { display: none; } }

/* a conversation's prompts as a small chart (projects.js promptSpark): columns = what each prompt spent, line = its context */
.pj-spark { display: block; width: 100%; height: 30px; overflow: visible; }
.pj-spark.empty { height: 8px; border-radius: 4px; background: var(--wash); }
.pj-legend { display: flex; gap: 14px; font-size: 11.5px; font-weight: 700; color: var(--muted); margin: -4px 0 8px; }
.pj-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pj-legend i.c { width: 4px; height: 11px; border-radius: 1px; background: var(--s1); }
.pj-legend i.l { width: 14px; height: 0; border-top: 1.6px solid var(--ink); opacity: .75; }

/* one project, unfolding (project.html + project.js) */
.prj { max-width: 1100px; margin: 0 auto; padding: 12px 16px 60px; display: flex; flex-direction: column; gap: 14px; }
.prj-head { display: flex; flex-direction: column; gap: 6px; }
.prj-head .pv-back { font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.prj-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.prj-title h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.prj-title .muted { font-size: 12.5px; }
.prj-ranges { margin-left: auto; display: inline-flex; gap: 4px; }
.prj-ranges button { border: 0; background: var(--wash); color: var(--ink-2); font: inherit; font-weight: 800; font-size: 12.5px; padding: 6px 10px; border-radius: calc(10px * var(--sq)); cursor: pointer; }
.prj-ranges button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.prj-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prj-tiles .kpi small { display: block; margin-top: 2px; font-size: 11.5px; }
.prj-unfold header, .prj-convs header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prj-unfold .pj-legend { margin: 0; }
.pj-legend i.a { width: 12px; height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--s3) 28%, transparent); }
.prj-chartw { position: relative; margin-top: 8px; padding-bottom: 20px; animation: prj-in .25s ease-out; }
@keyframes prj-in { from { opacity: 0; } to { opacity: 1; } }
.prj-chart { display: block; width: 100%; height: 240px; }
.prj-days { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; }
.prj-days span { position: absolute; padding-left: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.prj-grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.prj-cum { fill: color-mix(in srgb, var(--s3) 10%, transparent); }
.prj-ctx { fill: none; stroke: var(--ink); stroke-width: 1.6; opacity: .7; stroke-linejoin: round; }
.prj-tick { font-size: 11px; fill: var(--muted); text-anchor: start; }
.prj-hit { cursor: default; }
.prj-share { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-top: 14px; }
.prj-share i { display: block; height: 100%; }
.prj-who { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; }
.prj-who span { display: inline-flex; align-items: center; gap: 6px; }
.prj-who small { color: var(--muted); }
.prj-av { width: 22px; height: 22px; border-radius: 50%; corner-shape: round; display: inline-grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; flex: none; vertical-align: middle; }
.prj-list { display: flex; flex-direction: column; }
.prj-c { display: grid; grid-template-columns: 22px minmax(0, 1.2fr) minmax(80px, 1fr) 56px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--grid); }
.prj-c:first-child { border-top: 0; }
.prj-ct { min-width: 0; display: flex; flex-direction: column; }
.prj-ct b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prj-ct small { font-size: 11.5px; }
.prj-cc { text-align: right; font-variant-numeric: tabular-nums; }
.prj-tipv { display: flex; gap: 14px; margin-top: 6px; }
.prj-tipv span { display: flex; flex-direction: column; }
.prj-tipv small { font-size: 10.5px; color: var(--muted); }
@media (max-width: 720px) { .prj-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prj-c { grid-template-columns: 22px minmax(0, 1fr) 56px; } .prj-cs { display: none; } .prj-ranges { margin-left: 0; } }
/* the project page with one conversation picked: its row marked, the chart's title says which, "All" goes back */
button.prj-c { width: 100%; border: 0; border-top: 1px solid var(--grid); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 9px 6px; border-radius: 0; }
button.prj-c:first-child { border-top: 0; }
button.prj-c:hover { background: var(--wash); }
button.prj-c[aria-pressed="true"] { background: color-mix(in srgb, var(--s1) 10%, transparent); box-shadow: inset 3px 0 0 var(--s1); }
.prj-pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; font-weight: 700; }
.prj-pick b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.prj-pick button { border: 0; border-radius: 999px; padding: 3px 10px; background: var(--wash); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
/* tokens by kind: one bar (input, output, cache read, cache write), each kind's number and share under it */
.prj-tok { margin-top: 14px; }
.prj-tok .prj-share { margin-top: 0; }
.prj-tok ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; }
.prj-tok li { display: inline-flex; align-items: center; gap: 6px; }
.prj-tok li i { width: 9px; height: 9px; border-radius: 2px; }
.prj-tok li small { color: var(--muted); }

/* every conversation, a page at a time (work.html + work.js) */
.cv-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.cv-filters label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.cv-filters select { min-width: 160px; max-width: 260px; padding: 6px 8px; border-radius: calc(10px * var(--sq)); border: 1px solid var(--axis); background: var(--raised); color: var(--ink); font: inherit; font-size: 13px; }
.cv-list { display: flex; flex-direction: column; }
.cv-c { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--grid); color: inherit; text-decoration: none; }
.cv-c:first-child { border-top: 0; }
.cv-c:hover .rc-t b { text-decoration: underline; text-underline-offset: 3px; }
.cv-n { width: 64px; flex: none; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.cv-n.cv-tok { width: 72px; }
b.cv-n { color: var(--ink); }
.cv-c .rc-a { width: 64px; flex: none; }
/* the columns' names (each says what it counts on hover); the one the list is ordered by in ink */
.cv-head { padding-top: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cv-head > span { font-size: inherit; font-weight: inherit; color: inherit; cursor: help; }
.cv-head .rc-t { cursor: default; }
.cv-head .on { color: var(--ink); }
.cv-head .on::after { content: " ▾"; }
.cv-sp { width: 22px; flex: none; }
.cv-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12.5px; }
.cv-pager button { border: 0; border-radius: calc(10px * var(--sq)); padding: 7px 12px; background: var(--wash); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.cv-pager button:disabled { opacity: .4; cursor: default; }
.cv-count { margin: 10px 0 0; }
@media (max-width: 720px) { .cv-tok, .cv-c .cv-n:not(b) { display: none; } }
