/* Power Users figures — loaded after resources.css on this article only. */

.pu-fig {
  margin: 38px 0;
  padding: 34px 36px 32px;
  border: 1px solid #cfdcf0;
  border-radius: 20px;
  background: #f4f7fb;
  color: #071b3a;
}

h3.pu-h {
  margin: 0 0 26px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #071b3a;
}

p.pu-note {
  margin: 22px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: #4b5b76;
  text-wrap: pretty;
}

/* ---------- figure 1: behavior filtered by context ---------- */

.pu-combine {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 26px minmax(0, 1fr) 26px minmax(0, 0.95fr);
  align-items: stretch;
  gap: 12px;
}

.pu-col {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 22px 24px 24px;
  border: 1px solid #d7e2f2;
  border-top: 4px solid #16408f;
  border-radius: 16px;
  background: #fff;
}

.pu-col--ctx { border-top-color: #b8860b; }
.pu-col--out { border-top-color: #17693f; }

p.pu-col__k {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #16408f;
  text-wrap: pretty;
}

.pu-col--ctx p.pu-col__k { color: #8a5a06; }
.pu-col--out p.pu-col__k { color: #17693f; }

.pu-set {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
}

.pu-set span {
  padding: 7px 13px;
  border-radius: 999px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
  font-size: 15px;
  color: #33465f;
}

.pu-set--ctx span {
  background: #fdf9f1;
  box-shadow: inset 0 0 0 1px #e6cd9a;
  color: #6b4e08;
}

p.pu-col__note {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid #e6edf7;
  font-size: 14px;
  line-height: 1.45;
  color: #4b5b76;
  text-wrap: pretty;
}

p.pu-out {
  margin: 0;
  align-self: center;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: #17693f;
  text-wrap: pretty;
}

.pu-arrow {
  position: relative;
  align-self: center;
  width: 26px;
  height: 26px;
}

.pu-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 19px;
  height: 3px;
  margin-top: -1.5px;
  background: #b0bdcd;
}

.pu-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1px;
  margin-top: -7px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #b0bdcd;
}

/* ---------- figure 2: observable boundary ---------- */

.pu-boundary {
  padding: 22px 26px 26px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
}

/* Bars carry ONLY the proportion — the source's cell text is up to 68 characters and a
   bar can be as narrow as 16% of the track, so the copy lives beneath, colour-matched. */
.pu-zones,
.pu-role {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 4px 16px;
}

.pu-zones { margin-bottom: 10px; }

/* Base is class-only so the narrow-viewport overrides below can win on source order.
   A `p.pu-zone` base (0,1,1) would outrank them and pin both labels to column 2. */
.pu-zone {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.pu-zone--in {
  width: 50%;
  border-bottom: 2px solid #16408f;
  color: #16408f;
}

.pu-zone--out {
  justify-self: end;
  width: 50%;
  border-bottom: 2px dashed #b8860b;
  color: #8a5a06;
  text-align: right;
}

.pu-role {
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #e6edf7;
}

.pu-role:first-of-type { border-top: 0; }

p.pu-role__name {
  grid-column: 1;
  grid-row: 1 / span 3;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #071b3a;
  text-wrap: pretty;
}

.pu-role__track {
  grid-column: 2;
  position: relative;
  height: 22px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, #eef2f8 0 50%, transparent 50%) no-repeat,
    linear-gradient(#cfdcf0, #cfdcf0) no-repeat 50% 0 / 2px 100%;
}

.pu-role__seen,
.pu-role__beyond {
  position: absolute;
  top: 3px;
  bottom: 3px;
}

.pu-role__seen {
  left: 0;
  border-radius: 4px;
  background: #16408f;
}

/* Anchored at the 50% boundary in the markup, never at the end of the solid segment:
   the "beyond events" fill must not sit inside the observable half. The bare tint
   between solid-end and 50% is meaningful — observable ground this role never reaches. */
.pu-role__beyond {
  border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(-45deg, #e0c48a 0 6px, #f5ebd6 6px 12px);
  box-shadow: inset 0 0 0 1px #d9b978;
}

p.pu-role__obs,
p.pu-role__cannot {
  grid-column: 2;
  position: relative;
  margin: 0;
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  text-wrap: pretty;
}

p.pu-role__obs { color: #16408f; }
p.pu-role__cannot { color: #6b4e08; }

p.pu-role__obs::before,
p.pu-role__cannot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

p.pu-role__obs::before { background: #16408f; }

p.pu-role__cannot::before {
  background: repeating-linear-gradient(-45deg, #e0c48a 0 3px, #f5ebd6 3px 6px);
  box-shadow: inset 0 0 0 1px #d9b978;
}

/* ---------- figure 3: illustrative users ---------- */

.pu-users {
  display: grid;
  gap: 10px;
}

.pu-user {
  display: grid;
  grid-template-columns: 168px 190px minmax(0, 1fr);
  align-items: center;
  gap: 8px 20px;
  padding: 18px 24px 20px;
  border: 1px solid #d7e2f2;
  border-left: 6px solid #b0bdcd;
  border-radius: 16px;
  background: #fff;
}

.pu-user--yes { border-left-color: #17693f; }
.pu-user--hold { border-left-color: #b8860b; }
.pu-user--no { border-left-color: #8a94a6; }

.pu-user--excl {
  border-left-color: #8a94a6;
  background: #f4f7fb;
}

p.pu-user__name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #071b3a;
}

p.pu-user__role {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.3;
  color: #5a6a80;
}

.pu-user__score {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pu-meter {
  flex: 1 1 auto;
  height: 26px;
  border-radius: 6px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
  overflow: hidden;
}

.pu-meter span {
  display: block;
  height: 100%;
  border-radius: 5px 0 0 5px;
  background: #5a6a80;
}

.pu-user--yes .pu-meter span { background: #17693f; }

.pu-meter span.pu-meter--prov {
  background: repeating-linear-gradient(-45deg, #d09b1f 0 6px, #e8c179 6px 12px);
}

p.pu-user__pct {
  flex: none;
  margin: 0;
  min-width: 44px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #33465f;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pu-user--yes p.pu-user__pct { color: #114f30; }

p.pu-user__excl {
  margin: 0;
  padding: 5px 13px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #cfdcf0;
  font-size: 14px;
  font-weight: 700;
  color: #5a6a80;
}

p.pu-user__obs {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: #33465f;
  text-wrap: pretty;
}

p.pu-user__peer {
  grid-column: 2;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #5a6a80;
  font-variant-numeric: tabular-nums;
}

p.pu-user__read {
  grid-column: 3;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #4b5b76;
  text-wrap: pretty;
}

.pu-user--yes p.pu-user__read { color: #114f30; }
.pu-user--hold p.pu-user__read { color: #6b4e08; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .pu-combine {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    gap: 12px;
  }

  .pu-col--out {
    grid-column: 1 / -1;
    grid-template-rows: auto auto auto;
  }

  .pu-combine .pu-arrow:last-of-type {
    justify-self: center;
    transform: rotate(90deg);
  }

  .pu-zones,
  .pu-role { grid-template-columns: 150px minmax(0, 1fr); }

  .pu-user { grid-template-columns: 148px 168px minmax(0, 1fr); }
}

@media (max-width: 940px) {
  .pu-fig { padding: 26px 22px 24px; }

  h3.pu-h { font-size: 22px; }

  .pu-combine {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px 0;
  }

  .pu-col,
  .pu-col--out { grid-column: 1; }

  .pu-arrow,
  .pu-combine .pu-arrow:last-of-type {
    justify-self: center;
    transform: rotate(90deg);
  }

  /* The base rule puts .pu-zone in column 2 for the wide label+track layout. Here the
     label column is gone, so the legend must be re-placed explicitly — otherwise it asks
     for a column that no longer exists and the grid invents one, parking both labels in
     the right-hand third while the tracks below are boundaried at their own midpoint. */
  /* column-gap must be 0 here or the two halves total 16px less than the full-width
     track below, putting the legend split off the boundary line. */
  .pu-zones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0;
  }

  .pu-zone--in {
    grid-column: 1;
    width: auto;
  }

  .pu-zone--out {
    grid-column: 2;
    width: auto;
    justify-self: stretch;
  }
  .pu-role {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  p.pu-role__name { grid-row: auto; }

  .pu-role__track,
  p.pu-role__obs,
  p.pu-role__cannot { grid-column: 1; }

  .pu-user {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .pu-user__id { display: flex; align-items: baseline; gap: 10px; }

  p.pu-user__role { margin: 0; }

  p.pu-user__peer,
  p.pu-user__read { grid-column: 1; }
}
