/* Mes Heures — la marée. */
:root {
  color-scheme: dark;
  --nuit: #0d3b45; --creux: #08323a; --eau: #12666d; --vague: #1f7d80;
  --ecume: #eafbf8; --brume: #b5d9d6; --houle: #18737a;
  --soleil: #ffd877; --couchant: #ffab6b; --lune: #e9eddc;
  --ciel-jour: #175a8c; --horizon-jour: #2b6f8e; --ciel-nuit: #06122a;
  --ciel-aube: #2c3560; --horizon-aube: #8c4f58; --ciel-midi: #1f5886; --horizon-midi: #55697a;
  --ciel-soir: #382c5a; --horizon-soir: #98483a; --ciel-gris: #3a4a58; --horizon-gris: #52656e;
  --bas: env(safe-area-inset-bottom);
  --doux: cubic-bezier(.16, 1, .3, 1); /* départ vif, arrivée en douceur */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--nuit); }
/* iPhone seulement : 1rem suit le réglage « Taille du texte ». */
@supports (-webkit-touch-callout: none) { html { font: -apple-system-body; } }
body { max-width: 480px; margin: 0 auto; color: var(--ecume); font: 1rem/1.4 -apple-system, system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:active { opacity: .85; }
:focus-visible { outline: 3px solid var(--brume); outline-offset: 2px; }
::selection { background: var(--brume); color: var(--creux); }
input { caret-color: var(--ecume); }
/* Titres lus par les aides vocales, sans rien changer à l'écran */
/* Un prénom ou une note sans espace passe à la ligne au lieu de déborder */
h1, h2, p, legend, strong { overflow-wrap: anywhere; }
.lien > span, .saisie > span { min-width: 0; }
#form-erreur { margin-top: 12px; padding: 10px 14px; border-radius: 18px; background: var(--ecume); color: var(--creux); font-weight: 600; }
#form-erreur:empty { display: none; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Le ciel, tout au fond. Couleurs assez soutenues pour que le texte clair reste lisible. */
#ciel { position: fixed; z-index: -2; inset: 0; max-width: 480px; margin: 0 auto; overflow: hidden; pointer-events: none; background: linear-gradient(var(--haut), var(--horizon) 62%, var(--nuit)); --haut: var(--ciel-jour); --horizon: var(--horizon-jour); transition: opacity .4s; }
#ciel.vide { visibility: hidden; opacity: 0; }
#ciel[data-moment="nuit"] { --haut: var(--ciel-nuit); --horizon: var(--nuit); }
#ciel[data-moment="aube"] { --haut: var(--ciel-aube); --horizon: var(--horizon-aube); }
#ciel[data-moment="apres-midi"] { --haut: var(--ciel-midi); --horizon: var(--horizon-midi); }
#ciel[data-moment="soir"] { --haut: var(--ciel-soir); --horizon: var(--horizon-soir); }
#ciel:not([data-moment="nuit"]):is([data-temps="gris"], [data-temps="pluie"], [data-temps="neige"], [data-temps="brouillard"]) { --haut: var(--ciel-gris); --horizon: var(--horizon-gris); }
.etoiles { position: absolute; inset: 0 0 55% 0; opacity: 0;
  background-image: radial-gradient(1.5px 1.5px at 8% 22%, #fff, transparent), radial-gradient(1px 1px at 22% 58%, #fff, transparent), radial-gradient(1px 1px at 37% 12%, #fff, transparent), radial-gradient(1.5px 1.5px at 52% 70%, #fff, transparent), radial-gradient(1px 1px at 63% 8%, #fff, transparent), radial-gradient(1px 1px at 74% 46%, #fff, transparent), radial-gradient(1.5px 1.5px at 88% 28%, #fff, transparent), radial-gradient(1px 1px at 94% 66%, #fff, transparent), radial-gradient(1px 1px at 15% 82%, #fff, transparent), radial-gradient(1px 1px at 45% 40%, #fff, transparent); }
#ciel[data-moment="nuit"][data-temps="clair"] .etoiles { opacity: .8; }
.astre { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--soleil); box-shadow: 0 4px 22px color-mix(in srgb, var(--soleil) 40%, transparent); transition: left 1s var(--doux), top 1s var(--doux), opacity .6s; }
#ciel[data-moment="aube"] .astre, #ciel[data-moment="soir"] .astre { background: var(--couchant); box-shadow: 0 4px 24px color-mix(in srgb, var(--couchant) 40%, transparent); }
.astre[data-astre="lune"] { background: transparent; box-shadow: inset -8px 5px 0 0 var(--lune); transform: rotate(-12deg); }
#ciel[data-temps="gris"] .astre, #ciel[data-temps="pluie"] .astre, #ciel[data-temps="neige"] .astre, #ciel[data-temps="brouillard"] .astre { opacity: .22; }
.nuages, .chutes { position: absolute; inset: 0 0 45% 0; }
.nuages i { position: absolute; height: 34px; border-radius: 40px; background: #dfeaee; opacity: .13; }
.nuages i::before { content: ""; position: absolute; left: 22%; bottom: 40%; width: 45%; height: 36px; border-radius: 50%; background: inherit; }
#ciel[data-temps="brouillard"] .nuages i { height: 60px; opacity: .18; }
.chutes { inset: 0; }
.chutes .goutte { position: absolute; width: 1.5px; height: 14px; border-radius: 2px; background: #cfe6ee; opacity: .4; rotate: 8deg; }
.chutes .flocon { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity: .6; }
.meteo { font-size: 0.9375rem; }

/* L'eau, devant le ciel */
#maree { position: fixed; z-index: -1; left: 0; right: 0; top: 0; bottom: 0; max-width: 480px; margin: 0 auto; overflow: hidden; pointer-events: none; transition: opacity .35s; }
#maree svg { display: block; width: 100%; height: 100%; }
.eau-lointaine { fill: var(--vague); }
.eau-moyenne { fill: var(--houle); }
.eau-proche { fill: var(--eau); }
#maree.vide { visibility: hidden; opacity: 0; }

/* Écrans */
.ecran { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(20px + env(safe-area-inset-top)) 20px calc(86px + var(--bas)); }
#vue-accueil { padding-bottom: calc(18px + var(--bas)); }
.haut { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9375rem; font-weight: 600; }
.bas { margin-top: auto; padding-top: 18px; }
.centre { margin-top: max(11vh, 52px); text-align: center; }
.ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.doux { color: var(--brume); font-size: 0.875rem; }
h1, h2 { font-size: 1.875rem; line-height: 1.15; letter-spacing: -.5px; }
.geant { font-size: clamp(4rem, 22vw, 5.75rem); font-weight: 800; line-height: 1.05; letter-spacing: -3px; font-variant-numeric: tabular-nums; }
#vue-marche .geant { font-size: clamp(3.5rem, 19vw, 4.875rem); }

.annonce { margin-top: max(6vh, 30px); }
#vue-bienvenue .annonce { margin-top: max(7vh, 52px); }
.faites { margin-top: auto; padding-top: 24px; }
.faites .ligne { font-size: 1.875rem; font-weight: 700; }
.faites .ligne small { font-size: 0.9375rem; font-weight: 600; }
.lien { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; text-align: left; }
.lien::after { content: "›"; font-size: 1.375rem; padding-left: 10px; }

/* Boutons : verre aux angles doux, un reflet sur le contour */
@property --reflet { syntax: '<angle>'; inherits: false; initial-value: 320deg; }
.icones { display: none; }
.icone { flex: none; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bouton, .retour, .annees button { position: relative; --lueur: var(--ecume); transition: transform .35s var(--doux), --reflet .5s var(--doux), background-color .25s, color .25s, filter .2s; }
.bouton::before, .retour::before, .annees button::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--reflet), var(--lueur), transparent 22%, transparent 40%, var(--lueur) 50%, transparent 62%, transparent 82%, var(--lueur));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; }
.bouton:active, .retour:active, .annees button:active { transform: scale(.96); transition-duration: .08s, .5s, .25s, .25s, .2s; opacity: 1; }
.bouton { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 0 16px; border-radius: 20px; background: var(--ecume); color: var(--creux); --lueur: var(--vague); font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bouton.second { min-height: 50px; margin-top: 10px; background: rgb(8 50 58 / .82); color: var(--ecume); --lueur: var(--ecume); font-size: 0.9375rem; font-weight: 600; }
/* Un tour de reflet quand un écran arrive */
.entre-droite .bouton::before, .entre-gauche .bouton::before, .ecran:not([hidden]) > .bas .bouton::before { animation: tour 1.1s var(--doux) 1 backwards; }
@keyframes tour { from { --reflet: 40deg; opacity: 1; } }
@media (hover: hover) { .bouton:hover, .retour:hover, .annees button:hover, nav button:hover, .mois:hover { filter: brightness(1.12); } }
.bouton:disabled { background: var(--creux); color: var(--brume); cursor: default; opacity: 1; transform: none; }
.bouton:disabled::before { display: none; }
.paire { display: flex; gap: 10px; }
.paire > * { flex: 1; }

/* Maintenir pour supprimer : l'eau remplit le bouton */
#form-supprimer { overflow: hidden; isolation: isolate; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; flex: 1.7; padding: 0 8px; font-size: 0.8125rem; }
#form-supprimer::after { content: ""; position: absolute; z-index: -1; inset: 0; background: var(--vague); transform: translateY(101%); transition: transform .25s var(--doux); }
#form-supprimer.tient::after { transform: translateY(0); transition: transform 1.2s linear; }

/* Menu : la pastille glisse d'un bouton à l'autre */
nav { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--bas)); width: min(448px, 100% - 32px); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--creux); border-radius: 24px; padding: 5px; animation: monte .45s var(--doux); }
nav::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 4); border-radius: 19px; background: var(--ecume); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .45s var(--doux); }
nav button { position: relative; min-height: 48px; border-radius: 19px; font-size: 0.875rem; transition: color .25s, transform .2s var(--doux); }
nav button:active { transform: scale(.94); }
nav button.actif { color: var(--creux); font-weight: 700; }
body.sans-menu nav { display: none; }
@keyframes monte { from { opacity: 0; translate: 0 24px; } }

/* D'un écran à l'autre */
.entre-droite { animation: de-droite .42s var(--doux); }
.entre-gauche { animation: de-gauche .42s var(--doux); }
@keyframes de-droite { from { opacity: 0; transform: translateX(36px); } }
@keyframes de-gauche { from { opacity: 0; transform: translateX(-36px); } }

/* Mon année : chaque mois se remplit */
.annees { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.annees button { min-height: 44px; padding: 0 16px; border-radius: 16px; background: var(--creux); font-weight: 600; }
.annees button.actif { background: var(--ecume); color: var(--creux); }
#mois { flex: none; display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.mois { position: relative; flex: 1 0 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0 14px; border-radius: 12px; background: var(--creux); overflow: hidden; font-size: 0.875rem; }
.mois, .lien { transition: transform .3s var(--doux), filter .2s; }
.mois:active, .lien:active { transform: scale(.98); opacity: 1; }
.mois i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--eau); }
.mois span { position: relative; }
.mois span:last-child { text-align: right; }
.mois.courant { box-shadow: inset 0 0 0 2px var(--ecume); font-weight: 700; }

/* Détail d'un mois */
.retour { display: flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; padding: 0 18px 0 12px; border-radius: 16px; background: var(--creux); font-weight: 600; margin-bottom: 14px; }
.bloc { margin-top: 16px; padding: 6px 16px; border-radius: 20px; background: var(--creux); }
.bloc .ligne { padding: 8px 0; }
.titre-champ, legend { display: block; font-size: 0.875rem; font-weight: 600; color: var(--brume); margin-top: 12px; }
legend { margin: 0; padding-bottom: 8px; }
.saisie { margin-top: 8px; min-height: 52px; padding: 8px 16px; border-radius: 18px; background: var(--creux); }

/* Bienvenue */
#vue-bienvenue, #vue-prenom { padding-bottom: calc(18px + var(--bas)); }
.grand-titre { font-size: clamp(3rem, 15vw, 4rem); font-weight: 800; letter-spacing: -2px; margin: 4px 0 8px; }
.atouts { list-style: none; margin-top: 5vh; display: grid; gap: 16px; }
.atouts li { display: flex; align-items: center; gap: 14px; font-size: 1.0625rem; }
.atouts .icone { box-sizing: content-box; width: 20px; height: 20px; padding: 11px; border-radius: 16px; background: var(--creux); }
#vue-bienvenue:not([hidden]) > * { animation: surgit .8s var(--doux) backwards; }
#vue-bienvenue:not([hidden]) .atouts li { animation: surgit .7s var(--doux) backwards; }
#vue-bienvenue .atouts li:nth-child(1) { animation-delay: .35s; }
#vue-bienvenue .atouts li:nth-child(2) { animation-delay: .5s; }
#vue-bienvenue .atouts li:nth-child(3) { animation-delay: .65s; }
#vue-bienvenue:not([hidden]) > .bas { animation-delay: .85s; }
@keyframes surgit { from { opacity: 0; transform: translateY(16px); } }
/* Le titre commence sous le soleil ou la lune. */
#vue-prenom { padding-top: calc(136px + env(safe-area-inset-top)); }
#vue-prenom > p { margin-top: 8px; }
#vue-prenom .titre-champ { color: var(--ecume); }
.forme-prenom { margin-top: 20px; }
.forme-prenom input { min-height: 56px; font-size: 1.375rem; font-weight: 700; }
.forme-prenom .bouton { margin-top: 18px; }
.forme-prenom .bouton.second { margin-top: 10px; }

/* Le salut : le ciel et l'eau sont déjà là, le texte se pose puis laisse la place. */
#salut { position: fixed; z-index: 8; inset: 0; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 0 24px 12vh; cursor: pointer; transition: opacity .45s, transform .6s var(--doux); }
#salut .geant { font-size: clamp(3rem, 15vw, 4.25rem); white-space: pre-line; overflow-wrap: anywhere; letter-spacing: -2px; animation: surgit .7s var(--doux) backwards; }
#salut p + p { margin-top: 10px; font-size: 1.125rem; animation: surgit .7s .18s var(--doux) backwards; }
#salut.part { opacity: 0; transform: translateY(-28px); pointer-events: none; }
body.salue main { opacity: 0; visibility: hidden; }
body.arrive main { animation: surgit .7s var(--doux); }

/* Aide à l'ajout sur l'écran d'accueil : une feuille en bas de l'écran */
dialog.feuille { inset: auto 0 0 0; height: auto; max-height: 90vh; margin: 0 auto; padding: 24px 20px calc(20px + var(--bas)); border-radius: 28px 28px 0 0; background: var(--creux); }
.feuille:not([open]) { display: none; }
.feuille::backdrop { background: rgb(4 20 26 / .7); }
.feuille h2 { font-size: 1.5rem; }
.feuille ol { list-style: none; display: grid; gap: 14px; margin: 18px 0 14px; }
.feuille li { display: flex; align-items: center; gap: 14px; }
.feuille .icone { box-sizing: content-box; width: 20px; height: 20px; padding: 11px; border-radius: 16px; background: var(--nuit); }
.feuille .bouton { margin-top: 16px; }

/* Sauvegarde, sous les douze mois */
.sauvegarde { margin-top: 32px; }
.sauvegarde h2 { font-size: 1.25rem; }
.sauvegarde p { margin: 6px 0 12px; }
#vue-debut > .bouton { margin-top: 10px; }

/* Premier démarrage */
#vue-debut { padding-bottom: calc(18px + var(--bas)); }
#vue-debut > p { margin-top: 8px; }
.mois-debut { margin-top: 12px; padding: 10px 14px 14px; }
.mois-debut legend { float: left; width: 100%; color: var(--ecume); font-size: 1rem; padding: 0; }
.mois-debut .paire { clear: both; }
.mois-debut .titre-champ { margin-top: 6px; }
#vue-debut input { display: block; width: 100%; min-width: 0; min-height: 48px; margin-top: 4px; padding: 8px 14px; border: 0; border-radius: 14px; background: var(--nuit); font-size: 1.25rem; font-weight: 700; }
#vue-debut form > .bouton { margin-top: 16px; }
#vue-debut form > .bouton.second { margin-top: 10px; }

/* Confirmation */
#avis { position: fixed; z-index: 6; left: 50%; top: calc(10px + env(safe-area-inset-top)); width: min(448px, 100% - 24px); display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 7px 7px 7px 16px; border-radius: 20px; background: var(--ecume); color: var(--creux); font-weight: 700;
  /* rangée au-dessus de l'écran tant qu'il n'y a rien à dire */
  visibility: hidden; opacity: 0; transform: translate(-50%, -130%) scale(.94); transition: transform .3s var(--doux), opacity .25s, visibility 0s .3s; }
#avis.visible { visibility: visible; opacity: 1; transform: translate(-50%, 0) scale(1); transition: transform .5s var(--doux), opacity .25s; }
#avis > span { flex: 1; }
.signe { flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--creux); color: var(--ecume); fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
#avis.visible .signe path { stroke-dasharray: 1; animation: coche .5s var(--doux) .15s backwards; }
#avis.erreur .signe path { stroke-dasharray: none; }
@keyframes coche { from { stroke-dashoffset: 1; } }
/* « Annuler » : son contour se consume comme une mèche, le temps qu'il reste */
#avis button { position: relative; min-height: 44px; padding: 0 18px; border-radius: 15px; background: var(--creux); color: var(--ecume); font-weight: 600; }
#avis button:active { transform: scale(.95); }
#avis.erreur button { display: none; }
.meche { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; pointer-events: none; }
.meche rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); stroke: var(--brume); stroke-width: 2px; stroke-dasharray: 100; }
#avis.visible .meche rect { animation: meche 8s linear forwards; }
@keyframes meche { to { stroke-dashoffset: 100; } }

/* Petits téléphones : le mois et la marge tiennent sur une ligne, sous le soleil. */
@media (max-width: 360px) { .haut { font-size: 0.8125rem; } }

/* Saisie */
dialog { position: fixed; z-index: 4; inset: 0; width: 100%; max-width: 480px; height: 100%; max-height: 100%; margin: 0 auto; border: 0; padding: calc(20px + env(safe-area-inset-top)) 20px calc(90px + var(--bas)); overflow-y: auto; background: var(--nuit); color: var(--ecume); }
dialog h2:focus { outline: none; }
dialog { opacity: 0; translate: 0 48px; transition: opacity .25s, translate .45s var(--doux), display .3s allow-discrete; }
dialog[open] { opacity: 1; translate: 0 0; }
dialog:not([open]) { pointer-events: none; }
@starting-style { dialog[open] { opacity: 0; translate: 0 48px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; translate: none !important; }
  .bouton, .retour, .annees button, .mois, .lien, nav::before, nav button, .choix label, .pas button, dialog, #avis { transition: opacity .2s !important; }
  #form-supprimer.tient::after { transition: transform 1.2s linear !important; }
}
fieldset { border: 0; min-width: 0; margin-top: 12px; }
#form-chrono:empty { display: none; }
input[type="date"], input[type="text"] { display: block; width: 100%; min-height: 48px; margin-top: 8px; padding: 8px 16px; border: 0; border-radius: 18px; background: var(--creux); color: var(--ecume); font-size: 1rem; font-weight: 400; }
.pas { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px; border-radius: 22px; background: var(--creux); }
.pas button { transition: transform .3s var(--doux); flex: none; width: 56px; height: 48px; border-radius: 14px; background: var(--vague); font-size: 1.75rem; }
.pas input { flex: 1; min-width: 0; border: 0; background: none; text-align: center; font-size: 2.125rem; font-weight: 800; appearance: textfield; -moz-appearance: textfield; }
.pas input::-webkit-inner-spin-button, .pas input::-webkit-outer-spin-button { -webkit-appearance: none; }
.choix { display: flex; gap: 8px; }
.pas button:active { transform: scale(.88); transition-duration: .08s; }
.choix label { transition: background-color .25s var(--doux), color .25s, transform .3s var(--doux); }
.choix label:active { transform: scale(.94); }
.choix label { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 18px; background: var(--creux); font-weight: 600; cursor: pointer; }
.choix input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choix label:has(input:checked) { background: var(--ecume); color: var(--creux); font-weight: 700; }
.choix label:has(input:focus-visible) { outline: 3px solid var(--brume); }
/* « Enregistrer » reste visible même sur un écran très court. */
#form-valider { position: sticky; bottom: 0; z-index: 1; margin-top: 16px; min-height: 52px; }
.bouton:disabled { background: var(--creux); color: var(--brume); cursor: default; opacity: 1; }
#form-chrono.alerte { color: var(--creux); background: var(--ecume); border-radius: 18px; padding: 10px 14px; margin-top: 10px; font-weight: 600; }
dialog h2 { font-size: 1.625rem; }

/* ---------- Pliable ouvert et tablettes : deux volets ---------- */
body.large { max-width: none; }
body.large:not(.deux) #ciel, body.large:not(.deux) #maree { max-width: none; }
body.large:not(.deux) .ecran { max-width: 480px; margin: 0 auto; }
body.deux main { display: grid; grid-template-columns: 1fr 1fr; }
/* Les écrans qui entourent le pli suivent la charnière quand le téléphone la signale. */
@media (horizontal-viewport-segments: 2) {
  body.deux main { grid-template-columns: env(viewport-segment-width 0 0, 1fr) 1fr; column-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px)); }
}
body.deux .ecran { min-width: 0; height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; grid-row: 1; }
body.deux #vue-accueil, body.deux #vue-marche { grid-column: 1; }
body.deux #vue-annee, body.deux #vue-mois { grid-column: 2; padding-bottom: calc(20px + var(--bas)); background: var(--nuit); }
body.deux #vue-marche { padding-bottom: calc(86px + var(--bas)); }
body.deux #vue-accueil .paire > :last-child { display: none; } /* l'année est déjà visible */
/* L'eau et le ciel restent du côté du mois ; l'année se lit sur un fond uni. */
body.deux #ciel, body.deux #maree { right: 50%; max-width: none; margin: 0; }
body.deux nav { left: 25%; width: min(448px, 50% - 28px); }
body.deux dialog#fenetre { left: 50%; right: 0; width: 50%; max-width: none; margin: 0; padding-bottom: calc(24px + var(--bas)); }
main.replie { animation: deplie .35s var(--doux); }
@keyframes deplie { from { opacity: .2; } }

/* ---------- Écran extérieur très étroit ---------- */
@media (max-width: 340px) {
  .ecran { padding-left: 14px; padding-right: 14px; }
  .paire { flex-wrap: wrap; gap: 0 10px; }
  .paire > * { flex: 1 1 100%; }
  nav { width: calc(100% - 16px); }
  nav button { font-size: 0.75rem; }
  .choix { gap: 5px; }
}

/* ---------- Téléphone à l'horizontale : l'essentiel, sur deux colonnes ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  body { max-width: none; }
  #ciel, #maree { max-width: none; }
  .ecran { padding-left: calc(24px + env(safe-area-inset-left)); padding-right: calc(24px + env(safe-area-inset-right)); }
  /* Accueil : ce qu'il reste à gauche, les actions à droite ; le détail revient téléphone redressé. */
  #vue-accueil:not([hidden]) { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: auto 1fr; column-gap: 28px; }
  #vue-accueil .haut { grid-column: 1; }
  #vue-accueil .annonce { grid-column: 1; align-self: center; margin-top: 0; }
  #vue-accueil .faites { display: none; }
  #vue-accueil .bas { grid-column: 2; grid-row: 1 / 3; align-self: end; margin: 0; padding: 0; }
  #vue-accueil .geant { font-size: min(26vh, 5.75rem); }
  /* Prêcher */
  #vue-marche:not([hidden]) { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: auto 1fr; column-gap: 28px; }
  #vue-marche .haut { grid-column: 1; }
  #vue-marche .centre { grid-column: 1; align-self: center; margin-top: 0; }
  #vue-marche .bas { grid-column: 2; grid-row: 1 / 3; align-self: end; margin: 0; padding: 0; }
  #vue-marche .geant { font-size: min(22vh, 4.875rem); }
  /* L'année : les douze mois sur trois colonnes */
  #mois { display: grid; grid-template-columns: repeat(3, 1fr); }
  .mois { min-height: 44px; font-size: 0.8125rem; }
  #vue-annee > .doux { display: none; }
  /* Le menu reste compact pour laisser de la place */
  nav { bottom: calc(6px + var(--bas)); }
  nav button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { main.replie { animation: none; } }

/* Les champs se voient : contour clair sur tous les fonds, ciel compris. */
input[type="text"], input[type="date"], .pas, #vue-debut input { border: 2px solid var(--brume); }
input::placeholder { color: var(--brume); opacity: 1; font-weight: 500; }
input[type="text"]:focus, input[type="date"]:focus, #vue-debut input:focus { border-color: var(--ecume); }
.pas { padding: 5px; }
/* Rien ne se retrouve caché sous le menu quand on avance au clavier. */
html, .ecran, dialog { scroll-padding-bottom: 96px; }

/* Deux volets : l'année est déjà là, et la notification reste d'un seul côté, en bas. */
body.deux .lien-annee { display: none; }
body.deux #avis { left: 75%; width: min(448px, 50% - 20px); top: auto; bottom: calc(14px + var(--bas)); transform: translate(-50%, 140%) scale(.94); }
body.deux #avis.visible { transform: translate(-50%, 0) scale(1); }

/* Pendant une sortie, l'ajout à la main est en retrait. */
.indisponible, .bouton.indisponible { opacity: .45; }
.feuille p { margin-top: 10px; }
