/* =============================================================================
   AURYVO Business — version mobile (iPhone, Android), façon application iOS 26.
   Chargée seulement sous 820 px de large (<link media="(max-width: 820px)"> dans index.html) :
   l'ordinateur n'est jamais touché. Elle prend le pas sur les anciens blocs « max-width: 820px » d'app.css.

   Langage
   - Nouvelle identité (passe 2) : toile grise #ECEDEF / #0E0F12, panneaux blancs, action principale en pilule noire,
     accent bleu #0071E3 (liens, sélection, scan), alerte rouge. Plus aucun jaune.
   - Grands titres qui se replient dans la barre de navigation, listes groupées, cellules, cibles ≥ 44 px.
   - « Verre liquide » réservé à ce qui flotte au-dessus du contenu : barre de navigation, barre d'onglets,
     Sophystia, menus, notifications. Flou + saturation + reflet sur l'arête ; il grossit et s'éclaire sous le doigt.
   - Coins continus (squircle) par clip-path: shape(), qui marche dans Safari 18.4+ et Chrome 135+ :
     ce qu'on voit dans Chrome est ce que voit l'iPhone. Sans shape(), coins arrondis classiques.
   ============================================================================= */

/* ---------- couleurs : sombre (nouvelle identité du 01/12 : mêmes jetons que l'ordinateur, langage iOS) ---------- */
:root {
  --bg: #0E0F12;
  --bg-glow: transparent;
  --panel: #141518;
  --panel-line: transparent;
  --card: #1A1B1F;
  --card-2: #232429;
  --card-3: #2C2D33;
  --field: rgba(255, 255, 255, .08);
  --ink: #F5F5F7;
  --ink-2: #D1D1D6;
  --ink-3: #9C9CA3;
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .16);
  --verre: rgba(28, 29, 34, .55);
  --verre-fort: rgba(28, 29, 34, .82);
  --verre-arete: rgba(255, 255, 255, .22);
  --verre-arete-2: rgba(255, 255, 255, .08);
  --verre-ombre: 0 10px 30px -10px rgba(0, 0, 0, .65), 0 2px 8px -2px rgba(0, 0, 0, .4);
  --bulle: rgba(255, 255, 255, .16);   /* onglet ouvert : bulle grise dans le verre, pas de pastille pleine */
  --surbrillance: rgba(255, 255, 255, .07);
  --teinte: #3B9BFF;
  --rouge: #FF5A5F;
  --ressort: cubic-bezier(.3, 1.45, .45, 1);
  --ressort-doux: cubic-bezier(.32, .72, 0, 1);
  --sq-carte: 34px;
}
/* ---------- couleurs : clair (toile froide, panneaux blancs) ---------- */
:root[data-theme="light"] {
  --bg: #ECEDEF;
  --panel: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #F3F4F6;
  --card-3: #E8E9EC;
  --field: #F3F4F6;
  --ink: #0B0B0F;
  --ink-2: #33333A;
  --ink-3: #5B5B63;
  --line: #DCDDE1;
  --line-2: #CDCED3;
  --verre: rgba(255, 255, 255, .62);
  --verre-fort: rgba(255, 255, 255, .86);
  --verre-arete: rgba(255, 255, 255, .95);
  --verre-arete-2: rgba(255, 255, 255, .4);
  --verre-ombre: 0 10px 30px -10px rgba(16, 24, 40, .22), 0 2px 8px -2px rgba(16, 24, 40, .08), inset 0 0 0 .5px rgba(16, 24, 40, .06);
  --bulle: rgba(11, 11, 15, .09);
  --surbrillance: rgba(11, 11, 15, .05);
  --teinte: #0071E3;
  --rouge: #E5484D;
}

/* ---------- base ---------- */
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { font-size: 15px; background: var(--bg); background-image: none; background-attachment: scroll;
  overscroll-behavior-y: auto; -webkit-tap-highlight-color: transparent; }
html.feuille-ouverte, html.feuille-ouverte body { overflow: hidden; }
a, button, label, .tab-item, .ligne, .raccourci, .t-lien { touch-action: manipulation; }
.topbar, .tabbar, .btn, .tab, .subnav, .ligne, .raccourci, .plus-identite, .compositeur, .nav-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.m-cache, .m-txt { display: none !important; }
.tabbar a, .tabbar img, .nav-btn, .ligne, .raccourci, .plus-identite { -webkit-user-drag: none; }
/* symboles (js/symboles.js) */
.sym { display: block; width: 24px; height: 24px; flex-shrink: 0; }
.shell { display: block; }
.main { padding: 0 16px calc(118px + env(safe-area-inset-bottom)); }
.rail, .navpill, .hdr-reglages, .ro-pill, .wordmark { display: none !important; }

/* ---------- coins continus (squircle) ---------- */
/* --sq : étendue de la courbe (≈ 1,53 × le rayon apparent, comme les coins continus d'Apple) */
:is(.card, .kpi, .task, .reply, .ask, .modal, .pop, .input, .sel-btn, .dp-txt, textarea.input, .demo-banner, .groupe,
    .plus-identite, .raccourci, .monogramme, .lines .line, .totals, .compositeur, .comp-ligne, .empty-card, .plein-ecran .pe-carte, aside#visite) {
  --sqc: calc(var(--sq, 30px) * .18);
  border-radius: calc(var(--sq, 30px) / 1.53);
}
@supports (clip-path: shape(from 0 0, line to 1px 1px)) {
  :is(.card, .kpi, .task, .reply, .ask, .modal, .pop, .input, .sel-btn, .dp-txt, textarea.input, .groupe,
      .plus-identite, .raccourci, .monogramme, .lines .line, .totals, .compositeur, .comp-ligne, aside#visite) {
    clip-path: shape(from 0 var(--sq, 30px),
      curve to var(--sq, 30px) 0 with 0 var(--sqc) / var(--sqc) 0,
      hline to calc(100% - var(--sq, 30px)),
      curve to 100% var(--sq, 30px) with calc(100% - var(--sqc)) 0 / 100% var(--sqc),
      vline to calc(100% - var(--sq, 30px)),
      curve to calc(100% - var(--sq, 30px)) 100% with 100% calc(100% - var(--sqc)) / calc(100% - var(--sqc)) 100%,
      hline to var(--sq, 30px),
      curve to 0 calc(100% - var(--sq, 30px)) with var(--sqc) 100% / 0 calc(100% - var(--sqc)),
      close);
  }
}

/* ---------- verre liquide ---------- */
.onglets, .tab-soph, .nav-btn, .topbar .nav-retour, .menu-ios, .toast, .compositeur, .modal-bg.alerte .modal {
  background: var(--verre);
  -webkit-backdrop-filter: blur(24px) saturate(1.9); backdrop-filter: blur(24px) saturate(1.9);
  box-shadow: var(--verre-ombre);
}
/* arête : reflet clair en haut à gauche et en bas à droite, comme une lentille */
.onglets::before, .tab-soph::before, .nav-btn::before, .topbar .nav-retour::before, .toast::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 3;
  background: linear-gradient(150deg, var(--verre-arete), var(--verre-arete-2) 28%, transparent 46%, transparent 62%, var(--verre-arete-2) 82%, var(--verre-arete));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* sous le doigt : la pièce grossit et s'éclaire à l'endroit touché */
.tab-soph::after, .nav-btn::after, .topbar .nav-retour::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; z-index: 2;
  background: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%), rgba(255, 255, 255, .55), transparent 62%);
  transition: opacity .35s;
}
.presse::after { opacity: 1; transition-duration: .08s; }
.tab-soph, .nav-btn, .topbar .nav-retour { transition: transform .45s var(--ressort), opacity .2s, background .2s; }
.presse { transform: scale(1.1); transition-duration: .18s; }

/* =============================================================================
   BARRE DE NAVIGATION — grand titre dans la page, petit titre centré quand on défile
   ============================================================================= */
.topbar { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 0 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  flex-wrap: nowrap; }
/* bord de défilement : le contenu se fond et se floute sous la barre (pas de trait) */
.topbar::before { content: ""; position: absolute; inset: 0 0 -22px; z-index: -1; pointer-events: none; opacity: 0; border: 0; box-shadow: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 55%, transparent) 72%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.5); backdrop-filter: blur(10px) saturate(1.5);
  -webkit-mask-image: linear-gradient(#000 64%, transparent); mask-image: linear-gradient(#000 64%, transparent);
  transition: opacity .25s; }
.topbar.defile::before { opacity: 1; border: 0; box-shadow: none; }
.topbar .nav-retour { grid-column: 1; justify-self: start; position: relative; display: none; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; padding: 0; }
.topbar.a-retour .nav-retour { display: grid; }
.topbar .nav-retour .sym { width: 23px; height: 23px; margin-left: -2px; position: relative; z-index: 4; }
.topbar .nav-retour:has(.nav-retour-t:not(:empty)) { width: auto; max-width: 42vw; border-radius: 22px; padding: 0 16px 0 10px; grid-auto-flow: column; gap: 4px; }
.topbar .nav-retour-t { position: relative; z-index: 4; font: 600 15.5px/1 var(--text); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .nav-retour-t:empty { display: none; }
.topbar.titre-on .nav-retour-t { display: none; }
.topbar.titre-on .nav-retour { width: 44px; padding: 0; border-radius: 50%; }
.topbar .nav-titre { grid-column: 2; display: block; max-width: 56vw; overflow-wrap: anywhere;   /* titre long : deux lignes, jamais « … » */
  font: 700 16px/1.15 var(--text); letter-spacing: -.01em; text-align: center; opacity: 0; transform: translateY(5px);
  transition: opacity .2s, transform .3s var(--ressort-doux); }
.topbar.titre-on .nav-titre { opacity: 1; transform: none; }
/* titre masqué (haut de page) : il ne prend aucune place, le bouton retour garde son libellé entier */
.topbar:not(.titre-on) .nav-titre { width: 0; height: 0; overflow: hidden; }
.topbar .hdr-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; margin: 0; }
.topbar .nav-actions { display: flex; gap: 8px; }
.topbar .nav-actions:empty { display: none; }
.nav-btn { position: relative; height: 44px; min-width: 44px; border: 0; border-radius: 999px; color: var(--ink); cursor: pointer;
  display: inline-grid; place-items: center; padding: 0; font: 700 15px var(--text); }
.nav-btn.texte { padding: 0 18px; }
.nav-btn.fort { background: var(--black); color: var(--on-black); -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav-btn.fort::before { opacity: .5; }
.nav-btn .sym { width: 21px; height: 21px; position: relative; z-index: 4; }
.nav-btn:disabled { opacity: .4; }
/* avatar : sur les pages racines seulement (comme l'App Store) ; ailleurs la place va au retour et aux actions */
.topbar .avatar { width: 40px; height: 40px; font-size: 14px; position: relative; overflow: hidden; border: 0; box-shadow: none; transition: transform .45s var(--ressort), opacity .2s; }
.topbar.sans-avatar .hdr-right > div:has(> .avatar) { display: none; }
.topbar.a-retour .hdr-right > div:has(> .avatar) { display: none; }
#account-menu { display: none !important; }

/* grands titres */
.page-head { display: block; margin: 2px 0 18px; }
.page-head h1, .hello h1 { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -.028em; line-height: 1.08; margin: 0; }
.page-head p { font-size: 15px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 0; }
.page-head .eyebrow { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; text-transform: none; margin-bottom: 4px; display: block; }
.page-head a.eyebrow[href^="#/"] { display: none; }           /* remplacé par le bouton retour de la barre */
/* actions de la page : toutes visibles, sur plusieurs lignes au besoin (jamais de rangée qui défile de côté) */
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; margin: 14px 0 0; padding: 0; }
.page-head .actions:not(:has(> :not(.m-cache))) { display: none; }
.page-head .actions .btn { flex: 1 1 auto; justify-content: center; height: 38px; padding: 0 15px; font-size: 14px; }
.page-head .actions .btn-ghost { background: var(--field); color: var(--ink); }
.page-head .meta { margin-top: 10px; }
.hello { margin: 4px 0 18px; }
.hello p { font-size: 16px; line-height: 1.45; margin-top: 6px; }
.hello .eyebrow, .hello small, .hello > div:first-child:not(:has(h1)) { font-size: 13px; font-weight: 600; color: var(--ink-3); }

/* bandeau de démonstration : une seule ligne discrète */
#demo-banner:empty { display: none; }
.demo-banner { --sq: 26px; display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; margin: 0 0 14px; padding: 5px;
  background: var(--verre); -webkit-backdrop-filter: var(--verre-flou, blur(20px) saturate(160%)); backdrop-filter: var(--verre-flou, blur(20px) saturate(160%));
  border: 0; box-shadow: var(--verre-filet, var(--sh-pill)); font-size: 13px; border-radius: var(--pill) !important; clip-path: none !important; }
.demo-banner .tag { height: 38px; padding: 0 14px; font-size: 12.5px; border-radius: var(--pill); }   /* 5 px tout autour : rayon intérieur = 16 − 5 */
.demo-banner > span:not(.tag) { flex: 1; min-width: 0; font-size: 0; white-space: nowrap; overflow: hidden; }
.demo-banner > span:not(.tag) b { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.demo-banner .actions { width: auto; margin: 0; display: flex; gap: 4px; flex-shrink: 0; }
.demo-banner .btn { height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: var(--pill); }
.demo-banner .btn-ghost { width: 34px; padding: 0; color: var(--ink-2); background: var(--field); }
.demo-banner .sym.m-seul { display: block; width: 17px; height: 17px; }

/* =============================================================================
   BARRE D'ONGLETS — capsule de verre flottante + Sophystia dans son propre rond (iOS 26)
   ============================================================================= */
.tabbar { position: fixed; z-index: 60; left: 14px; right: 14px; bottom: max(12px, calc(env(safe-area-inset-bottom) - 8px)); height: auto;
  display: flex; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; grid-template-columns: none;
  transition: transform .45s var(--ressort-doux), opacity .25s; }
:root[data-theme="light"] .tabbar { background: none; }
html.clavier .tabbar { transform: translateY(140%); opacity: 0; pointer-events: none; }
.onglets { position: relative; flex: 1; min-width: 0; height: 64px; border-radius: 999px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px; touch-action: none; transition: height .45s var(--ressort-doux); }
.onglet-bulle { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--bulle); pointer-events: none; }
.onglets.prete .onglet-bulle { transition: transform .55s var(--ressort), width .45s var(--ressort), top .3s, bottom .3s, background .25s; }
.onglets.glisse .onglet-bulle { transition: transform .12s linear, top .3s, bottom .3s; top: 0; bottom: 0;
  background: var(--bulle); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .3); }
.tab-item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; height: 56px; border: 0; background: none; border-radius: 999px; color: var(--ink-2); font: 600 10.5px/1 var(--text);
  letter-spacing: .005em; transition: color .2s, transform .35s var(--ressort); }
.tab-item span { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s, max-height .3s; max-height: 14px; }
.tab-item .sym { width: 26px; height: 26px; transition: transform .35s var(--ressort); }
.tab-item.on { color: var(--ink); }
.tab-item.on .sym { transform: scale(1.04); }
.tab-item:active, .tab-item.survol { transform: scale(1.06); }
.onglets.glisse .tab-item.survol { color: var(--ink); }
.tab-soph { position: relative; flex-shrink: 0; width: 64px; height: 64px; margin: 0; border: 0; border-radius: 50%; padding: 5px; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--verre-ombre); }
.tab-soph img { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; display: block;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 16px -2px color-mix(in srgb, var(--accent) 55%, transparent); }
.tab-soph:active { transform: scale(1.08); }
/* barre toujours fine, symboles seuls (le nom de chaque onglet reste lu par VoiceOver) */
.tabbar .onglets { height: 52px; }
.tabbar .tab-item { height: 44px; gap: 0; }
.tabbar .tab-item span { opacity: 0; max-height: 0; text-overflow: clip; }   /* nom masqué (lu par VoiceOver) : jamais de « … » */
.tabbar .tab-soph { width: 52px; height: 52px; padding: 4px; }
.tab-soph { transition: width .45s var(--ressort-doux), height .45s var(--ressort-doux), transform .45s var(--ressort); }

/* =============================================================================
   SOPHYSTIA — feuille de saisie (bouton rond de la barre d'onglets)
   ============================================================================= */
.compositeur-fond { position: fixed; inset: 0; z-index: 320; background: rgba(0, 0, 0, 0); transition: background .3s; }
.compositeur-fond.on { background: rgba(0, 0, 0, .3); }
.compositeur { --sq: 50px; position: absolute; left: 8px; right: 8px; bottom: calc(max(8px, env(safe-area-inset-bottom) - 14px) + var(--clavier, 0px));
  padding: 14px 14px 16px; background: var(--verre-fort); transform: translateY(calc(100% + 40px)); transition: transform .5s var(--ressort-doux), bottom .25s; }
.compositeur-fond.on .compositeur { transform: none; }
.compositeur-fond.sortie .compositeur { transform: translateY(calc(100% + 40px)); transition-duration: .3s; }
.comp-tete { display: flex; align-items: center; gap: 12px; padding: 2px 2px 12px; }
.comp-tete img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--accent); }
.comp-tete div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.comp-tete b { font: 700 16px var(--text); }
.comp-tete small { font-size: 12.5px; color: var(--ink-2); }
.comp-fermer { width: 36px; height: 36px; min-width: 36px; }
.comp-fermer .sym { width: 17px; height: 17px; }
.comp-ligne { --sq: 30px; display: flex; align-items: center; gap: 6px; background: var(--field); padding: 5px 5px 5px 16px; }
.comp-ligne input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: none; font: 500 16px var(--text); color: var(--ink); }
.comp-ligne input::placeholder { color: var(--ink-3); }
.comp-envoi { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--black); color: var(--on-black); display: grid; place-items: center; cursor: pointer;
  transition: transform .4s var(--ressort); }
.comp-envoi:active { transform: scale(.9); }
.comp-envoi .sym { width: 20px; height: 20px; }
.comp-idees { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; margin: 12px 0 0; padding: 0; }
.comp-idees button { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--field); color: var(--ink);
  font: 600 13.5px var(--text); cursor: pointer; }
.comp-idees button:active { background: var(--card-3); }

/* =============================================================================
   CONTENU — cartes, groupes, KPI
   ============================================================================= */
.card { --sq: var(--sq-carte); background: var(--card); border: 0; box-shadow: var(--sh-card); }
.card:hover, .task:hover, a.kpi:hover { transform: none; }
.card-head { padding: 16px 16px 4px; }
.card-head h2, .card-head h3 { font-family: var(--text); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card-head a.small, .card-head > a { flex-shrink: 0; white-space: nowrap; border: 0; padding: 6px 0; color: var(--teinte); font-size: 14px; background: none; }
.card-body { padding: 10px 16px 16px; }
.card-body.tight { padding: 4px 0; }
.block { margin-top: 30px; }
.block-head { margin: 0 2px 10px; }
.block-head h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.block-head a { border: 0; padding: 6px 0; font-size: 15px; font-weight: 600; color: var(--teinte); background: none; }
.grid { gap: 10px; }
.g-2, .g-3, .g-main, .g-editor, .block.two, .form-grid, .cards { grid-template-columns: minmax(0, 1fr); }
.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g-3:has(> .kpi:nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g-3:has(> .kpi:nth-child(3):last-child) > .kpi:last-child { grid-column: 1 / -1; }
.mb { margin-bottom: 14px; }

.kpi { --sq: 30px; padding: 14px 15px 15px; background: var(--card); border: 0; box-shadow: var(--sh-card); }
.kpi-label { font-size: 13px; color: var(--ink-3); }
.kpi-value { font-size: 27px; font-weight: 700; margin: 10px 0 2px; letter-spacing: -.03em; }
.kpi-value .u { font-size: 14px; }
.kpi-sub { font-size: 12.5px; padding-right: 0; }
.kpi .ring { width: 30px; height: 30px; right: 12px; top: 12px; }
a.kpi:active, .task:active { transform: scale(.985); transition: transform .15s; }

/* badges */
.badge { font-size: 12px; padding: 4px 10px 4px 8px; }

/* =============================================================================
   BOUTONS, CHAMPS, INTERRUPTEURS
   ============================================================================= */
.btn { height: 48px; padding: 0 20px; font-size: 15.5px; font-weight: 650; transition: transform .25s var(--ressort), opacity .15s, background .2s; }
.btn:hover:not(:disabled) { transform: none; box-shadow: none; }
.btn:active:not(:disabled) { transform: scale(.96); opacity: .82; transition-duration: .08s; }
.btn-primary::after, .btn-lime::after { display: none; }
.btn-sm { height: 38px; padding: 0 15px; font-size: 14px; }
/* un libellé long passe à la ligne au lieu d'être coupé (petits iPhone) */
.btn-sm { max-width: 100%; height: auto; min-height: 38px; padding-top: 7px; padding-bottom: 7px; white-space: normal; text-align: center; line-height: 1.25; }
.btn-secondary { background: var(--card); border-color: var(--line-2); }
.btn-ghost { color: var(--teinte); }
.icon-btn { width: 44px; height: 44px; border: 0; background: var(--field); color: var(--ink); }
.icon-btn:hover { transform: none; }

.field { gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.input, select.input, textarea.input, .sel-btn, .dp-txt { --sq: 20px; height: 48px; font-size: 16px; border: 0; background: var(--field); box-shadow: none; }
textarea.input { --sq: 24px; height: auto; min-height: 96px; padding-top: 13px; }
.input.sm { --sq: 18px; height: 42px; font-size: 16px; }
.input:focus, .sel-btn:focus-visible, .dp-txt:focus { background: var(--field); box-shadow: inset 0 0 0 2px var(--teinte); border-color: transparent; }
.page-head h1, .hello h1 { color: var(--ink); }
.input:hover { border-color: transparent; }
.field .hint { font-size: 12.5px; padding-left: 4px; }
.field-err { padding-left: 4px; }
.switch { width: 51px; height: 31px; }
.switch span { background: rgba(120, 120, 128, .32); }
.switch span::before { width: 27px; height: 27px; left: 2px; top: 2px; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); }
.switch input:checked + span { background: var(--accent-fort); }
.switch input:checked + span::before { transform: translateX(20px); }
.check { min-height: 44px; }

/* contrôle segmenté : rail gris, segment ouvert blanc ombré (sombre : gris plus clair). Jamais de pilule noire.
   Toute la largeur, segments égaux ; passe à la ligne plutôt que de défiler. */
.seg, .segment { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding: 3px; border: 0; border-radius: var(--pill); background: var(--card-3); gap: 2px 0; }
.seg button, .segment button { flex: 1 1 auto; justify-content: center; height: 34px; padding: 0 12px; border-radius: var(--pill); font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.active, .segment button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .seg button.active, :root:not([data-theme="light"]) .segment button.on { background: #3A3B42; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.row:has(> .seg) { width: 100%; }

/* sous-rubriques d'un onglet (Vue d'ensemble / Clients / Résultat / Bilan) : le même contrôle segmenté gris.
   Tout reste visible : passe à la ligne au besoin, jamais de défilement latéral. */
.subnav { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px 0; margin: 0 0 18px; padding: 3px; background: var(--card-3); border: 0; border-radius: var(--pill); }
.subnav a { position: relative; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--pill);
  background: transparent; box-shadow: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; transition: color .2s, background .2s; }
.subnav a:hover { transform: none; background: transparent; }
.subnav a:active { background: color-mix(in srgb, var(--card) 60%, transparent); }
.subnav a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .subnav a.active { background: #3A3B42; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.subnav a.active::after { content: none; }
/* quatre sous-rubriques : deux par ligne, de largeur égale (jamais une seule orpheline en dessous) */
/* comme Apple : un sélecteur segmenté reste sur une ligne (capsule) et défile s'il déborde, jamais sur deux lignes */
.seg::-webkit-scrollbar, .segment::-webkit-scrollbar, .subnav::-webkit-scrollbar { display: none; }
.seg > *, .segment > *, .subnav > a { flex-shrink: 0; }
.subnav .count { font-size: 12px; font-weight: 600; opacity: .7; margin-left: 0; }

/* filtres d'une liste : rectangles arrondis (pas de pilule), sur plusieurs lignes au besoin */
.tabs { flex-wrap: wrap; overflow: visible; gap: 8px; margin: 0 0 14px; padding: 0; }
.tab { flex-shrink: 0; height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--pill); background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.tab.active { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 3px rgba(16, 24, 40, .10); }
.tab:hover { transform: none; }

/* =============================================================================
   LISTES — les tableaux deviennent des cellules iOS dans un groupe
   ============================================================================= */
.table-wrap { overflow: visible; }
table.t, .t tbody, .t tr, .t td { display: block; width: 100%; }
.t thead { display: none; }
.t tbody tr { position: relative; background: none; border-radius: 0; margin: 0; padding: 11px 16px; }
.t tbody tr + tr::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--line-2); }
.t tbody tr td { border: 0 !important; padding: 3px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; background: none !important; }
.t tbody tr td::before { content: attr(data-label); color: var(--ink-2); font-size: 13px; font-weight: 500; text-align: left; flex-shrink: 0; }
.t tbody tr td:not([data-label])::before, .t tbody tr td[data-label=""]::before { content: none; }
.t tbody tr td:first-child { font-weight: 650; font-size: 15.5px; }
.t tbody tr.t-plein { padding: 0; }
.t tbody tr.t-plein td { display: block; text-align: center; }
.t tbody tr.t-plein td::before { content: none; }
.click:active, .t-lien:active, tr[data-lien]:active { background: var(--surbrillance) !important; }

/* cellules : titre + sous-titre à gauche ; montant + statut à droite ; chevron si la ligne s'ouvre */
table.t-cellules tbody tr:not(.t-plein) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "titre montant" "titre statut" "action action";
  column-gap: 12px; row-gap: 3px; align-items: center; min-height: 60px; padding: 11px 16px; }
table.t-cellules tbody tr.t-lien { grid-template-columns: minmax(0, 1fr) auto 10px; grid-template-areas: "titre montant chev" "titre statut chev" "action action action"; padding-right: 12px; }
table.t-cellules tbody tr.t-lien::after { content: ""; grid-area: chev; align-self: center; width: 8px; height: 13px; background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1.5 1.5 6.5 6.5 1.5 11.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1.5 1.5 6.5 6.5 1.5 11.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
table.t-cellules tbody tr + tr::before { left: 16px; }
table.t-cellules tbody td { display: block !important; padding: 0 !important; text-align: left; min-width: 0; }
table.t-cellules tbody td::before { content: none !important; }
table.t-cellules td[data-m="titre"] { grid-area: titre; align-self: center; font-size: 16px; font-weight: 650; line-height: 1.3; overflow: hidden; }
table.t-cellules td[data-m="titre"] > :first-child, table.t-cellules td[data-m="titre"] { overflow-wrap: anywhere; }
table.t-cellules td[data-m="titre"] .xs, table.t-cellules td[data-m="titre"] .faint, table.t-cellules td[data-m="titre"]::after {
  overflow-wrap: anywhere; display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-top: 2px; }
table.t-cellules td[data-m="titre"]::after { content: attr(data-sous); }
table.t-cellules td[data-m="titre"][data-sous=""]::after { content: none; }
table.t-cellules td[data-m="titre"] .badge { display: none; }
table.t-cellules td[data-m="montant"] { grid-area: montant; text-align: right; font-size: 16px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; align-self: end; }
table.t-cellules td[data-m="statut"], table.t-cellules td[data-m="statut2"] { grid-area: statut; justify-self: end; align-self: start; white-space: nowrap; }
table.t-cellules td[data-m="statut2"] { grid-area: montant; align-self: end; }
table.t-cellules tr:has(td[data-m="statut2"]) td[data-m="statut"] { grid-area: statut; }
table.t-cellules td[data-m="statut"] .badge, table.t-cellules td[data-m="statut2"] .badge { font-size: 11.5px; padding: 3px 9px 3px 7px; }
table.t-cellules td[data-m="sous"], table.t-cellules td[data-m="sous+"], table.t-cellules td[data-m="cache"] { display: none !important; }
table.t-cellules td[data-m="action"] { grid-area: action; display: flex !important; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
table.t-cellules td[data-m="action"]:empty, table.t-cellules td[data-m="action"]:not(:has(*)) { display: none !important; }
table.t-cellules td[data-m="action"]:has(*) { margin-top: 8px; }
table.t-cellules td[data-m="action"] .btn { height: 34px; padding: 0 14px; font-size: 13.5px; }
.card-body.tight.table-wrap > .row, .card-body.tight > .row.between { padding: 12px 16px !important; border-top: .5px solid var(--line-2) !important; }

/* =============================================================================
   ACCUEIL — Sophystia et « À valider »
   ============================================================================= */
.ask { --sq: 40px; padding: 16px; box-shadow: none; }
.ask::before { animation-duration: 10s; }
.ask-k { margin-bottom: 12px; }
.ask-qui .faint { display: none; }
.ask-row { padding: 4px 4px 4px 16px; }
.ask-row input { font-size: 16px; height: 44px; }
.ask-btn { width: 44px; height: 44px; }
.ask-btn:hover { transform: none; }
.ask-chips { flex-wrap: wrap; overflow: visible; margin: 12px 0 0; padding: 0; }
.ask-chips .glass-chip { flex-shrink: 0; padding: 9px 14px; font-size: 13.5px; }
.ask-drop, .ask-soph { display: none; }
.reply { --sq: var(--sq-carte); border: 0; box-shadow: var(--sh-card); padding: 16px; }

.cards { gap: 10px; }
.task { --sq: var(--sq-carte); padding: 16px; gap: 6px; border: 0; background: var(--card); box-shadow: var(--sh-card); }
.task.ordo { border: 0; }
.task.ok { background: var(--card); }
.task-t { font-family: var(--text); font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.task-x { font-size: 14.5px; line-height: 1.5; }
.task-a { gap: 8px; padding-top: 8px; }
.task-a .btn { flex: 1; height: 44px; font-size: 15px; }
.task-a .btn-ghost { background: var(--field); color: var(--ink); }
.pill-n { height: 26px; font-size: 13px; }
/* automatisations : icône, texte ; en dessous, « Exécuter » et l'interrupteur */
.auto { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 12px; row-gap: 10px; padding: 14px 16px; border-radius: 0; }
.auto + .auto { border-top: .5px solid var(--line-2); }
.auto-ico { width: 38px; height: 38px; }
.auto-ico svg.i { width: 20px; height: 20px; }
.auto > .row:last-child { grid-column: 2; justify-content: space-between; }
.done { padding: 14px 16px; }
.done li { font-size: 14.5px; padding: 8px 0; }
.done li + li { border-top: .5px solid var(--line); }
.done-big { font-size: 28px; }
.deadline { display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: center; column-gap: 14px; row-gap: 8px; padding: 10px 16px; border-radius: 0; }
.deadline:has(> .row:last-child) { align-items: start; }
.deadline:has(> .row:last-child) > .date-chip { grid-row: span 2; }
.deadline > .row:last-child { grid-column: 2; }
.date-chip { width: 50px; height: 54px; border-radius: 16px; }
.deadline:hover { background: none; }
.btn-deplie { height: 34px; }
.deadline + .deadline { border-top: .5px solid var(--line); }

/* =============================================================================
   FACTURE : éditeur et détail
   ============================================================================= */
.lines .head { display: none; }
.lines .line { --sq: 26px; grid-template-columns: 1fr 1fr; padding: 12px; background: var(--card-2); border: 0; }
.lines .line > :first-child { grid-column: 1 / -1; }
.totals { --sq: var(--sq-carte); width: 100%; }
.sticky-side { position: static; }
.lines .line .input, .lines .line .sel-btn { background: var(--card); }
:root:not([data-theme="light"]) .lines .line .input, :root:not([data-theme="light"]) .lines .line .sel-btn { background: var(--card-3); }

/* =============================================================================
   PAGE « PLUS » — fiche de l'entreprise, quatre raccourcis, listes sans icône
   ============================================================================= */
.plus-tete { margin-bottom: 16px; }
.plus-identite { --sq: 34px; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 14px; margin: 0 0 12px;
  background: var(--card); color: var(--ink); box-shadow: var(--sh-card); transition: transform .25s var(--ressort), background .2s; }
.plus-identite:active { transform: scale(.985); background: color-mix(in srgb, var(--card) 92%, var(--ink)); }
.monogramme { --sq: 56px; width: 56px; height: 56px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50% !important; clip-path: none !important; background: var(--black); color: var(--on-black);
  font: 700 21px/1 var(--display); letter-spacing: .01em; }
.id-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.id-texte b { overflow-wrap: anywhere; font: 700 18px/1.2 var(--text); letter-spacing: -.015em; }
.id-texte small { overflow-wrap: anywhere; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plus-identite .chev, .ligne .chev { width: 15px; height: 15px; color: var(--ink-3); flex-shrink: 0; }

.raccourcis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 28px; }
.raccourci { --sq: 30px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 120px; padding: 15px 15px 14px;
  background: var(--card); color: var(--ink); box-shadow: var(--sh-card); transition: transform .25s var(--ressort), background .2s; }
.raccourci:active { transform: scale(.97); background: color-mix(in srgb, var(--card) 92%, var(--ink)); }
.raccourci .sym { width: 28px; height: 28px; color: var(--ink); }
.rac-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rac-texte b { font: 700 16px/1.2 var(--text); letter-spacing: -.01em; }
.rac-texte small { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.alerte-txt { color: var(--rouge); font-weight: 650; }

.groupe { --sq: 30px; background: var(--card); margin: 0 0 26px; overflow: hidden; box-shadow: var(--sh-card); }
.groupe-titre { font: 600 13px var(--text); color: var(--ink-3); text-transform: none; letter-spacing: 0; margin: 0 16px 8px; }
.ligne { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 14px 0 16px; border: 0;
  background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: background .25s; }
.ligne + .ligne::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--line-2); }
.ligne:active { background: var(--surbrillance); transition-duration: 0s; }
.lig-titre { overflow-wrap: anywhere; flex: 1; min-width: 0; font-size: 16.5px; font-weight: 500; letter-spacing: -.005em; }
.lig-valeur { font-size: 15.5px; color: var(--ink-3); white-space: nowrap; }
.lig-valeur:empty { display: none; }
.ligne.centre { justify-content: center; }
.ligne.centre .lig-titre, .ligne.centre { font-size: 16.5px; font-weight: 500; }
.ligne.danger { color: var(--rouge); }
.plus-pied { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; }

/* =============================================================================
   FEUILLES (fenêtres), ALERTES, MENUS, NOTIFICATIONS
   ============================================================================= */
.modal-bg { align-items: flex-end; justify-content: center; padding: env(safe-area-inset-top) 8px calc(max(8px, env(safe-area-inset-bottom) - 14px) + var(--clavier, 0px));
  background: rgba(11, 12, 15, .3); -webkit-backdrop-filter: none; backdrop-filter: none; animation: fondu-in .3s both; }
.modal, .modal.wide { --sq: 52px; position: relative; display: flex; flex-direction: column; width: 100%; max-width: 640px; margin: 0;
  max-height: calc(100dvh - env(safe-area-inset-top) - 18px - var(--clavier, 0px)); overflow: hidden; padding: 0; border: 0;
  background: var(--card); box-shadow: none; animation: feuille-in .55s var(--ressort-doux) both; transition: transform .45s var(--ressort-doux); }
.modal::before { content: ""; flex-shrink: 0; width: 36px; height: 5px; border-radius: 3px; margin: 7px auto 0; background: var(--card-3); }
.modal-head { flex-shrink: 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; padding: 4px 12px 6px; }
.modal-head h2 { grid-column: 2; text-align: center; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.modal-head .icon-btn { grid-column: 3; width: 36px; height: 36px; justify-self: end; background: var(--field); }
.modal-head .icon-btn svg.i, .modal-head .icon-btn .sym { width: 17px; height: 17px; stroke-width: 2.2; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 18px 18px; }
.modal-foot { flex-shrink: 0; position: static; display: flex; gap: 10px; padding: 10px 16px 16px; background: var(--card); }
.modal-foot .btn { flex: 1 1 auto; min-width: 0; height: 50px; }
.modal-foot .btn { padding: 0 14px; }
.modal-foot .btn-ghost, .modal-foot .btn-secondary { flex: 0 0 auto; padding: 0 20px; }   /* « Annuler » à sa taille, l'action prend le reste */
.modal-foot .btn-ghost, .modal-foot .btn-secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line-2); }
.modal-bg.sortie { animation: fondu-out .3s both; }
/* pendant qu'elle se referme, plus rien n'est cliquable (pas de double enregistrement) */
.modal-bg.sortie, .compositeur-fond.sortie { pointer-events: none; }
/* petites commandes : zone tactile agrandie à 44 px sans changer leur dessin */
.tab, .modal-head .icon-btn, .demo-banner .btn-ghost { position: relative; }
.tab::after, .modal-head .icon-btn::after, .demo-banner .btn-ghost::after { content: ""; position: absolute; inset: -5px; }
.modal-bg.sortie .modal { animation: feuille-out .3s cubic-bezier(.4, 0, 1, 1) both; }
@keyframes fondu-in { from { background: rgba(0, 0, 0, 0); } }
@keyframes fondu-out { to { background: rgba(0, 0, 0, 0); } }
@keyframes feuille-in { from { transform: translateY(calc(100% + 30px)); } }
@keyframes feuille-out { to { transform: translateY(calc(100% + 30px)); } }

/* alertes (confirmations) : comme UIAlertController */
.modal-bg.alerte { align-items: center; padding: 24px; background: rgba(0, 0, 0, .38); }
.modal-bg.alerte .modal { --sq: 42px; width: 290px; max-width: 290px; text-align: center; background: var(--verre-fort); animation: alerte-in .4s var(--ressort) both; }
.modal-bg.alerte .modal::before { display: none; }
.modal-bg.alerte .modal-head { display: block; padding: 20px 18px 0; }
.modal-bg.alerte .modal-head h2 { font-size: 17px; }
.modal-bg.alerte .modal-head .icon-btn { display: none; }
.modal-bg.alerte .modal-body { padding: 6px 18px 18px; font-size: 14px; line-height: 1.4; color: var(--ink-2); flex: none; }
.modal-bg.alerte .modal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; background: none; border-top: .5px solid var(--line-2); }
.modal-bg.alerte .modal-foot .btn { height: 48px; border: 0; border-radius: 0; background: none; color: var(--teinte); font-size: 16.5px; font-weight: 500; box-shadow: none; }
.modal-bg.alerte .modal-foot .btn + .btn { border-left: .5px solid var(--line-2); font-weight: 700; }
.modal-bg.alerte .modal-foot .btn-danger { color: var(--rouge); }
.modal-bg.alerte .modal-foot .btn:active { background: var(--surbrillance); transform: none; opacity: 1; }
.modal-bg.alerte.sortie .modal { animation: alerte-out .2s ease-in both; }
@keyframes alerte-in { from { transform: scale(1.12); opacity: 0; } }
@keyframes alerte-out { to { transform: scale(.94); opacity: 0; } }

/* listes déroulantes et calendrier : feuille d'action au pouce */
body:has(> .pop.on)::after { content: ""; position: fixed; inset: 0; z-index: 399; background: rgba(0, 0, 0, .3); animation: fondu-in .25s both; }
.pop { --sq: 44px; --r-parent: calc(44px / 1.53); --marge: 8px; left: 8px !important; right: 8px; top: auto !important; bottom: calc(max(8px, env(safe-area-inset-bottom) - 14px) + var(--clavier, 0px)) !important;
  min-width: 0 !important; width: auto !important; padding: 8px; border: 0; box-shadow: none; background: var(--card);
  opacity: 1; transform: translateY(calc(100% + 30px)); transition: transform .45s var(--ressort-doux); }
.pop.haut { transform: translateY(calc(100% + 30px)); }
.pop.on { transform: none; }
.pop.off { transform: translateY(calc(100% + 30px)); opacity: 1; transition: transform .25s ease-in; }
.pop-liste { max-height: 52dvh; }
.pop-opt { min-height: 50px; padding: 12px 14px; font-size: 16.5px; border-radius: max(8px, calc(var(--r-parent, 18px) - var(--marge, 6px))); }
.pop-opt.actif { background: var(--surbrillance); }
.pop-opt.choisi svg.i { color: var(--teinte); }
.pop-cherche input { height: 42px; font-size: 16px; border: 0; background: var(--field); }
.pop-date { padding: 14px; }
.cal-grille button { height: 44px; font-size: 16px; }

/* notifications : pastille qui descend du haut (façon Dynamic Island) */
#toasts { top: calc(env(safe-area-inset-top) + 8px); bottom: auto; left: 12px; right: 12px; transform: none; width: auto; z-index: 600; }
.toast { max-width: 100%; }
.toast { position: relative; overflow: hidden; background: rgba(11, 11, 15, .86); color: #fff; padding: 8px 18px 8px 8px; font-size: 14.5px; font-weight: 600;
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); animation: toast-in .6s var(--ressort) both; }
.toast.out { animation: toast-out .35s cubic-bezier(.4, 0, 1, 1) both; }
.toast::before { opacity: .35; }
@keyframes toast-in { from { transform: translateY(-140%) scale(.6); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-140%) scale(.8); opacity: 0; } }

/* visite guidée */
button#visite { left: auto; right: auto; bottom: auto; width: auto; }   /* bouton « Revoir la visite » (même id que la visite) */
aside#visite { --sq: 40px; left: 10px !important; right: 10px !important; width: auto !important; bottom: calc(96px + env(safe-area-inset-bottom)) !important; border: 0; }

/* connexion et création du compte : champs blancs sur fond groupé, comme les formulaires d'iOS */
.auth { min-height: 100dvh; background: var(--bg); }
.auth-carte .input, .auth-carte .sel-btn { background: var(--card); }
.auth-carte .btn { height: 52px; font-size: 16.5px; }
.auth-carte h1 { font-size: 34px; font-weight: 700; letter-spacing: -.028em; }

/* graphiques en plein écran */
.plein-ecran { padding: 0; }
.pe-carte { border-radius: 0; padding: calc(16px + env(safe-area-inset-top)) 14px 16px; }

/* expert-comptable en lecture seule */
.lecture-seule .demo-banner .actions { display: none !important; }

/* =============================================================================
   TRANSITIONS ENTRE PAGES (View Transitions) — pousser, revenir, changer d'onglet
   ============================================================================= */
/* les barres gardent leur place pendant la transition ; nommées seulement à ce moment-là, car un nom de transition
   isole l'arrière-plan et empêcherait le verre de flouter le contenu */
html[data-sens] .topbar { view-transition-name: barre-nav; }
html[data-sens] .onglets { view-transition-name: onglets; }
html[data-sens] .tab-soph { view-transition-name: sophystia; }
::view-transition-group(root), ::view-transition-group(barre-nav), ::view-transition-group(onglets), ::view-transition-group(sophystia) { animation-duration: .44s; animation-timing-function: var(--ressort-doux); }
html[data-sens="push"]::view-transition-old(root) { animation: vt-recule .44s var(--ressort-doux) both; mix-blend-mode: normal; }
html[data-sens="push"]::view-transition-new(root) { animation: vt-arrive .44s var(--ressort-doux) both; mix-blend-mode: normal; box-shadow: -14px 0 40px rgba(0, 0, 0, .14); }
html[data-sens="pop"]::view-transition-old(root) { animation: vt-repart .44s var(--ressort-doux) both; mix-blend-mode: normal; z-index: 2; box-shadow: -14px 0 40px rgba(0, 0, 0, .14); }
html[data-sens="pop"]::view-transition-new(root) { animation: vt-revient .44s var(--ressort-doux) both; mix-blend-mode: normal; }
html[data-sens="onglet"]::view-transition-old(root), html[data-sens="onglet"]::view-transition-new(root) { animation-duration: .22s; }
@keyframes vt-recule { to { transform: translateX(-30%); filter: brightness(.94); } }
@keyframes vt-arrive { from { transform: translateX(100%); } }
@keyframes vt-repart { to { transform: translateX(100%); } }
@keyframes vt-revient { from { transform: translateX(-30%); filter: brightness(.94); } }

@media (prefers-reduced-motion: reduce) {
  .onglets.prete .onglet-bulle, .tab-item, .tabbar, .compositeur, .modal, .pop, .toast { transition: none !important; animation: none !important; }
  .modal-bg, .modal-bg.sortie .modal { animation: none !important; }
}

/* affichage stable : les graphiques s'affichent directement, sans barres qui poussent */
.bar { animation: none; }

/* Sophystia : sur téléphone, le panneau devient une feuille plein écran ; le bouton de la barre d'onglets l'ouvre */
.sp-lanceur { display: none; }
.sp-barre { margin: 0 0 22px; }
.sp-barre-k, .sp-barre-t .faint { display: none; }

/* sans flou d'arrière-plan : barre d'onglets, boutons flottants et bandeau sur fond opaque */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .onglets, .tab-soph, .nav-btn, .topbar .nav-retour, .menu-ios, .toast, .compositeur, .modal-bg.alerte .modal, .demo-banner { background: var(--card) !important; }
}

/* un bouton capsule ne passe jamais sur deux lignes : les cartes des réglages s'empilent sur téléphone */
.grid.g-2.reglages { grid-template-columns: minmax(0, 1fr); }

/* 01/12 — comme iOS 26 : la barre d'onglets et un seul bouton à côté (le scan, bleu) ; Sophystia en haut, près de la recherche */
.sc-bouton { display: none !important; }
.tabbar .tab-scan { padding: 0; color: #fff; background: linear-gradient(160deg, #2B8CFF, #0071E3 60%, #005BBF) !important;
  box-shadow: 0 10px 24px -8px rgba(0, 113, 227, .55), 0 2px 6px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .35); }
.tabbar .tab-scan::before, .tabbar .tab-scan::after { display: none; }
.tabbar .tab-scan .sc-svg { position: relative; z-index: 1; width: 24px; height: 24px; }
.soph-haut { display: block; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--card); box-shadow: var(--sh-pill); cursor: pointer; flex-shrink: 0; }
.soph-haut img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.soph-haut:active { transform: scale(.94); }
.topbar.a-retour .hdr-right > .soph-haut { display: none; }       /* page poussée : le titre et le retour gardent la place */
html.sp-ouvert .soph-haut { opacity: 0; pointer-events: none; }
body:has(#sp-barre) .soph-haut { display: none; }        /* accueil : la barre « Demander à Sophystia » de la page suffit */
