/* ------------------------------------------------------------------
   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}

table.data.wide{min-width:1020px}

/* 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%}

/* row-list labels: the header row carries them on desktop, each field on mobile */
.rowlbl{display:none}
@media (max-width:640px){
  .rowlbl{display:block;font-size:11.5px;font-weight:600;line-height:1.5;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
}

/* 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}

/* ---------- copy buttons: the failure has to be as loud as the success ----------
   site.css styles .is-copied, and site.js only ever reaches that branch. A
   clipboard that is unavailable (a non-secure origin) or refused (a denied
   permission) left the button sitting still, which reads exactly like a
   silent success. The tool scripts handle their own copy buttons and set one
   of these two states every time. */
.is-copyfail{background:var(--red);color:#141414;border-color:var(--ink)}
.copy-note{
  flex:1 1 100%;margin:0;font-size:12.5px;line-height:1.45;
  color:var(--red);font-weight:600;
}
.copy-note:empty{display:none}

/* Anything driven by a thumb: the shared chrome is sized for a mouse, and
   30px of button is not a tap target. */
@media (pointer:coarse){
  .copy,.chip,.seg button,.btn-sm{min-height:40px}
  .copy,.seg button{display:inline-flex;align-items:center;justify-content:center}
}

/* Eleven columns at 1020px minimum. On a 390px screen that is nearly three
   screens of sideways scrolling, and the scenario name is the first thing to
   disappear. */
@media (max-width:620px){
  .table-wrap th[scope="row"]{position:sticky;left:0;z-index:1;background:var(--paper-2)}
}
