/*
 * Budget Allocation Summary insight (EmbedType 124).
 *
 * Everything here is server-rendered HTML plus CSS widths - no chart library. The report
 * context already juggles Flot, amCharts, Highcharts and D3, and CSS bars print correctly
 * where canvases rasterize badly.
 *
 * Colour never carries meaning on its own: cut bars are hatched so the distinction survives
 * grayscale printing, and every row states its direction in words. Text colours are the
 * darkened tokens - brand blue #0395FF fails WCAG AA as text on white.
 */

.fa-summary {
  color: #26303e;
  font-size: 14px;
}

.fa-summary__meta {
  color: #5b6875;
  margin-bottom: 12px;
}

.fa-summary__empty {
  color: #5b6875;
  font-style: italic;
  margin: 16px 0;
}

.fa-summary__caution {
  background-color: #fdf3e2;
  border-left: 4px solid #a86400;
  color: #6b4000;
  margin-bottom: 16px;
  padding: 8px 12px;
}

/* Stat tiles ------------------------------------------------------------- */

.fa-summary__tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
}

.fa-summary__tile {
  background-color: #f5f7f9;
  border: 1px solid #dde3e9;
  border-radius: 4px;
  flex: 1 1 160px;
  min-width: 150px;
  padding: 12px 14px;
}

.fa-summary__tile dt {
  color: #5b6875;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.fa-summary__tile dd {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.fa-summary__tile-sub {
  color: #5b6875;
  display: block;
  font-size: 12px;
  font-weight: 400;
}

/* Chart ------------------------------------------------------------------ */

.fa-summary__section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.fa-summary__section-sub {
  color: #5b6875;
  font-size: 12px;
  margin: 0 0 12px;
}

.fa-summary__chart {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.fa-summary__row {
  align-items: center;
  border-bottom: 1px solid #eef1f4;
  display: flex;
  gap: 12px;
  padding: 6px 0;
}

.fa-summary__row-name {
  flex: 0 0 30%;
  font-weight: 600;
  overflow-wrap: break-word;
}

.fa-summary__row-track {
  background-color: #f5f7f9;
  border-radius: 2px;
  flex: 1 1 auto;
  height: 16px;
  min-width: 60px;
  position: relative;
}

/* Divergent variant: the centre line is the option's current funding. */
.fa-summary__chart--divergent .fa-summary__row-track::before {
  background-color: #98a4b0;
  bottom: -2px;
  content: "";
  left: 50%;
  position: absolute;
  top: -2px;
  width: 1px;
}

.fa-summary__bar {
  display: block;
  height: 16px;
  max-width: 50%;
  position: absolute;
  top: 0;
}

.fa-summary__chart--divergent .fa-summary__bar--add {
  background-color: #1f7a4d;
  left: 50%;
}

.fa-summary__chart--divergent .fa-summary__bar--cut {
  /* Hatched, not merely red: grayscale print has to keep add and cut distinguishable. */
  background-color: #9a2c2c;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.55) 0,
    rgba(255, 255, 255, 0.55) 3px,
    transparent 3px,
    transparent 6px
  );
  right: 50%;
}

.fa-summary__chart--linear .fa-summary__bar {
  background-color: #1f5f8b;
  left: 0;
  max-width: 100%;
}

.fa-summary__row-value {
  flex: 0 0 26%;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.fa-summary__row-direction {
  color: #3f4a57;
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.fa-summary__row-detail {
  color: #5b6875;
  display: block;
  font-size: 11px;
  font-weight: 400;
}

.fa-summary__flag {
  color: #8a4b00;
  display: block;
  font-size: 11px;
  font-weight: 600;
}

/* Detail table ----------------------------------------------------------- */

.fa-summary__table {
  border-collapse: collapse;
  margin-bottom: 20px;
  width: 100%;
}

.fa-summary__table caption {
  color: #5b6875;
  font-size: 12px;
  padding-bottom: 8px;
  text-align: left;
}

.fa-summary__table th,
.fa-summary__table td {
  border-bottom: 1px solid #eef1f4;
  padding: 6px 8px;
  text-align: right;
}

.fa-summary__table thead th {
  border-bottom: 2px solid #cdd5dd;
  color: #3f4a57;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fa-summary__table th[scope="row"],
.fa-summary__table thead th:first-child {
  text-align: left;
}

/* Locked strip ----------------------------------------------------------- */

.fa-summary__locked {
  background-color: #f5f7f9;
  border: 1px solid #dde3e9;
  border-radius: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.fa-summary__locked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fa-summary__locked-list li {
  color: #3f4a57;
  font-size: 13px;
}

.fa-summary__locked-amount {
  font-weight: 700;
}

/* Method note ------------------------------------------------------------ */

.fa-summary__method {
  color: #5b6875;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
}

/* Print ------------------------------------------------------------------ */

@media print {
  .fa-summary {
    color: #000;
  }

  .fa-summary__chart,
  .fa-summary__locked,
  .fa-summary__tiles {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .fa-summary__row,
  .fa-summary__table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .fa-summary__bar,
  .fa-summary__row-track,
  .fa-summary__tile {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
