/* robotparts.dev /goals/ (build/site_goals.py): the goals, philosophies, inspirations and every gate and KPI with its
   history. Colours are the site's tokens (static/site.css), so light and dark follow it; the series are data-ui's
   generated --data-series-*, the active BOMs the accent.
   WHY calm (Zach's standing rule for dashboards: one answer first, detail on demand; amber or red only for a failure):
   the headline is one number, every KPI is one row that opens to its history, and only a failing gate is coloured. */

.goals { max-width: 72rem; }
.goals .lede { max-width: 52rem; }
.goals h2 small, .goals h3 small { font-weight: 400; font-size: 13px; margin-left: .4em; }

/* ---- the headline ---- */
.g-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 40px; margin: 14px 0 6px; padding: 16px 18px;
  border: 1px solid var(--rule2); border-radius: 8px; background: var(--bg2); }
.g-big { flex: 1 1 22rem; min-width: 0; }
.g-label { margin: 0; color: var(--ink2); font-weight: 600; }
.g-num { margin: 2px 0 4px; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.g-num .g-of { font-size: 18px; font-weight: 500; color: var(--ink2); }
.g-num .g-pct { font-size: 18px; font-weight: 650; color: var(--accent); margin-left: .3em; }
.g-sub { margin: 2px 0; color: var(--ink2); font-size: 13px; }
.g-trend { flex: 0 1 240px; }
.g-trend .g-spark { width: 100%; max-width: 240px; height: auto; }

/* ---- goals, philosophies, inspirations ---- */
.g-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.g-cols h2 { margin-top: 22px; }
.g-list { margin: 0; padding: 0; list-style: none; }
.g-list li { margin: 0 0 9px; }
.g-list li b { display: block; }
.g-quotes q { display: block; color: var(--ink); font-style: italic; quotes: "\201C" "\201D"; }
.g-quotes small { display: block; }
.g-insp li b, .g-insp a { font-weight: 600; }
@media (max-width: 900px) { .g-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---- the KPI rows ---- */
.g-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0 0 6px; }
.g-x { display: inline-flex; gap: 10px; align-items: center; border: 0; margin: 0; padding: 0; }
.g-x legend { float: left; margin-right: 8px; color: var(--ink2); padding: 0; }
.g-x label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.g-dim { margin: 0 0 6px; }
.g-dim h3 { margin: 22px 0 4px; font-size: 15px; }
.g-hdr, .g-kpi > summary { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1.1fr) 7.5rem 104px;
  gap: 4px 14px; align-items: center; padding: 7px 10px 7px 26px; }
.g-hdr { color: var(--ink3); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--rule); padding-top: 4px; padding-bottom: 4px; }
.g-kpi { border-bottom: 1px solid var(--rule2); }
.g-kpi > summary { list-style: none; cursor: pointer; position: relative; }
.g-kpi > summary::-webkit-details-marker { display: none; }
.g-kpi > summary::before { content: ""; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.5px solid var(--ink3); border-bottom: 1.5px solid var(--ink3); transform: rotate(-45deg); transition: transform .12s; }
.g-kpi[open] > summary::before { transform: rotate(45deg); }
.g-kpi > summary:hover { background: var(--hover); }
.g-name b { display: block; font-weight: 600; }
.g-name small, .g-val small { color: var(--ink2); }
.g-name small { display: block; }
.g-val { font-size: 15px; font-weight: 600; }
.g-val small { font-size: 12px; font-weight: 400; }
.g-val.bom { color: var(--accent); }
.g-tgt { color: var(--ink2); font-size: 13px; }
.g-nm { color: var(--ink3); font-style: italic; font-weight: 400; font-size: 13px; }
.g-more { padding: 4px 10px 14px 26px; }
.g-more .g-chart { display: block; width: 100%; max-width: 760px; height: auto; margin-top: 6px; }
.goals:has(input[name="g-x"][value="order"]:checked) .g-chart.time { display: none; }
.goals:not(:has(input[name="g-x"][value="order"]:checked)) .g-chart.order { display: none; }
.g-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.g-boms { margin: 4px 0 6px; padding-left: 18px; }

/* status chips: only a failure is coloured */
.chip { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 10px; white-space: nowrap; border: 1px solid var(--rule); color: var(--ink2); }
.chip.pass { color: var(--ink); border-color: var(--ink3); }
.chip.fail { color: var(--warn); border-color: currentColor; }
.chip.kpi { color: var(--ink3); }
.chip.nm { color: var(--ink3); border-style: dashed; font-weight: 500; }
.g-later { margin: 6px 0 0; padding: 0 0 0 26px; list-style: none; font-size: 13px; }
.g-later li { margin: 0 0 5px; }

/* ---- the charts ---- */
.g-chart, .g-spark { overflow: visible; }
.g-chart .grid { stroke: var(--rule2); stroke-width: 1; }
.g-chart .tick { fill: var(--ink3); font-size: 10.5px; font-family: var(--sans); }
.g-chart .tick.tgt { fill: var(--ink2); }
.g-chart .target { stroke: var(--ink3); stroke-width: 1; stroke-dasharray: 4 3; }
.g-chart path, .g-spark path { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.g-chart circle { stroke: var(--bg); stroke-width: 1; }
.g-chart circle.last { stroke-width: 1.6; }
.g-chart .hit { fill: transparent; }
.g-chart .hit:hover { fill: var(--hover); fill-opacity: .55; }
path.s-cat { stroke: var(--ink3); } circle.s-cat { fill: var(--ink3); }
path.s-bom { stroke: var(--accent); } circle.s-bom { fill: var(--accent); }
.g-key { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; white-space: nowrap; color: var(--ink2); font-size: 12.5px; }
.g-key i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.g-key i.s-cat { background: var(--ink3); height: 3px; }
.g-key i.s-bom { background: var(--accent); height: 3px; }
.g-key i.s-tgt { height: 0; border-top: 1.5px dashed var(--ink3); }
.g-legend { margin: 4px 0; }

/* levels and evidence rungs: one series colour each, the bar and the stacked chart alike */
.lv0 { fill: var(--rule); background: var(--rule); }
.lv1 { fill: var(--data-series-1); background: var(--data-series-1); }
.lv2 { fill: var(--data-series-3); background: var(--data-series-3); }
.lv3 { fill: var(--data-series-4); background: var(--data-series-4); }
.lv4 { fill: var(--data-series-2); background: var(--data-series-2); }
.lv5 { fill: var(--data-series-8); background: var(--data-series-8); }
.rg0 { background: var(--data-series-6); } .rg1 { background: var(--data-series-1); } .rg2 { background: var(--data-series-5); }
.rg3 { background: var(--data-series-7); } .rg4 { background: var(--data-series-4); } .rg5 { background: var(--data-series-2); }
.rg6 { background: var(--rule); } .rg7 { background: var(--data-series-8); }
.g-chart polygon { stroke: var(--bg); stroke-width: .6; }
.g-bar { margin: 6px 0 10px; max-width: 760px; }
.g-bar-l { margin: 0 0 3px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.g-seg { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--bg2); }
.g-seg span { display: block; min-width: 2px; }
.g-bar .g-legend { font-size: 12px; }

/* ---- the BOM table ---- */
.g-bomt { border-collapse: collapse; font-size: 13px; min-width: 640px; }
.g-bomt th, .g-bomt td { padding: 4px 8px; border-bottom: 1px solid var(--rule2); text-align: center; }
.g-bomt th:first-child, .g-bomt td:first-child { text-align: left; }
.g-bomt thead th { font-size: 11.5px; color: var(--ink3); font-weight: 650; vertical-align: bottom; }
.g-bomt .g-bom-h th { text-align: left; padding-top: 12px; color: var(--ink); background: none; }
.g-bomt td.y { color: var(--ink); font-weight: 650; }
.g-bomt td.x { color: var(--ink3); }

/* ---- phone: each row stacks, its cells labelled ---- */
@media (max-width: 767px) {
  .g-hdr { display: none; }
  .g-kpi > summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-left: 24px; }
  .g-name { grid-column: 1 / -1; }
  .g-val::before, .g-tgt::before { content: attr(data-l); display: block; color: var(--ink3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
  .g-more { padding-left: 12px; padding-right: 0; }
  .g-pair { grid-template-columns: minmax(0, 1fr); }
  .g-num { font-size: 32px; }
  .g-later { padding-left: 4px; }
}
