@font-face { font-family: 'Gloock'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(polices/Gloock-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Gloock'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(polices/Gloock-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(polices/NunitoSans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(polices/NunitoSans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  :root {
    --rose: #F6AFA6;
    --rose-clair: #FCE7E3;
    --rose-fonce: #EE9488;
    --ardoise: #53556F;
    --ardoise-fonce: #3F4157;
    --gris: #EDEEF0;
    --gris-texte: #6B6D80;
    --texte: #212121;
    --blanc: #FFFFFF;
    --vert: #2E7D5B;
    --vert-clair: #E3F2EA;
    --alerte: #A12A1E;
    --titre: 'Gloock', Georgia, serif;
    --corps: 'Nunito Sans', 'Avenir Next', 'Segoe UI', sans-serif;
    --rayon: 14px;
    --ombre: 0 2px 10px rgba(83, 85, 111, 0.10);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; background: #F7F4F3; color: var(--texte); font: 17px/1.45 var(--corps); -webkit-text-size-adjust: 100%; }
  button, input, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  :focus-visible { outline: 3px solid var(--ardoise); outline-offset: 2px; }

  .appli { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #F7F4F3; }
  .bandeau-maquette { background: var(--ardoise); color: var(--blanc); font-size: 13px; text-align: center; padding: 6px 12px; }

  /* En-tête */
  header { background: var(--rose); color: var(--ardoise); padding: 18px 20px 20px; }
  header .marque { font-family: var(--titre); font-size: 15px; letter-spacing: .04em; opacity: .85; }
  header h1 { font-family: var(--titre); font-weight: 400; font-size: 28px; margin: 4px 0 2px; line-height: 1.15; }
  header .sous { font-size: 15px; }

  main { flex: 1; padding: 16px 16px 110px; }
  .ecran[hidden], [hidden] { display: none !important; }
  #contenu { display: contents; }
  h2 { font-family: var(--titre); font-weight: 400; font-size: 21px; color: var(--ardoise); margin: 22px 4px 10px; }
  h2:first-child { margin-top: 4px; }

  /* Cartes */
  .carte { background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; margin-bottom: 12px; }
  .carte-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .nom { font-weight: 700; font-size: 19px; }
  .pastille { display: inline-block; background: var(--rose-clair); color: var(--ardoise-fonce); border-radius: 999px; padding: 3px 11px; font-size: 14px; font-weight: 600; white-space: nowrap; }
  .pastille.attente { background: #FFF1D6; color: #7A5200; }
  .pastille.ok { background: var(--vert-clair); color: var(--vert); }
  .ligne { display: flex; gap: 8px; align-items: baseline; margin-top: 6px; color: var(--gris-texte); font-size: 15px; }
  .ligne b { color: var(--texte); font-weight: 600; }
  .message { margin-top: 10px; background: var(--gris); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
  .telephone { font-size: 17px; font-weight: 600; color: var(--ardoise); letter-spacing: .02em; }

  /* Boutons */
  .actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
  .bouton { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; border-radius: 12px; border: 0; font-weight: 700; font-size: 16px; text-decoration: none; padding: 8px 10px; text-align: center; line-height: 1.15; }
  .bouton-appel { background: var(--ardoise); color: var(--blanc); }
  .bouton-appel:active { background: var(--ardoise-fonce); }
  .bouton-fait { background: var(--gris); color: var(--ardoise-fonce); }
  .bouton-rdv { background: var(--rose); color: var(--ardoise-fonce); }
  .bouton-large { width: 100%; }
  .bouton-secondaire { background: var(--blanc); color: var(--ardoise); border: 2px solid var(--ardoise); }
  .lien { background: none; border: 0; color: var(--ardoise); text-decoration: underline; font-weight: 600; padding: 8px 0; }
  svg.ic { width: 20px; height: 20px; flex: none; }

  /* Résumé */
  .resume { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .resume .carte { margin: 0; padding: 14px; }
  .resume .chiffre { font-family: var(--titre); font-size: 34px; color: var(--ardoise); line-height: 1; }
  .resume .legende { font-size: 14px; color: var(--gris-texte); margin-top: 4px; }

  .vide { text-align: center; padding: 26px 16px; color: var(--gris-texte); }
  .vide .grand { font-family: var(--titre); font-size: 22px; color: var(--ardoise); margin-bottom: 6px; }

  details.replie { margin-top: 4px; }
  details.replie summary { list-style: none; cursor: pointer; color: var(--ardoise); font-weight: 600; padding: 10px 4px; }
  details.replie summary::-webkit-details-marker { display: none; }
  .carte.faite { opacity: .75; padding: 12px 16px; }

  /* Recherche */
  .recherche { position: relative; margin-bottom: 14px; }
  .recherche input { width: 100%; min-height: 54px; border-radius: 14px; border: 2px solid #D9D6DE; background: var(--blanc); padding: 12px 16px 12px 46px; font-size: 17px; }
  .recherche input:focus { border-color: var(--ardoise); outline: none; }
  .recherche svg { position: absolute; left: 15px; top: 17px; width: 20px; height: 20px; color: var(--gris-texte); }
  .filtres { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
  .filtre { border: 2px solid var(--ardoise); background: var(--blanc); color: var(--ardoise); border-radius: 999px; padding: 6px 14px; min-height: 40px; font-weight: 600; font-size: 15px; white-space: nowrap; }
  .filtre[aria-pressed="true"] { background: var(--ardoise); color: var(--blanc); }

  .cliente { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 12px 14px; margin-bottom: 10px; }
  .initiales { width: 46px; height: 46px; border-radius: 50%; background: var(--rose-clair); color: var(--ardoise); display: grid; place-items: center; font-family: var(--titre); font-size: 18px; flex: none; }
  .cliente .infos { flex: 1; min-width: 0; }
  .cliente .infos .sous-ligne { font-size: 14px; color: var(--gris-texte); }
  .cliente .appel-rond { width: 48px; height: 48px; border-radius: 50%; background: var(--ardoise); color: var(--blanc); display: grid; place-items: center; flex: none; }

  /* Fiche */
  .retour { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--ardoise); font-weight: 700; padding: 8px 0; margin-bottom: 6px; }
  .fiche-tete { text-align: center; padding: 6px 0 14px; }
  .fiche-tete .initiales { width: 72px; height: 72px; font-size: 28px; margin: 0 auto 10px; }
  .fiche-tete .nom { font-size: 23px; font-family: var(--titre); font-weight: 400; }
  .champ { padding: 12px 0; border-bottom: 1px solid var(--gris); }
  .champ:last-child { border-bottom: 0; }
  .champ .etiquette { font-size: 14px; color: var(--gris-texte); }
  .champ .valeur { font-weight: 600; }
  .choix { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  .note { font-size: 14px; color: var(--gris-texte); background: var(--gris); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }

  /* Assistant */
  textarea { width: 100%; min-height: 96px; border-radius: 12px; border: 2px solid #D9D6DE; padding: 12px; font-size: 16px; resize: vertical; background: var(--blanc); }
  textarea:focus { border-color: var(--ardoise); outline: none; }
  .saisie { width: 100%; min-height: 52px; border-radius: 12px; border: 2px solid #D9D6DE; background: var(--blanc); padding: 10px 14px; font-size: 17px; margin-top: 6px; }
  .saisie:focus { border-color: var(--ardoise); outline: none; }
  #ajouter-cliente { margin-bottom: 14px; }
  .intro-assistant { margin: 0 4px 12px; color: var(--gris-texte); font-size: 15px; }
  .aide { font-size: 14px; color: var(--gris-texte); margin-top: 6px; }
  .question { font-weight: 700; font-size: 18px; }
  .rubrique-texte { font-size: 15px; white-space: pre-line; color: var(--texte); }

  /* Barre d'onglets */
  nav.onglets { position: fixed; bottom: 0; left: 0; right: 0; background: var(--blanc); box-shadow: 0 -2px 12px rgba(83, 85, 111, .12); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
  nav.onglets .interieur { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
  nav.onglets button { background: none; border: 0; min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--gris-texte); font-size: 14px; font-weight: 600; position: relative; }
  nav.onglets button[aria-current="page"] { color: var(--ardoise); }
  nav.onglets button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 4px; border-radius: 0 0 4px 4px; background: var(--rose-fonce); }
  nav.onglets svg { width: 26px; height: 26px; }
  .badge { position: absolute; top: 8px; left: calc(50% + 6px); background: var(--alerte); color: var(--blanc); border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }
  .badge:empty, .badge[data-n="0"] { display: none; }

  /* Message éphémère */
  .toast { position: fixed; left: 16px; right: 16px; bottom: 86px; max-width: 448px; margin: 0 auto; background: var(--texte); color: var(--blanc); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; z-index: 10; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
  .toast.visible { opacity: 1; visibility: visible; transform: translateY(0); }
  .toast button { background: none; border: 0; color: var(--rose); font-weight: 700; padding: 6px; }

  /* Code d'accès */
  .acces { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; text-align: center; background: var(--rose); color: var(--ardoise); }
  .acces .marque { font-family: var(--titre); font-size: 30px; line-height: 1.1; }
  .acces p { margin: 8px 0 22px; }
  .points { display: flex; gap: 14px; justify-content: center; margin-bottom: 24px; }
  .points span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ardoise); }
  .points span.plein { background: var(--ardoise); }
  .clavier { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
  .clavier button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(255,255,255,.65); color: var(--ardoise-fonce); font-size: 28px; font-family: var(--titre); }
  .clavier button:active { background: var(--blanc); }
  .acces .erreur { color: var(--alerte); min-height: 22px; font-weight: 600; }
  .chargement { text-align: center; color: var(--gris-texte); padding: 30px 0; }
  .rubrique-texte ul { margin: 6px 0; padding-left: 20px; }
  .rubrique-texte p { margin: 6px 0; }
  .rubrique-texte table { border-collapse: collapse; font-size: 14px; margin: 6px 0; }
  .rubrique-texte td, .rubrique-texte th { border-bottom: 1px solid var(--gris); padding: 4px 6px; text-align: left; vertical-align: top; }
  .rubrique-texte { white-space: normal; }
  .inactive { opacity: .55; }
  .rubrique-titre { flex: 1; background: none; border: 0; padding: 4px 0; text-align: left; font-weight: 700; font-size: 17px; color: var(--texte); display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; }
  .rubrique-titre::after { content: "›"; font-size: 24px; color: var(--ardoise); transition: transform .15s; }
  .rubrique-titre[aria-expanded="true"]::after { transform: rotate(90deg); }
