:root {
  --ink: #172026;
  --muted: #56636c;
  --paper: #f5efe4;
  --surface: #fffaf2;
  --line: #d4c5ae;
  --blue: #245c83;
  --burgundy: #8e3342;
  --olive: #526443;
  --gold: #c79a3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.sheet-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 5vw;
  background: rgba(255, 250, 242, 0.96);
  border-bottom: 1px solid var(--line);
}

.sheet-toolbar a,
.sheet-toolbar button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.sheet {
  max-width: 900px;
  margin: 34px auto;
  padding: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(23, 32, 38, 0.12);
}

.sheet-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 4px solid var(--burgundy);
}

.school {
  margin: 0 0 8px;
  color: var(--blue);
  font-weight: 850;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: 1.1;
}

.year-badge {
  display: grid;
  place-items: center;
  min-width: 96px;
  height: 96px;
  padding: 12px;
  color: #fff;
  background: var(--olive);
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 850;
  text-align: center;
}

.student-row {
  display: grid;
  grid-template-columns: 1fr 160px 160px;
  gap: 16px;
  margin: 24px 0;
}

.blank {
  min-height: 34px;
  border-bottom: 1px solid var(--ink);
}

.label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.lead {
  margin: 0 0 22px;
  padding: 18px;
  background: #ffffff;
  border-left: 6px solid var(--gold);
  border-radius: 8px;
}

.activity {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.activity h2 {
  margin: 0 0 12px;
  color: var(--burgundy);
  font-size: 1.28rem;
}

.activity p {
  margin: 8px 0;
}

.activity ol,
.activity ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

.activity li {
  margin: 9px 0;
}

.answer-lines {
  display: grid;
  gap: 15px;
  margin-top: 14px;
}

.answer-lines span {
  display: block;
  height: 28px;
  border-bottom: 1px solid var(--line);
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.source-list a {
  font-weight: 750;
}

.rubric {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.rubric th,
.rubric td {
  padding: 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.rubric th {
  color: #fff;
  background: var(--blue);
  text-align: left;
}

@media (max-width: 760px) {
  .sheet {
    margin: 0;
    padding: 24px 5vw;
    border-left: 0;
    border-right: 0;
  }

  .sheet-header,
  .student-row,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .year-badge {
    width: 96px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sheet-toolbar {
    display: none;
  }

  .sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  a {
    text-decoration: none;
  }

  .activity {
    break-inside: avoid;
  }
}
