/* Power flow uses the existing light theme. Accent fills are darkened
   brand terracotta and navy so white text meets WCAG AA. */
.pf-figure {
  --pf-primary: var(--terracotta-dark);
  --pf-arithmetic: var(--ink);
  --pf-surface: #fff;
  --pf-neutral-1: #b7c0ca;
  --pf-neutral-2: #c6cdd5;
  --pf-neutral-3: #d5dbe1;
  --pf-neutral-4: #e2e6eb;
  --pf-neutral-5: #edf0f3;
  background: var(--pf-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 8px auto 0;
  max-width: 1160px;
  padding: 36px;
}

.pf-heading { max-width: 820px; }
.pf-eyebrow {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.3px;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.pf-heading h2 {
  color: var(--ink);
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.7px;
  line-height: 1.2;
  margin: 0 0 14px;
}
#pf-subtitle, .pf-subtitle {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  min-height: 48px;
}
.pf-modes {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 4px;
  margin: 24px 0 0;
  padding: 4px;
  position: relative;
}
.pf-modes input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}
.pf-modes label {
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
}
.pf-modes input:checked + label {
  background: var(--ink);
  color: #fff;
}
.pf-modes input:focus-visible + label,
.pf-segment:focus-visible,
.pf-table-wrap summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
.pf-guide {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 18px 0 30px;
  max-width: 720px;
}
.pf-chart { position: relative; }
.pf-connectors {
  color: var(--pf-primary);
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  width: 100%;
}
.pf-connectors polygon { fill: currentColor; opacity: 0.08; }
.pf-row { position: relative; }
.pf-row + .pf-row { margin-top: 42px; }
.pf-row-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
}
.pf-row-heading h3 {
  color: var(--ink);
  font-size: 16px;
  margin: 0;
}
.pf-row-heading h3 span {
  color: var(--gold-dark);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  margin-right: 9px;
}
.pf-row-caption {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  max-width: 65%;
  text-align: right;
}
.pf-bar {
  display: flex;
  gap: 2px;
  height: 100px;
  position: relative;
}
.pf-segment {
  align-items: center;
  appearance: none;
  background: var(--segment-fill);
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  cursor: help;
  display: flex;
  flex-basis: 0;
  flex-shrink: 1;
  justify-content: center;
  min-width: 0;
  padding: 0;
  position: relative;
}
.pf-segment[data-tone="primary"],
.pf-segment[data-tone="arithmetic"] { color: #fff; }
.pf-segment:hover { box-shadow: inset 0 0 0 2px currentColor; }
.pf-segment[hidden] { display: none !important; }
.pf-segment-label {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.35;
  padding: 10px;
  text-align: left;
  width: 100%;
}
.pf-segment-label strong,
.pf-outside-label strong {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-bottom: 4px;
}
.pf-segment[data-external="true"] .pf-segment-label { visibility: hidden; }
.pf-label-short { display: none; }
.pf-segment[data-compact="true"] .pf-label-full { display: none; }
.pf-segment[data-compact="true"] .pf-label-short { display: block; }
.pf-segment[data-compact="true"] .pf-segment-label {
  overflow-wrap: anywhere;
  padding: 8px 4px;
  text-align: center;
}
.pf-outside-labels {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--label-count), minmax(0, 1fr));
  margin-top: 30px;
  position: relative;
}
.pf-outside-label {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: center;
}
.pf-outside-label[hidden] { display: none; }
.pf-outside-labels[hidden] { display: none; }
.pf-outside-label strong { font-size: 16px; }
.pf-outside-label[data-tone="arithmetic"] { font-weight: 600; }
.pf-outside-label[data-tone="arithmetic"] strong { color: var(--ink); font-size: 20px; }
.pf-annotation { color: var(--terracotta-dark); display: block; font-size: 12px; font-style: normal; font-weight: 600; margin-top: 6px; }
.pf-annotation-inside { display: none; }
.pf-leaders {
  height: 30px;
  left: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  top: 100px;
  width: 100%;
}
.pf-leaders path { fill: none; stroke: var(--muted); stroke-width: 1; }
.pf-takeaway {
  background: var(--paper);
  border-left: 4px solid var(--pf-arithmetic);
  border-radius: 0 8px 8px 0;
  margin-top: 36px;
  padding: 24px;
}
.pf-takeaway h3 { color: var(--ink); font-size: 23px; line-height: 1.4; margin: 0 0 10px; }
.pf-takeaway > p:last-child { font-size: 14px; line-height: 1.7; margin: 0; }
.pf-tooltip {
  background: var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  max-width: min(330px, calc(100vw - 24px));
  padding: 12px 16px;
  position: fixed;
  z-index: 100;
}
.pf-tooltip[hidden] { display: none; }
.pf-table-wrap { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }
.pf-table-wrap summary { color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 600; width: fit-content; }
.pf-table-scroll { max-width: 100%; overflow-x: auto; }
.pf-table { border-collapse: collapse; font-size: 12px; margin-top: 16px; text-align: left; width: 100%; }
.pf-table caption { color: var(--text); line-height: 1.6; padding-bottom: 12px; text-align: left; }
.pf-table th, .pf-table td { border-bottom: 1px solid var(--line); padding: 10px 8px; }
.pf-table thead th { color: var(--ink); }
.pf-table .pf-table-group th { background: var(--paper); color: var(--ink); }
.pf-load-status { font-size: 14px; }
.pf-load-status:empty { display: none; }

@media (max-width: 900px) {
  .pf-figure { padding: 24px; }
  .pf-heading h2 { font-size: 28px; }
}
@media (max-width: 639px) {
  .pf-figure { padding: 20px 16px; }
  .pf-heading h2 { font-size: 25px; }
  .pf-modes { display: flex; }
  .pf-modes label { flex: 1; padding: 10px 12px; text-align: center; }
  .pf-guide { margin-bottom: 26px; }
  .pf-row-heading { display: block; }
  .pf-row-caption { margin-top: 5px; max-width: none; text-align: left; }
  .pf-bar { height: 76px; }
  .pf-leaders { top: 76px; }
  .pf-outside-labels { gap: 8px; }
  .pf-outside-label { font-size: 12px; }
  .pf-segment-label { font-size: 12px; }
  .pf-segment-label strong { font-size: 21px; }
  .pf-row + .pf-row { margin-top: 30px; }
  .pf-row[data-layout="list"] .pf-bar { display: grid; gap: 6px; height: auto; }
  .pf-row[data-layout="list"] .pf-segment {
    background: linear-gradient(to right, var(--segment-fill) 0 var(--share), var(--paper) var(--share) 100%);
    color: var(--ink);
    justify-content: start;
    min-height: 66px;
    text-align: left;
  }
  .pf-row[data-layout="list"] .pf-segment[data-tone="primary"],
  .pf-row[data-layout="list"] .pf-segment[data-tone="arithmetic"] {
    background: var(--segment-fill);
    color: #fff;
  }
  .pf-row[data-layout="list"] .pf-segment-label { padding: 10px 12px; visibility: visible; }
  .pf-row[data-layout="list"] .pf-segment-label strong { display: inline; font-size: 18px; margin-right: 10px; }
  .pf-row[data-layout="list"] .pf-annotation-inside { color: inherit; display: block; }
  .pf-row[data-layout="list"] .pf-outside-labels,
  .pf-row[data-layout="list"] .pf-leaders { display: none; }
  .pf-takeaway { padding: 18px; }
  .pf-takeaway h3 { font-size: 21px; }
  .pf-table { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-figure *, .pf-figure *::before, .pf-figure *::after { animation: none !important; transition: none !important; }
}
@media print {
  .pf-modes, .pf-chart, .pf-guide, .pf-tooltip, .pf-table-wrap summary { display: none !important; }
  .pf-figure { border: 0; padding: 0; }
  .pf-table-wrap > * { display: block !important; }
  .pf-table-wrap .pf-table { display: table !important; }
  .pf-table-scroll { overflow: visible; }
  .pf-table-wrap { break-inside: avoid; }
  .pf-takeaway { break-inside: avoid; }
}
