:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #617080;
  --line: #d7dee5;
  --paper: #ffffff;
  --wash: #f5f7f9;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #9a3412;
  --focus: #d99b2b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.nav a,
.link-button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
}

.nav a:hover,
.link-button:hover {
  color: var(--ink);
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 42px 28px 80px;
}

.auth-panel,
.section-head,
.mark-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.auth-panel {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 8vh;
  padding: 36px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 2.8rem, 3rem);
}

h2 {
  font-size: 1.35rem;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 12px 0 0;
}

.primary-action,
.secondary-action {
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  text-decoration: none;
}

.primary-action {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.setup-warning,
.alert.error {
  color: var(--warn);
}

.alerts {
  margin-bottom: 18px;
}

.alert {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 6px;
  margin: 0 0 10px;
  padding: 12px 14px;
}

.choice-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.choice-tile,
.project-card,
.rubric-block,
.communication-block,
.comment-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-tile {
  cursor: pointer;
  min-height: 88px;
  padding: 18px;
}

.choice-tile input {
  margin-right: 8px;
}

.choice-tile span {
  font-size: 1.1rem;
  font-weight: 800;
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-card {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 42px 1fr;
  padding: 16px;
  text-decoration: none;
}

.project-card:hover,
.choice-tile:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.project-order {
  align-items: center;
  background: #eef3f3;
  border-radius: 6px;
  color: var(--accent-strong);
  display: flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
}

.project-card span span,
td span {
  color: var(--muted);
  display: block;
}

.mark-head {
  align-items: start;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #111820;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  width: 100%;
}

.video-frame iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.mark-form {
  display: grid;
  gap: 22px;
}

.rubric-block,
.communication-block {
  margin: 0;
  padding: 20px;
}

legend {
  font-size: 1.15rem;
  font-weight: 850;
  padding: 0 8px;
}

legend small {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 2px;
}

.rubric-options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.rubric-option {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 18px 1fr;
  padding: 14px;
}

.rubric-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.rubric-option strong {
  display: block;
  margin-bottom: 4px;
}

.rubric-option em {
  color: var(--muted);
  display: block;
  font-style: normal;
}

.rating-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  margin-top: 10px;
  max-width: 420px;
}

.rating-row label {
  cursor: pointer;
}

.rating-row input {
  position: absolute;
  opacity: 0;
}

.rating-row span {
  align-items: center;
  background: #eef3f3;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  font-size: 1.1rem;
  font-weight: 850;
  height: 52px;
  justify-content: center;
}

.rating-row input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.comment-block {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.comment-block span {
  font-weight: 850;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.form-actions {
  align-items: center;
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.sticky-actions {
  background: rgba(245, 247, 249, 0.92);
  border-top: 1px solid var(--line);
  bottom: 0;
  margin: 0 -28px -80px;
  padding: 16px 28px;
  position: sticky;
}

.admin-head {
  align-items: center;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 900px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f3;
  font-size: 0.82rem;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .topbar,
  .auth-panel,
  .section-head,
  .mark-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 16px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .page {
    padding: 28px 16px 72px;
  }

  h1 {
    font-size: 2rem;
  }

  .auth-panel {
    margin-top: 0;
    padding: 24px;
  }

  .rating-row {
    grid-template-columns: repeat(5, 1fr);
  }

  .sticky-actions {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
