:root {
  --page-bg: var(--dk-bg-page);
  --surface-bg: var(--dk-bg-surface);
  --surface-muted: var(--dk-bg-muted);
  --border-muted: var(--dk-border-default);
  --text-primary: var(--dk-text-primary);
  --text-heading: var(--dk-text-heading);
  --text-muted: var(--dk-text-muted);
  --link-color: var(--dk-text-link);
  --link-hover: var(--dk-text-link-hover);
  --input-bg: var(--dk-bg-surface);
  --input-border: var(--dk-border-default);
  --input-text: var(--dk-text-primary);
  --success-bg: var(--dk-success-bg);
  --success-text: var(--dk-success-text);
  --success-border: var(--dk-border-default);
  --warning-bg: var(--dk-warning-bg);
  --warning-text: var(--dk-warning-text);
  --warning-border: var(--dk-border-default);
  --danger-bg: var(--dk-danger-bg);
  --danger-text: var(--dk-danger-text);
  --danger-border: var(--dk-border-default);
  --info-bg: var(--dk-info-bg);
  --info-text: var(--dk-info-text);
  --info-border: var(--dk-border-default);
  --focus-ring: var(--dk-focus-ring);
  --control-size: 1.1rem;
  --control-line-height: 1.35rem;
}

body {
  background: var(--page-bg);
  color: var(--text-primary);
}

.app-page {
  background: var(--page-bg);
  color: var(--text-primary);
}

.app-surface {
  background: var(--surface-bg);
}

.app-surface-muted {
  background: var(--surface-muted);
}

.app-border {
  border-color: var(--border-muted);
}

.app-divide > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border-muted);
}

.app-heading {
  color: var(--text-heading);
}

.app-text {
  color: var(--text-primary);
}

.app-muted {
  color: var(--text-muted);
}

.app-link {
  color: var(--link-color);
}

.app-link:hover {
  color: var(--link-hover);
}

.app-danger-text {
  color: var(--danger-text);
}

.app-success-text {
  color: var(--success-text);
}

.app-warning-text {
  color: var(--warning-text);
}

.registration-markdown h2,
.registration-markdown h3 {
  color: var(--text-heading);
  font-weight: 600;
  margin-top: 1.5rem;
}

.registration-markdown h2 {
  font-size: 1.5rem;
}

.registration-markdown h3 {
  font-size: 1.25rem;
}

.registration-markdown p,
.registration-markdown ul,
.registration-markdown ol {
  margin-top: 0.85rem;
}

.registration-markdown ul,
.registration-markdown ol {
  padding-left: 1.25rem;
}

.registration-markdown a {
  color: var(--link-color);
}

.registration-panel {
  align-self: start;
}

.registration-form {
  margin: 0;
}

.registration-field-label {
  color: var(--text-heading);
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.registration-form input[type="email"],
.registration-form input[type="text"],
.registration-form select {
  min-height: 44px;
}

.registration-form select {
  appearance: none;
  background-image: var(--dk-select-chevron);
  background-position: right 0.85rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2.75rem;
}

.country-combobox-field {
  position: relative;
}

.country-combobox-field input[data-country-combobox-input] {
  background-image: var(--dk-select-chevron);
  background-position: right 0.85rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2.75rem;
}

.country-combobox-panel {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  box-shadow: var(--dk-shadow-overlay);
  margin-top: 0.25rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.25rem;
  position: absolute;
  width: 100%;
  z-index: 30;
}

.country-combobox-option,
.country-combobox-empty {
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-sizing: border-box;
  color: var(--text-primary);
  display: block;
  font: inherit;
  min-height: 40px;
  padding: 0.55rem 0.7rem;
  text-align: left;
  width: 100%;
}

.country-combobox-option {
  cursor: pointer;
}

.country-combobox-option:hover,
.country-combobox-option[aria-selected="true"] {
  background: var(--info-bg);
  color: var(--text-heading);
}

.country-combobox-empty {
  color: var(--text-muted);
}

.registration-form textarea {
  min-height: 112px;
}

.checkbox-row {
  align-items: flex-start;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1.1rem minmax(0, 1fr);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--dk-accent-default);
  box-sizing: border-box;
  cursor: pointer;
  height: var(--control-size);
  vertical-align: middle;
  width: var(--control-size);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.checkbox-row input[type="checkbox"] {
  margin: 0.15rem 0 0;
}

.checkbox-label {
  color: var(--text-heading);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.checkbox-help {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
  margin-top: 0.25rem;
}

.toggle-row {
  align-items: flex-start;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 2.5rem minmax(0, 1fr);
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  background: var(--dk-bg-hover);
  border: 1px solid var(--dk-border-strong);
  border-radius: 999px;
  box-sizing: border-box;
  cursor: pointer;
  height: 1.35rem;
  margin: 0.08rem 0 0;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  width: 2.35rem;
}

.toggle-row input[type="checkbox"]:checked::after {
  content: none;
}

.toggle-row input[type="checkbox"]::before {
  background: var(--dk-bg-surface);
  border-radius: 999px;
  content: "";
  height: 0.95rem;
  left: 0.14rem;
  position: absolute;
  top: 0.14rem;
  transition: transform 0.15s ease;
  width: 0.95rem;
}

.toggle-row input[type="checkbox"]:checked {
  background: var(--dk-accent-default);
  border-color: transparent;
}

.toggle-row input[type="checkbox"]:checked::before {
  background: var(--dk-text-on-deep);
  transform: translateX(1rem);
}

.toggle-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.toggle-row input[type="checkbox"]:disabled {
  cursor: wait;
  opacity: 0.65;
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toggle-label {
  color: var(--text-heading);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.toggle-help {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.registration-submit-button,
.course-register-button {
  width: auto !important;
}

@media (max-width: 767px) {
  .registration-panel {
    border-radius: 6px;
    padding: 1rem !important;
  }

  .registration-panel h2 {
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .registration-panel .space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.9rem !important;
  }

  .registration-form input[type="email"],
  .registration-form input[type="text"],
  .registration-form select {
    min-height: 42px;
    padding: var(--dk-space-2) var(--dk-space-3);
  }

  .registration-form select {
    background-position: right 0.8rem center;
    padding-right: 2.6rem;
  }

  .country-combobox-field input[data-country-combobox-input] {
    background-position: right 0.8rem center;
    padding-right: 2.6rem;
  }

  .country-combobox-panel {
    max-height: 14rem;
  }

  .registration-form textarea {
    min-height: 104px;
    padding: var(--dk-space-2) var(--dk-space-3);
  }

  .checkbox-label {
    font-size: 0.9rem;
  }

  .registration-form .primer-button {
    width: auto !important;
  }

  .registration-form .registration-submit-button {
    min-height: 36px;
    padding: var(--dk-space-2) var(--dk-space-3);
  }

  .course-actions:has(.course-register-button) {
    display: flex !important;
  }

  .course-register-button {
    flex: 0 0 auto;
    justify-self: start;
  }
}

.app-hover-muted:hover {
  background: var(--surface-muted);
}

.project-submission-row {
  align-items: center;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.project-submission-student a {
  display: block;
}

.project-submission-votes {
  justify-content: flex-end;
  min-width: 3.5rem;
  white-space: nowrap;
}

.project-submission-vote-action {
  justify-content: center;
  min-width: 1.75rem;
}

.project-submission-vote-action:empty {
  display: none;
}

.project-submission-review {
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 4.75rem;
  text-align: right;
}

.project-vote-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  width: 28px;
}

.project-vote-button:hover {
  background: var(--surface-muted);
  color: var(--link-hover);
}

.project-vote-button.is-voted {
  color: var(--link-color);
}

.project-vote-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.submission-action-button {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--dk-text-sm);
  font-weight: 600;
  gap: 0.35rem;
  min-height: 28px;
  padding: var(--dk-space-1) var(--dk-space-2);
  text-decoration: none;
  white-space: nowrap;
}

.submission-action-button:hover {
  background: var(--dk-bg-hover);
  border-color: var(--dk-border-control-hover);
  color: var(--dk-text-primary);
  text-decoration: none;
}

.submission-action-button-primary {
  background: var(--info-bg);
  border-color: transparent;
  color: var(--info-text);
}

.submission-action-button-primary:hover {
  background: var(--dk-accent-soft);
  border-color: var(--dk-border-control-hover);
  color: var(--link-hover);
}

.submission-action-button-fixed {
  justify-content: center;
  width: 76px;
}

.submission-action-button-danger {
  background: var(--danger-bg);
  border-color: transparent;
  color: var(--danger-text);
}

.submission-action-button-danger:hover {
  background: var(--danger-bg);
  border-color: var(--dk-border-control-hover);
  color: var(--dk-danger-hover);
}

@media (min-width: 768px) {
  .project-submission-row {
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) 64px 40px 86px;
  }

  .project-submission-votes,
  .project-submission-vote-action,
  .project-submission-review {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .project-submission-row {
    gap: 0.45rem;
  }

  .project-submission-votes {
    min-width: 3.25rem;
  }

  .project-submission-review {
    min-width: 4.25rem;
  }
}

.app-alert-info {
  background: var(--info-bg);
  border-color: transparent;
  color: var(--text-primary);
}

.app-alert-success {
  background: var(--success-bg);
  border-color: transparent;
  color: var(--success-text);
}

.app-alert-warning {
  background: var(--warning-bg);
  border-color: transparent;
  color: var(--warning-text);
}

.app-alert-danger {
  background: var(--danger-bg);
  border-color: transparent;
  color: var(--danger-text);
}

.app-badge-neutral {
  background: var(--surface-muted) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-muted) !important;
}

.app-badge-info {
  background: var(--info-bg);
  border-color: transparent;
  color: var(--info-text);
}

.app-badge-success {
  background: var(--success-bg);
  border-color: transparent;
  color: var(--success-text);
}

.app-badge-warning {
  background: var(--warning-bg);
  border-color: transparent;
  color: var(--warning-text);
}

.app-badge-danger {
  background: var(--danger-bg);
  border-color: transparent;
  color: var(--danger-text);
}

.app-badge-neutral,
.app-badge-info,
.app-badge-success,
.app-badge-warning,
.app-badge-danger {
  border-style: solid;
  border-width: 1px;
  border-radius: 6px;
  letter-spacing: 0;
  line-height: 1.25;
  white-space: nowrap;
}

/* One pill spec for every status label. Pair with a colour class:
   <span class="app-badge app-badge-success">Submitted</span> */
.app-badge {
  align-items: center;
  border-radius: 9999px;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  width: fit-content;
}

/* Category/kicker labels (ACTIVE, ARCHIVED), not statuses. */
.app-badge-upper {
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.leaderboard-project-star {
  align-items: center;
  border-radius: 9999px;
  display: inline-flex;
  font-size: var(--dk-text-xs);
  height: 20px;
  justify-content: center;
  width: 20px;
}

.leaderboard-project-star-1 {
  background: var(--dk-warning-bg);
  color: var(--dk-warning-text);
}

.leaderboard-project-star-2 {
  background: var(--dk-info-bg);
  color: var(--dk-info-text);
}

.leaderboard-project-star-3 {
  background: var(--dk-success-bg);
  color: var(--dk-success-text);
}

.leaderboard-project-star-4 {
  background: var(--dk-accent-soft);
  color: var(--dk-accent-default);
}

.leaderboard-project-star-5 {
  background: var(--dk-danger-bg);
  color: var(--dk-danger-text);
}

/* Wrapped (year in review). Shared by wrapped.html and user_wrapped.html;
   colours come from tokens so dark mode needs no separate rules. */
.wrapped-hero {
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.wrapped-stat {
  background: var(--surface-bg);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  padding: 1.25rem;
}

.wrapped-stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.wrapped-stat-number {
  color: var(--text-heading);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0.35rem;
}

.wrapped-rank {
  align-items: center;
  border-radius: 9999px;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 600;
  height: 1.75rem;
  justify-content: center;
  width: 1.75rem;
}

.wrapped-rank-1 {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.wrapped-rank-2 {
  background: var(--info-bg);
  color: var(--info-text);
}

.wrapped-rank-3 {
  background: var(--success-bg);
  color: var(--success-text);
}

.wrapped-rank-other {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.dense-utility-links a {
  color: var(--text-muted);
  font-weight: 500;
}

.dense-utility-links a:hover {
  color: var(--link-hover);
}

/* Apply to the header nav or a div inside the header if it wraps your content */
header nav {
  margin: 0 auto; /* Centers the navigation horizontally */
  display: flex;
  justify-content: space-between; /* This will space your list and logout/login */
  align-items: center; /* This will align the items vertically */
}

/* Ensure the lists within the nav take up the appropriate space */
header nav ul {
  display: flex;
  align-items: center; /* Align list items vertically */
  padding: 0;
  margin: 0; /* Reset margins to control spacing explicitly */
}

header nav li:not(:last-child) {
  margin-right: 1rem; /* Adds margin to the right of each list item except the last */
}

.breadcrumbs ul {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Style each list item */
.breadcrumbs ul li {
  align-items: center;
  display: inline-flex;
  margin-right: 0.5rem;
  min-width: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.breadcrumbs ul li a {
  display: inline-block;
  vertical-align: middle;
  white-space: normal;
}

/* Add ">" before each li except the first one using a pseudo-element */
.breadcrumbs ul li:not(:first-child)::before {
  content: "/";
  color: var(--dk-text-faint);
  padding-right: 0.5rem;
  font-weight: 400;
  vertical-align: middle;
}

/* Right-side controls */
header nav > div:last-child ul li {
  font-size: 0.9rem;
  white-space: nowrap;
}

.app-content-shell {
  max-width: 56rem;
}

.impersonation-banner {
  background: var(--dk-warning-bg);
  border-bottom: 1px solid var(--dk-border-default);
  color: var(--dk-warning-text);
}

.impersonation-banner form {
  margin: 0;
}

.impersonation-return-button {
  background: transparent;
  border: 0;
  color: var(--dk-warning-text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
}

.impersonation-return-button:hover {
  color: var(--dk-text-heading);
}

.form-container {
  max-width: none;
  margin: 0;
  box-shadow: none;
  padding: 0;
}

.content-narrow {
  max-width: none;
}

.form-container .question {
  padding-top: 0;
}

.form-container .question .question-text {
  margin-bottom: 0.5rem;
}

.question-text {
  line-height: 1.4;
}

/* The label is a row, and the help icon flows inline after the last word of the
   text. It must not be a flex item: when the label wraps, a flex icon is pushed
   out to the right edge and centred against the whole block. */
.form-label-with-help {
  display: block;
  max-width: 100%;
}

/* Questions */
.form-check-label {
  display: inline;
  color: var(--text-primary);
  flex: 1;
  line-height: var(--control-line-height);
}

.form-check {
  align-items: flex-start;
  display: flex;
  gap: 0.4rem;
  min-height: 0;
}

/* Centre the control on the label's first line box. Both sides of this
   subtraction are shared with the control and label rules, so the two cannot
   drift apart. */
.form-check-input {
  flex: 0 0 auto;
  margin: calc((var(--control-line-height) - var(--control-size)) / 2) 0 0;
}

.question .space-y-2 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.25rem !important;
}

@media (max-width: 640px) {
  .form-check {
    min-height: 2rem;
  }
}

.form-control {
  box-sizing: border-box;
  min-height: 40px;
  background-color: var(--input-bg);
  border-color: var(--input-border);
  border-radius: 6px;
  color: var(--input-text);
  font-size: var(--dk-text-body);
}

input,
textarea,
select {
  color-scheme: light;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  color-scheme: dark;
}

form input[type="text"],
form input[type="url"],
form input[type="email"],
form input[type="number"],
form input[type="search"],
form textarea,
form select {
  box-sizing: border-box;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--input-text);
  font-size: var(--dk-text-body);
  min-height: 40px;
  padding: var(--dk-space-2) var(--dk-space-3);
  width: 100%;
}

form select,
select.form-control {
  padding-right: var(--dk-space-7);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--dk-bg-muted);
  border-color: var(--dk-border-default);
  color: var(--dk-text-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

/* Focused Inputs */
.form-control:focus,
form input[type="text"]:focus,
form input[type="url"]:focus,
form input[type="email"]:focus,
form input[type="number"]:focus,
form input[type="search"]:focus,
form textarea:focus,
form select:focus {
  border-color: var(--dk-border-strong);
  box-shadow: none;
  outline: none;
}

.form-control:focus-visible,
form input[type="text"]:focus-visible,
form input[type="url"]:focus-visible,
form input[type="email"]:focus-visible,
form input[type="number"]:focus-visible,
form input[type="search"]:focus-visible,
form textarea:focus-visible,
form select:focus-visible {
  border-color: var(--dk-border-strong);
  outline: 3px solid var(--dk-focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

.settings-page-title {
  color: var(--text-heading);
}

.settings-page-kicker,
.settings-section-copy,
.settings-helper,
.settings-meta-label {
  color: var(--text-muted);
}

.settings-section {
  border-color: var(--border-muted);
}

.settings-section-title,
.settings-label {
  color: var(--text-heading);
}

.settings-meta-value {
  color: var(--text-muted);
}

.settings-link {
  color: var(--link-color);
}

.user-menu-toggle {
  list-style: none;
  opacity: 0.76;
}

.user-menu-toggle::-webkit-details-marker {
  display: none;
}

.user-menu-toggle:hover {
  opacity: 1;
}

.user-menu-panel {
  min-width: min(16rem, calc(100vw - 2rem));
}

.user-menu-actions {
  padding-top: 0.25rem;
}

.user-menu-item {
  align-items: center;
  display: flex;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  width: 100%;
}

.user-menu-item:hover {
  background: var(--surface-muted);
}

.user-menu-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dark-mode-icon-stack {
  display: inline-flex;
  justify-content: center;
  width: 1rem;
}

.dark-mode-icon-stack .dark-mode-icon-light {
  display: inline-block;
}

.dark-mode-icon-stack .dark-mode-icon-dark {
  display: none;
}

body.dark-mode .dark-mode-icon-stack .dark-mode-icon-light {
  display: none;
}

body.dark-mode .dark-mode-icon-stack .dark-mode-icon-dark {
  display: inline-block;
}

.site-footer-brand {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.site-footer-tagline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer-meta {
  max-width: 100%;
}

.site-footer-link {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  gap: 0.25rem;
  justify-content: center;
  line-height: 1;
  opacity: 0.72;
  width: 1.25rem;
}

.footer-version {
  align-items: baseline;
  color: var(--text-muted);
  display: inline-flex;
  gap: 0.375rem;
  max-width: min(100%, 24rem);
  min-width: 0;
  opacity: 0.78;
  white-space: nowrap;
}

.footer-version-label {
  color: var(--text-heading);
  flex: 0 0 auto;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.footer-version-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.6875rem;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .footer-version {
    max-width: calc(100vw - 5.5rem);
  }

  .settings-form {
    margin-top: 1.25rem;
  }

  .settings-form > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1.5rem !important;
  }

  .settings-section {
    gap: 1rem;
    padding-top: 1.25rem;
  }

  .settings-section-copy,
  .settings-helper {
    line-height: 1.4;
    margin-top: 0.25rem;
  }
}

/* Buttons */
.primer-button {
  align-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--dk-accent-default);
  color: var(--dk-text-on-accent);
  display: inline-flex;
  font-size: var(--dk-text-body);
  font-weight: 600;
  gap: 0.35rem;
  justify-content: center;
  line-height: 20px;
  min-height: 32px;
  padding: var(--dk-space-1) var(--dk-space-3);
  text-decoration: none;
  white-space: nowrap;
}

.cadmin-shell .rounded-md,
.cadmin-shell section,
.cadmin-shell article,
.cadmin-shell form,
.cadmin-shell label,
.cadmin-shell input,
.cadmin-shell textarea,
.cadmin-shell button,
.cadmin-shell a {
  min-width: 0;
}

.cadmin-shell {
  font-size: var(--dk-text-body);
}

.cadmin-page > div.mx-auto {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.cadmin-page .breadcrumbs {
  margin-bottom: 1rem !important;
}

.cadmin-shell h1 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.cadmin-shell h2 {
  font-size: 0.95rem;
  line-height: 1.35;
}

.cadmin-section-heading {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.cadmin-page-header {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cadmin-support-strip {
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 1rem;
}

.cadmin-metrics-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.cadmin-metric {
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
}

.cloudwatch-graphs-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.cloudwatch-graph-card {
  padding: 0.9rem;
}

.cloudwatch-chart {
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  color: var(--dk-accent-default);
  height: 5rem;
  overflow: hidden;
}

.cloudwatch-chart svg {
  display: block;
  height: 100%;
  width: 100%;
}

.cloudwatch-empty-chart {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
}

.cadmin-count-badge {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 1.5rem;
  padding: 0.15rem 0.55rem;
}

.cadmin-list-row {
  border-radius: 6px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.cadmin-list-row:hover {
  background: var(--surface-muted);
}

.cadmin-shell article {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

.cadmin-shell .mt-6 {
  margin-top: 1rem !important;
}

.cadmin-shell .space-y-6 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem !important;
}

.cadmin-shell .primer-button {
  background: var(--dk-bg-muted);
  border-color: var(--dk-border-default);
  color: var(--dk-text-primary);
  font-size: var(--dk-text-md);
  min-height: 30px;
  padding: var(--dk-space-1) var(--dk-space-3);
}

.cadmin-shell .primer-button:hover {
  background: var(--dk-bg-hover);
  border-color: var(--dk-border-control-hover);
  color: var(--dk-text-primary);
}

.cadmin-shell .primer-button.cadmin-primary {
  background: var(--dk-accent-default);
  border-color: transparent;
  color: var(--dk-text-on-accent);
}

.cadmin-shell .primer-button.cadmin-primary:hover {
  background: var(--dk-accent-hover);
  border-color: transparent;
  color: var(--dk-text-on-accent);
}

.cadmin-row-actions form {
  display: inline-flex;
}

.cadmin-row-actions .primer-button {
  width: auto;
}

.cadmin-actions-menu {
  position: relative;
}

.cadmin-actions-menu[open] {
  z-index: 20;
}

.cadmin-actions-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  list-style: none;
  opacity: 0.45;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
  width: 26px;
}

.cadmin-actions-toggle::-webkit-details-marker {
  display: none;
}

.cadmin-actions-toggle:hover,
.cadmin-actions-menu[open] .cadmin-actions-toggle {
  background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
  border-color: transparent;
  opacity: 1;
}

.cadmin-actions-panel {
  background: var(--surface-bg);
  background: color-mix(in srgb, var(--surface-bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-muted);
  border-color: color-mix(in srgb, var(--border-muted) 75%, transparent);
  border-radius: 6px;
  box-shadow: var(--dk-shadow-overlay);
  min-width: 13.5rem;
  overflow: hidden;
  padding: 0.25rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
}

.cadmin-actions-panel form {
  display: block;
  margin: 0;
}

.cadmin-action-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  line-height: 1.25;
  padding: 0.45rem 0.55rem;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.cadmin-action-item:hover {
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
  color: var(--text-primary);
  text-decoration: none;
}

.cadmin-action-item i {
  color: var(--text-muted);
  flex: 0 0 1rem;
  text-align: center;
}

.cadmin-submenu {
  width: 100%;
}

.cadmin-submenu-toggle {
  list-style: none;
}

.cadmin-submenu-toggle::-webkit-details-marker {
  display: none;
}

.cadmin-submenu-caret {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 120ms ease;
}

.cadmin-submenu[open] .cadmin-submenu-caret {
  transform: rotate(180deg);
}

.cadmin-submenu-panel {
  padding-left: 1rem;
}

.cadmin-active-filter {
  background: var(--dk-accent-soft);
  border-color: var(--dk-border-default);
  color: var(--dk-accent-default);
}

.readonly-value {
  display: grid;
  gap: 0.15rem;
}

.readonly-value-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.readonly-value-content {
  color: var(--text-primary);
  font-weight: 500;
}

.course-list-thumb {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: var(--dk-bg-muted);
  color: var(--text-muted);
  display: flex;
  font-size: 1.5rem;
  font-weight: 700;
  justify-content: center;
}

.metric-row {
  display: grid;
  gap: 0.25rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.metric-row + .metric-row {
  border-top: 1px solid var(--border-muted);
  padding-top: 0.75rem;
}

.submission-card-meta {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cadmin-meta-grid > * {
  padding: 0.75rem !important;
}

.cadmin-meta-grid p:first-child,
.cadmin-shell dt {
  letter-spacing: 0;
}

.cadmin-score-input {
  max-width: 5rem;
}

.cadmin-criteria-row {
  grid-template-columns: minmax(0, 1fr) 5rem;
}

.cadmin-shell summary {
  list-style-position: inside;
}

.cadmin-shell table tbody tr:hover {
  background: var(--dk-bg-hover);
}

.primer-button:hover {
  background: var(--dk-accent-hover);
  border-color: transparent;
  color: var(--dk-text-on-accent);
  text-decoration: none;
}

.primer-button:disabled,
.primer-button[aria-disabled="true"] {
  background: var(--dk-bg-muted);
  border-color: var(--dk-border-default);
  color: var(--dk-text-muted);
  cursor: not-allowed;
  opacity: 1;
}

.primer-button:disabled:hover,
.primer-button[aria-disabled="true"]:hover {
  background: var(--dk-bg-muted);
  border-color: var(--dk-border-default);
  color: var(--dk-text-muted);
  text-decoration: none;
}

.primer-button-secondary {
  background: var(--dk-bg-muted);
  border-color: var(--dk-border-default);
  color: var(--dk-text-primary);
}

.primer-button-secondary:hover {
  background: var(--dk-bg-hover);
  border-color: var(--dk-border-control-hover);
  color: var(--dk-text-primary);
}

.primer-button-success {
  background: var(--dk-success-bg);
  border-color: transparent;
  color: var(--dk-success-text);
}

.primer-button-success:hover {
  background: var(--dk-success-bg);
  border-color: var(--dk-border-default);
  color: var(--dk-success-text);
}

.primer-button-warning {
  background: var(--dk-warning-bg);
  border-color: transparent;
  color: var(--dk-warning-text);
}

.primer-button-warning:hover {
  background: var(--dk-warning-bg);
  border-color: var(--dk-border-default);
  color: var(--dk-warning-text);
}

.course-actions .primer-button {
  justify-content: center;
}

.cadmin-compact-button {
  min-height: 28px;
  min-width: 30px;
  padding: var(--dk-space-1) var(--dk-space-2);
}

@media (max-width: 767px) {
  .course-actions {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .course-actions .primer-button {
    font-size: var(--dk-text-body);
    min-height: 36px;
    padding: var(--dk-space-2) var(--dk-space-3);
    width: auto !important;
    white-space: nowrap;
  }

  .primer-button {
    min-height: 36px;
    padding: var(--dk-space-2) var(--dk-space-3);
    white-space: normal;
  }

  .cadmin-shell article {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .cadmin-shell .primer-button {
    font-size: var(--dk-text-sm);
    min-height: 30px;
    padding: var(--dk-space-1) var(--dk-space-2);
    white-space: nowrap;
  }

  .cadmin-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .cadmin-shell section > div[class~="px-4"][class~="py-3"] {
    padding: 0.625rem 0.75rem !important;
  }

  .cadmin-shell section > div[class~="p-4"],
  .cadmin-shell .p-4 {
    padding: 0.75rem !important;
  }

  .cadmin-compact-button {
    min-height: 36px;
    min-width: 36px;
  }
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
  .breadcrumbs ul {
    flex-wrap: wrap;
    gap: 0.25rem 0;
  }

  .breadcrumbs ul li a {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .breadcrumbs ul li {
    font-size: 0.8rem;
    white-space: normal;
  }

  .breadcrumbs ul li a {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

.text-muted a, .text-muted a:visited, .text-muted a:hover, .text-muted a:focus, .text-muted a:active {
  color: inherit; /* This makes the link use the color of the parent .text-muted class */
}

.alert p {
  margin-bottom: 0;
}

.invalid-feedback {
  display: none;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}


.option-answer-correct {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-primary);
  display: flex;
  font-weight: 400;
  min-width: 0;
  padding: 0;
}

.option-answer-incorrect {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-primary);
  display: flex;
  font-weight: 400;
  min-width: 0;
  padding: 0;
}

.option-answer-none {
  padding: 0;
}

.option-answer-correct .form-check-label,
.option-answer-incorrect .form-check-label {
  color: inherit;
}

.option-answer-correct .form-check-label::after,
.option-answer-incorrect .form-check-label::after {
  font-size: 0.85rem;
  font-weight: 700;
  margin-left: 0.4rem;
}

.option-answer-correct .form-check-label::after {
  color: var(--success-text);
  content: "\2713";
}

.option-answer-incorrect .form-check-label::after {
  color: var(--danger-text);
  content: "\00d7";
}

.option-answer-correct .form-check-input,
.option-answer-incorrect .form-check-input {
  accent-color: var(--success-text);
}

.option-answer-correct::after,
.option-answer-incorrect::after {
  content: none;
}


.no-answer-indicator {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.no-answer-indicator i {
  margin-right: 0.5rem;
}

.container .row {
  border-bottom: 1px solid var(--dk-border-default); /* subtle bottom border for each row */
}

.container .row:last-child {
  border-bottom: none; /* remove border for the last row */
}

.tooltip-icon {
  margin-left: var(--dk-space-1); /* Adjust as needed */
}

.form-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  font-size: 0.72rem;
  line-height: 1;
  height: 0.9rem;
  width: 0.9rem;
  margin-left: 0.25rem;
  outline: none;
  position: relative;
  vertical-align: baseline;
}

/* Anchor the tooltip to the label row rather than to the icon: an icon sitting
   near the right edge would otherwise push its tooltip off-screen. The label
   must be a block so a short label still gives the tooltip room, and the icon
   must not be transformed: a transform would make the icon the containing
   block again and squeeze the tooltip to one word per line. */
label:has(.form-help-icon) {
  display: block;
  position: relative;
}

label:has(.form-help-icon) .form-help-icon {
  position: static;
}

label:has(.form-help-icon) .form-help-icon:hover::after,
label:has(.form-help-icon) .form-help-icon:focus::after {
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  width: auto;
  max-width: 20rem;
}

.form-help-icon:focus-visible {
  border-radius: 999px;
  outline: 3px solid var(--dk-focus-ring);
  outline-offset: 2px;
}

.form-help-icon:hover::after,
.form-help-icon:focus::after {
  content: attr(data-form-help);
  position: absolute;
  z-index: 1000;
  left: 0;
  top: calc(100% + 0.5rem);
  width: min(20rem, calc(100vw - 2rem));
  transform: none;
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  background: var(--surface-bg);
  color: var(--text-primary);
  box-shadow: var(--dk-shadow-overlay);
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  white-space: normal;
}

.question .question-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: var(--dk-space-2);
  border-radius: 4px;
}

.error-message {
  color: var(--dk-warning-text);
  background-color: var(--dk-warning-bg);
  border: 1px solid transparent;
  border-radius: 0.25rem;
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.error-message i {
  margin-right: 0.5rem;
}

.question input.is-invalid,
.question textarea.is-invalid,
.question select.is-invalid {
  background-color: var(--dk-danger-bg);
  border-color: var(--dk-border-strong);
}

.social-icon {
  font-size: 1.5rem;
  color: var(--dk-text-muted);
  margin-right: var(--dk-space-2);
  transition: color 0.3s ease;
}

.social-icon:hover {
  color: var(--dk-text-heading);
}

/* Dark Mode Styles */
html.dark-mode,
body.dark-mode {
  background-color: var(--dk-bg-page) !important;
  color: var(--dk-text-primary) !important;
}

body.dark-mode .bg-dark {
  background-color: var(--dk-bg-page) !important;
}

body.dark-mode .border-dark {
  border-color: var(--dk-border-default) !important;
}

body.dark-mode .form-container {
  background-color: var(--dk-bg-page) !important;
  box-shadow: none;
  border-color: transparent !important;
}

body.dark-mode a {
  color: var(--dk-text-link);
}

body.dark-mode a:hover {
  color: var(--dk-text-link-hover);
}

body.dark-mode header nav,
body.dark-mode .breadcrumbs,
body.dark-mode .breadcrumbs a {
  color: var(--dk-text-muted);
}

body.dark-mode footer {
  color: var(--dk-text-muted);
}

body.dark-mode footer a {
  color: var(--dk-text-link);
}

body.dark-mode .text-muted {
  color: var(--dk-text-muted) !important;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
  color: var(--dk-text-heading);
}

/* Border colors */
body.dark-mode .border-bottom {
  border-bottom-color: var(--dk-border-default) !important;
}

body.dark-mode .border {
  border-color: var(--dk-border-default) !important;
}

body.dark-mode .rounded {
  border-color: var(--dk-border-default);
}
