/*
 * "AI Agent Governance" page hero.
 * Layout, copy, buttons and stat cards come from pe-firms-hero.css (.dlh-pef); this file holds
 * the .dlh-pef--aig spacing variant and the "Live agent register" scatter chart.
 */

/* Variant spacing (Figma: 94px top, 40px beside and below the chart, 150px stat cards) */
.dlh-pef.dlh-pef--aig { padding: 60px 16px 93px; }
.dlh-pef--aig .dlh-pef__main { gap: 40px; }
.dlh-pef--aig .dlh-pef-stat { min-height: 150px; gap: 16px; }
/* Figma's line heights, pinned (browsers make "normal" a little taller) */
.dlh-pef--aig .dlh-pef__lead { line-height: 29px; }
.dlh-pef--aig .dlh-pef-stat__value { line-height: 48px; }

/* ---------- Live agent register ----------
   Everything inside the chart is placed in the card's 479px-wide design units (--u), so the
   whole plot scales with the card. Text never drops below 10px on small screens. */
.dlh-aig-chart {
  --u: calc(100cqw / 479);
  --dlh-aig-green: #16a34a;
  --dlh-aig-amber: #eabe0c;
  --dlh-aig-red: #ff0505;

  container-type: inline-size;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  border-radius: 24px;
  background: #fff;
  overflow: hidden;
}

.dlh-aig-chart__plot {
  position: relative;
  display: block;
  aspect-ratio: 479 / 451;      /* the legend sits below, at y = 451 */
  color: #1a1a1a;
  font-size: max(10px, calc(12 * var(--u)));
  line-height: 1.3333;
}
.dlh-aig-chart__plot > * { position: absolute; }

.dlh-pef .dlh-aig-chart__title {
  left: calc(25 * var(--u)); top: calc(33 * var(--u));
  font-size: max(14px, calc(16 * var(--u))); font-weight: 500; line-height: 1.375;
  white-space: nowrap;
}
.dlh-aig-chart__date {
  right: calc(24 * var(--u)); top: calc(36 * var(--u));
  color: #9d9d9d;
  white-space: nowrap;
}

/* Axes */
.dlh-aig-chart__y {
  right: calc(429 * var(--u)); top: calc(97 * var(--u));   /* right-aligned at x = 50 */
  height: calc(247 * var(--u));
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
}
.dlh-aig-chart__x {
  left: calc(70 * var(--u)); top: calc(388 * var(--u));
  width: calc(354 * var(--u));
  display: flex; justify-content: space-between;
  white-space: nowrap;
}
.dlh-aig-chart__x-title {
  left: calc(265.5 * var(--u)); top: calc(415 * var(--u));
  transform: translateX(-50%);
  color: #9d9d9d;
  white-space: nowrap;
}

/* Grid and target lines (Figma's own dashed-line images, stretched to the plot) */
.dlh-pef .dlh-aig-chart__line { max-width: none; }
.dlh-aig-chart__line--h {
  left: calc(70 * var(--u)); top: calc((var(--y) - 0.5) * var(--u));
  width: calc(391 * var(--u)); height: 1px;
}
.dlh-aig-chart__line--v {
  left: calc((var(--x) - 0.5) * var(--u)); top: calc(97 * var(--u));
  width: 1px; height: calc(276 * var(--u));
}
.dlh-aig-chart__line--h.dlh-aig-chart__line--target { top: calc((var(--y) - 1) * var(--u)); height: 2px; }
.dlh-aig-chart__line--v.dlh-aig-chart__line--target { left: calc((var(--x) - 1) * var(--u)); width: 2px; }

/* Missed both targets: shaded quadrant */
.dlh-aig-chart__zone {
  left: calc(249 * var(--u)); top: calc(177 * var(--u));
  width: calc(212 * var(--u)); height: calc(196 * var(--u));
  background: #fee2e2;
  opacity: .3;
}

.dlh-aig-chart__note { white-space: nowrap; }
/* Anchored by its left edge (Figma: centred at 136.5, so it starts at 66.25) so the
   10px minimum text size on phones grows it away from the y-axis labels */
.dlh-aig-chart__note--accuracy { left: calc(66.25 * var(--u)); top: calc(183 * var(--u)); }
.dlh-aig-chart__note--latency { left: calc(254 * var(--u)); top: calc(97 * var(--u)); }

/* Agents: --x/--y are the dot's centre, --d its diameter, all in design units */
.dlh-aig-chart__dot {
  left: calc((var(--x) - var(--d) / 2) * var(--u));
  top: calc((var(--y) - var(--d) / 2) * var(--u));
  width: calc(var(--d) * var(--u)); height: calc(var(--d) * var(--u));
  border: 1px solid var(--dlh-aig-green);
  border-radius: 50%;
  background: rgba(22, 163, 74, .4);
}
.dlh-aig-chart__dot--watch { border-color: var(--dlh-aig-amber); background: rgba(234, 175, 12, .3); }
.dlh-aig-chart__dot--at-risk { border-color: var(--dlh-aig-red); background: rgba(234, 12, 12, .2); }

/* Legend */
.dlh-pef .dlh-aig-chart__legend {
  padding: 0 calc(16 * var(--u)) calc(25 * var(--u)) calc(32 * var(--u));
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 17px;
  color: #1a1a1a;
  font-size: 12px; line-height: 16px;
}
.dlh-aig-chart__key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dlh-aig-chart__key::before {
  content: "";
  box-sizing: border-box;
  width: 16px; height: 16px;
  border: 1px solid var(--dlh-aig-green);
  border-radius: 50%;
  background: rgba(22, 163, 74, .4);
}
.dlh-aig-chart__key--watch::before { border-color: var(--dlh-aig-amber); background: rgba(234, 175, 12, .3); }
.dlh-aig-chart__key--at-risk::before { border-color: var(--dlh-aig-red); background: rgba(234, 12, 12, .2); }
.dlh-pef .dlh-aig-chart__size-note { color: #9d9d9d; white-space: nowrap; }

/* Tablet: chart moves below the copy */
@media (max-width: 1023px) {
  .dlh-pef.dlh-pef--aig { padding: 60px 16px 56px; }
  .dlh-pef--aig .dlh-pef__main { gap: 32px; }
  .dlh-aig-chart { flex: none; width: 100%; max-width: 560px; }
  .dlh-pef--aig .dlh-pef-stat { min-height: 0; }
}

/* Phones */
@media (max-width: 720px) {
  .dlh-pef.dlh-pef--aig { padding: 60px 16px 48px; }
  .dlh-pef .dlh-aig-chart__legend { padding: 4px 20px 24px; gap: 8px 14px; }
}
