/* Générateur de fiches d'exercices : même vert que le reste du site */
#features.fx-section { padding-top: 1em; }
.fx-outil { max-width: 72em; margin: 0 auto; text-align: left; }
.fx-outil *:focus-visible { outline: 3px solid #f2b01e; outline-offset: 2px; }

/* ---------- Réglages ---------- */
.fx-boite { background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; padding: 1.1em 1.3em 1.2em; margin-bottom: 1.4em; }
.fx-boite h4 { text-align: left; text-transform: none; letter-spacing: 0; margin: 1em 0 .6em; font-size: 1em; color: #16855a; }
.fx-boite h4 small { color: #999; font-weight: 400; font-size: .85em; }
.fx-ligne { display: flex; flex-wrap: wrap; gap: .8em 1em; align-items: flex-end; }
.fx-champ { display: block; margin: 0; min-width: 7em; }
.fx-champ.fx-large { flex: 1 1 14em; }
.fx-champ > span:first-child { display: block; margin: 0 0 .3em; font-size: .82em; color: #878787; }
.fx-champ small { color: #aaa; }
.fx-champ input, .fx-champ select { font: inherit; width: 100%; padding: .45em .7em; border: 2px solid #e5e5e5; border-radius: .6em; background: #fff; color: #333; box-sizing: border-box; height: auto; }
.fx-champ input:focus, .fx-champ select:focus { outline: none; border-color: #16855a; }
.fx-code-c { display: flex; gap: .4em; align-items: center; }
.fx-code-c input { width: 7.5em; font: 600 1.05em/1.2 'Fredoka', 'Nunito', sans-serif; color: #16855a; letter-spacing: .08em; text-transform: uppercase; }
.fx-lien { flex: none; width: 2.3em; height: 2.3em; border-radius: 50%; background: #eaf7f1; color: #16855a; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fx-lien:hover { background: #d4efe3; }
.fx-lien .icon:before { margin: 0; }

.fx-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .5em; }
.fx-type { display: flex; align-items: center; justify-content: space-between; gap: .5em; padding: .4em .5em .4em .9em; border: 2px solid #e5e5e5; border-radius: .8em; background: #fff; color: #666; font-size: .93em; line-height: 1.25; }
.fx-type.actif { border-color: #5cc79a; background: #eaf7f1; color: #16855a; font-weight: 600; }
.fx-pm { flex: none; display: flex; align-items: center; gap: .3em; }
.fx-pm b { min-width: 1.4em; text-align: center; font-family: 'Fredoka', 'Nunito', sans-serif; }
.fx-pm [role=button] { width: 1.8em; height: 1.8em; border-radius: 50%; background: #fff; border: 2px solid #d4efe3; color: #16855a; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; -webkit-user-select: none; user-select: none; }
.fx-pm [role=button]:hover { border-color: #16855a; }

.fx-options { margin-top: 1em; }
.fx-case { display: flex; align-items: center; gap: .45em; margin: 0; padding-bottom: .5em; font-size: .93em; color: #555; cursor: pointer; }
.fx-outil .fx-case input[type=checkbox] { -webkit-appearance: checkbox; appearance: auto; display: inline-block; float: none; position: static; opacity: 1; z-index: auto; width: 1.15em; height: 1.15em; accent-color: #16855a; margin: 0; }
.fx-outil .fx-case:before { display: none !important; }
.fx-bts { display: flex; flex-wrap: wrap; gap: .6em; margin-top: 1.1em; }
.fx-act { display: inline-flex; align-items: center; gap: .55em; padding: .5em .95em; border: 2px solid #e5e5e5; border-radius: .8em; background: #fff; color: #555; cursor: pointer; font-size: .95em; -webkit-user-select: none; user-select: none; }
.fx-act:hover { border-color: #5cc79a; }
.fx-act .icon { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; background: #eaf7f1; color: #16855a; display: flex; align-items: center; justify-content: center; }
.fx-act .icon:before { margin: 0; }
.fx-act-p { border-color: #16855a; } .fx-act-p .icon { background: #16855a; color: #fff; }

.fx-apercu-titre { font-weight: 700; color: #16855a; margin: 0 0 .7em; }
.fx-apercu-titre .icon { margin-right: .3em; }
.fx-petit { font-weight: 400; color: #999; font-size: .85em; }
.fx-rgpd { text-align: center; color: #999; font-size: .85em; margin-top: 1em; }

/* ---------- Feuilles A4 (aperçu) ---------- */
.fx-feuilles { background: #eef1ef; border-radius: 1.2em; padding: 1.2em; overflow-x: auto; }
.fx-page { width: 210mm; min-height: 297mm; box-sizing: border-box; margin: 0 auto 1.2em; padding: 12mm 13mm; background: #fff; color: #111; box-shadow: 0 2px 10px rgba(0,0,0,.12); font-family: 'Nunito', Arial, sans-serif; font-size: 11.5pt; line-height: 1.45; position: relative; text-align: left; }
.fx-page:last-child { margin-bottom: 0; }
.fx-page.fx-petite { font-size: 10pt; }
.fx-page.fx-grande { font-size: 14pt; line-height: 1.6; letter-spacing: .02em; }
.fx-entete { border-bottom: 2px solid #16855a; padding-bottom: .5em; margin-bottom: 1em; }
.fx-entete > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.fx-entete b { font: 600 1.35em/1.2 'Fredoka', 'Nunito', sans-serif; color: #16855a; }
.fx-entete span { color: #666; font-weight: 700; }
.fx-nom { margin-top: .5em; color: #444; font-size: .92em; }
.fx-exo { margin-bottom: 1.1em; break-inside: avoid-page; }
.fx-exo h3 { text-transform: none; letter-spacing: 0; margin: 0 0 .15em; font: 600 1.05em/1.3 'Fredoka', 'Nunito', sans-serif; color: #16855a; }
.fx-consigne { text-align: left; margin: 0 0 .5em; font-style: italic; color: #333; }
.fx-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .55em 1.5em; }
.fx-items.cols1 { grid-template-columns: 1fr; }
.fx-items.cols2 { grid-template-columns: 1fr 1fr; }
.fx-items.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.fx-items li { margin: 0; padding: 0 0 var(--place, 0); break-inside: avoid; }
.fx-items.fx-sol { grid-template-columns: 1fr; gap: .35em; }
.fx-l { font-weight: 700; color: #16855a; margin-right: .15em; }
.fx-sol b { color: #16855a; }
.fx-corrige .fx-entete { border-bottom-style: dashed; }
.fx-code { position: absolute; right: 13mm; bottom: 7mm; font-size: 8pt; color: #aaa; }
.fx-vide { color: #999; font-style: italic; text-align: center; padding: 3em 0; }
.fx-page sup { font-size: .7em; line-height: 0; vertical-align: .55em; }

/* Fractions empilées */
.fx-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .12em; line-height: 1.15; text-align: center; }
.fx-f > span { padding: 0 .2em; }
.fx-f > span:first-child { border-bottom: .07em solid currentColor; }

@media screen and (max-width: 840px) {
	.fx-feuilles { padding: .6em; }
	.fx-page { width: 100%; min-height: 0; padding: 1.2em 1em 2em; font-size: 10.5pt; }
	.fx-items.cols3 { grid-template-columns: 1fr 1fr; }
	.fx-code { right: 1em; bottom: .6em; }
}
@media screen and (max-width: 480px) {
	.fx-items.cols2, .fx-items.cols3 { grid-template-columns: 1fr; }
	.fx-types { grid-template-columns: 1fr; }
}

/* ---------- Impression : seulement les feuilles ---------- */
@page { size: A4 portrait; margin: 12mm 13mm; }
@media print {
	body { background: #fff !important; }
	#header, #banner, #footer, #nav, .fx-reglages, .fx-apercu-titre, .fx-rgpd { display: none !important; }
	#page-wrapper, #features, #features .container, .fx-outil, .fx-feuilles { padding: 0 !important; margin: 0 !important; background: #fff !important; width: auto !important; max-width: none !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; }
	.fx-page { width: auto; min-height: 0; padding: 0; margin: 0; box-shadow: none; page-break-after: always; break-after: page; }
	.fx-page:last-child { page-break-after: auto; break-after: auto; }
	.fx-code { position: static; text-align: right; margin-top: 1em; }
	.fx-page, .fx-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
