.gram-workspace {
  --gram-accent: #2d6956;
  --gram-soft: #edf3e8;
  --gram-mark: #ffdf8e;
}
.gram-phrase { --gram-accent: #81501e; --gram-soft: #fcf0d7; }
.gram-groupes { --gram-accent: #315e56; --gram-soft: #e8f2ed; }
.gram-genre { --gram-accent: #73533b; --gram-soft: #f6edde; }
.gram-nombre { --gram-accent: #235d73; --gram-soft: #e7f1f4; }
.gram-adjectifs { --gram-accent: #48622d; --gram-soft: #eff3df; }
.school-grammar-link { background: #faf1de; border-color: #ddcaa2; }
.school-grammar-link .times-mark { color: #fff2cf; background: #81592e; }
.school-grammar-link small { color: #665943; }
.gram-header { margin: 1.15rem 0 1.5rem; }
.gram-header h1 { margin: 0; max-width: 28ch; line-height: 1.07; }
.gram-header > p:last-child:not(.section-kicker) { margin: .7rem 0 0; font-size: 1.12rem; color: var(--muted); }
main:has(> .gram-banner) { width: 100%; }
.gram-banner {
  color: #fffdf7;
  background: linear-gradient(90deg, rgb(18 45 35 / 91%), rgb(20 47 35 / 82%) 31%, rgb(24 46 34 / 54%) 53%, rgb(23 44 31 / 9%) 80%),
    #304d3e url('./assets/grammaire/genre.webp') center 62% / cover no-repeat;
}
.gram-banner-inner {
  max-width: 1150px; min-height: clamp(14rem, 20vw, 18rem); padding-block: 1rem 1.9rem;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
}
.gram-banner .backlink { margin-bottom: auto; color: #fffdf7; }
.gram-banner .backlink:focus-visible { outline-color: #ffe895; }
.gram-banner .section-kicker { margin: .85rem 0 .35rem; color: #f5e4ae; }
.gram-banner h1 { font-size: clamp(2.55rem, 4.8vw, 4rem); }
.gram-banner-inner > p:last-child { max-width: 40ch; margin: .5rem 0 0; font-size: 1.08rem; }
.gram-banner + .gram-hub { padding-top: clamp(1.3rem, 2.5vw, 1.9rem); }
.grammar-series { margin-block-start: 1.55rem; }
.grammar-series > h2, .series-batch h2 { margin: 0 0 .7rem; font-size: 1.2rem; }
.series-batches { display: grid; gap: .85rem; }
.series-intro { margin: 1rem 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; }
.series-intro h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin: .25rem 0 .65rem; }
.series-intro p:last-child { color: var(--muted); max-width: 50ch; }
.series-resume { display: grid; gap: .65rem; min-width: 12rem; }
.series-resume progress { width: 100%; height: .65rem; accent-color: var(--green); }
.series-resume .button { justify-self: start; }
.series-batches { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-items: start; }
.series-batch { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.series-numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.series-number { position: relative; display: grid; place-items: center; min-height: 2.8rem; font-weight: 600; border: 1px solid #bbcbbf; background: #fafbf7; border-radius: 8px; }
.series-number:hover { background: #e8f0e8; border-color: var(--green); }
.series-number.finished { background: #e0efe2; color: #255338; }
.series-number .icon { position: absolute; top: .12rem; right: .12rem; }
.course-sheet.gram-memo { max-width: none; }
.course-sheet .gram-rule { max-width: 83ch; }
.course-sheet .gram-annotated { gap: .7rem 1rem; }
.sheet-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2.1rem; margin-top: 1.25rem; }
.sheet-columns h3 { font-size: 1.08rem; margin: 0 0 .65rem; color: var(--gram-accent); }
.sheet-examples { display: grid; gap: .85rem; }
.sheet-examples p { margin: .18rem 0 0; color: var(--muted); line-height: 1.5; }
.sheet-columns .gram-checklist { margin: 0; }
.course-exercises { margin-top: clamp(1.65rem, 4vw, 2.6rem); }
.practice-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.3rem; margin-bottom: .8rem; }
.practice-heading h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.practice-progress { display: grid; gap: .24rem; font-size: .92rem; font-weight: 600; color: var(--gram-accent); }
.practice-progress progress { width: 100%; height: .55rem; accent-color: var(--gram-accent); }
.practice-picker { margin-bottom: .7rem; scroll-margin-top: 1rem; }
.practice-picker summary { width: fit-content; padding: .6rem .8rem; cursor: pointer; font-weight: 600; border-radius: 9px; background: var(--gram-soft); color: var(--gram-accent); }
.practice-picker .series-batches { margin: .7rem 0 1rem; }
.practice-picker .series-batch h3 { font-size: 1.04rem; margin: 0 0 .6rem; }
.practice-picker [aria-current="step"] { outline: 2px solid var(--gram-accent); outline-offset: -2px; }
.course-exercises .exercise-card { scroll-margin-top: 1rem; }
.course-exercises .exercise-card:focus { outline: none; }
.course-exercises .exercise-card h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); margin: .35rem 0 .8rem; }
.course-exercises .problem { background: var(--gram-soft); }
@media (max-width: 650px) {
  .series-intro { grid-template-columns: 1fr; gap: 1rem; }
  .series-resume { min-width: 0; }
  .sheet-columns { grid-template-columns: 1fr; }
}
.gram-gallery { display: grid; grid-template-columns: minmax(0,1.12fr) repeat(2,minmax(0,1fr)); gap: 1rem; }
.grammar-series-links { grid-template-columns: repeat(4,minmax(0,1fr)); }
.gram-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid #d3dbca; border-radius: 19px; background: var(--paper); box-shadow: var(--shadow);
}
.gram-card.gram-featured { grid-row: span 2; }
.gram-card-image { position: relative; overflow: hidden; aspect-ratio: 2.7; background: var(--gram-soft); }
.gram-card.gram-featured .gram-card-image { aspect-ratio: auto; flex: 1; min-height: 14rem; }
.grammar-series-links .gram-card-image { aspect-ratio: 2; }
.gram-art { width: 100%; height: 100%; display: block; object-fit: cover; }
.gram-card-image .gram-art { position: absolute; inset: 0; transition: transform 280ms ease; }
.gram-card.gram-groupes .gram-art { object-position: 50% 44%; }
.gram-card.gram-phrase .gram-art { object-position: 48% 32%; }
.gram-card:hover { border-color: var(--gram-accent); }
.gram-card:hover .gram-art { transform: scale(1.025); }
.gram-card-body { display: flex; flex: 1 0 auto; align-items: center; justify-content: space-between; gap: .6rem; padding: .9rem 1.05rem; }
.gram-card.gram-featured .gram-card-body { flex: 0 0 auto; padding: 1.35rem; }
.gram-card :is(h2,h3) { font-size: 1.2rem; line-height: 1.18; margin: 0; letter-spacing: -.025em; }
.gram-card.gram-featured h2 { font-size: clamp(1.55rem, 2.4vw, 2.05rem); }
.gram-card p { margin: .35rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.42; }
.gram-card small { display: block; margin-top: .5rem; font-weight: 600; color: var(--gram-accent); }
.grammar-series-links .gram-card-body {
  display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto 1fr auto;
  align-items: start; gap: .4rem .45rem;
}
.grammar-series-links .gram-card-body > div { display: contents; }
.grammar-series-links :is(h3,p) { grid-column: 1 / -1; margin: 0; }
.grammar-series-links .gram-card small { margin: 0; align-self: center; }
.grammar-series-links .gram-arrow { width: 1.8rem; height: 1.8rem; align-self: center; }
.grammar-series-links .gram-determinants img { object-position: 40% 55%; }
.grammar-series-links .gram-adjectifs img { object-position: 40% 46%; }
.grammar-series-links .gram-pronoms img { object-position: 46% 50%; }
.grammar-series-links .gram-noms img { object-position: 38% 50%; }
.gram-arrow, .gram-icon, .gram-listen {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  width: 2.3rem; height: 2.3rem; color: var(--gram-accent); background: var(--gram-soft);
}
.gram-arrow { font-size: 1.15rem; }
.gram-nav { display: flex; flex-wrap: wrap; width: fit-content; gap: .3rem; padding: .32rem; margin: 0 0 1.25rem; background: #f0f1e8; border-radius: 13px; }
.gram-nav a { display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: .55rem .85rem; font-size: .95rem; border-radius: 9px; font-weight: 600; }
.gram-nav a:hover { background: #e2e9db; }
.gram-nav a[aria-current] { color: #fffdf6; background: var(--green); }
.gram-course, .gram-demo, .gram-memo, .gram-question, .gram-bilan, .gram-pocket, .gram-corrections {
  border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); min-width: 0;
}
.gram-course { display: grid; grid-template-columns: minmax(0,.83fr) minmax(0,1.22fr); overflow: hidden; }
.gram-course-photo { min-height: 100%; position: relative; }
.gram-course-photo img { position: absolute; inset: 0; }
.gram-course-copy, .gram-demo, .gram-memo, .gram-question, .gram-bilan, .gram-pocket, .gram-corrections { padding: clamp(1.1rem, 2.4vw, 1.8rem); }
.gram-course h2, .gram-memo h2, .gram-bilan h2, .gram-demo h2 { font-size: 1.4rem; margin: 0; line-height: 1.22; }
.gram-rule { font-size: 1.07rem; line-height: 1.58; margin: .6rem 0 1rem; }
.gram-course h3 { font-size: 1rem; margin: 0 0 .6rem; }
.gram-examples { display: grid; gap: .65rem; }
.gram-examples > div { display: flex; gap: .68rem; align-items: flex-start; }
.gram-examples p { color: var(--muted); margin: .16rem 0 0; line-height: 1.43; font-size: .94rem; }
.gram-listen { border: 1px solid var(--line); height: 44px; width: 44px; }
.gram-listen[aria-pressed="true"], .gram-listen:hover { background: var(--gram-accent); color: white; }
.gram-demo { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.gram-demo-heading { display: flex; align-items: center; gap: .6rem; }
.gram-icon { border-radius: 11px; }
.gram-board, .gram-annotated, .gram-tray { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.gram-board {
  justify-content: center; min-height: 110px; padding: 1rem;
  background-color: var(--gram-soft);
  background-image: radial-gradient(#33513928 .8px, transparent .9px); background-size: 13px 13px;
  border-radius: 12px; border: 1px solid #253f341c;
}
.gram-tile, .gram-annotated > span { display: inline-flex; flex-direction: column; align-items: center; gap: .2rem; }
.gram-tile b, .gram-annotated b { margin: 0; background: #fffef9; border: 1px solid #c1cdbd; border-bottom: 3px solid #b6c4b1; border-radius: 8px; padding: .45rem .75rem; font-size: clamp(1.05rem,2vw,1.45rem); line-height: 1.2; }
.gram-tile small, .gram-annotated small { font-size: .79rem; font-weight: 600; color: var(--gram-accent); }
.gram-tile mark { display: inline-block; border-radius: .2em; background: var(--gram-mark); color: #4e3613; }
.gram-caption { min-height: 1.5em; margin: 0; line-height: 1.5; }
.gram-demo-controls, .gram-round-top, .gram-run-links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.gram-demo-controls [hidden] { display: none; }
.gram-steps { display: inline-flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 600; }
.gram-steps button { display: grid; place-items: center; width: 44px; height: 44px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; font-size: 1.4rem; }
.gram-steps button:disabled, .gram-options button:disabled, .gram-tray button:disabled { cursor: default; }
.gram-steps button:disabled { opacity: .42; }
.gram-actions { display: flex; gap: .6rem 1rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.gram-memo { max-width: 830px; }
.gram-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.gram-method-grid .gram-demo { margin: 0; }
.gram-checklist, .gram-scores, .gram-history ul { padding: 0; list-style: none; }
.gram-checklist { display: grid; gap: .65rem; line-height: 1.5; }
.gram-checklist li { display: flex; align-items: baseline; gap: .5rem; }
.gram-checklist svg { flex: none; align-self: flex-start; margin-top: .18em; color: var(--gram-accent); }
.gram-annotated { background: var(--gram-soft); border-radius: 12px; padding: 1rem; align-items: flex-start; }
.gram-annotated > span { align-items: flex-start; }
.gram-method { list-style: decimal; padding-inline-start: 1.55rem; margin: 1rem 0 0; }
.gram-method li { padding-left: .25rem; margin: .8rem 0 0; }
.gram-method li::marker { color: var(--gram-accent); font-weight: 700; }
.gram-method p, .gram-followup p { margin: .24rem 0 0; line-height: 1.54; }
.gram-run .gram-header, .gram-round { max-width: 850px; }
.gram-round-top p { margin: 0; color: var(--gram-accent); font-weight: 700; }
.gram-meter { display: flex; flex-wrap: nowrap; gap: .35rem; }
.gram-meter i { display: block; height: 8px; width: clamp(.85rem,3vw,2.3rem); background: #e5e9df; border-radius: 4px; }
.gram-meter .done { background: #407354; }
.gram-meter .current { background: #d8a746; }
.gram-round-note, .gram-run-links { color: var(--muted); font-size: .94rem; }
.gram-round-note { margin: .6rem 0; }
.gram-run-links { margin-top: 1rem; }
.gram-question h2 { margin: 1.3rem 0 1rem; font-size: clamp(1.2rem,2.3vw,1.65rem); line-height: 1.3; max-width: 48ch; }
.gram-question h2:focus, .gram-feedback:focus { outline: 0; }
.gram-support { border-left: 4px solid var(--gram-accent); background: var(--gram-soft); margin: 1rem 0; padding: .9rem 1rem; font-size: 1.18rem; font-weight: 600; border-radius: 0 9px 9px 0; }
.gram-inputs label, .gram-arranged p { display: block; font-weight: 600; margin: .75rem 0 .45rem; }
.gram-inputs input { width: 100%; min-height: 48px; padding: .65rem .8rem; border: 1px solid #8da394; border-radius: 9px; background: #fff; font-size: 1.12rem; }
.gram-options { display: flex; flex-wrap: wrap; gap: .52rem; }
.gram-options button, .gram-tray button { min-height: 44px; border: 1px solid #b9c7b8; border-radius: 9px; padding: .55rem .85rem; background: #fffdf8; font-weight: 500; }
.gram-options button[aria-pressed="true"], .gram-tray button { background: #e2f0e3; border-color: #477653; box-shadow: inset 0 0 0 1px #477653; }
.gram-options button:disabled:not([aria-pressed]) { opacity: .47; }
.gram-options button:hover:not(:disabled), .gram-tray button:hover:not(:disabled) { border-color: var(--green); }
.gram-choices { display: grid; max-width: 40rem; }
.gram-choices button { display: flex; align-items: center; gap: .7rem; text-align: left; }
.gram-choices i { display: inline-block; flex: none; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid #84998b; }
.gram-choices [aria-pressed="true"] i { background: var(--green); box-shadow: inset 0 0 0 3px #e2f0e3; }
.gram-tray { min-height: 67px; padding: .55rem; background: var(--gram-soft); border: 1px dashed #8ca18e; border-radius: 10px; margin-bottom: .8rem; }
.gram-placeholder { color: var(--muted); font-size: .95rem; padding-left: .3rem; }
.gram-error { color: #933b22; font-weight: 600; margin: .65rem 0; }
.gram-error:empty { margin: 0; }
.gram-feedback { background: #fff4d8; color: #604719; margin-top: 1rem; padding: .85rem 1rem; border-radius: 10px; }
.gram-feedback p { margin: .25rem 0 0; }
.gram-positive { background: #e9f4e9; color: #25573a; }
.gram-pocket, .gram-corrections { margin-top: 1rem; }
.gram-pocket summary, .gram-corrections summary { font-weight: 600; cursor: pointer; }
.gram-pocket summary svg { vertical-align: middle; margin: 0 .35rem; }
.gram-bilan { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; max-width: 850px; gap: 1.3rem; }
.gram-score { background: var(--gram-soft); color: var(--gram-accent); border-radius: 14px; padding: 1.1rem 1.3rem; display: grid; gap: .25rem; }
.gram-score b { font-size: 2.1rem; }
.gram-score b small { font-size: 1.15rem; }
.gram-score > span { font-size: .86rem; }
.gram-scores li, .gram-history li { display: flex; align-items: baseline; gap: .75rem; border-bottom: 1px solid var(--line); padding: .55rem 0; }
.gram-scores li { justify-content: space-between; }
.gram-scores strong, .gram-history li > b { white-space: nowrap; }
.gram-scores, .gram-bilan p { margin: .5rem 0 0; }
.gram-followup { margin-top: 1rem; max-width: 850px; }
.gram-corrections { max-width: 850px; }
.gram-corrections ol { list-style: none; padding: 0; margin: .8rem 0 0; }
.gram-corrections li { padding: .9rem 0; border-top: 1px solid var(--line); }
.gram-corrections h3 { font-size: 1.04rem; margin: .45rem 0; }
.gram-corrections p { margin: .22rem 0; line-height: 1.45; }
.gram-result-label { display: flex; gap: .4rem; align-items: center; font-size: .89rem; font-weight: 600; }
.gram-result-label.yes { color: #2f6749; }
.gram-result-label.again { color: #855315; }
.gram-history li { align-items: center; flex-wrap: wrap; }
.gram-history li > div { flex: 1 1 14rem; }
.gram-history li small { display: block; color: var(--muted); margin-top: .25rem; }
.gram-history .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.calm .gram-card:hover .gram-art { transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .gram-card:hover .gram-art { transform: none; transition: none; }
}
@media (max-width: 900px) {
  .gram-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gram-card.gram-featured { grid-row: auto; grid-column: span 2; flex-direction: row; }
  .gram-card.gram-featured .gram-card-image { min-height: 10rem; min-width: 42%; }
  .gram-card.gram-featured .gram-card-body { flex: 1; }
  .gram-card-image { aspect-ratio: 2.4; }
  .gram-method-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .gram-banner {
    background-image: linear-gradient(90deg, rgb(18 45 35 / 89%), rgb(20 47 35 / 77%) 56%, rgb(24 46 34 / 55%)), url('./assets/grammaire/genre.webp');
    background-position: center, 62% 70%;
  }
  .gram-banner-inner { min-height: 13.25rem; padding-block: .65rem 1.35rem; }
  .gram-banner-inner > p:last-child { max-width: 32ch; font-size: 1rem; }
  .gram-gallery { grid-template-columns: 1fr; gap: .75rem; }
  .gram-card, .gram-card.gram-featured { flex-direction: row; grid-column: auto; border-radius: 13px; }
  .gram-card .gram-card-image, .gram-card.gram-featured .gram-card-image { aspect-ratio: auto; min-width: 0; width: 31%; min-height: 7.8rem; flex: none; }
  .gram-card .gram-card-body, .gram-card.gram-featured .gram-card-body { padding: .75rem; flex: 1; }
  .gram-card :is(h2,h3), .gram-card.gram-featured h2 { font-size: 1.09rem; }
  .gram-card p { font-size: .86rem; }
  .gram-arrow { display: none; }
  .gram-nav { gap: .12rem; }
  .gram-nav a { padding: .46rem .56rem; font-size: .87rem; }
  .gram-course { grid-template-columns: 1fr; }
  .gram-course-photo { min-height: 0; aspect-ratio: 2.05; }
  .gram-phrase .gram-course-photo img { object-position: center 28%; }
  .gram-board { padding: .75rem .45rem; gap: .35rem; }
  .gram-tile b { padding: .36rem .45rem; }
  .gram-tile small { font-size: .72rem; }
  .gram-bilan { grid-template-columns: 1fr; }
  .gram-score { width: fit-content; }
}
