.rubric-designer {
  --rd-ink: #111418;
  --rd-muted: #66707c;
  --rd-panel: transparent;
  --rd-soft: rgba(17, 20, 24, 0.035);
  --rd-line: rgba(17, 20, 24, 0.075);
  --rd-blue: #174cff;
  --rd-green: #2d8b64;
  --rd-amber: #c98520;
  --rd-red: #c7504a;
  --rd-field: #f8f9fa;
  --rd-shadow: transparent;

  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(17, 20, 24, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 20, 24, 0.026) 1px, transparent 1px),
    var(--rd-field);
  background-size: 26px 26px;
  color: var(--rd-ink);
  box-shadow: none;
}

.theme-dark .rubric-designer {
  --rd-ink: #f4f5f7;
  --rd-muted: #9aa3ad;
  --rd-panel: #161c22;
  --rd-soft: rgba(244, 245, 247, 0.055);
  --rd-line: rgba(244, 245, 247, 0.11);
  --rd-field: #0b0c0e;
  --rd-shadow: rgba(0, 0, 0, 0.34);
}

.rd-toolbar {
  display: grid;
  gap: 0.65rem;
  padding: 0.15rem 0.1rem 0.25rem;
}

.rd-weight-card {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.15rem 0 0.4rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.theme-dark .rd-weight-card {
  background: transparent;
}

.rd-weight-card span,
.rd-weight-card em {
  color: var(--rd-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rd-weight-card strong {
  font-size: clamp(1.75rem, 13vw, 3.7rem);
  font-weight: 700;
  line-height: 1;
}

.rd-weight-copy {
  display: grid;
  gap: 0.15rem;
}

.rd-orbit {
  width: 4.4rem;
  aspect-ratio: 1;
  overflow: visible;
}

.rd-orbit path {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.rd-orbit-ghost {
  stroke: var(--rd-line);
  stroke-width: 1;
}

.rd-orbit-line {
  stroke: var(--rd-blue);
  stroke-width: 1.7;
  stroke-linecap: round;
  transition: d 220ms ease, stroke 180ms ease, stroke-dasharray 180ms ease;
}

.rd-weight-card[data-rd-status='under'] .rd-orbit-line {
  stroke: var(--rd-amber);
  stroke-dasharray: 9 7;
}

.rd-weight-card[data-rd-status='over'] .rd-orbit-line {
  stroke: var(--rd-red);
}

.rd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-content: start;
}

.rd-actions button,
.rd-level-head button,
.rd-remove-row,
.rd-mobile-remove,
.rd-mobile-level button,
.rd-confirm-actions button {
  min-height: 2.75rem;
  border: 0;
  border-bottom: 1px solid var(--rd-line);
  border-radius: 0;
  background: transparent;
  color: var(--rd-ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 820;
  cursor: pointer;
  padding: 0 0.1rem;
  text-transform: uppercase;
}

.rd-actions button:first-child,
.rd-actions button:nth-child(2) {
  background: transparent;
  color: var(--rd-blue);
  border-color: currentcolor;
}

.rd-table-shell {
  display: none;
  overflow-x: auto;
  padding: 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rd-table {
  width: 100%;
  min-width: 46rem;
  border-collapse: separate;
  border-spacing: 0;
}

.rd-table th,
.rd-table td {
  position: relative;
  min-width: 9rem;
  border-right: 1px solid var(--rd-line);
  border-bottom: 1px solid var(--rd-line);
  padding: 1rem;
  vertical-align: top;
}

.rd-table th:first-child,
.rd-table td:first-child {
  min-width: 11rem;
}

.rd-table th:nth-child(2),
.rd-table td:nth-child(2) {
  min-width: 5rem;
  width: 5rem;
}

.rd-table th {
  background: rgba(248, 249, 250, 0.72);
  color: var(--rd-muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-align: left;
  text-transform: uppercase;
}

.theme-dark .rd-table th {
  background: rgba(11, 12, 14, 0.82);
}

.rd-table tr:hover td,
.rd-table .is-column-hover {
  background: rgba(47, 111, 159, 0.1);
}

.rd-editable {
  min-height: 3.2rem;
  outline: 0;
  border-radius: 0;
  line-height: 1.45;
  transition: background 180ms ease, box-shadow 180ms ease, padding 180ms ease, min-height 180ms ease;
}

.rd-editable:focus {
  min-height: 4.8rem;
  padding: 0.45rem 0.55rem;
  background: rgba(23, 76, 255, 0.06);
  box-shadow: inset 0 -1px 0 var(--rd-blue);
}

.rd-criterion-name {
  min-height: 2rem;
  font-weight: 900;
}

.rd-level-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.8rem;
  gap: 0.45rem;
  align-items: center;
}

.rd-level-head input,
.rd-table td:nth-child(2) input {
  width: 100%;
  min-height: 2rem;
  border: 0;
  border-bottom: 1px solid var(--rd-line);
  border-radius: 0;
  background: transparent;
  color: var(--rd-ink);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0;
}

.rd-remove-level {
  position: absolute;
  min-height: 1.8rem;
  width: 1.8rem;
  padding: 0;
  opacity: 0;
  color: var(--rd-red);
  transition: opacity 160ms ease, transform 160ms ease;
  right: 0.25rem;
  top: 0.25rem;
}

.rd-remove-row {
  width: 2.15rem;
  min-height: 2.15rem;
  display: grid;
  place-items: center;
  justify-self: end;
  align-self: start;
  color: var(--rd-red);
  padding: 0;
  border: 1px solid rgba(199, 80, 74, 0.28);
  border-radius: 50%;
  line-height: 0;
}

.rd-remove-row svg,
.rd-mobile-remove svg {
  width: 1rem;
  height: 1rem;
  fill: var(--rd-red);
}



.rd-level-head:hover .rd-remove-level {
  opacity: 1;
  transform: translateX(-2px);
}

.rd-criterion-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.15rem;
  gap: 0.65rem;
  align-items: start;
}

.rd-mobile-board {
  display: grid;
  gap: 0.95rem;
  padding-bottom: 0.35rem;
}

.rd-mobile-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.75rem 0.15rem 0.95rem;
  border-top: 1px solid var(--rd-line);
  border-bottom: 1px solid var(--rd-line);
  border-radius: 0;
  background: transparent;
}

.theme-dark .rd-mobile-levels {
  background: transparent;
}

.rd-mobile-section-label {
  grid-column: 1 / -1;
  color: var(--rd-muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.rd-mobile-level {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.25rem 0.5rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid var(--rd-line);
}

.theme-dark .rd-mobile-level {
  background: rgba(255, 255, 255, 0.035);
}

.rd-mobile-score-badge {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid var(--rd-line);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 850;
}

.rd-mobile-level input,
.rd-mobile-card input {
  width: 100%;
  min-height: 2.15rem;
  border: 0;
  border-bottom: 1px solid var(--rd-line);
  border-radius: 0;
  background: transparent;
  color: var(--rd-ink);
  font-weight: 850;
  padding: 0;
}

.rd-mobile-level > input {
  grid-column: 2;
}

.rd-mobile-level > button {
  grid-column: 1 / -1;
  min-height: 1.8rem;
  justify-self: start;
  color: var(--rd-red);
}

.rd-mobile-level-name {
  min-height: 1.5rem;
  display: grid;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.rd-mobile-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 0.15rem;
  border: 0;
  border-top: 1px solid var(--rd-line);
  border-bottom: 1px solid var(--rd-line);
  border-radius: 0;
  background: transparent;
}

.rd-mobile-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.4rem 2.5rem;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 420px) {
  .rubric-designer {
    padding: 0.85rem;
  }

  .rd-mobile-card-top {
    grid-template-columns: minmax(0, 1fr) 2.5rem;
  }

  .rd-mobile-weight {
    grid-column: 1 / -1;
    padding-left: 0;
    padding-top: 0.55rem;
    border-left: 0;
    border-top: 1px solid var(--rd-line);
  }
}

.rd-mobile-criterion-identity {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.rd-mobile-criterion-identity > span {
  color: var(--rd-blue);
  font-size: 0.82rem;
  font-weight: 850;
  padding-top: 0.15rem;
}

.rd-mobile-weight {
  align-self: stretch;
  padding-left: 0.55rem;
  border-left: 1px solid var(--rd-line);
}

.rd-mobile-card label,
.rd-mobile-descriptor {
  display: grid;
  gap: 0.3rem;
}

.rd-mobile-card label span,
.rd-mobile-descriptor span {
  color: var(--rd-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.rd-mobile-weight input {
  min-height: 2rem;
  font-size: 1.05rem;
}

.rd-mobile-descriptor .rd-editable {
  min-height: 4rem;
  padding: 0;
  border-top: 0;
  background: transparent;
}

.rd-mobile-descriptor {
  grid-template-columns: 4.35rem minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  padding: 0.85rem 0.05rem;
  border-top: 1px solid var(--rd-line);
}

.rd-mobile-descriptor-head {
  display: grid;
  gap: 0.2rem;
}

.rd-mobile-descriptor-head b {
  font-size: 1.15rem;
  color: var(--rd-ink);
}

.rd-mobile-descriptor-head em {
  color: var(--rd-muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
}

.rd-mobile-remove {
  width: 2.5rem;
  min-height: 2.5rem;
  display: grid;
  place-items: center;
  justify-self: end;
  align-self: start;
  color: var(--rd-red);
  padding: 0;
  border: 1px solid rgba(199, 80, 74, 0.28);
  border-radius: 50%;
  line-height: 0;
}

.rd-remove-row:hover,
.rd-mobile-remove:hover {
  background: rgba(199, 80, 74, 0.1);
}

.rd-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(11, 12, 14, 0.42);
}

.rd-confirm-backdrop[hidden] {
  display: none;
}

.rd-confirm-dialog {
  width: min(100%, 24rem);
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--rd-line);
  background: var(--rd-field);
  color: var(--rd-ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.rd-confirm-dialog strong {
  font-size: 1.05rem;
  line-height: 1.15;
}

.rd-confirm-dialog p {
  margin: 0;
  color: var(--rd-muted);
  line-height: 1.45;
}

.rd-confirm-actions {
  display: grid;
  gap: 0.5rem;
}

.rd-confirm-actions button:last-child {
  color: var(--rd-red);
  border-color: currentcolor;
}

.rubric-designer.rd-pdf-capture {
  width: 1120px;
  padding: 24px;
  background: #fff;
  color: var(--rd-ink);
}

.rubric-designer.rd-pdf-capture .rd-toolbar,
.rubric-designer.rd-pdf-capture .rd-mobile-board,
.rubric-designer.rd-pdf-capture .rd-confirm-backdrop {
  display: none;
}

.rubric-designer.rd-pdf-capture .rd-table-shell {
  display: block;
  overflow: visible;
  padding: 0;
}

.rubric-designer.rd-pdf-capture .rd-table {
  min-width: 0;
}

.rubric-designer.rd-pdf-capture .rd-remove-row,
.rubric-designer.rd-pdf-capture .rd-remove-level {
  display: none;
}

.rd-print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
}

@media (min-width: 760px) {
  .rubric-designer {
    gap: 1.1rem;
    padding: 1.35rem;
  }

  .rd-toolbar {
    grid-template-columns: minmax(16rem, 0.7fr) minmax(0, 1.3fr);
    align-items: stretch;
  }

  .rd-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rd-weight-card {
    grid-template-columns: 5.75rem minmax(0, 1fr);
  }

  .rd-orbit {
    width: 5.75rem;
  }

  .rd-confirm-actions {
    grid-template-columns: 1fr 1fr;
  }

  .rd-table-shell {
    display: block;
  }

  .rd-mobile-board {
    display: none;
  }
}

@media print {
  .rd-toolbar {
    display: none;
  }

  .rubric-designer {
    box-shadow: none;
    border: 0;
  }

  .rd-table-shell {
    display: block;
    overflow: visible;
  }

  .rd-mobile-board {
    display: none;
  }
}
