/* Pages des outils : l'outil, puis ses explications juste en dessous. */
.outil { display: flex; flex-direction: column; gap: 18px; }
.explications { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; align-items: start; }
.explications .boite { background: var(--cream); border-color: transparent; }
.explications h2 { margin-bottom: 8px; }
.explications ol, .explications ul { padding-left: 22px; }
.explications li { margin-bottom: 6px; }
.explications p + p, .explications ul + p { margin-top: 10px; }

/* Transfert */
.bravo { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font: 600 22px var(--title); }
.bravo img { width: auto; height: 190px; }
.transfert { width: 100%; }
#send, #receive, #join { align-items: stretch; width: 100%; }
.etapes { display: flex; flex-wrap: wrap; gap: 8px; }
.etapes button { flex: 1 1 140px; min-height: 48px; background: var(--surf); border: 2px solid var(--ink); border-radius: 26px; font-weight: 800; }
.modes button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; border: 3px dashed var(--ink); border-radius: 22px; cursor: pointer; }
.drop strong { max-width: 100%; font: 600 26px/1.3 var(--title); overflow-wrap: anywhere; }
.drop.over { background: var(--sky); }
.file { width: 100%; min-width: 0; min-height: 44px; }
.file::file-selector-button { min-height: 44px; margin-right: 12px; padding: 0 18px; font: 800 16px var(--body); color: var(--ink); background: var(--surf); border: 2px solid var(--ink); border-radius: 22px; cursor: pointer; }
.share { width: 100%; padding: 18px; background: var(--cream); border-radius: 18px; gap: 10px; }
.code { font: 700 clamp(30px, 8vw, 46px)/1.2 var(--title); letter-spacing: .06em; user-select: all; }
.field { width: 100%; min-width: 0; min-height: 56px; padding: 0 20px; background: var(--bg); border: 2px solid var(--ink); border-radius: 28px; font: 600 26px var(--title); text-transform: uppercase; }
.filename { font: 600 23px/1.3 var(--title); overflow-wrap: anywhere; }
.progress { display: flex; align-items: center; gap: 14px; font-weight: 800; }
.progress progress { flex: 1; min-width: 0; height: 20px; accent-color: var(--blue); }
.status { min-height: 1.6em; font-weight: 800; }
.annuler { align-self: flex-start; min-height: 44px; font-size: 15px; }

/* Règle : le dessin est créé par script/regle.js. */
.ruler { padding: 0; overflow: hidden; }
.ruler svg { display: block; width: 100%; fill: var(--ink); }
.ruler line { stroke: var(--ink); stroke-width: 2; }
.ruler text { font-size: 17px; font-weight: 800; }
.ruler .cursor { stroke: var(--blue); stroke-width: 4; }
.outil input[type="range"] { width: 100%; height: 44px; accent-color: var(--blue); }
.outil input#calibration { max-width: 640px; }
.card-box { width: 100%; overflow-x: auto; }
.card { display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--sky); border: 2px dashed var(--ink); border-radius: 12px; }

/* Boussole : le cadran et l'aiguille sont deux fichiers SVG superposés. */
.boussole { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px 48px; }
.compass { position: relative; flex: 0 1 440px; aspect-ratio: 1; min-width: min(240px, 100%); }
.compass img { position: absolute; inset: 0; width: 100%; height: 100%; }
#needle { transition: transform 1.1s cubic-bezier(.2, 1.4, .4, 1); }
.boussole .stack { flex: 1 1 280px; max-width: 520px; }
.answer { width: 100%; padding: 18px 22px; background: var(--sky); border-radius: 20px; font: 600 26px/1.35 var(--title); }

@media (max-width: 640px) {
  .drop { padding: 26px 12px; }
  .boite.calibrate { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { #needle { transition: none; } }

/* Générateur de QR code */
.qr-outil { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; align-items: start; }
.qr-outil textarea { width: 100%; min-height: 150px; padding: 14px 18px; resize: vertical; background: var(--bg); border: 2px solid var(--ink); border-radius: 20px; }
.qr-outil select { min-height: 48px; padding: 0 14px; background: var(--bg); border: 2px solid var(--ink); border-radius: 24px; }
.qr-sortie { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-cadre { width: min(100%, 360px); aspect-ratio: 1; background: #FFFFFF; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; }
.qr-cadre svg { display: block; width: 100%; height: 100%; }

/* Niveau à bulle */
.niveau { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px 40px; }
.niveau-rond { position: relative; width: min(320px, 80vw); aspect-ratio: 1; background: var(--sky); border: 3px solid var(--ink); border-radius: 50%; }
.niveau-rond::before, .niveau-rond::after { content: ""; position: absolute; background: var(--dash); }
.niveau-rond::before { left: 50%; top: 8%; bottom: 8%; width: 2px; }
.niveau-rond::after { top: 50%; left: 8%; right: 8%; height: 2px; }
.cible { position: absolute; inset: 40%; border: 2px solid var(--ink); border-radius: 50%; }
.bulle-ronde { position: absolute; left: 50%; top: 50%; width: 18%; aspect-ratio: 1; margin: -9%; background: var(--surf); border: 3px solid var(--ink); border-radius: 50%; transition: transform .12s linear; }
.niveau-rond.juste { background: var(--mint); }
.niveau-rond.juste .bulle-ronde { background: var(--blue); }
.fiole { position: relative; background: var(--sky); border: 3px solid var(--ink); border-radius: 30px; }
.fiole--h { width: min(320px, 80vw); height: 56px; }
.fiole--v { width: 56px; height: 200px; }
.fiole i { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px; background: var(--surf); border: 3px solid var(--ink); border-radius: 50%; transition: transform .12s linear; }
.niveau-colonne { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.niveau-ligne { display: flex; align-items: center; gap: 16px; }

/* Bouton rouge */
.rouge-zone { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.rouge { width: 220px; height: 220px; padding: 0; background: #D6322E; border: 4px solid var(--ink); border-radius: 50%; box-shadow: 0 10px 0 #8F1F1C, 0 10px 0 4px var(--ink); transition: transform .08s, box-shadow .08s; }
.rouge:hover { background: #E4413C; }
.rouge:active { transform: translateY(8px); box-shadow: 0 2px 0 #8F1F1C, 0 2px 0 4px var(--ink); }
.rouge-zone .answer { max-width: 560px; }
@media (prefers-reduced-motion: reduce) { .bulle-ronde, .fiole i, .rouge { transition: none; } }

/* Détecteur de mensonge */
.detecteur { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.detecteur .champ { width: min(100%, 520px); }
.detecteur input[type="text"] { width: 100%; min-height: 48px; padding: 0 18px; background: var(--bg); border: 2px solid var(--ink); border-radius: 24px; }
.doigt { --p: 0; width: 150px; height: 150px; padding: 0; border: 4px solid var(--ink); border-radius: 50%; font: 700 17px var(--title); color: var(--ink); background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--sky) 0); }
.doigt:disabled { cursor: progress; }
.trace { display: flex; align-items: center; justify-content: center; gap: 4px; width: min(100%, 520px); height: 90px; padding: 8px 14px; background: var(--surf); border: 2px solid var(--ink); border-radius: 16px; }
.trace i { flex: 1; max-width: 10px; background: var(--blue); border-radius: 4px; transition: height .08s linear; }
.verdict { min-height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 4px; width: min(100%, 520px); padding: 12px 18px; border: 2px dashed var(--dash); border-radius: 16px; }
.verdict strong { font: 700 28px var(--title); }
.verdict.vrai { border: 2px solid var(--ink); background: var(--mint); }
.verdict.faux { border: 2px solid var(--ink); background: var(--peach); }
.verdict.doute { border: 2px solid var(--ink); background: var(--cream); }
@media (prefers-reduced-motion: reduce) { .trace i { transition: none; } }

/* Minuteur Pomodoro */
.pomodoro { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.etapes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.etapes button { min-height: 44px; padding: 0 18px; font-weight: 700; background: var(--surf); border: 2px solid var(--ink); border-radius: 24px; color: var(--ink); }
.etapes button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--bg); }
.cadran { --p: 0; display: grid; place-items: center; width: min(300px, 78vw); aspect-ratio: 1; border: 4px solid var(--ink); border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--sky) 0); }
.cadran div { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 82%; aspect-ratio: 1; background: var(--surf); border-radius: 50%; }
.cadran output { font: 700 clamp(44px, 14vw, 64px) var(--title); font-variant-numeric: tabular-nums; }
.reglages { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; }
.reglages label { display: flex; align-items: center; gap: 8px; }
.reglages input { width: 76px; min-height: 44px; padding: 0 10px; text-align: center; background: var(--bg); border: 2px solid var(--ink); border-radius: 22px; }

/* Compteur de mots */
.compteur textarea { width: 100%; min-height: 220px; padding: 14px 18px; resize: vertical; background: var(--bg); border: 2px solid var(--ink); border-radius: 20px; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.chiffres div { display: flex; flex-direction: column-reverse; padding: 12px 16px; background: var(--surf); border: 2px solid var(--line); border-radius: 16px; }
.chiffres dt { color: var(--soft); font-size: 15px; }
.chiffres dd { margin: 0; font: 700 30px var(--title); font-variant-numeric: tabular-nums; }
.chiffres .grand { background: var(--sky); border-color: var(--ink); }
.compteur { align-items: stretch; }
.compteur textarea, .qr-outil textarea { font: inherit; }
.etapes button { white-space: nowrap; }
.chiffres { width: 100%; }

/* Générateur de mots de passe */
.mdp { display: flex; flex-direction: column; gap: 16px; }
.mdp output, .mdp input[type="text"] { font: 600 22px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sortie { width: 100%; min-height: 56px; padding: 10px 18px; background: var(--bg); border: 2px solid var(--ink); border-radius: 20px; overflow-wrap: anywhere; }
.options { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; border: 0; }
.options label { display: flex; align-items: center; gap: 8px; }
.options input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--blue); }
.curseur { display: flex; align-items: center; gap: 14px; }
.curseur input { flex: 1; accent-color: var(--blue); }

/* Testeur de regex */
.regex { display: flex; flex-direction: column; gap: 14px; }
.regex .ligne { display: flex; align-items: center; gap: 8px; }
.regex .ligne span { font: 700 22px ui-monospace, Menlo, Consolas, monospace; }
.regex input[type="text"], .regex textarea { width: 100%; padding: 10px 16px; background: var(--bg); border: 2px solid var(--ink); border-radius: 18px; font: 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.regex textarea { min-height: 150px; resize: vertical; }
.apercu { min-height: 60px; margin: 0; padding: 12px 16px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surf); border: 2px solid var(--line); border-radius: 18px; font: 16px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.apercu mark { background: var(--sky); color: var(--ink); border-bottom: 3px solid var(--blue); border-radius: 3px; }
.resultats { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.resultats li { padding: 8px 14px; background: var(--surf); border: 2px solid var(--line); border-radius: 14px; overflow-wrap: anywhere; }
.erreur { margin: 0; color: var(--ink); font-weight: 700; }
.erreur:not(:empty) { padding: 8px 14px; background: var(--peach); border: 2px solid var(--ink); border-radius: 14px; }

/* Convertisseur de couleurs */
.couleurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; align-items: start; }
.echantillon { width: 100%; height: 130px; border: 3px solid var(--ink); border-radius: 20px; }
.entree-couleur { display: flex; gap: 10px; }
.entree-couleur input[type="text"] { flex: 1; min-height: 48px; padding: 0 16px; background: var(--bg); border: 2px solid var(--ink); border-radius: 24px; }
.entree-couleur input[type="color"] { width: 56px; height: 48px; padding: 2px; background: var(--bg); border: 2px solid var(--ink); border-radius: 24px; }
.valeur { display: flex; align-items: center; gap: 10px; }
.valeur label { width: 56px; font-weight: 700; }
.valeur input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; background: var(--bg); border: 2px solid var(--line); border-radius: 22px; font: 16px ui-monospace, Menlo, Consolas, monospace; }
.valeur .btn { min-height: 44px; padding: 0 14px; }
.couleurs .boite > *, .regex > *, .mdp > * { align-self: stretch; min-width: 0; }
.mdp .btns, .regex .btns { align-self: flex-start; }
