/* Step 33: charts (templates/_charts.html). Brand palette only:
   navy = the figure · light grey = the track · orange-dk = below target ·
   navy dashes = the target. Text in charts meets 4.5:1; marks meet 3:1. */
:root{--ch-fig:#253746;--ch-low:#9A3B10;--ch-track:#E3E6E6;--ch-grid:#E9ECEC;--ch-ink:#55595A;--ch-mid:#858E93}

/* donut */
.cx-dn{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;color:var(--navy);min-width:0;text-decoration:none}
a.cx-dn{border-radius:16px;padding:6px 4px 8px}
a.cx-dn:hover{background:var(--sage-xl);text-decoration:none}
.cx-dn svg{display:block;overflow:visible}
.ch-track{stroke:var(--ch-track)}
.ch-arc{stroke:var(--ch-fig);transition:stroke-dasharray .6s ease}
.cx-dn.lo .ch-arc{stroke:var(--ch-low)}
.ch-target{stroke:var(--navy)}
.ch-big{font-family:var(--f-title);font-weight:600;font-size:24px;fill:var(--navy)}
.ch-small{font-family:var(--f-title);font-size:11px;fill:var(--ch-ink)}
.cx-dn-l{font-weight:700;font-size:14px;line-height:1.25;margin-top:4px}
.cx-dn-t{font-size:12px;color:var(--ch-ink)}
.cx-dn.lo .cx-dn-t{color:#9A3B10;font-weight:700}
.cx-dn-s{font-size:12px;color:var(--ch-ink);line-height:1.35;max-width:22ch}
.cx-dn-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 14px;align-items:start}

/* horizontal bars */
.cx-hb{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.cx-hb li{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(90px,1.6fr) 74px;gap:12px;align-items:center;padding:7px 0;border-bottom:1px solid var(--line);font-size:14px}
.cx-hb li:last-child{border-bottom:0}
.cx-hb-l{min-width:0;color:var(--navy);font-weight:600;line-height:1.25}
.cx-hb-l a{color:var(--navy)} .cx-hb-l small{display:block;font-weight:400;color:var(--ch-ink);font-size:12px}
.cx-hb-t{position:relative;height:12px;border-radius:99px;background:var(--ch-track)}
.cx-hb-t b{position:absolute;left:0;top:0;bottom:0;border-radius:99px;background:var(--ch-fig)}
.cx-hb li.lo .cx-hb-t b{background:var(--ch-low)}
.cx-hb-t i{position:absolute;top:-4px;bottom:-4px;width:0;border-left:2px dashed var(--navy)}
.cx-hb-v{font-family:var(--f-short);font-weight:900;color:var(--navy);text-align:right;font-variant-numeric:tabular-nums}
.cx-hb li.lo .cx-hb-v{color:#9A3B10}
.cx-hb-empty{display:block!important;color:var(--ch-ink);border:0!important}
@media(max-width:560px){.cx-hb li{grid-template-columns:minmax(0,1fr) 64px;row-gap:4px}.cx-hb-t{grid-column:1 / -1;grid-row:2}}

/* columns */
.cols-wrap{overflow-x:auto}
svg.cols{display:block;width:100%;height:auto;font-family:var(--f-title)}
.ch-grid{stroke:var(--ch-grid);stroke-width:1}
.ch-axis{font-size:10.5px;fill:var(--ch-ink)}
.ch-tl{font-weight:700;fill:var(--navy)}
.ch-col{fill:var(--ch-fig)} .ch-col.lo{fill:var(--ch-low)}
.ch-none{fill:var(--ch-mid)}
.ch-val{font-size:10.5px;font-weight:700;fill:var(--navy)}

/* 100% split bar */
.cx-sp-bar{display:flex;height:18px;border-radius:99px;overflow:hidden;background:var(--ch-track);gap:2px}
.cx-sp-bar b{display:block;height:100%}
.cx-sp .p1{background:var(--ch-fig)} .cx-sp .p2{background:var(--ch-mid)} .cx-sp .p3{background:var(--ch-low)}
.cx-sp-key{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:8px;font-size:13px;color:var(--ink)}
.cx-sp-key span{display:inline-flex;align-items:center;gap:6px}
.cx-sp-key i{width:12px;height:12px;border-radius:3px;display:inline-block}
.cx-sp-key b{color:var(--navy)}

/* dot plot */
.cx-dp{display:flex;flex-direction:column}
.cx-dp-axis,.cx-dp-r{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,1.7fr) 92px;gap:12px;align-items:center}
.cx-dp-axis{font-size:11px;color:var(--ch-ink);padding-bottom:4px}
.cx-dp-scale{position:relative;height:14px}
.cx-dp-scale em{position:absolute;transform:translateX(-50%);font-style:normal}
.cx-dp-r{padding:7px 0;border-top:1px solid var(--line);font-size:14px}
.cx-dp-l{min-width:0;color:var(--navy);font-weight:600;line-height:1.25}
.cx-dp-l a{color:var(--navy)} .cx-dp-l small{display:block;font-weight:400;color:var(--ch-ink);font-size:12px}
.cx-dp-t{position:relative;height:16px;background:linear-gradient(var(--ch-track),var(--ch-track)) 0 50%/100% 2px no-repeat}
.cx-dp-t b{position:absolute;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:var(--ch-fig);border:2px solid #FFF;box-shadow:0 0 0 1px var(--ch-fig)}
.cx-dp-r.lo .cx-dp-t b{background:var(--ch-low);box-shadow:0 0 0 1px var(--ch-low)}
.cx-dp-avg{position:absolute;top:-3px;bottom:-3px;border-left:2px dashed var(--navy)}
.cx-dp-d{position:absolute;top:50%;height:4px;margin-top:-2px;background:var(--ch-mid);border-radius:2px}
.cx-dp-v{font-family:var(--f-short);font-weight:900;color:var(--navy);text-align:right;font-variant-numeric:tabular-nums}
.cx-dp-r.lo .cx-dp-v{color:#9A3B10}
.cx-dp-v em{display:block;font-family:var(--f-title);font-style:normal;font-weight:600;font-size:11px;color:var(--ch-ink)}
.cx-dp-k{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ch-ink);margin:8px 0 0}
.cx-dp-k i{width:0;height:14px;border-left:2px dashed var(--navy)}
@media(max-width:560px){.cx-dp-axis,.cx-dp-r{grid-template-columns:minmax(0,1fr) 64px}.cx-dp-t,.cx-dp-scale{grid-column:1 / -1;grid-row:2}.cx-dp-axis>span:first-child,.cx-dp-axis>span:last-child{display:none}}

/* meter (table cells) */
.cx-mt{display:inline-flex;align-items:center;gap:8px;justify-content:flex-end;white-space:nowrap}
.cx-mt-t{position:relative;width:64px;height:8px;border-radius:99px;background:var(--ch-track);overflow:visible}
.cx-mt-t b{position:absolute;left:0;top:0;bottom:0;border-radius:99px;background:var(--ch-fig)}
.cx-mt.lo .cx-mt-t b{background:var(--ch-low)}
.cx-mt-t i{position:absolute;top:-3px;bottom:-3px;border-left:2px solid var(--navy)}
.cx-mt-v{font-weight:800;color:var(--navy);min-width:38px;text-align:right;font-variant-numeric:tabular-nums}
.cx-mt.lo .cx-mt-v{color:#9A3B10}
.cx-mt small{color:var(--ch-ink);font-weight:400;min-width:38px}

/* a panel of charts */
.chart-card h3{margin:0 0 2px;font-size:16px}
.chart-card .sub{margin:0 0 12px}
.chart-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:14px}
@media print{.ch-arc{transition:none}}
@media (prefers-reduced-motion:reduce){.ch-arc{transition:none}}
