/* ------------------------------------------------------------------
   Tool chrome shared by the money + analytics tools (charts, editable
   row lists, legends). Scoped to the tool pages that load this file.
   Colours come from the theme tokens so both themes stay legible.
   ------------------------------------------------------------------ */

.chart{display:block;width:100%;height:auto}
.chart .axl{font-family:var(--pixel);font-size:9px;letter-spacing:.04em;fill:var(--muted)}
.chart .axl--ink{fill:var(--ink)}
.chart .gridline{stroke:var(--line);stroke-width:1}
.chart .axisline{stroke:var(--line-strong);stroke-width:1}
.chart .bar-a{fill:var(--accent);stroke:var(--ink);stroke-width:1}
.chart .bar-b{fill:var(--ink);fill-opacity:.2;stroke:var(--ink);stroke-width:1}
.chart .bar-c{fill:var(--muted);fill-opacity:.5;stroke:var(--ink);stroke-width:1}
.chart .bar-d{fill:var(--paper-3);stroke:var(--ink);stroke-width:1}
.chart .line-a{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.chart .line-b{fill:none;stroke:var(--ink);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.chart .line-c{fill:none;stroke:var(--muted);stroke-width:1.5;stroke-dasharray:5 4}
.chart .zero{stroke:var(--ink);stroke-width:1.5;stroke-dasharray:5 4}
.chart .dot{fill:var(--ink);stroke:var(--paper-2);stroke-width:1.5}
.chart .dot-a{fill:var(--accent);stroke:var(--ink);stroke-width:1.5}
.chart .area-a{fill:var(--accent);fill-opacity:.14;stroke:none}

.chart-wrap{overflow-x:auto;margin-top:18px}
.chart-wrap .chart{min-width:520px}

.legend{display:flex;flex-wrap:wrap;gap:16px;margin-top:14px;font-size:13px;color:var(--muted);align-items:center}
.legend span{display:inline-flex;align-items:center;gap:8px}
.legend i{display:inline-block;width:12px;height:12px;border:1px solid var(--ink);flex:none}
.legend .k-a{background:var(--accent)}
.legend .k-b{background:var(--ink);opacity:.32}
.legend .k-c{background:var(--muted);opacity:.55}
.legend .k-d{background:var(--paper-3)}
.legend .k-line{width:16px;height:0;border:0;border-top:2.5px solid var(--accent)}
.legend .k-line2{width:16px;height:0;border:0;border-top:2px solid var(--ink)}

/* editable row lists (team, one-offs, tiers, funding) */
.rows{display:grid;gap:10px}
.rows__head{
  font-family:var(--pixel);font-size:9px;letter-spacing:.05em;text-transform:uppercase;
  color:var(--muted);display:grid;gap:10px;
}
.row-line{display:grid;gap:10px;align-items:center}
.row-line input,.row-line select{padding:9px 11px;font-size:14px}
.rowx{
  border:1px solid var(--line-strong);background:var(--paper-3);color:var(--muted);
  width:100%;height:40px;cursor:pointer;font-size:15px;line-height:1;font-family:var(--body);
}
.rowx:hover{border-color:var(--red);color:var(--red)}
@media (max-width:640px){
  .rows__head{display:none}
  .row-line{grid-template-columns:1fr!important;border:1px solid var(--line);padding:12px}
}

/* small stat strip under a chart */
.mini{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;background:var(--line);border:1px solid var(--line);margin-top:18px}
.mini > div{background:var(--paper-2);padding:14px 16px}
.mini b{display:block;font-family:var(--display);font-size:1.15rem;line-height:1.1}
.mini span{display:block;margin-top:5px;font-size:11.5px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:600}

/* the left column must be allowed to shrink; wide tables scroll inside their wrap */
.split > .stack{grid-template-columns:minmax(0,1fr)}
.split > .stack > *{min-width:0}
.panel .table-wrap,.panel .chart-wrap{max-width:100%}

/* v4: the shareable-link bar above the tool */
.tool-share{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:20px}
.tool-share .hint{max-width:62ch}

/* Row headers inside the body are data, not column chrome. They used to carry
   an inline `font-weight:600;color:var(--ink)` from the script, which fought
   the pixel-caps rule above and lost on everything but the colour. */
#uaRoot table.data tbody th[scope="row"]{
  font-family:var(--body);font-size:15px;font-weight:600;letter-spacing:0;
  text-transform:none;color:var(--ink);
  border-bottom:1px solid var(--line);vertical-align:top;
}
#uaRoot table.data tbody tr:last-child th[scope="row"]{border-bottom:0}
#uaRoot table.data td.is-base{font-weight:700}

/* The results rail carries a note under most rows now; keep them tight. */
#uaRoot .result__row .micro{margin:6px 0 0;max-width:34ch}
#uaRoot .tool-share .c-red{font-weight:600}

@media (max-width:640px){
  #uaRoot .tool-share{gap:8px}
  #uaRoot .result__row .micro{max-width:none}
}
