/* ==========================================================================
   Téléphone et tablette (analyse ergonomie du 26/11/2026)
   Plannings lisibles sur téléphone, barre du bas, menu du profil, recherche.
   Sur ordinateur, presque rien ne change.
   ========================================================================== */

/* texte orange foncé lisible (titres de groupe, onglet actif) : en clair et en sombre */
:root { --brand-ink: #9A4708; }
html.a11y-sombre { --brand-ink: #F4B27A; }

/* ---------- Listes des plannings (toutes tailles) ----------
   Le thème mettait le jour dans une colonne étroite à gauche (« lundi 23 novembre 2026 » sur 4 lignes) :
   le jour devient un bandeau sur toute la largeur. */
.fc-list-view .fc-list-heading { display: table-row; height: auto; width: auto; }
.fc-list-view .fc-list-heading td.fc-widget-header {
  padding: 8px 12px !important; background: var(--bg, #F6F4F1) !important; border-top: 1px solid var(--line, #E5E1DC);
  font-weight: 700; line-height: 1.3; text-align: left;
}
.fc-list-view .fc-list-heading-main { color: var(--brand-ink, #B2560E); text-transform: capitalize; }
.fc-list-view .fc-list-heading-alt { float: none; margin-left: 6px; font-weight: 600; color: var(--ink, #3C3A47); }

/* ---------- Bande des jours (liste du jour du planning des membres) ---------- */
.day-band { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 12px; }
.day-band-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 52px; border: 1px solid var(--line, #E5E1DC); border-radius: 14px; background: var(--surface, #fff);
  color: var(--ink, #3C3A47); cursor: pointer; font: inherit; padding: 4px 0;
}
.day-band-btn .db-name { font-size: .8rem; text-transform: capitalize; color: var(--ink-soft, #6B6875); }
.day-band-btn .db-num { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.day-band-btn.is-today .db-num { color: var(--rose, #EA2C59); }
.day-band-btn.is-on { background: var(--brand, #EE964B); border-color: var(--brand, #EE964B); color: var(--ink-on-brand, #2B1A0A); }
.day-band-btn.is-on .db-name, .day-band-btn.is-on.is-today .db-num { color: inherit; }

/* membres repliables dans la liste du jour / de la semaine */
.dl-fold-bar { display: flex; justify-content: flex-end; margin: 0 0 6px; }
details.day-list-member > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; }
details.day-list-member > summary::-webkit-details-marker { display: none; }
details.day-list-member > summary::before {
  content: 'expand_more'; font-family: 'Material Icons'; font-size: 22px; line-height: 1; transform: rotate(-90deg);
  transition: transform .15s; color: var(--ink-soft, #6B6875);
}
details.day-list-member[open] > summary::before { transform: none; }
details.day-list-member > summary h4 { margin: 0; }

/* ---------- Bouton « explications » (repliées sur téléphone) ---------- */
.info-toggle {
  display: none; border: 0; background: transparent; color: var(--ink-soft, #6B6875); cursor: pointer;
  vertical-align: middle; margin-left: 6px; padding: 4px; border-radius: 50%; min-width: 0; min-height: 0;
}
.info-toggle .material-icons { font-size: 22px; }

/* ---------- Bouton « Filtres » des plannings (téléphone) ---------- */
.mf-toggle { display: none; }

@media only screen and (max-width: 768px) {
  /* barre du calendrier : la date, puis « ‹ Aujourd'hui › », puis les vues en boutons de même taille */
  .fc-toolbar.fc-header-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .fc-toolbar.fc-header-toolbar > div { min-width: 0; }
  .fc-toolbar.fc-header-toolbar > .fc-center { order: -1; text-align: center; }
  .fc-toolbar.fc-header-toolbar > .fc-left, .fc-toolbar.fc-header-toolbar > .fc-right {
    display: flex; gap: 6px; width: 100%; text-align: left; flex: none;
  }
  .fc-toolbar.fc-header-toolbar > .fc-left > .fc-button-group,
  .fc-toolbar.fc-header-toolbar > .fc-right > .fc-button-group { display: contents; }
  .fc-toolbar.fc-header-toolbar .fc-button { margin: 0 !important; float: none; }
  .fc-toolbar.fc-header-toolbar > .fc-left .fc-prev-button { order: 0; }
  .fc-toolbar.fc-header-toolbar > .fc-left .fc-aujourdhui-button,
  .fc-toolbar.fc-header-toolbar > .fc-left .fc-today-button { order: 1; flex: 1 1 auto; }
  .fc-toolbar.fc-header-toolbar > .fc-left .fc-next-button { order: 2; }
  .fc-toolbar.fc-header-toolbar > .fc-right .fc-button { flex: 1 1 0; min-width: 0; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fc-toolbar.fc-header-toolbar > .fc-clear { display: none; }

  /* listes : chaque rendez-vous sur une carte, l'heure au-dessus, le texte en dessous sur toute la largeur */
  .fc-list-view .fc-list-table, .fc-list-view .fc-list-table > tbody { display: block; width: 100%; }
  .fc-list-view .fc-list-heading { display: block; }
  .fc-list-view .fc-list-heading td.fc-widget-header { display: block; }
  .fc-list-view .fc-list-item {
    display: grid; grid-template-columns: 20px 1fr; column-gap: 6px; padding: 8px 10px;
    border-bottom: 1px solid var(--line, #E5E1DC);
  }
  .fc-list-view .fc-list-item td { display: block; border: 0 !important; padding: 0 !important; background: transparent !important; }
  .fc-list-view .fc-list-item .fc-list-item-marker { grid-row: 1 / span 2; padding-top: 3px !important; }
  .fc-list-view .fc-list-item .fc-list-item-time { grid-column: 2; font-weight: 700; font-size: .85rem; color: var(--ink-soft, #6B6875); }
  .fc-list-view .fc-list-item .fc-list-item-title { grid-column: 2; word-break: normal; overflow-wrap: anywhere; }

  /* filtres des plannings repliés derrière un bouton « Filtres » */
  .mf-toggle {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px 8px;
  }
  .mf-toggle .mf-count { background: var(--brand, #EE964B); color: var(--ink-on-brand, #2B1A0A); border-radius: 999px; padding: 0 7px; font-size: .8rem; font-weight: 700; }
  body.mf-ready:not(.mf-open) .mf-hide { display: none !important; }
  body.mf-open .mf-hide .activity-legend, body.mf-open .activity-legend.mf-hide { flex-wrap: wrap; overflow: visible; }

  /* « Types d'activité » passent à la ligne au lieu de dépasser à droite */
  .activity-legend { flex-wrap: wrap !important; overflow-x: visible !important; }

  /* explications repliées : petite icône « i » à toucher */
  .info-toggle { display: inline-flex; }
  body:not(.infos-open) .mobile-fold { display: none !important; }
}

/* ---------- Barre du haut : bouton Chercher, menu du profil ---------- */
nav.topbar .topbar-search-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--line, #E5E1DC); background: var(--bg, #F6F4F1); color: var(--ink-soft, #6B6875);
  cursor: pointer; font: inherit; font-size: .9rem; line-height: 1; min-width: 200px;
}
nav.topbar .topbar-search-btn .material-icons { color: var(--ink-soft, #6B6875); font-size: 22px; }
nav.topbar .topbar-search-btn:hover { background: var(--brand-soft, #FDEFE3); }
nav.topbar .topbar-user-li { position: relative; }
nav.topbar button.topbar-user { cursor: pointer; font: inherit; line-height: normal; height: auto; }
nav.topbar ul.topbar-actions > li { display: flex; align-items: center; }   /* recherche, Nouvel évènement, messages et profil sur la même ligne */
nav.topbar .topbar-caret { font-size: 20px; margin-left: -2px; color: var(--ink-soft, #6B6875); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; margin: 0; padding: 6px 0;
  background: var(--surface, #fff); border: 1px solid var(--line, #E5E1DC); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15); z-index: 1000; line-height: normal;
}
.user-menu li { float: none !important; display: block; }
.user-menu .um-head { padding: 8px 16px 6px; font-weight: 700; color: var(--ink, #3C3A47); font-size: .9rem; }
nav.topbar .user-menu a {
  display: flex !important; align-items: center; gap: 12px; padding: 10px 16px !important; height: auto !important;
  border-radius: 0 !important; color: var(--ink, #3C3A47) !important; font-size: .95rem; white-space: nowrap;
}
nav.topbar .user-menu a .material-icons { font-size: 20px; color: var(--ink-soft, #6B6875); margin: 0; }
nav.topbar .user-menu a:hover, nav.topbar .user-menu a:focus { background: var(--brand-soft, #FDEFE3) !important; }
.user-menu .um-sep { border-top: 1px solid var(--line, #E5E1DC); margin-top: 4px; padding-top: 4px; }
nav.topbar .user-menu a.um-logout { color: #B3173E !important; }
nav.topbar .user-menu a.um-logout .material-icons { color: #B3173E; }

/* ---------- Recherche unique ---------- */
.gs-panel { position: fixed; inset: 0; z-index: 1100; background: rgba(30, 28, 36, .45); display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 16px; }
.gs-panel[hidden] { display: none; }
.gs-box { width: 100%; max-width: 640px; background: var(--surface, #fff); border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.gs-field { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line, #E5E1DC); }
.gs-field .material-icons { color: var(--ink-soft, #6B6875); }
.gs-field input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1.05rem; background: transparent; color: var(--ink, #3C3A47); padding: 8px 4px; min-width: 0; }
.gs-close { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 50%; color: var(--ink-soft, #6B6875); }
.gs-results { overflow-y: auto; padding: 6px 0 10px; }
.gs-help, .gs-empty { padding: 12px 18px; color: var(--ink-soft, #6B6875); margin: 0; }
.gs-group-title { padding: 10px 18px 4px; margin: 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-ink, #B2560E); }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 9px 18px; color: var(--ink, #3C3A47); text-decoration: none !important; }
.gs-item:hover, .gs-item.is-active, .gs-item:focus { background: var(--brand-soft, #FDEFE3); outline: none; }
.gs-item .material-icons { color: var(--ink-soft, #6B6875); font-size: 20px; }
.gs-item .gs-label { font-weight: 600; }
.gs-item .gs-sub { color: var(--ink-soft, #6B6875); font-size: .85rem; margin-left: auto; text-align: right; }
.gs-more { display: block; padding: 4px 18px 8px 50px; font-size: .85rem; }

/* ---------- Barre du bas (téléphone seulement) ---------- */
.bottom-bar { display: none; }
@media only screen and (max-width: 600px) {
  nav.topbar .topbar-search-btn { min-width: 0; padding: 0; width: 40px; justify-content: center; border: 0; background: transparent; }
  nav.topbar .topbar-search-btn .gs-hint { display: none; }
  nav.topbar ul.topbar-actions { gap: 2px; }
  /* Nouvelle action et Messagerie sont dans la barre du bas ; l'agenda est dans le menu du profil */
  nav.topbar ul.topbar-actions a.topbar-cta, nav.topbar ul.topbar-actions a.topbar-msg,
  nav.topbar ul.topbar-actions a.topbar-agenda { display: none !important; }
  nav.topbar .topbar-caret { display: none; }
  .user-menu { position: fixed; right: 8px; left: auto; top: calc(var(--topbar-h, 64px) - 4px); }

  .bottom-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 996;
    background: var(--surface, #fff); border-top: 1px solid var(--line, #E5E1DC);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 14px rgba(0,0,0,.06);
  }
  .bb-item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    min-height: 52px; color: var(--ink-soft, #6B6875) !important; font-size: .72rem; font-weight: 600; text-decoration: none !important;
    position: relative; border-radius: 12px; line-height: 1.1; text-align: center;
  }
  .bb-item .material-icons { font-size: 24px; }
  .bb-item.is-on { color: var(--brand-ink, #B2560E) !important; }
  .bb-item.is-on .material-icons { background: var(--brand-soft, #FDEFE3); border-radius: 999px; padding: 2px 14px; }
  .bb-plus .material-icons {
    background: var(--brand, #EE964B); color: var(--ink-on-brand, #2B1A0A); border-radius: 50%; width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 28px; padding: 0 !important;
  }
  .bb-plus span:not(.material-icons) { font-size: .66rem; }
  .bb-item .msg-pill { position: absolute; top: 2px; left: calc(50% + 6px); }
  body.with-nav main#contenu { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .bottom-bar, .gs-panel, .user-menu { display: none !important; } }
@media only screen and (max-width: 600px) {
  .bottom-bar .material-icons { height: auto; line-height: 1; }
  .bottom-bar .bb-item.is-on .material-icons { padding: 3px 16px; }
}
@media only screen and (max-width: 600px) {
  .bottom-bar .bb-plus .material-icons { height: 40px; width: 40px; line-height: 40px; }
}

/* listes du planning : les cartes ne dépassent plus à droite ; bouton des présences sur plusieurs lignes */
.day-list-item { box-sizing: border-box; max-width: 100%; }
@media only screen and (max-width: 768px) {
  .activity-legend .activity-chip-presence { flex-wrap: wrap; white-space: normal; height: auto; max-width: 100%; text-align: left; row-gap: 4px; }
  .activity-legend .activity-chip-presence .pres-state { white-space: normal; flex-basis: 100%; }
}

/* ---------- Liste des rendez-vous : aller à un jour, jour toujours visible, lignes compactes ---------- */
.ex-day-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; background: transparent !important; height: auto !important; line-height: normal !important; box-shadow: none !important; }
.ex-day-jump a { text-transform: capitalize; color: var(--ink, #3C3A47) !important; }
.ex-day-jump a small { color: var(--ink-soft, #6B6875); margin-left: 4px; }
.ex-day-jump a.is-today { border-color: var(--brand, #EE964B); }
.ex-day { scroll-margin-top: calc(var(--topbar-h, 64px) + 8px); }
@media only screen and (max-width: 768px) {
  .ex-day > h3 { position: sticky; top: var(--topbar-h, 64px); z-index: 5; background: var(--surface, #fff); margin: -4px -4px 6px; padding: 8px 4px; }
  .ex-day li.ex-rdv { display: grid !important; grid-template-columns: 54px 1fr; column-gap: 10px; row-gap: 2px; padding: 8px 0; }
  .ex-day li.ex-rdv > div { min-width: 0; }
  .ex-day .ex-rdv-time { grid-row: 1 / span 4; display: flex; flex-direction: column; }
  .ex-day .ex-rdv-main, .ex-day .ex-rdv-who, .ex-day .ex-rdv-where, .ex-day .ex-rdv-state { grid-column: 2; }
  .ex-day .ex-rdv-who, .ex-day .ex-rdv-where { font-size: .85rem; color: var(--ink-soft, #6B6875); }
  .ex-day .ex-rdv-state:empty { display: none; }
}

/* ---------- Message « plus confortable sur ordinateur » (téléphone seulement) ---------- */
.phone-note { display: none; }
@media only screen and (max-width: 768px) {
  .phone-note { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-soft, #FDF0E4); border-radius: 12px; padding: 10px 12px; margin: 8px 0 4px; font-size: .9rem; }
  .phone-note .material-icons { color: var(--brand-ink); }
}

/* ---------- Nouveau dossier sur téléphone : le rond « + » ne pousse plus le titre ---------- */
@media only screen and (max-width: 600px) {
  .fc-page .ms-head .ms-avatar { display: none; }
  .fc-page .ms-head { padding-left: 0; }
}

/* ---------- Planning des membres sur PC : le dernier jour s'écrivait en minuscules ---------- */
.fc-head .fc-time-area .fc-following { text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Statistiques : Dossiers, Lieu et Membre en boutons ---------- */
.st-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.st-btn-label { font-weight: 600; margin-right: 2px; }
.st-chip.st-toggle input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.st-chip.st-toggle { position: relative; background: var(--brand-soft, #FDF0E4); border-color: var(--brand, #EE964B); font-weight: 600; }
.st-chip.st-toggle.is-off { opacity: .45; background: var(--surface, #fff); border-color: var(--line, #E5E1DC); font-weight: 400; }
.st-chip.st-toggle:focus-within { outline: 2px solid var(--brand-text, #9A4708); outline-offset: 2px; }
.st-btn-row .st-chip { position: relative; cursor: pointer; }
details.st-members { display: block; }
details.st-members > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
details.st-members > summary::-webkit-details-marker { display: none; }
details.st-members > summary .material-icons { font-size: 20px; transition: transform .15s; }
details.st-members[open] > summary .material-icons { transform: rotate(180deg); }
details.st-members .st-btn-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- Nouveau dossier : un dossier qui ressemble existe déjà ---------- */
.dup-box { background: #FFF6E5; border: 1px solid #F0C36D; border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; }
.dup-box p { margin: 0 0 8px; display: flex; gap: 8px; align-items: flex-start; }
.dup-box .material-icons { color: #9A4708; }
.dup-box ul { margin: 0 0 8px; padding: 0; }
.dup-box li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-top: 1px solid #F3DDB0; list-style: none; }
.dup-box li > a:first-child { font-weight: 700; }
.dup-box li span { color: var(--ink-soft, #6B6875); font-size: .9rem; }
.dup-box .dup-open { margin-left: auto; }
.dup-box .dup-hint { font-size: .9rem; color: var(--ink-soft, #6B6875); }
html.a11y-sombre .dup-box { background: #3A2E1A; border-color: #6B5428; }
html.a11y-sombre .dup-box li { border-color: #6B5428; }
html.a11y-sombre .dup-box .material-icons { color: #F4B27A; }

/* ---------- Rendez-vous de demain (à confirmer) ---------- */
.tm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.tm-bar .btn-flat { padding: 0 8px; }
.tm-day { font-weight: 700; min-width: 9em; text-align: center; }
.tm-who { display: inline-flex; gap: 6px; margin-left: auto; }
.tm-help { color: var(--ink-soft, #6B6875); font-size: .9rem; margin: 0 0 12px; }
.tm-list { margin: 0; padding: 0; }
.tm-rdv { list-style: none; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line, #E7E3EC); }
.tm-rdv:first-child { border-top: 0; }
.tm-time b { display: block; font-size: 1.05rem; }
.tm-time small, .tm-main small { color: var(--ink-soft, #6B6875); }
.tm-folder { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-weight: 600; }
.tm-tel { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--brand-ink, #9A4708); white-space: nowrap; }
.tm-tel .material-icons { font-size: 18px; }
.tm-notel { font-weight: 400; font-size: .85rem; color: var(--ink-soft, #6B6875); }
.tm-confirm { display: inline-flex; flex-direction: column; align-items: center; gap: 0; min-width: 110px; padding: 6px 10px; height: auto; line-height: 1.2; cursor: pointer; }
.tm-confirm small { font-size: .72rem; }
.tm-rdv.is-confirmed .tm-time b, .tm-rdv.is-confirmed .tm-folder > a:first-child { opacity: .7; }
.tm-empty { padding: 20px 4px; color: var(--ink-soft, #6B6875); }
@media (max-width: 600px) {
  .tm-rdv { grid-template-columns: 52px minmax(0, 1fr); }
  .tm-confirm { grid-column: 1 / -1; flex-direction: row; gap: 6px; justify-content: center; }
  .tm-who { margin-left: 0; width: 100%; }
  .tm-who .activity-chip { flex: 1; justify-content: center; }
}

/* ---------- Accueil : À compléter ---------- */
.hm-todo-list { margin: 0; padding: 0; }
.hm-todo-list li { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--line, #E7E3EC); }
.hm-todo-what { flex: 1 1 160px; min-width: 0; }
.hm-todo-what a { font-weight: 700; display: block; }
.hm-todo-what small { color: var(--ink-soft, #6B6875); }
.hm-todo-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.hm-todo-btn { cursor: pointer; }
.hm-todo-done { display: flex; align-items: center; gap: 6px; color: #1E7B4F; font-weight: 600; }
.hm-todo-done[hidden], .hm-todo-btns[hidden] { display: none; }
.hm-todo-list li.is-done .hm-todo-what { opacity: .65; }
html.a11y-sombre .hm-todo-done { color: #7FD6A8; }
.tm-confirm.is-off, .tm-who .activity-chip.is-off { text-decoration: none; }
.tm-confirm.is-off * { text-decoration: none; }

/* ---------- Dossier : documents (pièces jointes) et scan ---------- */
.pj-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.pj-actions label.btn { cursor: pointer; }
.pj-actions label.btn:focus-within { outline: 3px solid #1D4ED8; outline-offset: 2px; }
.pj-tip { display: flex; gap: 6px; align-items: flex-start; font-size: .85rem; color: var(--ink-soft, #6B6875); margin: 0 0 12px; }
.pj-tip .material-icons { font-size: 18px; color: var(--brand-ink, #9A4708); }
.pj-scan { border: 2px dashed #EE964B; border-radius: 14px; padding: 12px; margin: 0 0 12px; background: #FFF8F1; }
.pj-scan-head { margin-bottom: 8px; }
.pj-scan-count { color: var(--ink-soft, #6B6875); }
.pj-pages { display: flex; gap: 10px; overflow-x: auto; margin: 0 0 10px; padding: 0 0 4px; }
.pj-pages li { list-style: none; position: relative; flex: 0 0 auto; text-align: center; font-size: .8rem; }
.pj-pages img { display: block; height: 120px; width: auto; max-width: 110px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; background: #fff; }
.pj-pages .pj-page-del { position: absolute; top: 2px; right: 2px; padding: 0; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; background: rgba(255,255,255,.9); }
.pj-pages .pj-page-del .material-icons { font-size: 18px; line-height: 28px; }
.pj-scan-name { margin: 0 0 10px; }
.pj-scan-name label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; color: inherit; }
.pj-scan-name input, .pj-rename-input { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid #CFC9D6; border-radius: 10px; font: inherit; }
.pj-scan-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pj-scan-bar label.btn { cursor: pointer; }
.pj-msg { padding: 8px 12px; border-radius: 10px; margin: 0 0 10px; background: #EEF2F7; }
.pj-msg.is-ok { background: #E7F6EE; color: #165C3B; }
.pj-msg.is-error { background: #FDE8EC; color: #9B1238; }
.pj-msg .pj-undo { height: auto; line-height: 1.6; padding: 0 8px; font-weight: 700; }
.pj-list { margin: 0; padding: 0; }
.pj-list li { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name btns" "meta btns"; gap: 0 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line, #E7E3EC); }
.pj-list li:first-child { border-top: 0; }
.pj-open, .pj-rename-input { grid-area: name; }
.pj-open { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.pj-open .pj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-ico { color: var(--brand-ink, #9A4708); }
.pj-list li[data-ext=pdf] .pj-ico { color: #B3173E; }
.pj-meta { grid-area: meta; font-size: .8rem; color: var(--ink-soft, #6B6875); padding-left: 32px; }
.pj-btns { grid-area: btns; display: flex; }
.pj-btns .btn-flat { padding: 0 8px; }
html.a11y-sombre .pj-scan { background: #2E261E; }
html.a11y-sombre .pj-msg { background: #2A2F38; }
html.a11y-sombre .pj-msg.is-ok { background: #173A2A; color: #9BE3BD; }
html.a11y-sombre .pj-msg.is-error { background: #46202B; color: #F5A8BC; }
@media (max-width: 600px) {
  .pj-actions label.btn { flex: 1 1 100%; text-align: center; }
  .pj-meta { padding-left: 0; }
}

/* tablette : « Nouvelle action » ne passe plus sur deux lignes dans la barre du haut */
@media (min-width: 601px) and (max-width: 1100px) {
  .topbar-cta span { display: none; }
  .topbar-cta .material-icons.left { margin-right: 0; }
}
.pj-trash { margin-top: 14px; border-top: 1px solid var(--line, #E7E3EC); padding-top: 8px; }
.pj-trash summary { cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--ink-soft, #6B6875); font-weight: 600; padding: 6px 0; }
.pj-trash summary .material-icons { font-size: 20px; }
.pj-trash-list { margin: 0; padding: 0; }
.pj-trash-list li { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 6px 0; border-top: 1px dashed var(--line, #E7E3EC); }
.pj-trash-list .pj-name { font-weight: 600; text-decoration: line-through; }
.pj-trash-list small { color: var(--ink-soft, #6B6875); flex: 1 1 200px; }
.pj-trash-list .pj-erase { color: #B3173E; }
.pj-trash-list .pj-erase.is-confirm { background: #B3173E; color: #fff; border-radius: 999px; }
html.a11y-sombre .pj-trash-list .pj-erase:not(.is-confirm) { color: #F5A8BC; }
/* renommer : le nom (lien) disparaît pendant la saisie, sinon les deux se superposent */
.pj-list .pj-open[hidden] { display: none; }
.pj-list .pj-rename-input { max-width: none; min-width: 0; box-sizing: border-box; margin: 4px 0 6px; }
/* aperçu de la 1re page à la place de l'icône */
/* format d'une feuille A4, assez grand pour reconnaître le document d'un coup d'œil */
.pj-thumb { width: 84px; height: 119px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line, #E7E3EC); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pj-list li:has(.pj-thumb) { position: relative; padding-left: 98px; min-height: 135px; align-content: center; }
.pj-list li:has(.pj-thumb) .pj-thumb { position: absolute; left: 0; top: 8px; }
.pj-list li:has(.pj-thumb) .pj-meta { padding-left: 0; }
@media (max-width: 600px) {
  .pj-thumb { width: 64px; height: 90px; }
  .pj-list li:has(.pj-thumb) { padding-left: 76px; min-height: 106px; }
}
/* qui peut voir un document */
.pj-who { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; margin: 0 0 10px; }
.pj-who-label { font-weight: 600; font-size: .9rem; padding-top: 6px; }
.pj-access-opts, .pj-people { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-people { margin-top: 8px; padding-left: 10px; border-left: 3px solid #EE964B; }
.pj-access .activity-chip { cursor: pointer; }
.pj-access .activity-chip.is-off { text-decoration: none; }
.pj-lock { display: inline-flex; align-items: center; gap: 2px; color: var(--brand-ink, #9A4708); font-weight: 600; }
.pj-lock .material-icons { font-size: 14px; }
.pj-list li .pj-access-edit { grid-column: 1 / -1; background: #FFF8F1; border-radius: 12px; padding: 10px 12px; margin-top: 6px; }
.pj-access-bar { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
html.a11y-sombre .pj-list li .pj-access-edit { background: #2E261E; }
/* menu de gauche : petit cadenas après « Messagerie » ; lien « Nouvel évènement / Nouvelle action » sous le titre */
.sidenav .nav-text .nv-lock { font-size: 14px; vertical-align: -2px; margin-left: 2px; opacity: .7; width: auto; height: auto; line-height: 1; }
.rdv-mode-switch { margin: 6px 0 0; font-size: .95rem; }
.rdv-mode-switch a { font-weight: 700; text-decoration: underline; }

/* ---------- Libellés courts / longs des boutons (page Présences d'un membre) ---------- */
.lbl-short { display: none; }

@media only screen and (max-width: 768px) {
  /* listes du planning (vue « Jour » / « Semaine ») : le thème donnait 48 px de haut à chaque ligne,
     les textes longs (« avec … ») passaient par-dessus l'évènement suivant */
  .fc-list-view .fc-list-item { height: auto !important; border-bottom-color: var(--line, #E5E1DC) !important; }
  /* la barre de couleur du type est déjà donnée par la pastille : plus de trait décalé à gauche */
  .fc-list-view .fc-list-item .fc-list-item-time { box-shadow: none !important; }

  /* planning et présences d'un membre : moins de boutons empilés */
  .mp-tools { gap: 8px; }
  .mp-tools .mp-switch { flex: 1 1 100%; min-width: 0; }
  .mp-tools .mp-switch select { flex: 1 1 auto; min-width: 0; max-width: none; }
  .mp-tools > .btn, .mp-tools > .mf-toggle { flex: 1 1 0; min-width: 0; margin: 0; height: 38px; justify-content: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
  .mp-tools > .mf-toggle { flex: 0 1 auto; display: inline-flex; }
  .mp-tools .pr-actions { flex: 1 1 100%; flex-wrap: nowrap; margin-left: 0; gap: 8px; }
  .mp-tools .pr-actions .btn { padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .mp-tools .pr-actions #pr-add { flex: 0 0 auto; }
  .mp-tools .pr-actions #pr-copy { flex: 1 1 auto; }
  /* Corbeille (planning de l'équipe, présences) : le logo seul, en haut à droite (sur la ligne du bouton retour) */
  .page-head:has(.pl-head-actions) { position: relative; }
  .page-head .pl-head-actions { position: absolute; top: 0; right: 0; margin: 0; }
  .page-head:has(.pl-head-actions) h2 { padding-right: 52px; }
  /* bouton retour (« Planning de l'équipe », « Planning de X ») inutile sur téléphone : barre du bas et retour du téléphone */
  .member-head .back-all { display: none; }
  /* téléphone et mail du membre : déjà dans l'annuaire et sa fiche, inutiles ici sur téléphone */
  .member-head .mp-contact { display: none; }
  .page-head .pl-trash { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  .page-head .pl-trash .material-icons { margin: 0; }
  .page-head .pl-trash .pl-trash-label { display: none; }
  .mp-tools .pr-actions .lbl-long { display: none; }
  .mp-tools .pr-actions .lbl-short { display: inline; }
}
@media only screen and (max-width: 420px) {
  .mp-tools .pr-actions .lbl-short { display: none; }   /* petit téléphone : « Recopier » seul (l'explication reste au survol) */
}

/* ---------- Nom du titre = menu pour changer de personne (téléphone) ----------
   Le menu transparent couvre tout le titre : toucher le titre ouvre la liste des personnes. */
.mp-title-pick .mp-title-caret, .mp-title-pick .mp-title-select { display: none; }
@media only screen and (max-width: 768px) {
  body.mp-title-ready .member-head h2 { position: relative; }
  .mp-title-pick { color: var(--brand-ink, #9A4708); text-decoration: underline dotted 2px; text-underline-offset: 6px; }
  .mp-title-pick .mp-title-caret { display: inline; font-size: 1.6rem; vertical-align: middle; margin-left: 2px; text-decoration: none; }
  .mp-title-pick .mp-title-select { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
    border: 0; padding: 0; margin: 0; font-size: 16px; }
  body.mp-title-ready .member-head h2:focus-within { outline: 3px solid var(--brand, #EE964B); outline-offset: 2px; border-radius: 4px; }
  body.mp-title-ready .mp-tools .mp-switch { display: none; }
}

/* ---------- Téléphone tourné à l'horizontale : message « tournez votre téléphone » ----------
   Seulement sur écran tactile peu haut (téléphone) : ni tablette, ni ordinateur. */
.rotate-warning { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate-warning {
    display: flex; position: fixed; inset: 0; z-index: 100000; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 24px; text-align: center; background: var(--bg, #F6F4F1); color: var(--ink, #3C3A47);
  }
  .rotate-warning .material-icons { font-size: 64px; color: var(--brand, #EE964B); }
  .rotate-warning p { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.5; }
  html.a11y-sombre .rotate-warning { background: #1E1D23; color: #F1EFEA; }
  body:has(.rotate-warning) { overflow: hidden; }
}

/* ---------- Accueil sur téléphone : plus épuré, l'essentiel sur un écran ----------
   Chiffres en petites tuiles (3 par ligne),
   messagerie retirée (bouton Messages de la barre du bas), autres cartes repliées : on touche le titre pour ouvrir. */
@media only screen and (max-width: 768px) {
  .hm-page .hm-hello { margin: 0 0 8px; }
  .hm-page .hm-hello h2 { font-size: 1.35rem; }
  .hm-page .hm-hello .page-sub { font-size: .9rem; margin: 2px 0 6px; }
  .hm-page .hm-hello .hm-logo { display: none; }
  /* 4 chiffres sur une ligne (« en alerte » est déjà dans la carte « En alerte » plus bas) */
  .hm-page .hm-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
  .hm-page .hm-kpis > .hm-kpi[href="#hm-alerts"] { display: none; }
  .hm-page .hm-kpi { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 6px 6px 10px; border-radius: 12px; min-height: 0; }
  .hm-page .hm-kpi::before { width: 4px; }
  .hm-page .hm-kpi > i, .hm-page .hm-kpi small { display: none; }
  .hm-page .hm-kpi > span { font-size: .68rem; line-height: 1.15; overflow-wrap: anywhere; }
  .hm-page .hm-kpi b { font-size: 1.15rem; }
  .hm-page .hm-grid, .hm-page .hm-pair { gap: 8px; }
  .hm-page .hm-card { padding: 10px 12px; }
  /* prochains évènements : une ligne par évènement, 3 au plus (le reste : « Tout mon planning ») */
  .hm-page .hm-rdv .hm-card-head { margin-bottom: 0; align-items: center; }
  .hm-page .hm-rdv .hm-card-head h3 { font-size: .95rem; white-space: nowrap; }
  .hm-page .hm-rdv .hm-card-head h3 i { display: none; }
  .hm-page .hm-rdv .hm-card-head a { font-size: .8rem; }
  .hm-page .hm-rdv .hm-day { margin: 6px 0 4px; font-size: .9rem; }
  .hm-page .hm-rdv .hm-empty { margin: 0 0 2px; font-size: .88rem; }
  .hm-page .hm-rdv .hm-list li a { padding: 6px 8px; gap: 8px; margin-bottom: 4px; font-size: .92rem; }
  .hm-page .hm-rdv .hm-time { flex-direction: row; gap: 3px; min-width: 0; font-size: .85rem; white-space: nowrap; }
  .hm-page .hm-rdv .hm-time small::before { content: '– '; }
  .hm-page .hm-rdv .hm-time small { font-size: .8rem; }
  .hm-page .hm-rdv .hm-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-page .hm-rdv li.hm-more-hide, .hm-page .hm-rdv .hm-day.hm-more-hide, .hm-page .hm-rdv .hm-empty.hm-more-hide { display: none; }
  .hm-page .hm-rdv .hm-more { display: block; font-size: .85rem; font-weight: 600; color: var(--brand-text, #9A4708); margin: 2px 0 0; }
  /* « Derniers dossiers » et « En alerte » côte à côte, une carte ouverte prend toute la largeur */
  .hm-page .hm-pair { grid-template-columns: 1fr 1fr; }
  .hm-page .hm-pair > .hm-fold.is-open { grid-column: 1 / -1; }
  .hm-page .hm-msg { display: none; }
  /* cartes repliées */
  .hm-page .hm-fold > .hm-card-head { cursor: pointer; margin: 0; align-items: center; }
  .hm-page .hm-fold > .hm-card-head h3 { font-size: .95rem; gap: 6px; }
  .hm-page .hm-fold > .hm-card-head h3 i { font-size: 20px; }
  .hm-page .hm-fold > .hm-card-head::after { content: 'expand_more'; font-family: 'Material Icons'; font-size: 24px; line-height: 1;
    color: var(--ink-soft, #6B6875); transition: transform .15s; margin-left: auto; font-size: 22px; }
  .hm-page .hm-fold.is-open > .hm-card-head::after { transform: rotate(180deg); }
  .hm-page .hm-fold:not(.is-open) > :not(.hm-card-head) { display: none !important; }
  .hm-page .hm-fold.is-open > .hm-card-head { margin-bottom: 6px; }
}

/* ---------- Pastille des messages non lus : rond orange avec le nombre (barre du haut, barre du bas, menu) ---------- */
.msg-pill { background: var(--brand, #EE964B) !important; color: var(--ink-on-brand, #2B1A0A) !important; border-radius: 999px; }
.bb-item .msg-pill { min-width: 20px; height: 20px; line-height: 20px; font-size: 12px; box-shadow: 0 0 0 2px var(--surface, #fff); }

/* ---------- Accueil sur ordinateur (épuré le 28/11) : à droite, messagerie, À compléter,
   Derniers dossiers et Dossiers en alerte, l'un sous l'autre (messagerie masquée sur téléphone) ---------- */
@media only screen and (min-width: 769px) {
  .hm-side { display: flex; flex-direction: column; gap: 14px; }
  .hm-side .hm-pair { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------- Mon planning (28/11/2026) : boutons en haut à droite, filtres repliés aussi sur ordinateur ---------- */
body.mf-desk .mf-toggle { display: inline-flex; align-items: center; gap: 6px; }
body.mf-desk .mf-toggle .material-icons { margin: 0; }
body.mf-desk .mf-toggle .mf-count { background: var(--brand, #EE964B); color: var(--ink-on-brand, #2B1A0A); border-radius: 999px; padding: 0 7px; font-size: .8rem; font-weight: 700; line-height: 1.5; }
body.mf-desk.mf-ready:not(.mf-open) .mf-hide { display: none !important; }
.mp-head .mp-ln-i { display: none; }
.mp-head .mp-head-actions { align-items: center; }
@media (max-width: 768px) {
  .mp-head .mp-de, .mp-head .mp-ln { display: none; }
  .mp-head .mp-ln-i { display: inline; }
  .mp-head h2 { white-space: nowrap; }
  .page-head .mp-head-actions { position: static; flex: 1 1 100%; flex-wrap: nowrap; gap: 8px; margin: 0; }
  .page-head .mp-head-actions .pl-trash { position: absolute; top: 0; right: 0; }
  .mp-head-actions > .btn:not(.pl-trash) { flex: 1 1 0; min-width: 0; height: 38px; margin: 0; justify-content: center; }
  .mp-head-actions > .mf-toggle { flex: 0 1 auto; }
  body.mp-title-ready .mp-tools-switch { display: none; }
}
.mp-head-actions .lbl-short { display: none; }
@media (max-width: 768px) {
  .mp-head-actions .lbl-long { display: none; }
  .mp-head-actions .lbl-short { display: inline; }
  .mp-head-actions > .btn { white-space: nowrap; }
}
@media (min-width: 769px) {
  .member-head.mp-head { flex-wrap: nowrap; align-items: center; }
  .member-head.mp-head > div:first-child { flex: 1 1 auto; min-width: 0; }
  .mp-head .mp-head-actions { flex-wrap: nowrap; }
  .mp-head .mp-head-actions > .btn { white-space: nowrap; }
}

/* ---------- boutons d'affichage des plannings sur ordinateur : un picto + un mot court (28/11/2026) ----------
   Les deux listes portent l'icône « liste » ; leur nom complet reste au survol (title posé par mobile.js). */
@media (min-width: 769px) {
  .fc-toolbar .fc-button { white-space: nowrap; text-overflow: clip; }
  .fc-toolbar .fc-agendaDay-button::before, .fc-toolbar .fc-timelineDay-button::before { content: 'today'; }
  .fc-toolbar .fc-listToday-button { margin-left: 14px !important; }   /* les deux listes, un peu à part des grilles */
  .fc-toolbar .fc-agendaWeek-button::before, .fc-toolbar .fc-timelineWeek-button::before { content: 'view_week'; }
  .fc-toolbar .fc-month-button::before, .fc-toolbar .fc-timelineMonth-button::before { content: 'date_range'; }
  .fc-toolbar .fc-listToday-button::before, .fc-toolbar .fc-listWeek-button::before { content: 'view_list'; }
  .fc-toolbar .fc-agendaDay-button::before, .fc-toolbar .fc-timelineDay-button::before,
  .fc-toolbar .fc-agendaWeek-button::before, .fc-toolbar .fc-timelineWeek-button::before,
  .fc-toolbar .fc-month-button::before, .fc-toolbar .fc-timelineMonth-button::before,
  .fc-toolbar .fc-listToday-button::before, .fc-toolbar .fc-listWeek-button::before {
    font-family: 'Material Icons'; font-size: 18px; line-height: 1; vertical-align: -4px; margin-right: 5px;
    font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; text-transform: none; letter-spacing: normal;
  }
}
/* écran d'ordinateur étroit : les 4 boutons du haut ne gardent que leur picto (nom au survol) */
@media (min-width: 769px) and (max-width: 1199px) {
  .mp-head-actions .mp-lbl, .mp-head-actions .pl-trash-label, .mp-head-actions .mf-label { display: none; }
  .mp-head-actions > .btn { padding: 0 12px; }
  .mp-head-actions > .btn .material-icons.left { margin-right: 0; }
}
@media (max-width: 768px) {
  .mp-head > div:first-child { min-width: 0; max-width: 100%; }
  .mp-head h2 { overflow: hidden; text-overflow: ellipsis; padding-bottom: 8px; margin-bottom: 0; }
}
@media (max-width: 400px) { .mp-head h2 { font-size: 1.5rem; } }
