/* Nombres premiers : même vert que le reste du site */
#features.np-section { padding-top: 1em; }
.np-outil { max-width: 72em; margin: 0 auto; text-align: left; }
.np-outil [hidden] { display: none !important; }
.np-outil *:focus-visible { outline: 3px solid #f2b01e; outline-offset: 2px; }
.np-outil:fullscreen { background: #fff; padding: 1.5em 2em; overflow: auto; max-width: none; }
.np-outil:-webkit-full-screen { background: #fff; padding: 1.5em 2em; overflow: auto; max-width: none; }

.np-onglets { display: flex; flex-wrap: wrap; gap: .5em; justify-content: center; margin-bottom: 1em; }
.np-onglet { padding: .55em 1.2em; border: 2px solid #e5e5e5; border-radius: 2em; background: #fff; color: #777; cursor: pointer; font-weight: 600; -webkit-user-select: none; user-select: none; transition: all .2s; }
.np-onglet:hover { border-color: #5cc79a; }
.np-onglet.actif { background: #16855a; border-color: #16855a; color: #fff; }
.np-onglet .icon { margin-right: .3em; }

.np-barre { display: flex; flex-wrap: wrap; gap: .8em 1.2em; align-items: flex-end; justify-content: center; padding: 1em 1.2em; background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; margin-bottom: 1em; }
.np-champ { display: block; margin: 0; min-width: 9em; }
.np-champ.np-grand { min-width: 16em; }
.np-champ > span { display: block; margin: 0 0 .3em; font-size: .82em; color: #878787; }
.np-champ input, .np-champ select { font: inherit; width: 100%; padding: .45em .7em; border: 2px solid #e5e5e5; border-radius: .6em; background: #fff; color: #555; box-sizing: border-box; height: auto; }
.np-champ input { font: 600 1.4em/1.2 'Fredoka', 'Nunito', sans-serif; color: #16855a; }
.np-champ input:focus, .np-champ select:focus { outline: none; border-color: #16855a; }

.np-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: .92em; line-height: 1.3; -webkit-user-select: none; user-select: none; transition: border-color .2s; }
.np-act:hover { border-color: #5cc79a; }
.np-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; }
.np-act .icon:before { margin: 0; }
.np-act-p { border-color: #16855a; } .np-act-p .icon { background: #16855a; color: #fff; }
.np-act.off { opacity: .4; pointer-events: none; }
.np-cmd { display: flex; flex-wrap: wrap; gap: .5em; justify-content: center; margin-top: 1em; }

/* Crible */
.np-crible-zone { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16em, 1fr); gap: 1.2em; align-items: start; }
@media screen and (max-width: 900px) { .np-crible-zone { grid-template-columns: minmax(0, 1fr); } }
.np-grille { display: grid; grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); gap: .3em; padding: .8em; background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; }
.np-case { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1.25; border-radius: .5em; background: #f6f6f6; color: #444; font: 600 clamp(.8em, 1.6vw, 1.15em)/1 'Fredoka', 'Nunito', sans-serif; cursor: pointer; transition: background .3s, color .3s; -webkit-user-select: none; user-select: none; }
.np-case:hover { box-shadow: 0 0 0 2px #5cc79a; }
.np-case.choisi { box-shadow: 0 0 0 3px #f2b01e; }
.np-case.un { background: #e9e9e9; color: #aaa; }
.np-case.raye { background: #fafafa; color: #c4c4c4; }
.np-case.raye:after { content: ''; position: absolute; left: 12%; right: 12%; top: 50%; height: 3px; border-radius: 2px; background: var(--c); transform: rotate(-28deg); }
.np-case.flash { animation: np-flash calc(.5s * var(--np-k, 1)) ease; }
@keyframes np-flash { 0% { transform: scale(1.35); background: var(--c); color: #fff; } 100% { transform: none; } }
.np-case.premier { background: var(--c); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.np-case.courant { animation: np-pulse 1s ease-in-out infinite; }
@keyframes np-pulse { 50% { transform: scale(1.12); } }
.np-case.final { animation: np-pop .45s ease both; }
@keyframes np-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: none; } }
.np-cote { display: grid; gap: .8em; }
.np-recit { padding: 1em 1.1em; border-radius: 1em; background: #f6fcf9; border: 2px solid #d4efe3; color: #444; line-height: 1.65; min-height: 9em; }
.np-legende { display: flex; flex-wrap: wrap; gap: .4em; }
.np-legende:empty { display: none; }
.np-puce { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2em; height: 2.2em; padding: 0 .4em; border-radius: .5em; background: var(--c); color: #fff; font-weight: 700; animation: np-pop .4s ease; }
.np-info { padding: .7em 1em; border-radius: .9em; border: 2px dashed #e0e0e0; color: #666; font-size: .92em; line-height: 1.6; }

/* Décomposition / PGCD */
.np-decomp { display: grid; grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); gap: 1em; margin-bottom: 1em; }
.np-carte { background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; padding: .9em 1.2em 1.1em; margin-bottom: 1em; }
.np-decomp .np-carte { margin-bottom: 0; }
.np-carte h3 { margin: 0 0 .5em; font-size: .95em; color: #16855a; text-align: center; letter-spacing: .05em; }
.np-aide { margin: 0 0 .8em; font-size: .88em; color: #888; text-align: center; line-height: 1.5; }
.np-table { width: auto; margin: 0 auto; border-collapse: collapse; font: 600 1.15em/1.5 'Fredoka', 'Nunito', sans-serif; color: #444; }
.np-table th, .np-table td { padding: .25em .9em; border: 0; text-align: center; }
.np-div td:nth-child(1) { border-right: 3px solid #16855a; text-align: right; }
.np-div td:nth-child(2) { color: #16855a; text-align: left; min-width: 2.5em; }
.np-table th { font-size: .7em; color: #aaa; text-transform: uppercase; letter-spacing: .06em; }
.np-table .np-expl { font: 400 .72em/1.4 'Nunito', sans-serif; color: #999; text-align: left; }
.np-arbre { display: block; width: 100%; max-height: 26em; height: auto; }
.np-resultat { text-align: center; border-color: #16855a; background: #f6fcf9; }
.np-big { font: 600 1.35em/1.7 'Fredoka', 'Nunito', sans-serif; color: #444; text-align: center; margin: .2em 0 .5em; }
.np-big b { color: #16855a; }
.np-petit { font-size: .9em; color: #777; text-align: center; margin: 0; }
.np-erreur { text-align: center; color: #c0392b; font-weight: 700; }
.np-defile { overflow-x: auto; }
.np-tab-pg { margin-bottom: .6em; }
.np-tab-pg th, .np-tab-pg td { border: 1px solid #eee; }
.np-tab-pg tbody th { font-size: .9em; color: #555; text-transform: none; letter-spacing: 0; }
.np-tab-pg td.commun { background: #fdf0c8; }
.np-tab-pg td:last-child { text-align: left; font-weight: 400; font-family: 'Nunito', sans-serif; font-size: .85em; }
.np-l-pg { background: #eaf7f1; } .np-l-pm { background: #fdf2e1; }
.np-l-pg th, .np-l-pg b { color: #16855a !important; } .np-l-pm th, .np-l-pm b { color: #b76a06 !important; }
.np-vide { color: #ccc; }
.np-euclide td { text-align: left; font-size: .9em; }
.np-euclide b { color: #16855a; }
.np-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .15em; line-height: 1.2; }
.np-f > span { padding: 0 .3em; }
.np-f > span:first-child { border-bottom: 2px solid currentColor; }
.np-vert { color: #16855a; }
.np-anim { animation: np-entre calc(.5s * var(--np-k, 1)) ease both; }
@keyframes np-entre { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.np-rgpd { margin: 1.2em 0 0; text-align: center; font-size: .8em; color: #999; }
@media screen and (max-width: 736px) { .np-barre .np-act { flex: 1 1 auto; } .np-table { font-size: 1em; } .np-champ.np-grand { min-width: 0; width: 100%; } }
@media (prefers-reduced-motion: reduce) { .np-case, .np-anim, .np-puce { animation: none !important; transition: none !important; } }
.np-table thead, .np-table thead tr, .np-table thead th { background: none !important; border: 0; }
.np-table tbody tr { background: none; }
.np-tab-pg thead th { border: 1px solid #eee; }
.np-grille.c6 { width: 100%; max-width: 32em; margin: 0 auto; box-sizing: border-box; }
.np-grille.c6 .np-case { aspect-ratio: 1.6; }

/* PGCD / PPCM : résultat en grand et étapes */
.np-res-tete { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; padding: 1em; }
@media screen and (max-width: 600px) { .np-res-tete { grid-template-columns: 1fr; } }
.np-res-bloc { display: flex; flex-direction: column; align-items: center; padding: .7em; border-radius: 1em; }
.np-res-bloc span { font-size: .9em; color: #777; font-weight: 600; }
.np-res-bloc b { font: 700 2.4em/1.2 'Fredoka', 'Nunito', sans-serif; }
.np-res-pg { background: #eaf7f1; } .np-res-pg b { color: #16855a; }
.np-res-pm { background: #fdf2e1; } .np-res-pm b { color: #b76a06; }
.np-rebond { animation: np-rebond .5s ease both; }
@keyframes np-rebond { 0% { transform: scale(.94); opacity: .3; } 70% { transform: scale(1.02); opacity: 1; } 100% { transform: none; } }
.np-etapes { display: grid; gap: .9em; }
.np-etape { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: .8em; align-items: start; line-height: 1.7; color: #444; }
.np-etape > b { display: flex; align-items: center; justify-content: center; width: 2em; height: 2em; border-radius: 50%; background: #16855a; color: #fff; font-weight: 700; }
.np-etape > b .icon:before { margin: 0; }
.np-etape strong { color: #16855a; }
.np-e-pg strong { color: #16855a; } .np-e-pm strong, .np-e-pm > b + div b { color: #b76a06; }
.np-e-pm > b { background: #b76a06; }
.np-etape .np-defile { margin-top: .5em; }
.np-jaune { padding: 0 .35em; border-radius: .3em; background: #fdf0c8; }
.np-gros-pg, .np-gros-pm { font: 700 1.3em/1 'Fredoka', 'Nunito', sans-serif; padding: .05em .4em; border-radius: .4em; }
.np-gros-pg { color: #16855a; background: #eaf7f1; } .np-gros-pm { color: #b76a06; background: #fdf2e1; }
.np-tab-pg { font-size: 1.05em; }
.np-tab-pg thead th { font-size: .85em; color: #888; text-transform: none; }

.np-vit select { min-width: 8em; }
.np-vit .icon { color: #5cc79a; }
