/* =====================================================================
   Club d'Astronomie de Wittelsheim - Intendance des camps
   Feuille de style principale. Aucune dependance externe.
   ===================================================================== */

/* --- Jetons de couleur : theme sombre par defaut (ciel nocturne) ------ */
:root {
  --fond:        #080c1a;
  --fond-2:      #10162b;
  --fond-3:      #171f3a;
  --fond-survol: #1e2847;
  --bordure:     #26304f;
  --bordure-forte: #3a4670;

  --texte:        #e8ecf7;
  --texte-doux:   #a3aec9;
  --texte-faible: #6f7b9c;

  /* Bleu du club (#0087CB), eclairci pour rester lisible sur le fond nuit */
  --accent:        #4fb0e8;
  --accent-fort:   #7cc7f0;
  --accent-sombre: #1e6c9e;
  --accent-contraste: #04121c;

  --lien:        #8ecdf7;
  --succes:      #4ade80;
  --succes-fond: #10331f;
  --erreur:      #ff8080;
  --erreur-fond: #3a1414;
  --info:        #7dd3fc;
  --info-fond:   #0d2a3a;
  --alerte:      #fbbf24;
  --alerte-fond: #33270a;

  --midi: #ffc857;
  --soir: #c4b5fd;

  --rayon-r: 12px;
  --rayon-s: 8px;
  --ombre: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --largeur-max: 1360px;

  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-chiffres: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}

/* --- Theme clair ----------------------------------------------------- */
:root[data-theme="clair"] {
  --fond:        #f6f7fb;
  --fond-2:      #ffffff;
  --fond-3:      #eef1f8;
  --fond-survol: #e4e9f5;
  --bordure:     #d7dded;
  --bordure-forte: #b7c1da;

  --texte:        #161c2e;
  --texte-doux:   #4a5570;
  --texte-faible: #78829e;

  --accent:        #0072ae;
  --accent-fort:   #005a8c;
  --accent-sombre: #bfe3f8;
  --accent-contraste: #ffffff;

  --lien:        #0069a3;
  --succes:      #15803d;
  --succes-fond: #dcfce7;
  --erreur:      #b91c1c;
  --erreur-fond: #fee2e2;
  --info:        #0369a1;
  --info-fond:   #e0f2fe;
  --alerte:      #92600a;
  --alerte-fond: #fef3c7;

  --midi: #8a5a00;
  --soir: #6d28d9;

  --ombre: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px -12px rgba(16,24,40,.18);
  color-scheme: light;
}

/* --- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
  background-image:
    radial-gradient(1200px 500px at 12% -8%, rgba(0,135,203,.10), transparent 60%),
    radial-gradient(900px 420px at 92% 0%, rgba(255,200,87,.05), transparent 60%);
  background-attachment: fixed;
}
:root[data-theme="clair"] body { background-image: none; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.03rem; }
p  { margin: 0 0 .8em; }

a { color: var(--lien); text-decoration-color: color-mix(in srgb, var(--lien) 40%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

hr { border: 0; border-top: 1px solid var(--bordure); margin: 1.25rem 0; }

/* Taille par defaut de toutes les icones. Les regles de contexte plus bas
   (menu, boutons, jetons, tuiles) sont plus specifiques et l'emportent. */
.icone { width: 18px; height: 18px; flex: none; vertical-align: -.19em; }

/* --- En-tete --------------------------------------------------------- */
.entete {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--fond-2) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bordure);
}
.entete-interieur {
  max-width: var(--largeur-max); margin: 0 auto;
  padding: .6rem 1.1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.marque { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.marque img, .marque svg {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--bordure), 0 2px 10px -4px rgba(0,0,0,.6);
}
:root[data-theme="clair"] .marque img { box-shadow: none; }
.marque-texte { display: flex; flex-direction: column; line-height: 1.15; }
.marque-club { font-weight: 680; font-size: .95rem; letter-spacing: -.01em; }
.marque-appli { font-size: .74rem; color: var(--texte-faible); text-transform: uppercase; letter-spacing: .08em; }

.entete-droite { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.compte { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--texte-doux); }
.compte strong { color: var(--texte); font-weight: 600; }

/* --- Navigation ------------------------------------------------------ */
.nav {
  background: var(--fond-2);
  border-bottom: 1px solid var(--bordure);
  overflow-x: auto; scrollbar-width: thin;
}
.nav-interieur {
  max-width: var(--largeur-max); margin: 0 auto; padding: 0 1.1rem;
  display: flex; gap: .15rem; white-space: nowrap;
}
.nav a {
  display: inline-flex; align-items: center; gap: .42rem;
  padding: .68rem .8rem;
  color: var(--texte-doux); text-decoration: none;
  font-size: .88rem; font-weight: 520;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--texte); background: var(--fond-3); }
.nav a.actif { color: var(--accent); border-bottom-color: var(--accent); }
.nav a svg { width: 16px; height: 16px; flex: none; }

/* --- Structure ------------------------------------------------------- */
.page { max-width: var(--largeur-max); margin: 0 auto; padding: 1.4rem 1.1rem 4rem; }

.entete-page {
  display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.entete-page h1 { margin: 0; }
.entete-page .sous-titre { color: var(--texte-doux); font-size: .9rem; margin: .2rem 0 0; }
.entete-page .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.grille { display: grid; gap: 1rem; }
.grille-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grille-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grille-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- Cartes ---------------------------------------------------------- */
.carte {
  background: var(--fond-2);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-r);
  box-shadow: var(--ombre);
  overflow: hidden;
}
.carte-entete {
  padding: .85rem 1.05rem;
  border-bottom: 1px solid var(--bordure);
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  background: color-mix(in srgb, var(--fond-3) 55%, transparent);
}
.carte-entete h2, .carte-entete h3 { margin: 0; font-size: .98rem; }
.carte-entete > .icone { color: var(--accent); }
.carte-entete .actions { margin-left: auto; display: flex; gap: .4rem; }
.carte-corps { padding: 1.05rem; }
.carte-corps > :last-child { margin-bottom: 0; }
.carte-pied {
  padding: .7rem 1.05rem; border-top: 1px solid var(--bordure);
  background: color-mix(in srgb, var(--fond-3) 40%, transparent);
  font-size: .85rem; color: var(--texte-doux);
}

/* Vignette de statistique */
.stat { text-align: left; }
.stat .valeur { font-size: 1.85rem; font-weight: 660; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .etiquette { font-size: .78rem; color: var(--texte-faible); text-transform: uppercase; letter-spacing: .06em; margin-top: .2rem; }
.stat .detail { font-size: .82rem; color: var(--texte-doux); margin-top: .3rem; }

/* --- Boutons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .42rem;
  padding: .5rem .85rem;
  font: inherit; font-size: .87rem; font-weight: 560;
  color: var(--texte); background: var(--fond-3);
  border: 1px solid var(--bordure-forte); border-radius: var(--rayon-s);
  cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--fond-survol); border-color: var(--accent-sombre); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled], .btn.desactive { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-principal {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-contraste); font-weight: 620;
}
.btn-principal:hover { background: var(--accent-fort); border-color: var(--accent-fort); }

.btn-danger { color: var(--erreur); border-color: color-mix(in srgb, var(--erreur) 45%, var(--bordure)); }
.btn-danger:hover { background: var(--erreur-fond); border-color: var(--erreur); }

.btn-discret { background: transparent; border-color: transparent; color: var(--texte-doux); }
.btn-discret:hover { background: var(--fond-3); color: var(--texte); }

.btn-petit { padding: .3rem .55rem; font-size: .8rem; }
.btn-large { padding: .68rem 1.2rem; font-size: .95rem; }
.btn-bloc { width: 100%; }

.groupe-btn { display: inline-flex; gap: .4rem; flex-wrap: wrap; }

/* --- Formulaires ----------------------------------------------------- */
.champ { margin-bottom: .95rem; }
.champ:last-child { margin-bottom: 0; }
.champ > label, .etiquette-champ {
  display: block; margin-bottom: .3rem;
  font-size: .82rem; font-weight: 580; color: var(--texte-doux);
}
.champ .aide { font-size: .79rem; color: var(--texte-faible); margin-top: .28rem; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=email], select, textarea {
  width: 100%; padding: .5rem .65rem;
  font: inherit; font-size: .9rem;
  color: var(--texte); background: var(--fond);
  border: 1px solid var(--bordure-forte); border-radius: var(--rayon-s);
}
:root[data-theme="clair"] input, :root[data-theme="clair"] select, :root[data-theme="clair"] textarea { background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type=number] { font-variant-numeric: tabular-nums; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.champ-inline { display: flex; align-items: center; gap: .5rem; }
.champ-inline input[type=checkbox], .champ-inline input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin: 0; }
.champ-inline label { margin: 0; font-size: .87rem; color: var(--texte); font-weight: 480; cursor: pointer; }
.entete-droite .champ-inline label { white-space: nowrap; }
.entete-droite select { width: auto; min-width: 9rem; }

.ligne-champs { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ligne-champs.serree { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

fieldset { border: 1px solid var(--bordure); border-radius: var(--rayon-s); padding: .85rem 1rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; font-size: .82rem; font-weight: 600; color: var(--texte-doux); }

.barre-filtres {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end;
  padding: .85rem 1rem; margin-bottom: 1.1rem;
  background: var(--fond-2); border: 1px solid var(--bordure); border-radius: var(--rayon-r);
}
.barre-filtres .champ { margin: 0; min-width: 150px; }
.barre-filtres .champ.large { flex: 1 1 240px; }

/* --- Tableaux -------------------------------------------------------- */
.tableau-conteneur { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.tableau { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tableau th {
  text-align: left; padding: .55rem .7rem;
  font-size: .76rem; font-weight: 620; text-transform: uppercase; letter-spacing: .05em;
  color: var(--texte-faible); border-bottom: 1px solid var(--bordure-forte); white-space: nowrap;
}
table.tableau td { padding: .55rem .7rem; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
table.tableau tbody tr:hover { background: var(--fond-3); }
table.tableau tbody tr:last-child td { border-bottom: 0; }
table.tableau .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tableau .actions-cellule { text-align: right; white-space: nowrap; }
table.tableau tr.attenuee td { opacity: .5; }

/* --- Badges et pastilles -------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .1rem .45rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; line-height: 1.5;
  background: var(--fond-3); color: var(--texte-doux);
  border: 1px solid var(--bordure);
}
.badge-accent  { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge-succes  { background: var(--succes-fond); color: var(--succes); border-color: color-mix(in srgb, var(--succes) 35%, transparent); }
.badge-erreur  { background: var(--erreur-fond); color: var(--erreur); border-color: color-mix(in srgb, var(--erreur) 35%, transparent); }
.badge-info    { background: var(--info-fond);   color: var(--info);   border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.badge-alerte  { background: var(--alerte-fond); color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 35%, transparent); }
.badge-midi    { background: color-mix(in srgb, var(--midi) 15%, transparent); color: var(--midi); border-color: color-mix(in srgb, var(--midi) 35%, transparent); }
.badge-soir    { background: color-mix(in srgb, var(--soir) 15%, transparent); color: var(--soir); border-color: color-mix(in srgb, var(--soir) 35%, transparent); }

/* --- Messages -------------------------------------------------------- */
.messages { margin-bottom: 1.1rem; display: grid; gap: .5rem; }
.message {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .68rem .9rem; border-radius: var(--rayon-s);
  border: 1px solid; font-size: .88rem;
}
.message svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.message-succes { background: var(--succes-fond); border-color: color-mix(in srgb, var(--succes) 40%, transparent); color: var(--succes); }
.message-erreur { background: var(--erreur-fond); border-color: color-mix(in srgb, var(--erreur) 40%, transparent); color: var(--erreur); }
.message-info   { background: var(--info-fond);   border-color: color-mix(in srgb, var(--info) 40%, transparent);   color: var(--info); }

.encart {
  padding: .75rem .9rem; border-radius: var(--rayon-s);
  border: 1px solid var(--bordure); background: var(--fond-3);
  font-size: .87rem; color: var(--texte-doux);
}
.encart-alerte { background: var(--alerte-fond); border-color: color-mix(in srgb, var(--alerte) 40%, transparent); color: var(--alerte); }
.encart .icone { vertical-align: -.22em; margin-right: .15rem; }

.vide {
  text-align: center; padding: 2.6rem 1rem;
  color: var(--texte-faible); font-size: .92rem;
}
.vide svg { width: 38px; height: 38px; opacity: .35; margin-bottom: .6rem; }
.vide p { margin: 0 0 .9rem; }

/* --- Planning -------------------------------------------------------- */
.planning { display: grid; gap: .85rem; }

.jour-planning {
  background: var(--fond-2); border: 1px solid var(--bordure);
  border-radius: var(--rayon-r); overflow: hidden;
}
.jour-entete {
  padding: .55rem .95rem; background: var(--fond-3);
  border-bottom: 1px solid var(--bordure);
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.jour-entete .date { font-weight: 620; font-size: .93rem; text-transform: capitalize; }
.jour-entete .jour-num { color: var(--texte-faible); font-size: .8rem; }

.jour-repas { display: grid; grid-template-columns: 1fr 1fr; }
.jour-repas > * + * { border-left: 1px solid var(--bordure); }
@media (max-width: 700px) {
  .jour-repas { grid-template-columns: 1fr; }
  .jour-repas > * + * { border-left: 0; border-top: 1px solid var(--bordure); }
}

.case-repas { padding: .8rem .95rem; min-height: 108px; display: flex; flex-direction: column; gap: .5rem; }
.case-repas .creneau {
  display: flex; align-items: center; gap: .45rem;
  font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em;
}
.case-repas .creneau.midi { color: var(--midi); }
.case-repas .creneau.soir { color: var(--soir); }
.case-repas .creneau .effectif { margin-left: auto; color: var(--texte-faible); font-weight: 500; letter-spacing: 0; text-transform: none; }

.liste-plats { list-style: none; margin: 0; padding: 0; display: grid; gap: .22rem; }
.liste-plats li { display: flex; align-items: baseline; gap: .4rem; font-size: .88rem; }
.liste-plats .role { font-size: .7rem; color: var(--texte-faible); text-transform: uppercase; letter-spacing: .04em; flex: none; min-width: 54px; }

.equipe { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; font-size: .8rem; color: var(--texte-doux); }
.equipe .etiquette { color: var(--texte-faible); display: inline-flex; }
.equipe .etiquette .icone { width: 14px; height: 14px; }
.jeton {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .08rem .45rem; border-radius: 999px;
  background: var(--fond-3); border: 1px solid var(--bordure);
  font-size: .78rem; color: var(--texte);
}
.jeton.verrouille { border-color: var(--accent-sombre); color: var(--accent); }
.jeton svg { width: 11px; height: 11px; }

/* --- Liste de courses ------------------------------------------------ */
.rayon { margin-bottom: 1.1rem; }
.rayon-titre {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem 0; margin-bottom: .3rem;
  font-size: .78rem; font-weight: 680; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); border-bottom: 1px solid var(--bordure-forte);
}
.rayon-titre .compteur { margin-left: auto; color: var(--texte-faible); font-weight: 500; letter-spacing: 0; text-transform: none; }

.ligne-course {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .5rem .2rem; border-bottom: 1px solid var(--bordure);
}
.ligne-course:last-child { border-bottom: 0; }
.ligne-course input[type=checkbox] { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.ligne-course .corps { flex: 1 1 auto; min-width: 0; }
.ligne-course .nom { font-weight: 540; }
.ligne-course .detail { font-size: .78rem; color: var(--texte-faible); margin-top: .1rem; }
.ligne-course .quantite {
  flex: none; font-variant-numeric: tabular-nums; font-weight: 620;
  text-align: right; min-width: 88px;
}
.ligne-course.achetee .nom, .ligne-course.achetee .quantite { text-decoration: line-through; opacity: .45; }
.ligne-course.achetee .detail { opacity: .4; }

/* --- Divers ---------------------------------------------------------- */
.pile { display: grid; gap: 1rem; }
.rangee { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.rangee-fin { margin-left: auto; }
.doux { color: var(--texte-doux); }
.faible { color: var(--texte-faible); }
.petit { font-size: .82rem; }
.gras { font-weight: 620; }
.chiffres { font-variant-numeric: tabular-nums; }
.centre { text-align: center; }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0; }
.mt1 { margin-top: 1rem; }

.barre-progression { height: 6px; border-radius: 3px; background: var(--fond-3); overflow: hidden; }
.barre-progression > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.puces { list-style: none; margin: 0; padding: 0; display: flex; gap: .3rem; flex-wrap: wrap; }

.instructions { white-space: pre-wrap; line-height: 1.65; }

.imprimer-seulement { display: none; }

/* --- Responsive ------------------------------------------------------ */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .page { padding: 1rem .7rem 3rem; }
  .entete-interieur { padding: .5rem .7rem; }
  .marque-club { font-size: .85rem; }
  .entete-page .actions { width: 100%; margin-left: 0; }
  .entete-page .actions .btn { flex: 1 1 auto; }
  h1 { font-size: 1.32rem; }
}

/* --- Utilitaires complementaires ------------------------------------- */
.icone.icone-grande { width: 44px; height: 44px; }
.teinte-alerte { color: var(--alerte); margin-bottom: .8rem; }
.carte-etroite { max-width: 560px; margin: 3rem auto; }
.carte-moyenne { max-width: 760px; margin: 0 auto; }
.bloc-erreur { padding: 2.4rem 1.6rem; }
.code-erreur { font-size: 2.6rem; margin-bottom: .2rem; }
.sans-marge-bas { margin-bottom: 0; }
.pleine-largeur { width: 100%; }
.colonne-etroite { width: 1%; white-space: nowrap; }
.separateur-haut { border-top: 1px solid var(--bordure); padding-top: .9rem; margin-top: .9rem; }
.liste-nue { list-style: none; margin: 0; padding: 0; }
.liste-nue li + li { margin-top: .3rem; }
.compact .champ { margin-bottom: .55rem; }
.entete-connexion { text-align: center; margin-bottom: 1.4rem; }
.entete-connexion img { width: 62px; height: 62px; }
.entete-connexion h1 { font-size: 1.28rem; margin: .7rem 0 .1rem; }
.boite-connexion { max-width: 400px; margin: 6vh auto 0; }
.tuile-lien {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .95rem 1rem; text-decoration: none; color: inherit;
  background: var(--fond-2); border: 1px solid var(--bordure);
  border-radius: var(--rayon-r); transition: border-color .12s, background .12s;
}
.tuile-lien:hover { border-color: var(--accent-sombre); background: var(--fond-3); }
.tuile-lien svg { width: 21px; height: 21px; color: var(--accent); flex: none; margin-top: 2px; }
.tuile-lien .titre { font-weight: 600; display: block; }
.tuile-lien .desc { font-size: .82rem; color: var(--texte-faible); }

/* Cartes de hauteurs inegales : les aligner en haut evite un grand vide
   sous la plus courte. */
.grille.alignee-haut { align-items: start; }

/* --- Tableau de saisie des ingredients d'une recette ------------------ */
/* Sept colonnes de formulaire : sous cette largeur, les champs seraient
   tronques. On force donc le defilement horizontal du conteneur plutot
   que l'ecrasement des selects. */
.carte-ingredients { margin-top: 1rem; }

.tableau-ingredients { min-width: 920px; table-layout: fixed; }
.tableau-ingredients th:nth-child(1), .tableau-ingredients td:nth-child(1) { width: 23%; }
.tableau-ingredients th:nth-child(2), .tableau-ingredients td:nth-child(2) { width: 9%;  }
.tableau-ingredients th:nth-child(3), .tableau-ingredients td:nth-child(3) { width: 14%; }
.tableau-ingredients th:nth-child(4), .tableau-ingredients td:nth-child(4) { width: 17%; }
.tableau-ingredients th:nth-child(5), .tableau-ingredients td:nth-child(5) { width: 20%; }
.tableau-ingredients th:nth-child(6), .tableau-ingredients td:nth-child(6) { width: 11%; }
.tableau-ingredients th:nth-child(7), .tableau-ingredients td:nth-child(7) { width: 6%;  }
.tableau-ingredients td { vertical-align: top; padding-top: .5rem; padding-bottom: .5rem; }
.tableau-ingredients select,
.tableau-ingredients input[type=text] { min-width: 0; width: 100%; }

/* Texte reserve aux lecteurs d'ecran */
.lecteur-ecran {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Champ verrouille : doit se distinguer d'un champ vide au premier coup d'oeil */
input:disabled, select:disabled, textarea:disabled {
  background: var(--fond-3);
  color: var(--texte-faible);
  cursor: not-allowed;
  border-style: dashed;
}
.champ-inline input:disabled + label { color: var(--texte-faible); cursor: not-allowed; }

/* --- Aide contextuelle ------------------------------------------------ */
.aide-page {
  background: color-mix(in srgb, var(--info) 7%, var(--fond-2));
  border: 1px solid color-mix(in srgb, var(--info) 28%, var(--bordure));
  border-radius: var(--rayon-r);
  margin-bottom: 1.15rem;
}
.aide-page > summary {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem; cursor: pointer;
  font-size: .86rem; font-weight: 560; color: var(--info);
  list-style: none; user-select: none;
}
.aide-page > summary::-webkit-details-marker { display: none; }
.aide-page > summary::after {
  content: ''; margin-left: auto; flex: none;
  width: .5rem; height: .5rem; margin-right: .2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .15s ease;
}
.aide-page[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.aide-page > summary:hover { color: var(--texte); }
.aide-page[open] > summary { border-bottom: 1px solid color-mix(in srgb, var(--info) 22%, var(--bordure)); }

.aide-corps {
  padding: .8rem 1rem .85rem;
  font-size: .87rem; line-height: 1.6; color: var(--texte-doux);
}
.aide-corps > :last-child { margin-bottom: 0; }
.aide-corps strong { color: var(--texte); font-weight: 620; }
.aide-corps ul { margin: .45rem 0; padding-left: 1.15rem; }
.aide-corps li { margin-bottom: .3rem; }
.aide-corps li:last-child { margin-bottom: 0; }
.aide-corps code {
  background: var(--fond-3); border: 1px solid var(--bordure);
  border-radius: 4px; padding: 0 .3rem; font-size: .92em;
}
