.state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid;
  transition: 0.25s;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.state-extra:empty {
  display: none;
}

.state-sep {
  opacity: 0.5;
  font-weight: 400;
}

.state--wait { background: var(--wait-bg);  color: var(--wait);  border-color: var(--line-strong); }
.state--pass { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.state--fail { background: var(--red-bg);   color: var(--red);   border-color: var(--red-line); }

.config {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  align-items: flex-end;
  padding: 12px 15px 15px;
  border-bottom: 1px solid var(--line);
}

.config-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.config-actions {
  flex-basis: 100%;
}

.config-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 9px 14px;
  min-height: 40px;
  cursor: pointer;
  transition: 0.16s;
}

.segmented button + button {
  border-left: 1px solid var(--line-strong);
}

.segmented button.is-on {
  background: var(--ink);
  color: #fff;
}

.clear-button {
  appearance: none;
  border: 1px dashed var(--line-strong);
  background: transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 9px 14px;
  min-height: 40px;
  cursor: pointer;
  transition: 0.15s;
}

.clear-button:hover {
  background: var(--paper);
  border-color: var(--ink);
}

.subjects {
  padding: 4px 0 6px;
}

.subject {
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

.subject:last-child {
  border-bottom: 0;
}

.subject--exam {
  box-shadow: inset 3px 0 0 var(--red);
}

.subject-name {
  margin-bottom: 8px;
}

.name {
  font-size: 14.5px;
  font-weight: 600;
}

.badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--red);
  border: 1px solid var(--red-line);
  background: var(--red-bg);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 7px;
  vertical-align: middle;
}

.subject-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin: 0;
}

.field-cap {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 700;
}

.field-cap--strong {
  color: var(--ink);
}

.grade-select {
  appearance: none;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  width: 58px;
  height: var(--target);
  padding: 0 6px;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  transition: 0.15s;
}

.grade-select:hover {
  border-color: var(--ink);
}

.value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: var(--target);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.value--grade {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
}

.value--failing {
  color: var(--red);
}

.grade-group {
  display: flex;
  align-items: stretch;
  gap: 3px;
}

.grade-group::before {
  content: "";
  width: var(--arrow);
}

.arrow {
  appearance: none;
  width: var(--arrow);
  height: var(--target);
  padding: 0;
  font-size: 11px;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: transparent;
  cursor: default;
  transition: 0.15s;
}

.arrow--up   { color: var(--green); }
.arrow--down { color: var(--ink-faint); }

.arrow--free {
  cursor: pointer;
  border-color: var(--free-line);
  border-style: dashed;
  background: var(--free-bg);
}

.arrow--free:hover {
  border-color: var(--free);
  border-style: solid;
}

.verdict {
  border-radius: var(--radius);
  padding: 15px 17px;
  border: 1px solid;
  transition: 0.25s;
}

.verdict--wait { background: var(--wait-bg);  border-color: var(--line-strong); }
.verdict--pass { background: var(--green-bg); border-color: var(--green-line); }
.verdict--fail { background: var(--red-bg);   border-color: var(--red-line); }

.verdict-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  opacity: 0.7;
}

.verdict-status {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 2px 0 4px;
}

.verdict--wait .verdict-status { color: var(--wait); }
.verdict--pass .verdict-status { color: var(--green); }
.verdict--fail .verdict-status { color: var(--red); }

.verdict-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 11px;
}

.verdict-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 11px;
}

.verdict-cap {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 700;
}

.verdict-average {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.honours {
  font-size: 12px;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.honours--none {
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed var(--line-strong);
  font-weight: 600;
}

.panel {
  padding: 12px 13px 11px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-weight: 700;
}

.legend {
  font-size: 10px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.legend-up   { background: var(--green); }
.legend-down { background: var(--red); }

.band {
  width: 100%;
  height: 104px;
  display: block;
}

.bar-up   { fill: var(--green); transition: y 0.3s, height 0.3s; }
.bar-down { fill: var(--red);   transition: y 0.3s, height 0.3s; }

.band-axis {
  stroke: var(--ink);
  stroke-width: 1.4;
}

.band-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
}

.band-four {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 13px;
  color: var(--red);
}

.band-note {
  font-size: 10px;
  color: var(--ink-soft);
}

.criterion {
  padding: 12px 13px 13px;
}

.criterion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.criterion-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-weight: 700;
}

.check {
  font-size: 13px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check--yes  { color: var(--green); background: var(--green-bg); }
.check--no   { color: var(--red);   background: var(--red-bg); }
.check--none { color: var(--wait);  background: var(--wait-bg); }

.balance {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.balance-row {
  display: grid;
  grid-template-columns: 1fr 80px 46px;
  align-items: center;
  gap: 9px;
}

.balance-label {
  font-size: 11px;
  color: var(--ink-soft);
}

.balance-track {
  height: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.balance-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.balance-up   { background: var(--green); }
.balance-down { background: var(--red); }

.balance-value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12.5px;
  text-align: right;
}

.balance-value--up   { color: var(--green); }
.balance-value--down { color: var(--red); }

.criterion-foot {
  margin-top: 11px;
  padding: 7px 10px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.6px solid var(--line-strong);
  background: transparent;
  transition: 0.2s;
}

.dot--on {
  background: var(--ink);
  border-color: var(--ink);
}

.dot--over {
  border-style: dashed;
  margin-left: 5px;
}

.dot--over.dot--on {
  background: var(--red);
  border-color: var(--red);
}

.dots-text {
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-family: var(--font-num);
}

.dots-text .over {
  color: var(--red);
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.note {
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid;
}

.note--rescue {
  background: var(--green-bg);
  border-color: var(--green-line);
}

.note--choice {
  background: var(--free-bg);
  border-color: var(--free-line);
}

.note-title {
  font-weight: 700;
}
