/* Centered, animated task explanations. Original card copy is the data source. */
.benchmark-cards article {
  cursor: pointer;
}
.benchmark-cards article:hover {
  border-color: #7299d6;
  box-shadow: 0 10px 30px #1c4d8910;
}
.benchmark-cards .task-details {
  display: none;
}
html:has(.category-dialog[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}
.category-dialog {
  --camera: #d43843;
  --person: #087e63;
  position: fixed;
  inset: auto;
  left: 50vw;
  top: 50dvh;
  translate: -50% -50%;
  margin: 0;
  width: min(1160px, calc(100vw - 48px));
  max-width: none;
  height: min(1020px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  border: 1px solid #d8e2ef;
  border-radius: 22px;
  box-shadow: 0 30px 100px #0b203342;
  overflow: hidden;
}
.category-dialog[open] {
  display: flex;
  flex-direction: column;
}
.category-dialog::backdrop {
  background: #1b2c465e;
  backdrop-filter: blur(5px);
}
.category-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 30px 17px;
}
.category-heading .eyebrow {
  margin-bottom: 7px;
  font-size: 12px;
}
.category-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.category-heading p {
  max-width: 850px;
  margin: 10px 0 0;
  color: #526277;
  font-size: 16px;
  line-height: 1.5;
}
.category-close {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid #d8e2ef;
  border-radius: 50%;
  background: #f6f8fc;
  color: #24364d;
  font: 400 28px/1 var(--sans);
  cursor: pointer;
}
.category-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px 16px;
}
.category-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f8;
}
.category-switch button,
.diagram-play {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #42536a;
  padding: 8px 15px;
  font: 600 15px/1.3 var(--sans);
  cursor: pointer;
}
.category-switch button[aria-pressed="true"] {
  color: #174fa6;
  background: white;
  box-shadow: 0 1px 5px #23354d14;
}
.category-switch button span {
  margin-left: 5px;
  font-size: 12px;
  opacity: 0.8;
}
.diagram-play {
  border: 1px solid #d6dfec;
  color: #174fa6;
  background: white;
  white-space: nowrap;
}
.diagram-play:hover,
.category-close:hover {
  background: #edf3ff;
}
.diagram-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 0 30px 16px;
  font-size: 14px;
  color: #43546c;
}
.diagram-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.diagram-legend i {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.legend-camera {
  background: var(--camera);
}
.legend-camera::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 8px;
  border: 1.5px solid white;
  border-radius: 2px;
  top: 7px;
  left: 5.5px;
}
.legend-camera::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  border: 1px solid white;
  border-radius: 50%;
  top: 9.5px;
  left: 9px;
}
.legend-person {
  background: var(--person);
}
.legend-person::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  top: 5px;
  left: 8.5px;
}
.legend-person::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 5px;
  background: white;
  border-radius: 6px 6px 2px 2px;
  top: 12px;
  left: 6px;
}
.diagram-legend .diagram-context {
  margin-left: auto;
  color: #61718a;
}
.category-task-grid {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3px 30px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-content: start;
}
.category-task {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dce4ef;
  border-radius: 15px;
  background: white;
  display: flex;
  flex-direction: column;
}
.category-task h3 {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.35;
  color: #1d3454;
  letter-spacing: -0.025em;
}
.category-task p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: #526277;
}
.task-visual {
  margin-top: auto;
}
.task-diagram {
  display: block;
  width: 100%;
  height: 176px;
  border-radius: 10px;
  background: #f6f8fc;
}
.task-diagram text {
  font: 500 16px var(--sans);
  fill: #425570;
  text-anchor: middle;
  dominant-baseline: central;
}
.task-diagram .diagram-label {
  font-weight: 650;
  fill: #223b5b;
}
.task-diagram .diagram-small {
  font-size: 14px;
}
.task-diagram .diagram-answer text {
  fill: #174fa6;
  font-weight: 650;
}
.task-diagram .diagram-answer rect {
  fill: #e6efff;
}
.task-diagram .room {
  fill: #fff;
  stroke: #d2ddea;
  stroke-width: 1.5;
  transition:
    fill 0.35s,
    stroke 0.35s;
}
.task-diagram .room.visited {
  fill: #e6f4ef;
  stroke: #83baaa;
}
.task-diagram .stage-reveal {
  transition: opacity 0.35s;
}
.diagram-caption {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 45px;
  padding-top: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #304b70;
}
.diagram-step {
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8effb;
  color: #174fa6;
  font-size: 12px;
  font-weight: 700;
}
.diagram-progress {
  display: flex;
  gap: 4px;
  margin-top: 9px;
}
.diagram-progress i {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: #e2e9f3;
}
.diagram-progress i.passed {
  background: #376fc7;
}
.category-footnote {
  padding: 13px 30px;
  border-top: 1px solid #e3e9f2;
  background: #f8faff;
  color: #586a82;
  font-size: 12px;
}
.category-heading,
.category-toolbar,
.diagram-legend,
.category-footnote {
  flex-shrink: 0;
}
.category-task-grid[data-category="2"] .category-task:last-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}
.category-task-grid[data-category="2"] .category-task:last-child .task-visual {
  margin: 0;
}
.category-task-grid[data-category="1"] {
  align-content: center;
}
.category-task-grid[data-category="1"] .task-diagram {
  height: 220px;
}
@media (max-width: 700px) {
  .category-dialog {
    width: calc(100vw - 20px);
    height: calc(100dvh - 24px);
    border-radius: 16px;
  }
  .category-heading {
    padding: 18px 17px 14px;
    gap: 12px;
  }
  .category-heading h2 {
    font-size: 25px;
  }
  .category-heading p {
    font-size: 14px;
  }
  .category-heading .eyebrow {
    font-size: 10px;
  }
  .category-close {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
  .category-toolbar {
    padding: 0 17px 13px;
    gap: 9px;
    flex-wrap: wrap;
  }
  .category-switch {
    flex: 1;
  }
  .category-switch button {
    flex: 1;
    padding: 8px 9px;
    font-size: 14px;
  }
  .category-switch button span {
    margin-left: 2px;
  }
  .diagram-play {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .diagram-legend {
    padding: 0 17px 13px;
    gap: 9px 14px;
    font-size: 12px;
  }
  .diagram-legend .diagram-context {
    display: none;
  }
  .category-task-grid {
    grid-template-columns: 1fr;
    padding: 2px 14px 18px;
    gap: 14px;
  }
  .category-task {
    padding: 15px;
  }
  .category-task h3 {
    font-size: 18px;
  }
  .category-task p {
    font-size: 14px;
  }
  .task-diagram,
  .category-task-grid[data-category="1"] .task-diagram {
    height: auto;
  }
  .category-task-grid[data-category="1"] {
    align-content: start;
  }
  .category-task-grid[data-category="2"] .category-task:last-child {
    display: flex;
    gap: 0;
  }
  .category-footnote {
    padding: 11px 17px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .task-diagram .stage-reveal,
  .task-diagram .room {
    transition: none;
  }
}
