:root {
  --fond: #F3ECE2;
  --feuille: #FBF7F1;
  --encre: #2A2420;
  --doux: #5E5349;
  --pale: #9C8F80;
  --trait: #E6DCCF;
  --trait-fort: #CFC4B6;
  --case: #F1E9DE;
  --brique: #D9572B;
  --sur-brique: #FFF8F0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--encre); }
body {
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.5; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
.ecran {
  max-width: 440px; margin: 0 auto; min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.cache { display: none !important; }
.k { font-size: 13px; color: var(--pale); margin: 0 0 18px; }
.k a { color: inherit; }
.phrase { font-size: 25px; line-height: 1.5; letter-spacing: -0.015em; margin: 0; }
.titre { font-size: 28px; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 400; }
.u { font-weight: 500; border-bottom: 2px solid var(--brique); cursor: pointer; font-variant-numeric: tabular-nums; }
.vide { color: #A89B8C; border-bottom: 2px dashed var(--trait-fort); cursor: pointer; }
.mot { font-size: 18px; line-height: 1.5; margin: 14px 0 0; color: var(--doux); cursor: pointer; overflow-wrap: anywhere; }
.bouton {
  display: block; width: 100%; border: 0; font: inherit; font-size: 16px; font-weight: 500;
  background: var(--brique); color: var(--sur-brique); border-radius: 16px; padding: 16px;
  text-align: center; cursor: pointer; user-select: none; transition: transform .1s, opacity .2s;
}
.bouton:active { transform: scale(.98); }
.bouton[aria-busy="true"] { opacity: .6; pointer-events: none; }
.bouton.sombre { background: var(--encre); color: var(--fond); border-radius: 14px; padding: 14px; font-size: 15px; }
.lien { background: none; border: 0; font: inherit; font-size: 14px; color: var(--pale); text-decoration: underline; cursor: pointer; padding: 8px 0; }
.bas { margin-top: auto; padding-top: 28px; }
.note { font-size: 12px; color: var(--pale); text-align: center; margin: 12px 0 0; }
.erreur { color: #A93A16; font-size: 14px; margin: 10px 0 0; min-height: 21px; }
.champ {
  width: 100%; border: 0; border-bottom: 1.5px solid var(--trait-fort); background: transparent;
  font: inherit; font-size: 22px; padding: 10px 2px; color: var(--encre); outline: none; border-radius: 0;
}
.champ:focus { border-color: var(--brique); }
textarea.champ { font-size: 17px; resize: none; }

/* Bottom sheet */
.voile { position: fixed; inset: 0; background: rgba(42, 36, 32, .18); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 10; }
.voile.ouvert { opacity: 1; pointer-events: auto; }
.panneau {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 440px; z-index: 11;
  background: var(--feuille); border-radius: 22px 22px 0 0;
  padding: 18px 18px max(20px, env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  max-height: 85dvh; overflow-y: auto;
}
.panneau.ouvert { transform: none; }
.st { margin: 0 0 6px; font-size: 13px; color: var(--pale); }
.o {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid #ECE3D7; font-size: 17px; cursor: pointer; min-height: 48px;
}
.o:last-of-type { border-bottom: 0; }
.ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--trait-fort); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ck.on { background: var(--brique); border-color: var(--brique); }
.ck.on::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 4px; }
.c { padding: 12px 0; text-align: center; border-radius: 12px; background: var(--case); font-size: 16px; cursor: pointer; font-variant-numeric: tabular-nums; }
.c.on { background: var(--brique); color: #fff; }
.panneau .bouton { margin-top: 12px; }

/* iPhone-style time wheel */
.roue { position: relative; display: flex; justify-content: center; align-items: center; gap: 4px; height: 180px; margin: 4px 0; }
.roue .bande { position: absolute; left: 24px; right: 24px; top: 72px; height: 36px; background: var(--case); border-radius: 10px; pointer-events: none; }
.col {
  position: relative; width: 76px; height: 180px; overflow-y: scroll; scroll-snap-type: y mandatory;
  scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
}
.col::-webkit-scrollbar { display: none; }
.col div { height: 36px; line-height: 36px; text-align: center; font-size: 22px; scroll-snap-align: center; font-variant-numeric: tabular-nums; }
.col .pad { scroll-snap-align: none; }
.sep { font-size: 22px; color: var(--pale); position: relative; }
