.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
}

.profile-figure {
  --group-width: 7.7rem;
  --value-width: 3.5rem;
  --gap: .7rem;
  min-width: 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-top: 2px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}
.profile-figure h2, .profile-reading h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 620;
  line-height: 1.16;
  letter-spacing: -.037em;
}
.profile-figure h2 { margin-top: .5rem; }
.profile-counts { margin-top: .45rem; color: var(--muted); font-size: .92rem; }
.profile-legend, .profile-plot { padding: 0; list-style: none; }
.profile-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.2rem;
  margin: 1.4rem 0 .8rem;
  color: var(--muted);
  font-size: .84rem;
}
.profile-legend li { display: flex; align-items: center; gap: .5rem; }
.profile-swatch { width: 1.15rem; height: .5rem; }
.profile-swatch.profile-orders, .profile-orders .profile-track > span { background: var(--green); }
.profile-swatch.profile-lines, .profile-lines .profile-track > span {
  background: repeating-linear-gradient(120deg, #b6c8dc 0 3px, #69829a 3px 5px);
}

.profile-plot { margin: 0; }
.profile-row {
  display: grid;
  grid-template-columns: var(--group-width) minmax(0, 1fr);
  align-items: center;
  gap: var(--gap);
  padding-block: .85rem;
  border-top: 1px solid var(--line);
}
.profile-row > strong { font-size: .89rem; font-weight: 580; }
.profile-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--value-width);
  align-items: center;
  gap: var(--gap);
}
.profile-track {
  display: flex;
  align-items: center;
  height: 1.35rem;
  border-inline-end: 1px solid var(--line);
  background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 25%);
}
.profile-track > span { height: .55rem; }
.profile-value, .profile-axis {
  font: 500 .78rem/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.profile-value { text-align: right; }
.profile-axis {
  display: flex;
  justify-content: space-between;
  margin-inline: calc(var(--group-width) + var(--gap)) calc(var(--value-width) + var(--gap));
  border-top: 1px solid var(--line);
  padding-top: .35rem;
  color: var(--muted);
  font-size: .68rem;
}
.profile-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.profile-data { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.profile-data summary {
  width: fit-content;
  min-height: 2.75rem;
  padding-block: .85rem .15rem;
  color: var(--mint);
  cursor: pointer;
  font-weight: 550;
  font-size: .9rem;
}
.profile-data table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.profile-data th, .profile-data td { padding: .4rem .25rem; border-top: 1px solid var(--line); text-align: end; }
.profile-data th:first-child { padding-left: 0; text-align: start; }
.profile-data tbody th { font-weight: 450; }
.profile-data tfoot { font-weight: 650; }

.profile-reading { padding-top: clamp(.25rem, 2vw, 2rem); }
.profile-reading p { margin-top: .9rem; color: var(--muted); }
.profile-reading p:first-of-type { color: var(--text); }

@media (max-width: 900px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr); max-width: 47rem; }
  .profile-reading { max-width: 62ch; padding-top: 0; }
}
@media (max-width: 560px) {
  .profile-figure { --group-width: 0rem; --value-width: 2.8rem; --gap: .45rem; }
  .profile-row { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .profile-axis { margin-inline-start: 0; }
}
@media (forced-colors: active) {
  .profile-swatch.profile-orders, .profile-orders .profile-track > span { border: .2rem solid CanvasText; }
  .profile-swatch.profile-lines, .profile-lines .profile-track > span { border: 1px dashed CanvasText; }
}
