.bibliotheque {
  --tint: #f5dfae;
  --strong: #79501d;
  --pop: #eeb765;
}
.lib-workspace {
  --lib-gold: #f4d589;
  --lib-border: #dfd4b9;
}
.lib-workspace :is(h1, h2, h3),
.lib-card-info,
.lib-byline {
  overflow-wrap: anywhere;
}
.lib-hero {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  overflow: hidden;
  margin-top: 15px;
  border: 1px solid var(--lib-border);
  border-radius: 22px;
  background: #fff3d9;
  box-shadow: var(--shadow);
}
.lib-intro {
  align-self: center;
  padding: clamp(24px, 4vw, 56px);
}
.lib-intro h1 {
  max-width: 16ch;
}
.lib-intro p {
  margin: 13px 0 23px;
  max-width: 32ch;
  color: #535e4f;
  font-size: 1.08rem;
}
.lib-hero img {
  width: 100%;
  height: 100%;
  max-height: 330px;
  min-height: 255px;
  object-fit: cover;
  object-position: 50% 55%;
}
.lib-shelf-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 28px 0 14px;
}
.lib-shelf-heading > span,
.lib-storage,
.lib-hint,
.lib-audio > span,
.lib-byline {
  color: var(--muted);
}
.lib-empty {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 22px clamp(17px, 2.5vw, 32px);
  background: var(--paper);
  border: 1px dashed #beccb9;
  border-radius: 16px;
}
.lib-empty > svg {
  box-sizing: content-box;
  padding: 12px;
  border-radius: 14px;
  color: #42634c;
  background: #e7efdf;
}
.lib-empty h3 { font-size: 1.13rem; }
.lib-empty p { margin-top: 4px; color: var(--muted); }
.lib-storage { margin-top: 15px; font-size: .9rem; }
.lib-books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.lib-card {
  display: flex;
  gap: 16px;
  height: 100%;
  align-items: center;
  border: 1px solid var(--line);
  padding: 17px;
  background: var(--paper);
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.lib-card:hover { border-color: #8eaa91; }
.lib-cover {
  position: relative;
  flex: 0 0 55px;
  display: grid;
  place-items: center;
  height: 76px;
  color: #72472a;
  background: #e9b47a;
  border: 1px solid #c99a64;
  border-left: 6px solid #c79056;
  border-radius: 3px 8px 8px 3px;
  box-shadow: inset 0 -4px #fcf2d3, 1px 2px 0 #cab798;
}
.documentaire .lib-cover {
  background: #afcfc5;
  border-color: #88aa9e;
  border-left-color: #729b90;
  color: #254e44;
}
.lib-card-info { min-width: 0; }
.lib-type { color: var(--muted); font-size: .88rem; }
.lib-card-info h3 { margin: 3px 0; font-size: 1.16rem; }
.lib-card-info p { font-size: .94rem; color: var(--muted); }
.lib-count, .lib-byline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lib-count { color: #3f654e; font-size: .9rem; font-weight: 600; }
.lib-card .lib-count { margin-top: 9px; }
.lib-page-title { margin: 18px 0 23px; }
.lib-page-title > p { margin-top: 9px; }
.lib-form-page { max-width: 790px; }
.lib-form { padding: clamp(20px, 3.5vw, 38px); }
.lib-form label, .lib-form legend, .lib-reader label { font-size: 1rem; }
.lib-form label span:not(.icon) { font-weight: 400; }
.lib-fields, .lib-kinds {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.lib-fields label { margin-top: 0; }
.lib-fields input, .lib-form textarea, .lib-reader textarea { font-size: 1rem; }
.lib-form fieldset {
  margin: 24px 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.lib-form legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.lib-kinds { gap: 12px; }
.lib-form .lib-kind {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  min-width: 0;
  padding: 14px;
  margin: 0;
  background: #fbfaf5;
  border: 1px solid #cbd4c8;
  border-radius: 13px;
  cursor: pointer;
}
.lib-kind:has(input:checked) {
  background: #eff5e9;
  border-color: #528568;
  box-shadow: inset 0 0 0 1px #528568;
}
.lib-kind input[type='radio'] {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--green);
}
.lib-kind > span {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  align-items: center;
}
.lib-kind strong { font-size: .95rem; }
.lib-kind small { grid-column: 2; font-size: .88rem; color: var(--muted); }
.lib-hint { font-size: .9rem; }
.lib-form .lib-hint { margin: -1px 0 7px; }
.lib-form-actions, .lib-question-actions, .lib-audio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.lib-form-actions { margin-top: 20px; }
.lib-error:empty { display: none; }
.lib-form .lib-error { margin-bottom: 0; color: #9a3c30; }
.lib-book-layout { display: grid; grid-template-columns: minmax(225px, .65fr) minmax(0, 1.45fr); gap: 22px; align-items: start; }
.lib-synopsis { background: #fff4d9; border-color: var(--lib-border); }
.lib-synopsis p { white-space: pre-wrap; overflow-wrap: anywhere; }
.lib-synopsis h2 { font-size: 1.25rem; }
.lib-reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 15px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}
.lib-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-steps button {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #b5c6b3;
  border-radius: 50%;
  background: #fafbf6;
  font-weight: 600;
}
.lib-steps button[aria-current='step'] { background: var(--green); border-color: var(--green); color: white; }
.lib-steps button > span { display: none; }
.lib-steps button.answered > span {
  position: absolute;
  bottom: -3px;
  right: -2px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: white;
  background: #356b50;
  border: 1px solid var(--paper);
}
.lib-question-number { margin: 21px 0 8px; color: #55725a; font-weight: 600; font-size: .92rem; }
.lib-reader .lib-question { display: block; font-size: clamp(1.3rem, 2.3vw, 1.8rem); line-height: 1.25; }
.lib-audio { margin: 7px 0 14px; gap: 7px 12px; }
.lib-audio > span { font-size: .88rem; }
.lib-reader label { margin: 0 0 6px; }
.lib-reader .lib-hint { margin: 6px 0 0; }
.lib-question-actions { margin-top: 18px; }
@media (min-width: 801px) and (max-width: 1000px) {
  .activity-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .activity-card.bibliotheque {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  }
  .activity-card.bibliotheque .activity-art { height: 100%; min-height: 85px; }
  .lib-book-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 640px) {
  .lib-hero { grid-template-columns: 1fr; }
  .lib-hero img { min-height: 0; height: 155px; }
  .lib-intro { padding: 23px; }
  .lib-intro p { margin: 9px 0 16px; }
  .lib-fields, .lib-kinds { grid-template-columns: 1fr; gap: 12px; }
  .lib-kind > span { column-gap: 10px; }
  .lib-form fieldset { margin: 21px 0; }
  .lib-steps { gap: 5px; }
  .lib-empty { align-items: flex-start; }
}
@media (max-width: 420px) {
  .map-area { min-height: 150px; }
  .map-pin.ecole { top: 24%; }
  .map-pin.piscine { left: 60%; }
  .map-pin.maison { top: 76%; }
}
