/* KL Prépa — ce qui fait qu'une page se comporte comme une application sur un téléphone, pour toutes les mises en page
   (src/components/Pwa.astro) : les réglages tactiles communs, et l'invitation à installer l'application (/js/pwa.js).
   Les couleurs passent par les jetons de l'espace (clair et nuit) ; chaque var() porte sa valeur claire en secours,
   parce que cette feuille est aussi chargée par des pages qui n'ont pas ces jetons (connexion, accueil, tarifs). */

/* the browser's own grey flash on tap: every control has its own pressed state instead */
html { -webkit-tap-highlight-color: transparent; }
/* no double-tap zoom on controls, so a tap answers at once */
a, button, summary, label, [role="button"], [role="tab"] { touch-action: manipulation; }
/* a long press on a control does not select its label (lesson text stays selectable) */
button, summary, [role="button"], [role="tab"] { -webkit-user-select: none; user-select: none; }

/* ---------- the invitation, once, above the tab bar ---------- */
.kl-inst { position: fixed; z-index: 39; left: 10px; right: 10px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 10px; border-radius: 22px;
  background: var(--card, #fff); color: var(--ink, #0b1f44); font: 500 .9375rem/1.3 "Roundo", system-ui, sans-serif; box-shadow: 0 22px 44px -18px rgba(var(--shade-rgb, 11, 31, 68), .5), inset 0 0 0 1px rgba(var(--ink-rgb, 11, 31, 68), .06); animation: kl-inst-in .36s cubic-bezier(.2, .7, .2, 1) both; }
.kl-inst img { flex: none; width: 44px; height: 44px; border-radius: 50%; }
.kl-inst p { flex: 1; min-width: 0; margin: 0; }
.kl-inst b { display: block; font-weight: 600; }
.kl-inst small { display: block; font-size: .8125rem; color: var(--muted, #5b6885); }
.kl-inst-go { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 13px; background: var(--orange, #f5820a); color: #001a41; font: 600 .9375rem/1 "Roundo", system-ui, sans-serif; cursor: pointer; transition: transform .12s ease-out; }
.kl-inst-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--faint, #8b95ad); cursor: pointer; transition: transform .12s ease-out, background-color .12s; }
.kl-inst-go:active { transform: scale(.96); }
.kl-inst-x:active { transform: scale(.92); background: var(--soft, #f1f3f9); }
@keyframes kl-inst-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- iPhone: the three gestures, in a sheet ---------- */
.kl-ios { width: 100%; max-width: 480px; margin: auto auto 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 26px 26px 0 0; background: var(--card, #fff); color: var(--ink, #0b1f44);
  font: 500 1rem/1.4 "Roundo", system-ui, sans-serif; box-shadow: 0 -20px 50px -20px rgba(var(--navy-rgb, 0, 26, 65), .45); overscroll-behavior: contain; animation: kl-ios-in .34s cubic-bezier(.2, .7, .2, 1) both; }
.kl-ios::backdrop { background: rgba(0, 26, 65, .42); animation: kl-ios-fade .25s linear both; }
.kl-ios-grip { display: block; width: 44px; height: 5px; margin: 0 auto 16px; border-radius: 999px; background: var(--edge, #d3dbea); }
.kl-ios-head { display: flex; align-items: center; gap: 14px; }
.kl-ios-head img { flex: none; width: 52px; height: 52px; border-radius: 50%; }
.kl-ios h2 { margin: 0; font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.kl-ios-head p { margin: 2px 0 0; color: var(--muted, #5b6885); font-size: .9375rem; }
.kl-ios ol { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.kl-ios li { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--soft, #f1f3f9); }
.kl-ios li b { font-weight: 600; }
.kl-ios-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card, #fff); color: var(--sky-ink, #1b56ad); }
.kl-ios-ic.n { color: var(--ink, #0b1f44); font-weight: 600; }
.kl-ios-note { margin: 12px 2px 0; color: var(--muted, #5b6885); font-size: .875rem; }
.kl-ios-ok { width: 100%; min-height: 50px; margin-top: 16px; border: 0; border-radius: 16px; background: var(--navy, #001a41); color: #fff; font: 600 1rem/1 "Roundo", system-ui, sans-serif; cursor: pointer; transition: transform .12s ease-out; }
.kl-ios-ok:active { transform: scale(.98); }
.kl-ios :focus-visible { outline: 3px solid #f5820a; outline-offset: 2px; }
@keyframes kl-ios-in { from { transform: translateY(100%); } }
@keyframes kl-ios-fade { from { opacity: 0; } }
@media (min-width: 600px) { .kl-ios { margin: auto; padding-top: 22px; border-radius: 26px; } .kl-ios-grip { display: none; } }
@media (prefers-reduced-motion: reduce) { .kl-inst, .kl-ios, .kl-ios::backdrop { animation: none; } }
