.schoolnotes-app {
  --sn-cream: #FFF9EC;
  --sn-coral: #FF6F61;
  --sn-yellow: #FFC93C;
  --sn-teal: #2FBFBB;
  --sn-blue: #4EA8DE;
  --sn-purple: #A78BFA;
  --sn-green: #6FCF97;
  --sn-pink: #FF8FAB;
  --sn-ink: #4A3F35;

  font-family: 'Quicksand', 'Comic Sans MS', sans-serif;
  color: var(--sn-ink);
  background: var(--sn-cream);
  border-radius: 24px;
  padding: 1.5rem;
  margin: 0.5rem 0;
}

.schoolnotes-app h1,
.schoolnotes-app h2,
.schoolnotes-app h3 {
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
}

.schoolnotes-login {
  max-width: 380px;
  margin: 2rem auto;
}

.schoolnotes-app .form-item {
  margin-bottom: 1.1rem;
}

.schoolnotes-app label {
  display: block;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.schoolnotes-app input[type="text"],
.schoolnotes-app input[type="password"],
.schoolnotes-app input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  border: 3px solid #fff;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--sn-ink);
  background: #fff;
}

.schoolnotes-app input[type="text"]:focus,
.schoolnotes-app input[type="password"]:focus,
.schoolnotes-app input[type="email"]:focus {
  outline: none;
  border-color: var(--sn-teal);
}

.schoolnotes-app .description {
  font-size: 0.85rem;
  color: #8a7c6c;
}

.schoolnotes-app .form-actions {
  margin-top: 1.25rem;
}

.schoolnotes-tagline {
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-size: 1.4rem;
  color: var(--sn-coral);
  margin: 0 0 1rem;
}

/* Home page tiles */
.schoolnotes-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0;
  max-width: 640px;
}

.schoolnotes-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  text-decoration: none;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  border-radius: 24px;
  border: 4px solid #fff;
  padding: 1.5rem 1rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  min-height: 130px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.schoolnotes-tile:nth-of-type(5n + 1) { background: var(--sn-coral); }
.schoolnotes-tile:nth-of-type(5n + 2) { background: var(--sn-teal); }
.schoolnotes-tile:nth-of-type(5n + 3) { background: var(--sn-purple); }
.schoolnotes-tile:nth-of-type(5n + 4) { background: var(--sn-blue); }
.schoolnotes-tile:nth-of-type(5n + 5) { background: var(--sn-green); }

.schoolnotes-tile:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.schoolnotes-tile__icone {
  font-size: 2.75rem;
}

/* Class filters */
.schoolnotes-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.schoolnotes-filtre {
  display: inline-flex;
  cursor: pointer;
}

.schoolnotes-filtre__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.schoolnotes-filtre span {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sn-ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
  transition: background 0.1s ease, color 0.1s ease, transform 0.1s ease;
}

.schoolnotes-filtre__input:checked + span {
  background: var(--sn-teal);
  border-color: var(--sn-teal);
  color: #fff;
}

.schoolnotes-filtre__input:focus-visible + span {
  outline: 3px solid var(--sn-blue);
  outline-offset: 2px;
}

/* Children grid */
.schoolnotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.schoolnotes-card-wrap {
  position: relative;
}

.schoolnotes-card-supprimer {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1;
}

.schoolnotes-card-supprimer:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.schoolnotes-card-modifier {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1;
}

.schoolnotes-card-modifier:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.schoolnotes-card__classe {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--sn-ink);
  opacity: 0.65;
}

.schoolnotes-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--sn-ink);
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-size: 1.05rem;
  border-radius: 20px;
  padding: 1rem 0.75rem;
  background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.schoolnotes-card:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.schoolnotes-card img,
.schoolnotes-card__placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.5rem;
  border: 4px solid var(--sn-yellow);
  background: var(--sn-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: bold;
  color: #fff;
}

.schoolnotes-card-wrap:nth-of-type(4n + 1) img,
.schoolnotes-card-wrap:nth-of-type(4n + 1) .schoolnotes-card__placeholder { border-color: var(--sn-coral); background: var(--sn-coral); }
.schoolnotes-card-wrap:nth-of-type(4n + 2) img,
.schoolnotes-card-wrap:nth-of-type(4n + 2) .schoolnotes-card__placeholder { border-color: var(--sn-teal); background: var(--sn-teal); }
.schoolnotes-card-wrap:nth-of-type(4n + 3) img,
.schoolnotes-card-wrap:nth-of-type(4n + 3) .schoolnotes-card__placeholder { border-color: var(--sn-purple); background: var(--sn-purple); }
.schoolnotes-card-wrap:nth-of-type(4n + 4) img,
.schoolnotes-card-wrap:nth-of-type(4n + 4) .schoolnotes-card__placeholder { border-color: var(--sn-blue); background: var(--sn-blue); }

/* Buttons */
.schoolnotes-btn,
.schoolnotes-app input.form-submit,
.schoolnotes-app input.button,
.schoolnotes-app button.button,
.schoolnotes-app a.button {
  display: inline-block;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  padding: 0.9rem 1.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--sn-ink);
  cursor: pointer;
  text-decoration: none;
  margin: 0.4rem 0.4rem 0.4rem 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.schoolnotes-btn:active,
.schoolnotes-app input.form-submit:active,
.schoolnotes-app input.button:active,
.schoolnotes-app button.button:active,
.schoolnotes-app a.button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.schoolnotes-btn--primary {
  background: var(--sn-coral);
  color: #fff;
}

/* Native "Choose file" button (image/file widgets, e.g. the child's photo) */
.schoolnotes-app input[type="file"] {
  font-family: inherit;
  color: var(--sn-ink);
}

.schoolnotes-app input[type="file"]::file-selector-button,
.schoolnotes-app input[type="file"]::-webkit-file-upload-button {
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  margin-right: 0.75rem;
  border-radius: 999px;
  border: none;
  background: var(--sn-coral);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.schoolnotes-app input[type="file"]::file-selector-button:active,
.schoolnotes-app input[type="file"]::-webkit-file-upload-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.schoolnotes-audio-record.is-recording {
  background: #E4483B;
  color: #fff;
}

.schoolnotes-audio-recorder,
.schoolnotes-photo-picker {
  margin: 1.25rem 0;
}

.schoolnotes-photo-preview {
  display: block;
  max-width: 100%;
  border-radius: 16px;
  margin-top: 0.5rem;
  border: 4px solid var(--sn-yellow);
}

.schoolnotes-audio-preview {
  display: block;
  margin-top: 0.5rem;
  width: 100%;
  border-radius: 999px;
}

/* Observations */
.schoolnotes-observations {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.schoolnotes-observation {
  position: relative;
  border: none;
  border-radius: 20px;
  padding: 1.25rem;
  background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
}

.schoolnotes-observation-supprimer {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1;
}

.schoolnotes-observation-supprimer:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.schoolnotes-observation:nth-of-type(4n + 1) { background: #FFF3E9; }
.schoolnotes-observation:nth-of-type(4n + 2) { background: #EAFBFA; }
.schoolnotes-observation:nth-of-type(4n + 3) { background: #F5F0FF; }
.schoolnotes-observation:nth-of-type(4n + 4) { background: #EFF8FF; }

.schoolnotes-observation__date {
  display: inline-block;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--sn-purple);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  margin-bottom: 0.75rem;
}

.schoolnotes-observation__photo {
  max-width: 100%;
  border-radius: 16px;
  margin-bottom: 0.5rem;
  border: 4px solid #fff;
}

.schoolnotes-observation__audio {
  width: 100%;
  margin-bottom: 0.5rem;
  border-radius: 999px;
}

.schoolnotes-observation__texte {
  margin: 0;
  line-height: 1.5;
}

.schoolnotes-form-intro {
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-size: 1.2rem;
}

.schoolnotes-competences-toggles {
  margin: 0.5rem 0 1rem;
}

.schoolnotes-competences-groupe {
  margin-bottom: 1.25rem;
}

.schoolnotes-competences-groupe > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sn-teal);
  padding: 0.4rem 0;
}

.schoolnotes-competences-groupe > summary::-webkit-details-marker {
  display: none;
}

/* Olivero draws its own chevron on ::before (absolutely positioned at the
   start of the summary) and uses ::after for its focus/active ring — both
   left alone here, since our own arrow is a real <span>, not a pseudo-
   element layered on top of theirs. */
.schoolnotes-competences-groupe > summary::before {
  content: none;
}

.schoolnotes-competences-groupe__fleche {
  display: inline-block;
  flex-shrink: 0;
  margin-inline-start: auto;
  transition: transform 0.15s ease;
}

.schoolnotes-competences-groupe[open] > summary .schoolnotes-competences-groupe__fleche {
  transform: rotate(90deg);
}

.schoolnotes-competences-groupe > summary:focus-visible {
  outline: 3px solid var(--sn-blue);
  outline-offset: 2px;
}

.schoolnotes-competences-groupe fieldset {
  margin: 0.6rem 0;
}

.schoolnotes-competences-grid fieldset {
  margin-bottom: 1rem;
  border: none;
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
}

.schoolnotes-competences-grid legend {
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-weight: 700;
  padding: 0 0.35rem;
  color: var(--sn-coral);
}

.schoolnotes-competences-categorie {
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sn-teal);
  margin: 1.25rem 0 0.5rem;
}

.schoolnotes-competences-liste {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.schoolnotes-competences-liste li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border-radius: 14px;
  padding: 0.7rem 1rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
}

.schoolnotes-competence-supprimer {
  color: var(--sn-coral);
  text-decoration: none;
  font-family: 'Baloo 2', 'Comic Sans MS', sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.schoolnotes-empty {
  color: #8a7c6c;
  font-style: italic;
}
