:root {
  --hlp-olive: #7b8933;
  --hlp-leaf: #4f6f32;
  --hlp-red: #b8322d;
  --hlp-gold: #efef1c;
  --hlp-blue: #4d8fb8;
  --hlp-jade: #dde8cf;
  --hlp-paper: #f7f7f4;
  --hlp-ink: #222222;
  --hlp-muted: #5f625a;
  --hlp-line: #dfe1da;
  --hlp-white: #ffffff;
  --hlp-shadow: 0 12px 32px rgba(34, 34, 34, 0.08);
}

html {
  scroll-behavior: smooth;
}

.editable-homepage:has(.homework-page) > .page-title-band {
  display: none;
}

.homework-page {
  color: var(--hlp-ink);
  background: var(--hlp-paper);
}

.homework-page a:focus-visible,
.homework-page button:focus-visible {
  outline: 3px solid var(--hlp-blue);
  outline-offset: 3px;
}

.homework-hero {
  color: var(--hlp-white);
  background: var(--hlp-leaf);
  border-bottom: 8px solid var(--hlp-gold);
}

.homework-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
  gap: 54px;
  align-items: end;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 58px;
}

.homework-breadcrumb {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 700;
}

.homework-breadcrumb a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.homework-hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--hlp-white);
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.04;
}

.homework-hero__lede {
  max-width: 700px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  line-height: 1.6;
}

.school-week {
  padding: 22px 0 4px 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.school-week__label {
  display: block;
  margin-bottom: 7px;
  color: var(--hlp-gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.school-week strong {
  display: block;
  font-size: 21px;
  line-height: 1.3;
}

.school-week span:last-child {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 600;
}

.homework-toolbar {
  color: var(--hlp-ink);
  background: var(--hlp-white);
  border-bottom: 1px solid var(--hlp-line);
}

.homework-toolbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
}

.homework-toolbar__status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--hlp-muted);
  font-size: 14px;
  font-weight: 700;
}

.homework-toolbar__status::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hlp-leaf);
  content: "";
}

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

.homework-toolbar__actions a,
.homework-toolbar__actions button {
  padding: 8px 0;
  border: 0;
  color: var(--hlp-ink);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--hlp-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: pointer;
}

.homework-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 88px;
}

.class-finder {
  align-self: start;
  position: sticky;
  top: 196px;
  padding-right: 28px;
  border-right: 1px solid var(--hlp-line);
}

.class-finder h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.25;
}

.class-finder > p {
  margin: 0 0 22px;
  color: var(--hlp-muted);
  font-size: 14px;
  line-height: 1.5;
}

.class-finder__list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.class-filter {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--hlp-ink);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.class-filter:hover,
.class-filter.is-active {
  border-color: var(--hlp-line);
  background: var(--hlp-white);
}

.class-filter.is-active {
  box-shadow: 0 6px 18px rgba(34, 34, 34, 0.06);
}

.class-filter__code {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--hlp-white);
  background: var(--class-accent, var(--hlp-leaf));
  font-size: 11px;
  font-weight: 900;
}

.class-filter[data-class="all"] .class-filter__code {
  color: var(--hlp-ink);
  background: var(--hlp-gold);
}

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

.class-finder__help strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.class-finder__help p {
  margin: 0 0 10px;
  color: var(--hlp-muted);
  font-size: 13px;
  line-height: 1.5;
}

.class-finder__help a {
  color: var(--hlp-red);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.homework-feed {
  min-width: 0;
}

.homework-feed__intro {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 24px;
}

.homework-feed__intro p {
  max-width: 630px;
  margin: 0;
  color: var(--hlp-muted);
  font-size: 16px;
  line-height: 1.6;
}

.homework-feed__intro strong {
  display: block;
  margin-bottom: 7px;
  color: var(--hlp-ink);
  font-size: 26px;
  line-height: 1.2;
}

.homework-feed__count {
  flex: 0 0 auto;
  color: var(--hlp-muted);
  font-size: 13px;
  font-weight: 800;
}

.assignment-list {
  display: grid;
  gap: 18px;
}

.assignment-card {
  --class-accent: var(--hlp-leaf);
  position: relative;
  scroll-margin-top: 210px;
  overflow: hidden;
  border: 1px solid var(--hlp-line);
  border-radius: 8px;
  background: var(--hlp-white);
  box-shadow: 0 8px 22px rgba(34, 34, 34, 0.045);
}

.assignment-card[hidden] {
  display: none;
}

.assignment-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--class-accent);
  content: "";
}

.assignment-card--kg,
.class-filter--kg {
  --class-accent: #7b8933;
}

.assignment-card--1a,
.class-filter--1a {
  --class-accent: #4d8fb8;
}

.assignment-card--1b,
.class-filter--1b {
  --class-accent: #b8322d;
}

.assignment-card--1c,
.class-filter--1c {
  --class-accent: #8b5d8e;
}

.assignment-card--2,
.class-filter--2 {
  --class-accent: #3f7f74;
}

.assignment-card--3,
.class-filter--3 {
  --class-accent: #a4602a;
}

.assignment-card--4,
.class-filter--4 {
  --class-accent: #4f6f32;
}

.assignment-card__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 22px 24px 18px 28px;
  border-bottom: 1px solid var(--hlp-line);
}

.assignment-card__code {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: var(--hlp-white);
  background: var(--class-accent);
  font-size: 15px;
  font-weight: 900;
}

.assignment-card__identity h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.assignment-card__identity p {
  margin: 5px 0 0;
  color: var(--hlp-muted);
  font-size: 13px;
  font-weight: 700;
}

.assignment-card__updated {
  margin: 0;
  color: var(--hlp-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.assignment-card__updated strong {
  display: block;
  margin-bottom: 4px;
  color: var(--hlp-leaf);
  font-size: 12px;
  text-transform: uppercase;
}

.assignment-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.75fr);
  gap: 34px;
  padding: 24px 24px 24px 28px;
}

.assignment-card__summary {
  min-width: 0;
}

.assignment-card__label {
  display: block;
  margin-bottom: 8px;
  color: var(--hlp-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.assignment-card__summary h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.35;
}

.assignment-card__summary ul {
  margin: 0;
  padding-left: 20px;
  color: var(--hlp-ink);
}

.assignment-card__summary li {
  padding-left: 4px;
  font-size: 15px;
  line-height: 1.55;
}

.assignment-card__summary li + li {
  margin-top: 6px;
}

.assignment-card__aside {
  padding-left: 26px;
  border-left: 1px solid var(--hlp-line);
}

.assignment-card__aside dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0 0 16px;
}

.assignment-card__aside dt {
  color: var(--hlp-muted);
  font-size: 12px;
  font-weight: 800;
}

.assignment-card__aside dd {
  margin: 0;
  color: var(--hlp-ink);
  font-size: 12px;
  font-weight: 800;
}

.assignment-card__resources {
  display: grid;
  gap: 7px;
}

.assignment-card__resources a {
  color: var(--hlp-blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.assignment-card__resources a::after {
  content: " →";
}

.assignment-card__resources span {
  color: var(--hlp-muted);
  font-size: 13px;
  font-weight: 700;
}

.assignment-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px 14px 28px;
  background: rgba(221, 232, 207, 0.34);
}

.assignment-card__footer p {
  margin: 0;
  color: var(--hlp-muted);
  font-size: 12px;
  font-weight: 700;
}

.assignment-card__footer a {
  flex: 0 0 auto;
  color: var(--hlp-red);
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.assignment-card__footer > span {
  flex: 0 0 auto;
  color: var(--hlp-muted);
  font-size: 12px;
  font-weight: 800;
}

.assignment-history {
  border-top: 1px solid var(--hlp-line);
}

.assignment-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  padding: 12px 24px 12px 28px;
  color: var(--hlp-ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.assignment-history summary::-webkit-details-marker {
  display: none;
}

.assignment-history summary::before {
  display: inline-block;
  margin-right: -8px;
  color: var(--class-accent);
  content: "+";
  font-size: 20px;
  line-height: 1;
}

.assignment-history[open] summary::before {
  content: "-";
}

.assignment-history summary span:first-child {
  flex: 1 1 auto;
}

.assignment-history summary span:last-child {
  color: var(--hlp-muted);
  font-size: 12px;
  font-weight: 700;
}

.assignment-history ul {
  display: grid;
  margin: 0;
  padding: 0 24px 20px 28px;
  list-style: none;
}

.assignment-history li {
  border-top: 1px solid var(--hlp-line);
}

.assignment-history a {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1fr);
  gap: 18px;
  padding: 13px 0;
  color: var(--hlp-ink);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.assignment-history a:hover strong,
.assignment-history a:focus-visible strong {
  color: var(--hlp-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assignment-history a span {
  color: var(--hlp-muted);
}

.weekly-plan-summary {
  margin-bottom: 32px;
  padding: 26px;
  border-left: 6px solid var(--hlp-leaf);
  background: rgba(221, 232, 207, 0.34);
}

.weekly-plan-summary h2 {
  margin-top: 22px;
}

.weekly-plan-summary li + li {
  margin-top: 8px;
}

.homework-empty {
  display: none;
  padding: 46px 24px;
  border: 1px solid var(--hlp-line);
  border-radius: 8px;
  background: var(--hlp-white);
  text-align: center;
}

.homework-empty.is-visible {
  display: block;
}

.homework-empty h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.homework-empty p {
  margin: 0;
  color: var(--hlp-muted);
}

.homework-contact {
  color: var(--hlp-white);
  background: var(--hlp-ink);
}

.homework-contact__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0;
}

.homework-contact h2 {
  margin: 0 0 8px;
  color: var(--hlp-white);
  font-size: 27px;
}

.homework-contact p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.homework-contact a {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 14px 18px;
  border-radius: 6px;
  color: var(--hlp-white);
  background: var(--hlp-red);
  font-size: 14px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .homework-hero__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .school-week {
    padding: 0;
    border-left: 0;
  }

  .homework-shell {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .class-finder {
    position: static;
    padding: 0 0 24px;
    border-right: 0;
    border-bottom: 1px solid var(--hlp-line);
  }

  .class-finder__list {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .class-finder__list li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .class-filter {
    grid-template-columns: 32px auto;
    width: auto;
    min-height: 48px;
    border-color: var(--hlp-line);
    background: var(--hlp-white);
    white-space: nowrap;
  }

  .class-filter__code {
    width: 32px;
    height: 32px;
  }

  .class-finder__help {
    display: none;
  }
}

@media (max-width: 680px) {
  .homework-hero__inner,
  .homework-toolbar__inner,
  .homework-shell,
  .homework-contact__inner {
    width: min(100% - 28px, 1180px);
  }

  .homework-hero__inner {
    padding: 48px 0 42px;
  }

  .homework-hero h1 {
    font-size: 40px;
  }

  .homework-hero__lede {
    font-size: 17px;
  }

  .homework-toolbar__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
  }

  .homework-toolbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .homework-shell {
    padding: 36px 0 60px;
  }

  .homework-feed__intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .assignment-card {
    scroll-margin-top: 150px;
  }

  .assignment-card__header {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px 18px 16px 22px;
  }

  .assignment-card__code {
    width: 46px;
    height: 46px;
  }

  .assignment-card__updated {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid var(--hlp-line);
    text-align: left;
  }

  .assignment-card__updated strong {
    display: inline;
    margin-right: 5px;
  }

  .assignment-card__body {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 20px 18px 20px 22px;
  }

  .assignment-card__aside {
    padding: 20px 0 0;
    border-top: 1px solid var(--hlp-line);
    border-left: 0;
  }

  .assignment-card__footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px 14px 22px;
  }

  .assignment-history summary {
    padding-right: 18px;
    padding-left: 22px;
  }

  .assignment-history ul {
    padding-right: 18px;
    padding-left: 22px;
  }

  .assignment-history a {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .homework-contact__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .site-header,
  .homework-toolbar,
  .class-finder,
  .homework-contact,
  .site-footer {
    display: none !important;
  }

  .homework-hero {
    color: var(--hlp-ink);
    background: var(--hlp-white);
    border-bottom: 2px solid var(--hlp-ink);
  }

  .homework-hero__inner {
    display: block;
    width: 100%;
    padding: 20px 0;
  }

  .homework-hero h1,
  .homework-hero__lede,
  .school-week,
  .school-week__label {
    color: var(--hlp-ink);
  }

  .homework-shell {
    display: block;
    width: 100%;
    padding: 24px 0;
  }

  .assignment-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .assignment-history {
    display: none;
  }
}
