/* Écran d'accueil Hypatie pour l'iPhone. Les jetons (couleurs, polices, clair et sombre) viennent de /socle/base.css ;
   ici, seulement ce qui est propre à l'écran : fond, verre, icônes, Dock, feuilles. */
:root {
  --verre: rgba(255, 255, 255, .62); --verre-bord: rgba(255, 255, 255, .7); --badge: #FF3B30;
  --papier: radial-gradient(120% 60% at 0% 10%, rgba(46, 125, 91, .17), transparent 60%),
            radial-gradient(90% 55% at 100% 40%, rgba(106, 75, 216, .15), transparent 60%),
            radial-gradient(110% 50% at 40% 105%, rgba(168, 87, 42, .15), transparent 60%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --verre: rgba(40, 38, 34, .62); --verre-bord: rgba(255, 255, 255, .06);
    --papier: radial-gradient(120% 60% at 0% 10%, rgba(92, 184, 142, .20), transparent 60%),
              radial-gradient(90% 55% at 100% 40%, rgba(164, 140, 242, .18), transparent 60%),
              radial-gradient(110% 50% at 40% 105%, rgba(227, 154, 107, .14), transparent 60%);
  }
}
:root[data-theme="dark"] {
  --verre: rgba(40, 38, 34, .62); --verre-bord: rgba(255, 255, 255, .06);
  --papier: radial-gradient(120% 60% at 0% 10%, rgba(92, 184, 142, .20), transparent 60%),
            radial-gradient(90% 55% at 100% 40%, rgba(164, 140, 242, .18), transparent 60%),
            radial-gradient(110% 50% at 40% 105%, rgba(227, 154, 107, .14), transparent 60%);
}
* { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
svg { flex: none; }

/* Le téléphone : tout l'écran, marges de sécurité comprises */
.tel { position: relative; height: 100%; overflow: hidden; }
.fond { position: absolute; inset: 0; background: var(--papier), var(--bg); }
.pages { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; }
.pages::-webkit-scrollbar { display: none; }
.pg { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; scrollbar-width: none;
  padding: calc(env(safe-area-inset-top) + 14px) 0 calc(env(safe-area-inset-bottom) + 150px); }
.pg::-webkit-scrollbar { display: none; }
.cadre { max-width: 430px; margin: 0 auto; }

/* Le prochain rendez-vous */
.widget { display: block; margin: 0 max(20px, calc((100% - 390px) / 2)); padding: 12px 14px 11px; border-radius: 22px; color: var(--text);
  background: var(--verre); border: 1px solid var(--verre-bord); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); }
.widget:hover { color: var(--text); }
.w-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.w-sec { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.w-dans { font-size: 12.5px; font-weight: 700; color: var(--pro); white-space: nowrap; }
.w-rdv { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.w-h { font: 700 30px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.w-t b { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-t span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-vide { margin-top: 4px; font-size: 15px; }
.w-puis { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-puis b { color: var(--text); font-weight: 600; }
.w-puis .sep::before { content: "·"; margin: 0 5px; }
.w-co { display: inline-flex; margin-top: 8px; height: 34px; align-items: center; padding: 0 14px; border-radius: 999px; background: var(--acc); color: #fff; font-weight: 600; font-size: 14px; }

/* Les icônes */
.grille { display: grid; grid-template-columns: repeat(4, 76px); justify-content: space-between; row-gap: 16px;
  width: min(100% - 34px, 356px); margin: 22px auto 0; }
.app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 76px; color: var(--text); text-decoration: none; }
.app:hover { color: var(--text); }
.ic { position: relative; width: 60px; height: 60px; display: block; transition: transform .12s, filter .12s; }
.ic > svg, .ic > img { width: 60px; height: 60px; display: block; border-radius: 13.5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ic > img { background: var(--panel); }
.dos-ic { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 13.5px; background: var(--verre);
  border: 1px solid var(--verre-bord); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.mini { display: grid; grid-template-columns: repeat(3, 13px); gap: 3px; }
.mini img, .mini i { display: block; width: 13px; height: 13px; border-radius: 3.5px; }
.app:active .ic { transform: scale(.94); filter: brightness(.88); }
.nom { max-width: 92px; margin: 0 -8px; font-size: 11.5px; font-weight: 500; line-height: 1.2; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: absolute; margin: 0; line-height: 22px; top: -6px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--badge); color: #fff; font: 600 13px/22px var(--font); text-align: center; }
.verre { fill: var(--verre); stroke: var(--verre-bord); }
.ferme .nom { color: var(--boussole); font-weight: 600; }
.cadenas { position: absolute; right: -5px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--boussole); color: #fff; border: 2px solid var(--bg); }

/* Points de page et Dock */
.points { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 112px); display: flex; justify-content: center; gap: 9px; }
.pt { width: 8px; height: 8px; border-radius: 50%; background: var(--text); opacity: .22; }
.pt.on { opacity: .75; }
.dock { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); height: 92px; max-width: 406px; margin: 0 auto;
  border-radius: 34px; display: flex; align-items: center; justify-content: space-around; padding: 0 10px;
  background: var(--verre); border: 1px solid var(--verre-bord); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); }
.dock .app { width: 60px; }

/* Le tableau de bord (page de droite) */
.tb { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.tb-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.tb-tete h1 { margin: 0; font: 600 30px/1.1 var(--font-display); letter-spacing: -.01em; }
.tb a, .tb a:hover { color: var(--text); }
.tb-tete span { font-size: 13px; font-weight: 600; color: var(--muted); }
.sec { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.jour { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 11px; }
.jour p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.carte { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.liste { padding: 2px 0; }
.ligne { display: flex; align-items: center; gap: 10px; padding: 7px 14px; min-height: 40px; color: var(--text); }
.ligne:hover { color: var(--text); }
.ligne + .ligne { border-top: 1px solid var(--line); }
.ligne .h { font: 700 14px/1 var(--font-display); font-variant-numeric: tabular-nums; width: 42px; flex: none; }
.ligne .t { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rond-c { width: 20px; height: 20px; margin: 0 11px 0 1px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.rond-c.retard { border-color: var(--late); }
.vide { padding: 12px 14px; color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; flex: none;
  background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.pro { background: var(--pro-soft); color: var(--pro); }
.pill.perso { background: var(--perso-soft); color: var(--perso); }
.pill.late { background: var(--late-soft); color: var(--late); }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chiffre { padding: 8px 12px 9px; min-width: 0; }
.c-t { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.c-v { font: 700 22px/1.15 var(--font-display); font-variant-numeric: tabular-nums; margin-top: 3px; white-space: nowrap; }
.c-m { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verrou { background: var(--boussole-soft); border-color: transparent; }
.verrou .c-t, .verrou .c-v { color: var(--boussole); }
.objectifs { padding: 12px 14px 2px; }
.obj { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.obj span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj b { font: 700 15px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jauge { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin-bottom: 12px; }
.jauge span { display: block; height: 100%; border-radius: 999px; background: var(--perso); }
.pied { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; font-size: 12.5px; color: var(--muted); }
.lien { color: var(--muted); font-weight: 600; font-size: 14px; padding: 10px 0; }

/* Les apps d'Hypatie, ouvertes dans l'écran : un cadre par app, gardé en arrière-plan ; la barre du bas ramène à l'accueil */
.cadres { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--bg); animation: ouvrir .18s ease-out; }
.cadres[hidden] { display: none; }
.cadres-zone { position: relative; flex: 1; min-height: 0; }
.cadres-zone iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; background: var(--bg); }
.cadres-zone iframe.actif { display: block; }
/* La barre du bas, au-dessus de la zone du geste d'iOS (glisser depuis le bord = quitter vers l'écran de l'iPhone) :
   « Accueil », le nom de l'app, les autres apps ouvertes. */
.retour { flex: none; display: flex; align-items: center; gap: 8px; height: calc(48px + env(safe-area-inset-bottom));
  padding: 0 12px env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); }
.r-accueil { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 15px; flex: none; }
.r-accueil:active { filter: brightness(.9); }
.r-nom { flex: 1; min-width: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-autres { display: flex; gap: 8px; flex: none; min-width: 84px; justify-content: flex-end; }
.r-autres button { display: block; width: 32px; height: 32px; }
.r-autres svg { width: 32px; height: 32px; display: block; border-radius: 8px; }
/* Le bord gauche : glisser vers la droite ramène à l'accueil, comme le retour d'une app iOS. */
.bord { position: absolute; z-index: 2; left: 0; top: 0; bottom: calc(48px + env(safe-area-inset-bottom)); width: 14px; touch-action: none; }
@keyframes ouvrir { from { opacity: 0; transform: scale(.97); } }

/* Feuilles : dossier, frein, réglages */
.voile { position: fixed; inset: 0; z-index: 10; background: rgba(20, 18, 16, .35); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.feuille { position: fixed; z-index: 11; left: 0; right: 0; bottom: 0; max-height: 92%; overflow-y: auto; background: var(--bg); color: var(--text);
  border-radius: 24px 24px 0 0; padding: 18px 20px calc(env(safe-area-inset-bottom) + 20px); box-shadow: var(--shadow-float);
  -webkit-user-select: text; user-select: text; }
.feuille[hidden], .voile[hidden] { display: none; }
.f-barre { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.f-barre h1 { margin: 0; font: 600 24px/1.2 var(--font-display); }
.f-ok { font-weight: 600; font-size: 16px; color: var(--acc); padding: 6px 0 6px 16px; }
.dossier { display: grid; grid-template-columns: repeat(4, 76px); justify-content: space-between; row-gap: 16px; padding: 6px 0 10px; }
.frein { text-align: center; padding-top: 10px; }
.frein .f-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 12px; background: var(--boussole-soft); color: var(--boussole); }
.frein h1 { margin: 0 0 8px; font: 600 24px/1.2 var(--font-display); }
.frein p { margin: 0 0 18px; color: var(--muted); }
.btn-plein, .btn-creux { display: flex; width: 100%; height: 50px; border-radius: 999px; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 16px; }
.btn-plein { background: var(--boussole); color: #fff; }
.btn-creux { margin-top: 10px; border: 1px solid var(--line); background: var(--panel); }

/* Réglages */
.reg h3 { margin: 22px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.reg h3:first-of-type { margin-top: 4px; }
.reg .liste-r { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.reg .liste-r li { display: flex; align-items: center; gap: 4px; min-height: 48px; padding-left: 14px; }
.reg .liste-r li + li { border-top: 1px solid var(--line); }
.reg .liste-r .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reg .liste-r button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.reg .liste-r button:disabled { opacity: .25; }
.reg .liste-r .retirer { color: var(--late); }
.reg .vide-r { padding: 12px 14px; color: var(--muted); }
.dos-r { margin-top: 8px; }
.dos-r summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); font-weight: 600; cursor: pointer; list-style: none; }
.dos-r summary::-webkit-details-marker { display: none; }
.dos-r summary span { color: var(--muted); font-weight: 500; }
.dos-r[open] summary { margin-bottom: 6px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix button { height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 15px; color: var(--muted); }
.choix button[aria-pressed="true"] { border-color: var(--acc); color: var(--acc); font-weight: 600; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces button { height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 15px; }
.perso-f { display: grid; gap: 10px; }
.perso-f label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.perso-f input, .heures input { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.perso-f .ajouter { justify-self: start; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--acc); color: #fff; font-weight: 600; }
.erreur { margin: 0; min-height: 1.2em; color: var(--late); font-size: 13px; }
.btn-verrou { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--boussole); color: #fff; font-weight: 600; }
.btn-verrou:hover { color: #fff; }
.aide { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.heures { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.heures label { display: flex; align-items: center; gap: 8px; }
.case { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 15px; }
.case input { width: 22px; height: 22px; accent-color: var(--acc); }

@media (prefers-reduced-motion: reduce) { .ic { transition: none; } .cadres { animation: none; } }
