:root {
  --text-blue: #203148;
  --teal: #22615e;
  --light-teal: #dceee8;
  --paper: #fffdf4;
  --cream: #f8f2e4;
  --coral: #bd5144;
  --yellow: #f6dfa2;
  --display-font: Georgia, "Times New Roman", serif;
  --body-font: "Avenir Next", Avenir, system-ui, sans-serif;
}

body {
  font-family: var(--body-font);
  color: var(--text-blue);
  background: var(--cream);
}

body > header {
  background: var(--paper);
  border-color: #dfd9c9;
}

.brand {
  color: var(--text-blue);
  gap: .7rem;
  font-size: 1.14rem;
}

.brand span {
  width: 37px;
  height: 35px;
  border-radius: 48% 52% 44% 56%;
  background: #d66051;
  color: #fff9e9;
  transform: rotate(-8deg);
}

.primary {
  background: var(--teal);
  color: #fff;
  border-color: transparent;
}

.primary:hover {
  background: #184d49;
}

.secondary {
  border-color: #aebeb8;
  color: var(--text-blue);
}

.secondary:hover {
  background: #e8f3eb;
}

.entry {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr);
  gap: clamp(1rem, 3vw, 2.3rem);
  max-width: 1090px;
  margin: clamp(1rem, 4vw, 2.8rem) auto 0;
}

.entry .welcome {
  min-height: 490px;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  background: #ebf4e9;
  color: var(--text-blue);
  border: 1px solid #d5dfd4;
  border-radius: 23px;
}

.welcome-copy {
  padding: clamp(1.35rem, 4vw, 2.55rem) clamp(1.35rem, 4vw, 2.6rem) 1.15rem;
}

.entry .welcome h1 {
  max-width: 17ch;
  font: 700 clamp(2.5rem, 5vw, 4.5rem)/1.02 var(--display-font);
  letter-spacing: -.045em;
  margin-bottom: .55rem;
}

.entry .welcome p {
  color: #395354;
  margin: 0;
  max-width: 38ch;
  font-size: 1.08rem;
}

.archipelago-art {
  min-width: 0;
  min-height: 215px;
  background: #7cbabb url("/archipel.jpg") center 57% / cover no-repeat;
}

.entry .login {
  background: var(--paper);
  border-radius: 23px;
  border-color: #dfd9c9;
  padding: clamp(1.3rem, 3vw, 2.15rem);
}

.login h2 {
  font-size: clamp(1.6rem, 2.3vw, 2rem);
  margin-bottom: 1.3rem;
}

.login label {
  color: var(--text-blue);
}

.login input {
  min-height: 53px;
  font-size: 1.1rem;
  border-color: #bfc9c4;
}

.login .primary {
  min-height: 52px;
}

.login .switch {
  background: #eeeee3;
  width: 100%;
  margin-bottom: 1.5rem;
}

.login .switch button {
  flex: 1;
  min-height: 46px;
  color: var(--text-blue);
}

body[data-surface="student"] main {
  max-width: 1020px;
  padding-top: clamp(1rem, 3.5vw, 2.4rem);
}

.student-home {
  overflow: hidden;
  background: var(--paper);
  border-color: #e0d8c4;
  border-radius: 26px;
}

.student-greeting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .85fr);
  align-items: stretch;
  background: #dfefe5;
  overflow: hidden;
  min-height: 175px;
  border-radius: 16px;
  margin-bottom: 1.6rem;
}

.student-greeting > div:first-child {
  align-content: center;
  padding: 1.2rem;
}

.student-greeting .archipelago-art {
  min-height: 170px;
  background-position: right 55%;
}

.student-greeting h1 {
  font: 700 clamp(2.1rem, 5vw, 3.4rem)/1.03 var(--display-font);
  letter-spacing: -.03em;
  margin-bottom: 0;
}

.student-greeting .eyebrow {
  margin: 0 0 .45rem;
  text-transform: none;
  letter-spacing: 0;
  color: #365e58;
  font-size: .95rem;
}

.student-home > h2,
.pupil-revisit h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.16;
}

.student-home .primary,
.lesson .primary {
  min-height: 53px;
  min-width: 130px;
  font-size: 1.05rem;
}

.pupil-islands .island {
  border: 1px solid #bfd5cb;
  background: #e7f2e9;
  min-height: 112px;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.pupil-islands .island:hover {
  border-color: #56897c;
  background: #d6ecdf;
}

.pupil-islands .island small {
  color: #344c58;
}

.lesson {
  background: var(--paper);
  border-color: #e0d8c4;
  border-radius: 25px;
}

.lesson-top {
  color: #29534e;
  font-size: .98rem;
}

.lesson-top span:last-child {
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  background: #dceee8;
  padding: .25rem .65rem;
}

.lesson progress {
  accent-color: #2c7770;
  border-radius: 999px;
  overflow: hidden;
  height: .65rem;
}

.lesson h1 {
  color: var(--text-blue);
  font-size: clamp(1.6rem, 3.7vw, 2.6rem);
  letter-spacing: -.035em;
  line-height: 1.14;
}

.reading-passage {
  background: #fff2cc;
  border-left: 4px solid #b77737;
  border-radius: 0 9px 9px 0;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.55;
  padding: .75rem .95rem;
  margin-bottom: 1.15rem;
}

.sound-button {
  min-height: 48px;
  background: #e8f4ed;
  color: #194b4a;
}

.lesson .answer {
  position: relative;
  min-height: 58px;
  border: 2px solid #c7d6cc;
  border-radius: 12px;
  padding: .75rem 1rem;
  color: var(--text-blue);
  background: #fff;
  box-shadow: 0 2px 0 #e8e6d9;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.lesson .answer:hover:enabled {
  border-color: #50897b;
  background: #ebf5ed;
}

.lesson .answer.chosen {
  background: #f8e7b1;
  border-color: #af823a;
}

.lesson .answer.correct {
  background: #daede4;
  border-color: #4d8374;
}

.lesson-feedback {
  margin-top: .85rem;
  border: 1px solid #dec17f;
  background: #ffefd0;
  color: #293750;
}

.lesson-feedback .lesson-example {
  background: #fff8e7;
  padding: .55rem .7rem;
  border-radius: 8px;
  margin: .5rem 0;
}

.letter-tile {
  background: #fff5d9;
  border-color: #98773e;
  color: var(--text-blue);
  min-width: 44px;
  min-height: 48px;
}

.letter-slot {
  background: #e8f2eb;
}

body[data-surface="teacher"] {
  background: #f6f7f2;
}

body[data-surface="teacher"] .panel {
  border-radius: 15px;
  background: #fff;
  border-color: #dfe5df;
}

body[data-surface="teacher"] .page-heading h1 {
  font-size: clamp(1.85rem, 3.1vw, 2.85rem);
}

body[data-surface="teacher"] .tabs .active {
  border-color: var(--teal);
  color: var(--teal);
}

.bilan-radar {
  background: #f4f8f5;
  border: 1px solid #e0e9e1;
  border-radius: 12px;
}

@media (max-width: 760px) {
  .entry {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .entry .welcome {
    min-height: 0;
    grid-template-rows: auto minmax(155px, 1fr);
  }

  .entry .archipelago-art {
    min-height: 155px;
  }
}

@media (max-width: 480px) {
  .student-greeting {
    grid-template-columns: 1fr;
  }

  .student-greeting .archipelago-art {
    min-height: 115px;
  }

  .student-home .header-actions .primary {
    flex: 1;
  }

  .lesson .answer {
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lesson .answer,
  .pupil-islands .island {
    transition: none;
  }
}

.roster-table input,
.roster-table select {
  min-width: 112px;
}

.roster-delivery {
  white-space: nowrap;
}

.roster-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

span.roster-date {
  display: block;
  margin-top: .3rem;
  font-size: .85rem;
}

.evolution-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.evolution-heading p {
  margin-bottom: 0;
}

.evolution-heading select,
.evolution-content select {
  min-width: min(200px, 100%);
}

.evolution-content select {
  width: fit-content;
  max-width: 100%;
}

.evolution-chart {
  background: #f0f6f2;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 10px;
}

.evolution-chart ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.evolution-chart li {
  display: grid;
  grid-template-columns: minmax(108px, max-content) minmax(70px, 1fr) 3rem;
  align-items: center;
  gap: .65rem;
  padding: .2rem 0;
}

.evolution-chart meter {
  width: 100%;
  height: .9rem;
}

.evolution-chart meter::-webkit-meter-optimum-value {
  background: var(--teal);
}

.evolution-chart b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.evolution-chart p:last-child {
  margin-bottom: 0;
}

.evolution-earlier {
  margin-top: 1rem;
}

.evolution-earlier summary {
  cursor: pointer;
  font-weight: 650;
}

.cover {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
  min-height: min(580px, 75vh);
  overflow: hidden;
  background: #e1f0e6;
  border: 1px solid #cddfd5;
  border-radius: 28px;
  margin-top: clamp(.4rem, 3vw, 2.2rem);
}
.cover-copy { align-self: center; padding: clamp(1.6rem, 5vw, 4.2rem); }
.cover h1 { font: 700 clamp(3rem, 7vw, 6.3rem)/.92 var(--display-font); letter-spacing: -.055em; margin: 0 0 1.2rem; }
.cover p { color: #3a5759; font-size: clamp(1rem, 2.1vw, 1.3rem); max-width: 26ch; }
.cover-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.cover-actions button { min-height: 49px; }
.cover-actions button:first-child { min-height: 58px; padding-inline: 1.3rem; font-size: 1.07rem; }
.cover-art { min-width: 0; min-height: 270px; background: #73b7ae url("/archipel.jpg") 61% center / cover no-repeat; }
.charter { padding: 1.2rem; background: #e7f2e9; border-radius: 14px; }
.charter-check { display: flex; align-items: flex-start; gap: .55rem; }
.charter-check input { width: 1.2rem; min-height: 1.2rem; margin: .25rem 0 0; flex: 0 0 auto; }
.current-period select { min-height: 38px; }
.dossier-facts { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; }
.dossier-facts span { display: grid; gap: .15rem; }
.activity-length { background: #e1f2e6; color: #284e48; display: inline-block; padding: .35rem .65rem; border-radius: 10px; }
@media (max-width: 760px) {
  .cover { grid-template-columns: 1fr; min-height: auto; }
  .cover-art { min-height: clamp(210px, 63vw, 380px); }
}
