/* ==========================================================================
   TAMADOUGH — ce qui n'appartient qu'à cette app. Chargé APRÈS workbench.css.

   Accent croûte dorée. Une PAIRE vérifiée dans les deux thèmes :
     python3 lib/workbench/css/check_contrasts.py "#8a4a14" "#ffffff" "#e3a45a" "#0d0d0e"
     clair   blanc sur accent 6,84:1   accent sur fond 6,40:1
     sombre  encre sur accent 9,00:1   accent sur fond 8,67:1
   ========================================================================== */
:root {
  --accent: #8a4a14;
  --accent-tx: #ffffff;
  --accent-soft: #f6eadc;
  --accent-line: #e2c6a4;
  --ring: rgba(138, 74, 20, .30);
  --pate: #edd4a6;
  --pate-bulle: #d8b57a;
  --visage: #3b2716;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #e3a45a;
    --accent-tx: #0d0d0e;
    --accent-soft: #2e2418;
    --accent-line: #4a3822;
    --ring: rgba(227, 164, 90, .32);
    --pate: #d2a569;
    --pate-bulle: #b3854a;
  }
}
:root[data-theme="dark"] {
  --accent: #e3a45a;
  --accent-tx: #0d0d0e;
  --accent-soft: #2e2418;
  --accent-line: #4a3822;
  --ring: rgba(227, 164, 90, .32);
  --pate: #d2a569;
  --pate-bulle: #b3854a;
}

/* `hidden` doit gagner sur `.pile { display: flex }` : la carte des rappels
   rend tous ses états masqués et le script n'en montre qu'un. */
[hidden] { display: none !important; }

/* --- En cuisine, les mains dans la pâte : de grosses cibles ------------- */
.bouton.gros { min-height: 56px; font-size: 1.1rem; font-weight: 600; }
a.bouton.pleine-largeur { display: flex; justify-content: center; align-items: center; text-align: center; }
.centre { text-align: center; }

/* Le socle style onze formes de saisie ; datetime-local n'en fait pas partie. */
input[type=datetime-local], input[type=time] {
  display: block; width: 100%; min-height: 44px;
  padding: var(--e-2) var(--e-3);
  font: inherit; font-size: 16px; color: var(--tx);
  background: var(--surface);
  border: 1px solid var(--line-controle); border-radius: var(--r-m);
  -webkit-appearance: none; appearance: none;
}
input[type=datetime-local]:focus, input[type=time]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: var(--e-2); }
.stepper .bouton { min-height: 56px; padding: 0; font-size: 1.5rem; justify-content: center; }
.stepper input { min-height: 56px; text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* --- Ratios du rafraîchi ------------------------------------------------ */
.ratios { border: 0; padding: 0; margin: 0; min-width: 0; }
.ratios legend { font-size: var(--t-s); color: var(--tx-2); margin-bottom: var(--e-1); }
.ratios-grille { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--e-2); }
.ratio { position: relative; }
.ratio input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ratio span {
  display: flex; align-items: center; justify-content: center; min-height: 56px;
  border: 1px solid var(--line-controle); border-radius: var(--r-m);
  background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums;
}
.ratio input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-tx); }
.ratio input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
@media (max-width: 440px) { .ratios-grille { grid-template-columns: repeat(3, 1fr); } }
.ratios-grille.grille-3 { grid-template-columns: repeat(3, 1fr); }
.ratios-grille.grille-2 { grid-template-columns: repeat(2, 1fr); }

/* --- Choix du mode de planification ------------------------------------ */
.choix { border: 0; padding: 0; margin: 0; display: grid; gap: var(--e-2); min-width: 0; }
.choix legend { font-weight: 600; margin-bottom: var(--e-2); }
.choix-carte {
  display: flex; gap: var(--e-3); align-items: flex-start; min-height: 56px;
  padding: var(--e-3); border: 1px solid var(--line); border-radius: var(--r-l); cursor: pointer;
}
.choix-carte input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.choix-carte span { display: flex; flex-direction: column; gap: 2px; }
.choix-carte small { color: var(--tx-2); }
.choix-carte:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.formule summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--tx-2); }
.formule[open] summary { margin-bottom: var(--e-3); }

/* --- Le levain en bocal ------------------------------------------------- */
.tamagotchi { display: flex; align-items: center; gap: var(--e-4); }
.tamagotchi-bocal { flex: none; width: 112px; }
.tamagotchi-texte { display: flex; flex-direction: column; gap: var(--e-1); min-width: 0; }
.humeur { font-size: 1.15rem; font-weight: 650; color: var(--accent); }
@media (max-width: 440px) { .tamagotchi-bocal { width: 84px; } }

.bocal { display: block; width: 100%; height: auto; overflow: visible; }
.bocal .verre { fill: var(--surface-2); stroke: var(--tx-2); stroke-width: 3; }
.bocal .couvercle { fill: var(--accent); }
.bocal .pate { fill: var(--pate); }
.bocal .bulle { fill: var(--pate-bulle); }
.bocal .visage { fill: none; stroke: var(--visage); stroke-width: 3; stroke-linecap: round; }
.bocal .oeil { fill: var(--visage); }
.bocal .etincelle { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.bocal .zzz { fill: var(--tx-3); font: 700 14px system-ui, sans-serif; }
.bocal.humeur-pic { animation: sautille 1.8s ease-in-out infinite; }
@keyframes sautille { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .bocal.humeur-pic { animation: none; } }

/* --- Page publique de l'avant-première ------------------------------------ */
.landing { max-width: 640px; }
.landing-haut { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.landing-haut .nom-app { font-weight: 700; }
.landing-hero {
  display: flex; flex-direction: column; align-items: center; gap: var(--e-3);
  padding-block: var(--e-5); text-align: center;
}
.landing-hero h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.15; }
.landing-sous { max-width: 32rem; font-size: 1.15rem; color: var(--tx-2); }
.landing-bocal { width: 120px; }
.landing-humeurs { display: flex; justify-content: center; gap: var(--e-3); }
.landing-humeurs figure { width: 92px; margin: 0; }
.landing-humeurs figcaption { font-size: var(--t-s); color: var(--tx-2); }

/* --- Heure d'une saisie faite après coup ---------------------------------- */
.heure-saisie > summary {
  display: flex; align-items: center; min-height: 44px; cursor: pointer;
  color: var(--tx-2); font-size: var(--t-s);
}
.heure-saisie[open] > summary { margin-bottom: var(--e-2); }

/* --- Absences --------------------------------------------------------------- */
.en-deux { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-3); }
/* Une action, pas une légende : couleur d'accent et « + », sinon le repli se
   lit comme un texte gris et personne n'ose y toucher. */
.ajout > summary { color: var(--accent); font-weight: 650; list-style: none; }
.ajout > summary::-webkit-details-marker { display: none; }
.ajout > summary::before { content: "+"; margin-right: var(--e-2); font-size: 1.3rem; line-height: 1; }
.ajout[open] > summary::before { content: "−"; }
.absence-ligne { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); }
.alerte.pile-serree { display: flex; flex-direction: column; gap: var(--e-2); }
.conseils { display: grid; gap: var(--e-1); padding-left: 1.2rem; }

.connexion { max-width: 420px; margin: var(--e-6) auto 0; }
.connexion-bocal { width: 96px; margin: 0 auto; }
.nom-propose a { font-weight: 600; }
.rafraichi-ligne { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); }

/* --- Frise des étapes ----------------------------------------------------- */
.frise { list-style: none; }
.frise li {
  display: grid; grid-template-columns: 7.5rem 1fr auto; gap: var(--e-3); align-items: baseline;
  padding: var(--e-2) 0; border-bottom: 1px solid var(--line);
}
.frise li:last-child { border-bottom: 0; }
.frise time { color: var(--tx-2); font-variant-numeric: tabular-nums; }
.frise li.faite { color: var(--tx-3); }
.frise li.courante { color: var(--accent); font-weight: 650; }
.frise li.courante time { color: var(--accent); }
.frise .coche { color: var(--ok-tx); font-weight: 700; }

/* --- L'étape courante ------------------------------------------------------ */
.etape { display: flex; flex-direction: column; gap: var(--e-4); border-color: var(--accent-line); }
.etape h1 { font-size: 1.9rem; }
.etape-quand { font-size: 1.1rem; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.etape-quand time.echu { color: var(--accent); font-weight: 700; }
.consigne { font-size: 1.15rem; line-height: 1.5; }
.protocole { display: grid; gap: var(--e-2); padding-left: 1.4rem; font-size: 1.1rem; }
.pesees { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--e-2); }
.pesees li { padding: var(--e-2) var(--e-3); background: var(--surface-2); border-radius: var(--r-m); }
.pot { display: flex; flex-direction: column; gap: var(--e-3); }
.pousse { font-size: 2rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.scenario header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--e-2); }
.scenario-sortie strong { color: var(--accent); }
.petrir-a { display: flex; align-items: flex-end; gap: var(--e-3); }
.petrir-a .champ { flex: 1; }

/* --- Parcours débutant ---------------------------------------------------- */
.nom-levain { color: inherit; text-decoration: none; }
.tuiles { display: grid; gap: var(--e-2); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; vertical-align: middle;
  background: var(--accent-soft, var(--surface-2)); color: var(--accent); font-size: var(--t-s); font-weight: 600;
}
.carte-lien { color: inherit; text-decoration: none; border-color: var(--accent-line); }
.moisissure summary { cursor: pointer; font-weight: 600; }
.nom-propose-grand { font-size: 1.8rem; line-height: 1.2; }
.moment { padding-block: var(--e-5); }
.moment-bocal { width: 140px; margin-inline: auto; }
.gestes { display: grid; gap: var(--e-2); padding-left: 1.4rem; margin: 0; }
/* Une liste d'objets à réunir, dans la même forme que les pesées du jour. */
.liste-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e-2); }
.liste-simple li { padding: var(--e-2) var(--e-3); background: var(--surface-2); border-radius: var(--r-m); }
/* Baptême : le nom proposé est un champ qui a l'air d'un titre, le stylo à côté. */
.nom-editable { display: flex; align-items: center; justify-content: center; gap: var(--e-2); }
.nom-editable input[type=text] {
  flex: 1; min-width: 0; min-height: 56px; padding: var(--e-1) 0;
  text-align: center; font-size: 1.8rem; font-weight: 700; color: var(--tx);
  background: transparent; border: 0; border-bottom: 2px dashed var(--accent-line); border-radius: 0;
  box-shadow: none;
}
.nom-editable input[type=text]:focus { outline: none; border-bottom-color: var(--accent); box-shadow: none; }
.stylo {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 999px; cursor: pointer;
}
