/* Grade-specific progress visualisation. Colours are semantic tokens (e8/tokens.generated.css). */
.e8pv {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  background: var(--e8-surface);
  border: 1px solid var(--e8-line);
  border-radius: 14px;
  color: var(--e8-ink);
}
.e8pv-heading {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
}
.e8pv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.e8pv-title {
  font-weight: 700;
  line-height: 1.25;
}
.e8pv-legend {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: var(--e8-ink-soft);
}
.e8pv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.e8pv-state {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}
.e8pv-state--not-yet {
  color: var(--e8-mastery-new);
  background: var(--e8-mastery-new-tint);
}
.e8pv-state--exploring,
.e8pv-state--developing {
  color: var(--e8-mastery-developing);
  background: var(--e8-mastery-developing-tint);
}
.e8pv-state--practicing {
  color: var(--e8-mastery-practicing);
  background: var(--e8-mastery-practicing-tint);
}
.e8pv-state--demonstrated {
  color: var(--e8-mastery-demonstrated);
  background: var(--e8-mastery-demonstrated-tint);
}

/* Grade 1 garden and Grade 2 tower: big tiles, one picture per skill. */
.e8pv--garden .e8pv-list,
.e8pv--tower .e8pv-list,
.e8pv--constellation .e8pv-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.e8pv--garden .e8pv-item,
.e8pv--tower .e8pv-item,
.e8pv--constellation .e8pv-item {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.3rem;
  padding: 0.8rem 0.5rem;
  border-radius: 22px;
}
.e8pv--garden {
  border: 4px solid #cfe7cf;
  border-radius: 30px;
  background: #f6fbf4;
}
.e8pv--garden .e8pv-item {
  background: #fff;
  border: 3px solid #e3efe0;
}
.e8pv--garden .e8pv-title {
  font-size: 1.02rem;
}
.e8pv--tower {
  border: 3px solid #e9c58a;
  background: #fffaf0;
}
.e8pv--tower .e8pv-item {
  background: #fff;
  border: 2px solid #efd9ae;
  border-top: 10px solid #f2c15b;
  border-radius: 12px;
}
.e8pv--constellation {
  border: 2px dashed #7fae80;
  background:
    radial-gradient(circle, #dbead8 1.2px, transparent 1.3px) 0 0 / 18px 18px,
    #fff;
}
.e8pv--constellation .e8pv-item {
  background: #ffffffe6;
  border-radius: 12px;
  border: 1px solid #c5dcc3;
}

/* Grades 4-5: numbered checklist with a four-step bar. */
.e8pv--checklist-bars .e8pv-list {
  counter-reset: e8pv;
}
.e8pv--checklist-bars .e8pv-item {
  counter-increment: e8pv;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 96px auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--e8-line);
}
.e8pv--checklist-bars .e8pv-item::before {
  content: counter(e8pv);
  font:
    800 0.85rem ui-monospace,
    Menlo,
    monospace;
  color: var(--e8-ink-soft);
}
.e8pv-bar {
  display: flex;
  gap: 3px;
}
.e8pv-bar i {
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background: var(--e8-surface-sunk);
  border: 1px solid var(--e8-line);
}
.e8pv-bar i.on {
  background: var(--e8-model-a);
  border-color: var(--e8-domain-ratio);
}
.e8pv--checklist-bars {
  border-radius: 6px;
  border: 2px solid #21496a;
  box-shadow: 4px 4px 0 #bcd2e4;
}

/* Grades 6-8: one bar per mathematics domain, segmented by state, with counts as text. */
.e8pv--domain-bars {
  border-radius: 8px;
}
.e8pv-domain {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.3rem 0;
  position: relative;
}
.e8pv-domain-name {
  font-weight: 800;
  text-transform: capitalize;
}
.e8pv-domain--number .e8pv-domain-name {
  color: var(--e8-domain-number);
}
.e8pv-domain--operations .e8pv-domain-name {
  color: var(--e8-domain-operations);
}
.e8pv-domain--fractions .e8pv-domain-name {
  color: var(--e8-domain-fractions);
}
.e8pv-domain--ratio .e8pv-domain-name {
  color: var(--e8-domain-ratio);
}
.e8pv-domain--algebra .e8pv-domain-name {
  color: var(--e8-domain-algebra);
}
.e8pv-domain--geometry .e8pv-domain-name {
  color: var(--e8-domain-geometry);
}
.e8pv-domain--data .e8pv-domain-name {
  color: var(--e8-domain-data);
}
.e8pv-domain--measurement .e8pv-domain-name {
  color: var(--e8-domain-measurement);
}
.e8pv-track {
  display: flex;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--e8-line);
  background: var(--e8-surface-sunk);
}
.e8pv-seg {
  display: block;
}
.e8pv-seg--not-yet {
  background: repeating-linear-gradient(135deg, #c4cfda 0 4px, #e6ecf1 4px 8px);
}
.e8pv-seg--exploring,
.e8pv-seg--developing {
  background: #f2c15b;
}
.e8pv-seg--practicing {
  background: #5b9bd5;
}
.e8pv-seg--demonstrated {
  background: #1b7a4b;
}
.e8pv-domain-count {
  font:
    700 0.85rem ui-monospace,
    Menlo,
    monospace;
  font-variant-numeric: tabular-nums;
}
html[data-gs-header="algebra-workspace"] .e8pv--domain-bars {
  border-radius: 2px;
  background: #f5f9fb;
}

@media (max-width: 640px) {
  .e8pv--checklist-bars .e8pv-item {
    grid-template-columns: 1.6rem minmax(0, 1fr);
  }
  .e8pv--checklist-bars .e8pv-bar,
  .e8pv--checklist-bars .e8pv-state {
    grid-column: 2;
  }
  .e8pv-domain {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* Mastery states of the evidence model (see mastery-evidence.js). */
.e8pv-state--developing { color: var(--e8-mastery-developing); background: var(--e8-mastery-developing-tint); }
.e8pv-state--review-due { color: var(--e8-mastery-review); background: var(--e8-mastery-review-tint); }
.e8pv-seg--review-due { background: repeating-linear-gradient(45deg, #0b5d57 0 3px, #8de3df 3px 6px); }
