/* Calculator styles: grade-calc */

.gradebook-two-step {
  width: 100%;
  --gradebook-pill-graded-text: #0f766e;
  --gradebook-pill-graded-bg: rgba(20, 184, 166, 0.14);
  --gradebook-pill-graded-border: rgba(20, 184, 166, 0.22);
  --gradebook-pill-remaining-text: #1d4ed8;
  --gradebook-pill-remaining-bg: rgba(59, 130, 246, 0.14);
  --gradebook-pill-remaining-border: rgba(59, 130, 246, 0.22);
  --gradebook-pill-overweight-text: #9a3412;
  --gradebook-pill-overweight-bg: rgba(249, 115, 22, 0.14);
  --gradebook-pill-overweight-border: rgba(249, 115, 22, 0.22);
}

.vareoncalc-root.theme-dark .gradebook-two-step,
.vareoncalc-root[data-theme="dark"] .gradebook-two-step,
.vareoncalc-root[data-vareoncalc-theme="dark"] .gradebook-two-step {
  --gradebook-pill-graded-text: #99f6e4;
  --gradebook-pill-graded-bg: rgba(20, 184, 166, 0.28);
  --gradebook-pill-graded-border: rgba(45, 212, 191, 0.5);
  --gradebook-pill-remaining-text: #bfdbfe;
  --gradebook-pill-remaining-bg: rgba(59, 130, 246, 0.28);
  --gradebook-pill-remaining-border: rgba(96, 165, 250, 0.5);
  --gradebook-pill-overweight-text: #fed7aa;
  --gradebook-pill-overweight-bg: rgba(249, 115, 22, 0.28);
  --gradebook-pill-overweight-border: rgba(251, 146, 60, 0.5);
}

.gradebook-entry {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: none;
  padding: 0;
}

.gradebook-entry__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gradebook-entry__section.vareoncalc-section,
.gradebook-step-actions.vareoncalc-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.gradebook-entry__header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gradebook-entry__title {
  display: none;
}

.gradebook-entry__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  order: 1;
}

.gradebook-mode-toggle.vareoncalc-measurement-toggle,
.gradebook-mode-toggle.vareoncalc-measurement-toggle:not(.vareoncalc-toggle) {
  width: fit-content;
  min-width: 0;
  margin: 0;
}

.gradebook-mode-toggle__btn {
  min-width: 0;
  padding-inline: 8px;
}

.gradebook-settings-inline-wrap {
  display: inline-flex;
  align-items: center;
  order: 3;
}

.gradebook-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 8px;
  background: var(--sc-card-bg, #fff);
  color: var(--sc-muted-text, #6b7280);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.gradebook-settings-btn:hover {
  border-color: var(--sc-accent, #2563eb);
  color: var(--sc-accent, #2563eb);
  background: var(--sc-input-bg, #f8fafc);
}

.gradebook-settings-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sc-accent, #2563eb) 45%, transparent);
  outline-offset: 2px;
}

.gradebook-settings-btn.is-active {
  border-color: color-mix(in srgb, var(--sc-accent, #2563eb) 38%, var(--sc-card-border, #e5e7eb) 62%);
  color: var(--sc-accent, #2563eb);
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 8%, var(--sc-card-bg, #fff) 92%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sc-accent, #2563eb) 18%, transparent);
}

.gradebook-weight-indicator {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-left: auto;
  order: 2;
  padding: 0;
  min-height: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}

.gradebook-weight-indicator__prefix {
  font-weight: 600;
  font-size: 20px;
  color: var(--sc-card-text, #111827);
}

.gradebook-weight-indicator__value {
  font-weight: 700;
  color: var(--sc-card-text, #111827);
  font-size: 20px;
}

.gradebook-weight-indicator__label {
  display: none;
}

.gradebook-quick-add {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 96px 112px 40px;
  gap: 8px;
  align-items: stretch;
}

.gradebook-quick-add.vareoncalc-section {
  border: none;
  border-radius: 10px;
  background: var(--sc-card-bg, #fff);
}

.gradebook-input {
  margin-bottom: 0;
}

.vareoncalc-card input.gradebook-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.vareoncalc-card select.gradebook-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--sc-input-border, #d1d5db);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--sc-input-bg, #fff);
  color: var(--sc-card-text, #111827);
}

/* Keep suffix-wrapped score/weight fields the same row height as plain inputs + add button */
.gradebook-quick-add > .vareoncalc-input-adorned {
  display: flex;
  align-items: stretch;
  min-height: 40px;
  width: 100%;
  min-width: 0;
}

.gradebook-quick-add > .vareoncalc-input-adorned > input.gradebook-input,
.gradebook-quick-add > .vareoncalc-input-adorned > select.gradebook-input {
  height: 100%;
  min-height: 40px;
  align-self: stretch;
}

.vareoncalc-card input.gradebook-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.vareoncalc-card select.gradebook-input:focus {
  border-color: var(--sc-accent, #2563eb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc-accent, #2563eb) 22%, transparent);
  outline: none;
}

/*
 * Scenario modal is portaled to document.body (outside .vareoncalc-card). Duplicate the
 * gradebook field look so "Desired Final Grade" matches quick-add row; theme vars are
 * copied onto the modal element in JS when it opens.
 */
.gradebook-settings-modal input.gradebook-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.gradebook-settings-modal select.gradebook-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--sc-input-border, #d1d5db);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--sc-input-bg, #fff);
  color: var(--sc-card-text, #111827);
}

.gradebook-settings-modal input.gradebook-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.gradebook-settings-modal select.gradebook-input:focus {
  border-color: var(--sc-accent, #2563eb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc-accent, #2563eb) 22%, transparent);
  outline: none;
}

.gradebook-input::placeholder {
  color: var(--sc-muted-text, #94a3b8);
}

.gradebook-add-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  border: 1px dashed var(--sc-accent, #2563eb);
  border-radius: 10px;
  background: transparent;
  color: var(--sc-accent, #2563eb);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gradebook-add-btn:hover {
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 8%, transparent);
}

.gradebook-add-btn--editing {
  border-style: solid;
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 12%, transparent);
}

.gradebook-add-btn__icon {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.gradebook-list-shell {
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.gradebook-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 104px 36px;
  gap: 8px;
  padding: 4px 14px 10px;
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-list-header__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-muted-text, #94a3b8);
}

.gradebook-list-header__action svg {
  width: 14px;
  height: 14px;
}

.gradebook-assignment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  padding: 8px 2px 2px;
}

.gradebook-assignment-list::-webkit-scrollbar {
  width: 6px;
}

.gradebook-assignment-list::-webkit-scrollbar-track {
  background: var(--sc-input-bg, #f1f5f9);
}

.gradebook-assignment-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--sc-muted-text, #94a3b8) 86%, transparent);
  border-radius: 999px;
}

.gradebook-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 104px 36px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  background: var(--sc-card-bg, #fff);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
}

.gradebook-assignment-row:hover {
  border-color: color-mix(in srgb, var(--sc-accent, #2563eb) 28%, var(--sc-card-border, #e5e7eb) 72%);
}

.gradebook-assignment-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sc-accent, #2563eb) 48%, transparent);
  outline-offset: -2px;
}

.gradebook-assignment-row--editing {
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 10%, var(--sc-card-bg, #fff) 90%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc-accent, #2563eb) 28%, transparent);
}

.gradebook-assignment-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--sc-card-text, #111827);
}

.gradebook-assignment-row__score,
.gradebook-assignment-row__weight {
  text-align: center;
  font-weight: 600;
  color: var(--sc-card-text, #111827);
}

.gradebook-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sc-muted-text, #94a3b8);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.gradebook-remove-btn:hover {
  color: var(--sc-error, #dc2626);
  background: color-mix(in srgb, var(--sc-error, #dc2626) 10%, transparent);
}

.gradebook-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 16px;
}

.gradebook-empty__text {
  font-size: 13px;
  color: var(--sc-muted-text, #6b7280);
  text-align: center;
}

.gradebook-entry__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gradebook-remaining-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 10px 14px;
  border: 1px dashed var(--sc-accent, #2563eb);
  border-radius: 12px;
  background: transparent;
  color: var(--sc-accent, #2563eb);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.gradebook-remaining-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 8%, transparent);
}

.gradebook-remaining-btn:disabled,
.gradebook-remaining-btn--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gradebook-remaining {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.gradebook-remaining::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sc-muted-text, #6b7280) 45%, transparent);
  flex: 0 0 auto;
}

.gradebook-remaining[hidden] {
  display: none !important;
}

.gradebook-entry__footer .gradebook-remaining {
  margin-top: 0;
}

.gradebook-remaining__text {
  font-size: 11px;
  line-height: 1.35;
  color: var(--sc-muted-text, #6b7280);
  font-weight: 500;
}

.gradebook-step-actions {
  margin-top: 2px;
}

.gradebook-step-actions .vareoncalc-btn {
  border-radius: 12px;
}

.gradebook-step-actions .vareoncalc-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.gradebook-results-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vareoncalc-gradebook-report {
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  background: var(--sc-card-bg, #fff);
  overflow: hidden;
}

.vareoncalc-gradebook-report--placeholder {
  padding: var(--sc-card-padding);
}

.gradebook-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 170px;
  text-align: center;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-empty-state svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  opacity: 0.7;
}

.gradebook-empty-state p {
  margin: 0;
  max-width: 320px;
  line-height: 1.45;
}

.gradebook-report-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: var(--sc-card-padding);
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-card-bg, #fff);
}

.gradebook-ring-wrap {
  display: flex;
  justify-content: center;
}

.gradebook-ring {
  position: relative;
  width: 170px;
  height: 170px;
}

.gradebook-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gradebook-ring__track,
.gradebook-ring__progress {
  fill: none;
  stroke-width: 14;
}

.gradebook-ring__track {
  stroke: color-mix(in srgb, var(--sc-card-border, #e5e7eb) 78%, transparent);
}

.gradebook-ring__progress {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.gradebook-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gradebook-ring__value {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  color: var(--sc-card-text, #111827);
}

.gradebook-ring__letter {
  margin-top: 7px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gradebook-report-hero__summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gradebook-report-hero__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sc-muted-text, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gradebook-report-hero__headline {
  font-size: 22px;
  font-weight: 700;
  color: var(--sc-card-text, #111827);
}

.gradebook-report-hero__stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.gradebook-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 12px 10px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  background: var(--sc-input-bg, #f8fafc);
}

.gradebook-stat-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-stat-card__value {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--sc-card-text, #111827);
}

.gradebook-completion {
  margin: 0 16px 16px;
  padding: 14px 16px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 10px;
  background: var(--sc-input-bg, #f8fafc);
}

.gradebook-completion__label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sc-muted-text, #6b7280);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gradebook-completion__label::before,
.gradebook-completion__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sc-card-border, #e5e7eb);
}

.gradebook-completion__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.gradebook-completion-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.gradebook-completion-pill--graded {
  color: var(--gradebook-pill-graded-text, #0f766e);
  background: var(--gradebook-pill-graded-bg, rgba(20, 184, 166, 0.14));
  border-color: var(--gradebook-pill-graded-border, rgba(20, 184, 166, 0.22));
}

.gradebook-completion-pill--remaining {
  color: var(--gradebook-pill-remaining-text, #1d4ed8);
  background: var(--gradebook-pill-remaining-bg, rgba(59, 130, 246, 0.14));
  border-color: var(--gradebook-pill-remaining-border, rgba(59, 130, 246, 0.22));
}

.gradebook-completion-pill--overweight {
  color: var(--gradebook-pill-overweight-text, #9a3412);
  background: var(--gradebook-pill-overweight-bg, rgba(249, 115, 22, 0.14));
  border-color: var(--gradebook-pill-overweight-border, rgba(249, 115, 22, 0.22));
}

.gradebook-scenario-card {
  margin: 0 16px 16px;
  padding: 16px;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 10px;
  background: var(--sc-card-bg, #fff);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gradebook-scenario-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sc-card-text, #111827);
  text-align: center;
}

.gradebook-scenario-card__message {
  font-size: 13px;
  color: var(--sc-muted-text, #6b7280);
  line-height: 1.5;
}

.gradebook-scenario-card__required {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.gradebook-scenario-card__required-label {
  font-size: 12px;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-scenario-card__required-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  color: var(--sc-card-text, #111827);
}

.gradebook-scenario-card__required-context {
  font-size: 12px;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-scenario-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gradebook-scenario-card__badge--impossible {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.12);
}

.gradebook-scenario-card__badge--achieved {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
}

.gradebook-scenario-card__badge--hard {
  color: #c2410c;
  background: rgba(249, 115, 22, 0.12);
}

.gradebook-scenario-card__badge--moderate {
  color: #a16207;
  background: rgba(245, 158, 11, 0.14);
}

.gradebook-scenario-card__badge--easy {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
}

.gradebook-scenario-card--notice {
  border-color: color-mix(in srgb, var(--sc-warning, #f59e0b) 30%, var(--sc-card-border, #e5e7eb) 70%);
  background: color-mix(in srgb, var(--sc-warning, #f59e0b) 8%, var(--sc-card-bg, #fff) 92%);
}

.gradebook-scenario-card--prompt {
  border-style: dashed;
  border-color: var(--sc-card-border, #e5e7eb);
  background: var(--sc-input-bg, #f9fafb);
  text-align: center;
}

.gradebook-scenario-card--prompt .gradebook-scenario-card__title {
  font-weight: 700;
  color: var(--sc-card-text, #111827);
}

.gradebook-scenario-card--prompt .gradebook-scenario-card__message {
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-scenario-card--final {
  align-items: center;
  text-align: center;
}

.gradebook-settings-modal {
  position: fixed;
  inset: 0;
  z-index: var(--vareoncalc-modal-z-index, 2000000);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sc-card-padding);
}

.gradebook-settings-modal[hidden] {
  display: none !important;
}

.gradebook-settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: gradebook-modal-backdrop-in 0.18s ease;
}

@keyframes gradebook-modal-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.gradebook-settings-modal__container {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-top: 2px solid var(--sc-accent, #2563eb);
  border-radius: 11px;
  background: var(--sc-card-bg, #fff);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  z-index: 1;
  animation: gradebook-modal-in 0.2s ease;
}

@keyframes gradebook-modal-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gradebook-settings-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-card-bg, #fff);
}

.gradebook-settings-modal__title-group {
  flex: 1;
  min-width: 0;
}

.gradebook-settings-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--sc-card-text, #111827);
}

.gradebook-settings-modal__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--sc-muted-text, #6b7280);
}

.gradebook-settings-modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sc-muted-text, #6b7280);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.gradebook-settings-modal__close:hover {
  border-color: var(--sc-card-border, #e5e7eb);
  color: var(--sc-card-text, #111827);
  background: var(--sc-input-bg, #f9fafb);
}

.gradebook-settings-modal__close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sc-accent, #2563eb) 45%, transparent);
  outline-offset: 2px;
}

.gradebook-settings-modal__body {
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--sc-card-bg, #fff);
}

.gradebook-settings-modal__footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-card-bg, #fff);
  display: flex;
  justify-content: flex-end;
}

.gradebook-settings-modal__footer .vareoncalc-btn {
  margin-top: 0;
  background: var(--sc-button-bg, var(--sc-accent, #2563eb));
  color: var(--sc-button-text, #fff);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.gradebook-settings-modal__footer .vareoncalc-btn:hover:not(:disabled) {
  background: var(--sc-button-hover, color-mix(in srgb, var(--sc-accent, #2563eb) 85%, #000));
}

.gradebook-goal-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 10px;
  background: var(--sc-card-bg, #fff);
  overflow: hidden;
}

.gradebook-goal-card.vareoncalc-section {
  padding: 0;
  gap: 0;
  box-shadow: none;
  background: var(--sc-card-bg, #fff);
}

.gradebook-goal-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-input-bg, #f9fafb);
}

.gradebook-goal-card__header svg {
  flex-shrink: 0;
  color: var(--sc-accent, #2563eb);
}

.gradebook-goal-card__header-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.gradebook-goal-card__eyebrow {
  color: var(--sc-card-text, #111827);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.gradebook-goal-card.is-active {
  border-color: color-mix(in srgb, var(--sc-accent, #2563eb) 34%, var(--sc-card-border, #e5e7eb) 66%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sc-accent, #2563eb) 12%, transparent);
}

.gradebook-goal-card__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  background: var(--sc-card-bg, #fff);
}

.gradebook-goal-primary {
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 10px;
  padding: 12px;
  background: var(--sc-card-bg, #fff);
}

.gradebook-goal-card.is-active .gradebook-goal-primary {
  border-color: color-mix(in srgb, var(--sc-accent, #2563eb) 34%, var(--sc-card-border, #e5e7eb) 66%);
}

.gradebook-goal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.gradebook-goal-grid .vareoncalc-field {
  margin-bottom: 0;
}

.gradebook-goal-grid label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-card-text, #111827);
}

/* Match quick-add row: same 40px height, radii, and suffix rail as other gradebook inputs */
.gradebook-goal-grid .vareoncalc-input-adorned {
  display: flex;
  align-items: stretch;
  min-height: 40px;
  width: 100%;
  min-width: 0;
}

.gradebook-goal-grid .vareoncalc-input-adorned > input.gradebook-input,
.gradebook-goal-grid .vareoncalc-input-adorned > select.gradebook-input {
  height: 100%;
  min-height: 40px;
  align-self: stretch;
  margin-bottom: 0;
}

.gradebook-goal-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gradebook-goal-actions__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-muted-text, #6b7280);
  letter-spacing: 0.01em;
}

.gradebook-goal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gradebook-goal-btn {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  border: 1px solid var(--sc-card-border, #d1d5db);
  border-radius: 10px;
  background: var(--sc-input-bg, #f8fafc);
  color: var(--sc-card-text, #111827);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gradebook-goal-btn:hover {
  border-color: var(--sc-accent, #2563eb);
  color: var(--sc-accent, #2563eb);
  background: color-mix(in srgb, var(--sc-accent, #2563eb) 8%, transparent);
}

.gradebook-goal-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sc-accent, #2563eb) 40%, transparent);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .gradebook-report-hero__summary {
    align-items: center;
  }

  .gradebook-report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gradebook-entry__header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .gradebook-entry__title-row {
    flex-wrap: wrap;
  }

  .gradebook-weight-indicator {
    margin-left: auto;
  }

  .gradebook-weight-indicator__prefix,
  .gradebook-weight-indicator__value {
    font-size: 16px;
  }

  .gradebook-quick-add {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .gradebook-input--name {
    grid-column: 1 / -1;
  }

  .gradebook-add-btn {
    grid-column: 1 / -1;
    width: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .gradebook-list-header,
  .gradebook-assignment-row {
    grid-template-columns: minmax(0, 1fr) 72px 92px 32px;
    gap: 6px;
    font-size: 12px;
  }

  .gradebook-settings-modal {
    padding: 0;
    align-items: flex-end;
  }

  .gradebook-settings-modal__container {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    animation: gradebook-modal-slide-up 0.28s ease;
  }

  .gradebook-settings-modal__header {
    padding: 14px 16px;
    gap: 10px;
  }

  .gradebook-settings-modal__title {
    font-size: 16px;
  }

  .gradebook-settings-modal__subtitle {
    font-size: 12px;
  }

  .gradebook-settings-modal__body {
    padding: 12px 16px;
  }

  .gradebook-settings-modal__footer {
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .gradebook-settings-modal__footer .vareoncalc-btn {
    width: 100%;
  }
}

@keyframes gradebook-modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@container vareoncalc (max-width: 640px) {
  .gradebook-entry__header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .gradebook-entry__title-row {
    flex-wrap: wrap;
  }

  .gradebook-weight-indicator {
    margin-left: auto;
  }

  .gradebook-weight-indicator__prefix,
  .gradebook-weight-indicator__value {
    font-size: 16px;
  }

  .gradebook-quick-add {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .gradebook-input--name {
    grid-column: 1 / -1;
  }

  .gradebook-add-btn {
    grid-column: 1 / -1;
    width: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .gradebook-list-header,
  .gradebook-assignment-row {
    grid-template-columns: minmax(0, 1fr) 72px 92px 32px;
    gap: 6px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .gradebook-report-metrics {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .gradebook-stat-card {
    flex-direction: row;
    justify-content: space-between;
    border: none;
    border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
    border-radius: 0;
    background: transparent;
    padding: 10px 16px;
    gap: 8px;
  }

  .gradebook-stat-card:last-child {
    border-bottom: none;
  }

  .gradebook-stat-card__value {
    font-size: 16px;
  }

  .gradebook-goal-actions {
    grid-template-columns: 1fr;
  }

  .gradebook-ring {
    width: 140px;
    height: 140px;
  }

  .gradebook-ring__value {
    font-size: 26px;
  }

  .gradebook-report-hero__headline {
    font-size: 18px;
  }

  .gradebook-report-hero__stats {
    font-size: 12px;
  }

  .gradebook-completion__label::before,
  .gradebook-completion__label::after {
    display: none;
  }

  .gradebook-scenario-card {
    margin: 0 12px 12px;
    padding: 12px;
  }

  .gradebook-scenario-card__title {
    font-size: 14px;
  }

  .gradebook-scenario-card__required-value {
    font-size: 28px;
  }
}

@media (max-width: 410px) {
  .gradebook-settings-inline-wrap {
    order: 2;
    width: auto;
  }

  .gradebook-weight-indicator {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .gradebook-quick-add {
    grid-template-columns: 1fr;
  }

  .gradebook-list-header,
  .gradebook-assignment-row {
    grid-template-columns: 1fr 64px 74px 28px;
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .gradebook-entry {
    gap: 10px;
  }

  .gradebook-entry__section {
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .gradebook-entry__header {
    gap: 6px;
  }

  .gradebook-entry__title-row {
    gap: 6px;
  }

  .gradebook-settings-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .gradebook-mode-toggle__btn {
    padding-inline: 6px;
    font-size: 11px;
  }

  .gradebook-weight-indicator__prefix,
  .gradebook-weight-indicator__value {
    font-size: 14px;
  }

  .gradebook-quick-add,
  .gradebook-list-shell,
  .gradebook-step-actions {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .gradebook-quick-add {
    gap: 6px;
  }

  .gradebook-add-btn {
    margin-bottom: 0;
    min-height: 40px;
  }

  .gradebook-list-header {
    grid-template-columns: 1fr;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  }

  .gradebook-list-header > :not(:first-child) {
    display: none;
  }

  .gradebook-assignment-row {
    grid-template-columns: 1fr 1fr 28px;
    gap: 6px;
    padding: 8px 10px;
  }

  .gradebook-assignment-row__name {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .gradebook-remove-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  .gradebook-assignment-row__score {
    grid-row: 2;
  }

  .gradebook-assignment-row__weight {
    grid-row: 2;
  }

  .gradebook-assignment-row__score,
  .gradebook-assignment-row__weight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid var(--sc-card-border, #e5e7eb);
    border-radius: 8px;
    background: var(--sc-input-bg, #f8fafc);
    text-align: left;
    font-size: 12px;
  }

  .gradebook-assignment-row__score::before,
  .gradebook-assignment-row__weight::before {
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sc-muted-text, #6b7280);
  }

  .gradebook-empty {
    min-height: 72px;
    padding: 10px 0;
  }

  .gradebook-entry__footer {
    gap: 8px;
  }

  .gradebook-entry__footer .gradebook-remaining {
    width: 100%;
    margin-inline-start: 0;
  }
}

@container vareoncalc (max-width: 560px) {
  .gradebook-report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container vareoncalc (max-width: 480px) {
  .gradebook-report-metrics {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .gradebook-stat-card {
    flex-direction: row;
    justify-content: space-between;
    border: none;
    border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
    border-radius: 0;
    background: transparent;
    padding: 10px 16px;
    gap: 8px;
  }

  .gradebook-stat-card:last-child {
    border-bottom: none;
  }

  .gradebook-stat-card__value {
    font-size: 16px;
  }

  .gradebook-ring {
    width: 140px;
    height: 140px;
  }

  .gradebook-ring__value {
    font-size: 26px;
  }

  .gradebook-report-hero__headline {
    font-size: 18px;
  }

  .gradebook-report-hero__stats {
    font-size: 12px;
  }

  .gradebook-scenario-card {
    margin: 0 12px 12px;
    padding: 12px;
  }

  .gradebook-scenario-card__title {
    font-size: 14px;
  }

  .gradebook-scenario-card__required-value {
    font-size: 28px;
  }

  .gradebook-completion__label::before,
  .gradebook-completion__label::after {
    display: none;
  }
}

@container vareoncalc (max-width: 410px) {
  .gradebook-settings-inline-wrap {
    order: 2;
    width: auto;
  }

  .gradebook-weight-indicator {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .gradebook-quick-add {
    grid-template-columns: 1fr;
  }

  .gradebook-list-header,
  .gradebook-assignment-row {
    grid-template-columns: 1fr 64px 74px 28px;
    gap: 6px;
  }
}

@container vareoncalc (max-width: 360px) {
  .gradebook-entry {
    gap: 10px;
  }

  .gradebook-entry__section {
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .gradebook-entry__header {
    gap: 6px;
  }

  .gradebook-entry__title-row {
    gap: 6px;
  }

  .gradebook-settings-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .gradebook-mode-toggle__btn {
    padding-inline: 6px;
    font-size: 11px;
  }

  .gradebook-weight-indicator__prefix,
  .gradebook-weight-indicator__value {
    font-size: 14px;
  }

  .gradebook-quick-add,
  .gradebook-list-shell,
  .gradebook-step-actions {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .gradebook-quick-add {
    gap: 6px;
  }

  .gradebook-add-btn {
    margin-bottom: 0;
    min-height: 40px;
  }

  .gradebook-list-header {
    grid-template-columns: 1fr;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
  }

  .gradebook-list-header > :not(:first-child) {
    display: none;
  }

  .gradebook-assignment-row {
    grid-template-columns: 1fr 1fr 28px;
    gap: 6px;
    padding: 8px 10px;
  }

  .gradebook-assignment-row__name {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .gradebook-remove-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  .gradebook-assignment-row__score {
    grid-row: 2;
  }

  .gradebook-assignment-row__weight {
    grid-row: 2;
  }

  .gradebook-assignment-row__score,
  .gradebook-assignment-row__weight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid var(--sc-card-border, #e5e7eb);
    border-radius: 8px;
    background: var(--sc-input-bg, #f8fafc);
    text-align: left;
    font-size: 12px;
  }

  .gradebook-assignment-row__score::before,
  .gradebook-assignment-row__weight::before {
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sc-muted-text, #6b7280);
  }

  .gradebook-empty {
    min-height: 72px;
    padding: 10px 0;
  }

  .gradebook-entry__footer {
    gap: 8px;
  }

  .gradebook-entry__footer .gradebook-remaining {
    width: 100%;
    margin-inline-start: 0;
  }
}
